@js-joda/timezone 2.3.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- //! @version @js-joda/timezone-2.3.0
1
+ //! @version @js-joda/timezone-2.7.0
2
2
  //! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
3
3
  //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
4
4
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -111,7 +111,27 @@ __webpack_require__.r(__webpack_exports__);
111
111
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MomentZoneRules", function() { return MomentZoneRules; });
112
112
  /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
113
113
  /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
114
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
114
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
115
+
116
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
117
+
118
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
119
+
120
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
121
+
122
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
123
+
124
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
125
+
126
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
127
+
128
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
129
+
130
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
131
+
132
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
133
+
134
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
115
135
 
116
136
  /*
117
137
  * @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper
@@ -120,188 +140,215 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
120
140
  */
121
141
 
122
142
  var MomentZoneRules = function (_ZoneRules) {
123
- _inheritsLoose(MomentZoneRules, _ZoneRules);
143
+ _inherits(MomentZoneRules, _ZoneRules);
144
+
145
+ var _super = _createSuper(MomentZoneRules);
124
146
 
125
147
  function MomentZoneRules(tzdbInfo) {
126
148
  var _this;
127
149
 
128
- _this = _ZoneRules.call(this) || this;
150
+ _classCallCheck(this, MomentZoneRules);
151
+
152
+ _this = _super.call(this);
129
153
  _this._tzdbInfo = tzdbInfo;
130
154
  _this._ldtUntils = new LDTUntils(_this._tzdbInfo.untils, _this._tzdbInfo.offsets);
131
155
  return _this;
132
156
  }
133
157
 
134
- var _proto = MomentZoneRules.prototype;
135
-
136
- _proto.isFixedOffset = function isFixedOffset() {
137
- return this._tzdbInfo.offsets.length === 1;
138
- };
139
-
140
- _proto.offsetOfInstant = function offsetOfInstant(instant) {
141
- var epochMilli = instant.toEpochMilli();
142
- return this.offsetOfEpochMilli(epochMilli);
143
- };
144
-
145
- _proto.offsetOfEpochMilli = function offsetOfEpochMilli(epochMilli) {
146
- var index = binarySearch(this._tzdbInfo.untils, epochMilli);
147
- return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(index));
148
- };
149
-
150
- _proto.offsetOfLocalDateTime = function offsetOfLocalDateTime(localDateTime) {
151
- var info = this._offsetInfo(localDateTime);
152
-
153
- if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
154
- return info.offsetBefore();
158
+ _createClass(MomentZoneRules, [{
159
+ key: "isFixedOffset",
160
+ value: function isFixedOffset() {
161
+ return this._tzdbInfo.offsets.length === 1;
155
162
  }
156
-
157
- return info;
158
- };
159
-
160
- _proto._offsetInfo = function _offsetInfo(localDateTime) {
161
- var index = ldtBinarySearch(this._ldtUntils, localDateTime);
162
- var offsetIndex = index >> 1;
163
-
164
- if (index % 2 === 1) {
165
- var ldtBefore = this._ldtUntils.get(Math.max(index - 1, 0));
166
-
167
- var ldtAfter = this._ldtUntils.get(Math.min(index, this._ldtUntils.size - 1));
168
-
169
- var offsetBefore = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(offsetIndex));
170
- var offsetAfter = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(Math.min(offsetIndex + 1, this._tzdbInfo.offsets.length - 1)));
171
-
172
- if (offsetBefore.compareTo(offsetAfter) > 0) {
173
- return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"].of(ldtBefore, offsetBefore, offsetAfter);
174
- } else {
175
- return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"].of(ldtAfter, offsetBefore, offsetAfter);
176
- }
163
+ }, {
164
+ key: "offsetOfInstant",
165
+ value: function offsetOfInstant(instant) {
166
+ var epochMilli = instant.toEpochMilli();
167
+ return this.offsetOfEpochMilli(epochMilli);
177
168
  }
178
-
179
- return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(offsetIndex));
180
- };
181
-
182
- _proto._offsetByIndexInSeconds = function _offsetByIndexInSeconds(index) {
183
- return -offsetInSeconds(this._tzdbInfo.offsets[index]);
184
- };
185
-
186
- _proto.validOffsets = function validOffsets(localDateTime) {
187
- var info = this._offsetInfo(localDateTime);
188
-
189
- if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
190
- return info.validOffsets();
169
+ }, {
170
+ key: "offsetOfEpochMilli",
171
+ value: function offsetOfEpochMilli(epochMilli) {
172
+ var index = binarySearch(this._tzdbInfo.untils, epochMilli);
173
+ return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(index));
191
174
  }
175
+ }, {
176
+ key: "offsetOfLocalDateTime",
177
+ value: function offsetOfLocalDateTime(localDateTime) {
178
+ var info = this._offsetInfo(localDateTime);
192
179
 
193
- return [info];
194
- };
195
-
196
- _proto.transition = function transition(localDateTime) {
197
- var info = this._offsetInfo(localDateTime);
180
+ if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
181
+ return info.offsetBefore();
182
+ }
198
183
 
199
- if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
200
184
  return info;
201
185
  }
186
+ }, {
187
+ key: "_offsetInfo",
188
+ value: function _offsetInfo(localDateTime) {
189
+ var index = ldtBinarySearch(this._ldtUntils, localDateTime);
190
+ var offsetIndex = index >> 1;
202
191
 
203
- return null;
204
- };
192
+ if (index % 2 === 1) {
193
+ var ldtBefore = this._ldtUntils.get(Math.max(index - 1, 0));
205
194
 
206
- _proto.standardOffset = function standardOffset(instant) {
207
- notSupported('ZoneRules.standardOffset');
208
- };
195
+ var ldtAfter = this._ldtUntils.get(Math.min(index, this._ldtUntils.size - 1));
209
196
 
210
- _proto.daylightSavings = function daylightSavings(instant) {
211
- notSupported('ZoneRules.daylightSavings');
212
- };
197
+ var offsetBefore = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(offsetIndex));
198
+ var offsetAfter = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(Math.min(offsetIndex + 1, this._tzdbInfo.offsets.length - 1)));
213
199
 
214
- _proto.isDaylightSavings = function isDaylightSavings(instant) {
215
- notSupported('ZoneRules.isDaylightSavings');
216
- };
217
-
218
- _proto.isValidOffset = function isValidOffset(localDateTime, offset) {
219
- return this.validOffsets(localDateTime).some(function (o) {
220
- return o.equals(offset);
221
- });
222
- };
200
+ if (offsetBefore.compareTo(offsetAfter) > 0) {
201
+ return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"].of(ldtBefore, offsetBefore, offsetAfter);
202
+ } else {
203
+ return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"].of(ldtAfter, offsetBefore, offsetAfter);
204
+ }
205
+ }
223
206
 
224
- _proto.nextTransition = function nextTransition(instant) {
225
- notSupported('ZoneRules.nextTransition');
226
- };
207
+ return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(offsetIndex));
208
+ }
209
+ }, {
210
+ key: "_offsetByIndexInSeconds",
211
+ value: function _offsetByIndexInSeconds(index) {
212
+ return -offsetInSeconds(this._tzdbInfo.offsets[index]);
213
+ }
214
+ }, {
215
+ key: "validOffsets",
216
+ value: function validOffsets(localDateTime) {
217
+ var info = this._offsetInfo(localDateTime);
227
218
 
228
- _proto.previousTransition = function previousTransition(instant) {
229
- notSupported('ZoneRules.previousTransition');
230
- };
219
+ if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
220
+ return info.validOffsets();
221
+ }
231
222
 
232
- _proto.transitions = function transitions() {
233
- notSupported('ZoneRules.transitions');
234
- };
223
+ return [info];
224
+ }
225
+ }, {
226
+ key: "transition",
227
+ value: function transition(localDateTime) {
228
+ var info = this._offsetInfo(localDateTime);
235
229
 
236
- _proto.transitionRules = function transitionRules() {
237
- notSupported('ZoneRules.transitionRules');
238
- };
230
+ if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
231
+ return info;
232
+ }
239
233
 
240
- _proto.equals = function equals(other) {
241
- if (this === other) {
242
- return true;
234
+ return null;
243
235
  }
244
-
245
- if (other instanceof MomentZoneRules) {
246
- return this._tzdbInfo === other._tzdbInfo;
236
+ }, {
237
+ key: "standardOffset",
238
+ value: function standardOffset(instant) {
239
+ notSupported('ZoneRules.standardOffset');
240
+ }
241
+ }, {
242
+ key: "daylightSavings",
243
+ value: function daylightSavings(instant) {
244
+ notSupported('ZoneRules.daylightSavings');
245
+ }
246
+ }, {
247
+ key: "isDaylightSavings",
248
+ value: function isDaylightSavings(instant) {
249
+ notSupported('ZoneRules.isDaylightSavings');
250
+ }
251
+ }, {
252
+ key: "isValidOffset",
253
+ value: function isValidOffset(localDateTime, offset) {
254
+ return this.validOffsets(localDateTime).some(function (o) {
255
+ return o.equals(offset);
256
+ });
247
257
  }
258
+ }, {
259
+ key: "nextTransition",
260
+ value: function nextTransition(instant) {
261
+ notSupported('ZoneRules.nextTransition');
262
+ }
263
+ }, {
264
+ key: "previousTransition",
265
+ value: function previousTransition(instant) {
266
+ notSupported('ZoneRules.previousTransition');
267
+ }
268
+ }, {
269
+ key: "transitions",
270
+ value: function transitions() {
271
+ notSupported('ZoneRules.transitions');
272
+ }
273
+ }, {
274
+ key: "transitionRules",
275
+ value: function transitionRules() {
276
+ notSupported('ZoneRules.transitionRules');
277
+ }
278
+ }, {
279
+ key: "equals",
280
+ value: function equals(other) {
281
+ if (this === other) {
282
+ return true;
283
+ }
248
284
 
249
- return false;
250
- };
285
+ if (other instanceof MomentZoneRules) {
286
+ return this._tzdbInfo === other._tzdbInfo;
287
+ }
251
288
 
252
- _proto.toString = function toString() {
253
- return this._tzdbInfo.name;
254
- };
289
+ return false;
290
+ }
291
+ }, {
292
+ key: "toString",
293
+ value: function toString() {
294
+ return this._tzdbInfo.name;
295
+ }
296
+ }]);
255
297
 
256
298
  return MomentZoneRules;
257
299
  }(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneRules"]);
258
300
 
259
301
  var LDTUntils = function () {
260
302
  function LDTUntils(_tzdbUntils, tzdbOffsets) {
303
+ _classCallCheck(this, LDTUntils);
304
+
261
305
  this._tzdbUntils = _tzdbUntils;
262
306
  this._tzdbOffsets = tzdbOffsets;
263
307
  this._ldtUntils = [];
264
308
  this.size = this._tzdbUntils.length * 2;
265
309
  }
266
310
 
267
- var _proto2 = LDTUntils.prototype;
311
+ _createClass(LDTUntils, [{
312
+ key: "_generateTupple",
313
+ value: function _generateTupple(index) {
314
+ var epochMillis = this._tzdbUntils[index];
268
315
 
269
- _proto2._generateTupple = function _generateTupple(index) {
270
- var epochMillis = this._tzdbUntils[index];
316
+ if (epochMillis === Infinity) {
317
+ return [_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].MAX, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].MAX];
318
+ }
271
319
 
272
- if (epochMillis === Infinity) {
273
- return [_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].MAX, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].MAX];
320
+ var instant = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].ofEpochMilli(epochMillis);
321
+ var offset1 = offsetInSeconds(this._tzdbOffsets[index]);
322
+ var zone1 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(-offset1);
323
+ var ldt1 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].ofInstant(instant, zone1);
324
+ var nextIndex = Math.min(index + 1, this._tzdbOffsets.length - 1);
325
+ var offset2 = offsetInSeconds(this._tzdbOffsets[nextIndex]);
326
+ var zone2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(-offset2);
327
+ var ldt2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].ofInstant(instant, zone2);
328
+
329
+ if (offset1 > offset2) {
330
+ return [ldt1, ldt2];
331
+ } else {
332
+ return [ldt2, ldt1];
333
+ }
274
334
  }
335
+ }, {
336
+ key: "_getTupple",
337
+ value: function _getTupple(index) {
338
+ if (this._ldtUntils[index] == null) {
339
+ this._ldtUntils[index] = this._generateTupple(index);
340
+ }
275
341
 
276
- var instant = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].ofEpochMilli(epochMillis);
277
- var offset1 = offsetInSeconds(this._tzdbOffsets[index]);
278
- var zone1 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(-offset1);
279
- var ldt1 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].ofInstant(instant, zone1);
280
- var nextIndex = Math.min(index + 1, this._tzdbOffsets.length - 1);
281
- var offset2 = offsetInSeconds(this._tzdbOffsets[nextIndex]);
282
- var zone2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(-offset2);
283
- var ldt2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].ofInstant(instant, zone2);
284
-
285
- if (offset1 > offset2) {
286
- return [ldt1, ldt2];
287
- } else {
288
- return [ldt2, ldt1];
342
+ return this._ldtUntils[index];
289
343
  }
290
- };
344
+ }, {
345
+ key: "get",
346
+ value: function get(index) {
347
+ var ldtTupple = this._getTupple(index >> 1);
291
348
 
292
- _proto2._getTupple = function _getTupple(index) {
293
- if (this._ldtUntils[index] == null) {
294
- this._ldtUntils[index] = this._generateTupple(index);
349
+ return ldtTupple[index % 2];
295
350
  }
296
-
297
- return this._ldtUntils[index];
298
- };
299
-
300
- _proto2.get = function get(index) {
301
- var ldtTupple = this._getTupple(index >> 1);
302
-
303
- return ldtTupple[index % 2];
304
- };
351
+ }]);
305
352
 
306
353
  return LDTUntils;
307
354
  }();
@@ -351,7 +398,7 @@ function binarySearch(array, value) {
351
398
  }
352
399
 
353
400
  function notSupported(msg) {
354
- throw new Error('not supported: ' + msg);
401
+ throw new Error("not supported: ".concat(msg));
355
402
  }
356
403
 
357
404
  /***/ }),
@@ -370,7 +417,33 @@ __webpack_require__.r(__webpack_exports__);
370
417
  /* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
371
418
  /* harmony import */ var _MomentZoneRules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MomentZoneRules */ "./src/MomentZoneRules.js");
372
419
  /* harmony import */ var _unpack__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unpack */ "./src/unpack.js");
373
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
420
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
421
+
422
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
423
+
424
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
425
+
426
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
427
+
428
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
429
+
430
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
431
+
432
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
433
+
434
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
435
+
436
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
437
+
438
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
439
+
440
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
441
+
442
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
443
+
444
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
445
+
446
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
374
447
 
375
448
  /*
376
449
  * @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper
@@ -386,75 +459,82 @@ var AVAILABLE_ZONE_IDS = [];
386
459
  var zones = {};
387
460
  var links = {};
388
461
  var MomentZoneRulesProvider = function (_ZoneRulesProvider) {
389
- _inheritsLoose(MomentZoneRulesProvider, _ZoneRulesProvider);
462
+ _inherits(MomentZoneRulesProvider, _ZoneRulesProvider);
390
463
 
391
- function MomentZoneRulesProvider() {
392
- return _ZoneRulesProvider.apply(this, arguments) || this;
393
- }
394
-
395
- MomentZoneRulesProvider.getRules = function getRules(zoneId) {
396
- var tzdbZoneInfo = zones[links[zoneId]];
397
-
398
- if (tzdbZoneInfo == null) {
399
- throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Unknown time-zone ID: ' + zoneId);
400
- }
401
-
402
- return new _MomentZoneRules__WEBPACK_IMPORTED_MODULE_1__["MomentZoneRules"](tzdbZoneInfo);
403
- };
404
-
405
- MomentZoneRulesProvider.getAvailableZoneIds = function getAvailableZoneIds() {
406
- return AVAILABLE_ZONE_IDS;
407
- };
464
+ var _super = _createSuper(MomentZoneRulesProvider);
408
465
 
409
- MomentZoneRulesProvider.getVersion = function getVersion() {
410
- return TZDB_VERSION;
411
- };
412
-
413
- MomentZoneRulesProvider.getTzdbData = function getTzdbData() {
414
- return TZDB_DATA;
415
- };
466
+ function MomentZoneRulesProvider() {
467
+ _classCallCheck(this, MomentZoneRulesProvider);
416
468
 
417
- MomentZoneRulesProvider.loadTzdbData = function loadTzdbData(packedJson) {
418
- TZDB_DATA = packedJson;
419
- TZDB_VERSION = packedJson.version;
469
+ return _super.apply(this, arguments);
470
+ }
420
471
 
421
- for (var _iterator = packedJson.zones, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
422
- var _ref;
472
+ _createClass(MomentZoneRulesProvider, null, [{
473
+ key: "getRules",
474
+ value: function getRules(zoneId) {
475
+ var tzdbZoneInfo = zones[links[zoneId]];
423
476
 
424
- if (_isArray) {
425
- if (_i >= _iterator.length) break;
426
- _ref = _iterator[_i++];
427
- } else {
428
- _i = _iterator.next();
429
- if (_i.done) break;
430
- _ref = _i.value;
477
+ if (tzdbZoneInfo == null) {
478
+ throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]("Unknown time-zone ID: ".concat(zoneId));
431
479
  }
432
480
 
433
- var packedZoneInfo = _ref;
434
- var tzdbZoneInfo = Object(_unpack__WEBPACK_IMPORTED_MODULE_2__["unpack"])(packedZoneInfo);
435
- AVAILABLE_ZONE_IDS.push(tzdbZoneInfo.name);
436
- zones[tzdbZoneInfo.name] = tzdbZoneInfo;
437
- links[tzdbZoneInfo.name] = tzdbZoneInfo.name;
481
+ return new _MomentZoneRules__WEBPACK_IMPORTED_MODULE_1__["MomentZoneRules"](tzdbZoneInfo);
438
482
  }
439
-
440
- for (var _iterator2 = packedJson.links, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
441
- var _ref2;
442
-
443
- if (_isArray2) {
444
- if (_i2 >= _iterator2.length) break;
445
- _ref2 = _iterator2[_i2++];
446
- } else {
447
- _i2 = _iterator2.next();
448
- if (_i2.done) break;
449
- _ref2 = _i2.value;
483
+ }, {
484
+ key: "getAvailableZoneIds",
485
+ value: function getAvailableZoneIds() {
486
+ return AVAILABLE_ZONE_IDS;
487
+ }
488
+ }, {
489
+ key: "getVersion",
490
+ value: function getVersion() {
491
+ return TZDB_VERSION;
492
+ }
493
+ }, {
494
+ key: "getTzdbData",
495
+ value: function getTzdbData() {
496
+ return TZDB_DATA;
497
+ }
498
+ }, {
499
+ key: "loadTzdbData",
500
+ value: function loadTzdbData(packedJson) {
501
+ TZDB_DATA = packedJson;
502
+ TZDB_VERSION = packedJson.version;
503
+
504
+ var _iterator = _createForOfIteratorHelper(packedJson.zones),
505
+ _step;
506
+
507
+ try {
508
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
509
+ var packedZoneInfo = _step.value;
510
+ var tzdbZoneInfo = Object(_unpack__WEBPACK_IMPORTED_MODULE_2__["unpack"])(packedZoneInfo);
511
+ AVAILABLE_ZONE_IDS.push(tzdbZoneInfo.name);
512
+ zones[tzdbZoneInfo.name] = tzdbZoneInfo;
513
+ links[tzdbZoneInfo.name] = tzdbZoneInfo.name;
514
+ }
515
+ } catch (err) {
516
+ _iterator.e(err);
517
+ } finally {
518
+ _iterator.f();
450
519
  }
451
520
 
452
- var packedLink = _ref2;
453
- var link = packedLink.split('|');
454
- AVAILABLE_ZONE_IDS.push(link[1]);
455
- links[link[1]] = link[0];
521
+ var _iterator2 = _createForOfIteratorHelper(packedJson.links),
522
+ _step2;
523
+
524
+ try {
525
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
526
+ var packedLink = _step2.value;
527
+ var link = packedLink.split('|');
528
+ AVAILABLE_ZONE_IDS.push(link[1]);
529
+ links[link[1]] = link[0];
530
+ }
531
+ } catch (err) {
532
+ _iterator2.e(err);
533
+ } finally {
534
+ _iterator2.f();
535
+ }
456
536
  }
457
- };
537
+ }]);
458
538
 
459
539
  return MomentZoneRulesProvider;
460
540
  }(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneRulesProvider"]);