@js-joda/locale_sv-se 4.8.6 → 4.8.10

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 CHANGED
@@ -1,4 +1,4 @@
1
- //! @version @js-joda/locale - 4.8.5
1
+ //! @version @js-joda/locale - 4.8.9
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 || function (target) {
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 || function _setPrototypeOf(o, p) {
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
 
@@ -12297,8 +12261,7 @@ function cldrData(path) {
12297
12261
  /*
12298
12262
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
12299
12263
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
12300
- */
12301
- var createEntry = function createEntry(text, field) {
12264
+ */var createEntry = function createEntry(text, field) {
12302
12265
  return {
12303
12266
  key: text,
12304
12267
  value: field,
@@ -12307,11 +12270,9 @@ var createEntry = function createEntry(text, field) {
12307
12270
  }
12308
12271
  };
12309
12272
  };
12310
-
12311
12273
  var _comparator = function _comparator(obj1, obj2) {
12312
12274
  return obj2.key.length - obj1.key.length;
12313
12275
  };
12314
-
12315
12276
  var LocaleStore = function () {
12316
12277
  function LocaleStore(valueTextMap) {
12317
12278
  this._valueTextMap = valueTextMap;
@@ -12322,7 +12283,6 @@ var LocaleStore = function () {
12322
12283
  var list = [];
12323
12284
  Object.keys(valueTextMap[style]).forEach(function (key) {
12324
12285
  var value = valueTextMap[style][key];
12325
-
12326
12286
  if (reverse[value] === undefined) {
12327
12287
  reverse[value] = createEntry(value, parseInt(key));
12328
12288
  list.push(reverse[value]);
@@ -12336,25 +12296,35 @@ var LocaleStore = function () {
12336
12296
  allList.sort(_comparator);
12337
12297
  this._parsable = map;
12338
12298
  }
12339
-
12340
12299
  var _proto = LocaleStore.prototype;
12341
-
12342
12300
  _proto.getText = function getText(value, style) {
12343
12301
  var map = this._valueTextMap[style];
12344
12302
  return map != null ? map[value] : null;
12345
12303
  };
12346
-
12347
12304
  _proto.getTextIterator = function getTextIterator(style) {
12348
12305
  var list = this._parsable[style];
12349
12306
  return list != null ? list[Symbol.iterator]() : null;
12350
12307
  };
12351
-
12352
12308
  return LocaleStore;
12353
12309
  }();
12354
12310
 
12355
12311
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
12356
12312
 
12357
- var cldr = {exports: {}};
12313
+ function getDefaultExportFromCjs (x) {
12314
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
12315
+ }
12316
+
12317
+ var node_mainExports = {};
12318
+ var node_main = {
12319
+ get exports(){ return node_mainExports; },
12320
+ set exports(v){ node_mainExports = v; },
12321
+ };
12322
+
12323
+ var cldrExports = {};
12324
+ var cldr = {
12325
+ get exports(){ return cldrExports; },
12326
+ set exports(v){ cldrExports = v; },
12327
+ };
12358
12328
 
12359
12329
  /**
12360
12330
  * CLDR JavaScript Library v0.5.4
@@ -12368,616 +12338,1090 @@ var cldr = {exports: {}};
12368
12338
  */
12369
12339
 
12370
12340
  (function (module) {
12371
- /*!
12372
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
12373
- * http://git.io/h4lmVg
12374
- */
12375
- (function (root, factory) {
12376
- {
12377
- // Node. CommonJS.
12378
- module.exports = factory();
12379
- }
12380
- })(commonjsGlobal, function () {
12381
- var arrayIsArray = Array.isArray || function (obj) {
12382
- return Object.prototype.toString.call(obj) === "[object Array]";
12383
- };
12384
-
12385
- var pathNormalize = function (path, attributes) {
12386
- if (arrayIsArray(path)) {
12387
- path = path.join("/");
12388
- }
12389
-
12390
- if (typeof path !== "string") {
12391
- throw new Error("invalid path \"" + path + "\"");
12392
- } // 1: Ignore leading slash `/`
12393
- // 2: Ignore leading `cldr/`
12394
-
12395
-
12396
- path = path.replace(/^\//, "")
12397
- /* 1 */
12398
- .replace(/^cldr\//, "");
12399
- /* 2 */
12400
- // Replace {attribute}'s
12401
-
12402
- path = path.replace(/{[a-zA-Z]+}/g, function (name) {
12403
- name = name.replace(/^{([^}]*)}$/, "$1");
12404
- return attributes[name];
12405
- });
12406
- return path.split("/");
12407
- };
12408
-
12409
- var arraySome = function (array, callback) {
12410
- var i, length;
12411
-
12412
- if (array.some) {
12413
- return array.some(callback);
12414
- }
12415
-
12416
- for (i = 0, length = array.length; i < length; i++) {
12417
- if (callback(array[i], i, array)) {
12418
- return true;
12419
- }
12420
- }
12421
-
12422
- return false;
12423
- };
12424
- /**
12425
- * Return the maximized language id as defined in
12426
- * http://www.unicode.org/reports/tr35/#Likely_Subtags
12427
- * 1. Canonicalize.
12428
- * 1.1 Make sure the input locale is in canonical form: uses the right
12429
- * separator, and has the right casing.
12430
- * TODO Right casing? What df? It seems languages are lowercase, scripts are
12431
- * Capitalized, territory is uppercase. I am leaving this as an exercise to
12432
- * the user.
12433
- *
12434
- * 1.2 Replace any deprecated subtags with their canonical values using the
12435
- * <alias> data in supplemental metadata. Use the first value in the
12436
- * replacement list, if it exists. Language tag replacements may have multiple
12437
- * parts, such as "sh" "sr_Latn" or mo" "ro_MD". In such a case, the
12438
- * original script and/or region are retained if there is one. Thus
12439
- * "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ".
12440
- * TODO What <alias> data?
12441
- *
12442
- * 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
12443
- * type="choice"> in the supplemental data), then return it.
12444
- * TODO grandfathered?
12445
- *
12446
- * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
12447
- * 1.5 Get the components of the cleaned-up source tag (languages, scripts,
12448
- * and regions), plus any variants and extensions.
12449
- * 2. Lookup. Lookup each of the following in order, and stop on the first
12450
- * match:
12451
- * 2.1 languages_scripts_regions
12452
- * 2.2 languages_regions
12453
- * 2.3 languages_scripts
12454
- * 2.4 languages
12455
- * 2.5 und_scripts
12456
- * 3. Return
12457
- * 3.1 If there is no match, either return an error value, or the match for
12458
- * "und" (in APIs where a valid language tag is required).
12459
- * 3.2 Otherwise there is a match = languagem_scriptm_regionm
12460
- * 3.3 Let xr = xs if xs is not empty, and xm otherwise.
12461
- * 3.4 Return the language tag composed of languager _ scriptr _ regionr +
12462
- * variants + extensions.
12463
- *
12464
- * @subtags [Array] normalized language id subtags tuple (see init.js).
12465
- */
12466
-
12467
-
12468
- var coreLikelySubtags = function (Cldr, cldr, subtags, options) {
12469
- var match,
12470
- matchFound,
12471
- language = subtags[0],
12472
- script = subtags[1],
12473
- sep = Cldr.localeSep,
12474
- territory = subtags[2],
12475
- variants = subtags.slice(3, 4);
12476
- options = options || {}; // Skip if (language, script, territory) is not empty [3.3]
12477
-
12478
- if (language !== "und" && script !== "Zzzz" && territory !== "ZZ") {
12479
- return [language, script, territory].concat(variants);
12480
- } // Skip if no supplemental likelySubtags data is present
12481
-
12482
-
12483
- if (typeof cldr.get("supplemental/likelySubtags") === "undefined") {
12484
- return;
12485
- } // [2]
12486
-
12487
-
12488
- matchFound = arraySome([[language, script, territory], [language, territory], [language, script], [language], ["und", script]], function (test) {
12489
- return match = !/\b(Zzzz|ZZ)\b/.test(test.join(sep))
12490
- /* [1.4] */
12491
- && cldr.get(["supplemental/likelySubtags", test.join(sep)]);
12492
- }); // [3]
12493
-
12494
- if (matchFound) {
12495
- // [3.2 .. 3.4]
12496
- match = match.split(sep);
12497
- return [language !== "und" ? language : match[0], script !== "Zzzz" ? script : match[1], territory !== "ZZ" ? territory : match[2]].concat(variants);
12498
- } else if (options.force) {
12499
- // [3.1.2]
12500
- return cldr.get("supplemental/likelySubtags/und").split(sep);
12501
- } else {
12502
- // [3.1.1]
12503
- return;
12504
- }
12505
- };
12506
- /**
12507
- * Given a locale, remove any fields that Add Likely Subtags would add.
12508
- * http://www.unicode.org/reports/tr35/#Likely_Subtags
12509
- * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
12510
- * return it.
12511
- * 2. Remove the variants from max.
12512
- * 3. Then for trial in {language, language _ region, language _ script}. If
12513
- * AddLikelySubtags(trial) = max, then return trial + variants.
12514
- * 4. If you do not get a match, return max + variants.
12515
- *
12516
- * @maxLanguageId [Array] maxLanguageId tuple (see init.js).
12517
- */
12518
-
12519
-
12520
- var coreRemoveLikelySubtags = function (Cldr, cldr, maxLanguageId) {
12521
- var match,
12522
- matchFound,
12523
- language = maxLanguageId[0],
12524
- script = maxLanguageId[1],
12525
- territory = maxLanguageId[2],
12526
- variants = maxLanguageId[3]; // [3]
12527
-
12528
- matchFound = arraySome([[[language, "Zzzz", "ZZ"], [language]], [[language, "Zzzz", territory], [language, territory]], [[language, script, "ZZ"], [language, script]]], function (test) {
12529
- var result = coreLikelySubtags(Cldr, cldr, test[0]);
12530
- match = test[1];
12531
- return result && result[0] === maxLanguageId[0] && result[1] === maxLanguageId[1] && result[2] === maxLanguageId[2];
12532
- });
12533
-
12534
- if (matchFound) {
12535
- if (variants) {
12536
- match.push(variants);
12537
- }
12538
-
12539
- return match;
12540
- } // [4]
12541
-
12542
-
12543
- return maxLanguageId;
12544
- };
12545
- /**
12546
- * subtags( locale )
12547
- *
12548
- * @locale [String]
12549
- */
12550
-
12551
-
12552
- var coreSubtags = function (locale) {
12553
- var aux,
12554
- unicodeLanguageId,
12555
- subtags = [];
12556
- locale = locale.replace(/_/, "-"); // Unicode locale extensions.
12557
-
12558
- aux = locale.split("-u-");
12559
-
12560
- if (aux[1]) {
12561
- aux[1] = aux[1].split("-t-");
12562
- locale = aux[0] + (aux[1][1] ? "-t-" + aux[1][1] : "");
12563
- subtags[4
12564
- /* unicodeLocaleExtensions */
12565
- ] = aux[1][0];
12566
- } // TODO normalize transformed extensions. Currently, skipped.
12567
- // subtags[ x ] = locale.split( "-t-" )[ 1 ];
12568
-
12569
-
12570
- unicodeLanguageId = locale.split("-t-")[0]; // unicode_language_id = "root"
12571
- // | unicode_language_subtag
12572
- // (sep unicode_script_subtag)?
12573
- // (sep unicode_region_subtag)?
12574
- // (sep unicode_variant_subtag)* ;
12575
- //
12576
- // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
12577
-
12578
- 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)$/);
12579
-
12580
- if (aux === null) {
12581
- return ["und", "Zzzz", "ZZ"];
12582
- }
12583
-
12584
- subtags[0
12585
- /* language */
12586
- ] = aux[10]
12587
- /* root */
12588
- || aux[2] || "und";
12589
- subtags[1
12590
- /* script */
12591
- ] = aux[4] || "Zzzz";
12592
- subtags[2
12593
- /* territory */
12594
- ] = aux[6] || "ZZ";
12595
-
12596
- if (aux[7] && aux[7].length) {
12597
- subtags[3
12598
- /* variant */
12599
- ] = aux[7].slice(1)
12600
- /* remove leading "-" */
12601
- ;
12602
- } // 0: language
12603
- // 1: script
12604
- // 2: territory (aka region)
12605
- // 3: variant
12606
- // 4: unicodeLocaleExtensions
12607
-
12608
-
12609
- return subtags;
12610
- };
12611
-
12612
- var arrayForEach = function (array, callback) {
12613
- var i, length;
12614
-
12615
- if (array.forEach) {
12616
- return array.forEach(callback);
12617
- }
12618
-
12619
- for (i = 0, length = array.length; i < length; i++) {
12620
- callback(array[i], i, array);
12621
- }
12622
- };
12623
- /**
12624
- * bundleLookup( minLanguageId )
12625
- *
12626
- * @Cldr [Cldr class]
12627
- *
12628
- * @cldr [Cldr instance]
12629
- *
12630
- * @minLanguageId [String] requested languageId after applied remove likely subtags.
12631
- */
12632
-
12633
-
12634
- var bundleLookup = function (Cldr, cldr, minLanguageId) {
12635
- var availableBundleMap = Cldr._availableBundleMap,
12636
- availableBundleMapQueue = Cldr._availableBundleMapQueue;
12637
-
12638
- if (availableBundleMapQueue.length) {
12639
- arrayForEach(availableBundleMapQueue, function (bundle, i) {
12640
- var existing, maxBundle, minBundle, subtags;
12641
- subtags = coreSubtags(bundle);
12642
- maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
12643
-
12644
- if (maxBundle === undefined) {
12645
- availableBundleMapQueue.splice(i, 1);
12646
- throw new Error("Could not find likelySubtags for " + bundle);
12647
- }
12648
-
12649
- minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
12650
- minBundle = minBundle.join(Cldr.localeSep);
12651
- existing = availableBundleMap[minBundle];
12652
-
12653
- if (existing && existing.length < bundle.length) {
12654
- return;
12655
- }
12656
-
12657
- availableBundleMap[minBundle] = bundle;
12658
- });
12659
- Cldr._availableBundleMapQueue = [];
12660
- }
12661
-
12662
- return availableBundleMap[minLanguageId] || null;
12663
- };
12664
-
12665
- var objectKeys = function (object) {
12666
- var i,
12667
- result = [];
12668
-
12669
- if (Object.keys) {
12670
- return Object.keys(object);
12671
- }
12672
-
12673
- for (i in object) {
12674
- result.push(i);
12675
- }
12676
-
12677
- return result;
12678
- };
12679
-
12680
- var createError = function (code, attributes) {
12681
- var error, message;
12682
- message = code + (attributes && JSON ? ": " + JSON.stringify(attributes) : "");
12683
- error = new Error(message);
12684
- error.code = code; // extend( error, attributes );
12685
-
12686
- arrayForEach(objectKeys(attributes), function (attribute) {
12687
- error[attribute] = attributes[attribute];
12688
- });
12689
- return error;
12690
- };
12691
-
12692
- var validate = function (code, check, attributes) {
12693
- if (!check) {
12694
- throw createError(code, attributes);
12695
- }
12696
- };
12697
-
12698
- var validatePresence = function (value, name) {
12699
- validate("E_MISSING_PARAMETER", typeof value !== "undefined", {
12700
- name: name
12701
- });
12702
- };
12703
-
12704
- var validateType = function (value, name, check, expected) {
12705
- validate("E_INVALID_PAR_TYPE", check, {
12706
- expected: expected,
12707
- name: name,
12708
- value: value
12709
- });
12710
- };
12711
-
12712
- var validateTypePath = function (value, name) {
12713
- validateType(value, name, typeof value === "string" || arrayIsArray(value), "String or Array");
12714
- };
12715
- /**
12716
- * Function inspired by jQuery Core, but reduced to our use case.
12717
- */
12718
-
12719
-
12720
- var isPlainObject = function (obj) {
12721
- return obj !== null && "" + obj === "[object Object]";
12722
- };
12723
-
12724
- var validateTypePlainObject = function (value, name) {
12725
- validateType(value, name, typeof value === "undefined" || isPlainObject(value), "Plain Object");
12726
- };
12727
-
12728
- var validateTypeString = function (value, name) {
12729
- validateType(value, name, typeof value === "string", "a string");
12730
- }; // @path: normalized path
12731
-
12732
-
12733
- var resourceGet = function (data, path) {
12734
- var i,
12735
- node = data,
12736
- length = path.length;
12737
-
12738
- for (i = 0; i < length - 1; i++) {
12739
- node = node[path[i]];
12740
-
12741
- if (!node) {
12742
- return undefined;
12743
- }
12744
- }
12745
-
12746
- return node[path[i]];
12747
- };
12748
- /**
12749
- * setAvailableBundles( Cldr, json )
12750
- *
12751
- * @Cldr [Cldr class]
12752
- *
12753
- * @json resolved/unresolved cldr data.
12754
- *
12755
- * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
12756
- */
12757
-
12758
-
12759
- var coreSetAvailableBundles = function (Cldr, json) {
12760
- var bundle,
12761
- availableBundleMapQueue = Cldr._availableBundleMapQueue,
12762
- main = resourceGet(json, ["main"]);
12763
-
12764
- if (main) {
12765
- for (bundle in main) {
12766
- if (main.hasOwnProperty(bundle) && bundle !== "root" && availableBundleMapQueue.indexOf(bundle) === -1) {
12767
- availableBundleMapQueue.push(bundle);
12768
- }
12769
- }
12770
- }
12771
- };
12772
-
12773
- var alwaysArray = function (somethingOrArray) {
12774
- return arrayIsArray(somethingOrArray) ? somethingOrArray : [somethingOrArray];
12775
- };
12776
-
12777
- var jsonMerge = function () {
12778
- // Returns new deeply merged JSON.
12779
- //
12780
- // Eg.
12781
- // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
12782
- // -> { a: { b: 3, c: 2, d: 4 } }
12783
- //
12784
- // @arguments JSON's
12785
- //
12786
- var merge = function () {
12787
- var destination = {},
12788
- sources = [].slice.call(arguments, 0);
12789
- arrayForEach(sources, function (source) {
12790
- var prop;
12791
-
12792
- for (prop in source) {
12793
- if (prop in destination && typeof destination[prop] === "object" && !arrayIsArray(destination[prop])) {
12794
- // Merge Objects
12795
- destination[prop] = merge(destination[prop], source[prop]);
12796
- } else {
12797
- // Set new values
12798
- destination[prop] = source[prop];
12799
- }
12800
- }
12801
- });
12802
- return destination;
12803
- };
12804
-
12805
- return merge;
12806
- }();
12807
- /**
12808
- * load( Cldr, source, jsons )
12809
- *
12810
- * @Cldr [Cldr class]
12811
- *
12812
- * @source [Object]
12813
- *
12814
- * @jsons [arguments]
12815
- */
12816
-
12817
-
12818
- var coreLoad = function (Cldr, source, jsons) {
12819
- var i, j, json;
12820
- validatePresence(jsons[0], "json"); // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
12821
-
12822
- for (i = 0; i < jsons.length; i++) {
12823
- // Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
12824
- json = alwaysArray(jsons[i]);
12825
-
12826
- for (j = 0; j < json.length; j++) {
12827
- validateTypePlainObject(json[j], "json");
12828
- source = jsonMerge(source, json[j]);
12829
- coreSetAvailableBundles(Cldr, json[j]);
12830
- }
12831
- }
12832
-
12833
- return source;
12834
- };
12835
-
12836
- var itemGetResolved = function (Cldr, path, attributes) {
12837
- // Resolve path
12838
- var normalizedPath = pathNormalize(path, attributes);
12839
- return resourceGet(Cldr._resolved, normalizedPath);
12840
- };
12841
- /**
12842
- * new Cldr()
12843
- */
12844
-
12845
-
12846
- var Cldr = function (locale) {
12847
- this.init(locale);
12848
- }; // Build optimization hack to avoid duplicating functions across modules.
12849
-
12850
-
12851
- Cldr._alwaysArray = alwaysArray;
12852
- Cldr._coreLoad = coreLoad;
12853
- Cldr._createError = createError;
12854
- Cldr._itemGetResolved = itemGetResolved;
12855
- Cldr._jsonMerge = jsonMerge;
12856
- Cldr._pathNormalize = pathNormalize;
12857
- Cldr._resourceGet = resourceGet;
12858
- Cldr._validatePresence = validatePresence;
12859
- Cldr._validateType = validateType;
12860
- Cldr._validateTypePath = validateTypePath;
12861
- Cldr._validateTypePlainObject = validateTypePlainObject;
12862
- Cldr._availableBundleMap = {};
12863
- Cldr._availableBundleMapQueue = [];
12864
- Cldr._resolved = {}; // 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.
12865
-
12866
- Cldr.localeSep = "-";
12867
- /**
12868
- * Cldr.load( json [, json, ...] )
12869
- *
12870
- * @json [JSON] CLDR data or [Array] Array of @json's.
12871
- *
12872
- * Load resolved cldr data.
12873
- */
12874
-
12875
- Cldr.load = function () {
12876
- Cldr._resolved = coreLoad(Cldr, Cldr._resolved, arguments);
12877
- };
12878
- /**
12879
- * .init() automatically run on instantiation/construction.
12880
- */
12881
-
12882
-
12883
- Cldr.prototype.init = function (locale) {
12884
- var attributes,
12885
- language,
12886
- maxLanguageId,
12887
- minLanguageId,
12888
- script,
12889
- subtags,
12890
- territory,
12891
- unicodeLocaleExtensions,
12892
- variant,
12893
- sep = Cldr.localeSep,
12894
- unicodeLocaleExtensionsRaw = "";
12895
- validatePresence(locale, "locale");
12896
- validateTypeString(locale, "locale");
12897
- subtags = coreSubtags(locale);
12898
-
12899
- if (subtags.length === 5) {
12900
- unicodeLocaleExtensions = subtags.pop();
12901
- unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions; // Remove trailing null when there is unicodeLocaleExtensions but no variants.
12902
-
12903
- if (!subtags[3]) {
12904
- subtags.pop();
12905
- }
12906
- }
12907
-
12908
- variant = subtags[3]; // Normalize locale code.
12909
- // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
12910
- // Get the variant subtags (calendar, collation, currency, etc).
12911
- // refs:
12912
- // - http://www.unicode.org/reports/tr35/#Field_Definitions
12913
- // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
12914
- // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
12915
- // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
12916
-
12917
- maxLanguageId = coreLikelySubtags(Cldr, this, subtags, {
12918
- force: true
12919
- }) || subtags;
12920
- language = maxLanguageId[0];
12921
- script = maxLanguageId[1];
12922
- territory = maxLanguageId[2];
12923
- minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep); // Set attributes
12924
-
12925
- this.attributes = attributes = {
12926
- bundle: bundleLookup(Cldr, this, minLanguageId),
12927
- // Unicode Language Id
12928
- minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
12929
- maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
12930
- // Unicode Language Id Subtabs
12931
- language: language,
12932
- script: script,
12933
- territory: territory,
12934
- region: territory,
12935
-
12936
- /* alias */
12937
- variant: variant
12938
- }; // Unicode locale extensions.
12939
-
12940
- unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
12941
- if (key) {
12942
- // Extension is in the `keyword` form.
12943
- attributes["u" + key] = type;
12944
- } else {
12945
- // Extension is in the `attribute` form.
12946
- attributes["u" + attribute] = true;
12947
- }
12948
- });
12949
- this.locale = locale;
12950
- };
12951
- /**
12952
- * .get()
12953
- */
12954
-
12955
-
12956
- Cldr.prototype.get = function (path) {
12957
- validatePresence(path, "path");
12958
- validateTypePath(path, "path");
12959
- return itemGetResolved(Cldr, path, this.attributes);
12960
- };
12961
- /**
12962
- * .main()
12963
- */
12964
-
12965
-
12966
- Cldr.prototype.main = function (path) {
12967
- validatePresence(path, "path");
12968
- validateTypePath(path, "path");
12969
- validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
12970
- locale: this.locale
12971
- });
12972
- path = alwaysArray(path);
12973
- return this.get(["main/{bundle}"].concat(path));
12974
- };
12341
+ /*!
12342
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
12343
+ * http://git.io/h4lmVg
12344
+ */
12345
+ (function (root, factory) {
12346
+ {
12347
+ // Node. CommonJS.
12348
+ module.exports = factory();
12349
+ }
12350
+ })(commonjsGlobal, function () {
12351
+ var arrayIsArray = Array.isArray || function (obj) {
12352
+ return Object.prototype.toString.call(obj) === "[object Array]";
12353
+ };
12354
+ var pathNormalize = function (path, attributes) {
12355
+ if (arrayIsArray(path)) {
12356
+ path = path.join("/");
12357
+ }
12358
+ if (typeof path !== "string") {
12359
+ throw new Error("invalid path \"" + path + "\"");
12360
+ }
12361
+ // 1: Ignore leading slash `/`
12362
+ // 2: Ignore leading `cldr/`
12363
+ path = path.replace(/^\//, "") /* 1 */.replace(/^cldr\//, ""); /* 2 */
12364
+
12365
+ // Replace {attribute}'s
12366
+ path = path.replace(/{[a-zA-Z]+}/g, function (name) {
12367
+ name = name.replace(/^{([^}]*)}$/, "$1");
12368
+ return attributes[name];
12369
+ });
12370
+ return path.split("/");
12371
+ };
12372
+ var arraySome = function (array, callback) {
12373
+ var i, length;
12374
+ if (array.some) {
12375
+ return array.some(callback);
12376
+ }
12377
+ for (i = 0, length = array.length; i < length; i++) {
12378
+ if (callback(array[i], i, array)) {
12379
+ return true;
12380
+ }
12381
+ }
12382
+ return false;
12383
+ };
12384
+
12385
+ /**
12386
+ * Return the maximized language id as defined in
12387
+ * http://www.unicode.org/reports/tr35/#Likely_Subtags
12388
+ * 1. Canonicalize.
12389
+ * 1.1 Make sure the input locale is in canonical form: uses the right
12390
+ * separator, and has the right casing.
12391
+ * TODO Right casing? What df? It seems languages are lowercase, scripts are
12392
+ * Capitalized, territory is uppercase. I am leaving this as an exercise to
12393
+ * the user.
12394
+ *
12395
+ * 1.2 Replace any deprecated subtags with their canonical values using the
12396
+ * <alias> data in supplemental metadata. Use the first value in the
12397
+ * replacement list, if it exists. Language tag replacements may have multiple
12398
+ * parts, such as "sh" "sr_Latn" or mo" "ro_MD". In such a case, the
12399
+ * original script and/or region are retained if there is one. Thus
12400
+ * "sh_Arab_AQ" "sr_Arab_AQ", not "sr_Latn_AQ".
12401
+ * TODO What <alias> data?
12402
+ *
12403
+ * 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
12404
+ * type="choice"> in the supplemental data), then return it.
12405
+ * TODO grandfathered?
12406
+ *
12407
+ * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
12408
+ * 1.5 Get the components of the cleaned-up source tag (languages, scripts,
12409
+ * and regions), plus any variants and extensions.
12410
+ * 2. Lookup. Lookup each of the following in order, and stop on the first
12411
+ * match:
12412
+ * 2.1 languages_scripts_regions
12413
+ * 2.2 languages_regions
12414
+ * 2.3 languages_scripts
12415
+ * 2.4 languages
12416
+ * 2.5 und_scripts
12417
+ * 3. Return
12418
+ * 3.1 If there is no match, either return an error value, or the match for
12419
+ * "und" (in APIs where a valid language tag is required).
12420
+ * 3.2 Otherwise there is a match = languagem_scriptm_regionm
12421
+ * 3.3 Let xr = xs if xs is not empty, and xm otherwise.
12422
+ * 3.4 Return the language tag composed of languager _ scriptr _ regionr +
12423
+ * variants + extensions.
12424
+ *
12425
+ * @subtags [Array] normalized language id subtags tuple (see init.js).
12426
+ */
12427
+ var coreLikelySubtags = function (Cldr, cldr, subtags, options) {
12428
+ var match,
12429
+ matchFound,
12430
+ language = subtags[0],
12431
+ script = subtags[1],
12432
+ sep = Cldr.localeSep,
12433
+ territory = subtags[2],
12434
+ variants = subtags.slice(3, 4);
12435
+ options = options || {};
12436
+
12437
+ // Skip if (language, script, territory) is not empty [3.3]
12438
+ if (language !== "und" && script !== "Zzzz" && territory !== "ZZ") {
12439
+ return [language, script, territory].concat(variants);
12440
+ }
12441
+
12442
+ // Skip if no supplemental likelySubtags data is present
12443
+ if (typeof cldr.get("supplemental/likelySubtags") === "undefined") {
12444
+ return;
12445
+ }
12446
+
12447
+ // [2]
12448
+ matchFound = arraySome([[language, script, territory], [language, territory], [language, script], [language], ["und", script]], function (test) {
12449
+ return match = !/\b(Zzzz|ZZ)\b/.test(test.join(sep)) /* [1.4] */ && cldr.get(["supplemental/likelySubtags", test.join(sep)]);
12450
+ });
12451
+
12452
+ // [3]
12453
+ if (matchFound) {
12454
+ // [3.2 .. 3.4]
12455
+ match = match.split(sep);
12456
+ return [language !== "und" ? language : match[0], script !== "Zzzz" ? script : match[1], territory !== "ZZ" ? territory : match[2]].concat(variants);
12457
+ } else if (options.force) {
12458
+ // [3.1.2]
12459
+ return cldr.get("supplemental/likelySubtags/und").split(sep);
12460
+ } else {
12461
+ // [3.1.1]
12462
+ return;
12463
+ }
12464
+ };
12465
+
12466
+ /**
12467
+ * Given a locale, remove any fields that Add Likely Subtags would add.
12468
+ * http://www.unicode.org/reports/tr35/#Likely_Subtags
12469
+ * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
12470
+ * return it.
12471
+ * 2. Remove the variants from max.
12472
+ * 3. Then for trial in {language, language _ region, language _ script}. If
12473
+ * AddLikelySubtags(trial) = max, then return trial + variants.
12474
+ * 4. If you do not get a match, return max + variants.
12475
+ *
12476
+ * @maxLanguageId [Array] maxLanguageId tuple (see init.js).
12477
+ */
12478
+ var coreRemoveLikelySubtags = function (Cldr, cldr, maxLanguageId) {
12479
+ var match,
12480
+ matchFound,
12481
+ language = maxLanguageId[0],
12482
+ script = maxLanguageId[1],
12483
+ territory = maxLanguageId[2],
12484
+ variants = maxLanguageId[3];
12485
+
12486
+ // [3]
12487
+ matchFound = arraySome([[[language, "Zzzz", "ZZ"], [language]], [[language, "Zzzz", territory], [language, territory]], [[language, script, "ZZ"], [language, script]]], function (test) {
12488
+ var result = coreLikelySubtags(Cldr, cldr, test[0]);
12489
+ match = test[1];
12490
+ return result && result[0] === maxLanguageId[0] && result[1] === maxLanguageId[1] && result[2] === maxLanguageId[2];
12491
+ });
12492
+ if (matchFound) {
12493
+ if (variants) {
12494
+ match.push(variants);
12495
+ }
12496
+ return match;
12497
+ }
12498
+
12499
+ // [4]
12500
+ return maxLanguageId;
12501
+ };
12502
+
12503
+ /**
12504
+ * subtags( locale )
12505
+ *
12506
+ * @locale [String]
12507
+ */
12508
+ var coreSubtags = function (locale) {
12509
+ var aux,
12510
+ unicodeLanguageId,
12511
+ subtags = [];
12512
+ locale = locale.replace(/_/, "-");
12513
+
12514
+ // Unicode locale extensions.
12515
+ aux = locale.split("-u-");
12516
+ if (aux[1]) {
12517
+ aux[1] = aux[1].split("-t-");
12518
+ locale = aux[0] + (aux[1][1] ? "-t-" + aux[1][1] : "");
12519
+ subtags[4 /* unicodeLocaleExtensions */] = aux[1][0];
12520
+ }
12521
+
12522
+ // TODO normalize transformed extensions. Currently, skipped.
12523
+ // subtags[ x ] = locale.split( "-t-" )[ 1 ];
12524
+ unicodeLanguageId = locale.split("-t-")[0];
12525
+
12526
+ // unicode_language_id = "root"
12527
+ // | unicode_language_subtag
12528
+ // (sep unicode_script_subtag)?
12529
+ // (sep unicode_region_subtag)?
12530
+ // (sep unicode_variant_subtag)* ;
12531
+ //
12532
+ // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
12533
+ 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)$/);
12534
+ if (aux === null) {
12535
+ return ["und", "Zzzz", "ZZ"];
12536
+ }
12537
+ subtags[0 /* language */] = aux[10] /* root */ || aux[2] || "und";
12538
+ subtags[1 /* script */] = aux[4] || "Zzzz";
12539
+ subtags[2 /* territory */] = aux[6] || "ZZ";
12540
+ if (aux[7] && aux[7].length) {
12541
+ subtags[3 /* variant */] = aux[7].slice(1) /* remove leading "-" */;
12542
+ }
12543
+
12544
+ // 0: language
12545
+ // 1: script
12546
+ // 2: territory (aka region)
12547
+ // 3: variant
12548
+ // 4: unicodeLocaleExtensions
12549
+ return subtags;
12550
+ };
12551
+ var arrayForEach = function (array, callback) {
12552
+ var i, length;
12553
+ if (array.forEach) {
12554
+ return array.forEach(callback);
12555
+ }
12556
+ for (i = 0, length = array.length; i < length; i++) {
12557
+ callback(array[i], i, array);
12558
+ }
12559
+ };
12560
+
12561
+ /**
12562
+ * bundleLookup( minLanguageId )
12563
+ *
12564
+ * @Cldr [Cldr class]
12565
+ *
12566
+ * @cldr [Cldr instance]
12567
+ *
12568
+ * @minLanguageId [String] requested languageId after applied remove likely subtags.
12569
+ */
12570
+ var bundleLookup = function (Cldr, cldr, minLanguageId) {
12571
+ var availableBundleMap = Cldr._availableBundleMap,
12572
+ availableBundleMapQueue = Cldr._availableBundleMapQueue;
12573
+ if (availableBundleMapQueue.length) {
12574
+ arrayForEach(availableBundleMapQueue, function (bundle, i) {
12575
+ var existing, maxBundle, minBundle, subtags;
12576
+ subtags = coreSubtags(bundle);
12577
+ maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
12578
+ if (maxBundle === undefined) {
12579
+ availableBundleMapQueue.splice(i, 1);
12580
+ throw new Error("Could not find likelySubtags for " + bundle);
12581
+ }
12582
+ minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
12583
+ minBundle = minBundle.join(Cldr.localeSep);
12584
+ existing = availableBundleMap[minBundle];
12585
+ if (existing && existing.length < bundle.length) {
12586
+ return;
12587
+ }
12588
+ availableBundleMap[minBundle] = bundle;
12589
+ });
12590
+ Cldr._availableBundleMapQueue = [];
12591
+ }
12592
+ return availableBundleMap[minLanguageId] || null;
12593
+ };
12594
+ var objectKeys = function (object) {
12595
+ var i,
12596
+ result = [];
12597
+ if (Object.keys) {
12598
+ return Object.keys(object);
12599
+ }
12600
+ for (i in object) {
12601
+ result.push(i);
12602
+ }
12603
+ return result;
12604
+ };
12605
+ var createError = function (code, attributes) {
12606
+ var error, message;
12607
+ message = code + (attributes && JSON ? ": " + JSON.stringify(attributes) : "");
12608
+ error = new Error(message);
12609
+ error.code = code;
12610
+
12611
+ // extend( error, attributes );
12612
+ arrayForEach(objectKeys(attributes), function (attribute) {
12613
+ error[attribute] = attributes[attribute];
12614
+ });
12615
+ return error;
12616
+ };
12617
+ var validate = function (code, check, attributes) {
12618
+ if (!check) {
12619
+ throw createError(code, attributes);
12620
+ }
12621
+ };
12622
+ var validatePresence = function (value, name) {
12623
+ validate("E_MISSING_PARAMETER", typeof value !== "undefined", {
12624
+ name: name
12625
+ });
12626
+ };
12627
+ var validateType = function (value, name, check, expected) {
12628
+ validate("E_INVALID_PAR_TYPE", check, {
12629
+ expected: expected,
12630
+ name: name,
12631
+ value: value
12632
+ });
12633
+ };
12634
+ var validateTypePath = function (value, name) {
12635
+ validateType(value, name, typeof value === "string" || arrayIsArray(value), "String or Array");
12636
+ };
12637
+
12638
+ /**
12639
+ * Function inspired by jQuery Core, but reduced to our use case.
12640
+ */
12641
+ var isPlainObject = function (obj) {
12642
+ return obj !== null && "" + obj === "[object Object]";
12643
+ };
12644
+ var validateTypePlainObject = function (value, name) {
12645
+ validateType(value, name, typeof value === "undefined" || isPlainObject(value), "Plain Object");
12646
+ };
12647
+ var validateTypeString = function (value, name) {
12648
+ validateType(value, name, typeof value === "string", "a string");
12649
+ };
12650
+
12651
+ // @path: normalized path
12652
+ var resourceGet = function (data, path) {
12653
+ var i,
12654
+ node = data,
12655
+ length = path.length;
12656
+ for (i = 0; i < length - 1; i++) {
12657
+ node = node[path[i]];
12658
+ if (!node) {
12659
+ return undefined;
12660
+ }
12661
+ }
12662
+ return node[path[i]];
12663
+ };
12664
+
12665
+ /**
12666
+ * setAvailableBundles( Cldr, json )
12667
+ *
12668
+ * @Cldr [Cldr class]
12669
+ *
12670
+ * @json resolved/unresolved cldr data.
12671
+ *
12672
+ * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
12673
+ */
12674
+ var coreSetAvailableBundles = function (Cldr, json) {
12675
+ var bundle,
12676
+ availableBundleMapQueue = Cldr._availableBundleMapQueue,
12677
+ main = resourceGet(json, ["main"]);
12678
+ if (main) {
12679
+ for (bundle in main) {
12680
+ if (main.hasOwnProperty(bundle) && bundle !== "root" && availableBundleMapQueue.indexOf(bundle) === -1) {
12681
+ availableBundleMapQueue.push(bundle);
12682
+ }
12683
+ }
12684
+ }
12685
+ };
12686
+ var alwaysArray = function (somethingOrArray) {
12687
+ return arrayIsArray(somethingOrArray) ? somethingOrArray : [somethingOrArray];
12688
+ };
12689
+ var jsonMerge = function () {
12690
+ // Returns new deeply merged JSON.
12691
+ //
12692
+ // Eg.
12693
+ // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
12694
+ // -> { a: { b: 3, c: 2, d: 4 } }
12695
+ //
12696
+ // @arguments JSON's
12697
+ //
12698
+ var merge = function () {
12699
+ var destination = {},
12700
+ sources = [].slice.call(arguments, 0);
12701
+ arrayForEach(sources, function (source) {
12702
+ var prop;
12703
+ for (prop in source) {
12704
+ if (prop in destination && typeof destination[prop] === "object" && !arrayIsArray(destination[prop])) {
12705
+ // Merge Objects
12706
+ destination[prop] = merge(destination[prop], source[prop]);
12707
+ } else {
12708
+ // Set new values
12709
+ destination[prop] = source[prop];
12710
+ }
12711
+ }
12712
+ });
12713
+ return destination;
12714
+ };
12715
+ return merge;
12716
+ }();
12717
+
12718
+ /**
12719
+ * load( Cldr, source, jsons )
12720
+ *
12721
+ * @Cldr [Cldr class]
12722
+ *
12723
+ * @source [Object]
12724
+ *
12725
+ * @jsons [arguments]
12726
+ */
12727
+ var coreLoad = function (Cldr, source, jsons) {
12728
+ var i, j, json;
12729
+ validatePresence(jsons[0], "json");
12730
+
12731
+ // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
12732
+ for (i = 0; i < jsons.length; i++) {
12733
+ // Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
12734
+ json = alwaysArray(jsons[i]);
12735
+ for (j = 0; j < json.length; j++) {
12736
+ validateTypePlainObject(json[j], "json");
12737
+ source = jsonMerge(source, json[j]);
12738
+ coreSetAvailableBundles(Cldr, json[j]);
12739
+ }
12740
+ }
12741
+ return source;
12742
+ };
12743
+ var itemGetResolved = function (Cldr, path, attributes) {
12744
+ // Resolve path
12745
+ var normalizedPath = pathNormalize(path, attributes);
12746
+ return resourceGet(Cldr._resolved, normalizedPath);
12747
+ };
12748
+
12749
+ /**
12750
+ * new Cldr()
12751
+ */
12752
+ var Cldr = function (locale) {
12753
+ this.init(locale);
12754
+ };
12755
+
12756
+ // Build optimization hack to avoid duplicating functions across modules.
12757
+ Cldr._alwaysArray = alwaysArray;
12758
+ Cldr._coreLoad = coreLoad;
12759
+ Cldr._createError = createError;
12760
+ Cldr._itemGetResolved = itemGetResolved;
12761
+ Cldr._jsonMerge = jsonMerge;
12762
+ Cldr._pathNormalize = pathNormalize;
12763
+ Cldr._resourceGet = resourceGet;
12764
+ Cldr._validatePresence = validatePresence;
12765
+ Cldr._validateType = validateType;
12766
+ Cldr._validateTypePath = validateTypePath;
12767
+ Cldr._validateTypePlainObject = validateTypePlainObject;
12768
+ Cldr._availableBundleMap = {};
12769
+ Cldr._availableBundleMapQueue = [];
12770
+ Cldr._resolved = {};
12771
+
12772
+ // 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.
12773
+ Cldr.localeSep = "-";
12774
+
12775
+ /**
12776
+ * Cldr.load( json [, json, ...] )
12777
+ *
12778
+ * @json [JSON] CLDR data or [Array] Array of @json's.
12779
+ *
12780
+ * Load resolved cldr data.
12781
+ */
12782
+ Cldr.load = function () {
12783
+ Cldr._resolved = coreLoad(Cldr, Cldr._resolved, arguments);
12784
+ };
12785
+
12786
+ /**
12787
+ * .init() automatically run on instantiation/construction.
12788
+ */
12789
+ Cldr.prototype.init = function (locale) {
12790
+ var attributes,
12791
+ language,
12792
+ maxLanguageId,
12793
+ minLanguageId,
12794
+ script,
12795
+ subtags,
12796
+ territory,
12797
+ unicodeLocaleExtensions,
12798
+ variant,
12799
+ sep = Cldr.localeSep,
12800
+ unicodeLocaleExtensionsRaw = "";
12801
+ validatePresence(locale, "locale");
12802
+ validateTypeString(locale, "locale");
12803
+ subtags = coreSubtags(locale);
12804
+ if (subtags.length === 5) {
12805
+ unicodeLocaleExtensions = subtags.pop();
12806
+ unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions;
12807
+ // Remove trailing null when there is unicodeLocaleExtensions but no variants.
12808
+ if (!subtags[3]) {
12809
+ subtags.pop();
12810
+ }
12811
+ }
12812
+ variant = subtags[3];
12813
+
12814
+ // Normalize locale code.
12815
+ // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
12816
+ // Get the variant subtags (calendar, collation, currency, etc).
12817
+ // refs:
12818
+ // - http://www.unicode.org/reports/tr35/#Field_Definitions
12819
+ // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
12820
+ // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
12821
+
12822
+ // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
12823
+ maxLanguageId = coreLikelySubtags(Cldr, this, subtags, {
12824
+ force: true
12825
+ }) || subtags;
12826
+ language = maxLanguageId[0];
12827
+ script = maxLanguageId[1];
12828
+ territory = maxLanguageId[2];
12829
+ minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep);
12830
+
12831
+ // Set attributes
12832
+ this.attributes = attributes = {
12833
+ bundle: bundleLookup(Cldr, this, minLanguageId),
12834
+ // Unicode Language Id
12835
+ minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
12836
+ maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
12837
+ // Unicode Language Id Subtabs
12838
+ language: language,
12839
+ script: script,
12840
+ territory: territory,
12841
+ region: territory,
12842
+ /* alias */
12843
+ variant: variant
12844
+ };
12845
+
12846
+ // Unicode locale extensions.
12847
+ unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
12848
+ if (key) {
12849
+ // Extension is in the `keyword` form.
12850
+ attributes["u" + key] = type;
12851
+ } else {
12852
+ // Extension is in the `attribute` form.
12853
+ attributes["u" + attribute] = true;
12854
+ }
12855
+ });
12856
+ this.locale = locale;
12857
+ };
12858
+
12859
+ /**
12860
+ * .get()
12861
+ */
12862
+ Cldr.prototype.get = function (path) {
12863
+ validatePresence(path, "path");
12864
+ validateTypePath(path, "path");
12865
+ return itemGetResolved(Cldr, path, this.attributes);
12866
+ };
12867
+
12868
+ /**
12869
+ * .main()
12870
+ */
12871
+ Cldr.prototype.main = function (path) {
12872
+ validatePresence(path, "path");
12873
+ validateTypePath(path, "path");
12874
+ validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
12875
+ locale: this.locale
12876
+ });
12877
+ path = alwaysArray(path);
12878
+ return this.get(["main/{bundle}"].concat(path));
12879
+ };
12880
+ return Cldr;
12881
+ });
12882
+ } (cldr));
12883
+
12884
+ var eventExports = {};
12885
+ var event = {
12886
+ get exports(){ return eventExports; },
12887
+ set exports(v){ eventExports = v; },
12888
+ };
12975
12889
 
12976
- return Cldr;
12977
- });
12978
- }(cldr));
12890
+ /**
12891
+ * CLDR JavaScript Library v0.5.4
12892
+ * http://jquery.com/
12893
+ *
12894
+ * Copyright 2013 Rafael Xavier de Souza
12895
+ * Released under the MIT license
12896
+ * http://jquery.org/license
12897
+ *
12898
+ * Date: 2020-10-22T15:56Z
12899
+ */
12979
12900
 
12980
- var event = {exports: {}};
12901
+ (function (module) {
12902
+ /*!
12903
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
12904
+ * http://git.io/h4lmVg
12905
+ */
12906
+ (function (factory) {
12907
+ {
12908
+ // Node. CommonJS.
12909
+ module.exports = factory(cldrExports);
12910
+ }
12911
+ })(function (Cldr) {
12912
+ // Build optimization hack to avoid duplicating functions across modules.
12913
+ var pathNormalize = Cldr._pathNormalize,
12914
+ validatePresence = Cldr._validatePresence,
12915
+ validateType = Cldr._validateType;
12916
+
12917
+ /*!
12918
+ * EventEmitter v4.2.7 - git.io/ee
12919
+ * Oliver Caldwell
12920
+ * MIT license
12921
+ * @preserve
12922
+ */
12923
+
12924
+ var EventEmitter;
12925
+ /* jshint ignore:start */
12926
+ EventEmitter = function () {
12927
+ /**
12928
+ * Class for managing events.
12929
+ * Can be extended to provide event functionality in other classes.
12930
+ *
12931
+ * @class EventEmitter Manages event registering and emitting.
12932
+ */
12933
+ function EventEmitter() {}
12934
+
12935
+ // Shortcuts to improve speed and size
12936
+ var proto = EventEmitter.prototype;
12937
+
12938
+ /**
12939
+ * Finds the index of the listener for the event in it's storage array.
12940
+ *
12941
+ * @param {Function[]} listeners Array of listeners to search through.
12942
+ * @param {Function} listener Method to look for.
12943
+ * @return {Number} Index of the specified listener, -1 if not found
12944
+ * @api private
12945
+ */
12946
+ function indexOfListener(listeners, listener) {
12947
+ var i = listeners.length;
12948
+ while (i--) {
12949
+ if (listeners[i].listener === listener) {
12950
+ return i;
12951
+ }
12952
+ }
12953
+ return -1;
12954
+ }
12955
+
12956
+ /**
12957
+ * Alias a method while keeping the context correct, to allow for overwriting of target method.
12958
+ *
12959
+ * @param {String} name The name of the target method.
12960
+ * @return {Function} The aliased method
12961
+ * @api private
12962
+ */
12963
+ function alias(name) {
12964
+ return function aliasClosure() {
12965
+ return this[name].apply(this, arguments);
12966
+ };
12967
+ }
12968
+
12969
+ /**
12970
+ * Returns the listener array for the specified event.
12971
+ * Will initialise the event object and listener arrays if required.
12972
+ * 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.
12973
+ * Each property in the object response is an array of listener functions.
12974
+ *
12975
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
12976
+ * @return {Function[]|Object} All listener functions for the event.
12977
+ */
12978
+ proto.getListeners = function getListeners(evt) {
12979
+ var events = this._getEvents();
12980
+ var response;
12981
+ var key;
12982
+
12983
+ // Return a concatenated array of all matching events if
12984
+ // the selector is a regular expression.
12985
+ if (evt instanceof RegExp) {
12986
+ response = {};
12987
+ for (key in events) {
12988
+ if (events.hasOwnProperty(key) && evt.test(key)) {
12989
+ response[key] = events[key];
12990
+ }
12991
+ }
12992
+ } else {
12993
+ response = events[evt] || (events[evt] = []);
12994
+ }
12995
+ return response;
12996
+ };
12997
+
12998
+ /**
12999
+ * Takes a list of listener objects and flattens it into a list of listener functions.
13000
+ *
13001
+ * @param {Object[]} listeners Raw listener objects.
13002
+ * @return {Function[]} Just the listener functions.
13003
+ */
13004
+ proto.flattenListeners = function flattenListeners(listeners) {
13005
+ var flatListeners = [];
13006
+ var i;
13007
+ for (i = 0; i < listeners.length; i += 1) {
13008
+ flatListeners.push(listeners[i].listener);
13009
+ }
13010
+ return flatListeners;
13011
+ };
13012
+
13013
+ /**
13014
+ * 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.
13015
+ *
13016
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
13017
+ * @return {Object} All listener functions for an event in an object.
13018
+ */
13019
+ proto.getListenersAsObject = function getListenersAsObject(evt) {
13020
+ var listeners = this.getListeners(evt);
13021
+ var response;
13022
+ if (listeners instanceof Array) {
13023
+ response = {};
13024
+ response[evt] = listeners;
13025
+ }
13026
+ return response || listeners;
13027
+ };
13028
+
13029
+ /**
13030
+ * Adds a listener function to the specified event.
13031
+ * The listener will not be added if it is a duplicate.
13032
+ * If the listener returns true then it will be removed after it is called.
13033
+ * If you pass a regular expression as the event name then the listener will be added to all events that match it.
13034
+ *
13035
+ * @param {String|RegExp} evt Name of the event to attach the listener to.
13036
+ * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
13037
+ * @return {Object} Current instance of EventEmitter for chaining.
13038
+ */
13039
+ proto.addListener = function addListener(evt, listener) {
13040
+ var listeners = this.getListenersAsObject(evt);
13041
+ var listenerIsWrapped = typeof listener === 'object';
13042
+ var key;
13043
+ for (key in listeners) {
13044
+ if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
13045
+ listeners[key].push(listenerIsWrapped ? listener : {
13046
+ listener: listener,
13047
+ once: false
13048
+ });
13049
+ }
13050
+ }
13051
+ return this;
13052
+ };
13053
+
13054
+ /**
13055
+ * Alias of addListener
13056
+ */
13057
+ proto.on = alias('addListener');
13058
+
13059
+ /**
13060
+ * Semi-alias of addListener. It will add a listener that will be
13061
+ * automatically removed after it's first execution.
13062
+ *
13063
+ * @param {String|RegExp} evt Name of the event to attach the listener to.
13064
+ * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
13065
+ * @return {Object} Current instance of EventEmitter for chaining.
13066
+ */
13067
+ proto.addOnceListener = function addOnceListener(evt, listener) {
13068
+ return this.addListener(evt, {
13069
+ listener: listener,
13070
+ once: true
13071
+ });
13072
+ };
13073
+
13074
+ /**
13075
+ * Alias of addOnceListener.
13076
+ */
13077
+ proto.once = alias('addOnceListener');
13078
+
13079
+ /**
13080
+ * 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.
13081
+ * You need to tell it what event names should be matched by a regex.
13082
+ *
13083
+ * @param {String} evt Name of the event to create.
13084
+ * @return {Object} Current instance of EventEmitter for chaining.
13085
+ */
13086
+ proto.defineEvent = function defineEvent(evt) {
13087
+ this.getListeners(evt);
13088
+ return this;
13089
+ };
13090
+
13091
+ /**
13092
+ * Uses defineEvent to define multiple events.
13093
+ *
13094
+ * @param {String[]} evts An array of event names to define.
13095
+ * @return {Object} Current instance of EventEmitter for chaining.
13096
+ */
13097
+ proto.defineEvents = function defineEvents(evts) {
13098
+ for (var i = 0; i < evts.length; i += 1) {
13099
+ this.defineEvent(evts[i]);
13100
+ }
13101
+ return this;
13102
+ };
13103
+
13104
+ /**
13105
+ * Removes a listener function from the specified event.
13106
+ * When passed a regular expression as the event name, it will remove the listener from all events that match it.
13107
+ *
13108
+ * @param {String|RegExp} evt Name of the event to remove the listener from.
13109
+ * @param {Function} listener Method to remove from the event.
13110
+ * @return {Object} Current instance of EventEmitter for chaining.
13111
+ */
13112
+ proto.removeListener = function removeListener(evt, listener) {
13113
+ var listeners = this.getListenersAsObject(evt);
13114
+ var index;
13115
+ var key;
13116
+ for (key in listeners) {
13117
+ if (listeners.hasOwnProperty(key)) {
13118
+ index = indexOfListener(listeners[key], listener);
13119
+ if (index !== -1) {
13120
+ listeners[key].splice(index, 1);
13121
+ }
13122
+ }
13123
+ }
13124
+ return this;
13125
+ };
13126
+
13127
+ /**
13128
+ * Alias of removeListener
13129
+ */
13130
+ proto.off = alias('removeListener');
13131
+
13132
+ /**
13133
+ * Adds listeners in bulk using the manipulateListeners method.
13134
+ * 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.
13135
+ * You can also pass it a regular expression to add the array of listeners to all events that match it.
13136
+ * Yeah, this function does quite a bit. That's probably a bad thing.
13137
+ *
13138
+ * @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.
13139
+ * @param {Function[]} [listeners] An optional array of listener functions to add.
13140
+ * @return {Object} Current instance of EventEmitter for chaining.
13141
+ */
13142
+ proto.addListeners = function addListeners(evt, listeners) {
13143
+ // Pass through to manipulateListeners
13144
+ return this.manipulateListeners(false, evt, listeners);
13145
+ };
13146
+
13147
+ /**
13148
+ * Removes listeners in bulk using the manipulateListeners method.
13149
+ * 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.
13150
+ * You can also pass it an event name and an array of listeners to be removed.
13151
+ * You can also pass it a regular expression to remove the listeners from all events that match it.
13152
+ *
13153
+ * @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.
13154
+ * @param {Function[]} [listeners] An optional array of listener functions to remove.
13155
+ * @return {Object} Current instance of EventEmitter for chaining.
13156
+ */
13157
+ proto.removeListeners = function removeListeners(evt, listeners) {
13158
+ // Pass through to manipulateListeners
13159
+ return this.manipulateListeners(true, evt, listeners);
13160
+ };
13161
+
13162
+ /**
13163
+ * 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.
13164
+ * The first argument will determine if the listeners are removed (true) or added (false).
13165
+ * 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.
13166
+ * You can also pass it an event name and an array of listeners to be added/removed.
13167
+ * You can also pass it a regular expression to manipulate the listeners of all events that match it.
13168
+ *
13169
+ * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
13170
+ * @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.
13171
+ * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
13172
+ * @return {Object} Current instance of EventEmitter for chaining.
13173
+ */
13174
+ proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
13175
+ var i;
13176
+ var value;
13177
+ var single = remove ? this.removeListener : this.addListener;
13178
+ var multiple = remove ? this.removeListeners : this.addListeners;
13179
+
13180
+ // If evt is an object then pass each of it's properties to this method
13181
+ if (typeof evt === 'object' && !(evt instanceof RegExp)) {
13182
+ for (i in evt) {
13183
+ if (evt.hasOwnProperty(i) && (value = evt[i])) {
13184
+ // Pass the single listener straight through to the singular method
13185
+ if (typeof value === 'function') {
13186
+ single.call(this, i, value);
13187
+ } else {
13188
+ // Otherwise pass back to the multiple function
13189
+ multiple.call(this, i, value);
13190
+ }
13191
+ }
13192
+ }
13193
+ } else {
13194
+ // So evt must be a string
13195
+ // And listeners must be an array of listeners
13196
+ // Loop over it and pass each one to the multiple method
13197
+ i = listeners.length;
13198
+ while (i--) {
13199
+ single.call(this, evt, listeners[i]);
13200
+ }
13201
+ }
13202
+ return this;
13203
+ };
13204
+
13205
+ /**
13206
+ * Removes all listeners from a specified event.
13207
+ * If you do not specify an event then all listeners will be removed.
13208
+ * That means every event will be emptied.
13209
+ * You can also pass a regex to remove all events that match it.
13210
+ *
13211
+ * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
13212
+ * @return {Object} Current instance of EventEmitter for chaining.
13213
+ */
13214
+ proto.removeEvent = function removeEvent(evt) {
13215
+ var type = typeof evt;
13216
+ var events = this._getEvents();
13217
+ var key;
13218
+
13219
+ // Remove different things depending on the state of evt
13220
+ if (type === 'string') {
13221
+ // Remove all listeners for the specified event
13222
+ delete events[evt];
13223
+ } else if (evt instanceof RegExp) {
13224
+ // Remove all events matching the regex.
13225
+ for (key in events) {
13226
+ if (events.hasOwnProperty(key) && evt.test(key)) {
13227
+ delete events[key];
13228
+ }
13229
+ }
13230
+ } else {
13231
+ // Remove all listeners in all events
13232
+ delete this._events;
13233
+ }
13234
+ return this;
13235
+ };
13236
+
13237
+ /**
13238
+ * Alias of removeEvent.
13239
+ *
13240
+ * Added to mirror the node API.
13241
+ */
13242
+ proto.removeAllListeners = alias('removeEvent');
13243
+
13244
+ /**
13245
+ * Emits an event of your choice.
13246
+ * When emitted, every listener attached to that event will be executed.
13247
+ * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
13248
+ * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
13249
+ * So they will not arrive within the array on the other side, they will be separate.
13250
+ * You can also pass a regular expression to emit to all events that match it.
13251
+ *
13252
+ * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
13253
+ * @param {Array} [args] Optional array of arguments to be passed to each listener.
13254
+ * @return {Object} Current instance of EventEmitter for chaining.
13255
+ */
13256
+ proto.emitEvent = function emitEvent(evt, args) {
13257
+ var listeners = this.getListenersAsObject(evt);
13258
+ var listener;
13259
+ var i;
13260
+ var key;
13261
+ var response;
13262
+ for (key in listeners) {
13263
+ if (listeners.hasOwnProperty(key)) {
13264
+ i = listeners[key].length;
13265
+ while (i--) {
13266
+ // If the listener returns true then it shall be removed from the event
13267
+ // The function is executed either with a basic call or an apply if there is an args array
13268
+ listener = listeners[key][i];
13269
+ if (listener.once === true) {
13270
+ this.removeListener(evt, listener.listener);
13271
+ }
13272
+ response = listener.listener.apply(this, args || []);
13273
+ if (response === this._getOnceReturnValue()) {
13274
+ this.removeListener(evt, listener.listener);
13275
+ }
13276
+ }
13277
+ }
13278
+ }
13279
+ return this;
13280
+ };
13281
+
13282
+ /**
13283
+ * Alias of emitEvent
13284
+ */
13285
+ proto.trigger = alias('emitEvent');
13286
+
13287
+ /**
13288
+ * 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.
13289
+ * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
13290
+ *
13291
+ * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
13292
+ * @param {...*} Optional additional arguments to be passed to each listener.
13293
+ * @return {Object} Current instance of EventEmitter for chaining.
13294
+ */
13295
+ proto.emit = function emit(evt) {
13296
+ var args = Array.prototype.slice.call(arguments, 1);
13297
+ return this.emitEvent(evt, args);
13298
+ };
13299
+
13300
+ /**
13301
+ * Sets the current value to check against when executing listeners. If a
13302
+ * listeners return value matches the one set here then it will be removed
13303
+ * after execution. This value defaults to true.
13304
+ *
13305
+ * @param {*} value The new value to check for when executing listeners.
13306
+ * @return {Object} Current instance of EventEmitter for chaining.
13307
+ */
13308
+ proto.setOnceReturnValue = function setOnceReturnValue(value) {
13309
+ this._onceReturnValue = value;
13310
+ return this;
13311
+ };
13312
+
13313
+ /**
13314
+ * Fetches the current value to check against when executing listeners. If
13315
+ * the listeners return value matches this one then it should be removed
13316
+ * automatically. It will return true by default.
13317
+ *
13318
+ * @return {*|Boolean} The current value to check for or the default, true.
13319
+ * @api private
13320
+ */
13321
+ proto._getOnceReturnValue = function _getOnceReturnValue() {
13322
+ if (this.hasOwnProperty('_onceReturnValue')) {
13323
+ return this._onceReturnValue;
13324
+ } else {
13325
+ return true;
13326
+ }
13327
+ };
13328
+
13329
+ /**
13330
+ * Fetches the events object and creates one if required.
13331
+ *
13332
+ * @return {Object} The events storage object.
13333
+ * @api private
13334
+ */
13335
+ proto._getEvents = function _getEvents() {
13336
+ return this._events || (this._events = {});
13337
+ };
13338
+
13339
+ /**
13340
+ * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
13341
+ *
13342
+ * @return {Function} Non conflicting EventEmitter class.
13343
+ */
13344
+ EventEmitter.noConflict = function noConflict() {
13345
+ originalGlobalValue;
13346
+ return EventEmitter;
13347
+ };
13348
+ return EventEmitter;
13349
+ }();
13350
+ /* jshint ignore:end */
13351
+
13352
+ var validateTypeFunction = function (value, name) {
13353
+ validateType(value, name, typeof value === "undefined" || typeof value === "function", "Function");
13354
+ };
13355
+ var superGet,
13356
+ superInit,
13357
+ globalEe = new EventEmitter();
13358
+ function validateTypeEvent(value, name) {
13359
+ validateType(value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp");
13360
+ }
13361
+ function validateThenCall(method, self) {
13362
+ return function (event, listener) {
13363
+ validatePresence(event, "event");
13364
+ validateTypeEvent(event, "event");
13365
+ validatePresence(listener, "listener");
13366
+ validateTypeFunction(listener, "listener");
13367
+ return self[method].apply(self, arguments);
13368
+ };
13369
+ }
13370
+ function off(self) {
13371
+ return validateThenCall("off", self);
13372
+ }
13373
+ function on(self) {
13374
+ return validateThenCall("on", self);
13375
+ }
13376
+ function once(self) {
13377
+ return validateThenCall("once", self);
13378
+ }
13379
+ Cldr.off = off(globalEe);
13380
+ Cldr.on = on(globalEe);
13381
+ Cldr.once = once(globalEe);
13382
+
13383
+ /**
13384
+ * Overload Cldr.prototype.init().
13385
+ */
13386
+ superInit = Cldr.prototype.init;
13387
+ Cldr.prototype.init = function () {
13388
+ var ee;
13389
+ this.ee = ee = new EventEmitter();
13390
+ this.off = off(ee);
13391
+ this.on = on(ee);
13392
+ this.once = once(ee);
13393
+ superInit.apply(this, arguments);
13394
+ };
13395
+
13396
+ /**
13397
+ * getOverload is encapsulated, because of cldr/unresolved. If it's loaded
13398
+ * after cldr/event (and note it overwrites .get), it can trigger this
13399
+ * overload again.
13400
+ */
13401
+ function getOverload() {
13402
+ /**
13403
+ * Overload Cldr.prototype.get().
13404
+ */
13405
+ superGet = Cldr.prototype.get;
13406
+ Cldr.prototype.get = function (path) {
13407
+ var value = superGet.apply(this, arguments);
13408
+ path = pathNormalize(path, this.attributes).join("/");
13409
+ globalEe.trigger("get", [path, value]);
13410
+ this.ee.trigger("get", [path, value]);
13411
+ return value;
13412
+ };
13413
+ }
13414
+ Cldr._eventInit = getOverload;
13415
+ getOverload();
13416
+ return Cldr;
13417
+ });
13418
+ } (event));
13419
+
13420
+ var supplementalExports = {};
13421
+ var supplemental = {
13422
+ get exports(){ return supplementalExports; },
13423
+ set exports(v){ supplementalExports = v; },
13424
+ };
12981
13425
 
12982
13426
  /**
12983
13427
  * CLDR JavaScript Library v0.5.4
@@ -12991,841 +13435,231 @@ var event = {exports: {}};
12991
13435
  */
12992
13436
 
12993
13437
  (function (module) {
12994
- /*!
12995
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
12996
- * http://git.io/h4lmVg
13438
+ /*!
13439
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
13440
+ * http://git.io/h4lmVg
13441
+ */
13442
+ (function (factory) {
13443
+ {
13444
+ // Node. CommonJS.
13445
+ module.exports = factory(cldrExports);
13446
+ }
13447
+ })(function (Cldr) {
13448
+ // Build optimization hack to avoid duplicating functions across modules.
13449
+ var alwaysArray = Cldr._alwaysArray;
13450
+ var supplementalMain = function (cldr) {
13451
+ var prepend, supplemental;
13452
+ prepend = function (prepend) {
13453
+ return function (path) {
13454
+ path = alwaysArray(path);
13455
+ return cldr.get([prepend].concat(path));
13456
+ };
13457
+ };
13458
+ supplemental = prepend("supplemental");
13459
+
13460
+ // Week Data
13461
+ // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
13462
+ supplemental.weekData = prepend("supplemental/weekData");
13463
+ supplemental.weekData.firstDay = function () {
13464
+ return cldr.get("supplemental/weekData/firstDay/{territory}") || cldr.get("supplemental/weekData/firstDay/001");
13465
+ };
13466
+ supplemental.weekData.minDays = function () {
13467
+ var minDays = cldr.get("supplemental/weekData/minDays/{territory}") || cldr.get("supplemental/weekData/minDays/001");
13468
+ return parseInt(minDays, 10);
13469
+ };
13470
+
13471
+ // Time Data
13472
+ // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
13473
+ supplemental.timeData = prepend("supplemental/timeData");
13474
+ supplemental.timeData.allowed = function () {
13475
+ return cldr.get("supplemental/timeData/{territory}/_allowed") || cldr.get("supplemental/timeData/001/_allowed");
13476
+ };
13477
+ supplemental.timeData.preferred = function () {
13478
+ return cldr.get("supplemental/timeData/{territory}/_preferred") || cldr.get("supplemental/timeData/001/_preferred");
13479
+ };
13480
+ return supplemental;
13481
+ };
13482
+ var initSuper = Cldr.prototype.init;
13483
+
13484
+ /**
13485
+ * .init() automatically ran on construction.
13486
+ *
13487
+ * Overload .init().
13488
+ */
13489
+ Cldr.prototype.init = function () {
13490
+ initSuper.apply(this, arguments);
13491
+ this.supplemental = supplementalMain(this);
13492
+ };
13493
+ return Cldr;
13494
+ });
13495
+ } (supplemental));
13496
+
13497
+ var unresolvedExports = {};
13498
+ var unresolved = {
13499
+ get exports(){ return unresolvedExports; },
13500
+ set exports(v){ unresolvedExports = v; },
13501
+ };
13502
+
13503
+ /**
13504
+ * CLDR JavaScript Library v0.5.4
13505
+ * http://jquery.com/
13506
+ *
13507
+ * Copyright 2013 Rafael Xavier de Souza
13508
+ * Released under the MIT license
13509
+ * http://jquery.org/license
13510
+ *
13511
+ * Date: 2020-10-22T15:56Z
12997
13512
  */
12998
- (function (factory) {
12999
- {
13000
- // Node. CommonJS.
13001
- module.exports = factory(cldr.exports);
13002
- }
13003
- })(function (Cldr) {
13004
- // Build optimization hack to avoid duplicating functions across modules.
13005
- var pathNormalize = Cldr._pathNormalize,
13006
- validatePresence = Cldr._validatePresence,
13007
- validateType = Cldr._validateType;
13008
- /*!
13009
- * EventEmitter v4.2.7 - git.io/ee
13010
- * Oliver Caldwell
13011
- * MIT license
13012
- * @preserve
13013
- */
13014
13513
 
13015
- var EventEmitter;
13016
- /* jshint ignore:start */
13514
+ (function (module) {
13515
+ /*!
13516
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
13517
+ * http://git.io/h4lmVg
13518
+ */
13519
+ (function (factory) {
13520
+ {
13521
+ // Node. CommonJS.
13522
+ module.exports = factory(cldrExports);
13523
+ }
13524
+ })(function (Cldr) {
13525
+ // Build optimization hack to avoid duplicating functions across modules.
13526
+ var coreLoad = Cldr._coreLoad;
13527
+ var jsonMerge = Cldr._jsonMerge;
13528
+ var pathNormalize = Cldr._pathNormalize;
13529
+ var resourceGet = Cldr._resourceGet;
13530
+ var validatePresence = Cldr._validatePresence;
13531
+ var validateTypePath = Cldr._validateTypePath;
13532
+ var bundleParentLookup = function (Cldr, locale) {
13533
+ var normalizedPath, parent;
13534
+ if (locale === "root") {
13535
+ return;
13536
+ }
13537
+
13538
+ // First, try to find parent on supplemental data.
13539
+ normalizedPath = pathNormalize(["supplemental/parentLocales/parentLocale", locale]);
13540
+ parent = resourceGet(Cldr._resolved, normalizedPath) || resourceGet(Cldr._raw, normalizedPath);
13541
+ if (parent) {
13542
+ return parent;
13543
+ }
13544
+
13545
+ // Or truncate locale.
13546
+ parent = locale.substr(0, locale.lastIndexOf(Cldr.localeSep));
13547
+ if (!parent) {
13548
+ return "root";
13549
+ }
13550
+ return parent;
13551
+ };
13552
+
13553
+ // @path: normalized path
13554
+ var resourceSet = function (data, path, value) {
13555
+ var i,
13556
+ node = data,
13557
+ length = path.length;
13558
+ for (i = 0; i < length - 1; i++) {
13559
+ if (!node[path[i]]) {
13560
+ node[path[i]] = {};
13561
+ }
13562
+ node = node[path[i]];
13563
+ }
13564
+ node[path[i]] = value;
13565
+ };
13566
+ var itemLookup = function () {
13567
+ var lookup;
13568
+ lookup = function (Cldr, locale, path, attributes, childLocale) {
13569
+ var normalizedPath, parent, value;
13570
+
13571
+ // 1: Finish recursion
13572
+ // 2: Avoid infinite loop
13573
+ if (typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */) {
13574
+ return;
13575
+ }
13576
+
13577
+ // Resolve path
13578
+ normalizedPath = pathNormalize(path, attributes);
13579
+
13580
+ // Check resolved (cached) data first
13581
+ // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
13582
+ // represent its leafs in its entirety.
13583
+ value = resourceGet(Cldr._resolved, normalizedPath);
13584
+ if (value !== undefined && typeof value !== "object" /* 1 */) {
13585
+ return value;
13586
+ }
13587
+
13588
+ // Check raw data
13589
+ value = resourceGet(Cldr._raw, normalizedPath);
13590
+ if (value === undefined) {
13591
+ // Or, lookup at parent locale
13592
+ parent = bundleParentLookup(Cldr, locale);
13593
+ value = lookup(Cldr, parent, path, jsonMerge(attributes, {
13594
+ bundle: parent
13595
+ }), locale);
13596
+ }
13597
+ if (value !== undefined) {
13598
+ // Set resolved (cached)
13599
+ resourceSet(Cldr._resolved, normalizedPath, value);
13600
+ }
13601
+ return value;
13602
+ };
13603
+ return lookup;
13604
+ }();
13605
+ Cldr._raw = {};
13606
+
13607
+ /**
13608
+ * Cldr.load( json [, json, ...] )
13609
+ *
13610
+ * @json [JSON] CLDR data or [Array] Array of @json's.
13611
+ *
13612
+ * Load resolved or unresolved cldr data.
13613
+ * Overwrite Cldr.load().
13614
+ */
13615
+ Cldr.load = function () {
13616
+ Cldr._raw = coreLoad(Cldr, Cldr._raw, arguments);
13617
+ };
13618
+
13619
+ /**
13620
+ * Overwrite Cldr.prototype.get().
13621
+ */
13622
+ Cldr.prototype.get = function (path) {
13623
+ validatePresence(path, "path");
13624
+ validateTypePath(path, "path");
13625
+
13626
+ // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
13627
+ // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
13628
+ return itemLookup(Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes);
13629
+ };
13630
+
13631
+ // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
13632
+ if (Cldr._eventInit) {
13633
+ Cldr._eventInit();
13634
+ }
13635
+ return Cldr;
13636
+ });
13637
+ } (unresolved));
13017
13638
 
13018
- EventEmitter = function () {
13019
- /**
13020
- * Class for managing events.
13021
- * Can be extended to provide event functionality in other classes.
13022
- *
13023
- * @class EventEmitter Manages event registering and emitting.
13024
- */
13025
- function EventEmitter() {} // Shortcuts to improve speed and size
13639
+ /**
13640
+ * CLDR JavaScript Library v0.5.4
13641
+ * http://jquery.com/
13642
+ *
13643
+ * Copyright 2013 Rafael Xavier de Souza
13644
+ * Released under the MIT license
13645
+ * http://jquery.org/license
13646
+ *
13647
+ * Date: 2020-10-22T15:56Z
13648
+ */
13026
13649
 
13650
+ (function (module) {
13651
+ /*!
13652
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
13653
+ * http://git.io/h4lmVg
13654
+ */
13027
13655
 
13028
- var proto = EventEmitter.prototype;
13029
- /**
13030
- * Finds the index of the listener for the event in it's storage array.
13031
- *
13032
- * @param {Function[]} listeners Array of listeners to search through.
13033
- * @param {Function} listener Method to look for.
13034
- * @return {Number} Index of the specified listener, -1 if not found
13035
- * @api private
13036
- */
13656
+ // Cldr
13657
+ module.exports = cldrExports;
13037
13658
 
13038
- function indexOfListener(listeners, listener) {
13039
- var i = listeners.length;
13659
+ // Extent Cldr with the following modules
13660
+ } (node_main));
13040
13661
 
13041
- while (i--) {
13042
- if (listeners[i].listener === listener) {
13043
- return i;
13044
- }
13045
- }
13046
-
13047
- return -1;
13048
- }
13049
- /**
13050
- * Alias a method while keeping the context correct, to allow for overwriting of target method.
13051
- *
13052
- * @param {String} name The name of the target method.
13053
- * @return {Function} The aliased method
13054
- * @api private
13055
- */
13056
-
13057
-
13058
- function alias(name) {
13059
- return function aliasClosure() {
13060
- return this[name].apply(this, arguments);
13061
- };
13062
- }
13063
- /**
13064
- * Returns the listener array for the specified event.
13065
- * Will initialise the event object and listener arrays if required.
13066
- * 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.
13067
- * Each property in the object response is an array of listener functions.
13068
- *
13069
- * @param {String|RegExp} evt Name of the event to return the listeners from.
13070
- * @return {Function[]|Object} All listener functions for the event.
13071
- */
13072
-
13073
-
13074
- proto.getListeners = function getListeners(evt) {
13075
- var events = this._getEvents();
13076
-
13077
- var response;
13078
- var key; // Return a concatenated array of all matching events if
13079
- // the selector is a regular expression.
13080
-
13081
- if (evt instanceof RegExp) {
13082
- response = {};
13083
-
13084
- for (key in events) {
13085
- if (events.hasOwnProperty(key) && evt.test(key)) {
13086
- response[key] = events[key];
13087
- }
13088
- }
13089
- } else {
13090
- response = events[evt] || (events[evt] = []);
13091
- }
13092
-
13093
- return response;
13094
- };
13095
- /**
13096
- * Takes a list of listener objects and flattens it into a list of listener functions.
13097
- *
13098
- * @param {Object[]} listeners Raw listener objects.
13099
- * @return {Function[]} Just the listener functions.
13100
- */
13101
-
13102
-
13103
- proto.flattenListeners = function flattenListeners(listeners) {
13104
- var flatListeners = [];
13105
- var i;
13106
-
13107
- for (i = 0; i < listeners.length; i += 1) {
13108
- flatListeners.push(listeners[i].listener);
13109
- }
13110
-
13111
- return flatListeners;
13112
- };
13113
- /**
13114
- * 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.
13115
- *
13116
- * @param {String|RegExp} evt Name of the event to return the listeners from.
13117
- * @return {Object} All listener functions for an event in an object.
13118
- */
13119
-
13120
-
13121
- proto.getListenersAsObject = function getListenersAsObject(evt) {
13122
- var listeners = this.getListeners(evt);
13123
- var response;
13124
-
13125
- if (listeners instanceof Array) {
13126
- response = {};
13127
- response[evt] = listeners;
13128
- }
13129
-
13130
- return response || listeners;
13131
- };
13132
- /**
13133
- * Adds a listener function to the specified event.
13134
- * The listener will not be added if it is a duplicate.
13135
- * If the listener returns true then it will be removed after it is called.
13136
- * If you pass a regular expression as the event name then the listener will be added to all events that match it.
13137
- *
13138
- * @param {String|RegExp} evt Name of the event to attach the listener to.
13139
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
13140
- * @return {Object} Current instance of EventEmitter for chaining.
13141
- */
13142
-
13143
-
13144
- proto.addListener = function addListener(evt, listener) {
13145
- var listeners = this.getListenersAsObject(evt);
13146
- var listenerIsWrapped = typeof listener === 'object';
13147
- var key;
13148
-
13149
- for (key in listeners) {
13150
- if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
13151
- listeners[key].push(listenerIsWrapped ? listener : {
13152
- listener: listener,
13153
- once: false
13154
- });
13155
- }
13156
- }
13157
-
13158
- return this;
13159
- };
13160
- /**
13161
- * Alias of addListener
13162
- */
13163
-
13164
-
13165
- proto.on = alias('addListener');
13166
- /**
13167
- * Semi-alias of addListener. It will add a listener that will be
13168
- * automatically removed after it's first execution.
13169
- *
13170
- * @param {String|RegExp} evt Name of the event to attach the listener to.
13171
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
13172
- * @return {Object} Current instance of EventEmitter for chaining.
13173
- */
13174
-
13175
- proto.addOnceListener = function addOnceListener(evt, listener) {
13176
- return this.addListener(evt, {
13177
- listener: listener,
13178
- once: true
13179
- });
13180
- };
13181
- /**
13182
- * Alias of addOnceListener.
13183
- */
13184
-
13185
-
13186
- proto.once = alias('addOnceListener');
13187
- /**
13188
- * 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.
13189
- * You need to tell it what event names should be matched by a regex.
13190
- *
13191
- * @param {String} evt Name of the event to create.
13192
- * @return {Object} Current instance of EventEmitter for chaining.
13193
- */
13194
-
13195
- proto.defineEvent = function defineEvent(evt) {
13196
- this.getListeners(evt);
13197
- return this;
13198
- };
13199
- /**
13200
- * Uses defineEvent to define multiple events.
13201
- *
13202
- * @param {String[]} evts An array of event names to define.
13203
- * @return {Object} Current instance of EventEmitter for chaining.
13204
- */
13205
-
13206
-
13207
- proto.defineEvents = function defineEvents(evts) {
13208
- for (var i = 0; i < evts.length; i += 1) {
13209
- this.defineEvent(evts[i]);
13210
- }
13211
-
13212
- return this;
13213
- };
13214
- /**
13215
- * Removes a listener function from the specified event.
13216
- * When passed a regular expression as the event name, it will remove the listener from all events that match it.
13217
- *
13218
- * @param {String|RegExp} evt Name of the event to remove the listener from.
13219
- * @param {Function} listener Method to remove from the event.
13220
- * @return {Object} Current instance of EventEmitter for chaining.
13221
- */
13222
-
13223
-
13224
- proto.removeListener = function removeListener(evt, listener) {
13225
- var listeners = this.getListenersAsObject(evt);
13226
- var index;
13227
- var key;
13228
-
13229
- for (key in listeners) {
13230
- if (listeners.hasOwnProperty(key)) {
13231
- index = indexOfListener(listeners[key], listener);
13232
-
13233
- if (index !== -1) {
13234
- listeners[key].splice(index, 1);
13235
- }
13236
- }
13237
- }
13238
-
13239
- return this;
13240
- };
13241
- /**
13242
- * Alias of removeListener
13243
- */
13244
-
13245
-
13246
- proto.off = alias('removeListener');
13247
- /**
13248
- * Adds listeners in bulk using the manipulateListeners method.
13249
- * 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.
13250
- * You can also pass it a regular expression to add the array of listeners to all events that match it.
13251
- * Yeah, this function does quite a bit. That's probably a bad thing.
13252
- *
13253
- * @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.
13254
- * @param {Function[]} [listeners] An optional array of listener functions to add.
13255
- * @return {Object} Current instance of EventEmitter for chaining.
13256
- */
13257
-
13258
- proto.addListeners = function addListeners(evt, listeners) {
13259
- // Pass through to manipulateListeners
13260
- return this.manipulateListeners(false, evt, listeners);
13261
- };
13262
- /**
13263
- * Removes listeners in bulk using the manipulateListeners method.
13264
- * 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.
13265
- * You can also pass it an event name and an array of listeners to be removed.
13266
- * You can also pass it a regular expression to remove the listeners from all events that match it.
13267
- *
13268
- * @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.
13269
- * @param {Function[]} [listeners] An optional array of listener functions to remove.
13270
- * @return {Object} Current instance of EventEmitter for chaining.
13271
- */
13272
-
13273
-
13274
- proto.removeListeners = function removeListeners(evt, listeners) {
13275
- // Pass through to manipulateListeners
13276
- return this.manipulateListeners(true, evt, listeners);
13277
- };
13278
- /**
13279
- * 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.
13280
- * The first argument will determine if the listeners are removed (true) or added (false).
13281
- * 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.
13282
- * You can also pass it an event name and an array of listeners to be added/removed.
13283
- * You can also pass it a regular expression to manipulate the listeners of all events that match it.
13284
- *
13285
- * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
13286
- * @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.
13287
- * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
13288
- * @return {Object} Current instance of EventEmitter for chaining.
13289
- */
13290
-
13291
-
13292
- proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
13293
- var i;
13294
- var value;
13295
- var single = remove ? this.removeListener : this.addListener;
13296
- var multiple = remove ? this.removeListeners : this.addListeners; // If evt is an object then pass each of it's properties to this method
13297
-
13298
- if (typeof evt === 'object' && !(evt instanceof RegExp)) {
13299
- for (i in evt) {
13300
- if (evt.hasOwnProperty(i) && (value = evt[i])) {
13301
- // Pass the single listener straight through to the singular method
13302
- if (typeof value === 'function') {
13303
- single.call(this, i, value);
13304
- } else {
13305
- // Otherwise pass back to the multiple function
13306
- multiple.call(this, i, value);
13307
- }
13308
- }
13309
- }
13310
- } else {
13311
- // So evt must be a string
13312
- // And listeners must be an array of listeners
13313
- // Loop over it and pass each one to the multiple method
13314
- i = listeners.length;
13315
-
13316
- while (i--) {
13317
- single.call(this, evt, listeners[i]);
13318
- }
13319
- }
13320
-
13321
- return this;
13322
- };
13323
- /**
13324
- * Removes all listeners from a specified event.
13325
- * If you do not specify an event then all listeners will be removed.
13326
- * That means every event will be emptied.
13327
- * You can also pass a regex to remove all events that match it.
13328
- *
13329
- * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
13330
- * @return {Object} Current instance of EventEmitter for chaining.
13331
- */
13332
-
13333
-
13334
- proto.removeEvent = function removeEvent(evt) {
13335
- var type = typeof evt;
13336
-
13337
- var events = this._getEvents();
13338
-
13339
- var key; // Remove different things depending on the state of evt
13340
-
13341
- if (type === 'string') {
13342
- // Remove all listeners for the specified event
13343
- delete events[evt];
13344
- } else if (evt instanceof RegExp) {
13345
- // Remove all events matching the regex.
13346
- for (key in events) {
13347
- if (events.hasOwnProperty(key) && evt.test(key)) {
13348
- delete events[key];
13349
- }
13350
- }
13351
- } else {
13352
- // Remove all listeners in all events
13353
- delete this._events;
13354
- }
13355
-
13356
- return this;
13357
- };
13358
- /**
13359
- * Alias of removeEvent.
13360
- *
13361
- * Added to mirror the node API.
13362
- */
13363
-
13364
-
13365
- proto.removeAllListeners = alias('removeEvent');
13366
- /**
13367
- * Emits an event of your choice.
13368
- * When emitted, every listener attached to that event will be executed.
13369
- * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
13370
- * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
13371
- * So they will not arrive within the array on the other side, they will be separate.
13372
- * You can also pass a regular expression to emit to all events that match it.
13373
- *
13374
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
13375
- * @param {Array} [args] Optional array of arguments to be passed to each listener.
13376
- * @return {Object} Current instance of EventEmitter for chaining.
13377
- */
13378
-
13379
- proto.emitEvent = function emitEvent(evt, args) {
13380
- var listeners = this.getListenersAsObject(evt);
13381
- var listener;
13382
- var i;
13383
- var key;
13384
- var response;
13385
-
13386
- for (key in listeners) {
13387
- if (listeners.hasOwnProperty(key)) {
13388
- i = listeners[key].length;
13389
-
13390
- while (i--) {
13391
- // If the listener returns true then it shall be removed from the event
13392
- // The function is executed either with a basic call or an apply if there is an args array
13393
- listener = listeners[key][i];
13394
-
13395
- if (listener.once === true) {
13396
- this.removeListener(evt, listener.listener);
13397
- }
13398
-
13399
- response = listener.listener.apply(this, args || []);
13400
-
13401
- if (response === this._getOnceReturnValue()) {
13402
- this.removeListener(evt, listener.listener);
13403
- }
13404
- }
13405
- }
13406
- }
13407
-
13408
- return this;
13409
- };
13410
- /**
13411
- * Alias of emitEvent
13412
- */
13413
-
13414
-
13415
- proto.trigger = alias('emitEvent');
13416
- /**
13417
- * 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.
13418
- * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
13419
- *
13420
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
13421
- * @param {...*} Optional additional arguments to be passed to each listener.
13422
- * @return {Object} Current instance of EventEmitter for chaining.
13423
- */
13424
-
13425
- proto.emit = function emit(evt) {
13426
- var args = Array.prototype.slice.call(arguments, 1);
13427
- return this.emitEvent(evt, args);
13428
- };
13429
- /**
13430
- * Sets the current value to check against when executing listeners. If a
13431
- * listeners return value matches the one set here then it will be removed
13432
- * after execution. This value defaults to true.
13433
- *
13434
- * @param {*} value The new value to check for when executing listeners.
13435
- * @return {Object} Current instance of EventEmitter for chaining.
13436
- */
13437
-
13438
-
13439
- proto.setOnceReturnValue = function setOnceReturnValue(value) {
13440
- this._onceReturnValue = value;
13441
- return this;
13442
- };
13443
- /**
13444
- * Fetches the current value to check against when executing listeners. If
13445
- * the listeners return value matches this one then it should be removed
13446
- * automatically. It will return true by default.
13447
- *
13448
- * @return {*|Boolean} The current value to check for or the default, true.
13449
- * @api private
13450
- */
13451
-
13452
-
13453
- proto._getOnceReturnValue = function _getOnceReturnValue() {
13454
- if (this.hasOwnProperty('_onceReturnValue')) {
13455
- return this._onceReturnValue;
13456
- } else {
13457
- return true;
13458
- }
13459
- };
13460
- /**
13461
- * Fetches the events object and creates one if required.
13462
- *
13463
- * @return {Object} The events storage object.
13464
- * @api private
13465
- */
13466
-
13467
-
13468
- proto._getEvents = function _getEvents() {
13469
- return this._events || (this._events = {});
13470
- };
13471
- /**
13472
- * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
13473
- *
13474
- * @return {Function} Non conflicting EventEmitter class.
13475
- */
13476
-
13477
-
13478
- EventEmitter.noConflict = function noConflict() {
13479
- originalGlobalValue;
13480
- return EventEmitter;
13481
- };
13482
-
13483
- return EventEmitter;
13484
- }();
13485
- /* jshint ignore:end */
13486
-
13487
-
13488
- var validateTypeFunction = function (value, name) {
13489
- validateType(value, name, typeof value === "undefined" || typeof value === "function", "Function");
13490
- };
13491
-
13492
- var superGet,
13493
- superInit,
13494
- globalEe = new EventEmitter();
13495
-
13496
- function validateTypeEvent(value, name) {
13497
- validateType(value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp");
13498
- }
13499
-
13500
- function validateThenCall(method, self) {
13501
- return function (event, listener) {
13502
- validatePresence(event, "event");
13503
- validateTypeEvent(event, "event");
13504
- validatePresence(listener, "listener");
13505
- validateTypeFunction(listener, "listener");
13506
- return self[method].apply(self, arguments);
13507
- };
13508
- }
13509
-
13510
- function off(self) {
13511
- return validateThenCall("off", self);
13512
- }
13513
-
13514
- function on(self) {
13515
- return validateThenCall("on", self);
13516
- }
13517
-
13518
- function once(self) {
13519
- return validateThenCall("once", self);
13520
- }
13521
-
13522
- Cldr.off = off(globalEe);
13523
- Cldr.on = on(globalEe);
13524
- Cldr.once = once(globalEe);
13525
- /**
13526
- * Overload Cldr.prototype.init().
13527
- */
13528
-
13529
- superInit = Cldr.prototype.init;
13530
-
13531
- Cldr.prototype.init = function () {
13532
- var ee;
13533
- this.ee = ee = new EventEmitter();
13534
- this.off = off(ee);
13535
- this.on = on(ee);
13536
- this.once = once(ee);
13537
- superInit.apply(this, arguments);
13538
- };
13539
- /**
13540
- * getOverload is encapsulated, because of cldr/unresolved. If it's loaded
13541
- * after cldr/event (and note it overwrites .get), it can trigger this
13542
- * overload again.
13543
- */
13544
-
13545
-
13546
- function getOverload() {
13547
- /**
13548
- * Overload Cldr.prototype.get().
13549
- */
13550
- superGet = Cldr.prototype.get;
13551
-
13552
- Cldr.prototype.get = function (path) {
13553
- var value = superGet.apply(this, arguments);
13554
- path = pathNormalize(path, this.attributes).join("/");
13555
- globalEe.trigger("get", [path, value]);
13556
- this.ee.trigger("get", [path, value]);
13557
- return value;
13558
- };
13559
- }
13560
-
13561
- Cldr._eventInit = getOverload;
13562
- getOverload();
13563
- return Cldr;
13564
- });
13565
- }(event));
13566
-
13567
- var supplemental = {exports: {}};
13568
-
13569
- /**
13570
- * CLDR JavaScript Library v0.5.4
13571
- * http://jquery.com/
13572
- *
13573
- * Copyright 2013 Rafael Xavier de Souza
13574
- * Released under the MIT license
13575
- * http://jquery.org/license
13576
- *
13577
- * Date: 2020-10-22T15:56Z
13578
- */
13579
-
13580
- (function (module) {
13581
- /*!
13582
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
13583
- * http://git.io/h4lmVg
13584
- */
13585
- (function (factory) {
13586
- {
13587
- // Node. CommonJS.
13588
- module.exports = factory(cldr.exports);
13589
- }
13590
- })(function (Cldr) {
13591
- // Build optimization hack to avoid duplicating functions across modules.
13592
- var alwaysArray = Cldr._alwaysArray;
13593
-
13594
- var supplementalMain = function (cldr) {
13595
- var prepend, supplemental;
13596
-
13597
- prepend = function (prepend) {
13598
- return function (path) {
13599
- path = alwaysArray(path);
13600
- return cldr.get([prepend].concat(path));
13601
- };
13602
- };
13603
-
13604
- supplemental = prepend("supplemental"); // Week Data
13605
- // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
13606
-
13607
- supplemental.weekData = prepend("supplemental/weekData");
13608
-
13609
- supplemental.weekData.firstDay = function () {
13610
- return cldr.get("supplemental/weekData/firstDay/{territory}") || cldr.get("supplemental/weekData/firstDay/001");
13611
- };
13612
-
13613
- supplemental.weekData.minDays = function () {
13614
- var minDays = cldr.get("supplemental/weekData/minDays/{territory}") || cldr.get("supplemental/weekData/minDays/001");
13615
- return parseInt(minDays, 10);
13616
- }; // Time Data
13617
- // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
13618
-
13619
-
13620
- supplemental.timeData = prepend("supplemental/timeData");
13621
-
13622
- supplemental.timeData.allowed = function () {
13623
- return cldr.get("supplemental/timeData/{territory}/_allowed") || cldr.get("supplemental/timeData/001/_allowed");
13624
- };
13625
-
13626
- supplemental.timeData.preferred = function () {
13627
- return cldr.get("supplemental/timeData/{territory}/_preferred") || cldr.get("supplemental/timeData/001/_preferred");
13628
- };
13629
-
13630
- return supplemental;
13631
- };
13632
-
13633
- var initSuper = Cldr.prototype.init;
13634
- /**
13635
- * .init() automatically ran on construction.
13636
- *
13637
- * Overload .init().
13638
- */
13639
-
13640
- Cldr.prototype.init = function () {
13641
- initSuper.apply(this, arguments);
13642
- this.supplemental = supplementalMain(this);
13643
- };
13644
-
13645
- return Cldr;
13646
- });
13647
- }(supplemental));
13648
-
13649
- var unresolved = {exports: {}};
13650
-
13651
- /**
13652
- * CLDR JavaScript Library v0.5.4
13653
- * http://jquery.com/
13654
- *
13655
- * Copyright 2013 Rafael Xavier de Souza
13656
- * Released under the MIT license
13657
- * http://jquery.org/license
13658
- *
13659
- * Date: 2020-10-22T15:56Z
13660
- */
13661
-
13662
- (function (module) {
13663
- /*!
13664
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
13665
- * http://git.io/h4lmVg
13666
- */
13667
- (function (factory) {
13668
- {
13669
- // Node. CommonJS.
13670
- module.exports = factory(cldr.exports);
13671
- }
13672
- })(function (Cldr) {
13673
- // Build optimization hack to avoid duplicating functions across modules.
13674
- var coreLoad = Cldr._coreLoad;
13675
- var jsonMerge = Cldr._jsonMerge;
13676
- var pathNormalize = Cldr._pathNormalize;
13677
- var resourceGet = Cldr._resourceGet;
13678
- var validatePresence = Cldr._validatePresence;
13679
- var validateTypePath = Cldr._validateTypePath;
13680
-
13681
- var bundleParentLookup = function (Cldr, locale) {
13682
- var normalizedPath, parent;
13683
-
13684
- if (locale === "root") {
13685
- return;
13686
- } // First, try to find parent on supplemental data.
13687
-
13688
-
13689
- normalizedPath = pathNormalize(["supplemental/parentLocales/parentLocale", locale]);
13690
- parent = resourceGet(Cldr._resolved, normalizedPath) || resourceGet(Cldr._raw, normalizedPath);
13691
-
13692
- if (parent) {
13693
- return parent;
13694
- } // Or truncate locale.
13695
-
13696
-
13697
- parent = locale.substr(0, locale.lastIndexOf(Cldr.localeSep));
13698
-
13699
- if (!parent) {
13700
- return "root";
13701
- }
13702
-
13703
- return parent;
13704
- }; // @path: normalized path
13705
-
13706
-
13707
- var resourceSet = function (data, path, value) {
13708
- var i,
13709
- node = data,
13710
- length = path.length;
13711
-
13712
- for (i = 0; i < length - 1; i++) {
13713
- if (!node[path[i]]) {
13714
- node[path[i]] = {};
13715
- }
13716
-
13717
- node = node[path[i]];
13718
- }
13719
-
13720
- node[path[i]] = value;
13721
- };
13722
-
13723
- var itemLookup = function () {
13724
- var lookup;
13725
-
13726
- lookup = function (Cldr, locale, path, attributes, childLocale) {
13727
- var normalizedPath, parent, value; // 1: Finish recursion
13728
- // 2: Avoid infinite loop
13729
-
13730
- if (typeof locale === "undefined"
13731
- /* 1 */
13732
- || locale === childLocale
13733
- /* 2 */
13734
- ) {
13735
- return;
13736
- } // Resolve path
13737
-
13738
-
13739
- normalizedPath = pathNormalize(path, attributes); // Check resolved (cached) data first
13740
- // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
13741
- // represent its leafs in its entirety.
13742
-
13743
- value = resourceGet(Cldr._resolved, normalizedPath);
13744
-
13745
- if (value !== undefined && typeof value !== "object"
13746
- /* 1 */
13747
- ) {
13748
- return value;
13749
- } // Check raw data
13750
-
13751
-
13752
- value = resourceGet(Cldr._raw, normalizedPath);
13753
-
13754
- if (value === undefined) {
13755
- // Or, lookup at parent locale
13756
- parent = bundleParentLookup(Cldr, locale);
13757
- value = lookup(Cldr, parent, path, jsonMerge(attributes, {
13758
- bundle: parent
13759
- }), locale);
13760
- }
13761
-
13762
- if (value !== undefined) {
13763
- // Set resolved (cached)
13764
- resourceSet(Cldr._resolved, normalizedPath, value);
13765
- }
13766
-
13767
- return value;
13768
- };
13769
-
13770
- return lookup;
13771
- }();
13772
-
13773
- Cldr._raw = {};
13774
- /**
13775
- * Cldr.load( json [, json, ...] )
13776
- *
13777
- * @json [JSON] CLDR data or [Array] Array of @json's.
13778
- *
13779
- * Load resolved or unresolved cldr data.
13780
- * Overwrite Cldr.load().
13781
- */
13782
-
13783
- Cldr.load = function () {
13784
- Cldr._raw = coreLoad(Cldr, Cldr._raw, arguments);
13785
- };
13786
- /**
13787
- * Overwrite Cldr.prototype.get().
13788
- */
13789
-
13790
-
13791
- Cldr.prototype.get = function (path) {
13792
- validatePresence(path, "path");
13793
- 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.
13794
- // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
13795
-
13796
- return itemLookup(Cldr, this.attributes && this.attributes.bundle
13797
- /* 1 */
13798
- || ""
13799
- /* 2 */
13800
- , path, this.attributes);
13801
- }; // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
13802
-
13803
-
13804
- if (Cldr._eventInit) {
13805
- Cldr._eventInit();
13806
- }
13807
-
13808
- return Cldr;
13809
- });
13810
- }(unresolved));
13811
-
13812
- /**
13813
- * CLDR JavaScript Library v0.5.4
13814
- * http://jquery.com/
13815
- *
13816
- * Copyright 2013 Rafael Xavier de Souza
13817
- * Released under the MIT license
13818
- * http://jquery.org/license
13819
- *
13820
- * Date: 2020-10-22T15:56Z
13821
- */
13822
-
13823
- /*!
13824
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
13825
- * http://git.io/h4lmVg
13826
- */
13827
- // Cldr
13828
- var node_main = cldr.exports; // Extent Cldr with the following modules
13662
+ var Cldr = /*@__PURE__*/getDefaultExportFromCjs(node_mainExports);
13829
13663
 
13830
13664
  /*
13831
13665
  * @copyright (c) 2020, Philipp Thuerwaechter & Pattrick Hueper
@@ -13834,16 +13668,15 @@ var node_main = cldr.exports; // Extent Cldr with the following modules
13834
13668
  var cldrDataLoaded = new Set();
13835
13669
  var loadCldrData = function loadCldrData(path) {
13836
13670
  if (!cldrDataLoaded.has(path)) {
13837
- node_main.load(cldrData(path));
13671
+ Cldr.load(cldrData(path));
13838
13672
  cldrDataLoaded.add(path);
13839
13673
  }
13840
13674
  };
13841
13675
  var localeToCldrInstanceCache = {};
13842
13676
  var getOrCreateCldrInstance = function getOrCreateCldrInstance(locale) {
13843
13677
  if (localeToCldrInstanceCache[locale] == null) {
13844
- localeToCldrInstanceCache[locale] = new node_main(locale);
13678
+ localeToCldrInstanceCache[locale] = new Cldr(locale);
13845
13679
  }
13846
-
13847
13680
  return localeToCldrInstanceCache[locale];
13848
13681
  };
13849
13682
  var localeToMapZonesCache = {};
@@ -13855,13 +13688,11 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
13855
13688
  if (!mapZones[metaZone.mapZone._other]) {
13856
13689
  mapZones[metaZone.mapZone._other] = {};
13857
13690
  }
13858
-
13859
13691
  mapZones[metaZone.mapZone._other][metaZone.mapZone._territory] = metaZone.mapZone._type;
13860
13692
  }
13861
13693
  });
13862
13694
  localeToMapZonesCache[cldr.locale] = mapZones;
13863
13695
  }
13864
-
13865
13696
  return localeToMapZonesCache[cldr.locale];
13866
13697
  };
13867
13698
 
@@ -13869,55 +13700,41 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
13869
13700
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
13870
13701
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
13871
13702
  */
13872
-
13873
13703
  var CldrDateTimeTextProvider = function () {
13874
13704
  function CldrDateTimeTextProvider() {
13875
13705
  this._cache = {};
13876
13706
  loadCldrData('supplemental/likelySubtags.json');
13877
13707
  }
13878
-
13879
13708
  var _proto = CldrDateTimeTextProvider.prototype;
13880
-
13881
13709
  _proto.getAvailableLocales = function getAvailableLocales() {
13882
13710
  return cldrData('availableLocales.json').availableLocales;
13883
13711
  };
13884
-
13885
13712
  _proto.getText = function getText(field, value, style, locale) {
13886
13713
  var store = this._findStore(field, locale);
13887
-
13888
13714
  if (store instanceof LocaleStore) {
13889
13715
  return store.getText(value, style);
13890
13716
  }
13891
-
13892
13717
  return null;
13893
13718
  };
13894
-
13895
13719
  _proto.getTextIterator = function getTextIterator(field, style, locale) {
13896
13720
  var store = this._findStore(field, locale);
13897
-
13898
13721
  if (store instanceof LocaleStore) {
13899
13722
  return store.getTextIterator(style);
13900
13723
  }
13901
-
13902
13724
  return null;
13903
13725
  };
13904
-
13905
13726
  _proto._findStore = function _findStore(field, locale) {
13906
13727
  var key = createEntry(field, locale);
13907
13728
  var store = this._cache[key];
13908
-
13909
13729
  if (store === undefined) {
13910
13730
  store = this._createStore(field, locale);
13911
13731
  this._cache[key] = store;
13912
13732
  }
13913
-
13914
13733
  return store;
13915
13734
  };
13916
-
13917
13735
  _proto._createStore = function _createStore(field, locale) {
13918
13736
  loadCldrData("main/" + locale.localeString() + "/ca-gregorian.json");
13919
13737
  var cldr = getOrCreateCldrInstance(locale.localeString());
13920
-
13921
13738
  if (field === ChronoField.MONTH_OF_YEAR) {
13922
13739
  var monthsData = cldr.main('dates/calendars/gregorian/months/format');
13923
13740
  var styleMap = {};
@@ -13965,7 +13782,6 @@ var CldrDateTimeTextProvider = function () {
13965
13782
  styleMap[TextStyle.SHORT] = data;
13966
13783
  return this._createLocaleStore(styleMap);
13967
13784
  }
13968
-
13969
13785
  if (field === ChronoField.DAY_OF_WEEK) {
13970
13786
  var daysData = cldr.main('dates/calendars/gregorian/days/format');
13971
13787
  var _styleMap = {};
@@ -13998,7 +13814,6 @@ var CldrDateTimeTextProvider = function () {
13998
13814
  _styleMap[TextStyle.SHORT] = _data;
13999
13815
  return this._createLocaleStore(_styleMap);
14000
13816
  }
14001
-
14002
13817
  if (field === ChronoField.AMPM_OF_DAY) {
14003
13818
  var dayPeriodsData = cldr.main('dates/calendars/gregorian/dayPeriods/format');
14004
13819
  var _styleMap2 = {};
@@ -14016,7 +13831,6 @@ var CldrDateTimeTextProvider = function () {
14016
13831
  _styleMap2[TextStyle.SHORT] = _data2;
14017
13832
  return this._createLocaleStore(_styleMap2);
14018
13833
  }
14019
-
14020
13834
  if (field === ChronoField.ERA) {
14021
13835
  var erasData = cldr.main('dates/calendars/gregorian/eras');
14022
13836
  var _styleMap3 = {};
@@ -14034,7 +13848,6 @@ var CldrDateTimeTextProvider = function () {
14034
13848
  _styleMap3[TextStyle.SHORT] = _data3;
14035
13849
  return this._createLocaleStore(_styleMap3);
14036
13850
  }
14037
-
14038
13851
  if (field === IsoFields.QUARTER_OF_YEAR) {
14039
13852
  var quartersData = cldr.main('dates/calendars/gregorian/quarters/format');
14040
13853
  var _styleMap4 = {};
@@ -14058,40 +13871,30 @@ var CldrDateTimeTextProvider = function () {
14058
13871
  _styleMap4[TextStyle.SHORT] = _data4;
14059
13872
  return this._createLocaleStore(_styleMap4);
14060
13873
  }
14061
-
14062
13874
  return null;
14063
13875
  };
14064
-
14065
13876
  _proto._createLocaleStore = function _createLocaleStore(valueTextMap) {
14066
13877
  valueTextMap[TextStyle.FULL_STANDALONE] = valueTextMap[TextStyle.FULL];
14067
13878
  valueTextMap[TextStyle.SHORT_STANDALONE] = valueTextMap[TextStyle.SHORT];
14068
-
14069
13879
  if (Object.keys(valueTextMap).indexOf(TextStyle.NARROW) > -1 && Object.keys(valueTextMap).indexOf(TextStyle.NARROW_STANDALONE) === -1) {
14070
13880
  valueTextMap[TextStyle.NARROW_STANDALONE] = valueTextMap[TextStyle.NARROW];
14071
13881
  }
14072
-
14073
13882
  return new LocaleStore(valueTextMap);
14074
13883
  };
14075
-
14076
13884
  return CldrDateTimeTextProvider;
14077
13885
  }();
14078
13886
 
14079
13887
  var _jodaInternal$assert$2 = _.assert,
14080
- requireNonNull$3 = _jodaInternal$assert$2.requireNonNull,
14081
- requireInstance$2 = _jodaInternal$assert$2.requireInstance;
14082
-
13888
+ requireNonNull$3 = _jodaInternal$assert$2.requireNonNull,
13889
+ requireInstance$2 = _jodaInternal$assert$2.requireInstance;
14083
13890
  var LENGTH_COMPARATOR = function LENGTH_COMPARATOR(str1, str2) {
14084
13891
  var cmp = str2.length - str1.length;
14085
-
14086
13892
  if (cmp === 0) {
14087
13893
  cmp = str1.localeCompare(str2);
14088
13894
  }
14089
-
14090
13895
  return cmp;
14091
13896
  };
14092
-
14093
13897
  var resolveZoneIdTextCache = {};
14094
-
14095
13898
  var CldrZoneTextPrinterParser = function () {
14096
13899
  function CldrZoneTextPrinterParser(textStyle) {
14097
13900
  requireNonNull$3(textStyle, 'textStyle');
@@ -14101,69 +13904,52 @@ var CldrZoneTextPrinterParser = function () {
14101
13904
  loadCldrData('supplemental/likelySubtags.json');
14102
13905
  loadCldrData('supplemental/metaZones.json');
14103
13906
  }
14104
-
14105
13907
  var _proto = CldrZoneTextPrinterParser.prototype;
14106
-
14107
13908
  _proto._cachedResolveZoneIdText = function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
14108
13909
  if (resolveZoneIdTextCache[cldr.locale] == null) {
14109
13910
  resolveZoneIdTextCache[cldr.locale] = {};
14110
13911
  }
14111
-
14112
13912
  var zoneIdToStyle = resolveZoneIdTextCache[cldr.locale];
14113
-
14114
13913
  if (zoneIdToStyle[zoneId] == null) {
14115
13914
  zoneIdToStyle[zoneId] = {};
14116
13915
  }
14117
-
14118
13916
  var styleToType = zoneIdToStyle[zoneId];
14119
-
14120
13917
  if (styleToType[style] == null) {
14121
13918
  styleToType[style] = {};
14122
13919
  }
14123
-
14124
13920
  var typeToResolvedZoneIdText = styleToType[style];
14125
-
14126
13921
  if (typeToResolvedZoneIdText[type] == null) {
14127
13922
  typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
14128
13923
  }
14129
-
14130
13924
  return typeToResolvedZoneIdText[type];
14131
13925
  };
14132
-
14133
13926
  _proto._resolveZoneIdText = function _resolveZoneIdText(cldr, zoneId, style, type) {
14134
13927
  var zoneData = cldr.main("dates/timeZoneNames/zone/" + zoneId + "/" + style + "/" + type);
14135
-
14136
13928
  if (zoneData) {
14137
13929
  return zoneData;
14138
13930
  } else {
14139
13931
  var metazoneInfo = cldr.get("supplemental/metaZones/metazoneInfo/timezone/" + zoneId);
14140
-
14141
13932
  if (metazoneInfo) {
14142
13933
  var metazone = metazoneInfo[metazoneInfo.length - 1]['usesMetazone']['_mzone'];
14143
13934
  var metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/" + type);
14144
-
14145
13935
  if (metaZoneData) {
14146
13936
  return metaZoneData;
14147
13937
  } else {
14148
13938
  metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/generic");
14149
-
14150
13939
  if (!metaZoneData) {
14151
13940
  metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/standard");
14152
13941
  }
14153
-
14154
13942
  if (metaZoneData) {
14155
13943
  return metaZoneData;
14156
13944
  } else {
14157
13945
  var mapZones = getOrCreateMapZones(cldr);
14158
13946
  var preferredZone = mapZones[metazone][cldr.attributes.territory];
14159
-
14160
13947
  if (preferredZone) {
14161
13948
  if (preferredZone !== zoneId) {
14162
13949
  return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
14163
13950
  }
14164
13951
  } else {
14165
13952
  var goldenZone = mapZones[metazone]['001'];
14166
-
14167
13953
  if (goldenZone !== zoneId) {
14168
13954
  return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
14169
13955
  }
@@ -14173,14 +13959,11 @@ var CldrZoneTextPrinterParser = function () {
14173
13959
  }
14174
13960
  }
14175
13961
  };
14176
-
14177
13962
  _proto.print = function print(context, buf) {
14178
13963
  var zone = context.getValueQuery(TemporalQueries.zoneId());
14179
-
14180
13964
  if (zone == null) {
14181
13965
  return false;
14182
13966
  }
14183
-
14184
13967
  if (zone.normalized() instanceof ZoneOffset) {
14185
13968
  buf.append(zone.id());
14186
13969
  return true;
@@ -14189,51 +13972,38 @@ var CldrZoneTextPrinterParser = function () {
14189
13972
  var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
14190
13973
  loadCldrData("main/" + context.locale().localeString() + "/timeZoneNames.json");
14191
13974
  var cldr = getOrCreateCldrInstance(context.locale().localeString());
14192
-
14193
13975
  var text = this._cachedResolveZoneIdText(cldr, zone.id(), tzstyle, tzType);
14194
-
14195
13976
  if (text) {
14196
13977
  buf.append(text);
14197
13978
  } else {
14198
13979
  buf.append(zone.id());
14199
13980
  }
14200
-
14201
13981
  return true;
14202
13982
  };
14203
-
14204
13983
  _proto._resolveZoneIds = function _resolveZoneIds(localString) {
14205
13984
  if (this._zoneIdsLocales[localString] != null) {
14206
13985
  return this._zoneIdsLocales[localString];
14207
13986
  }
14208
-
14209
13987
  var ids = {};
14210
13988
  loadCldrData("main/" + localString + "/timeZoneNames.json");
14211
13989
  var cldr = getOrCreateCldrInstance(localString);
14212
-
14213
13990
  for (var _iterator = _createForOfIteratorHelperLoose(ZoneRulesProvider.getAvailableZoneIds()), _step; !(_step = _iterator()).done;) {
14214
13991
  var id = _step.value;
14215
13992
  ids[id] = id;
14216
13993
  var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
14217
-
14218
13994
  var genericText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'generic');
14219
-
14220
13995
  if (genericText) {
14221
13996
  ids[genericText] = id;
14222
13997
  }
14223
-
14224
13998
  var standardText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'standard');
14225
-
14226
13999
  if (standardText) {
14227
14000
  ids[standardText] = id;
14228
14001
  }
14229
-
14230
14002
  var daylightText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'daylight');
14231
-
14232
14003
  if (daylightText) {
14233
14004
  ids[daylightText] = id;
14234
14005
  }
14235
14006
  }
14236
-
14237
14007
  var sortedKeys = Object.keys(ids).sort(LENGTH_COMPARATOR);
14238
14008
  this._zoneIdsLocales[localString] = {
14239
14009
  ids: ids,
@@ -14241,37 +14011,29 @@ var CldrZoneTextPrinterParser = function () {
14241
14011
  };
14242
14012
  return this._zoneIdsLocales[localString];
14243
14013
  };
14244
-
14245
14014
  _proto.parse = function parse(context, text, position) {
14246
14015
  for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
14247
14016
  var name = _arr[_i];
14248
-
14249
14017
  if (context.subSequenceEquals(text, position, name, 0, name.length)) {
14250
14018
  context.setParsedZone(ZoneId.of(name));
14251
14019
  return position + name.length;
14252
14020
  }
14253
14021
  }
14254
-
14255
14022
  var _this$_resolveZoneIds = this._resolveZoneIds(context.locale().localeString()),
14256
- ids = _this$_resolveZoneIds.ids,
14257
- sortedKeys = _this$_resolveZoneIds.sortedKeys;
14258
-
14023
+ ids = _this$_resolveZoneIds.ids,
14024
+ sortedKeys = _this$_resolveZoneIds.sortedKeys;
14259
14025
  for (var _iterator2 = _createForOfIteratorHelperLoose(sortedKeys), _step2; !(_step2 = _iterator2()).done;) {
14260
14026
  var _name = _step2.value;
14261
-
14262
14027
  if (context.subSequenceEquals(text, position, _name, 0, _name.length)) {
14263
14028
  context.setParsedZone(ZoneId.of(ids[_name]));
14264
14029
  return position + _name.length;
14265
14030
  }
14266
14031
  }
14267
-
14268
14032
  return ~position;
14269
14033
  };
14270
-
14271
14034
  _proto.toString = function toString() {
14272
14035
  return "ZoneText(" + this._textStyle + ")";
14273
14036
  };
14274
-
14275
14037
  return CldrZoneTextPrinterParser;
14276
14038
  }();
14277
14039
 
@@ -14281,178 +14043,127 @@ var CldrZoneTextPrinterParser = function () {
14281
14043
  * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
14282
14044
  */
14283
14045
  var MathUtil$1 = _.MathUtil;
14284
-
14285
14046
  var LocalizedOffsetPrinterParser = function () {
14286
14047
  function LocalizedOffsetPrinterParser(textStyle) {
14287
14048
  this._textStyle = textStyle;
14288
14049
  }
14289
-
14290
14050
  var _proto = LocalizedOffsetPrinterParser.prototype;
14291
-
14292
14051
  _proto.textStyle = function textStyle() {
14293
14052
  return this._textStyle;
14294
14053
  };
14295
-
14296
14054
  _proto.print = function print(context, buf) {
14297
14055
  var offsetSecs = context.getValue(ChronoField.OFFSET_SECONDS);
14298
-
14299
14056
  if (offsetSecs == null) {
14300
14057
  return false;
14301
14058
  }
14302
-
14303
14059
  buf.append('GMT');
14304
-
14305
14060
  if (this._textStyle === TextStyle.FULL) {
14306
14061
  return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').print(context, buf);
14307
14062
  }
14308
-
14309
14063
  var totalSecs = MathUtil$1.safeToInt(offsetSecs);
14310
-
14311
14064
  if (totalSecs !== 0) {
14312
14065
  var absHours = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 3600), 100));
14313
14066
  var absMinutes = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 60), 60));
14314
14067
  var absSeconds = Math.abs(MathUtil$1.intMod(totalSecs, 60));
14315
14068
  buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
14316
-
14317
14069
  if (absMinutes > 0 || absSeconds > 0) {
14318
14070
  buf.append(':').append(MathUtil$1.intDiv(absMinutes, 10)).append(MathUtil$1.intMod(absMinutes, 10));
14319
-
14320
14071
  if (absSeconds > 0) {
14321
14072
  buf.append(':').append(MathUtil$1.intDiv(absSeconds, 10)).append(MathUtil$1.intMod(absSeconds, 10));
14322
14073
  }
14323
14074
  }
14324
14075
  }
14325
-
14326
14076
  return true;
14327
14077
  };
14328
-
14329
14078
  _proto.parse = function parse(context, text, position) {
14330
14079
  if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
14331
14080
  return ~position;
14332
14081
  }
14333
-
14334
14082
  position += 3;
14335
-
14336
14083
  if (this._textStyle === TextStyle.FULL) {
14337
14084
  return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').parse(context, text, position);
14338
14085
  }
14339
-
14340
14086
  var end = text.length;
14341
-
14342
14087
  if (position === end) {
14343
14088
  return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
14344
14089
  }
14345
-
14346
14090
  var sign = text.charAt(position);
14347
-
14348
14091
  if (sign !== '+' && sign !== '-') {
14349
14092
  return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
14350
14093
  }
14351
-
14352
14094
  var negative = sign === '-' ? -1 : 1;
14353
-
14354
14095
  if (position === end) {
14355
14096
  return ~position;
14356
14097
  }
14357
-
14358
14098
  position++;
14359
14099
  var ch = text.charAt(position);
14360
-
14361
14100
  if (ch < '0' || ch > '9') {
14362
14101
  return ~position;
14363
14102
  }
14364
-
14365
14103
  position++;
14366
14104
  var hour = MathUtil$1.parseInt(ch);
14367
-
14368
14105
  if (position !== end) {
14369
14106
  ch = text.charAt(position);
14370
-
14371
14107
  if (ch >= '0' && ch <= '9') {
14372
14108
  hour = hour * 10 + MathUtil$1.parseInt(ch);
14373
-
14374
14109
  if (hour > 23) {
14375
14110
  return ~position;
14376
14111
  }
14377
-
14378
14112
  position++;
14379
14113
  }
14380
14114
  }
14381
-
14382
14115
  if (position === end || text.charAt(position) !== ':') {
14383
14116
  var _offset = negative * 3600 * hour;
14384
-
14385
14117
  return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset, position, position);
14386
14118
  }
14387
-
14388
14119
  position++;
14389
-
14390
14120
  if (position > end - 2) {
14391
14121
  return ~position;
14392
14122
  }
14393
-
14394
14123
  ch = text.charAt(position);
14395
-
14396
14124
  if (ch < '0' || ch > '9') {
14397
14125
  return ~position;
14398
14126
  }
14399
-
14400
14127
  position++;
14401
14128
  var min = MathUtil$1.parseInt(ch);
14402
14129
  ch = text.charAt(position);
14403
-
14404
14130
  if (ch < '0' || ch > '9') {
14405
14131
  return ~position;
14406
14132
  }
14407
-
14408
14133
  position++;
14409
14134
  min = min * 10 + MathUtil$1.parseInt(ch);
14410
-
14411
14135
  if (min > 59) {
14412
14136
  return ~position;
14413
14137
  }
14414
-
14415
14138
  if (position === end || text.charAt(position) !== ':') {
14416
14139
  var _offset2 = negative * (3600 * hour + 60 * min);
14417
-
14418
14140
  return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset2, position, position);
14419
14141
  }
14420
-
14421
14142
  position++;
14422
-
14423
14143
  if (position > end - 2) {
14424
14144
  return ~position;
14425
14145
  }
14426
-
14427
14146
  ch = text.charAt(position);
14428
-
14429
14147
  if (ch < '0' || ch > '9') {
14430
14148
  return ~position;
14431
14149
  }
14432
-
14433
14150
  position++;
14434
14151
  var sec = MathUtil$1.parseInt(ch);
14435
14152
  ch = text.charAt(position);
14436
-
14437
14153
  if (ch < '0' || ch > '9') {
14438
14154
  return ~position;
14439
14155
  }
14440
-
14441
14156
  position++;
14442
14157
  sec = sec * 10 + MathUtil$1.parseInt(ch);
14443
-
14444
14158
  if (sec > 59) {
14445
14159
  return ~position;
14446
14160
  }
14447
-
14448
14161
  var offset = negative * (3600 * hour + 60 * min + sec);
14449
14162
  return context.setParsedField(ChronoField.OFFSET_SECONDS, offset, position, position);
14450
14163
  };
14451
-
14452
14164
  _proto.toString = function toString() {
14453
14165
  return "LocalizedOffset(" + this._textStyle + ")";
14454
14166
  };
14455
-
14456
14167
  return LocalizedOffsetPrinterParser;
14457
14168
  }();
14458
14169
 
@@ -14461,9 +14172,9 @@ var LocalizedOffsetPrinterParser = function () {
14461
14172
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
14462
14173
  */
14463
14174
  var MathUtil = _.MathUtil,
14464
- _jodaInternal$assert$1 = _.assert,
14465
- requireNonNull$2 = _jodaInternal$assert$1.requireNonNull,
14466
- requireInstance$1 = _jodaInternal$assert$1.requireInstance;
14175
+ _jodaInternal$assert$1 = _.assert,
14176
+ requireNonNull$2 = _jodaInternal$assert$1.requireNonNull,
14177
+ requireInstance$1 = _jodaInternal$assert$1.requireInstance;
14467
14178
  var DAY_OF_WEEK_RANGE = ValueRange.of(1, 7);
14468
14179
  var WEEK_OF_MONTH_RANGE = ValueRange.of(0, 1, 4, 6);
14469
14180
  var WEEK_OF_YEAR_RANGE = ValueRange.of(0, 1, 52, 54);
@@ -14482,23 +14193,18 @@ var ComputedDayOfField = function () {
14482
14193
  ComputedDayOfField.ofDayOfWeekField = function ofDayOfWeekField(weekDef) {
14483
14194
  return new ComputedDayOfField('DayOfWeek', weekDef, ChronoUnit.DAYS, ChronoUnit.WEEKS, DAY_OF_WEEK_RANGE);
14484
14195
  };
14485
-
14486
14196
  ComputedDayOfField.ofWeekOfMonthField = function ofWeekOfMonthField(weekDef) {
14487
14197
  return new ComputedDayOfField('WeekOfMonth', weekDef, ChronoUnit.WEEKS, ChronoUnit.MONTHS, WEEK_OF_MONTH_RANGE);
14488
14198
  };
14489
-
14490
14199
  ComputedDayOfField.ofWeekOfYearField = function ofWeekOfYearField(weekDef) {
14491
14200
  return new ComputedDayOfField('WeekOfYear', weekDef, ChronoUnit.WEEKS, ChronoUnit.YEARS, WEEK_OF_YEAR_RANGE);
14492
14201
  };
14493
-
14494
14202
  ComputedDayOfField.ofWeekOfWeekBasedYearField = function ofWeekOfWeekBasedYearField(weekDef) {
14495
14203
  return new ComputedDayOfField('WeekOfWeekBasedYear', weekDef, ChronoUnit.WEEKS, IsoFields.WEEK_BASED_YEARS, WEEK_OF_WEEK_BASED_YEAR_RANGE);
14496
14204
  };
14497
-
14498
14205
  ComputedDayOfField.ofWeekBasedYearField = function ofWeekBasedYearField(weekDef) {
14499
14206
  return new ComputedDayOfField('WeekBasedYear', weekDef, IsoFields.WEEK_BASED_YEARS, ChronoUnit.FOREVER, WEEK_BASED_YEAR_RANGE);
14500
14207
  };
14501
-
14502
14208
  function ComputedDayOfField(name, weekDef, baseUnit, rangeUnit, range) {
14503
14209
  this._name = name;
14504
14210
  this._weekDef = weekDef;
@@ -14506,14 +14212,10 @@ var ComputedDayOfField = function () {
14506
14212
  this._rangeUnit = rangeUnit;
14507
14213
  this._range = range;
14508
14214
  }
14509
-
14510
14215
  var _proto = ComputedDayOfField.prototype;
14511
-
14512
14216
  _proto.getFrom = function getFrom(temporal) {
14513
14217
  var sow = this._weekDef.firstDayOfWeek().value();
14514
-
14515
14218
  var dow = this._localizedDayOfWeek(temporal, sow);
14516
-
14517
14219
  if (this._rangeUnit === ChronoUnit.WEEKS) {
14518
14220
  return dow;
14519
14221
  } else if (this._rangeUnit === ChronoUnit.MONTHS) {
@@ -14528,112 +14230,79 @@ var ComputedDayOfField = function () {
14528
14230
  throw new IllegalStateException('unreachable');
14529
14231
  }
14530
14232
  };
14531
-
14532
14233
  _proto._localizedDayOfWeek = function _localizedDayOfWeek(temporal, sow) {
14533
14234
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
14534
14235
  return MathUtil.floorMod(isoDow - sow, 7) + 1;
14535
14236
  };
14536
-
14537
14237
  _proto._localizedWeekOfMonth = function _localizedWeekOfMonth(temporal, dow) {
14538
14238
  var dom = temporal.get(ChronoField.DAY_OF_MONTH);
14539
-
14540
14239
  var offset = this._startOfWeekOffset(dom, dow);
14541
-
14542
14240
  return ComputedDayOfField._computeWeek(offset, dom);
14543
14241
  };
14544
-
14545
14242
  _proto._localizedWeekOfYear = function _localizedWeekOfYear(temporal, dow) {
14546
14243
  var doy = temporal.get(ChronoField.DAY_OF_YEAR);
14547
-
14548
14244
  var offset = this._startOfWeekOffset(doy, dow);
14549
-
14550
14245
  return ComputedDayOfField._computeWeek(offset, doy);
14551
14246
  };
14552
-
14553
14247
  _proto._localizedWOWBY = function _localizedWOWBY(temporal) {
14554
14248
  var sow = this._weekDef.firstDayOfWeek().value();
14555
-
14556
14249
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
14557
14250
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
14558
-
14559
14251
  var woy = this._localizedWeekOfYear(temporal, dow);
14560
-
14561
14252
  if (woy === 0) {
14562
14253
  var previous = LocalDate.from(temporal).minus(1, ChronoUnit.WEEKS);
14563
14254
  return this._localizedWeekOfYear(previous, dow) + 1;
14564
14255
  } else if (woy >= 53) {
14565
14256
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
14566
-
14567
14257
  var year = temporal.get(ChronoField.YEAR);
14568
14258
  var yearLen = Year.isLeap(year) ? 366 : 365;
14569
-
14570
14259
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
14571
-
14572
14260
  if (woy >= weekIndexOfFirstWeekNextYear) {
14573
14261
  return woy - (weekIndexOfFirstWeekNextYear - 1);
14574
14262
  }
14575
14263
  }
14576
-
14577
14264
  return woy;
14578
14265
  };
14579
-
14580
14266
  _proto._localizedWBY = function _localizedWBY(temporal) {
14581
14267
  var sow = this._weekDef.firstDayOfWeek().value();
14582
-
14583
14268
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
14584
14269
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
14585
14270
  var year = temporal.get(ChronoField.YEAR);
14586
-
14587
14271
  var woy = this._localizedWeekOfYear(temporal, dow);
14588
-
14589
14272
  if (woy === 0) {
14590
14273
  return year - 1;
14591
14274
  } else if (woy < 53) {
14592
14275
  return year;
14593
14276
  }
14594
-
14595
14277
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
14596
-
14597
14278
  var yearLen = Year.isLeap(year) ? 366 : 365;
14598
-
14599
14279
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
14600
-
14601
14280
  if (woy >= weekIndexOfFirstWeekNextYear) {
14602
14281
  return year + 1;
14603
14282
  }
14604
-
14605
14283
  return year;
14606
14284
  };
14607
-
14608
14285
  _proto._startOfWeekOffset = function _startOfWeekOffset(day, dow) {
14609
14286
  var weekStart = MathUtil.floorMod(day - dow, 7);
14610
14287
  var offset = -weekStart;
14611
-
14612
14288
  if (weekStart + 1 > this._weekDef.minimalDaysInFirstWeek()) {
14613
14289
  offset = 7 - weekStart;
14614
14290
  }
14615
-
14616
14291
  return offset;
14617
14292
  };
14618
-
14619
14293
  ComputedDayOfField._computeWeek = function _computeWeek(offset, day) {
14620
14294
  return MathUtil.intDiv(7 + offset + (day - 1), 7);
14621
14295
  };
14622
-
14623
14296
  _proto.adjustInto = function adjustInto(temporal, newValue) {
14624
14297
  var newVal = this._range.checkValidIntValue(newValue, this);
14625
-
14626
14298
  var currentVal = temporal.get(this);
14627
-
14628
14299
  if (newVal === currentVal) {
14629
14300
  return temporal;
14630
14301
  }
14631
-
14632
14302
  if (this._rangeUnit === ChronoUnit.FOREVER) {
14633
14303
  var baseWowby = temporal.get(this._weekDef.weekOfWeekBasedYear());
14634
14304
  var diffWeeks = MathUtil.roundDown((newValue - currentVal) * 52.1775);
14635
14305
  var result = temporal.plus(diffWeeks, ChronoUnit.WEEKS);
14636
-
14637
14306
  if (result.get(this) > newVal) {
14638
14307
  var newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
14639
14308
  result = result.minus(newWowby, ChronoUnit.WEEKS);
@@ -14641,140 +14310,96 @@ var ComputedDayOfField = function () {
14641
14310
  if (result.get(this) < newVal) {
14642
14311
  result = result.plus(2, ChronoUnit.WEEKS);
14643
14312
  }
14644
-
14645
14313
  var _newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
14646
-
14647
14314
  result = result.plus(baseWowby - _newWowby, ChronoUnit.WEEKS);
14648
-
14649
14315
  if (result.get(this) > newVal) {
14650
14316
  result = result.minus(1, ChronoUnit.WEEKS);
14651
14317
  }
14652
14318
  }
14653
-
14654
14319
  return result;
14655
14320
  }
14656
-
14657
14321
  var delta = newVal - currentVal;
14658
14322
  return temporal.plus(delta, this._baseUnit);
14659
14323
  };
14660
-
14661
14324
  _proto.resolve = function resolve(fieldValues, partialTemporal, resolverStyle) {
14662
14325
  var sow = this._weekDef.firstDayOfWeek().value();
14663
-
14664
14326
  if (this._rangeUnit === ChronoUnit.WEEKS) {
14665
14327
  var value = fieldValues.remove(this);
14666
-
14667
14328
  var localDow = this._range.checkValidIntValue(value, this);
14668
-
14669
14329
  var _isoDow = MathUtil.floorMod(sow - 1 + (localDow - 1), 7) + 1;
14670
-
14671
14330
  fieldValues.put(ChronoField.DAY_OF_WEEK, _isoDow);
14672
14331
  return null;
14673
14332
  }
14674
-
14675
14333
  if (fieldValues.containsKey(ChronoField.DAY_OF_WEEK) === false) {
14676
14334
  return null;
14677
14335
  }
14678
-
14679
14336
  if (this._rangeUnit === ChronoUnit.FOREVER) {
14680
14337
  if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
14681
14338
  return null;
14682
14339
  }
14683
-
14684
14340
  var _isoDow2 = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
14685
-
14686
14341
  var _dow = MathUtil.floorMod(_isoDow2 - sow, 7) + 1;
14687
-
14688
14342
  var wby = this.range().checkValidIntValue(fieldValues.get(this), this);
14689
14343
  var date;
14690
14344
  var days;
14691
-
14692
14345
  if (resolverStyle === ResolverStyle.LENIENT) {
14693
14346
  date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
14694
14347
  var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
14695
-
14696
14348
  var dateDow = this._localizedDayOfWeek(date, sow);
14697
-
14698
14349
  var weeks = wowby - this._localizedWeekOfYear(date, dateDow);
14699
-
14700
14350
  days = weeks * 7 + (_dow - dateDow);
14701
14351
  } else {
14702
14352
  date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
14703
-
14704
14353
  var _wowby = this._weekDef.weekOfWeekBasedYear().range().checkValidIntValue(fieldValues.get(this._weekDef.weekOfWeekBasedYear()), this._weekDef.weekOfWeekBasedYear);
14705
-
14706
14354
  var _dateDow = this._localizedDayOfWeek(date, sow);
14707
-
14708
14355
  var _weeks = _wowby - this._localizedWeekOfYear(date, _dateDow);
14709
-
14710
14356
  days = _weeks * 7 + (_dow - _dateDow);
14711
14357
  }
14712
-
14713
14358
  date = date.plus(days, ChronoUnit.DAYS);
14714
-
14715
14359
  if (resolverStyle === ResolverStyle.STRICT) {
14716
14360
  if (date.getLong(this) !== fieldValues.get(this)) {
14717
14361
  throw new DateTimeException('Strict mode rejected date parsed to a different year');
14718
14362
  }
14719
14363
  }
14720
-
14721
14364
  fieldValues.remove(this);
14722
14365
  fieldValues.remove(this._weekDef.weekOfWeekBasedYear());
14723
14366
  fieldValues.remove(ChronoField.DAY_OF_WEEK);
14724
14367
  return date;
14725
14368
  }
14726
-
14727
14369
  if (fieldValues.containsKey(ChronoField.YEAR) === false) {
14728
14370
  return null;
14729
14371
  }
14730
-
14731
14372
  var isoDow = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
14732
14373
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
14733
14374
  var year = ChronoField.YEAR.checkValidIntValue(fieldValues.get(ChronoField.YEAR));
14734
-
14735
14375
  if (this._rangeUnit === ChronoUnit.MONTHS) {
14736
14376
  if (fieldValues.containsKey(ChronoField.MONTH_OF_YEAR) === false) {
14737
14377
  return null;
14738
14378
  }
14739
-
14740
14379
  var _value = fieldValues.remove(this);
14741
-
14742
14380
  var _date;
14743
-
14744
14381
  var _days;
14745
-
14746
14382
  if (resolverStyle === ResolverStyle.LENIENT) {
14747
14383
  var month = fieldValues.get(ChronoField.MONTH_OF_YEAR);
14748
14384
  _date = LocalDate.of(year, 1, 1);
14749
14385
  _date = _date.plus(month - 1, ChronoUnit.MONTHS);
14750
-
14751
14386
  var _dateDow2 = this._localizedDayOfWeek(_date, sow);
14752
-
14753
14387
  var _weeks2 = _value - this._localizedWeekOfMonth(_date, _dateDow2);
14754
-
14755
14388
  _days = _weeks2 * 7 + (dow - _dateDow2);
14756
14389
  } else {
14757
14390
  var _month = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.get(ChronoField.MONTH_OF_YEAR));
14758
-
14759
14391
  _date = LocalDate.of(year, _month, 8);
14760
-
14761
14392
  var _dateDow3 = this._localizedDayOfWeek(_date, sow);
14762
-
14763
14393
  var wom = this._range.checkValidIntValue(_value, this);
14764
-
14765
14394
  var _weeks3 = wom - this._localizedWeekOfMonth(_date, _dateDow3);
14766
-
14767
14395
  _days = _weeks3 * 7 + (dow - _dateDow3);
14768
14396
  }
14769
-
14770
14397
  _date = _date.plus(_days, ChronoUnit.DAYS);
14771
-
14772
14398
  if (resolverStyle === ResolverStyle.STRICT) {
14773
14399
  if (_date.getLong(ChronoField.MONTH_OF_YEAR) !== fieldValues.get(ChronoField.MONTH_OF_YEAR)) {
14774
14400
  throw new DateTimeException('Strict mode rejected date parsed to a different month');
14775
14401
  }
14776
14402
  }
14777
-
14778
14403
  fieldValues.remove(this);
14779
14404
  fieldValues.remove(ChronoField.YEAR);
14780
14405
  fieldValues.remove(ChronoField.MONTH_OF_YEAR);
@@ -14782,35 +14407,24 @@ var ComputedDayOfField = function () {
14782
14407
  return _date;
14783
14408
  } else if (this._rangeUnit === ChronoUnit.YEARS) {
14784
14409
  var _value2 = fieldValues.remove(this);
14785
-
14786
14410
  var _date2 = LocalDate.of(year, 1, 1);
14787
-
14788
14411
  var _days2;
14789
-
14790
14412
  if (resolverStyle === ResolverStyle.LENIENT) {
14791
14413
  var _dateDow4 = this._localizedDayOfWeek(_date2, sow);
14792
-
14793
14414
  var _weeks4 = _value2 - this._localizedWeekOfYear(_date2, _dateDow4);
14794
-
14795
14415
  _days2 = _weeks4 * 7 + (dow - _dateDow4);
14796
14416
  } else {
14797
14417
  var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
14798
-
14799
14418
  var woy = this._range.checkValidIntValue(_value2, this);
14800
-
14801
14419
  var _weeks5 = woy - this._localizedWeekOfYear(_date2, _dateDow5);
14802
-
14803
14420
  _days2 = _weeks5 * 7 + (dow - _dateDow5);
14804
14421
  }
14805
-
14806
14422
  _date2 = _date2.plus(_days2, ChronoUnit.DAYS);
14807
-
14808
14423
  if (resolverStyle === ResolverStyle.STRICT) {
14809
14424
  if (_date2.getLong(ChronoField.YEAR) !== fieldValues.get(ChronoField.YEAR)) {
14810
14425
  throw new DateTimeException('Strict mode rejected date parsed to a different year');
14811
14426
  }
14812
14427
  }
14813
-
14814
14428
  fieldValues.remove(this);
14815
14429
  fieldValues.remove(ChronoField.YEAR);
14816
14430
  fieldValues.remove(ChronoField.DAY_OF_WEEK);
@@ -14819,31 +14433,24 @@ var ComputedDayOfField = function () {
14819
14433
  throw new IllegalStateException('unreachable');
14820
14434
  }
14821
14435
  };
14822
-
14823
14436
  _proto.name = function name() {
14824
14437
  return this._name;
14825
14438
  };
14826
-
14827
14439
  _proto.baseUnit = function baseUnit() {
14828
14440
  return this._baseUnit;
14829
14441
  };
14830
-
14831
14442
  _proto.rangeUnit = function rangeUnit() {
14832
14443
  return this._rangeUnit;
14833
14444
  };
14834
-
14835
14445
  _proto.range = function range() {
14836
14446
  return this._range;
14837
14447
  };
14838
-
14839
14448
  _proto.isDateBased = function isDateBased() {
14840
14449
  return true;
14841
14450
  };
14842
-
14843
14451
  _proto.isTimeBased = function isTimeBased() {
14844
14452
  return false;
14845
14453
  };
14846
-
14847
14454
  _proto.isSupportedBy = function isSupportedBy(temporal) {
14848
14455
  if (temporal.isSupported(ChronoField.DAY_OF_WEEK)) {
14849
14456
  if (this._rangeUnit === ChronoUnit.WEEKS) {
@@ -14858,17 +14465,13 @@ var ComputedDayOfField = function () {
14858
14465
  return temporal.isSupported(ChronoField.EPOCH_DAY);
14859
14466
  }
14860
14467
  }
14861
-
14862
14468
  return false;
14863
14469
  };
14864
-
14865
14470
  _proto.rangeRefinedBy = function rangeRefinedBy(temporal) {
14866
14471
  if (this._rangeUnit === ChronoUnit.WEEKS) {
14867
14472
  return this._range;
14868
14473
  }
14869
-
14870
14474
  var field = null;
14871
-
14872
14475
  if (this._rangeUnit === ChronoUnit.MONTHS) {
14873
14476
  field = ChronoField.DAY_OF_MONTH;
14874
14477
  } else if (this._rangeUnit === ChronoUnit.YEARS) {
@@ -14880,58 +14483,40 @@ var ComputedDayOfField = function () {
14880
14483
  } else {
14881
14484
  throw new IllegalStateException('unreachable');
14882
14485
  }
14883
-
14884
14486
  var sow = this._weekDef.firstDayOfWeek().value();
14885
-
14886
14487
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
14887
14488
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
14888
-
14889
14489
  var offset = this._startOfWeekOffset(temporal.get(field), dow);
14890
-
14891
14490
  var fieldRange = temporal.range(field);
14892
14491
  return ValueRange.of(ComputedDayOfField._computeWeek(offset, fieldRange.minimum()), ComputedDayOfField._computeWeek(offset, fieldRange.maximum()));
14893
14492
  };
14894
-
14895
14493
  _proto._rangeWOWBY = function _rangeWOWBY(temporal) {
14896
14494
  var sow = this._weekDef.firstDayOfWeek().value();
14897
-
14898
14495
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
14899
14496
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
14900
-
14901
14497
  var woy = this._localizedWeekOfYear(temporal, dow);
14902
-
14903
14498
  if (woy === 0) {
14904
14499
  return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).minus(2, ChronoUnit.WEEKS));
14905
14500
  }
14906
-
14907
14501
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
14908
-
14909
14502
  var year = temporal.get(ChronoField.YEAR);
14910
14503
  var yearLen = Year.isLeap(year) ? 366 : 365;
14911
-
14912
14504
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
14913
-
14914
14505
  if (woy >= weekIndexOfFirstWeekNextYear) {
14915
14506
  return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).plus(2, ChronoUnit.WEEKS));
14916
14507
  }
14917
-
14918
14508
  return ValueRange.of(1, weekIndexOfFirstWeekNextYear - 1);
14919
14509
  };
14920
-
14921
14510
  _proto.displayName = function displayName(locale) {
14922
14511
  requireNonNull$2(locale, 'locale');
14923
-
14924
14512
  if (this._rangeUnit === ChronoUnit.YEARS) {
14925
14513
  return 'Week';
14926
14514
  }
14927
-
14928
14515
  return this.toString();
14929
14516
  };
14930
-
14931
14517
  _proto.toString = function toString() {
14932
14518
  return this._name + "[" + this._weekDef.toString() + "]";
14933
14519
  };
14934
-
14935
14520
  return ComputedDayOfField;
14936
14521
  }();
14937
14522
  var WeekFieldsCache = new Map();
@@ -14943,54 +14528,42 @@ var WeekFields = function () {
14943
14528
  return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
14944
14529
  }
14945
14530
  };
14946
-
14947
14531
  WeekFields.ofLocale = function ofLocale(locale) {
14948
14532
  requireNonNull$2(locale, 'locale');
14949
- node_main.load(cldrData('supplemental/weekData.json'));
14950
- var cldr = new node_main(locale.localeString());
14533
+ Cldr.load(cldrData('supplemental/weekData.json'));
14534
+ var cldr = new Cldr(locale.localeString());
14951
14535
  var worldRegion = '001';
14952
14536
  var weekData = cldr.get('supplemental/weekData');
14953
-
14954
14537
  var dow = _weekDayMap[weekData.firstDay[locale.country()]];
14955
-
14956
14538
  if (!dow) {
14957
14539
  dow = _weekDayMap[weekData.firstDay[worldRegion]];
14958
14540
  }
14959
-
14960
14541
  var minDays = weekData.minDays[locale.country()];
14961
-
14962
14542
  if (!minDays) {
14963
14543
  minDays = weekData.minDays[worldRegion];
14964
14544
  }
14965
-
14966
14545
  return WeekFields.ofFirstDayOfWeekMinDays(dow, minDays);
14967
14546
  };
14968
-
14969
14547
  WeekFields.ofFirstDayOfWeekMinDays = function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
14970
14548
  requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
14971
14549
  requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
14972
14550
  requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
14973
14551
  var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
14974
14552
  var rules = WeekFieldsCache.get(key);
14975
-
14976
14553
  if (rules == null) {
14977
14554
  rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
14978
14555
  WeekFieldsCache.set(key, rules);
14979
14556
  rules = WeekFieldsCache.get(key);
14980
14557
  }
14981
-
14982
14558
  return rules;
14983
14559
  };
14984
-
14985
14560
  function WeekFields(firstDayOfWeek, minimalDaysInFirstWeek) {
14986
14561
  requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
14987
14562
  requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
14988
14563
  requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
14989
-
14990
14564
  if (minimalDaysInFirstWeek < 1 || minimalDaysInFirstWeek > 7) {
14991
14565
  throw new IllegalArgumentException('Minimal number of days is invalid');
14992
14566
  }
14993
-
14994
14567
  this._firstDayOfWeek = firstDayOfWeek;
14995
14568
  this._minimalDays = minimalDaysInFirstWeek;
14996
14569
  this._dayOfWeek = ComputedDayOfField.ofDayOfWeekField(this);
@@ -14998,59 +14571,45 @@ var WeekFields = function () {
14998
14571
  this._weekOfYear = ComputedDayOfField.ofWeekOfYearField(this);
14999
14572
  this._weekOfWeekBasedYear = ComputedDayOfField.ofWeekOfWeekBasedYearField(this);
15000
14573
  this._weekBasedYear = ComputedDayOfField.ofWeekBasedYearField(this);
15001
- node_main.load(cldrData('supplemental/likelySubtags.json'));
14574
+ Cldr.load(cldrData('supplemental/likelySubtags.json'));
15002
14575
  }
15003
-
15004
14576
  var _proto2 = WeekFields.prototype;
15005
-
15006
14577
  _proto2.firstDayOfWeek = function firstDayOfWeek() {
15007
14578
  return this._firstDayOfWeek;
15008
14579
  };
15009
-
15010
14580
  _proto2.minimalDaysInFirstWeek = function minimalDaysInFirstWeek() {
15011
14581
  return this._minimalDays;
15012
14582
  };
15013
-
15014
14583
  _proto2.dayOfWeek = function dayOfWeek() {
15015
14584
  return this._dayOfWeek;
15016
14585
  };
15017
-
15018
14586
  _proto2.weekOfMonth = function weekOfMonth() {
15019
14587
  return this._weekOfMonth;
15020
14588
  };
15021
-
15022
14589
  _proto2.weekOfYear = function weekOfYear() {
15023
14590
  return this._weekOfYear;
15024
14591
  };
15025
-
15026
14592
  _proto2.weekOfWeekBasedYear = function weekOfWeekBasedYear() {
15027
14593
  return this._weekOfWeekBasedYear;
15028
14594
  };
15029
-
15030
14595
  _proto2.weekBasedYear = function weekBasedYear() {
15031
14596
  return this._weekBasedYear;
15032
14597
  };
15033
-
15034
14598
  _proto2.equals = function equals(other) {
15035
14599
  if (this === other) {
15036
14600
  return true;
15037
14601
  }
15038
-
15039
14602
  if (other instanceof WeekFields) {
15040
14603
  return this.hashCode() === other.hashCode();
15041
14604
  }
15042
-
15043
14605
  return false;
15044
14606
  };
15045
-
15046
14607
  _proto2.hashCode = function hashCode() {
15047
14608
  return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
15048
14609
  };
15049
-
15050
14610
  _proto2.toString = function toString() {
15051
14611
  return "WeekFields[" + this._firstDayOfWeek + "," + this._minimalDays + "]";
15052
14612
  };
15053
-
15054
14613
  return WeekFields;
15055
14614
  }();
15056
14615
  function _init$2() {
@@ -15063,68 +14622,50 @@ function _init$2() {
15063
14622
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
15064
14623
  */
15065
14624
  var StringBuilder = _.StringBuilder;
15066
-
15067
14625
  var WeekFieldsPrinterParser = function () {
15068
14626
  function WeekFieldsPrinterParser(letter, count) {
15069
14627
  this._letter = letter;
15070
14628
  this._count = count;
15071
14629
  }
15072
-
15073
14630
  var _proto = WeekFieldsPrinterParser.prototype;
15074
-
15075
14631
  _proto.print = function print(context, buf) {
15076
14632
  var weekFields = WeekFields.of(context.locale());
15077
-
15078
14633
  var pp = this._evaluate(weekFields);
15079
-
15080
14634
  return pp.print(context, buf);
15081
14635
  };
15082
-
15083
14636
  _proto.parse = function parse(context, text, position) {
15084
14637
  var weekFields = WeekFields.of(context.locale());
15085
-
15086
14638
  var pp = this._evaluate(weekFields);
15087
-
15088
14639
  return pp.parse(context, text, position);
15089
14640
  };
15090
-
15091
14641
  _proto._evaluate = function _evaluate(weekFields) {
15092
14642
  var pp = null;
15093
-
15094
14643
  switch (this._letter) {
15095
14644
  case 'e':
15096
14645
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
15097
14646
  break;
15098
-
15099
14647
  case 'c':
15100
14648
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
15101
14649
  break;
15102
-
15103
14650
  case 'w':
15104
14651
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfWeekBasedYear(), this._count, 2, SignStyle.NOT_NEGATIVE);
15105
14652
  break;
15106
-
15107
14653
  case 'W':
15108
14654
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfMonth(), 1, 2, SignStyle.NOT_NEGATIVE);
15109
14655
  break;
15110
-
15111
14656
  case 'Y':
15112
14657
  if (this._count === 2) {
15113
14658
  pp = new DateTimeFormatterBuilder.ReducedPrinterParser(weekFields.weekBasedYear(), 2, 2, 0, DateTimeFormatterBuilder.ReducedPrinterParser.BASE_DATE);
15114
14659
  } else {
15115
14660
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekBasedYear(), this._count, 19, this._count < 4 ? SignStyle.NORMAL : SignStyle.EXCEEDS_PAD, -1);
15116
14661
  }
15117
-
15118
14662
  break;
15119
14663
  }
15120
-
15121
14664
  return pp;
15122
14665
  };
15123
-
15124
14666
  _proto.toString = function toString() {
15125
14667
  var sb = new StringBuilder(30);
15126
14668
  sb.append('Localized(');
15127
-
15128
14669
  if (this._letter === 'Y') {
15129
14670
  if (this._count === 1) {
15130
14671
  sb.append('WeekBasedYear');
@@ -15141,31 +14682,24 @@ var WeekFieldsPrinterParser = function () {
15141
14682
  } else if (this._letter === 'W') {
15142
14683
  sb.append('WeekOfMonth');
15143
14684
  }
15144
-
15145
14685
  sb.append(',');
15146
14686
  sb.append(this._count);
15147
14687
  }
15148
-
15149
14688
  sb.append(')');
15150
14689
  return sb.toString();
15151
14690
  };
15152
-
15153
14691
  return WeekFieldsPrinterParser;
15154
14692
  }();
15155
14693
 
15156
14694
  var _jodaInternal$assert = _.assert,
15157
- requireNonNull$1 = _jodaInternal$assert.requireNonNull,
15158
- requireInstance = _jodaInternal$assert.requireInstance;
15159
-
14695
+ requireNonNull$1 = _jodaInternal$assert.requireNonNull,
14696
+ requireInstance = _jodaInternal$assert.requireInstance;
15160
14697
  var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
15161
14698
  _inheritsLoose(CldrDateTimeFormatterBuilder, _DateTimeFormatterBui);
15162
-
15163
14699
  function CldrDateTimeFormatterBuilder() {
15164
14700
  return _DateTimeFormatterBui.apply(this, arguments) || this;
15165
14701
  }
15166
-
15167
14702
  var _proto = CldrDateTimeFormatterBuilder.prototype;
15168
-
15169
14703
  _proto.appendText = function appendText(field, styleOrMap) {
15170
14704
  if (styleOrMap === undefined) {
15171
14705
  return this.appendTextField(field);
@@ -15175,29 +14709,22 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
15175
14709
  return this.appendTextFieldMap(field, styleOrMap);
15176
14710
  }
15177
14711
  };
15178
-
15179
14712
  _proto.appendTextField = function appendTextField(field) {
15180
14713
  return this.appendTextFieldStyle(field, TextStyle.FULL);
15181
14714
  };
15182
-
15183
14715
  _proto.appendTextFieldStyle = function appendTextFieldStyle(field, textStyle) {
15184
14716
  requireNonNull$1(field, 'field');
15185
14717
  requireInstance(field, TemporalField, 'field');
15186
14718
  requireNonNull$1(textStyle, 'textStyle');
15187
14719
  requireInstance(textStyle, TextStyle, 'textStyle');
15188
-
15189
14720
  this._appendInternal(new TextPrinterParser(field, textStyle, new CldrDateTimeTextProvider()));
15190
-
15191
14721
  return this;
15192
14722
  };
15193
-
15194
14723
  _proto.appendTextFieldMap = function appendTextFieldMap(field, textLookup) {
15195
14724
  requireNonNull$1(field, 'field');
15196
14725
  requireInstance(field, ChronoField, 'field');
15197
14726
  requireNonNull$1(textLookup, 'textLookup');
15198
-
15199
14727
  var copy = _extends({}, textLookup);
15200
-
15201
14728
  var map = {};
15202
14729
  map[TextStyle.FULL] = copy;
15203
14730
  var store = new LocaleStore(map);
@@ -15209,39 +14736,27 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
15209
14736
  return store.getTextIterator(style);
15210
14737
  }
15211
14738
  };
15212
-
15213
14739
  this._appendInternal(new TextPrinterParser(field, TextStyle.FULL, provider));
15214
-
15215
14740
  return this;
15216
14741
  };
15217
-
15218
14742
  _proto.appendWeekField = function appendWeekField(field, count) {
15219
14743
  requireNonNull$1(field, 'field');
15220
14744
  requireNonNull$1(count, 'count');
15221
-
15222
14745
  this._appendInternal(new WeekFieldsPrinterParser(field, count));
15223
-
15224
14746
  return this;
15225
14747
  };
15226
-
15227
14748
  _proto.appendZoneText = function appendZoneText(textStyle) {
15228
14749
  this._appendInternal(new CldrZoneTextPrinterParser(textStyle));
15229
-
15230
14750
  return this;
15231
14751
  };
15232
-
15233
14752
  _proto.appendLocalizedOffset = function appendLocalizedOffset(textStyle) {
15234
14753
  requireNonNull$1(textStyle, 'textStyle');
15235
-
15236
14754
  if (textStyle !== TextStyle.FULL && textStyle !== TextStyle.SHORT) {
15237
14755
  throw new IllegalArgumentException('Style must be either full or short');
15238
14756
  }
15239
-
15240
14757
  this._appendInternal(new LocalizedOffsetPrinterParser(textStyle));
15241
-
15242
14758
  return this;
15243
14759
  };
15244
-
15245
14760
  return CldrDateTimeFormatterBuilder;
15246
14761
  }(DateTimeFormatterBuilder);
15247
14762
 
@@ -15249,64 +14764,50 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
15249
14764
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
15250
14765
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
15251
14766
  */
15252
-
15253
14767
  var Locale = function () {
15254
14768
  Locale.getAvailableLocales = function getAvailableLocales() {
15255
14769
  return new CldrDateTimeTextProvider().getAvailableLocales();
15256
14770
  };
15257
-
15258
14771
  function Locale(language, country, localeString) {
15259
14772
  if (country === void 0) {
15260
14773
  country = '';
15261
14774
  }
15262
-
15263
14775
  if (localeString === void 0) {
15264
14776
  localeString = '';
15265
14777
  }
15266
-
15267
14778
  this._language = language;
15268
14779
  this._country = country;
15269
14780
  this._localeString = localeString;
15270
14781
  }
15271
-
15272
14782
  var _proto = Locale.prototype;
15273
-
15274
14783
  _proto.language = function language() {
15275
14784
  return this._language;
15276
14785
  };
15277
-
15278
14786
  _proto.country = function country() {
15279
14787
  return this._country;
15280
14788
  };
15281
-
15282
14789
  _proto.localeString = function localeString() {
15283
14790
  if (this._localeString.length > 0) {
15284
14791
  return this._localeString;
15285
14792
  }
15286
-
15287
14793
  if (this._country.length > 0) {
15288
14794
  return this._language + "-" + this._country;
15289
14795
  } else {
15290
14796
  return this._language;
15291
14797
  }
15292
14798
  };
15293
-
15294
14799
  _proto.toString = function toString() {
15295
14800
  return "Locale[" + this.localeString() + "]";
15296
14801
  };
15297
-
15298
14802
  _proto.equals = function equals(other) {
15299
14803
  if (!other) {
15300
14804
  return false;
15301
14805
  }
15302
-
15303
14806
  if (!(other instanceof Locale)) {
15304
14807
  return false;
15305
14808
  }
15306
-
15307
14809
  return this.localeString() === other.localeString();
15308
14810
  };
15309
-
15310
14811
  return Locale;
15311
14812
  }();
15312
14813
  function _init$1() {
@@ -15332,26 +14833,19 @@ function _init$1() {
15332
14833
  }
15333
14834
 
15334
14835
  var requireNonNull = _.assert.requireNonNull;
15335
-
15336
14836
  var LocaleDateTimeFormatter = function (_DateTimeFormatter) {
15337
14837
  _inheritsLoose(LocaleDateTimeFormatter, _DateTimeFormatter);
15338
-
15339
14838
  function LocaleDateTimeFormatter() {
15340
14839
  return _DateTimeFormatter.apply(this, arguments) || this;
15341
14840
  }
15342
-
15343
14841
  var _proto = LocaleDateTimeFormatter.prototype;
15344
-
15345
14842
  _proto.withLocale = function withLocale(locale) {
15346
14843
  requireNonNull(locale, 'locale');
15347
-
15348
14844
  if (locale.equals(this._locale)) {
15349
14845
  return this;
15350
14846
  }
15351
-
15352
14847
  return new DateTimeFormatter(this._printerParser, locale, this._decimalStyle, this._resolverStyle, this._resolverFields, this._chrono, this._zone);
15353
14848
  };
15354
-
15355
14849
  return LocaleDateTimeFormatter;
15356
14850
  }(DateTimeFormatter);
15357
14851
  function _init() {
@@ -15386,24 +14880,17 @@ function _init() {
15386
14880
  * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
15387
14881
  */
15388
14882
  var isInit = false;
15389
-
15390
14883
  function init() {
15391
14884
  if (isInit) {
15392
14885
  return;
15393
14886
  }
15394
-
15395
14887
  isInit = true;
15396
14888
  _init$1();
15397
14889
  _init$2();
15398
14890
  _init();
15399
14891
  }
15400
-
15401
14892
  init();
15402
14893
 
15403
- /*
15404
- * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
15405
- * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
15406
- */
15407
14894
  function plug (jsJoda) {
15408
14895
  Object.getOwnPropertyNames(CldrDateTimeFormatterBuilder.prototype).forEach(function (prop) {
15409
14896
  if (prop !== 'constructor') {