@js-joda/locale_zh 4.8.6 → 4.8.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.
- package/dist/index.esm.js +1304 -1817
- package/dist/index.js +1304 -1819
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +22 -22
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! @version @js-joda/locale - 4.8.
|
|
1
|
+
//! @version @js-joda/locale - 4.8.10
|
|
2
2
|
//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
|
|
3
3
|
//! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
4
4
|
//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
@@ -6,39 +6,31 @@
|
|
|
6
6
|
import { IllegalArgumentException, DateTimeFormatterBuilder, SignStyle, TextStyle, ChronoField, IsoFields, _, TemporalQueries, ZoneOffset, ZoneRulesProvider, ZoneId, ValueRange, DayOfWeek, ChronoUnit, IllegalStateException, LocalDate, Year, ResolverStyle, DateTimeException, IsoChronology, TemporalField, DateTimeFormatter, use } from '@js-joda/core';
|
|
7
7
|
|
|
8
8
|
function _extends() {
|
|
9
|
-
_extends = Object.assign
|
|
9
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
10
10
|
for (var i = 1; i < arguments.length; i++) {
|
|
11
11
|
var source = arguments[i];
|
|
12
|
-
|
|
13
12
|
for (var key in source) {
|
|
14
13
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15
14
|
target[key] = source[key];
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
return target;
|
|
21
19
|
};
|
|
22
|
-
|
|
23
20
|
return _extends.apply(this, arguments);
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
function _inheritsLoose(subClass, superClass) {
|
|
27
23
|
subClass.prototype = Object.create(superClass.prototype);
|
|
28
24
|
subClass.prototype.constructor = subClass;
|
|
29
|
-
|
|
30
25
|
_setPrototypeOf(subClass, superClass);
|
|
31
26
|
}
|
|
32
|
-
|
|
33
27
|
function _setPrototypeOf(o, p) {
|
|
34
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
28
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
35
29
|
o.__proto__ = p;
|
|
36
30
|
return o;
|
|
37
31
|
};
|
|
38
|
-
|
|
39
32
|
return _setPrototypeOf(o, p);
|
|
40
33
|
}
|
|
41
|
-
|
|
42
34
|
function _unsupportedIterableToArray(o, minLen) {
|
|
43
35
|
if (!o) return;
|
|
44
36
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -47,19 +39,14 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
47
39
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
48
40
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
49
41
|
}
|
|
50
|
-
|
|
51
42
|
function _arrayLikeToArray(arr, len) {
|
|
52
43
|
if (len == null || len > arr.length) len = arr.length;
|
|
53
|
-
|
|
54
44
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
55
|
-
|
|
56
45
|
return arr2;
|
|
57
46
|
}
|
|
58
|
-
|
|
59
47
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
60
48
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
61
49
|
if (it) return (it = it.call(o)).next.bind(it);
|
|
62
|
-
|
|
63
50
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
64
51
|
if (it) o = it;
|
|
65
52
|
var i = 0;
|
|
@@ -73,7 +60,6 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
73
60
|
};
|
|
74
61
|
};
|
|
75
62
|
}
|
|
76
|
-
|
|
77
63
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
78
64
|
}
|
|
79
65
|
|
|
@@ -83,83 +69,61 @@ var TextPrinterParser = function () {
|
|
|
83
69
|
this._textStyle = textStyle;
|
|
84
70
|
this._provider = provider;
|
|
85
71
|
}
|
|
86
|
-
|
|
87
72
|
var _proto = TextPrinterParser.prototype;
|
|
88
|
-
|
|
89
73
|
_proto.field = function field() {
|
|
90
74
|
return this._field;
|
|
91
75
|
};
|
|
92
|
-
|
|
93
76
|
_proto.textStyle = function textStyle() {
|
|
94
77
|
return this._textStyle;
|
|
95
78
|
};
|
|
96
|
-
|
|
97
79
|
_proto.provider = function provider() {
|
|
98
80
|
return this._provider;
|
|
99
81
|
};
|
|
100
|
-
|
|
101
82
|
_proto.print = function print(context, buf) {
|
|
102
83
|
var value = context.getValue(this._field);
|
|
103
|
-
|
|
104
84
|
if (value === null) {
|
|
105
85
|
return false;
|
|
106
86
|
}
|
|
107
|
-
|
|
108
87
|
var text = this._provider.getText(this._field, value, this._textStyle, context.locale());
|
|
109
|
-
|
|
110
88
|
if (text === null) {
|
|
111
89
|
return this._numberPrinterParser().print(context, buf);
|
|
112
90
|
}
|
|
113
|
-
|
|
114
91
|
buf.append(text);
|
|
115
92
|
return true;
|
|
116
93
|
};
|
|
117
|
-
|
|
118
94
|
_proto.parse = function parse(context, parseText, position) {
|
|
119
95
|
var length = parseText.length;
|
|
120
|
-
|
|
121
96
|
if (position < 0 || position > length) {
|
|
122
97
|
throw new IllegalArgumentException("The position is invalid: " + position);
|
|
123
98
|
}
|
|
124
|
-
|
|
125
99
|
var style = context.isStrict() ? this._textStyle : null;
|
|
126
|
-
|
|
127
100
|
var it = this._provider.getTextIterator(this._field, style, context.locale());
|
|
128
|
-
|
|
129
101
|
if (it != null) {
|
|
130
102
|
for (var _iterator = _createForOfIteratorHelperLoose(it), _step; !(_step = _iterator()).done;) {
|
|
131
103
|
var entry = _step.value;
|
|
132
104
|
var itText = entry.key;
|
|
133
|
-
|
|
134
105
|
if (context.subSequenceEquals(itText, 0, parseText, position, itText.length)) {
|
|
135
106
|
return context.setParsedField(this._field, entry.value, position, position + itText.length);
|
|
136
107
|
}
|
|
137
108
|
}
|
|
138
|
-
|
|
139
109
|
if (context.isStrict()) {
|
|
140
110
|
return ~position;
|
|
141
111
|
}
|
|
142
112
|
}
|
|
143
|
-
|
|
144
113
|
return this._numberPrinterParser().parse(context, parseText, position);
|
|
145
114
|
};
|
|
146
|
-
|
|
147
115
|
_proto._numberPrinterParser = function _numberPrinterParser() {
|
|
148
116
|
if (this._currentNumberPrinterParser == null) {
|
|
149
117
|
this._currentNumberPrinterParser = new DateTimeFormatterBuilder.NumberPrinterParser(this._field, 1, 19, SignStyle.NORMAL);
|
|
150
118
|
}
|
|
151
|
-
|
|
152
119
|
return this._currentNumberPrinterParser;
|
|
153
120
|
};
|
|
154
|
-
|
|
155
121
|
_proto.toString = function toString() {
|
|
156
122
|
if (this._textStyle === TextStyle.FULL) {
|
|
157
123
|
return "Text(" + this._field + ")";
|
|
158
124
|
}
|
|
159
|
-
|
|
160
125
|
return "Text(" + this._field + "," + this._textStyle + ")";
|
|
161
126
|
};
|
|
162
|
-
|
|
163
127
|
return TextPrinterParser;
|
|
164
128
|
}();
|
|
165
129
|
|
|
@@ -32491,8 +32455,7 @@ function cldrData(path) {
|
|
|
32491
32455
|
/*
|
|
32492
32456
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
32493
32457
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
32494
|
-
*/
|
|
32495
|
-
var createEntry = function createEntry(text, field) {
|
|
32458
|
+
*/var createEntry = function createEntry(text, field) {
|
|
32496
32459
|
return {
|
|
32497
32460
|
key: text,
|
|
32498
32461
|
value: field,
|
|
@@ -32501,11 +32464,9 @@ var createEntry = function createEntry(text, field) {
|
|
|
32501
32464
|
}
|
|
32502
32465
|
};
|
|
32503
32466
|
};
|
|
32504
|
-
|
|
32505
32467
|
var _comparator = function _comparator(obj1, obj2) {
|
|
32506
32468
|
return obj2.key.length - obj1.key.length;
|
|
32507
32469
|
};
|
|
32508
|
-
|
|
32509
32470
|
var LocaleStore = function () {
|
|
32510
32471
|
function LocaleStore(valueTextMap) {
|
|
32511
32472
|
this._valueTextMap = valueTextMap;
|
|
@@ -32516,7 +32477,6 @@ var LocaleStore = function () {
|
|
|
32516
32477
|
var list = [];
|
|
32517
32478
|
Object.keys(valueTextMap[style]).forEach(function (key) {
|
|
32518
32479
|
var value = valueTextMap[style][key];
|
|
32519
|
-
|
|
32520
32480
|
if (reverse[value] === undefined) {
|
|
32521
32481
|
reverse[value] = createEntry(value, parseInt(key));
|
|
32522
32482
|
list.push(reverse[value]);
|
|
@@ -32530,25 +32490,35 @@ var LocaleStore = function () {
|
|
|
32530
32490
|
allList.sort(_comparator);
|
|
32531
32491
|
this._parsable = map;
|
|
32532
32492
|
}
|
|
32533
|
-
|
|
32534
32493
|
var _proto = LocaleStore.prototype;
|
|
32535
|
-
|
|
32536
32494
|
_proto.getText = function getText(value, style) {
|
|
32537
32495
|
var map = this._valueTextMap[style];
|
|
32538
32496
|
return map != null ? map[value] : null;
|
|
32539
32497
|
};
|
|
32540
|
-
|
|
32541
32498
|
_proto.getTextIterator = function getTextIterator(style) {
|
|
32542
32499
|
var list = this._parsable[style];
|
|
32543
32500
|
return list != null ? list[Symbol.iterator]() : null;
|
|
32544
32501
|
};
|
|
32545
|
-
|
|
32546
32502
|
return LocaleStore;
|
|
32547
32503
|
}();
|
|
32548
32504
|
|
|
32549
32505
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
32550
32506
|
|
|
32551
|
-
|
|
32507
|
+
function getDefaultExportFromCjs (x) {
|
|
32508
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
32509
|
+
}
|
|
32510
|
+
|
|
32511
|
+
var node_mainExports = {};
|
|
32512
|
+
var node_main = {
|
|
32513
|
+
get exports(){ return node_mainExports; },
|
|
32514
|
+
set exports(v){ node_mainExports = v; },
|
|
32515
|
+
};
|
|
32516
|
+
|
|
32517
|
+
var cldrExports = {};
|
|
32518
|
+
var cldr = {
|
|
32519
|
+
get exports(){ return cldrExports; },
|
|
32520
|
+
set exports(v){ cldrExports = v; },
|
|
32521
|
+
};
|
|
32552
32522
|
|
|
32553
32523
|
/**
|
|
32554
32524
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -32562,616 +32532,554 @@ var cldr = {exports: {}};
|
|
|
32562
32532
|
*/
|
|
32563
32533
|
|
|
32564
32534
|
(function (module) {
|
|
32565
|
-
/*!
|
|
32566
|
-
|
|
32567
|
-
|
|
32568
|
-
|
|
32569
|
-
(function (root, factory) {
|
|
32570
|
-
|
|
32571
|
-
|
|
32572
|
-
|
|
32573
|
-
|
|
32574
|
-
})(commonjsGlobal, function () {
|
|
32575
|
-
|
|
32576
|
-
|
|
32577
|
-
|
|
32578
|
-
|
|
32579
|
-
|
|
32580
|
-
|
|
32581
|
-
|
|
32582
|
-
|
|
32583
|
-
|
|
32584
|
-
|
|
32585
|
-
|
|
32586
|
-
|
|
32587
|
-
|
|
32588
|
-
|
|
32589
|
-
|
|
32590
|
-
|
|
32591
|
-
|
|
32592
|
-
|
|
32593
|
-
|
|
32594
|
-
|
|
32595
|
-
|
|
32596
|
-
|
|
32597
|
-
|
|
32598
|
-
|
|
32599
|
-
|
|
32600
|
-
|
|
32601
|
-
|
|
32602
|
-
|
|
32603
|
-
|
|
32604
|
-
|
|
32605
|
-
|
|
32606
|
-
|
|
32607
|
-
|
|
32608
|
-
|
|
32609
|
-
|
|
32610
|
-
|
|
32611
|
-
|
|
32612
|
-
|
|
32613
|
-
|
|
32614
|
-
|
|
32615
|
-
|
|
32616
|
-
|
|
32617
|
-
|
|
32618
|
-
|
|
32619
|
-
|
|
32620
|
-
|
|
32621
|
-
|
|
32622
|
-
|
|
32623
|
-
|
|
32624
|
-
|
|
32625
|
-
|
|
32626
|
-
|
|
32627
|
-
|
|
32628
|
-
|
|
32629
|
-
|
|
32630
|
-
|
|
32631
|
-
|
|
32632
|
-
|
|
32633
|
-
|
|
32634
|
-
|
|
32635
|
-
|
|
32636
|
-
|
|
32637
|
-
|
|
32638
|
-
|
|
32639
|
-
|
|
32640
|
-
|
|
32641
|
-
|
|
32642
|
-
|
|
32643
|
-
|
|
32644
|
-
|
|
32645
|
-
|
|
32646
|
-
|
|
32647
|
-
|
|
32648
|
-
|
|
32649
|
-
|
|
32650
|
-
|
|
32651
|
-
|
|
32652
|
-
|
|
32653
|
-
|
|
32654
|
-
|
|
32655
|
-
|
|
32656
|
-
|
|
32657
|
-
|
|
32658
|
-
|
|
32659
|
-
|
|
32660
|
-
|
|
32661
|
-
|
|
32662
|
-
|
|
32663
|
-
|
|
32664
|
-
|
|
32665
|
-
|
|
32666
|
-
|
|
32667
|
-
|
|
32668
|
-
|
|
32669
|
-
|
|
32670
|
-
|
|
32671
|
-
|
|
32672
|
-
|
|
32673
|
-
|
|
32674
|
-
|
|
32675
|
-
|
|
32676
|
-
|
|
32677
|
-
|
|
32678
|
-
|
|
32679
|
-
|
|
32680
|
-
|
|
32681
|
-
|
|
32682
|
-
|
|
32683
|
-
|
|
32684
|
-
|
|
32685
|
-
|
|
32686
|
-
|
|
32687
|
-
|
|
32688
|
-
|
|
32689
|
-
|
|
32690
|
-
|
|
32691
|
-
|
|
32692
|
-
|
|
32693
|
-
|
|
32694
|
-
|
|
32695
|
-
|
|
32696
|
-
|
|
32697
|
-
|
|
32698
|
-
|
|
32699
|
-
|
|
32700
|
-
|
|
32701
|
-
|
|
32702
|
-
|
|
32703
|
-
|
|
32704
|
-
|
|
32705
|
-
|
|
32706
|
-
|
|
32707
|
-
|
|
32708
|
-
|
|
32709
|
-
|
|
32710
|
-
|
|
32711
|
-
|
|
32712
|
-
|
|
32713
|
-
|
|
32714
|
-
|
|
32715
|
-
|
|
32716
|
-
|
|
32717
|
-
|
|
32718
|
-
|
|
32719
|
-
|
|
32720
|
-
|
|
32721
|
-
|
|
32722
|
-
|
|
32723
|
-
|
|
32724
|
-
|
|
32725
|
-
|
|
32726
|
-
|
|
32727
|
-
|
|
32728
|
-
|
|
32729
|
-
|
|
32730
|
-
|
|
32731
|
-
|
|
32732
|
-
|
|
32733
|
-
|
|
32734
|
-
|
|
32735
|
-
|
|
32736
|
-
|
|
32737
|
-
|
|
32738
|
-
|
|
32739
|
-
|
|
32740
|
-
|
|
32741
|
-
|
|
32742
|
-
|
|
32743
|
-
|
|
32744
|
-
|
|
32745
|
-
|
|
32746
|
-
|
|
32747
|
-
|
|
32748
|
-
|
|
32749
|
-
|
|
32750
|
-
|
|
32751
|
-
|
|
32752
|
-
|
|
32753
|
-
|
|
32754
|
-
|
|
32755
|
-
|
|
32756
|
-
|
|
32757
|
-
|
|
32758
|
-
|
|
32759
|
-
|
|
32760
|
-
|
|
32761
|
-
|
|
32762
|
-
|
|
32763
|
-
|
|
32764
|
-
|
|
32765
|
-
|
|
32766
|
-
|
|
32767
|
-
|
|
32768
|
-
|
|
32769
|
-
|
|
32770
|
-
|
|
32771
|
-
|
|
32772
|
-
|
|
32773
|
-
|
|
32774
|
-
|
|
32775
|
-
|
|
32776
|
-
|
|
32777
|
-
|
|
32778
|
-
|
|
32779
|
-
|
|
32780
|
-
|
|
32781
|
-
|
|
32782
|
-
|
|
32783
|
-
|
|
32784
|
-
|
|
32785
|
-
|
|
32786
|
-
|
|
32787
|
-
|
|
32788
|
-
|
|
32789
|
-
|
|
32790
|
-
|
|
32791
|
-
|
|
32792
|
-
|
|
32793
|
-
|
|
32794
|
-
|
|
32795
|
-
|
|
32796
|
-
|
|
32797
|
-
|
|
32798
|
-
|
|
32799
|
-
|
|
32800
|
-
|
|
32801
|
-
|
|
32802
|
-
|
|
32803
|
-
|
|
32804
|
-
|
|
32805
|
-
|
|
32806
|
-
|
|
32807
|
-
|
|
32808
|
-
|
|
32809
|
-
|
|
32810
|
-
|
|
32811
|
-
|
|
32812
|
-
|
|
32813
|
-
|
|
32814
|
-
|
|
32815
|
-
|
|
32816
|
-
|
|
32817
|
-
|
|
32818
|
-
|
|
32819
|
-
|
|
32820
|
-
|
|
32821
|
-
|
|
32822
|
-
|
|
32823
|
-
|
|
32824
|
-
|
|
32825
|
-
|
|
32826
|
-
|
|
32827
|
-
|
|
32828
|
-
|
|
32829
|
-
|
|
32830
|
-
|
|
32831
|
-
|
|
32832
|
-
|
|
32833
|
-
|
|
32834
|
-
|
|
32835
|
-
|
|
32836
|
-
|
|
32837
|
-
|
|
32838
|
-
|
|
32839
|
-
|
|
32840
|
-
|
|
32841
|
-
|
|
32842
|
-
|
|
32843
|
-
|
|
32844
|
-
|
|
32845
|
-
|
|
32846
|
-
|
|
32847
|
-
|
|
32848
|
-
|
|
32849
|
-
|
|
32850
|
-
|
|
32851
|
-
|
|
32852
|
-
|
|
32853
|
-
|
|
32854
|
-
|
|
32855
|
-
|
|
32856
|
-
|
|
32857
|
-
|
|
32858
|
-
|
|
32859
|
-
|
|
32860
|
-
|
|
32861
|
-
|
|
32862
|
-
|
|
32863
|
-
|
|
32864
|
-
|
|
32865
|
-
|
|
32866
|
-
|
|
32867
|
-
|
|
32868
|
-
|
|
32869
|
-
|
|
32870
|
-
|
|
32871
|
-
|
|
32872
|
-
|
|
32873
|
-
|
|
32874
|
-
|
|
32875
|
-
|
|
32876
|
-
|
|
32877
|
-
|
|
32878
|
-
|
|
32879
|
-
|
|
32880
|
-
|
|
32881
|
-
|
|
32882
|
-
|
|
32883
|
-
|
|
32884
|
-
|
|
32885
|
-
|
|
32886
|
-
|
|
32887
|
-
|
|
32888
|
-
|
|
32889
|
-
|
|
32890
|
-
|
|
32891
|
-
|
|
32892
|
-
|
|
32893
|
-
|
|
32894
|
-
|
|
32895
|
-
|
|
32896
|
-
|
|
32897
|
-
|
|
32898
|
-
|
|
32899
|
-
|
|
32900
|
-
|
|
32901
|
-
|
|
32902
|
-
|
|
32903
|
-
|
|
32904
|
-
|
|
32905
|
-
|
|
32906
|
-
|
|
32907
|
-
|
|
32908
|
-
|
|
32909
|
-
|
|
32910
|
-
|
|
32911
|
-
|
|
32912
|
-
|
|
32913
|
-
|
|
32914
|
-
|
|
32915
|
-
|
|
32916
|
-
|
|
32917
|
-
|
|
32918
|
-
|
|
32919
|
-
|
|
32920
|
-
|
|
32921
|
-
|
|
32922
|
-
|
|
32923
|
-
|
|
32924
|
-
|
|
32925
|
-
|
|
32926
|
-
|
|
32927
|
-
|
|
32928
|
-
|
|
32929
|
-
|
|
32930
|
-
|
|
32931
|
-
|
|
32932
|
-
|
|
32933
|
-
|
|
32934
|
-
|
|
32935
|
-
|
|
32936
|
-
|
|
32937
|
-
|
|
32938
|
-
|
|
32939
|
-
|
|
32940
|
-
|
|
32941
|
-
|
|
32942
|
-
|
|
32943
|
-
|
|
32944
|
-
|
|
32945
|
-
|
|
32946
|
-
|
|
32947
|
-
|
|
32948
|
-
|
|
32949
|
-
|
|
32950
|
-
|
|
32951
|
-
|
|
32952
|
-
|
|
32953
|
-
|
|
32954
|
-
|
|
32955
|
-
|
|
32956
|
-
|
|
32957
|
-
|
|
32958
|
-
|
|
32959
|
-
|
|
32960
|
-
|
|
32961
|
-
|
|
32962
|
-
|
|
32963
|
-
|
|
32964
|
-
|
|
32965
|
-
|
|
32966
|
-
|
|
32967
|
-
|
|
32968
|
-
|
|
32969
|
-
|
|
32970
|
-
|
|
32971
|
-
|
|
32972
|
-
|
|
32973
|
-
|
|
32974
|
-
|
|
32975
|
-
|
|
32976
|
-
|
|
32977
|
-
|
|
32978
|
-
|
|
32979
|
-
|
|
32980
|
-
|
|
32981
|
-
|
|
32982
|
-
|
|
32983
|
-
|
|
32984
|
-
|
|
32985
|
-
|
|
32986
|
-
|
|
32987
|
-
|
|
32988
|
-
|
|
32989
|
-
|
|
32990
|
-
|
|
32991
|
-
|
|
32992
|
-
|
|
32993
|
-
|
|
32994
|
-
|
|
32995
|
-
|
|
32996
|
-
|
|
32997
|
-
|
|
32998
|
-
|
|
32999
|
-
|
|
33000
|
-
|
|
33001
|
-
|
|
33002
|
-
|
|
33003
|
-
|
|
33004
|
-
|
|
33005
|
-
|
|
33006
|
-
|
|
33007
|
-
|
|
33008
|
-
|
|
33009
|
-
|
|
33010
|
-
|
|
33011
|
-
|
|
33012
|
-
|
|
33013
|
-
|
|
33014
|
-
|
|
33015
|
-
|
|
33016
|
-
|
|
33017
|
-
|
|
33018
|
-
|
|
33019
|
-
|
|
33020
|
-
|
|
33021
|
-
|
|
33022
|
-
|
|
33023
|
-
|
|
33024
|
-
|
|
33025
|
-
|
|
33026
|
-
|
|
33027
|
-
|
|
33028
|
-
|
|
33029
|
-
|
|
33030
|
-
|
|
33031
|
-
|
|
33032
|
-
|
|
33033
|
-
|
|
33034
|
-
|
|
33035
|
-
|
|
33036
|
-
|
|
33037
|
-
|
|
33038
|
-
|
|
33039
|
-
|
|
33040
|
-
|
|
33041
|
-
|
|
33042
|
-
|
|
33043
|
-
|
|
33044
|
-
|
|
33045
|
-
|
|
33046
|
-
|
|
33047
|
-
|
|
33048
|
-
|
|
33049
|
-
|
|
33050
|
-
|
|
33051
|
-
|
|
33052
|
-
|
|
33053
|
-
|
|
33054
|
-
|
|
33055
|
-
|
|
33056
|
-
|
|
33057
|
-
|
|
33058
|
-
|
|
33059
|
-
|
|
33060
|
-
|
|
33061
|
-
|
|
33062
|
-
|
|
33063
|
-
|
|
33064
|
-
|
|
33065
|
-
|
|
33066
|
-
|
|
33067
|
-
|
|
33068
|
-
|
|
33069
|
-
|
|
33070
|
-
|
|
33071
|
-
|
|
33072
|
-
|
|
33073
|
-
|
|
33074
|
-
|
|
33075
|
-
|
|
33076
|
-
|
|
33077
|
-
|
|
33078
|
-
|
|
33079
|
-
|
|
33080
|
-
|
|
33081
|
-
|
|
33082
|
-
|
|
33083
|
-
|
|
33084
|
-
|
|
33085
|
-
|
|
33086
|
-
|
|
33087
|
-
|
|
33088
|
-
|
|
33089
|
-
|
|
33090
|
-
|
|
33091
|
-
|
|
33092
|
-
|
|
33093
|
-
|
|
33094
|
-
|
|
33095
|
-
|
|
33096
|
-
|
|
33097
|
-
|
|
33098
|
-
|
|
33099
|
-
|
|
33100
|
-
|
|
33101
|
-
|
|
33102
|
-
|
|
33103
|
-
|
|
33104
|
-
|
|
33105
|
-
|
|
33106
|
-
|
|
33107
|
-
|
|
33108
|
-
|
|
33109
|
-
|
|
33110
|
-
|
|
33111
|
-
|
|
33112
|
-
|
|
33113
|
-
}) || subtags;
|
|
33114
|
-
language = maxLanguageId[0];
|
|
33115
|
-
script = maxLanguageId[1];
|
|
33116
|
-
territory = maxLanguageId[2];
|
|
33117
|
-
minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep); // Set attributes
|
|
33118
|
-
|
|
33119
|
-
this.attributes = attributes = {
|
|
33120
|
-
bundle: bundleLookup(Cldr, this, minLanguageId),
|
|
33121
|
-
// Unicode Language Id
|
|
33122
|
-
minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
|
|
33123
|
-
maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
|
|
33124
|
-
// Unicode Language Id Subtabs
|
|
33125
|
-
language: language,
|
|
33126
|
-
script: script,
|
|
33127
|
-
territory: territory,
|
|
33128
|
-
region: territory,
|
|
33129
|
-
|
|
33130
|
-
/* alias */
|
|
33131
|
-
variant: variant
|
|
33132
|
-
}; // Unicode locale extensions.
|
|
33133
|
-
|
|
33134
|
-
unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
|
|
33135
|
-
if (key) {
|
|
33136
|
-
// Extension is in the `keyword` form.
|
|
33137
|
-
attributes["u" + key] = type;
|
|
33138
|
-
} else {
|
|
33139
|
-
// Extension is in the `attribute` form.
|
|
33140
|
-
attributes["u" + attribute] = true;
|
|
33141
|
-
}
|
|
33142
|
-
});
|
|
33143
|
-
this.locale = locale;
|
|
33144
|
-
};
|
|
33145
|
-
/**
|
|
33146
|
-
* .get()
|
|
33147
|
-
*/
|
|
33148
|
-
|
|
33149
|
-
|
|
33150
|
-
Cldr.prototype.get = function (path) {
|
|
33151
|
-
validatePresence(path, "path");
|
|
33152
|
-
validateTypePath(path, "path");
|
|
33153
|
-
return itemGetResolved(Cldr, path, this.attributes);
|
|
33154
|
-
};
|
|
33155
|
-
/**
|
|
33156
|
-
* .main()
|
|
33157
|
-
*/
|
|
33158
|
-
|
|
33159
|
-
|
|
33160
|
-
Cldr.prototype.main = function (path) {
|
|
33161
|
-
validatePresence(path, "path");
|
|
33162
|
-
validateTypePath(path, "path");
|
|
33163
|
-
validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
|
|
33164
|
-
locale: this.locale
|
|
33165
|
-
});
|
|
33166
|
-
path = alwaysArray(path);
|
|
33167
|
-
return this.get(["main/{bundle}"].concat(path));
|
|
33168
|
-
};
|
|
33169
|
-
|
|
33170
|
-
return Cldr;
|
|
33171
|
-
});
|
|
33172
|
-
}(cldr));
|
|
33173
|
-
|
|
33174
|
-
var event = {exports: {}};
|
|
32535
|
+
/*!
|
|
32536
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
32537
|
+
* http://git.io/h4lmVg
|
|
32538
|
+
*/
|
|
32539
|
+
(function (root, factory) {
|
|
32540
|
+
{
|
|
32541
|
+
// Node. CommonJS.
|
|
32542
|
+
module.exports = factory();
|
|
32543
|
+
}
|
|
32544
|
+
})(commonjsGlobal, function () {
|
|
32545
|
+
var arrayIsArray = Array.isArray || function (obj) {
|
|
32546
|
+
return Object.prototype.toString.call(obj) === "[object Array]";
|
|
32547
|
+
};
|
|
32548
|
+
var pathNormalize = function (path, attributes) {
|
|
32549
|
+
if (arrayIsArray(path)) {
|
|
32550
|
+
path = path.join("/");
|
|
32551
|
+
}
|
|
32552
|
+
if (typeof path !== "string") {
|
|
32553
|
+
throw new Error("invalid path \"" + path + "\"");
|
|
32554
|
+
}
|
|
32555
|
+
// 1: Ignore leading slash `/`
|
|
32556
|
+
// 2: Ignore leading `cldr/`
|
|
32557
|
+
path = path.replace(/^\//, "") /* 1 */.replace(/^cldr\//, ""); /* 2 */
|
|
32558
|
+
|
|
32559
|
+
// Replace {attribute}'s
|
|
32560
|
+
path = path.replace(/{[a-zA-Z]+}/g, function (name) {
|
|
32561
|
+
name = name.replace(/^{([^}]*)}$/, "$1");
|
|
32562
|
+
return attributes[name];
|
|
32563
|
+
});
|
|
32564
|
+
return path.split("/");
|
|
32565
|
+
};
|
|
32566
|
+
var arraySome = function (array, callback) {
|
|
32567
|
+
var i, length;
|
|
32568
|
+
if (array.some) {
|
|
32569
|
+
return array.some(callback);
|
|
32570
|
+
}
|
|
32571
|
+
for (i = 0, length = array.length; i < length; i++) {
|
|
32572
|
+
if (callback(array[i], i, array)) {
|
|
32573
|
+
return true;
|
|
32574
|
+
}
|
|
32575
|
+
}
|
|
32576
|
+
return false;
|
|
32577
|
+
};
|
|
32578
|
+
|
|
32579
|
+
/**
|
|
32580
|
+
* Return the maximized language id as defined in
|
|
32581
|
+
* http://www.unicode.org/reports/tr35/#Likely_Subtags
|
|
32582
|
+
* 1. Canonicalize.
|
|
32583
|
+
* 1.1 Make sure the input locale is in canonical form: uses the right
|
|
32584
|
+
* separator, and has the right casing.
|
|
32585
|
+
* TODO Right casing? What df? It seems languages are lowercase, scripts are
|
|
32586
|
+
* Capitalized, territory is uppercase. I am leaving this as an exercise to
|
|
32587
|
+
* the user.
|
|
32588
|
+
*
|
|
32589
|
+
* 1.2 Replace any deprecated subtags with their canonical values using the
|
|
32590
|
+
* <alias> data in supplemental metadata. Use the first value in the
|
|
32591
|
+
* replacement list, if it exists. Language tag replacements may have multiple
|
|
32592
|
+
* parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the
|
|
32593
|
+
* original script and/or region are retained if there is one. Thus
|
|
32594
|
+
* "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ".
|
|
32595
|
+
* TODO What <alias> data?
|
|
32596
|
+
*
|
|
32597
|
+
* 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
|
|
32598
|
+
* type="choice"> in the supplemental data), then return it.
|
|
32599
|
+
* TODO grandfathered?
|
|
32600
|
+
*
|
|
32601
|
+
* 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
|
|
32602
|
+
* 1.5 Get the components of the cleaned-up source tag (languages, scripts,
|
|
32603
|
+
* and regions), plus any variants and extensions.
|
|
32604
|
+
* 2. Lookup. Lookup each of the following in order, and stop on the first
|
|
32605
|
+
* match:
|
|
32606
|
+
* 2.1 languages_scripts_regions
|
|
32607
|
+
* 2.2 languages_regions
|
|
32608
|
+
* 2.3 languages_scripts
|
|
32609
|
+
* 2.4 languages
|
|
32610
|
+
* 2.5 und_scripts
|
|
32611
|
+
* 3. Return
|
|
32612
|
+
* 3.1 If there is no match, either return an error value, or the match for
|
|
32613
|
+
* "und" (in APIs where a valid language tag is required).
|
|
32614
|
+
* 3.2 Otherwise there is a match = languagem_scriptm_regionm
|
|
32615
|
+
* 3.3 Let xr = xs if xs is not empty, and xm otherwise.
|
|
32616
|
+
* 3.4 Return the language tag composed of languager _ scriptr _ regionr +
|
|
32617
|
+
* variants + extensions.
|
|
32618
|
+
*
|
|
32619
|
+
* @subtags [Array] normalized language id subtags tuple (see init.js).
|
|
32620
|
+
*/
|
|
32621
|
+
var coreLikelySubtags = function (Cldr, cldr, subtags, options) {
|
|
32622
|
+
var match,
|
|
32623
|
+
matchFound,
|
|
32624
|
+
language = subtags[0],
|
|
32625
|
+
script = subtags[1],
|
|
32626
|
+
sep = Cldr.localeSep,
|
|
32627
|
+
territory = subtags[2],
|
|
32628
|
+
variants = subtags.slice(3, 4);
|
|
32629
|
+
options = options || {};
|
|
32630
|
+
|
|
32631
|
+
// Skip if (language, script, territory) is not empty [3.3]
|
|
32632
|
+
if (language !== "und" && script !== "Zzzz" && territory !== "ZZ") {
|
|
32633
|
+
return [language, script, territory].concat(variants);
|
|
32634
|
+
}
|
|
32635
|
+
|
|
32636
|
+
// Skip if no supplemental likelySubtags data is present
|
|
32637
|
+
if (typeof cldr.get("supplemental/likelySubtags") === "undefined") {
|
|
32638
|
+
return;
|
|
32639
|
+
}
|
|
32640
|
+
|
|
32641
|
+
// [2]
|
|
32642
|
+
matchFound = arraySome([[language, script, territory], [language, territory], [language, script], [language], ["und", script]], function (test) {
|
|
32643
|
+
return match = !/\b(Zzzz|ZZ)\b/.test(test.join(sep)) /* [1.4] */ && cldr.get(["supplemental/likelySubtags", test.join(sep)]);
|
|
32644
|
+
});
|
|
32645
|
+
|
|
32646
|
+
// [3]
|
|
32647
|
+
if (matchFound) {
|
|
32648
|
+
// [3.2 .. 3.4]
|
|
32649
|
+
match = match.split(sep);
|
|
32650
|
+
return [language !== "und" ? language : match[0], script !== "Zzzz" ? script : match[1], territory !== "ZZ" ? territory : match[2]].concat(variants);
|
|
32651
|
+
} else if (options.force) {
|
|
32652
|
+
// [3.1.2]
|
|
32653
|
+
return cldr.get("supplemental/likelySubtags/und").split(sep);
|
|
32654
|
+
} else {
|
|
32655
|
+
// [3.1.1]
|
|
32656
|
+
return;
|
|
32657
|
+
}
|
|
32658
|
+
};
|
|
32659
|
+
|
|
32660
|
+
/**
|
|
32661
|
+
* Given a locale, remove any fields that Add Likely Subtags would add.
|
|
32662
|
+
* http://www.unicode.org/reports/tr35/#Likely_Subtags
|
|
32663
|
+
* 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
|
|
32664
|
+
* return it.
|
|
32665
|
+
* 2. Remove the variants from max.
|
|
32666
|
+
* 3. Then for trial in {language, language _ region, language _ script}. If
|
|
32667
|
+
* AddLikelySubtags(trial) = max, then return trial + variants.
|
|
32668
|
+
* 4. If you do not get a match, return max + variants.
|
|
32669
|
+
*
|
|
32670
|
+
* @maxLanguageId [Array] maxLanguageId tuple (see init.js).
|
|
32671
|
+
*/
|
|
32672
|
+
var coreRemoveLikelySubtags = function (Cldr, cldr, maxLanguageId) {
|
|
32673
|
+
var match,
|
|
32674
|
+
matchFound,
|
|
32675
|
+
language = maxLanguageId[0],
|
|
32676
|
+
script = maxLanguageId[1],
|
|
32677
|
+
territory = maxLanguageId[2],
|
|
32678
|
+
variants = maxLanguageId[3];
|
|
32679
|
+
|
|
32680
|
+
// [3]
|
|
32681
|
+
matchFound = arraySome([[[language, "Zzzz", "ZZ"], [language]], [[language, "Zzzz", territory], [language, territory]], [[language, script, "ZZ"], [language, script]]], function (test) {
|
|
32682
|
+
var result = coreLikelySubtags(Cldr, cldr, test[0]);
|
|
32683
|
+
match = test[1];
|
|
32684
|
+
return result && result[0] === maxLanguageId[0] && result[1] === maxLanguageId[1] && result[2] === maxLanguageId[2];
|
|
32685
|
+
});
|
|
32686
|
+
if (matchFound) {
|
|
32687
|
+
if (variants) {
|
|
32688
|
+
match.push(variants);
|
|
32689
|
+
}
|
|
32690
|
+
return match;
|
|
32691
|
+
}
|
|
32692
|
+
|
|
32693
|
+
// [4]
|
|
32694
|
+
return maxLanguageId;
|
|
32695
|
+
};
|
|
32696
|
+
|
|
32697
|
+
/**
|
|
32698
|
+
* subtags( locale )
|
|
32699
|
+
*
|
|
32700
|
+
* @locale [String]
|
|
32701
|
+
*/
|
|
32702
|
+
var coreSubtags = function (locale) {
|
|
32703
|
+
var aux,
|
|
32704
|
+
unicodeLanguageId,
|
|
32705
|
+
subtags = [];
|
|
32706
|
+
locale = locale.replace(/_/, "-");
|
|
32707
|
+
|
|
32708
|
+
// Unicode locale extensions.
|
|
32709
|
+
aux = locale.split("-u-");
|
|
32710
|
+
if (aux[1]) {
|
|
32711
|
+
aux[1] = aux[1].split("-t-");
|
|
32712
|
+
locale = aux[0] + (aux[1][1] ? "-t-" + aux[1][1] : "");
|
|
32713
|
+
subtags[4 /* unicodeLocaleExtensions */] = aux[1][0];
|
|
32714
|
+
}
|
|
32715
|
+
|
|
32716
|
+
// TODO normalize transformed extensions. Currently, skipped.
|
|
32717
|
+
// subtags[ x ] = locale.split( "-t-" )[ 1 ];
|
|
32718
|
+
unicodeLanguageId = locale.split("-t-")[0];
|
|
32719
|
+
|
|
32720
|
+
// unicode_language_id = "root"
|
|
32721
|
+
// | unicode_language_subtag
|
|
32722
|
+
// (sep unicode_script_subtag)?
|
|
32723
|
+
// (sep unicode_region_subtag)?
|
|
32724
|
+
// (sep unicode_variant_subtag)* ;
|
|
32725
|
+
//
|
|
32726
|
+
// Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
|
|
32727
|
+
aux = unicodeLanguageId.match(/^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/);
|
|
32728
|
+
if (aux === null) {
|
|
32729
|
+
return ["und", "Zzzz", "ZZ"];
|
|
32730
|
+
}
|
|
32731
|
+
subtags[0 /* language */] = aux[10] /* root */ || aux[2] || "und";
|
|
32732
|
+
subtags[1 /* script */] = aux[4] || "Zzzz";
|
|
32733
|
+
subtags[2 /* territory */] = aux[6] || "ZZ";
|
|
32734
|
+
if (aux[7] && aux[7].length) {
|
|
32735
|
+
subtags[3 /* variant */] = aux[7].slice(1) /* remove leading "-" */;
|
|
32736
|
+
}
|
|
32737
|
+
|
|
32738
|
+
// 0: language
|
|
32739
|
+
// 1: script
|
|
32740
|
+
// 2: territory (aka region)
|
|
32741
|
+
// 3: variant
|
|
32742
|
+
// 4: unicodeLocaleExtensions
|
|
32743
|
+
return subtags;
|
|
32744
|
+
};
|
|
32745
|
+
var arrayForEach = function (array, callback) {
|
|
32746
|
+
var i, length;
|
|
32747
|
+
if (array.forEach) {
|
|
32748
|
+
return array.forEach(callback);
|
|
32749
|
+
}
|
|
32750
|
+
for (i = 0, length = array.length; i < length; i++) {
|
|
32751
|
+
callback(array[i], i, array);
|
|
32752
|
+
}
|
|
32753
|
+
};
|
|
32754
|
+
|
|
32755
|
+
/**
|
|
32756
|
+
* bundleLookup( minLanguageId )
|
|
32757
|
+
*
|
|
32758
|
+
* @Cldr [Cldr class]
|
|
32759
|
+
*
|
|
32760
|
+
* @cldr [Cldr instance]
|
|
32761
|
+
*
|
|
32762
|
+
* @minLanguageId [String] requested languageId after applied remove likely subtags.
|
|
32763
|
+
*/
|
|
32764
|
+
var bundleLookup = function (Cldr, cldr, minLanguageId) {
|
|
32765
|
+
var availableBundleMap = Cldr._availableBundleMap,
|
|
32766
|
+
availableBundleMapQueue = Cldr._availableBundleMapQueue;
|
|
32767
|
+
if (availableBundleMapQueue.length) {
|
|
32768
|
+
arrayForEach(availableBundleMapQueue, function (bundle, i) {
|
|
32769
|
+
var existing, maxBundle, minBundle, subtags;
|
|
32770
|
+
subtags = coreSubtags(bundle);
|
|
32771
|
+
maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
|
|
32772
|
+
if (maxBundle === undefined) {
|
|
32773
|
+
availableBundleMapQueue.splice(i, 1);
|
|
32774
|
+
throw new Error("Could not find likelySubtags for " + bundle);
|
|
32775
|
+
}
|
|
32776
|
+
minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
|
|
32777
|
+
minBundle = minBundle.join(Cldr.localeSep);
|
|
32778
|
+
existing = availableBundleMap[minBundle];
|
|
32779
|
+
if (existing && existing.length < bundle.length) {
|
|
32780
|
+
return;
|
|
32781
|
+
}
|
|
32782
|
+
availableBundleMap[minBundle] = bundle;
|
|
32783
|
+
});
|
|
32784
|
+
Cldr._availableBundleMapQueue = [];
|
|
32785
|
+
}
|
|
32786
|
+
return availableBundleMap[minLanguageId] || null;
|
|
32787
|
+
};
|
|
32788
|
+
var objectKeys = function (object) {
|
|
32789
|
+
var i,
|
|
32790
|
+
result = [];
|
|
32791
|
+
if (Object.keys) {
|
|
32792
|
+
return Object.keys(object);
|
|
32793
|
+
}
|
|
32794
|
+
for (i in object) {
|
|
32795
|
+
result.push(i);
|
|
32796
|
+
}
|
|
32797
|
+
return result;
|
|
32798
|
+
};
|
|
32799
|
+
var createError = function (code, attributes) {
|
|
32800
|
+
var error, message;
|
|
32801
|
+
message = code + (attributes && JSON ? ": " + JSON.stringify(attributes) : "");
|
|
32802
|
+
error = new Error(message);
|
|
32803
|
+
error.code = code;
|
|
32804
|
+
|
|
32805
|
+
// extend( error, attributes );
|
|
32806
|
+
arrayForEach(objectKeys(attributes), function (attribute) {
|
|
32807
|
+
error[attribute] = attributes[attribute];
|
|
32808
|
+
});
|
|
32809
|
+
return error;
|
|
32810
|
+
};
|
|
32811
|
+
var validate = function (code, check, attributes) {
|
|
32812
|
+
if (!check) {
|
|
32813
|
+
throw createError(code, attributes);
|
|
32814
|
+
}
|
|
32815
|
+
};
|
|
32816
|
+
var validatePresence = function (value, name) {
|
|
32817
|
+
validate("E_MISSING_PARAMETER", typeof value !== "undefined", {
|
|
32818
|
+
name: name
|
|
32819
|
+
});
|
|
32820
|
+
};
|
|
32821
|
+
var validateType = function (value, name, check, expected) {
|
|
32822
|
+
validate("E_INVALID_PAR_TYPE", check, {
|
|
32823
|
+
expected: expected,
|
|
32824
|
+
name: name,
|
|
32825
|
+
value: value
|
|
32826
|
+
});
|
|
32827
|
+
};
|
|
32828
|
+
var validateTypePath = function (value, name) {
|
|
32829
|
+
validateType(value, name, typeof value === "string" || arrayIsArray(value), "String or Array");
|
|
32830
|
+
};
|
|
32831
|
+
|
|
32832
|
+
/**
|
|
32833
|
+
* Function inspired by jQuery Core, but reduced to our use case.
|
|
32834
|
+
*/
|
|
32835
|
+
var isPlainObject = function (obj) {
|
|
32836
|
+
return obj !== null && "" + obj === "[object Object]";
|
|
32837
|
+
};
|
|
32838
|
+
var validateTypePlainObject = function (value, name) {
|
|
32839
|
+
validateType(value, name, typeof value === "undefined" || isPlainObject(value), "Plain Object");
|
|
32840
|
+
};
|
|
32841
|
+
var validateTypeString = function (value, name) {
|
|
32842
|
+
validateType(value, name, typeof value === "string", "a string");
|
|
32843
|
+
};
|
|
32844
|
+
|
|
32845
|
+
// @path: normalized path
|
|
32846
|
+
var resourceGet = function (data, path) {
|
|
32847
|
+
var i,
|
|
32848
|
+
node = data,
|
|
32849
|
+
length = path.length;
|
|
32850
|
+
for (i = 0; i < length - 1; i++) {
|
|
32851
|
+
node = node[path[i]];
|
|
32852
|
+
if (!node) {
|
|
32853
|
+
return undefined;
|
|
32854
|
+
}
|
|
32855
|
+
}
|
|
32856
|
+
return node[path[i]];
|
|
32857
|
+
};
|
|
32858
|
+
|
|
32859
|
+
/**
|
|
32860
|
+
* setAvailableBundles( Cldr, json )
|
|
32861
|
+
*
|
|
32862
|
+
* @Cldr [Cldr class]
|
|
32863
|
+
*
|
|
32864
|
+
* @json resolved/unresolved cldr data.
|
|
32865
|
+
*
|
|
32866
|
+
* Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
|
|
32867
|
+
*/
|
|
32868
|
+
var coreSetAvailableBundles = function (Cldr, json) {
|
|
32869
|
+
var bundle,
|
|
32870
|
+
availableBundleMapQueue = Cldr._availableBundleMapQueue,
|
|
32871
|
+
main = resourceGet(json, ["main"]);
|
|
32872
|
+
if (main) {
|
|
32873
|
+
for (bundle in main) {
|
|
32874
|
+
if (main.hasOwnProperty(bundle) && bundle !== "root" && availableBundleMapQueue.indexOf(bundle) === -1) {
|
|
32875
|
+
availableBundleMapQueue.push(bundle);
|
|
32876
|
+
}
|
|
32877
|
+
}
|
|
32878
|
+
}
|
|
32879
|
+
};
|
|
32880
|
+
var alwaysArray = function (somethingOrArray) {
|
|
32881
|
+
return arrayIsArray(somethingOrArray) ? somethingOrArray : [somethingOrArray];
|
|
32882
|
+
};
|
|
32883
|
+
var jsonMerge = function () {
|
|
32884
|
+
// Returns new deeply merged JSON.
|
|
32885
|
+
//
|
|
32886
|
+
// Eg.
|
|
32887
|
+
// merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
|
|
32888
|
+
// -> { a: { b: 3, c: 2, d: 4 } }
|
|
32889
|
+
//
|
|
32890
|
+
// @arguments JSON's
|
|
32891
|
+
//
|
|
32892
|
+
var merge = function () {
|
|
32893
|
+
var destination = {},
|
|
32894
|
+
sources = [].slice.call(arguments, 0);
|
|
32895
|
+
arrayForEach(sources, function (source) {
|
|
32896
|
+
var prop;
|
|
32897
|
+
for (prop in source) {
|
|
32898
|
+
if (prop in destination && typeof destination[prop] === "object" && !arrayIsArray(destination[prop])) {
|
|
32899
|
+
// Merge Objects
|
|
32900
|
+
destination[prop] = merge(destination[prop], source[prop]);
|
|
32901
|
+
} else {
|
|
32902
|
+
// Set new values
|
|
32903
|
+
destination[prop] = source[prop];
|
|
32904
|
+
}
|
|
32905
|
+
}
|
|
32906
|
+
});
|
|
32907
|
+
return destination;
|
|
32908
|
+
};
|
|
32909
|
+
return merge;
|
|
32910
|
+
}();
|
|
32911
|
+
|
|
32912
|
+
/**
|
|
32913
|
+
* load( Cldr, source, jsons )
|
|
32914
|
+
*
|
|
32915
|
+
* @Cldr [Cldr class]
|
|
32916
|
+
*
|
|
32917
|
+
* @source [Object]
|
|
32918
|
+
*
|
|
32919
|
+
* @jsons [arguments]
|
|
32920
|
+
*/
|
|
32921
|
+
var coreLoad = function (Cldr, source, jsons) {
|
|
32922
|
+
var i, j, json;
|
|
32923
|
+
validatePresence(jsons[0], "json");
|
|
32924
|
+
|
|
32925
|
+
// Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
|
|
32926
|
+
for (i = 0; i < jsons.length; i++) {
|
|
32927
|
+
// Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
|
|
32928
|
+
json = alwaysArray(jsons[i]);
|
|
32929
|
+
for (j = 0; j < json.length; j++) {
|
|
32930
|
+
validateTypePlainObject(json[j], "json");
|
|
32931
|
+
source = jsonMerge(source, json[j]);
|
|
32932
|
+
coreSetAvailableBundles(Cldr, json[j]);
|
|
32933
|
+
}
|
|
32934
|
+
}
|
|
32935
|
+
return source;
|
|
32936
|
+
};
|
|
32937
|
+
var itemGetResolved = function (Cldr, path, attributes) {
|
|
32938
|
+
// Resolve path
|
|
32939
|
+
var normalizedPath = pathNormalize(path, attributes);
|
|
32940
|
+
return resourceGet(Cldr._resolved, normalizedPath);
|
|
32941
|
+
};
|
|
32942
|
+
|
|
32943
|
+
/**
|
|
32944
|
+
* new Cldr()
|
|
32945
|
+
*/
|
|
32946
|
+
var Cldr = function (locale) {
|
|
32947
|
+
this.init(locale);
|
|
32948
|
+
};
|
|
32949
|
+
|
|
32950
|
+
// Build optimization hack to avoid duplicating functions across modules.
|
|
32951
|
+
Cldr._alwaysArray = alwaysArray;
|
|
32952
|
+
Cldr._coreLoad = coreLoad;
|
|
32953
|
+
Cldr._createError = createError;
|
|
32954
|
+
Cldr._itemGetResolved = itemGetResolved;
|
|
32955
|
+
Cldr._jsonMerge = jsonMerge;
|
|
32956
|
+
Cldr._pathNormalize = pathNormalize;
|
|
32957
|
+
Cldr._resourceGet = resourceGet;
|
|
32958
|
+
Cldr._validatePresence = validatePresence;
|
|
32959
|
+
Cldr._validateType = validateType;
|
|
32960
|
+
Cldr._validateTypePath = validateTypePath;
|
|
32961
|
+
Cldr._validateTypePlainObject = validateTypePlainObject;
|
|
32962
|
+
Cldr._availableBundleMap = {};
|
|
32963
|
+
Cldr._availableBundleMapQueue = [];
|
|
32964
|
+
Cldr._resolved = {};
|
|
32965
|
+
|
|
32966
|
+
// Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set.
|
|
32967
|
+
Cldr.localeSep = "-";
|
|
32968
|
+
|
|
32969
|
+
/**
|
|
32970
|
+
* Cldr.load( json [, json, ...] )
|
|
32971
|
+
*
|
|
32972
|
+
* @json [JSON] CLDR data or [Array] Array of @json's.
|
|
32973
|
+
*
|
|
32974
|
+
* Load resolved cldr data.
|
|
32975
|
+
*/
|
|
32976
|
+
Cldr.load = function () {
|
|
32977
|
+
Cldr._resolved = coreLoad(Cldr, Cldr._resolved, arguments);
|
|
32978
|
+
};
|
|
32979
|
+
|
|
32980
|
+
/**
|
|
32981
|
+
* .init() automatically run on instantiation/construction.
|
|
32982
|
+
*/
|
|
32983
|
+
Cldr.prototype.init = function (locale) {
|
|
32984
|
+
var attributes,
|
|
32985
|
+
language,
|
|
32986
|
+
maxLanguageId,
|
|
32987
|
+
minLanguageId,
|
|
32988
|
+
script,
|
|
32989
|
+
subtags,
|
|
32990
|
+
territory,
|
|
32991
|
+
unicodeLocaleExtensions,
|
|
32992
|
+
variant,
|
|
32993
|
+
sep = Cldr.localeSep,
|
|
32994
|
+
unicodeLocaleExtensionsRaw = "";
|
|
32995
|
+
validatePresence(locale, "locale");
|
|
32996
|
+
validateTypeString(locale, "locale");
|
|
32997
|
+
subtags = coreSubtags(locale);
|
|
32998
|
+
if (subtags.length === 5) {
|
|
32999
|
+
unicodeLocaleExtensions = subtags.pop();
|
|
33000
|
+
unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions;
|
|
33001
|
+
// Remove trailing null when there is unicodeLocaleExtensions but no variants.
|
|
33002
|
+
if (!subtags[3]) {
|
|
33003
|
+
subtags.pop();
|
|
33004
|
+
}
|
|
33005
|
+
}
|
|
33006
|
+
variant = subtags[3];
|
|
33007
|
+
|
|
33008
|
+
// Normalize locale code.
|
|
33009
|
+
// Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
|
|
33010
|
+
// Get the variant subtags (calendar, collation, currency, etc).
|
|
33011
|
+
// refs:
|
|
33012
|
+
// - http://www.unicode.org/reports/tr35/#Field_Definitions
|
|
33013
|
+
// - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
|
|
33014
|
+
// - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
|
|
33015
|
+
|
|
33016
|
+
// When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
|
|
33017
|
+
maxLanguageId = coreLikelySubtags(Cldr, this, subtags, {
|
|
33018
|
+
force: true
|
|
33019
|
+
}) || subtags;
|
|
33020
|
+
language = maxLanguageId[0];
|
|
33021
|
+
script = maxLanguageId[1];
|
|
33022
|
+
territory = maxLanguageId[2];
|
|
33023
|
+
minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep);
|
|
33024
|
+
|
|
33025
|
+
// Set attributes
|
|
33026
|
+
this.attributes = attributes = {
|
|
33027
|
+
bundle: bundleLookup(Cldr, this, minLanguageId),
|
|
33028
|
+
// Unicode Language Id
|
|
33029
|
+
minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
|
|
33030
|
+
maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
|
|
33031
|
+
// Unicode Language Id Subtabs
|
|
33032
|
+
language: language,
|
|
33033
|
+
script: script,
|
|
33034
|
+
territory: territory,
|
|
33035
|
+
region: territory,
|
|
33036
|
+
/* alias */
|
|
33037
|
+
variant: variant
|
|
33038
|
+
};
|
|
33039
|
+
|
|
33040
|
+
// Unicode locale extensions.
|
|
33041
|
+
unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
|
|
33042
|
+
if (key) {
|
|
33043
|
+
// Extension is in the `keyword` form.
|
|
33044
|
+
attributes["u" + key] = type;
|
|
33045
|
+
} else {
|
|
33046
|
+
// Extension is in the `attribute` form.
|
|
33047
|
+
attributes["u" + attribute] = true;
|
|
33048
|
+
}
|
|
33049
|
+
});
|
|
33050
|
+
this.locale = locale;
|
|
33051
|
+
};
|
|
33052
|
+
|
|
33053
|
+
/**
|
|
33054
|
+
* .get()
|
|
33055
|
+
*/
|
|
33056
|
+
Cldr.prototype.get = function (path) {
|
|
33057
|
+
validatePresence(path, "path");
|
|
33058
|
+
validateTypePath(path, "path");
|
|
33059
|
+
return itemGetResolved(Cldr, path, this.attributes);
|
|
33060
|
+
};
|
|
33061
|
+
|
|
33062
|
+
/**
|
|
33063
|
+
* .main()
|
|
33064
|
+
*/
|
|
33065
|
+
Cldr.prototype.main = function (path) {
|
|
33066
|
+
validatePresence(path, "path");
|
|
33067
|
+
validateTypePath(path, "path");
|
|
33068
|
+
validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
|
|
33069
|
+
locale: this.locale
|
|
33070
|
+
});
|
|
33071
|
+
path = alwaysArray(path);
|
|
33072
|
+
return this.get(["main/{bundle}"].concat(path));
|
|
33073
|
+
};
|
|
33074
|
+
return Cldr;
|
|
33075
|
+
});
|
|
33076
|
+
} (cldr));
|
|
33077
|
+
|
|
33078
|
+
var eventExports = {};
|
|
33079
|
+
var event = {
|
|
33080
|
+
get exports(){ return eventExports; },
|
|
33081
|
+
set exports(v){ eventExports = v; },
|
|
33082
|
+
};
|
|
33175
33083
|
|
|
33176
33084
|
/**
|
|
33177
33085
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -33185,580 +33093,529 @@ var event = {exports: {}};
|
|
|
33185
33093
|
*/
|
|
33186
33094
|
|
|
33187
33095
|
(function (module) {
|
|
33188
|
-
/*!
|
|
33189
|
-
|
|
33190
|
-
|
|
33191
|
-
|
|
33192
|
-
(function (factory) {
|
|
33193
|
-
|
|
33194
|
-
|
|
33195
|
-
|
|
33196
|
-
|
|
33197
|
-
})(function (Cldr) {
|
|
33198
|
-
|
|
33199
|
-
|
|
33200
|
-
|
|
33201
|
-
|
|
33202
|
-
|
|
33203
|
-
|
|
33204
|
-
|
|
33205
|
-
|
|
33206
|
-
|
|
33207
|
-
|
|
33208
|
-
|
|
33209
|
-
|
|
33210
|
-
|
|
33211
|
-
|
|
33212
|
-
|
|
33213
|
-
|
|
33214
|
-
|
|
33215
|
-
|
|
33216
|
-
|
|
33217
|
-
|
|
33218
|
-
|
|
33219
|
-
|
|
33220
|
-
|
|
33221
|
-
|
|
33222
|
-
|
|
33223
|
-
|
|
33224
|
-
|
|
33225
|
-
|
|
33226
|
-
|
|
33227
|
-
|
|
33228
|
-
|
|
33229
|
-
|
|
33230
|
-
|
|
33231
|
-
|
|
33232
|
-
|
|
33233
|
-
|
|
33234
|
-
|
|
33235
|
-
|
|
33236
|
-
|
|
33237
|
-
|
|
33238
|
-
|
|
33239
|
-
|
|
33240
|
-
|
|
33241
|
-
|
|
33242
|
-
|
|
33243
|
-
|
|
33244
|
-
|
|
33245
|
-
|
|
33246
|
-
|
|
33247
|
-
|
|
33248
|
-
|
|
33249
|
-
|
|
33250
|
-
|
|
33251
|
-
|
|
33252
|
-
|
|
33253
|
-
|
|
33254
|
-
|
|
33255
|
-
|
|
33256
|
-
|
|
33257
|
-
|
|
33258
|
-
|
|
33259
|
-
|
|
33260
|
-
|
|
33261
|
-
|
|
33262
|
-
|
|
33263
|
-
|
|
33264
|
-
|
|
33265
|
-
|
|
33266
|
-
|
|
33267
|
-
|
|
33268
|
-
|
|
33269
|
-
|
|
33270
|
-
|
|
33271
|
-
|
|
33272
|
-
|
|
33273
|
-
|
|
33274
|
-
|
|
33275
|
-
|
|
33276
|
-
|
|
33277
|
-
|
|
33278
|
-
|
|
33279
|
-
|
|
33280
|
-
|
|
33281
|
-
|
|
33282
|
-
|
|
33283
|
-
|
|
33284
|
-
|
|
33285
|
-
|
|
33286
|
-
|
|
33287
|
-
|
|
33288
|
-
|
|
33289
|
-
|
|
33290
|
-
|
|
33291
|
-
|
|
33292
|
-
|
|
33293
|
-
|
|
33294
|
-
|
|
33295
|
-
|
|
33296
|
-
|
|
33297
|
-
|
|
33298
|
-
|
|
33299
|
-
|
|
33300
|
-
|
|
33301
|
-
|
|
33302
|
-
|
|
33303
|
-
|
|
33304
|
-
|
|
33305
|
-
|
|
33306
|
-
|
|
33307
|
-
|
|
33308
|
-
|
|
33309
|
-
|
|
33310
|
-
|
|
33311
|
-
|
|
33312
|
-
|
|
33313
|
-
|
|
33314
|
-
|
|
33315
|
-
|
|
33316
|
-
|
|
33317
|
-
|
|
33318
|
-
|
|
33319
|
-
|
|
33320
|
-
|
|
33321
|
-
|
|
33322
|
-
|
|
33323
|
-
|
|
33324
|
-
|
|
33325
|
-
|
|
33326
|
-
|
|
33327
|
-
|
|
33328
|
-
|
|
33329
|
-
|
|
33330
|
-
|
|
33331
|
-
|
|
33332
|
-
|
|
33333
|
-
|
|
33334
|
-
|
|
33335
|
-
|
|
33336
|
-
|
|
33337
|
-
|
|
33338
|
-
|
|
33339
|
-
|
|
33340
|
-
|
|
33341
|
-
|
|
33342
|
-
|
|
33343
|
-
|
|
33344
|
-
|
|
33345
|
-
|
|
33346
|
-
|
|
33347
|
-
|
|
33348
|
-
|
|
33349
|
-
|
|
33350
|
-
|
|
33351
|
-
|
|
33352
|
-
|
|
33353
|
-
|
|
33354
|
-
|
|
33355
|
-
|
|
33356
|
-
|
|
33357
|
-
|
|
33358
|
-
|
|
33359
|
-
|
|
33360
|
-
|
|
33361
|
-
|
|
33362
|
-
|
|
33363
|
-
|
|
33364
|
-
|
|
33365
|
-
|
|
33366
|
-
|
|
33367
|
-
|
|
33368
|
-
|
|
33369
|
-
|
|
33370
|
-
|
|
33371
|
-
|
|
33372
|
-
|
|
33373
|
-
|
|
33374
|
-
|
|
33375
|
-
|
|
33376
|
-
|
|
33377
|
-
|
|
33378
|
-
|
|
33379
|
-
|
|
33380
|
-
|
|
33381
|
-
|
|
33382
|
-
|
|
33383
|
-
|
|
33384
|
-
|
|
33385
|
-
|
|
33386
|
-
|
|
33387
|
-
|
|
33388
|
-
|
|
33389
|
-
|
|
33390
|
-
|
|
33391
|
-
|
|
33392
|
-
|
|
33393
|
-
|
|
33394
|
-
|
|
33395
|
-
|
|
33396
|
-
|
|
33397
|
-
|
|
33398
|
-
|
|
33399
|
-
|
|
33400
|
-
|
|
33401
|
-
|
|
33402
|
-
|
|
33403
|
-
|
|
33404
|
-
|
|
33405
|
-
|
|
33406
|
-
|
|
33407
|
-
|
|
33408
|
-
|
|
33409
|
-
|
|
33410
|
-
|
|
33411
|
-
|
|
33412
|
-
|
|
33413
|
-
|
|
33414
|
-
|
|
33415
|
-
|
|
33416
|
-
|
|
33417
|
-
|
|
33418
|
-
|
|
33419
|
-
|
|
33420
|
-
|
|
33421
|
-
|
|
33422
|
-
|
|
33423
|
-
|
|
33424
|
-
|
|
33425
|
-
|
|
33426
|
-
|
|
33427
|
-
|
|
33428
|
-
|
|
33429
|
-
|
|
33430
|
-
|
|
33431
|
-
|
|
33432
|
-
|
|
33433
|
-
|
|
33434
|
-
|
|
33435
|
-
|
|
33436
|
-
|
|
33437
|
-
|
|
33438
|
-
|
|
33439
|
-
|
|
33440
|
-
|
|
33441
|
-
|
|
33442
|
-
|
|
33443
|
-
|
|
33444
|
-
|
|
33445
|
-
|
|
33446
|
-
|
|
33447
|
-
|
|
33448
|
-
|
|
33449
|
-
|
|
33450
|
-
|
|
33451
|
-
|
|
33452
|
-
|
|
33453
|
-
|
|
33454
|
-
|
|
33455
|
-
|
|
33456
|
-
|
|
33457
|
-
|
|
33458
|
-
|
|
33459
|
-
|
|
33460
|
-
|
|
33461
|
-
|
|
33462
|
-
|
|
33463
|
-
|
|
33464
|
-
|
|
33465
|
-
|
|
33466
|
-
|
|
33467
|
-
|
|
33468
|
-
|
|
33469
|
-
|
|
33470
|
-
|
|
33471
|
-
|
|
33472
|
-
|
|
33473
|
-
|
|
33474
|
-
|
|
33475
|
-
|
|
33476
|
-
|
|
33477
|
-
|
|
33478
|
-
|
|
33479
|
-
|
|
33480
|
-
|
|
33481
|
-
|
|
33482
|
-
|
|
33483
|
-
|
|
33484
|
-
|
|
33485
|
-
|
|
33486
|
-
|
|
33487
|
-
|
|
33488
|
-
|
|
33489
|
-
|
|
33490
|
-
|
|
33491
|
-
|
|
33492
|
-
|
|
33493
|
-
|
|
33494
|
-
|
|
33495
|
-
|
|
33496
|
-
|
|
33497
|
-
|
|
33498
|
-
|
|
33499
|
-
|
|
33500
|
-
|
|
33501
|
-
|
|
33502
|
-
|
|
33503
|
-
|
|
33504
|
-
|
|
33505
|
-
|
|
33506
|
-
|
|
33507
|
-
|
|
33508
|
-
|
|
33509
|
-
|
|
33510
|
-
|
|
33511
|
-
|
|
33512
|
-
|
|
33513
|
-
|
|
33514
|
-
|
|
33515
|
-
|
|
33516
|
-
|
|
33517
|
-
|
|
33518
|
-
|
|
33519
|
-
|
|
33520
|
-
|
|
33521
|
-
|
|
33522
|
-
|
|
33523
|
-
|
|
33524
|
-
|
|
33525
|
-
|
|
33526
|
-
|
|
33527
|
-
|
|
33528
|
-
|
|
33529
|
-
|
|
33530
|
-
|
|
33531
|
-
|
|
33532
|
-
|
|
33533
|
-
|
|
33534
|
-
|
|
33535
|
-
|
|
33536
|
-
|
|
33537
|
-
|
|
33538
|
-
|
|
33539
|
-
|
|
33540
|
-
|
|
33541
|
-
|
|
33542
|
-
|
|
33543
|
-
|
|
33544
|
-
|
|
33545
|
-
|
|
33546
|
-
|
|
33547
|
-
|
|
33548
|
-
|
|
33549
|
-
|
|
33550
|
-
|
|
33551
|
-
|
|
33552
|
-
|
|
33553
|
-
|
|
33554
|
-
|
|
33555
|
-
|
|
33556
|
-
|
|
33557
|
-
|
|
33558
|
-
|
|
33559
|
-
|
|
33560
|
-
|
|
33561
|
-
|
|
33562
|
-
|
|
33563
|
-
|
|
33564
|
-
|
|
33565
|
-
|
|
33566
|
-
|
|
33567
|
-
|
|
33568
|
-
|
|
33569
|
-
|
|
33570
|
-
|
|
33571
|
-
|
|
33572
|
-
|
|
33573
|
-
|
|
33574
|
-
|
|
33575
|
-
|
|
33576
|
-
|
|
33577
|
-
|
|
33578
|
-
|
|
33579
|
-
|
|
33580
|
-
|
|
33581
|
-
|
|
33582
|
-
|
|
33583
|
-
|
|
33584
|
-
|
|
33585
|
-
|
|
33586
|
-
|
|
33587
|
-
|
|
33588
|
-
|
|
33589
|
-
|
|
33590
|
-
|
|
33591
|
-
|
|
33592
|
-
|
|
33593
|
-
|
|
33594
|
-
|
|
33595
|
-
|
|
33596
|
-
|
|
33597
|
-
|
|
33598
|
-
|
|
33599
|
-
|
|
33600
|
-
|
|
33601
|
-
|
|
33602
|
-
|
|
33603
|
-
|
|
33604
|
-
|
|
33605
|
-
|
|
33606
|
-
|
|
33607
|
-
|
|
33608
|
-
|
|
33609
|
-
|
|
33610
|
-
|
|
33611
|
-
|
|
33612
|
-
|
|
33613
|
-
|
|
33614
|
-
|
|
33615
|
-
|
|
33616
|
-
|
|
33617
|
-
|
|
33618
|
-
|
|
33619
|
-
|
|
33620
|
-
|
|
33621
|
-
|
|
33622
|
-
|
|
33623
|
-
|
|
33624
|
-
|
|
33625
|
-
|
|
33626
|
-
|
|
33627
|
-
|
|
33628
|
-
|
|
33629
|
-
|
|
33630
|
-
|
|
33631
|
-
|
|
33632
|
-
|
|
33633
|
-
|
|
33634
|
-
|
|
33635
|
-
|
|
33636
|
-
|
|
33637
|
-
|
|
33638
|
-
|
|
33639
|
-
|
|
33640
|
-
|
|
33641
|
-
|
|
33642
|
-
|
|
33643
|
-
|
|
33644
|
-
|
|
33645
|
-
|
|
33646
|
-
|
|
33647
|
-
|
|
33648
|
-
|
|
33649
|
-
|
|
33650
|
-
|
|
33651
|
-
|
|
33652
|
-
|
|
33653
|
-
|
|
33654
|
-
|
|
33655
|
-
|
|
33656
|
-
|
|
33657
|
-
|
|
33658
|
-
|
|
33659
|
-
|
|
33660
|
-
|
|
33661
|
-
|
|
33662
|
-
|
|
33663
|
-
|
|
33664
|
-
|
|
33665
|
-
|
|
33666
|
-
|
|
33667
|
-
|
|
33668
|
-
|
|
33669
|
-
|
|
33670
|
-
|
|
33671
|
-
|
|
33672
|
-
|
|
33673
|
-
|
|
33674
|
-
|
|
33675
|
-
|
|
33676
|
-
|
|
33677
|
-
|
|
33678
|
-
|
|
33679
|
-
|
|
33680
|
-
|
|
33681
|
-
|
|
33682
|
-
|
|
33683
|
-
|
|
33684
|
-
|
|
33685
|
-
|
|
33686
|
-
|
|
33687
|
-
|
|
33688
|
-
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
33695
|
-
|
|
33696
|
-
|
|
33697
|
-
|
|
33698
|
-
|
|
33699
|
-
|
|
33700
|
-
|
|
33701
|
-
|
|
33702
|
-
|
|
33703
|
-
|
|
33704
|
-
|
|
33705
|
-
|
|
33706
|
-
|
|
33707
|
-
|
|
33708
|
-
|
|
33709
|
-
|
|
33710
|
-
|
|
33711
|
-
|
|
33712
|
-
function once(self) {
|
|
33713
|
-
return validateThenCall("once", self);
|
|
33714
|
-
}
|
|
33715
|
-
|
|
33716
|
-
Cldr.off = off(globalEe);
|
|
33717
|
-
Cldr.on = on(globalEe);
|
|
33718
|
-
Cldr.once = once(globalEe);
|
|
33719
|
-
/**
|
|
33720
|
-
* Overload Cldr.prototype.init().
|
|
33721
|
-
*/
|
|
33722
|
-
|
|
33723
|
-
superInit = Cldr.prototype.init;
|
|
33724
|
-
|
|
33725
|
-
Cldr.prototype.init = function () {
|
|
33726
|
-
var ee;
|
|
33727
|
-
this.ee = ee = new EventEmitter();
|
|
33728
|
-
this.off = off(ee);
|
|
33729
|
-
this.on = on(ee);
|
|
33730
|
-
this.once = once(ee);
|
|
33731
|
-
superInit.apply(this, arguments);
|
|
33732
|
-
};
|
|
33733
|
-
/**
|
|
33734
|
-
* getOverload is encapsulated, because of cldr/unresolved. If it's loaded
|
|
33735
|
-
* after cldr/event (and note it overwrites .get), it can trigger this
|
|
33736
|
-
* overload again.
|
|
33737
|
-
*/
|
|
33738
|
-
|
|
33739
|
-
|
|
33740
|
-
function getOverload() {
|
|
33741
|
-
/**
|
|
33742
|
-
* Overload Cldr.prototype.get().
|
|
33743
|
-
*/
|
|
33744
|
-
superGet = Cldr.prototype.get;
|
|
33745
|
-
|
|
33746
|
-
Cldr.prototype.get = function (path) {
|
|
33747
|
-
var value = superGet.apply(this, arguments);
|
|
33748
|
-
path = pathNormalize(path, this.attributes).join("/");
|
|
33749
|
-
globalEe.trigger("get", [path, value]);
|
|
33750
|
-
this.ee.trigger("get", [path, value]);
|
|
33751
|
-
return value;
|
|
33752
|
-
};
|
|
33753
|
-
}
|
|
33754
|
-
|
|
33755
|
-
Cldr._eventInit = getOverload;
|
|
33756
|
-
getOverload();
|
|
33757
|
-
return Cldr;
|
|
33758
|
-
});
|
|
33759
|
-
}(event));
|
|
33760
|
-
|
|
33761
|
-
var supplemental = {exports: {}};
|
|
33096
|
+
/*!
|
|
33097
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
33098
|
+
* http://git.io/h4lmVg
|
|
33099
|
+
*/
|
|
33100
|
+
(function (factory) {
|
|
33101
|
+
{
|
|
33102
|
+
// Node. CommonJS.
|
|
33103
|
+
module.exports = factory(cldrExports);
|
|
33104
|
+
}
|
|
33105
|
+
})(function (Cldr) {
|
|
33106
|
+
// Build optimization hack to avoid duplicating functions across modules.
|
|
33107
|
+
var pathNormalize = Cldr._pathNormalize,
|
|
33108
|
+
validatePresence = Cldr._validatePresence,
|
|
33109
|
+
validateType = Cldr._validateType;
|
|
33110
|
+
|
|
33111
|
+
/*!
|
|
33112
|
+
* EventEmitter v4.2.7 - git.io/ee
|
|
33113
|
+
* Oliver Caldwell
|
|
33114
|
+
* MIT license
|
|
33115
|
+
* @preserve
|
|
33116
|
+
*/
|
|
33117
|
+
|
|
33118
|
+
var EventEmitter;
|
|
33119
|
+
/* jshint ignore:start */
|
|
33120
|
+
EventEmitter = function () {
|
|
33121
|
+
/**
|
|
33122
|
+
* Class for managing events.
|
|
33123
|
+
* Can be extended to provide event functionality in other classes.
|
|
33124
|
+
*
|
|
33125
|
+
* @class EventEmitter Manages event registering and emitting.
|
|
33126
|
+
*/
|
|
33127
|
+
function EventEmitter() {}
|
|
33128
|
+
|
|
33129
|
+
// Shortcuts to improve speed and size
|
|
33130
|
+
var proto = EventEmitter.prototype;
|
|
33131
|
+
|
|
33132
|
+
/**
|
|
33133
|
+
* Finds the index of the listener for the event in it's storage array.
|
|
33134
|
+
*
|
|
33135
|
+
* @param {Function[]} listeners Array of listeners to search through.
|
|
33136
|
+
* @param {Function} listener Method to look for.
|
|
33137
|
+
* @return {Number} Index of the specified listener, -1 if not found
|
|
33138
|
+
* @api private
|
|
33139
|
+
*/
|
|
33140
|
+
function indexOfListener(listeners, listener) {
|
|
33141
|
+
var i = listeners.length;
|
|
33142
|
+
while (i--) {
|
|
33143
|
+
if (listeners[i].listener === listener) {
|
|
33144
|
+
return i;
|
|
33145
|
+
}
|
|
33146
|
+
}
|
|
33147
|
+
return -1;
|
|
33148
|
+
}
|
|
33149
|
+
|
|
33150
|
+
/**
|
|
33151
|
+
* Alias a method while keeping the context correct, to allow for overwriting of target method.
|
|
33152
|
+
*
|
|
33153
|
+
* @param {String} name The name of the target method.
|
|
33154
|
+
* @return {Function} The aliased method
|
|
33155
|
+
* @api private
|
|
33156
|
+
*/
|
|
33157
|
+
function alias(name) {
|
|
33158
|
+
return function aliasClosure() {
|
|
33159
|
+
return this[name].apply(this, arguments);
|
|
33160
|
+
};
|
|
33161
|
+
}
|
|
33162
|
+
|
|
33163
|
+
/**
|
|
33164
|
+
* Returns the listener array for the specified event.
|
|
33165
|
+
* Will initialise the event object and listener arrays if required.
|
|
33166
|
+
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
|
|
33167
|
+
* Each property in the object response is an array of listener functions.
|
|
33168
|
+
*
|
|
33169
|
+
* @param {String|RegExp} evt Name of the event to return the listeners from.
|
|
33170
|
+
* @return {Function[]|Object} All listener functions for the event.
|
|
33171
|
+
*/
|
|
33172
|
+
proto.getListeners = function getListeners(evt) {
|
|
33173
|
+
var events = this._getEvents();
|
|
33174
|
+
var response;
|
|
33175
|
+
var key;
|
|
33176
|
+
|
|
33177
|
+
// Return a concatenated array of all matching events if
|
|
33178
|
+
// the selector is a regular expression.
|
|
33179
|
+
if (evt instanceof RegExp) {
|
|
33180
|
+
response = {};
|
|
33181
|
+
for (key in events) {
|
|
33182
|
+
if (events.hasOwnProperty(key) && evt.test(key)) {
|
|
33183
|
+
response[key] = events[key];
|
|
33184
|
+
}
|
|
33185
|
+
}
|
|
33186
|
+
} else {
|
|
33187
|
+
response = events[evt] || (events[evt] = []);
|
|
33188
|
+
}
|
|
33189
|
+
return response;
|
|
33190
|
+
};
|
|
33191
|
+
|
|
33192
|
+
/**
|
|
33193
|
+
* Takes a list of listener objects and flattens it into a list of listener functions.
|
|
33194
|
+
*
|
|
33195
|
+
* @param {Object[]} listeners Raw listener objects.
|
|
33196
|
+
* @return {Function[]} Just the listener functions.
|
|
33197
|
+
*/
|
|
33198
|
+
proto.flattenListeners = function flattenListeners(listeners) {
|
|
33199
|
+
var flatListeners = [];
|
|
33200
|
+
var i;
|
|
33201
|
+
for (i = 0; i < listeners.length; i += 1) {
|
|
33202
|
+
flatListeners.push(listeners[i].listener);
|
|
33203
|
+
}
|
|
33204
|
+
return flatListeners;
|
|
33205
|
+
};
|
|
33206
|
+
|
|
33207
|
+
/**
|
|
33208
|
+
* Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
|
|
33209
|
+
*
|
|
33210
|
+
* @param {String|RegExp} evt Name of the event to return the listeners from.
|
|
33211
|
+
* @return {Object} All listener functions for an event in an object.
|
|
33212
|
+
*/
|
|
33213
|
+
proto.getListenersAsObject = function getListenersAsObject(evt) {
|
|
33214
|
+
var listeners = this.getListeners(evt);
|
|
33215
|
+
var response;
|
|
33216
|
+
if (listeners instanceof Array) {
|
|
33217
|
+
response = {};
|
|
33218
|
+
response[evt] = listeners;
|
|
33219
|
+
}
|
|
33220
|
+
return response || listeners;
|
|
33221
|
+
};
|
|
33222
|
+
|
|
33223
|
+
/**
|
|
33224
|
+
* Adds a listener function to the specified event.
|
|
33225
|
+
* The listener will not be added if it is a duplicate.
|
|
33226
|
+
* If the listener returns true then it will be removed after it is called.
|
|
33227
|
+
* If you pass a regular expression as the event name then the listener will be added to all events that match it.
|
|
33228
|
+
*
|
|
33229
|
+
* @param {String|RegExp} evt Name of the event to attach the listener to.
|
|
33230
|
+
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
|
|
33231
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33232
|
+
*/
|
|
33233
|
+
proto.addListener = function addListener(evt, listener) {
|
|
33234
|
+
var listeners = this.getListenersAsObject(evt);
|
|
33235
|
+
var listenerIsWrapped = typeof listener === 'object';
|
|
33236
|
+
var key;
|
|
33237
|
+
for (key in listeners) {
|
|
33238
|
+
if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
|
|
33239
|
+
listeners[key].push(listenerIsWrapped ? listener : {
|
|
33240
|
+
listener: listener,
|
|
33241
|
+
once: false
|
|
33242
|
+
});
|
|
33243
|
+
}
|
|
33244
|
+
}
|
|
33245
|
+
return this;
|
|
33246
|
+
};
|
|
33247
|
+
|
|
33248
|
+
/**
|
|
33249
|
+
* Alias of addListener
|
|
33250
|
+
*/
|
|
33251
|
+
proto.on = alias('addListener');
|
|
33252
|
+
|
|
33253
|
+
/**
|
|
33254
|
+
* Semi-alias of addListener. It will add a listener that will be
|
|
33255
|
+
* automatically removed after it's first execution.
|
|
33256
|
+
*
|
|
33257
|
+
* @param {String|RegExp} evt Name of the event to attach the listener to.
|
|
33258
|
+
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
|
|
33259
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33260
|
+
*/
|
|
33261
|
+
proto.addOnceListener = function addOnceListener(evt, listener) {
|
|
33262
|
+
return this.addListener(evt, {
|
|
33263
|
+
listener: listener,
|
|
33264
|
+
once: true
|
|
33265
|
+
});
|
|
33266
|
+
};
|
|
33267
|
+
|
|
33268
|
+
/**
|
|
33269
|
+
* Alias of addOnceListener.
|
|
33270
|
+
*/
|
|
33271
|
+
proto.once = alias('addOnceListener');
|
|
33272
|
+
|
|
33273
|
+
/**
|
|
33274
|
+
* Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
|
|
33275
|
+
* You need to tell it what event names should be matched by a regex.
|
|
33276
|
+
*
|
|
33277
|
+
* @param {String} evt Name of the event to create.
|
|
33278
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33279
|
+
*/
|
|
33280
|
+
proto.defineEvent = function defineEvent(evt) {
|
|
33281
|
+
this.getListeners(evt);
|
|
33282
|
+
return this;
|
|
33283
|
+
};
|
|
33284
|
+
|
|
33285
|
+
/**
|
|
33286
|
+
* Uses defineEvent to define multiple events.
|
|
33287
|
+
*
|
|
33288
|
+
* @param {String[]} evts An array of event names to define.
|
|
33289
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33290
|
+
*/
|
|
33291
|
+
proto.defineEvents = function defineEvents(evts) {
|
|
33292
|
+
for (var i = 0; i < evts.length; i += 1) {
|
|
33293
|
+
this.defineEvent(evts[i]);
|
|
33294
|
+
}
|
|
33295
|
+
return this;
|
|
33296
|
+
};
|
|
33297
|
+
|
|
33298
|
+
/**
|
|
33299
|
+
* Removes a listener function from the specified event.
|
|
33300
|
+
* When passed a regular expression as the event name, it will remove the listener from all events that match it.
|
|
33301
|
+
*
|
|
33302
|
+
* @param {String|RegExp} evt Name of the event to remove the listener from.
|
|
33303
|
+
* @param {Function} listener Method to remove from the event.
|
|
33304
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33305
|
+
*/
|
|
33306
|
+
proto.removeListener = function removeListener(evt, listener) {
|
|
33307
|
+
var listeners = this.getListenersAsObject(evt);
|
|
33308
|
+
var index;
|
|
33309
|
+
var key;
|
|
33310
|
+
for (key in listeners) {
|
|
33311
|
+
if (listeners.hasOwnProperty(key)) {
|
|
33312
|
+
index = indexOfListener(listeners[key], listener);
|
|
33313
|
+
if (index !== -1) {
|
|
33314
|
+
listeners[key].splice(index, 1);
|
|
33315
|
+
}
|
|
33316
|
+
}
|
|
33317
|
+
}
|
|
33318
|
+
return this;
|
|
33319
|
+
};
|
|
33320
|
+
|
|
33321
|
+
/**
|
|
33322
|
+
* Alias of removeListener
|
|
33323
|
+
*/
|
|
33324
|
+
proto.off = alias('removeListener');
|
|
33325
|
+
|
|
33326
|
+
/**
|
|
33327
|
+
* Adds listeners in bulk using the manipulateListeners method.
|
|
33328
|
+
* If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
|
|
33329
|
+
* You can also pass it a regular expression to add the array of listeners to all events that match it.
|
|
33330
|
+
* Yeah, this function does quite a bit. That's probably a bad thing.
|
|
33331
|
+
*
|
|
33332
|
+
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
|
|
33333
|
+
* @param {Function[]} [listeners] An optional array of listener functions to add.
|
|
33334
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33335
|
+
*/
|
|
33336
|
+
proto.addListeners = function addListeners(evt, listeners) {
|
|
33337
|
+
// Pass through to manipulateListeners
|
|
33338
|
+
return this.manipulateListeners(false, evt, listeners);
|
|
33339
|
+
};
|
|
33340
|
+
|
|
33341
|
+
/**
|
|
33342
|
+
* Removes listeners in bulk using the manipulateListeners method.
|
|
33343
|
+
* If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
|
|
33344
|
+
* You can also pass it an event name and an array of listeners to be removed.
|
|
33345
|
+
* You can also pass it a regular expression to remove the listeners from all events that match it.
|
|
33346
|
+
*
|
|
33347
|
+
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
|
|
33348
|
+
* @param {Function[]} [listeners] An optional array of listener functions to remove.
|
|
33349
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33350
|
+
*/
|
|
33351
|
+
proto.removeListeners = function removeListeners(evt, listeners) {
|
|
33352
|
+
// Pass through to manipulateListeners
|
|
33353
|
+
return this.manipulateListeners(true, evt, listeners);
|
|
33354
|
+
};
|
|
33355
|
+
|
|
33356
|
+
/**
|
|
33357
|
+
* Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
|
|
33358
|
+
* The first argument will determine if the listeners are removed (true) or added (false).
|
|
33359
|
+
* If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
|
|
33360
|
+
* You can also pass it an event name and an array of listeners to be added/removed.
|
|
33361
|
+
* You can also pass it a regular expression to manipulate the listeners of all events that match it.
|
|
33362
|
+
*
|
|
33363
|
+
* @param {Boolean} remove True if you want to remove listeners, false if you want to add.
|
|
33364
|
+
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
|
|
33365
|
+
* @param {Function[]} [listeners] An optional array of listener functions to add/remove.
|
|
33366
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33367
|
+
*/
|
|
33368
|
+
proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
|
|
33369
|
+
var i;
|
|
33370
|
+
var value;
|
|
33371
|
+
var single = remove ? this.removeListener : this.addListener;
|
|
33372
|
+
var multiple = remove ? this.removeListeners : this.addListeners;
|
|
33373
|
+
|
|
33374
|
+
// If evt is an object then pass each of it's properties to this method
|
|
33375
|
+
if (typeof evt === 'object' && !(evt instanceof RegExp)) {
|
|
33376
|
+
for (i in evt) {
|
|
33377
|
+
if (evt.hasOwnProperty(i) && (value = evt[i])) {
|
|
33378
|
+
// Pass the single listener straight through to the singular method
|
|
33379
|
+
if (typeof value === 'function') {
|
|
33380
|
+
single.call(this, i, value);
|
|
33381
|
+
} else {
|
|
33382
|
+
// Otherwise pass back to the multiple function
|
|
33383
|
+
multiple.call(this, i, value);
|
|
33384
|
+
}
|
|
33385
|
+
}
|
|
33386
|
+
}
|
|
33387
|
+
} else {
|
|
33388
|
+
// So evt must be a string
|
|
33389
|
+
// And listeners must be an array of listeners
|
|
33390
|
+
// Loop over it and pass each one to the multiple method
|
|
33391
|
+
i = listeners.length;
|
|
33392
|
+
while (i--) {
|
|
33393
|
+
single.call(this, evt, listeners[i]);
|
|
33394
|
+
}
|
|
33395
|
+
}
|
|
33396
|
+
return this;
|
|
33397
|
+
};
|
|
33398
|
+
|
|
33399
|
+
/**
|
|
33400
|
+
* Removes all listeners from a specified event.
|
|
33401
|
+
* If you do not specify an event then all listeners will be removed.
|
|
33402
|
+
* That means every event will be emptied.
|
|
33403
|
+
* You can also pass a regex to remove all events that match it.
|
|
33404
|
+
*
|
|
33405
|
+
* @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
|
|
33406
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33407
|
+
*/
|
|
33408
|
+
proto.removeEvent = function removeEvent(evt) {
|
|
33409
|
+
var type = typeof evt;
|
|
33410
|
+
var events = this._getEvents();
|
|
33411
|
+
var key;
|
|
33412
|
+
|
|
33413
|
+
// Remove different things depending on the state of evt
|
|
33414
|
+
if (type === 'string') {
|
|
33415
|
+
// Remove all listeners for the specified event
|
|
33416
|
+
delete events[evt];
|
|
33417
|
+
} else if (evt instanceof RegExp) {
|
|
33418
|
+
// Remove all events matching the regex.
|
|
33419
|
+
for (key in events) {
|
|
33420
|
+
if (events.hasOwnProperty(key) && evt.test(key)) {
|
|
33421
|
+
delete events[key];
|
|
33422
|
+
}
|
|
33423
|
+
}
|
|
33424
|
+
} else {
|
|
33425
|
+
// Remove all listeners in all events
|
|
33426
|
+
delete this._events;
|
|
33427
|
+
}
|
|
33428
|
+
return this;
|
|
33429
|
+
};
|
|
33430
|
+
|
|
33431
|
+
/**
|
|
33432
|
+
* Alias of removeEvent.
|
|
33433
|
+
*
|
|
33434
|
+
* Added to mirror the node API.
|
|
33435
|
+
*/
|
|
33436
|
+
proto.removeAllListeners = alias('removeEvent');
|
|
33437
|
+
|
|
33438
|
+
/**
|
|
33439
|
+
* Emits an event of your choice.
|
|
33440
|
+
* When emitted, every listener attached to that event will be executed.
|
|
33441
|
+
* If you pass the optional argument array then those arguments will be passed to every listener upon execution.
|
|
33442
|
+
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
|
|
33443
|
+
* So they will not arrive within the array on the other side, they will be separate.
|
|
33444
|
+
* You can also pass a regular expression to emit to all events that match it.
|
|
33445
|
+
*
|
|
33446
|
+
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
|
|
33447
|
+
* @param {Array} [args] Optional array of arguments to be passed to each listener.
|
|
33448
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33449
|
+
*/
|
|
33450
|
+
proto.emitEvent = function emitEvent(evt, args) {
|
|
33451
|
+
var listeners = this.getListenersAsObject(evt);
|
|
33452
|
+
var listener;
|
|
33453
|
+
var i;
|
|
33454
|
+
var key;
|
|
33455
|
+
var response;
|
|
33456
|
+
for (key in listeners) {
|
|
33457
|
+
if (listeners.hasOwnProperty(key)) {
|
|
33458
|
+
i = listeners[key].length;
|
|
33459
|
+
while (i--) {
|
|
33460
|
+
// If the listener returns true then it shall be removed from the event
|
|
33461
|
+
// The function is executed either with a basic call or an apply if there is an args array
|
|
33462
|
+
listener = listeners[key][i];
|
|
33463
|
+
if (listener.once === true) {
|
|
33464
|
+
this.removeListener(evt, listener.listener);
|
|
33465
|
+
}
|
|
33466
|
+
response = listener.listener.apply(this, args || []);
|
|
33467
|
+
if (response === this._getOnceReturnValue()) {
|
|
33468
|
+
this.removeListener(evt, listener.listener);
|
|
33469
|
+
}
|
|
33470
|
+
}
|
|
33471
|
+
}
|
|
33472
|
+
}
|
|
33473
|
+
return this;
|
|
33474
|
+
};
|
|
33475
|
+
|
|
33476
|
+
/**
|
|
33477
|
+
* Alias of emitEvent
|
|
33478
|
+
*/
|
|
33479
|
+
proto.trigger = alias('emitEvent');
|
|
33480
|
+
|
|
33481
|
+
/**
|
|
33482
|
+
* Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
|
|
33483
|
+
* As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
|
|
33484
|
+
*
|
|
33485
|
+
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
|
|
33486
|
+
* @param {...*} Optional additional arguments to be passed to each listener.
|
|
33487
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33488
|
+
*/
|
|
33489
|
+
proto.emit = function emit(evt) {
|
|
33490
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
33491
|
+
return this.emitEvent(evt, args);
|
|
33492
|
+
};
|
|
33493
|
+
|
|
33494
|
+
/**
|
|
33495
|
+
* Sets the current value to check against when executing listeners. If a
|
|
33496
|
+
* listeners return value matches the one set here then it will be removed
|
|
33497
|
+
* after execution. This value defaults to true.
|
|
33498
|
+
*
|
|
33499
|
+
* @param {*} value The new value to check for when executing listeners.
|
|
33500
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
33501
|
+
*/
|
|
33502
|
+
proto.setOnceReturnValue = function setOnceReturnValue(value) {
|
|
33503
|
+
this._onceReturnValue = value;
|
|
33504
|
+
return this;
|
|
33505
|
+
};
|
|
33506
|
+
|
|
33507
|
+
/**
|
|
33508
|
+
* Fetches the current value to check against when executing listeners. If
|
|
33509
|
+
* the listeners return value matches this one then it should be removed
|
|
33510
|
+
* automatically. It will return true by default.
|
|
33511
|
+
*
|
|
33512
|
+
* @return {*|Boolean} The current value to check for or the default, true.
|
|
33513
|
+
* @api private
|
|
33514
|
+
*/
|
|
33515
|
+
proto._getOnceReturnValue = function _getOnceReturnValue() {
|
|
33516
|
+
if (this.hasOwnProperty('_onceReturnValue')) {
|
|
33517
|
+
return this._onceReturnValue;
|
|
33518
|
+
} else {
|
|
33519
|
+
return true;
|
|
33520
|
+
}
|
|
33521
|
+
};
|
|
33522
|
+
|
|
33523
|
+
/**
|
|
33524
|
+
* Fetches the events object and creates one if required.
|
|
33525
|
+
*
|
|
33526
|
+
* @return {Object} The events storage object.
|
|
33527
|
+
* @api private
|
|
33528
|
+
*/
|
|
33529
|
+
proto._getEvents = function _getEvents() {
|
|
33530
|
+
return this._events || (this._events = {});
|
|
33531
|
+
};
|
|
33532
|
+
|
|
33533
|
+
/**
|
|
33534
|
+
* Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
|
|
33535
|
+
*
|
|
33536
|
+
* @return {Function} Non conflicting EventEmitter class.
|
|
33537
|
+
*/
|
|
33538
|
+
EventEmitter.noConflict = function noConflict() {
|
|
33539
|
+
originalGlobalValue;
|
|
33540
|
+
return EventEmitter;
|
|
33541
|
+
};
|
|
33542
|
+
return EventEmitter;
|
|
33543
|
+
}();
|
|
33544
|
+
/* jshint ignore:end */
|
|
33545
|
+
|
|
33546
|
+
var validateTypeFunction = function (value, name) {
|
|
33547
|
+
validateType(value, name, typeof value === "undefined" || typeof value === "function", "Function");
|
|
33548
|
+
};
|
|
33549
|
+
var superGet,
|
|
33550
|
+
superInit,
|
|
33551
|
+
globalEe = new EventEmitter();
|
|
33552
|
+
function validateTypeEvent(value, name) {
|
|
33553
|
+
validateType(value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp");
|
|
33554
|
+
}
|
|
33555
|
+
function validateThenCall(method, self) {
|
|
33556
|
+
return function (event, listener) {
|
|
33557
|
+
validatePresence(event, "event");
|
|
33558
|
+
validateTypeEvent(event, "event");
|
|
33559
|
+
validatePresence(listener, "listener");
|
|
33560
|
+
validateTypeFunction(listener, "listener");
|
|
33561
|
+
return self[method].apply(self, arguments);
|
|
33562
|
+
};
|
|
33563
|
+
}
|
|
33564
|
+
function off(self) {
|
|
33565
|
+
return validateThenCall("off", self);
|
|
33566
|
+
}
|
|
33567
|
+
function on(self) {
|
|
33568
|
+
return validateThenCall("on", self);
|
|
33569
|
+
}
|
|
33570
|
+
function once(self) {
|
|
33571
|
+
return validateThenCall("once", self);
|
|
33572
|
+
}
|
|
33573
|
+
Cldr.off = off(globalEe);
|
|
33574
|
+
Cldr.on = on(globalEe);
|
|
33575
|
+
Cldr.once = once(globalEe);
|
|
33576
|
+
|
|
33577
|
+
/**
|
|
33578
|
+
* Overload Cldr.prototype.init().
|
|
33579
|
+
*/
|
|
33580
|
+
superInit = Cldr.prototype.init;
|
|
33581
|
+
Cldr.prototype.init = function () {
|
|
33582
|
+
var ee;
|
|
33583
|
+
this.ee = ee = new EventEmitter();
|
|
33584
|
+
this.off = off(ee);
|
|
33585
|
+
this.on = on(ee);
|
|
33586
|
+
this.once = once(ee);
|
|
33587
|
+
superInit.apply(this, arguments);
|
|
33588
|
+
};
|
|
33589
|
+
|
|
33590
|
+
/**
|
|
33591
|
+
* getOverload is encapsulated, because of cldr/unresolved. If it's loaded
|
|
33592
|
+
* after cldr/event (and note it overwrites .get), it can trigger this
|
|
33593
|
+
* overload again.
|
|
33594
|
+
*/
|
|
33595
|
+
function getOverload() {
|
|
33596
|
+
/**
|
|
33597
|
+
* Overload Cldr.prototype.get().
|
|
33598
|
+
*/
|
|
33599
|
+
superGet = Cldr.prototype.get;
|
|
33600
|
+
Cldr.prototype.get = function (path) {
|
|
33601
|
+
var value = superGet.apply(this, arguments);
|
|
33602
|
+
path = pathNormalize(path, this.attributes).join("/");
|
|
33603
|
+
globalEe.trigger("get", [path, value]);
|
|
33604
|
+
this.ee.trigger("get", [path, value]);
|
|
33605
|
+
return value;
|
|
33606
|
+
};
|
|
33607
|
+
}
|
|
33608
|
+
Cldr._eventInit = getOverload;
|
|
33609
|
+
getOverload();
|
|
33610
|
+
return Cldr;
|
|
33611
|
+
});
|
|
33612
|
+
} (event));
|
|
33613
|
+
|
|
33614
|
+
var supplementalExports = {};
|
|
33615
|
+
var supplemental = {
|
|
33616
|
+
get exports(){ return supplementalExports; },
|
|
33617
|
+
set exports(v){ supplementalExports = v; },
|
|
33618
|
+
};
|
|
33762
33619
|
|
|
33763
33620
|
/**
|
|
33764
33621
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -33772,75 +33629,70 @@ var supplemental = {exports: {}};
|
|
|
33772
33629
|
*/
|
|
33773
33630
|
|
|
33774
33631
|
(function (module) {
|
|
33775
|
-
/*!
|
|
33776
|
-
|
|
33777
|
-
|
|
33778
|
-
|
|
33779
|
-
(function (factory) {
|
|
33780
|
-
|
|
33781
|
-
|
|
33782
|
-
|
|
33783
|
-
|
|
33784
|
-
})(function (Cldr) {
|
|
33785
|
-
|
|
33786
|
-
|
|
33787
|
-
|
|
33788
|
-
|
|
33789
|
-
|
|
33790
|
-
|
|
33791
|
-
|
|
33792
|
-
|
|
33793
|
-
|
|
33794
|
-
|
|
33795
|
-
|
|
33796
|
-
|
|
33797
|
-
|
|
33798
|
-
|
|
33799
|
-
|
|
33800
|
-
|
|
33801
|
-
|
|
33802
|
-
|
|
33803
|
-
|
|
33804
|
-
|
|
33805
|
-
|
|
33806
|
-
|
|
33807
|
-
|
|
33808
|
-
|
|
33809
|
-
|
|
33810
|
-
|
|
33811
|
-
|
|
33812
|
-
|
|
33813
|
-
|
|
33814
|
-
|
|
33815
|
-
|
|
33816
|
-
|
|
33817
|
-
|
|
33818
|
-
|
|
33819
|
-
|
|
33820
|
-
|
|
33821
|
-
|
|
33822
|
-
|
|
33823
|
-
|
|
33824
|
-
|
|
33825
|
-
|
|
33826
|
-
|
|
33827
|
-
|
|
33828
|
-
|
|
33829
|
-
|
|
33830
|
-
|
|
33831
|
-
|
|
33832
|
-
|
|
33833
|
-
|
|
33834
|
-
|
|
33835
|
-
|
|
33836
|
-
|
|
33837
|
-
}
|
|
33838
|
-
|
|
33839
|
-
return Cldr;
|
|
33840
|
-
});
|
|
33841
|
-
}(supplemental));
|
|
33842
|
-
|
|
33843
|
-
var unresolved = {exports: {}};
|
|
33632
|
+
/*!
|
|
33633
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
33634
|
+
* http://git.io/h4lmVg
|
|
33635
|
+
*/
|
|
33636
|
+
(function (factory) {
|
|
33637
|
+
{
|
|
33638
|
+
// Node. CommonJS.
|
|
33639
|
+
module.exports = factory(cldrExports);
|
|
33640
|
+
}
|
|
33641
|
+
})(function (Cldr) {
|
|
33642
|
+
// Build optimization hack to avoid duplicating functions across modules.
|
|
33643
|
+
var alwaysArray = Cldr._alwaysArray;
|
|
33644
|
+
var supplementalMain = function (cldr) {
|
|
33645
|
+
var prepend, supplemental;
|
|
33646
|
+
prepend = function (prepend) {
|
|
33647
|
+
return function (path) {
|
|
33648
|
+
path = alwaysArray(path);
|
|
33649
|
+
return cldr.get([prepend].concat(path));
|
|
33650
|
+
};
|
|
33651
|
+
};
|
|
33652
|
+
supplemental = prepend("supplemental");
|
|
33653
|
+
|
|
33654
|
+
// Week Data
|
|
33655
|
+
// http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
|
|
33656
|
+
supplemental.weekData = prepend("supplemental/weekData");
|
|
33657
|
+
supplemental.weekData.firstDay = function () {
|
|
33658
|
+
return cldr.get("supplemental/weekData/firstDay/{territory}") || cldr.get("supplemental/weekData/firstDay/001");
|
|
33659
|
+
};
|
|
33660
|
+
supplemental.weekData.minDays = function () {
|
|
33661
|
+
var minDays = cldr.get("supplemental/weekData/minDays/{territory}") || cldr.get("supplemental/weekData/minDays/001");
|
|
33662
|
+
return parseInt(minDays, 10);
|
|
33663
|
+
};
|
|
33664
|
+
|
|
33665
|
+
// Time Data
|
|
33666
|
+
// http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
|
|
33667
|
+
supplemental.timeData = prepend("supplemental/timeData");
|
|
33668
|
+
supplemental.timeData.allowed = function () {
|
|
33669
|
+
return cldr.get("supplemental/timeData/{territory}/_allowed") || cldr.get("supplemental/timeData/001/_allowed");
|
|
33670
|
+
};
|
|
33671
|
+
supplemental.timeData.preferred = function () {
|
|
33672
|
+
return cldr.get("supplemental/timeData/{territory}/_preferred") || cldr.get("supplemental/timeData/001/_preferred");
|
|
33673
|
+
};
|
|
33674
|
+
return supplemental;
|
|
33675
|
+
};
|
|
33676
|
+
var initSuper = Cldr.prototype.init;
|
|
33677
|
+
|
|
33678
|
+
/**
|
|
33679
|
+
* .init() automatically ran on construction.
|
|
33680
|
+
*
|
|
33681
|
+
* Overload .init().
|
|
33682
|
+
*/
|
|
33683
|
+
Cldr.prototype.init = function () {
|
|
33684
|
+
initSuper.apply(this, arguments);
|
|
33685
|
+
this.supplemental = supplementalMain(this);
|
|
33686
|
+
};
|
|
33687
|
+
return Cldr;
|
|
33688
|
+
});
|
|
33689
|
+
} (supplemental));
|
|
33690
|
+
|
|
33691
|
+
var unresolvedExports = {};
|
|
33692
|
+
var unresolved = {
|
|
33693
|
+
get exports(){ return unresolvedExports; },
|
|
33694
|
+
set exports(v){ unresolvedExports = v; },
|
|
33695
|
+
};
|
|
33844
33696
|
|
|
33845
33697
|
/**
|
|
33846
33698
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -33854,154 +33706,129 @@ var unresolved = {exports: {}};
|
|
|
33854
33706
|
*/
|
|
33855
33707
|
|
|
33856
33708
|
(function (module) {
|
|
33857
|
-
/*!
|
|
33858
|
-
|
|
33859
|
-
|
|
33860
|
-
|
|
33861
|
-
(function (factory) {
|
|
33862
|
-
|
|
33863
|
-
|
|
33864
|
-
|
|
33865
|
-
|
|
33866
|
-
})(function (Cldr) {
|
|
33867
|
-
|
|
33868
|
-
|
|
33869
|
-
|
|
33870
|
-
|
|
33871
|
-
|
|
33872
|
-
|
|
33873
|
-
|
|
33874
|
-
|
|
33875
|
-
|
|
33876
|
-
|
|
33877
|
-
|
|
33878
|
-
|
|
33879
|
-
|
|
33880
|
-
|
|
33881
|
-
|
|
33882
|
-
|
|
33883
|
-
|
|
33884
|
-
|
|
33885
|
-
|
|
33886
|
-
|
|
33887
|
-
|
|
33888
|
-
|
|
33889
|
-
|
|
33890
|
-
|
|
33891
|
-
|
|
33892
|
-
|
|
33893
|
-
|
|
33894
|
-
|
|
33895
|
-
|
|
33896
|
-
|
|
33897
|
-
|
|
33898
|
-
|
|
33899
|
-
|
|
33900
|
-
|
|
33901
|
-
|
|
33902
|
-
|
|
33903
|
-
|
|
33904
|
-
|
|
33905
|
-
|
|
33906
|
-
|
|
33907
|
-
|
|
33908
|
-
|
|
33909
|
-
|
|
33910
|
-
|
|
33911
|
-
|
|
33912
|
-
|
|
33913
|
-
|
|
33914
|
-
|
|
33915
|
-
|
|
33916
|
-
|
|
33917
|
-
|
|
33918
|
-
|
|
33919
|
-
|
|
33920
|
-
|
|
33921
|
-
|
|
33922
|
-
|
|
33923
|
-
|
|
33924
|
-
|
|
33925
|
-
|
|
33926
|
-
|
|
33927
|
-
|
|
33928
|
-
|
|
33929
|
-
|
|
33930
|
-
|
|
33931
|
-
|
|
33932
|
-
|
|
33933
|
-
|
|
33934
|
-
|
|
33935
|
-
|
|
33936
|
-
|
|
33937
|
-
|
|
33938
|
-
|
|
33939
|
-
|
|
33940
|
-
|
|
33941
|
-
|
|
33942
|
-
|
|
33943
|
-
|
|
33944
|
-
|
|
33945
|
-
|
|
33946
|
-
|
|
33947
|
-
|
|
33948
|
-
|
|
33949
|
-
|
|
33950
|
-
|
|
33951
|
-
|
|
33952
|
-
|
|
33953
|
-
|
|
33954
|
-
|
|
33955
|
-
|
|
33956
|
-
|
|
33957
|
-
|
|
33958
|
-
|
|
33959
|
-
|
|
33960
|
-
|
|
33961
|
-
|
|
33962
|
-
|
|
33963
|
-
|
|
33964
|
-
|
|
33965
|
-
|
|
33966
|
-
|
|
33967
|
-
|
|
33968
|
-
|
|
33969
|
-
|
|
33970
|
-
|
|
33971
|
-
|
|
33972
|
-
|
|
33973
|
-
|
|
33974
|
-
|
|
33975
|
-
|
|
33976
|
-
|
|
33977
|
-
|
|
33978
|
-
|
|
33979
|
-
|
|
33980
|
-
/**
|
|
33981
|
-
* Overwrite Cldr.prototype.get().
|
|
33982
|
-
*/
|
|
33983
|
-
|
|
33984
|
-
|
|
33985
|
-
Cldr.prototype.get = function (path) {
|
|
33986
|
-
validatePresence(path, "path");
|
|
33987
|
-
validateTypePath(path, "path"); // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
|
|
33988
|
-
// 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
|
|
33989
|
-
|
|
33990
|
-
return itemLookup(Cldr, this.attributes && this.attributes.bundle
|
|
33991
|
-
/* 1 */
|
|
33992
|
-
|| ""
|
|
33993
|
-
/* 2 */
|
|
33994
|
-
, path, this.attributes);
|
|
33995
|
-
}; // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
|
|
33996
|
-
|
|
33997
|
-
|
|
33998
|
-
if (Cldr._eventInit) {
|
|
33999
|
-
Cldr._eventInit();
|
|
34000
|
-
}
|
|
34001
|
-
|
|
34002
|
-
return Cldr;
|
|
34003
|
-
});
|
|
34004
|
-
}(unresolved));
|
|
33709
|
+
/*!
|
|
33710
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
33711
|
+
* http://git.io/h4lmVg
|
|
33712
|
+
*/
|
|
33713
|
+
(function (factory) {
|
|
33714
|
+
{
|
|
33715
|
+
// Node. CommonJS.
|
|
33716
|
+
module.exports = factory(cldrExports);
|
|
33717
|
+
}
|
|
33718
|
+
})(function (Cldr) {
|
|
33719
|
+
// Build optimization hack to avoid duplicating functions across modules.
|
|
33720
|
+
var coreLoad = Cldr._coreLoad;
|
|
33721
|
+
var jsonMerge = Cldr._jsonMerge;
|
|
33722
|
+
var pathNormalize = Cldr._pathNormalize;
|
|
33723
|
+
var resourceGet = Cldr._resourceGet;
|
|
33724
|
+
var validatePresence = Cldr._validatePresence;
|
|
33725
|
+
var validateTypePath = Cldr._validateTypePath;
|
|
33726
|
+
var bundleParentLookup = function (Cldr, locale) {
|
|
33727
|
+
var normalizedPath, parent;
|
|
33728
|
+
if (locale === "root") {
|
|
33729
|
+
return;
|
|
33730
|
+
}
|
|
33731
|
+
|
|
33732
|
+
// First, try to find parent on supplemental data.
|
|
33733
|
+
normalizedPath = pathNormalize(["supplemental/parentLocales/parentLocale", locale]);
|
|
33734
|
+
parent = resourceGet(Cldr._resolved, normalizedPath) || resourceGet(Cldr._raw, normalizedPath);
|
|
33735
|
+
if (parent) {
|
|
33736
|
+
return parent;
|
|
33737
|
+
}
|
|
33738
|
+
|
|
33739
|
+
// Or truncate locale.
|
|
33740
|
+
parent = locale.substr(0, locale.lastIndexOf(Cldr.localeSep));
|
|
33741
|
+
if (!parent) {
|
|
33742
|
+
return "root";
|
|
33743
|
+
}
|
|
33744
|
+
return parent;
|
|
33745
|
+
};
|
|
33746
|
+
|
|
33747
|
+
// @path: normalized path
|
|
33748
|
+
var resourceSet = function (data, path, value) {
|
|
33749
|
+
var i,
|
|
33750
|
+
node = data,
|
|
33751
|
+
length = path.length;
|
|
33752
|
+
for (i = 0; i < length - 1; i++) {
|
|
33753
|
+
if (!node[path[i]]) {
|
|
33754
|
+
node[path[i]] = {};
|
|
33755
|
+
}
|
|
33756
|
+
node = node[path[i]];
|
|
33757
|
+
}
|
|
33758
|
+
node[path[i]] = value;
|
|
33759
|
+
};
|
|
33760
|
+
var itemLookup = function () {
|
|
33761
|
+
var lookup;
|
|
33762
|
+
lookup = function (Cldr, locale, path, attributes, childLocale) {
|
|
33763
|
+
var normalizedPath, parent, value;
|
|
33764
|
+
|
|
33765
|
+
// 1: Finish recursion
|
|
33766
|
+
// 2: Avoid infinite loop
|
|
33767
|
+
if (typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */) {
|
|
33768
|
+
return;
|
|
33769
|
+
}
|
|
33770
|
+
|
|
33771
|
+
// Resolve path
|
|
33772
|
+
normalizedPath = pathNormalize(path, attributes);
|
|
33773
|
+
|
|
33774
|
+
// Check resolved (cached) data first
|
|
33775
|
+
// 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
|
|
33776
|
+
// represent its leafs in its entirety.
|
|
33777
|
+
value = resourceGet(Cldr._resolved, normalizedPath);
|
|
33778
|
+
if (value !== undefined && typeof value !== "object" /* 1 */) {
|
|
33779
|
+
return value;
|
|
33780
|
+
}
|
|
33781
|
+
|
|
33782
|
+
// Check raw data
|
|
33783
|
+
value = resourceGet(Cldr._raw, normalizedPath);
|
|
33784
|
+
if (value === undefined) {
|
|
33785
|
+
// Or, lookup at parent locale
|
|
33786
|
+
parent = bundleParentLookup(Cldr, locale);
|
|
33787
|
+
value = lookup(Cldr, parent, path, jsonMerge(attributes, {
|
|
33788
|
+
bundle: parent
|
|
33789
|
+
}), locale);
|
|
33790
|
+
}
|
|
33791
|
+
if (value !== undefined) {
|
|
33792
|
+
// Set resolved (cached)
|
|
33793
|
+
resourceSet(Cldr._resolved, normalizedPath, value);
|
|
33794
|
+
}
|
|
33795
|
+
return value;
|
|
33796
|
+
};
|
|
33797
|
+
return lookup;
|
|
33798
|
+
}();
|
|
33799
|
+
Cldr._raw = {};
|
|
33800
|
+
|
|
33801
|
+
/**
|
|
33802
|
+
* Cldr.load( json [, json, ...] )
|
|
33803
|
+
*
|
|
33804
|
+
* @json [JSON] CLDR data or [Array] Array of @json's.
|
|
33805
|
+
*
|
|
33806
|
+
* Load resolved or unresolved cldr data.
|
|
33807
|
+
* Overwrite Cldr.load().
|
|
33808
|
+
*/
|
|
33809
|
+
Cldr.load = function () {
|
|
33810
|
+
Cldr._raw = coreLoad(Cldr, Cldr._raw, arguments);
|
|
33811
|
+
};
|
|
33812
|
+
|
|
33813
|
+
/**
|
|
33814
|
+
* Overwrite Cldr.prototype.get().
|
|
33815
|
+
*/
|
|
33816
|
+
Cldr.prototype.get = function (path) {
|
|
33817
|
+
validatePresence(path, "path");
|
|
33818
|
+
validateTypePath(path, "path");
|
|
33819
|
+
|
|
33820
|
+
// 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
|
|
33821
|
+
// 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
|
|
33822
|
+
return itemLookup(Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes);
|
|
33823
|
+
};
|
|
33824
|
+
|
|
33825
|
+
// In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
|
|
33826
|
+
if (Cldr._eventInit) {
|
|
33827
|
+
Cldr._eventInit();
|
|
33828
|
+
}
|
|
33829
|
+
return Cldr;
|
|
33830
|
+
});
|
|
33831
|
+
} (unresolved));
|
|
34005
33832
|
|
|
34006
33833
|
/**
|
|
34007
33834
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -34014,12 +33841,19 @@ var unresolved = {exports: {}};
|
|
|
34014
33841
|
* Date: 2020-10-22T15:56Z
|
|
34015
33842
|
*/
|
|
34016
33843
|
|
|
34017
|
-
|
|
34018
|
-
|
|
34019
|
-
|
|
34020
|
-
|
|
34021
|
-
|
|
34022
|
-
|
|
33844
|
+
(function (module) {
|
|
33845
|
+
/*!
|
|
33846
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
33847
|
+
* http://git.io/h4lmVg
|
|
33848
|
+
*/
|
|
33849
|
+
|
|
33850
|
+
// Cldr
|
|
33851
|
+
module.exports = cldrExports;
|
|
33852
|
+
|
|
33853
|
+
// Extent Cldr with the following modules
|
|
33854
|
+
} (node_main));
|
|
33855
|
+
|
|
33856
|
+
var Cldr = /*@__PURE__*/getDefaultExportFromCjs(node_mainExports);
|
|
34023
33857
|
|
|
34024
33858
|
/*
|
|
34025
33859
|
* @copyright (c) 2020, Philipp Thuerwaechter & Pattrick Hueper
|
|
@@ -34028,16 +33862,15 @@ var node_main = cldr.exports; // Extent Cldr with the following modules
|
|
|
34028
33862
|
var cldrDataLoaded = new Set();
|
|
34029
33863
|
var loadCldrData = function loadCldrData(path) {
|
|
34030
33864
|
if (!cldrDataLoaded.has(path)) {
|
|
34031
|
-
|
|
33865
|
+
Cldr.load(cldrData(path));
|
|
34032
33866
|
cldrDataLoaded.add(path);
|
|
34033
33867
|
}
|
|
34034
33868
|
};
|
|
34035
33869
|
var localeToCldrInstanceCache = {};
|
|
34036
33870
|
var getOrCreateCldrInstance = function getOrCreateCldrInstance(locale) {
|
|
34037
33871
|
if (localeToCldrInstanceCache[locale] == null) {
|
|
34038
|
-
localeToCldrInstanceCache[locale] = new
|
|
33872
|
+
localeToCldrInstanceCache[locale] = new Cldr(locale);
|
|
34039
33873
|
}
|
|
34040
|
-
|
|
34041
33874
|
return localeToCldrInstanceCache[locale];
|
|
34042
33875
|
};
|
|
34043
33876
|
var localeToMapZonesCache = {};
|
|
@@ -34049,13 +33882,11 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
|
|
|
34049
33882
|
if (!mapZones[metaZone.mapZone._other]) {
|
|
34050
33883
|
mapZones[metaZone.mapZone._other] = {};
|
|
34051
33884
|
}
|
|
34052
|
-
|
|
34053
33885
|
mapZones[metaZone.mapZone._other][metaZone.mapZone._territory] = metaZone.mapZone._type;
|
|
34054
33886
|
}
|
|
34055
33887
|
});
|
|
34056
33888
|
localeToMapZonesCache[cldr.locale] = mapZones;
|
|
34057
33889
|
}
|
|
34058
|
-
|
|
34059
33890
|
return localeToMapZonesCache[cldr.locale];
|
|
34060
33891
|
};
|
|
34061
33892
|
|
|
@@ -34063,55 +33894,41 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
|
|
|
34063
33894
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
34064
33895
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
34065
33896
|
*/
|
|
34066
|
-
|
|
34067
33897
|
var CldrDateTimeTextProvider = function () {
|
|
34068
33898
|
function CldrDateTimeTextProvider() {
|
|
34069
33899
|
this._cache = {};
|
|
34070
33900
|
loadCldrData('supplemental/likelySubtags.json');
|
|
34071
33901
|
}
|
|
34072
|
-
|
|
34073
33902
|
var _proto = CldrDateTimeTextProvider.prototype;
|
|
34074
|
-
|
|
34075
33903
|
_proto.getAvailableLocales = function getAvailableLocales() {
|
|
34076
33904
|
return cldrData('availableLocales.json').availableLocales;
|
|
34077
33905
|
};
|
|
34078
|
-
|
|
34079
33906
|
_proto.getText = function getText(field, value, style, locale) {
|
|
34080
33907
|
var store = this._findStore(field, locale);
|
|
34081
|
-
|
|
34082
33908
|
if (store instanceof LocaleStore) {
|
|
34083
33909
|
return store.getText(value, style);
|
|
34084
33910
|
}
|
|
34085
|
-
|
|
34086
33911
|
return null;
|
|
34087
33912
|
};
|
|
34088
|
-
|
|
34089
33913
|
_proto.getTextIterator = function getTextIterator(field, style, locale) {
|
|
34090
33914
|
var store = this._findStore(field, locale);
|
|
34091
|
-
|
|
34092
33915
|
if (store instanceof LocaleStore) {
|
|
34093
33916
|
return store.getTextIterator(style);
|
|
34094
33917
|
}
|
|
34095
|
-
|
|
34096
33918
|
return null;
|
|
34097
33919
|
};
|
|
34098
|
-
|
|
34099
33920
|
_proto._findStore = function _findStore(field, locale) {
|
|
34100
33921
|
var key = createEntry(field, locale);
|
|
34101
33922
|
var store = this._cache[key];
|
|
34102
|
-
|
|
34103
33923
|
if (store === undefined) {
|
|
34104
33924
|
store = this._createStore(field, locale);
|
|
34105
33925
|
this._cache[key] = store;
|
|
34106
33926
|
}
|
|
34107
|
-
|
|
34108
33927
|
return store;
|
|
34109
33928
|
};
|
|
34110
|
-
|
|
34111
33929
|
_proto._createStore = function _createStore(field, locale) {
|
|
34112
33930
|
loadCldrData("main/" + locale.localeString() + "/ca-gregorian.json");
|
|
34113
33931
|
var cldr = getOrCreateCldrInstance(locale.localeString());
|
|
34114
|
-
|
|
34115
33932
|
if (field === ChronoField.MONTH_OF_YEAR) {
|
|
34116
33933
|
var monthsData = cldr.main('dates/calendars/gregorian/months/format');
|
|
34117
33934
|
var styleMap = {};
|
|
@@ -34159,7 +33976,6 @@ var CldrDateTimeTextProvider = function () {
|
|
|
34159
33976
|
styleMap[TextStyle.SHORT] = data;
|
|
34160
33977
|
return this._createLocaleStore(styleMap);
|
|
34161
33978
|
}
|
|
34162
|
-
|
|
34163
33979
|
if (field === ChronoField.DAY_OF_WEEK) {
|
|
34164
33980
|
var daysData = cldr.main('dates/calendars/gregorian/days/format');
|
|
34165
33981
|
var _styleMap = {};
|
|
@@ -34192,7 +34008,6 @@ var CldrDateTimeTextProvider = function () {
|
|
|
34192
34008
|
_styleMap[TextStyle.SHORT] = _data;
|
|
34193
34009
|
return this._createLocaleStore(_styleMap);
|
|
34194
34010
|
}
|
|
34195
|
-
|
|
34196
34011
|
if (field === ChronoField.AMPM_OF_DAY) {
|
|
34197
34012
|
var dayPeriodsData = cldr.main('dates/calendars/gregorian/dayPeriods/format');
|
|
34198
34013
|
var _styleMap2 = {};
|
|
@@ -34210,7 +34025,6 @@ var CldrDateTimeTextProvider = function () {
|
|
|
34210
34025
|
_styleMap2[TextStyle.SHORT] = _data2;
|
|
34211
34026
|
return this._createLocaleStore(_styleMap2);
|
|
34212
34027
|
}
|
|
34213
|
-
|
|
34214
34028
|
if (field === ChronoField.ERA) {
|
|
34215
34029
|
var erasData = cldr.main('dates/calendars/gregorian/eras');
|
|
34216
34030
|
var _styleMap3 = {};
|
|
@@ -34228,7 +34042,6 @@ var CldrDateTimeTextProvider = function () {
|
|
|
34228
34042
|
_styleMap3[TextStyle.SHORT] = _data3;
|
|
34229
34043
|
return this._createLocaleStore(_styleMap3);
|
|
34230
34044
|
}
|
|
34231
|
-
|
|
34232
34045
|
if (field === IsoFields.QUARTER_OF_YEAR) {
|
|
34233
34046
|
var quartersData = cldr.main('dates/calendars/gregorian/quarters/format');
|
|
34234
34047
|
var _styleMap4 = {};
|
|
@@ -34252,40 +34065,30 @@ var CldrDateTimeTextProvider = function () {
|
|
|
34252
34065
|
_styleMap4[TextStyle.SHORT] = _data4;
|
|
34253
34066
|
return this._createLocaleStore(_styleMap4);
|
|
34254
34067
|
}
|
|
34255
|
-
|
|
34256
34068
|
return null;
|
|
34257
34069
|
};
|
|
34258
|
-
|
|
34259
34070
|
_proto._createLocaleStore = function _createLocaleStore(valueTextMap) {
|
|
34260
34071
|
valueTextMap[TextStyle.FULL_STANDALONE] = valueTextMap[TextStyle.FULL];
|
|
34261
34072
|
valueTextMap[TextStyle.SHORT_STANDALONE] = valueTextMap[TextStyle.SHORT];
|
|
34262
|
-
|
|
34263
34073
|
if (Object.keys(valueTextMap).indexOf(TextStyle.NARROW) > -1 && Object.keys(valueTextMap).indexOf(TextStyle.NARROW_STANDALONE) === -1) {
|
|
34264
34074
|
valueTextMap[TextStyle.NARROW_STANDALONE] = valueTextMap[TextStyle.NARROW];
|
|
34265
34075
|
}
|
|
34266
|
-
|
|
34267
34076
|
return new LocaleStore(valueTextMap);
|
|
34268
34077
|
};
|
|
34269
|
-
|
|
34270
34078
|
return CldrDateTimeTextProvider;
|
|
34271
34079
|
}();
|
|
34272
34080
|
|
|
34273
34081
|
var _jodaInternal$assert$2 = _.assert,
|
|
34274
|
-
|
|
34275
|
-
|
|
34276
|
-
|
|
34082
|
+
requireNonNull$3 = _jodaInternal$assert$2.requireNonNull,
|
|
34083
|
+
requireInstance$2 = _jodaInternal$assert$2.requireInstance;
|
|
34277
34084
|
var LENGTH_COMPARATOR = function LENGTH_COMPARATOR(str1, str2) {
|
|
34278
34085
|
var cmp = str2.length - str1.length;
|
|
34279
|
-
|
|
34280
34086
|
if (cmp === 0) {
|
|
34281
34087
|
cmp = str1.localeCompare(str2);
|
|
34282
34088
|
}
|
|
34283
|
-
|
|
34284
34089
|
return cmp;
|
|
34285
34090
|
};
|
|
34286
|
-
|
|
34287
34091
|
var resolveZoneIdTextCache = {};
|
|
34288
|
-
|
|
34289
34092
|
var CldrZoneTextPrinterParser = function () {
|
|
34290
34093
|
function CldrZoneTextPrinterParser(textStyle) {
|
|
34291
34094
|
requireNonNull$3(textStyle, 'textStyle');
|
|
@@ -34295,69 +34098,52 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
34295
34098
|
loadCldrData('supplemental/likelySubtags.json');
|
|
34296
34099
|
loadCldrData('supplemental/metaZones.json');
|
|
34297
34100
|
}
|
|
34298
|
-
|
|
34299
34101
|
var _proto = CldrZoneTextPrinterParser.prototype;
|
|
34300
|
-
|
|
34301
34102
|
_proto._cachedResolveZoneIdText = function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
|
|
34302
34103
|
if (resolveZoneIdTextCache[cldr.locale] == null) {
|
|
34303
34104
|
resolveZoneIdTextCache[cldr.locale] = {};
|
|
34304
34105
|
}
|
|
34305
|
-
|
|
34306
34106
|
var zoneIdToStyle = resolveZoneIdTextCache[cldr.locale];
|
|
34307
|
-
|
|
34308
34107
|
if (zoneIdToStyle[zoneId] == null) {
|
|
34309
34108
|
zoneIdToStyle[zoneId] = {};
|
|
34310
34109
|
}
|
|
34311
|
-
|
|
34312
34110
|
var styleToType = zoneIdToStyle[zoneId];
|
|
34313
|
-
|
|
34314
34111
|
if (styleToType[style] == null) {
|
|
34315
34112
|
styleToType[style] = {};
|
|
34316
34113
|
}
|
|
34317
|
-
|
|
34318
34114
|
var typeToResolvedZoneIdText = styleToType[style];
|
|
34319
|
-
|
|
34320
34115
|
if (typeToResolvedZoneIdText[type] == null) {
|
|
34321
34116
|
typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
|
|
34322
34117
|
}
|
|
34323
|
-
|
|
34324
34118
|
return typeToResolvedZoneIdText[type];
|
|
34325
34119
|
};
|
|
34326
|
-
|
|
34327
34120
|
_proto._resolveZoneIdText = function _resolveZoneIdText(cldr, zoneId, style, type) {
|
|
34328
34121
|
var zoneData = cldr.main("dates/timeZoneNames/zone/" + zoneId + "/" + style + "/" + type);
|
|
34329
|
-
|
|
34330
34122
|
if (zoneData) {
|
|
34331
34123
|
return zoneData;
|
|
34332
34124
|
} else {
|
|
34333
34125
|
var metazoneInfo = cldr.get("supplemental/metaZones/metazoneInfo/timezone/" + zoneId);
|
|
34334
|
-
|
|
34335
34126
|
if (metazoneInfo) {
|
|
34336
34127
|
var metazone = metazoneInfo[metazoneInfo.length - 1]['usesMetazone']['_mzone'];
|
|
34337
34128
|
var metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/" + type);
|
|
34338
|
-
|
|
34339
34129
|
if (metaZoneData) {
|
|
34340
34130
|
return metaZoneData;
|
|
34341
34131
|
} else {
|
|
34342
34132
|
metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/generic");
|
|
34343
|
-
|
|
34344
34133
|
if (!metaZoneData) {
|
|
34345
34134
|
metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/standard");
|
|
34346
34135
|
}
|
|
34347
|
-
|
|
34348
34136
|
if (metaZoneData) {
|
|
34349
34137
|
return metaZoneData;
|
|
34350
34138
|
} else {
|
|
34351
34139
|
var mapZones = getOrCreateMapZones(cldr);
|
|
34352
34140
|
var preferredZone = mapZones[metazone][cldr.attributes.territory];
|
|
34353
|
-
|
|
34354
34141
|
if (preferredZone) {
|
|
34355
34142
|
if (preferredZone !== zoneId) {
|
|
34356
34143
|
return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
|
|
34357
34144
|
}
|
|
34358
34145
|
} else {
|
|
34359
34146
|
var goldenZone = mapZones[metazone]['001'];
|
|
34360
|
-
|
|
34361
34147
|
if (goldenZone !== zoneId) {
|
|
34362
34148
|
return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
|
|
34363
34149
|
}
|
|
@@ -34367,14 +34153,11 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
34367
34153
|
}
|
|
34368
34154
|
}
|
|
34369
34155
|
};
|
|
34370
|
-
|
|
34371
34156
|
_proto.print = function print(context, buf) {
|
|
34372
34157
|
var zone = context.getValueQuery(TemporalQueries.zoneId());
|
|
34373
|
-
|
|
34374
34158
|
if (zone == null) {
|
|
34375
34159
|
return false;
|
|
34376
34160
|
}
|
|
34377
|
-
|
|
34378
34161
|
if (zone.normalized() instanceof ZoneOffset) {
|
|
34379
34162
|
buf.append(zone.id());
|
|
34380
34163
|
return true;
|
|
@@ -34383,51 +34166,38 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
34383
34166
|
var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
|
|
34384
34167
|
loadCldrData("main/" + context.locale().localeString() + "/timeZoneNames.json");
|
|
34385
34168
|
var cldr = getOrCreateCldrInstance(context.locale().localeString());
|
|
34386
|
-
|
|
34387
34169
|
var text = this._cachedResolveZoneIdText(cldr, zone.id(), tzstyle, tzType);
|
|
34388
|
-
|
|
34389
34170
|
if (text) {
|
|
34390
34171
|
buf.append(text);
|
|
34391
34172
|
} else {
|
|
34392
34173
|
buf.append(zone.id());
|
|
34393
34174
|
}
|
|
34394
|
-
|
|
34395
34175
|
return true;
|
|
34396
34176
|
};
|
|
34397
|
-
|
|
34398
34177
|
_proto._resolveZoneIds = function _resolveZoneIds(localString) {
|
|
34399
34178
|
if (this._zoneIdsLocales[localString] != null) {
|
|
34400
34179
|
return this._zoneIdsLocales[localString];
|
|
34401
34180
|
}
|
|
34402
|
-
|
|
34403
34181
|
var ids = {};
|
|
34404
34182
|
loadCldrData("main/" + localString + "/timeZoneNames.json");
|
|
34405
34183
|
var cldr = getOrCreateCldrInstance(localString);
|
|
34406
|
-
|
|
34407
34184
|
for (var _iterator = _createForOfIteratorHelperLoose(ZoneRulesProvider.getAvailableZoneIds()), _step; !(_step = _iterator()).done;) {
|
|
34408
34185
|
var id = _step.value;
|
|
34409
34186
|
ids[id] = id;
|
|
34410
34187
|
var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
|
|
34411
|
-
|
|
34412
34188
|
var genericText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'generic');
|
|
34413
|
-
|
|
34414
34189
|
if (genericText) {
|
|
34415
34190
|
ids[genericText] = id;
|
|
34416
34191
|
}
|
|
34417
|
-
|
|
34418
34192
|
var standardText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'standard');
|
|
34419
|
-
|
|
34420
34193
|
if (standardText) {
|
|
34421
34194
|
ids[standardText] = id;
|
|
34422
34195
|
}
|
|
34423
|
-
|
|
34424
34196
|
var daylightText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'daylight');
|
|
34425
|
-
|
|
34426
34197
|
if (daylightText) {
|
|
34427
34198
|
ids[daylightText] = id;
|
|
34428
34199
|
}
|
|
34429
34200
|
}
|
|
34430
|
-
|
|
34431
34201
|
var sortedKeys = Object.keys(ids).sort(LENGTH_COMPARATOR);
|
|
34432
34202
|
this._zoneIdsLocales[localString] = {
|
|
34433
34203
|
ids: ids,
|
|
@@ -34435,37 +34205,29 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
34435
34205
|
};
|
|
34436
34206
|
return this._zoneIdsLocales[localString];
|
|
34437
34207
|
};
|
|
34438
|
-
|
|
34439
34208
|
_proto.parse = function parse(context, text, position) {
|
|
34440
34209
|
for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
|
|
34441
34210
|
var name = _arr[_i];
|
|
34442
|
-
|
|
34443
34211
|
if (context.subSequenceEquals(text, position, name, 0, name.length)) {
|
|
34444
34212
|
context.setParsedZone(ZoneId.of(name));
|
|
34445
34213
|
return position + name.length;
|
|
34446
34214
|
}
|
|
34447
34215
|
}
|
|
34448
|
-
|
|
34449
34216
|
var _this$_resolveZoneIds = this._resolveZoneIds(context.locale().localeString()),
|
|
34450
|
-
|
|
34451
|
-
|
|
34452
|
-
|
|
34217
|
+
ids = _this$_resolveZoneIds.ids,
|
|
34218
|
+
sortedKeys = _this$_resolveZoneIds.sortedKeys;
|
|
34453
34219
|
for (var _iterator2 = _createForOfIteratorHelperLoose(sortedKeys), _step2; !(_step2 = _iterator2()).done;) {
|
|
34454
34220
|
var _name = _step2.value;
|
|
34455
|
-
|
|
34456
34221
|
if (context.subSequenceEquals(text, position, _name, 0, _name.length)) {
|
|
34457
34222
|
context.setParsedZone(ZoneId.of(ids[_name]));
|
|
34458
34223
|
return position + _name.length;
|
|
34459
34224
|
}
|
|
34460
34225
|
}
|
|
34461
|
-
|
|
34462
34226
|
return ~position;
|
|
34463
34227
|
};
|
|
34464
|
-
|
|
34465
34228
|
_proto.toString = function toString() {
|
|
34466
34229
|
return "ZoneText(" + this._textStyle + ")";
|
|
34467
34230
|
};
|
|
34468
|
-
|
|
34469
34231
|
return CldrZoneTextPrinterParser;
|
|
34470
34232
|
}();
|
|
34471
34233
|
|
|
@@ -34475,178 +34237,127 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
34475
34237
|
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
34476
34238
|
*/
|
|
34477
34239
|
var MathUtil$1 = _.MathUtil;
|
|
34478
|
-
|
|
34479
34240
|
var LocalizedOffsetPrinterParser = function () {
|
|
34480
34241
|
function LocalizedOffsetPrinterParser(textStyle) {
|
|
34481
34242
|
this._textStyle = textStyle;
|
|
34482
34243
|
}
|
|
34483
|
-
|
|
34484
34244
|
var _proto = LocalizedOffsetPrinterParser.prototype;
|
|
34485
|
-
|
|
34486
34245
|
_proto.textStyle = function textStyle() {
|
|
34487
34246
|
return this._textStyle;
|
|
34488
34247
|
};
|
|
34489
|
-
|
|
34490
34248
|
_proto.print = function print(context, buf) {
|
|
34491
34249
|
var offsetSecs = context.getValue(ChronoField.OFFSET_SECONDS);
|
|
34492
|
-
|
|
34493
34250
|
if (offsetSecs == null) {
|
|
34494
34251
|
return false;
|
|
34495
34252
|
}
|
|
34496
|
-
|
|
34497
34253
|
buf.append('GMT');
|
|
34498
|
-
|
|
34499
34254
|
if (this._textStyle === TextStyle.FULL) {
|
|
34500
34255
|
return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').print(context, buf);
|
|
34501
34256
|
}
|
|
34502
|
-
|
|
34503
34257
|
var totalSecs = MathUtil$1.safeToInt(offsetSecs);
|
|
34504
|
-
|
|
34505
34258
|
if (totalSecs !== 0) {
|
|
34506
34259
|
var absHours = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 3600), 100));
|
|
34507
34260
|
var absMinutes = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 60), 60));
|
|
34508
34261
|
var absSeconds = Math.abs(MathUtil$1.intMod(totalSecs, 60));
|
|
34509
34262
|
buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
|
|
34510
|
-
|
|
34511
34263
|
if (absMinutes > 0 || absSeconds > 0) {
|
|
34512
34264
|
buf.append(':').append(MathUtil$1.intDiv(absMinutes, 10)).append(MathUtil$1.intMod(absMinutes, 10));
|
|
34513
|
-
|
|
34514
34265
|
if (absSeconds > 0) {
|
|
34515
34266
|
buf.append(':').append(MathUtil$1.intDiv(absSeconds, 10)).append(MathUtil$1.intMod(absSeconds, 10));
|
|
34516
34267
|
}
|
|
34517
34268
|
}
|
|
34518
34269
|
}
|
|
34519
|
-
|
|
34520
34270
|
return true;
|
|
34521
34271
|
};
|
|
34522
|
-
|
|
34523
34272
|
_proto.parse = function parse(context, text, position) {
|
|
34524
34273
|
if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
|
|
34525
34274
|
return ~position;
|
|
34526
34275
|
}
|
|
34527
|
-
|
|
34528
34276
|
position += 3;
|
|
34529
|
-
|
|
34530
34277
|
if (this._textStyle === TextStyle.FULL) {
|
|
34531
34278
|
return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').parse(context, text, position);
|
|
34532
34279
|
}
|
|
34533
|
-
|
|
34534
34280
|
var end = text.length;
|
|
34535
|
-
|
|
34536
34281
|
if (position === end) {
|
|
34537
34282
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
|
|
34538
34283
|
}
|
|
34539
|
-
|
|
34540
34284
|
var sign = text.charAt(position);
|
|
34541
|
-
|
|
34542
34285
|
if (sign !== '+' && sign !== '-') {
|
|
34543
34286
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
|
|
34544
34287
|
}
|
|
34545
|
-
|
|
34546
34288
|
var negative = sign === '-' ? -1 : 1;
|
|
34547
|
-
|
|
34548
34289
|
if (position === end) {
|
|
34549
34290
|
return ~position;
|
|
34550
34291
|
}
|
|
34551
|
-
|
|
34552
34292
|
position++;
|
|
34553
34293
|
var ch = text.charAt(position);
|
|
34554
|
-
|
|
34555
34294
|
if (ch < '0' || ch > '9') {
|
|
34556
34295
|
return ~position;
|
|
34557
34296
|
}
|
|
34558
|
-
|
|
34559
34297
|
position++;
|
|
34560
34298
|
var hour = MathUtil$1.parseInt(ch);
|
|
34561
|
-
|
|
34562
34299
|
if (position !== end) {
|
|
34563
34300
|
ch = text.charAt(position);
|
|
34564
|
-
|
|
34565
34301
|
if (ch >= '0' && ch <= '9') {
|
|
34566
34302
|
hour = hour * 10 + MathUtil$1.parseInt(ch);
|
|
34567
|
-
|
|
34568
34303
|
if (hour > 23) {
|
|
34569
34304
|
return ~position;
|
|
34570
34305
|
}
|
|
34571
|
-
|
|
34572
34306
|
position++;
|
|
34573
34307
|
}
|
|
34574
34308
|
}
|
|
34575
|
-
|
|
34576
34309
|
if (position === end || text.charAt(position) !== ':') {
|
|
34577
34310
|
var _offset = negative * 3600 * hour;
|
|
34578
|
-
|
|
34579
34311
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset, position, position);
|
|
34580
34312
|
}
|
|
34581
|
-
|
|
34582
34313
|
position++;
|
|
34583
|
-
|
|
34584
34314
|
if (position > end - 2) {
|
|
34585
34315
|
return ~position;
|
|
34586
34316
|
}
|
|
34587
|
-
|
|
34588
34317
|
ch = text.charAt(position);
|
|
34589
|
-
|
|
34590
34318
|
if (ch < '0' || ch > '9') {
|
|
34591
34319
|
return ~position;
|
|
34592
34320
|
}
|
|
34593
|
-
|
|
34594
34321
|
position++;
|
|
34595
34322
|
var min = MathUtil$1.parseInt(ch);
|
|
34596
34323
|
ch = text.charAt(position);
|
|
34597
|
-
|
|
34598
34324
|
if (ch < '0' || ch > '9') {
|
|
34599
34325
|
return ~position;
|
|
34600
34326
|
}
|
|
34601
|
-
|
|
34602
34327
|
position++;
|
|
34603
34328
|
min = min * 10 + MathUtil$1.parseInt(ch);
|
|
34604
|
-
|
|
34605
34329
|
if (min > 59) {
|
|
34606
34330
|
return ~position;
|
|
34607
34331
|
}
|
|
34608
|
-
|
|
34609
34332
|
if (position === end || text.charAt(position) !== ':') {
|
|
34610
34333
|
var _offset2 = negative * (3600 * hour + 60 * min);
|
|
34611
|
-
|
|
34612
34334
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset2, position, position);
|
|
34613
34335
|
}
|
|
34614
|
-
|
|
34615
34336
|
position++;
|
|
34616
|
-
|
|
34617
34337
|
if (position > end - 2) {
|
|
34618
34338
|
return ~position;
|
|
34619
34339
|
}
|
|
34620
|
-
|
|
34621
34340
|
ch = text.charAt(position);
|
|
34622
|
-
|
|
34623
34341
|
if (ch < '0' || ch > '9') {
|
|
34624
34342
|
return ~position;
|
|
34625
34343
|
}
|
|
34626
|
-
|
|
34627
34344
|
position++;
|
|
34628
34345
|
var sec = MathUtil$1.parseInt(ch);
|
|
34629
34346
|
ch = text.charAt(position);
|
|
34630
|
-
|
|
34631
34347
|
if (ch < '0' || ch > '9') {
|
|
34632
34348
|
return ~position;
|
|
34633
34349
|
}
|
|
34634
|
-
|
|
34635
34350
|
position++;
|
|
34636
34351
|
sec = sec * 10 + MathUtil$1.parseInt(ch);
|
|
34637
|
-
|
|
34638
34352
|
if (sec > 59) {
|
|
34639
34353
|
return ~position;
|
|
34640
34354
|
}
|
|
34641
|
-
|
|
34642
34355
|
var offset = negative * (3600 * hour + 60 * min + sec);
|
|
34643
34356
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, offset, position, position);
|
|
34644
34357
|
};
|
|
34645
|
-
|
|
34646
34358
|
_proto.toString = function toString() {
|
|
34647
34359
|
return "LocalizedOffset(" + this._textStyle + ")";
|
|
34648
34360
|
};
|
|
34649
|
-
|
|
34650
34361
|
return LocalizedOffsetPrinterParser;
|
|
34651
34362
|
}();
|
|
34652
34363
|
|
|
@@ -34655,9 +34366,9 @@ var LocalizedOffsetPrinterParser = function () {
|
|
|
34655
34366
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
34656
34367
|
*/
|
|
34657
34368
|
var MathUtil = _.MathUtil,
|
|
34658
|
-
|
|
34659
|
-
|
|
34660
|
-
|
|
34369
|
+
_jodaInternal$assert$1 = _.assert,
|
|
34370
|
+
requireNonNull$2 = _jodaInternal$assert$1.requireNonNull,
|
|
34371
|
+
requireInstance$1 = _jodaInternal$assert$1.requireInstance;
|
|
34661
34372
|
var DAY_OF_WEEK_RANGE = ValueRange.of(1, 7);
|
|
34662
34373
|
var WEEK_OF_MONTH_RANGE = ValueRange.of(0, 1, 4, 6);
|
|
34663
34374
|
var WEEK_OF_YEAR_RANGE = ValueRange.of(0, 1, 52, 54);
|
|
@@ -34676,23 +34387,18 @@ var ComputedDayOfField = function () {
|
|
|
34676
34387
|
ComputedDayOfField.ofDayOfWeekField = function ofDayOfWeekField(weekDef) {
|
|
34677
34388
|
return new ComputedDayOfField('DayOfWeek', weekDef, ChronoUnit.DAYS, ChronoUnit.WEEKS, DAY_OF_WEEK_RANGE);
|
|
34678
34389
|
};
|
|
34679
|
-
|
|
34680
34390
|
ComputedDayOfField.ofWeekOfMonthField = function ofWeekOfMonthField(weekDef) {
|
|
34681
34391
|
return new ComputedDayOfField('WeekOfMonth', weekDef, ChronoUnit.WEEKS, ChronoUnit.MONTHS, WEEK_OF_MONTH_RANGE);
|
|
34682
34392
|
};
|
|
34683
|
-
|
|
34684
34393
|
ComputedDayOfField.ofWeekOfYearField = function ofWeekOfYearField(weekDef) {
|
|
34685
34394
|
return new ComputedDayOfField('WeekOfYear', weekDef, ChronoUnit.WEEKS, ChronoUnit.YEARS, WEEK_OF_YEAR_RANGE);
|
|
34686
34395
|
};
|
|
34687
|
-
|
|
34688
34396
|
ComputedDayOfField.ofWeekOfWeekBasedYearField = function ofWeekOfWeekBasedYearField(weekDef) {
|
|
34689
34397
|
return new ComputedDayOfField('WeekOfWeekBasedYear', weekDef, ChronoUnit.WEEKS, IsoFields.WEEK_BASED_YEARS, WEEK_OF_WEEK_BASED_YEAR_RANGE);
|
|
34690
34398
|
};
|
|
34691
|
-
|
|
34692
34399
|
ComputedDayOfField.ofWeekBasedYearField = function ofWeekBasedYearField(weekDef) {
|
|
34693
34400
|
return new ComputedDayOfField('WeekBasedYear', weekDef, IsoFields.WEEK_BASED_YEARS, ChronoUnit.FOREVER, WEEK_BASED_YEAR_RANGE);
|
|
34694
34401
|
};
|
|
34695
|
-
|
|
34696
34402
|
function ComputedDayOfField(name, weekDef, baseUnit, rangeUnit, range) {
|
|
34697
34403
|
this._name = name;
|
|
34698
34404
|
this._weekDef = weekDef;
|
|
@@ -34700,14 +34406,10 @@ var ComputedDayOfField = function () {
|
|
|
34700
34406
|
this._rangeUnit = rangeUnit;
|
|
34701
34407
|
this._range = range;
|
|
34702
34408
|
}
|
|
34703
|
-
|
|
34704
34409
|
var _proto = ComputedDayOfField.prototype;
|
|
34705
|
-
|
|
34706
34410
|
_proto.getFrom = function getFrom(temporal) {
|
|
34707
34411
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
34708
|
-
|
|
34709
34412
|
var dow = this._localizedDayOfWeek(temporal, sow);
|
|
34710
|
-
|
|
34711
34413
|
if (this._rangeUnit === ChronoUnit.WEEKS) {
|
|
34712
34414
|
return dow;
|
|
34713
34415
|
} else if (this._rangeUnit === ChronoUnit.MONTHS) {
|
|
@@ -34722,112 +34424,79 @@ var ComputedDayOfField = function () {
|
|
|
34722
34424
|
throw new IllegalStateException('unreachable');
|
|
34723
34425
|
}
|
|
34724
34426
|
};
|
|
34725
|
-
|
|
34726
34427
|
_proto._localizedDayOfWeek = function _localizedDayOfWeek(temporal, sow) {
|
|
34727
34428
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
34728
34429
|
return MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
34729
34430
|
};
|
|
34730
|
-
|
|
34731
34431
|
_proto._localizedWeekOfMonth = function _localizedWeekOfMonth(temporal, dow) {
|
|
34732
34432
|
var dom = temporal.get(ChronoField.DAY_OF_MONTH);
|
|
34733
|
-
|
|
34734
34433
|
var offset = this._startOfWeekOffset(dom, dow);
|
|
34735
|
-
|
|
34736
34434
|
return ComputedDayOfField._computeWeek(offset, dom);
|
|
34737
34435
|
};
|
|
34738
|
-
|
|
34739
34436
|
_proto._localizedWeekOfYear = function _localizedWeekOfYear(temporal, dow) {
|
|
34740
34437
|
var doy = temporal.get(ChronoField.DAY_OF_YEAR);
|
|
34741
|
-
|
|
34742
34438
|
var offset = this._startOfWeekOffset(doy, dow);
|
|
34743
|
-
|
|
34744
34439
|
return ComputedDayOfField._computeWeek(offset, doy);
|
|
34745
34440
|
};
|
|
34746
|
-
|
|
34747
34441
|
_proto._localizedWOWBY = function _localizedWOWBY(temporal) {
|
|
34748
34442
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
34749
|
-
|
|
34750
34443
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
34751
34444
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
34752
|
-
|
|
34753
34445
|
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
34754
|
-
|
|
34755
34446
|
if (woy === 0) {
|
|
34756
34447
|
var previous = LocalDate.from(temporal).minus(1, ChronoUnit.WEEKS);
|
|
34757
34448
|
return this._localizedWeekOfYear(previous, dow) + 1;
|
|
34758
34449
|
} else if (woy >= 53) {
|
|
34759
34450
|
var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
|
|
34760
|
-
|
|
34761
34451
|
var year = temporal.get(ChronoField.YEAR);
|
|
34762
34452
|
var yearLen = Year.isLeap(year) ? 366 : 365;
|
|
34763
|
-
|
|
34764
34453
|
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
34765
|
-
|
|
34766
34454
|
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
34767
34455
|
return woy - (weekIndexOfFirstWeekNextYear - 1);
|
|
34768
34456
|
}
|
|
34769
34457
|
}
|
|
34770
|
-
|
|
34771
34458
|
return woy;
|
|
34772
34459
|
};
|
|
34773
|
-
|
|
34774
34460
|
_proto._localizedWBY = function _localizedWBY(temporal) {
|
|
34775
34461
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
34776
|
-
|
|
34777
34462
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
34778
34463
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
34779
34464
|
var year = temporal.get(ChronoField.YEAR);
|
|
34780
|
-
|
|
34781
34465
|
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
34782
|
-
|
|
34783
34466
|
if (woy === 0) {
|
|
34784
34467
|
return year - 1;
|
|
34785
34468
|
} else if (woy < 53) {
|
|
34786
34469
|
return year;
|
|
34787
34470
|
}
|
|
34788
|
-
|
|
34789
34471
|
var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
|
|
34790
|
-
|
|
34791
34472
|
var yearLen = Year.isLeap(year) ? 366 : 365;
|
|
34792
|
-
|
|
34793
34473
|
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
34794
|
-
|
|
34795
34474
|
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
34796
34475
|
return year + 1;
|
|
34797
34476
|
}
|
|
34798
|
-
|
|
34799
34477
|
return year;
|
|
34800
34478
|
};
|
|
34801
|
-
|
|
34802
34479
|
_proto._startOfWeekOffset = function _startOfWeekOffset(day, dow) {
|
|
34803
34480
|
var weekStart = MathUtil.floorMod(day - dow, 7);
|
|
34804
34481
|
var offset = -weekStart;
|
|
34805
|
-
|
|
34806
34482
|
if (weekStart + 1 > this._weekDef.minimalDaysInFirstWeek()) {
|
|
34807
34483
|
offset = 7 - weekStart;
|
|
34808
34484
|
}
|
|
34809
|
-
|
|
34810
34485
|
return offset;
|
|
34811
34486
|
};
|
|
34812
|
-
|
|
34813
34487
|
ComputedDayOfField._computeWeek = function _computeWeek(offset, day) {
|
|
34814
34488
|
return MathUtil.intDiv(7 + offset + (day - 1), 7);
|
|
34815
34489
|
};
|
|
34816
|
-
|
|
34817
34490
|
_proto.adjustInto = function adjustInto(temporal, newValue) {
|
|
34818
34491
|
var newVal = this._range.checkValidIntValue(newValue, this);
|
|
34819
|
-
|
|
34820
34492
|
var currentVal = temporal.get(this);
|
|
34821
|
-
|
|
34822
34493
|
if (newVal === currentVal) {
|
|
34823
34494
|
return temporal;
|
|
34824
34495
|
}
|
|
34825
|
-
|
|
34826
34496
|
if (this._rangeUnit === ChronoUnit.FOREVER) {
|
|
34827
34497
|
var baseWowby = temporal.get(this._weekDef.weekOfWeekBasedYear());
|
|
34828
34498
|
var diffWeeks = MathUtil.roundDown((newValue - currentVal) * 52.1775);
|
|
34829
34499
|
var result = temporal.plus(diffWeeks, ChronoUnit.WEEKS);
|
|
34830
|
-
|
|
34831
34500
|
if (result.get(this) > newVal) {
|
|
34832
34501
|
var newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
|
|
34833
34502
|
result = result.minus(newWowby, ChronoUnit.WEEKS);
|
|
@@ -34835,140 +34504,96 @@ var ComputedDayOfField = function () {
|
|
|
34835
34504
|
if (result.get(this) < newVal) {
|
|
34836
34505
|
result = result.plus(2, ChronoUnit.WEEKS);
|
|
34837
34506
|
}
|
|
34838
|
-
|
|
34839
34507
|
var _newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
|
|
34840
|
-
|
|
34841
34508
|
result = result.plus(baseWowby - _newWowby, ChronoUnit.WEEKS);
|
|
34842
|
-
|
|
34843
34509
|
if (result.get(this) > newVal) {
|
|
34844
34510
|
result = result.minus(1, ChronoUnit.WEEKS);
|
|
34845
34511
|
}
|
|
34846
34512
|
}
|
|
34847
|
-
|
|
34848
34513
|
return result;
|
|
34849
34514
|
}
|
|
34850
|
-
|
|
34851
34515
|
var delta = newVal - currentVal;
|
|
34852
34516
|
return temporal.plus(delta, this._baseUnit);
|
|
34853
34517
|
};
|
|
34854
|
-
|
|
34855
34518
|
_proto.resolve = function resolve(fieldValues, partialTemporal, resolverStyle) {
|
|
34856
34519
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
34857
|
-
|
|
34858
34520
|
if (this._rangeUnit === ChronoUnit.WEEKS) {
|
|
34859
34521
|
var value = fieldValues.remove(this);
|
|
34860
|
-
|
|
34861
34522
|
var localDow = this._range.checkValidIntValue(value, this);
|
|
34862
|
-
|
|
34863
34523
|
var _isoDow = MathUtil.floorMod(sow - 1 + (localDow - 1), 7) + 1;
|
|
34864
|
-
|
|
34865
34524
|
fieldValues.put(ChronoField.DAY_OF_WEEK, _isoDow);
|
|
34866
34525
|
return null;
|
|
34867
34526
|
}
|
|
34868
|
-
|
|
34869
34527
|
if (fieldValues.containsKey(ChronoField.DAY_OF_WEEK) === false) {
|
|
34870
34528
|
return null;
|
|
34871
34529
|
}
|
|
34872
|
-
|
|
34873
34530
|
if (this._rangeUnit === ChronoUnit.FOREVER) {
|
|
34874
34531
|
if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
|
|
34875
34532
|
return null;
|
|
34876
34533
|
}
|
|
34877
|
-
|
|
34878
34534
|
var _isoDow2 = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
|
|
34879
|
-
|
|
34880
34535
|
var _dow = MathUtil.floorMod(_isoDow2 - sow, 7) + 1;
|
|
34881
|
-
|
|
34882
34536
|
var wby = this.range().checkValidIntValue(fieldValues.get(this), this);
|
|
34883
34537
|
var date;
|
|
34884
34538
|
var days;
|
|
34885
|
-
|
|
34886
34539
|
if (resolverStyle === ResolverStyle.LENIENT) {
|
|
34887
34540
|
date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
34888
34541
|
var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
|
|
34889
|
-
|
|
34890
34542
|
var dateDow = this._localizedDayOfWeek(date, sow);
|
|
34891
|
-
|
|
34892
34543
|
var weeks = wowby - this._localizedWeekOfYear(date, dateDow);
|
|
34893
|
-
|
|
34894
34544
|
days = weeks * 7 + (_dow - dateDow);
|
|
34895
34545
|
} else {
|
|
34896
34546
|
date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
34897
|
-
|
|
34898
34547
|
var _wowby = this._weekDef.weekOfWeekBasedYear().range().checkValidIntValue(fieldValues.get(this._weekDef.weekOfWeekBasedYear()), this._weekDef.weekOfWeekBasedYear);
|
|
34899
|
-
|
|
34900
34548
|
var _dateDow = this._localizedDayOfWeek(date, sow);
|
|
34901
|
-
|
|
34902
34549
|
var _weeks = _wowby - this._localizedWeekOfYear(date, _dateDow);
|
|
34903
|
-
|
|
34904
34550
|
days = _weeks * 7 + (_dow - _dateDow);
|
|
34905
34551
|
}
|
|
34906
|
-
|
|
34907
34552
|
date = date.plus(days, ChronoUnit.DAYS);
|
|
34908
|
-
|
|
34909
34553
|
if (resolverStyle === ResolverStyle.STRICT) {
|
|
34910
34554
|
if (date.getLong(this) !== fieldValues.get(this)) {
|
|
34911
34555
|
throw new DateTimeException('Strict mode rejected date parsed to a different year');
|
|
34912
34556
|
}
|
|
34913
34557
|
}
|
|
34914
|
-
|
|
34915
34558
|
fieldValues.remove(this);
|
|
34916
34559
|
fieldValues.remove(this._weekDef.weekOfWeekBasedYear());
|
|
34917
34560
|
fieldValues.remove(ChronoField.DAY_OF_WEEK);
|
|
34918
34561
|
return date;
|
|
34919
34562
|
}
|
|
34920
|
-
|
|
34921
34563
|
if (fieldValues.containsKey(ChronoField.YEAR) === false) {
|
|
34922
34564
|
return null;
|
|
34923
34565
|
}
|
|
34924
|
-
|
|
34925
34566
|
var isoDow = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
|
|
34926
34567
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
34927
34568
|
var year = ChronoField.YEAR.checkValidIntValue(fieldValues.get(ChronoField.YEAR));
|
|
34928
|
-
|
|
34929
34569
|
if (this._rangeUnit === ChronoUnit.MONTHS) {
|
|
34930
34570
|
if (fieldValues.containsKey(ChronoField.MONTH_OF_YEAR) === false) {
|
|
34931
34571
|
return null;
|
|
34932
34572
|
}
|
|
34933
|
-
|
|
34934
34573
|
var _value = fieldValues.remove(this);
|
|
34935
|
-
|
|
34936
34574
|
var _date;
|
|
34937
|
-
|
|
34938
34575
|
var _days;
|
|
34939
|
-
|
|
34940
34576
|
if (resolverStyle === ResolverStyle.LENIENT) {
|
|
34941
34577
|
var month = fieldValues.get(ChronoField.MONTH_OF_YEAR);
|
|
34942
34578
|
_date = LocalDate.of(year, 1, 1);
|
|
34943
34579
|
_date = _date.plus(month - 1, ChronoUnit.MONTHS);
|
|
34944
|
-
|
|
34945
34580
|
var _dateDow2 = this._localizedDayOfWeek(_date, sow);
|
|
34946
|
-
|
|
34947
34581
|
var _weeks2 = _value - this._localizedWeekOfMonth(_date, _dateDow2);
|
|
34948
|
-
|
|
34949
34582
|
_days = _weeks2 * 7 + (dow - _dateDow2);
|
|
34950
34583
|
} else {
|
|
34951
34584
|
var _month = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.get(ChronoField.MONTH_OF_YEAR));
|
|
34952
|
-
|
|
34953
34585
|
_date = LocalDate.of(year, _month, 8);
|
|
34954
|
-
|
|
34955
34586
|
var _dateDow3 = this._localizedDayOfWeek(_date, sow);
|
|
34956
|
-
|
|
34957
34587
|
var wom = this._range.checkValidIntValue(_value, this);
|
|
34958
|
-
|
|
34959
34588
|
var _weeks3 = wom - this._localizedWeekOfMonth(_date, _dateDow3);
|
|
34960
|
-
|
|
34961
34589
|
_days = _weeks3 * 7 + (dow - _dateDow3);
|
|
34962
34590
|
}
|
|
34963
|
-
|
|
34964
34591
|
_date = _date.plus(_days, ChronoUnit.DAYS);
|
|
34965
|
-
|
|
34966
34592
|
if (resolverStyle === ResolverStyle.STRICT) {
|
|
34967
34593
|
if (_date.getLong(ChronoField.MONTH_OF_YEAR) !== fieldValues.get(ChronoField.MONTH_OF_YEAR)) {
|
|
34968
34594
|
throw new DateTimeException('Strict mode rejected date parsed to a different month');
|
|
34969
34595
|
}
|
|
34970
34596
|
}
|
|
34971
|
-
|
|
34972
34597
|
fieldValues.remove(this);
|
|
34973
34598
|
fieldValues.remove(ChronoField.YEAR);
|
|
34974
34599
|
fieldValues.remove(ChronoField.MONTH_OF_YEAR);
|
|
@@ -34976,35 +34601,24 @@ var ComputedDayOfField = function () {
|
|
|
34976
34601
|
return _date;
|
|
34977
34602
|
} else if (this._rangeUnit === ChronoUnit.YEARS) {
|
|
34978
34603
|
var _value2 = fieldValues.remove(this);
|
|
34979
|
-
|
|
34980
34604
|
var _date2 = LocalDate.of(year, 1, 1);
|
|
34981
|
-
|
|
34982
34605
|
var _days2;
|
|
34983
|
-
|
|
34984
34606
|
if (resolverStyle === ResolverStyle.LENIENT) {
|
|
34985
34607
|
var _dateDow4 = this._localizedDayOfWeek(_date2, sow);
|
|
34986
|
-
|
|
34987
34608
|
var _weeks4 = _value2 - this._localizedWeekOfYear(_date2, _dateDow4);
|
|
34988
|
-
|
|
34989
34609
|
_days2 = _weeks4 * 7 + (dow - _dateDow4);
|
|
34990
34610
|
} else {
|
|
34991
34611
|
var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
|
|
34992
|
-
|
|
34993
34612
|
var woy = this._range.checkValidIntValue(_value2, this);
|
|
34994
|
-
|
|
34995
34613
|
var _weeks5 = woy - this._localizedWeekOfYear(_date2, _dateDow5);
|
|
34996
|
-
|
|
34997
34614
|
_days2 = _weeks5 * 7 + (dow - _dateDow5);
|
|
34998
34615
|
}
|
|
34999
|
-
|
|
35000
34616
|
_date2 = _date2.plus(_days2, ChronoUnit.DAYS);
|
|
35001
|
-
|
|
35002
34617
|
if (resolverStyle === ResolverStyle.STRICT) {
|
|
35003
34618
|
if (_date2.getLong(ChronoField.YEAR) !== fieldValues.get(ChronoField.YEAR)) {
|
|
35004
34619
|
throw new DateTimeException('Strict mode rejected date parsed to a different year');
|
|
35005
34620
|
}
|
|
35006
34621
|
}
|
|
35007
|
-
|
|
35008
34622
|
fieldValues.remove(this);
|
|
35009
34623
|
fieldValues.remove(ChronoField.YEAR);
|
|
35010
34624
|
fieldValues.remove(ChronoField.DAY_OF_WEEK);
|
|
@@ -35013,31 +34627,24 @@ var ComputedDayOfField = function () {
|
|
|
35013
34627
|
throw new IllegalStateException('unreachable');
|
|
35014
34628
|
}
|
|
35015
34629
|
};
|
|
35016
|
-
|
|
35017
34630
|
_proto.name = function name() {
|
|
35018
34631
|
return this._name;
|
|
35019
34632
|
};
|
|
35020
|
-
|
|
35021
34633
|
_proto.baseUnit = function baseUnit() {
|
|
35022
34634
|
return this._baseUnit;
|
|
35023
34635
|
};
|
|
35024
|
-
|
|
35025
34636
|
_proto.rangeUnit = function rangeUnit() {
|
|
35026
34637
|
return this._rangeUnit;
|
|
35027
34638
|
};
|
|
35028
|
-
|
|
35029
34639
|
_proto.range = function range() {
|
|
35030
34640
|
return this._range;
|
|
35031
34641
|
};
|
|
35032
|
-
|
|
35033
34642
|
_proto.isDateBased = function isDateBased() {
|
|
35034
34643
|
return true;
|
|
35035
34644
|
};
|
|
35036
|
-
|
|
35037
34645
|
_proto.isTimeBased = function isTimeBased() {
|
|
35038
34646
|
return false;
|
|
35039
34647
|
};
|
|
35040
|
-
|
|
35041
34648
|
_proto.isSupportedBy = function isSupportedBy(temporal) {
|
|
35042
34649
|
if (temporal.isSupported(ChronoField.DAY_OF_WEEK)) {
|
|
35043
34650
|
if (this._rangeUnit === ChronoUnit.WEEKS) {
|
|
@@ -35052,17 +34659,13 @@ var ComputedDayOfField = function () {
|
|
|
35052
34659
|
return temporal.isSupported(ChronoField.EPOCH_DAY);
|
|
35053
34660
|
}
|
|
35054
34661
|
}
|
|
35055
|
-
|
|
35056
34662
|
return false;
|
|
35057
34663
|
};
|
|
35058
|
-
|
|
35059
34664
|
_proto.rangeRefinedBy = function rangeRefinedBy(temporal) {
|
|
35060
34665
|
if (this._rangeUnit === ChronoUnit.WEEKS) {
|
|
35061
34666
|
return this._range;
|
|
35062
34667
|
}
|
|
35063
|
-
|
|
35064
34668
|
var field = null;
|
|
35065
|
-
|
|
35066
34669
|
if (this._rangeUnit === ChronoUnit.MONTHS) {
|
|
35067
34670
|
field = ChronoField.DAY_OF_MONTH;
|
|
35068
34671
|
} else if (this._rangeUnit === ChronoUnit.YEARS) {
|
|
@@ -35074,58 +34677,40 @@ var ComputedDayOfField = function () {
|
|
|
35074
34677
|
} else {
|
|
35075
34678
|
throw new IllegalStateException('unreachable');
|
|
35076
34679
|
}
|
|
35077
|
-
|
|
35078
34680
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
35079
|
-
|
|
35080
34681
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
35081
34682
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
35082
|
-
|
|
35083
34683
|
var offset = this._startOfWeekOffset(temporal.get(field), dow);
|
|
35084
|
-
|
|
35085
34684
|
var fieldRange = temporal.range(field);
|
|
35086
34685
|
return ValueRange.of(ComputedDayOfField._computeWeek(offset, fieldRange.minimum()), ComputedDayOfField._computeWeek(offset, fieldRange.maximum()));
|
|
35087
34686
|
};
|
|
35088
|
-
|
|
35089
34687
|
_proto._rangeWOWBY = function _rangeWOWBY(temporal) {
|
|
35090
34688
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
35091
|
-
|
|
35092
34689
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
35093
34690
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
35094
|
-
|
|
35095
34691
|
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
35096
|
-
|
|
35097
34692
|
if (woy === 0) {
|
|
35098
34693
|
return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).minus(2, ChronoUnit.WEEKS));
|
|
35099
34694
|
}
|
|
35100
|
-
|
|
35101
34695
|
var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
|
|
35102
|
-
|
|
35103
34696
|
var year = temporal.get(ChronoField.YEAR);
|
|
35104
34697
|
var yearLen = Year.isLeap(year) ? 366 : 365;
|
|
35105
|
-
|
|
35106
34698
|
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
35107
|
-
|
|
35108
34699
|
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
35109
34700
|
return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).plus(2, ChronoUnit.WEEKS));
|
|
35110
34701
|
}
|
|
35111
|
-
|
|
35112
34702
|
return ValueRange.of(1, weekIndexOfFirstWeekNextYear - 1);
|
|
35113
34703
|
};
|
|
35114
|
-
|
|
35115
34704
|
_proto.displayName = function displayName(locale) {
|
|
35116
34705
|
requireNonNull$2(locale, 'locale');
|
|
35117
|
-
|
|
35118
34706
|
if (this._rangeUnit === ChronoUnit.YEARS) {
|
|
35119
34707
|
return 'Week';
|
|
35120
34708
|
}
|
|
35121
|
-
|
|
35122
34709
|
return this.toString();
|
|
35123
34710
|
};
|
|
35124
|
-
|
|
35125
34711
|
_proto.toString = function toString() {
|
|
35126
34712
|
return this._name + "[" + this._weekDef.toString() + "]";
|
|
35127
34713
|
};
|
|
35128
|
-
|
|
35129
34714
|
return ComputedDayOfField;
|
|
35130
34715
|
}();
|
|
35131
34716
|
var WeekFieldsCache = new Map();
|
|
@@ -35137,54 +34722,42 @@ var WeekFields = function () {
|
|
|
35137
34722
|
return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
|
|
35138
34723
|
}
|
|
35139
34724
|
};
|
|
35140
|
-
|
|
35141
34725
|
WeekFields.ofLocale = function ofLocale(locale) {
|
|
35142
34726
|
requireNonNull$2(locale, 'locale');
|
|
35143
|
-
|
|
35144
|
-
var cldr = new
|
|
34727
|
+
Cldr.load(cldrData('supplemental/weekData.json'));
|
|
34728
|
+
var cldr = new Cldr(locale.localeString());
|
|
35145
34729
|
var worldRegion = '001';
|
|
35146
34730
|
var weekData = cldr.get('supplemental/weekData');
|
|
35147
|
-
|
|
35148
34731
|
var dow = _weekDayMap[weekData.firstDay[locale.country()]];
|
|
35149
|
-
|
|
35150
34732
|
if (!dow) {
|
|
35151
34733
|
dow = _weekDayMap[weekData.firstDay[worldRegion]];
|
|
35152
34734
|
}
|
|
35153
|
-
|
|
35154
34735
|
var minDays = weekData.minDays[locale.country()];
|
|
35155
|
-
|
|
35156
34736
|
if (!minDays) {
|
|
35157
34737
|
minDays = weekData.minDays[worldRegion];
|
|
35158
34738
|
}
|
|
35159
|
-
|
|
35160
34739
|
return WeekFields.ofFirstDayOfWeekMinDays(dow, minDays);
|
|
35161
34740
|
};
|
|
35162
|
-
|
|
35163
34741
|
WeekFields.ofFirstDayOfWeekMinDays = function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
35164
34742
|
requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
|
|
35165
34743
|
requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
|
|
35166
34744
|
requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
35167
34745
|
var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
|
|
35168
34746
|
var rules = WeekFieldsCache.get(key);
|
|
35169
|
-
|
|
35170
34747
|
if (rules == null) {
|
|
35171
34748
|
rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
|
|
35172
34749
|
WeekFieldsCache.set(key, rules);
|
|
35173
34750
|
rules = WeekFieldsCache.get(key);
|
|
35174
34751
|
}
|
|
35175
|
-
|
|
35176
34752
|
return rules;
|
|
35177
34753
|
};
|
|
35178
|
-
|
|
35179
34754
|
function WeekFields(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
35180
34755
|
requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
|
|
35181
34756
|
requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
|
|
35182
34757
|
requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
35183
|
-
|
|
35184
34758
|
if (minimalDaysInFirstWeek < 1 || minimalDaysInFirstWeek > 7) {
|
|
35185
34759
|
throw new IllegalArgumentException('Minimal number of days is invalid');
|
|
35186
34760
|
}
|
|
35187
|
-
|
|
35188
34761
|
this._firstDayOfWeek = firstDayOfWeek;
|
|
35189
34762
|
this._minimalDays = minimalDaysInFirstWeek;
|
|
35190
34763
|
this._dayOfWeek = ComputedDayOfField.ofDayOfWeekField(this);
|
|
@@ -35192,59 +34765,45 @@ var WeekFields = function () {
|
|
|
35192
34765
|
this._weekOfYear = ComputedDayOfField.ofWeekOfYearField(this);
|
|
35193
34766
|
this._weekOfWeekBasedYear = ComputedDayOfField.ofWeekOfWeekBasedYearField(this);
|
|
35194
34767
|
this._weekBasedYear = ComputedDayOfField.ofWeekBasedYearField(this);
|
|
35195
|
-
|
|
34768
|
+
Cldr.load(cldrData('supplemental/likelySubtags.json'));
|
|
35196
34769
|
}
|
|
35197
|
-
|
|
35198
34770
|
var _proto2 = WeekFields.prototype;
|
|
35199
|
-
|
|
35200
34771
|
_proto2.firstDayOfWeek = function firstDayOfWeek() {
|
|
35201
34772
|
return this._firstDayOfWeek;
|
|
35202
34773
|
};
|
|
35203
|
-
|
|
35204
34774
|
_proto2.minimalDaysInFirstWeek = function minimalDaysInFirstWeek() {
|
|
35205
34775
|
return this._minimalDays;
|
|
35206
34776
|
};
|
|
35207
|
-
|
|
35208
34777
|
_proto2.dayOfWeek = function dayOfWeek() {
|
|
35209
34778
|
return this._dayOfWeek;
|
|
35210
34779
|
};
|
|
35211
|
-
|
|
35212
34780
|
_proto2.weekOfMonth = function weekOfMonth() {
|
|
35213
34781
|
return this._weekOfMonth;
|
|
35214
34782
|
};
|
|
35215
|
-
|
|
35216
34783
|
_proto2.weekOfYear = function weekOfYear() {
|
|
35217
34784
|
return this._weekOfYear;
|
|
35218
34785
|
};
|
|
35219
|
-
|
|
35220
34786
|
_proto2.weekOfWeekBasedYear = function weekOfWeekBasedYear() {
|
|
35221
34787
|
return this._weekOfWeekBasedYear;
|
|
35222
34788
|
};
|
|
35223
|
-
|
|
35224
34789
|
_proto2.weekBasedYear = function weekBasedYear() {
|
|
35225
34790
|
return this._weekBasedYear;
|
|
35226
34791
|
};
|
|
35227
|
-
|
|
35228
34792
|
_proto2.equals = function equals(other) {
|
|
35229
34793
|
if (this === other) {
|
|
35230
34794
|
return true;
|
|
35231
34795
|
}
|
|
35232
|
-
|
|
35233
34796
|
if (other instanceof WeekFields) {
|
|
35234
34797
|
return this.hashCode() === other.hashCode();
|
|
35235
34798
|
}
|
|
35236
|
-
|
|
35237
34799
|
return false;
|
|
35238
34800
|
};
|
|
35239
|
-
|
|
35240
34801
|
_proto2.hashCode = function hashCode() {
|
|
35241
34802
|
return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
|
|
35242
34803
|
};
|
|
35243
|
-
|
|
35244
34804
|
_proto2.toString = function toString() {
|
|
35245
34805
|
return "WeekFields[" + this._firstDayOfWeek + "," + this._minimalDays + "]";
|
|
35246
34806
|
};
|
|
35247
|
-
|
|
35248
34807
|
return WeekFields;
|
|
35249
34808
|
}();
|
|
35250
34809
|
function _init$2() {
|
|
@@ -35257,68 +34816,50 @@ function _init$2() {
|
|
|
35257
34816
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
35258
34817
|
*/
|
|
35259
34818
|
var StringBuilder = _.StringBuilder;
|
|
35260
|
-
|
|
35261
34819
|
var WeekFieldsPrinterParser = function () {
|
|
35262
34820
|
function WeekFieldsPrinterParser(letter, count) {
|
|
35263
34821
|
this._letter = letter;
|
|
35264
34822
|
this._count = count;
|
|
35265
34823
|
}
|
|
35266
|
-
|
|
35267
34824
|
var _proto = WeekFieldsPrinterParser.prototype;
|
|
35268
|
-
|
|
35269
34825
|
_proto.print = function print(context, buf) {
|
|
35270
34826
|
var weekFields = WeekFields.of(context.locale());
|
|
35271
|
-
|
|
35272
34827
|
var pp = this._evaluate(weekFields);
|
|
35273
|
-
|
|
35274
34828
|
return pp.print(context, buf);
|
|
35275
34829
|
};
|
|
35276
|
-
|
|
35277
34830
|
_proto.parse = function parse(context, text, position) {
|
|
35278
34831
|
var weekFields = WeekFields.of(context.locale());
|
|
35279
|
-
|
|
35280
34832
|
var pp = this._evaluate(weekFields);
|
|
35281
|
-
|
|
35282
34833
|
return pp.parse(context, text, position);
|
|
35283
34834
|
};
|
|
35284
|
-
|
|
35285
34835
|
_proto._evaluate = function _evaluate(weekFields) {
|
|
35286
34836
|
var pp = null;
|
|
35287
|
-
|
|
35288
34837
|
switch (this._letter) {
|
|
35289
34838
|
case 'e':
|
|
35290
34839
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
|
|
35291
34840
|
break;
|
|
35292
|
-
|
|
35293
34841
|
case 'c':
|
|
35294
34842
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
|
|
35295
34843
|
break;
|
|
35296
|
-
|
|
35297
34844
|
case 'w':
|
|
35298
34845
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfWeekBasedYear(), this._count, 2, SignStyle.NOT_NEGATIVE);
|
|
35299
34846
|
break;
|
|
35300
|
-
|
|
35301
34847
|
case 'W':
|
|
35302
34848
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfMonth(), 1, 2, SignStyle.NOT_NEGATIVE);
|
|
35303
34849
|
break;
|
|
35304
|
-
|
|
35305
34850
|
case 'Y':
|
|
35306
34851
|
if (this._count === 2) {
|
|
35307
34852
|
pp = new DateTimeFormatterBuilder.ReducedPrinterParser(weekFields.weekBasedYear(), 2, 2, 0, DateTimeFormatterBuilder.ReducedPrinterParser.BASE_DATE);
|
|
35308
34853
|
} else {
|
|
35309
34854
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekBasedYear(), this._count, 19, this._count < 4 ? SignStyle.NORMAL : SignStyle.EXCEEDS_PAD, -1);
|
|
35310
34855
|
}
|
|
35311
|
-
|
|
35312
34856
|
break;
|
|
35313
34857
|
}
|
|
35314
|
-
|
|
35315
34858
|
return pp;
|
|
35316
34859
|
};
|
|
35317
|
-
|
|
35318
34860
|
_proto.toString = function toString() {
|
|
35319
34861
|
var sb = new StringBuilder(30);
|
|
35320
34862
|
sb.append('Localized(');
|
|
35321
|
-
|
|
35322
34863
|
if (this._letter === 'Y') {
|
|
35323
34864
|
if (this._count === 1) {
|
|
35324
34865
|
sb.append('WeekBasedYear');
|
|
@@ -35335,31 +34876,24 @@ var WeekFieldsPrinterParser = function () {
|
|
|
35335
34876
|
} else if (this._letter === 'W') {
|
|
35336
34877
|
sb.append('WeekOfMonth');
|
|
35337
34878
|
}
|
|
35338
|
-
|
|
35339
34879
|
sb.append(',');
|
|
35340
34880
|
sb.append(this._count);
|
|
35341
34881
|
}
|
|
35342
|
-
|
|
35343
34882
|
sb.append(')');
|
|
35344
34883
|
return sb.toString();
|
|
35345
34884
|
};
|
|
35346
|
-
|
|
35347
34885
|
return WeekFieldsPrinterParser;
|
|
35348
34886
|
}();
|
|
35349
34887
|
|
|
35350
34888
|
var _jodaInternal$assert = _.assert,
|
|
35351
|
-
|
|
35352
|
-
|
|
35353
|
-
|
|
34889
|
+
requireNonNull$1 = _jodaInternal$assert.requireNonNull,
|
|
34890
|
+
requireInstance = _jodaInternal$assert.requireInstance;
|
|
35354
34891
|
var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
35355
34892
|
_inheritsLoose(CldrDateTimeFormatterBuilder, _DateTimeFormatterBui);
|
|
35356
|
-
|
|
35357
34893
|
function CldrDateTimeFormatterBuilder() {
|
|
35358
34894
|
return _DateTimeFormatterBui.apply(this, arguments) || this;
|
|
35359
34895
|
}
|
|
35360
|
-
|
|
35361
34896
|
var _proto = CldrDateTimeFormatterBuilder.prototype;
|
|
35362
|
-
|
|
35363
34897
|
_proto.appendText = function appendText(field, styleOrMap) {
|
|
35364
34898
|
if (styleOrMap === undefined) {
|
|
35365
34899
|
return this.appendTextField(field);
|
|
@@ -35369,29 +34903,22 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
|
35369
34903
|
return this.appendTextFieldMap(field, styleOrMap);
|
|
35370
34904
|
}
|
|
35371
34905
|
};
|
|
35372
|
-
|
|
35373
34906
|
_proto.appendTextField = function appendTextField(field) {
|
|
35374
34907
|
return this.appendTextFieldStyle(field, TextStyle.FULL);
|
|
35375
34908
|
};
|
|
35376
|
-
|
|
35377
34909
|
_proto.appendTextFieldStyle = function appendTextFieldStyle(field, textStyle) {
|
|
35378
34910
|
requireNonNull$1(field, 'field');
|
|
35379
34911
|
requireInstance(field, TemporalField, 'field');
|
|
35380
34912
|
requireNonNull$1(textStyle, 'textStyle');
|
|
35381
34913
|
requireInstance(textStyle, TextStyle, 'textStyle');
|
|
35382
|
-
|
|
35383
34914
|
this._appendInternal(new TextPrinterParser(field, textStyle, new CldrDateTimeTextProvider()));
|
|
35384
|
-
|
|
35385
34915
|
return this;
|
|
35386
34916
|
};
|
|
35387
|
-
|
|
35388
34917
|
_proto.appendTextFieldMap = function appendTextFieldMap(field, textLookup) {
|
|
35389
34918
|
requireNonNull$1(field, 'field');
|
|
35390
34919
|
requireInstance(field, ChronoField, 'field');
|
|
35391
34920
|
requireNonNull$1(textLookup, 'textLookup');
|
|
35392
|
-
|
|
35393
34921
|
var copy = _extends({}, textLookup);
|
|
35394
|
-
|
|
35395
34922
|
var map = {};
|
|
35396
34923
|
map[TextStyle.FULL] = copy;
|
|
35397
34924
|
var store = new LocaleStore(map);
|
|
@@ -35403,39 +34930,27 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
|
35403
34930
|
return store.getTextIterator(style);
|
|
35404
34931
|
}
|
|
35405
34932
|
};
|
|
35406
|
-
|
|
35407
34933
|
this._appendInternal(new TextPrinterParser(field, TextStyle.FULL, provider));
|
|
35408
|
-
|
|
35409
34934
|
return this;
|
|
35410
34935
|
};
|
|
35411
|
-
|
|
35412
34936
|
_proto.appendWeekField = function appendWeekField(field, count) {
|
|
35413
34937
|
requireNonNull$1(field, 'field');
|
|
35414
34938
|
requireNonNull$1(count, 'count');
|
|
35415
|
-
|
|
35416
34939
|
this._appendInternal(new WeekFieldsPrinterParser(field, count));
|
|
35417
|
-
|
|
35418
34940
|
return this;
|
|
35419
34941
|
};
|
|
35420
|
-
|
|
35421
34942
|
_proto.appendZoneText = function appendZoneText(textStyle) {
|
|
35422
34943
|
this._appendInternal(new CldrZoneTextPrinterParser(textStyle));
|
|
35423
|
-
|
|
35424
34944
|
return this;
|
|
35425
34945
|
};
|
|
35426
|
-
|
|
35427
34946
|
_proto.appendLocalizedOffset = function appendLocalizedOffset(textStyle) {
|
|
35428
34947
|
requireNonNull$1(textStyle, 'textStyle');
|
|
35429
|
-
|
|
35430
34948
|
if (textStyle !== TextStyle.FULL && textStyle !== TextStyle.SHORT) {
|
|
35431
34949
|
throw new IllegalArgumentException('Style must be either full or short');
|
|
35432
34950
|
}
|
|
35433
|
-
|
|
35434
34951
|
this._appendInternal(new LocalizedOffsetPrinterParser(textStyle));
|
|
35435
|
-
|
|
35436
34952
|
return this;
|
|
35437
34953
|
};
|
|
35438
|
-
|
|
35439
34954
|
return CldrDateTimeFormatterBuilder;
|
|
35440
34955
|
}(DateTimeFormatterBuilder);
|
|
35441
34956
|
|
|
@@ -35443,64 +34958,50 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
|
35443
34958
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
35444
34959
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
35445
34960
|
*/
|
|
35446
|
-
|
|
35447
34961
|
var Locale = function () {
|
|
35448
34962
|
Locale.getAvailableLocales = function getAvailableLocales() {
|
|
35449
34963
|
return new CldrDateTimeTextProvider().getAvailableLocales();
|
|
35450
34964
|
};
|
|
35451
|
-
|
|
35452
34965
|
function Locale(language, country, localeString) {
|
|
35453
34966
|
if (country === void 0) {
|
|
35454
34967
|
country = '';
|
|
35455
34968
|
}
|
|
35456
|
-
|
|
35457
34969
|
if (localeString === void 0) {
|
|
35458
34970
|
localeString = '';
|
|
35459
34971
|
}
|
|
35460
|
-
|
|
35461
34972
|
this._language = language;
|
|
35462
34973
|
this._country = country;
|
|
35463
34974
|
this._localeString = localeString;
|
|
35464
34975
|
}
|
|
35465
|
-
|
|
35466
34976
|
var _proto = Locale.prototype;
|
|
35467
|
-
|
|
35468
34977
|
_proto.language = function language() {
|
|
35469
34978
|
return this._language;
|
|
35470
34979
|
};
|
|
35471
|
-
|
|
35472
34980
|
_proto.country = function country() {
|
|
35473
34981
|
return this._country;
|
|
35474
34982
|
};
|
|
35475
|
-
|
|
35476
34983
|
_proto.localeString = function localeString() {
|
|
35477
34984
|
if (this._localeString.length > 0) {
|
|
35478
34985
|
return this._localeString;
|
|
35479
34986
|
}
|
|
35480
|
-
|
|
35481
34987
|
if (this._country.length > 0) {
|
|
35482
34988
|
return this._language + "-" + this._country;
|
|
35483
34989
|
} else {
|
|
35484
34990
|
return this._language;
|
|
35485
34991
|
}
|
|
35486
34992
|
};
|
|
35487
|
-
|
|
35488
34993
|
_proto.toString = function toString() {
|
|
35489
34994
|
return "Locale[" + this.localeString() + "]";
|
|
35490
34995
|
};
|
|
35491
|
-
|
|
35492
34996
|
_proto.equals = function equals(other) {
|
|
35493
34997
|
if (!other) {
|
|
35494
34998
|
return false;
|
|
35495
34999
|
}
|
|
35496
|
-
|
|
35497
35000
|
if (!(other instanceof Locale)) {
|
|
35498
35001
|
return false;
|
|
35499
35002
|
}
|
|
35500
|
-
|
|
35501
35003
|
return this.localeString() === other.localeString();
|
|
35502
35004
|
};
|
|
35503
|
-
|
|
35504
35005
|
return Locale;
|
|
35505
35006
|
}();
|
|
35506
35007
|
function _init$1() {
|
|
@@ -35526,26 +35027,19 @@ function _init$1() {
|
|
|
35526
35027
|
}
|
|
35527
35028
|
|
|
35528
35029
|
var requireNonNull = _.assert.requireNonNull;
|
|
35529
|
-
|
|
35530
35030
|
var LocaleDateTimeFormatter = function (_DateTimeFormatter) {
|
|
35531
35031
|
_inheritsLoose(LocaleDateTimeFormatter, _DateTimeFormatter);
|
|
35532
|
-
|
|
35533
35032
|
function LocaleDateTimeFormatter() {
|
|
35534
35033
|
return _DateTimeFormatter.apply(this, arguments) || this;
|
|
35535
35034
|
}
|
|
35536
|
-
|
|
35537
35035
|
var _proto = LocaleDateTimeFormatter.prototype;
|
|
35538
|
-
|
|
35539
35036
|
_proto.withLocale = function withLocale(locale) {
|
|
35540
35037
|
requireNonNull(locale, 'locale');
|
|
35541
|
-
|
|
35542
35038
|
if (locale.equals(this._locale)) {
|
|
35543
35039
|
return this;
|
|
35544
35040
|
}
|
|
35545
|
-
|
|
35546
35041
|
return new DateTimeFormatter(this._printerParser, locale, this._decimalStyle, this._resolverStyle, this._resolverFields, this._chrono, this._zone);
|
|
35547
35042
|
};
|
|
35548
|
-
|
|
35549
35043
|
return LocaleDateTimeFormatter;
|
|
35550
35044
|
}(DateTimeFormatter);
|
|
35551
35045
|
function _init() {
|
|
@@ -35580,24 +35074,17 @@ function _init() {
|
|
|
35580
35074
|
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
35581
35075
|
*/
|
|
35582
35076
|
var isInit = false;
|
|
35583
|
-
|
|
35584
35077
|
function init() {
|
|
35585
35078
|
if (isInit) {
|
|
35586
35079
|
return;
|
|
35587
35080
|
}
|
|
35588
|
-
|
|
35589
35081
|
isInit = true;
|
|
35590
35082
|
_init$1();
|
|
35591
35083
|
_init$2();
|
|
35592
35084
|
_init();
|
|
35593
35085
|
}
|
|
35594
|
-
|
|
35595
35086
|
init();
|
|
35596
35087
|
|
|
35597
|
-
/*
|
|
35598
|
-
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
35599
|
-
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
35600
|
-
*/
|
|
35601
35088
|
function plug (jsJoda) {
|
|
35602
35089
|
Object.getOwnPropertyNames(CldrDateTimeFormatterBuilder.prototype).forEach(function (prop) {
|
|
35603
35090
|
if (prop !== 'constructor') {
|