diff --git a/CHANGELOG.md b/CHANGELOG.md index e0cce8b..432e55f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.0.3 (unreleased) + +- Updated Chart.js to 4.3.1 + ## 5.0.2 (2023-05-02) - Updated Chart.js to 4.3.0 diff --git a/build/package.json b/build/package.json index 825faf7..dedc7cd 100644 --- a/build/package.json +++ b/build/package.json @@ -14,9 +14,9 @@ "rollup": "^3.9.1" }, "dependencies": { - "chart.js": "4.3.0", + "chart.js": "4.3.1", "@kurkle/color": "0.3.2", "chartjs-adapter-date-fns": "3.0.0", - "date-fns": "2.29.3" + "date-fns": "2.30.0" } } diff --git a/build/rollup.config.js b/build/rollup.config.js index 2afb659..5bf7ac4 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -2,12 +2,12 @@ import babel from "@rollup/plugin-babel"; import resolve from "@rollup/plugin-node-resolve"; // use same banner as projects -// https://unpkg.com/chart.js@4.3.0 +// https://unpkg.com/chart.js@4.3.1 // https://unpkg.com/@kurkle/color@0.3.2 // https://unpkg.com/chartjs-adapter-date-fns@3.0.0 -// https://unpkg.com/date-fns@2.29.3 (no banner) +// https://unpkg.com/date-fns@2.30.0 (no banner) const banner = `/*! - * Chart.js v4.3.0 + * Chart.js v4.3.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License @@ -22,7 +22,7 @@ const banner = `/*! * (c) 2022 chartjs-adapter-date-fns Contributors * Released under the MIT license * - * date-fns v2.29.3 + * date-fns v2.30.0 * https://date-fns.org * (c) 2021 Sasha Koss and Lesha Koss * Released under the MIT License diff --git a/vendor/assets/javascripts/Chart.bundle.js b/vendor/assets/javascripts/Chart.bundle.js index af27666..27e1440 100644 --- a/vendor/assets/javascripts/Chart.bundle.js +++ b/vendor/assets/javascripts/Chart.bundle.js @@ -1,5 +1,5 @@ /*! - * Chart.js v4.3.0 + * Chart.js v4.3.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License @@ -14,7 +14,7 @@ * (c) 2022 chartjs-adapter-date-fns Contributors * Released under the MIT license * - * date-fns v2.29.3 + * date-fns v2.30.0 * https://date-fns.org * (c) 2021 Sasha Koss and Lesha Koss * Released under the MIT License @@ -67,46 +67,46 @@ for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { - _defineProperty$w(target, key, source[key]); + _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } - function _typeof$z(obj) { + function _typeof$1(obj) { "@babel/helpers - typeof"; - return _typeof$z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }, _typeof$z(obj); + }, _typeof$1(obj); } - function _classCallCheck$x(instance, Constructor) { + function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _defineProperties$x(target, props) { + function _defineProperties$1(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, _toPropertyKey(descriptor.key), descriptor); + Object.defineProperty(target, _toPropertyKey$1(descriptor.key), descriptor); } } - function _createClass$x(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$x(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$x(Constructor, staticProps); + function _createClass$1(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$1(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _defineProperty$w(obj, key, value) { - key = _toPropertyKey(key); + function _defineProperty$1(obj, key, value) { + key = _toPropertyKey$1(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, @@ -119,7 +119,7 @@ } return obj; } - function _inherits$w(subClass, superClass) { + function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } @@ -133,22 +133,22 @@ Object.defineProperty(subClass, "prototype", { writable: false }); - if (superClass) _setPrototypeOf$w(subClass, superClass); + if (superClass) _setPrototypeOf$1(subClass, superClass); } - function _getPrototypeOf$w(o) { - _getPrototypeOf$w = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + function _getPrototypeOf$1(o) { + _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; - return _getPrototypeOf$w(o); + return _getPrototypeOf$1(o); } - function _setPrototypeOf$w(o, p) { - _setPrototypeOf$w = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + function _setPrototypeOf$1(o, p) { + _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; - return _setPrototypeOf$w(o, p); + return _setPrototypeOf$1(o, p); } - function _isNativeReflectConstruct$w() { + function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; @@ -159,37 +159,37 @@ return false; } } - function _assertThisInitialized$w(self) { + function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - function _possibleConstructorReturn$w(self, call) { + function _possibleConstructorReturn$1(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$w(self); + return _assertThisInitialized$1(self); } - function _createSuper$w(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$w(); + function _createSuper$1(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { - var Super = _getPrototypeOf$w(Derived), + var Super = _getPrototypeOf$1(Derived), result; if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$w(this).constructor; + var NewTarget = _getPrototypeOf$1(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } - return _possibleConstructorReturn$w(this, result); + return _possibleConstructorReturn$1(this, result); }; } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf$w(object); + object = _getPrototypeOf$1(object); if (object === null) break; } return object; @@ -295,7 +295,7 @@ } }; } - function _toPrimitive(input, hint) { + function _toPrimitive$1(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { @@ -305,8 +305,8 @@ } return (hint === "string" ? String : Number)(input); } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); + function _toPropertyKey$1(arg) { + var key = _toPrimitive$1(arg, "string"); return typeof key === "symbol" ? key : String(key); } @@ -821,11 +821,11 @@ } var Color = /*#__PURE__*/function () { function Color(input) { - _classCallCheck$x(this, Color); + _classCallCheck$1(this, Color); if (input instanceof Color) { return input; } - var type = _typeof$z(input); + var type = _typeof$1(input); var v; if (type === 'object') { v = fromObject(input); @@ -835,7 +835,7 @@ this._rgb = v; this._valid = !!v; } - _createClass$x(Color, [{ + _createClass$1(Color, [{ key: "valid", get: function get() { return this._valid; @@ -1691,7 +1691,7 @@ if (minDefined) { start = _limitValue(Math.min( // @ts-expect-error Need to type _parsed - _lookupByKey(_parsed, iScale.axis, min).lo, + _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1); } @@ -1863,7 +1863,7 @@ } }; function isPatternOrGradient(value) { - if (value && _typeof$z(value) === 'object') { + if (value && _typeof$1(value) === 'object') { var type = value.toString(); return type === '[object CanvasPattern]' || type === '[object CanvasGradient]'; } @@ -2123,7 +2123,7 @@ } var Defaults = /*#__PURE__*/function () { function Defaults(_descriptors, _appliers) { - _classCallCheck$x(this, Defaults); + _classCallCheck$1(this, Defaults); this.animation = undefined; this.backgroundColor = 'rgba(0,0,0,0.1)'; this.borderColor = 'rgba(0,0,0,0.1)'; @@ -2170,7 +2170,7 @@ this.describe(_descriptors); this.apply(_appliers); } - _createClass$x(Defaults, [{ + _createClass$1(Defaults, [{ key: "set", value: function set(scope, values) { return _set(this, scope, values); @@ -2197,10 +2197,10 @@ var scopeObject = getScope$1(this, scope); var targetScopeObject = getScope$1(this, targetScope); var privateName = '_' + name; - Object.defineProperties(scopeObject, (_Object$definePropert = {}, _defineProperty$w(_Object$definePropert, privateName, { + Object.defineProperties(scopeObject, (_Object$definePropert = {}, _defineProperty$1(_Object$definePropert, privateName, { value: scopeObject[name], writable: true - }), _defineProperty$w(_Object$definePropert, name, { + }), _defineProperty$1(_Object$definePropert, name, { enumerable: true, get: function get() { var local = this[privateName]; @@ -2348,7 +2348,7 @@ var rotation = options.rotation; var radius = options.radius; var rad = (rotation || 0) * RAD_PER_DEG; - if (style && _typeof$z(style) === 'object') { + if (style && _typeof$1(style) === 'object') { type = style.toString(); if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') { ctx.save(); @@ -2830,7 +2830,7 @@ if (typeof fallback === 'undefined') { fallback = _resolve('_fallback', scopes); } - var cache = (_cache = {}, _defineProperty$w(_cache, Symbol.toStringTag, 'Object'), _defineProperty$w(_cache, "_cacheable", true), _defineProperty$w(_cache, "_scopes", scopes), _defineProperty$w(_cache, "_rootScopes", finalRootScopes), _defineProperty$w(_cache, "_fallback", fallback), _defineProperty$w(_cache, "_getTarget", getTarget), _defineProperty$w(_cache, "override", function override(scope) { + var cache = (_cache = {}, _defineProperty$1(_cache, Symbol.toStringTag, 'Object'), _defineProperty$1(_cache, "_cacheable", true), _defineProperty$1(_cache, "_scopes", scopes), _defineProperty$1(_cache, "_rootScopes", finalRootScopes), _defineProperty$1(_cache, "_fallback", fallback), _defineProperty$1(_cache, "_getTarget", getTarget), _defineProperty$1(_cache, "override", function override(scope) { return _createResolver([scope].concat(_toConsumableArray(scopes)), prefixes, finalRootScopes, fallback); }), _cache); return new Proxy(cache, { @@ -4081,13 +4081,13 @@ var Animator = /*#__PURE__*/function () { function Animator() { - _classCallCheck$x(this, Animator); + _classCallCheck$1(this, Animator); this._request = null; this._charts = new Map(); this._running = false; this._lastDate = undefined; } - _createClass$x(Animator, [{ + _createClass$1(Animator, [{ key: "_notify", value: function _notify(chart, anims, date, type) { var callbacks = anims.listeners[type]; @@ -4264,12 +4264,12 @@ }; var Animation = /*#__PURE__*/function () { function Animation(cfg, target, prop, to) { - _classCallCheck$x(this, Animation); + _classCallCheck$1(this, Animation); var currentValue = target[prop]; to = resolve([cfg.to, to, currentValue, cfg.from]); var from = resolve([cfg.from, currentValue, to]); this._active = true; - this._fn = cfg.fn || interpolators[cfg.type || _typeof$z(from)]; + this._fn = cfg.fn || interpolators[cfg.type || _typeof$1(from)]; this._easing = effects[cfg.easing] || effects.linear; this._start = Math.floor(Date.now() + (cfg.delay || 0)); this._duration = this._total = Math.floor(cfg.duration); @@ -4280,7 +4280,7 @@ this._to = to; this._promises = undefined; } - _createClass$x(Animation, [{ + _createClass$1(Animation, [{ key: "active", value: function active() { return this._active; @@ -4360,12 +4360,12 @@ }(); var Animations = /*#__PURE__*/function () { function Animations(chart, config) { - _classCallCheck$x(this, Animations); + _classCallCheck$1(this, Animations); this._chart = chart; this._properties = new Map(); this.configure(config); } - _createClass$x(Animations, [{ + _createClass$1(Animations, [{ key: "configure", value: function configure(config) { if (!isObject(config)) { @@ -4708,7 +4708,7 @@ }; var DatasetController = /*#__PURE__*/function () { function DatasetController(chart, datasetIndex) { - _classCallCheck$x(this, DatasetController); + _classCallCheck$1(this, DatasetController); this.chart = chart; this._ctx = chart.ctx; this.index = datasetIndex; @@ -4730,7 +4730,7 @@ this.dataElementType = (this instanceof DatasetController ? this.constructor : void 0).dataElementType; this.initialize(); } - _createClass$x(DatasetController, [{ + _createClass$1(DatasetController, [{ key: "initialize", value: function initialize() { var meta = this._cachedMeta; @@ -4923,7 +4923,7 @@ for (i = 0, ilen = count; i < ilen; ++i) { var _parsed$i; index = i + start; - parsed[i] = (_parsed$i = {}, _defineProperty$w(_parsed$i, iAxis, singleScale || iScale.parse(labels[index], index)), _defineProperty$w(_parsed$i, vAxis, vScale.parse(data[index], index)), _parsed$i); + parsed[i] = (_parsed$i = {}, _defineProperty$1(_parsed$i, iAxis, singleScale || iScale.parse(labels[index], index)), _defineProperty$1(_parsed$i, vAxis, vScale.parse(data[index], index)), _parsed$i); } return parsed; } @@ -5405,9 +5405,9 @@ }]); return DatasetController; }(); - _defineProperty$w(DatasetController, "defaults", {}); - _defineProperty$w(DatasetController, "datasetElementType", null); - _defineProperty$w(DatasetController, "dataElementType", null); + _defineProperty$1(DatasetController, "defaults", {}); + _defineProperty$1(DatasetController, "datasetElementType", null); + _defineProperty$1(DatasetController, "dataElementType", null); function getAllScaleValues(scale, type) { if (!scale._cache.$bar) { var visibleMetas = scale.getMatchingVisibleMetas(type); @@ -5617,13 +5617,13 @@ properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount; } var BarController = /*#__PURE__*/function (_DatasetController) { - _inherits$w(BarController, _DatasetController); - var _super = _createSuper$w(BarController); + _inherits$1(BarController, _DatasetController); + var _super = _createSuper$1(BarController); function BarController() { - _classCallCheck$x(this, BarController); + _classCallCheck$1(this, BarController); return _super.apply(this, arguments); } - _createClass$x(BarController, [{ + _createClass$1(BarController, [{ key: "parsePrimitiveData", value: function parsePrimitiveData(meta, data, start, count) { return parseArrayOrPrimitive(meta, data, start, count); @@ -5658,7 +5658,7 @@ }, { key: "updateRangeFromParsed", value: function updateRangeFromParsed(range, scale, parsed, stack) { - _get(_getPrototypeOf$w(BarController.prototype), "updateRangeFromParsed", this).call(this, range, scale, parsed, stack); + _get(_getPrototypeOf$1(BarController.prototype), "updateRangeFromParsed", this).call(this, range, scale, parsed, stack); var custom = parsed._custom; if (custom && scale === this._cachedMeta.vScale) { range.min = Math.min(range.min, custom.min); @@ -5688,7 +5688,7 @@ key: "initialize", value: function initialize() { this.enableOptionSharing = true; - _get(_getPrototypeOf$w(BarController.prototype), "initialize", this).call(this); + _get(_getPrototypeOf$1(BarController.prototype), "initialize", this).call(this); var meta = this._cachedMeta; meta.stack = this.getDataset().stack; } @@ -5920,8 +5920,8 @@ }]); return BarController; }(DatasetController); - _defineProperty$w(BarController, "id", 'bar'); - _defineProperty$w(BarController, "defaults", { + _defineProperty$1(BarController, "id", 'bar'); + _defineProperty$1(BarController, "defaults", { datasetElementType: false, dataElementType: 'bar', categoryPercentage: 0.8, @@ -5934,7 +5934,7 @@ } } }); - _defineProperty$w(BarController, "overrides", { + _defineProperty$1(BarController, "overrides", { scales: { _index_: { type: 'category', @@ -5950,22 +5950,22 @@ } }); var BubbleController = /*#__PURE__*/function (_DatasetController2) { - _inherits$w(BubbleController, _DatasetController2); - var _super2 = _createSuper$w(BubbleController); + _inherits$1(BubbleController, _DatasetController2); + var _super2 = _createSuper$1(BubbleController); function BubbleController() { - _classCallCheck$x(this, BubbleController); + _classCallCheck$1(this, BubbleController); return _super2.apply(this, arguments); } - _createClass$x(BubbleController, [{ + _createClass$1(BubbleController, [{ key: "initialize", value: function initialize() { this.enableOptionSharing = true; - _get(_getPrototypeOf$w(BubbleController.prototype), "initialize", this).call(this); + _get(_getPrototypeOf$1(BubbleController.prototype), "initialize", this).call(this); } }, { key: "parsePrimitiveData", value: function parsePrimitiveData(meta, data, start, count) { - var parsed = _get(_getPrototypeOf$w(BubbleController.prototype), "parsePrimitiveData", this).call(this, meta, data, start, count); + var parsed = _get(_getPrototypeOf$1(BubbleController.prototype), "parsePrimitiveData", this).call(this, meta, data, start, count); for (var i = 0; i < parsed.length; i++) { parsed[i]._custom = this.resolveDataElementOptions(i + start).radius; } @@ -5974,7 +5974,7 @@ }, { key: "parseArrayData", value: function parseArrayData(meta, data, start, count) { - var parsed = _get(_getPrototypeOf$w(BubbleController.prototype), "parseArrayData", this).call(this, meta, data, start, count); + var parsed = _get(_getPrototypeOf$1(BubbleController.prototype), "parseArrayData", this).call(this, meta, data, start, count); for (var i = 0; i < parsed.length; i++) { var item = data[start + i]; parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius); @@ -5984,7 +5984,7 @@ }, { key: "parseObjectData", value: function parseObjectData(meta, data, start, count) { - var parsed = _get(_getPrototypeOf$w(BubbleController.prototype), "parseObjectData", this).call(this, meta, data, start, count); + var parsed = _get(_getPrototypeOf$1(BubbleController.prototype), "parseObjectData", this).call(this, meta, data, start, count); for (var i = 0; i < parsed.length; i++) { var item = data[start + i]; parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius); @@ -6055,7 +6055,7 @@ key: "resolveDataElementOptions", value: function resolveDataElementOptions(index, mode) { var parsed = this.getParsed(index); - var values = _get(_getPrototypeOf$w(BubbleController.prototype), "resolveDataElementOptions", this).call(this, index, mode); + var values = _get(_getPrototypeOf$1(BubbleController.prototype), "resolveDataElementOptions", this).call(this, index, mode); if (values.$shared) { values = Object.assign({}, values, { $shared: false @@ -6071,8 +6071,8 @@ }]); return BubbleController; }(DatasetController); - _defineProperty$w(BubbleController, "id", 'bubble'); - _defineProperty$w(BubbleController, "defaults", { + _defineProperty$1(BubbleController, "id", 'bubble'); + _defineProperty$1(BubbleController, "defaults", { datasetElementType: false, dataElementType: 'point', animations: { @@ -6082,7 +6082,7 @@ } } }); - _defineProperty$w(BubbleController, "overrides", { + _defineProperty$1(BubbleController, "overrides", { scales: { x: { type: 'linear' @@ -6127,11 +6127,11 @@ }; } var DoughnutController = /*#__PURE__*/function (_DatasetController3) { - _inherits$w(DoughnutController, _DatasetController3); - var _super3 = _createSuper$w(DoughnutController); + _inherits$1(DoughnutController, _DatasetController3); + var _super3 = _createSuper$1(DoughnutController); function DoughnutController(chart, datasetIndex) { var _this4; - _classCallCheck$x(this, DoughnutController); + _classCallCheck$1(this, DoughnutController); _this4 = _super3.call(this, chart, datasetIndex); _this4.enableOptionSharing = true; _this4.innerRadius = undefined; @@ -6140,7 +6140,7 @@ _this4.offsetY = undefined; return _this4; } - _createClass$x(DoughnutController, [{ + _createClass$1(DoughnutController, [{ key: "linkScales", value: function linkScales() {} }, { @@ -6376,8 +6376,8 @@ }]); return DoughnutController; }(DatasetController); - _defineProperty$w(DoughnutController, "id", 'doughnut'); - _defineProperty$w(DoughnutController, "defaults", { + _defineProperty$1(DoughnutController, "id", 'doughnut'); + _defineProperty$1(DoughnutController, "defaults", { datasetElementType: false, dataElementType: 'arc', animation: { @@ -6397,7 +6397,7 @@ spacing: 0, indexAxis: 'r' }); - _defineProperty$w(DoughnutController, "descriptors", { + _defineProperty$1(DoughnutController, "descriptors", { _scriptable: function _scriptable(name) { return name !== 'spacing'; }, @@ -6405,7 +6405,7 @@ return name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'); } }); - _defineProperty$w(DoughnutController, "overrides", { + _defineProperty$1(DoughnutController, "overrides", { aspectRatio: 1, plugins: { legend: { @@ -6442,18 +6442,18 @@ } }); var LineController = /*#__PURE__*/function (_DatasetController4) { - _inherits$w(LineController, _DatasetController4); - var _super4 = _createSuper$w(LineController); + _inherits$1(LineController, _DatasetController4); + var _super4 = _createSuper$1(LineController); function LineController() { - _classCallCheck$x(this, LineController); + _classCallCheck$1(this, LineController); return _super4.apply(this, arguments); } - _createClass$x(LineController, [{ + _createClass$1(LineController, [{ key: "initialize", value: function initialize() { this.enableOptionSharing = true; this.supportsDecimation = true; - _get(_getPrototypeOf$w(LineController.prototype), "initialize", this).call(this); + _get(_getPrototypeOf$1(LineController.prototype), "initialize", this).call(this); } }, { key: "update", @@ -6476,7 +6476,7 @@ line._chart = this.chart; line._datasetIndex = this.index; line._decimated = !!_dataset._decimated; - line.points = points; + line.points = points.slice(Math.max(this._drawStart - 1, 0), this._drawStart + this._drawCount); var options = this.resolveDatasetElementOptions(mode); if (!this.options.showLine) { options.borderWidth = 0; @@ -6555,19 +6555,19 @@ value: function draw() { var meta = this._cachedMeta; meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis); - _get(_getPrototypeOf$w(LineController.prototype), "draw", this).call(this); + _get(_getPrototypeOf$1(LineController.prototype), "draw", this).call(this); } }]); return LineController; }(DatasetController); - _defineProperty$w(LineController, "id", 'line'); - _defineProperty$w(LineController, "defaults", { + _defineProperty$1(LineController, "id", 'line'); + _defineProperty$1(LineController, "defaults", { datasetElementType: 'line', dataElementType: 'point', showLine: true, spanGaps: false }); - _defineProperty$w(LineController, "overrides", { + _defineProperty$1(LineController, "overrides", { scales: { _index_: { type: 'category' @@ -6578,17 +6578,17 @@ } }); var PolarAreaController = /*#__PURE__*/function (_DatasetController5) { - _inherits$w(PolarAreaController, _DatasetController5); - var _super5 = _createSuper$w(PolarAreaController); + _inherits$1(PolarAreaController, _DatasetController5); + var _super5 = _createSuper$1(PolarAreaController); function PolarAreaController(chart, datasetIndex) { var _this5; - _classCallCheck$x(this, PolarAreaController); + _classCallCheck$1(this, PolarAreaController); _this5 = _super5.call(this, chart, datasetIndex); _this5.innerRadius = undefined; _this5.outerRadius = undefined; return _this5; } - _createClass$x(PolarAreaController, [{ + _createClass$1(PolarAreaController, [{ key: "getLabelAndValue", value: function getLabelAndValue(index) { var meta = this._cachedMeta; @@ -6711,8 +6711,8 @@ }]); return PolarAreaController; }(DatasetController); - _defineProperty$w(PolarAreaController, "id", 'polarArea'); - _defineProperty$w(PolarAreaController, "defaults", { + _defineProperty$1(PolarAreaController, "id", 'polarArea'); + _defineProperty$1(PolarAreaController, "defaults", { dataElementType: 'arc', animation: { animateRotate: true, @@ -6727,7 +6727,7 @@ indexAxis: 'r', startAngle: 0 }); - _defineProperty$w(PolarAreaController, "overrides", { + _defineProperty$1(PolarAreaController, "overrides", { aspectRatio: 1, plugins: { legend: { @@ -6780,29 +6780,29 @@ } }); var PieController = /*#__PURE__*/function (_DoughnutController) { - _inherits$w(PieController, _DoughnutController); - var _super6 = _createSuper$w(PieController); + _inherits$1(PieController, _DoughnutController); + var _super6 = _createSuper$1(PieController); function PieController() { - _classCallCheck$x(this, PieController); + _classCallCheck$1(this, PieController); return _super6.apply(this, arguments); } - return _createClass$x(PieController); + return _createClass$1(PieController); }(DoughnutController); - _defineProperty$w(PieController, "id", 'pie'); - _defineProperty$w(PieController, "defaults", { + _defineProperty$1(PieController, "id", 'pie'); + _defineProperty$1(PieController, "defaults", { cutout: 0, rotation: 0, circumference: 360, radius: '100%' }); var RadarController = /*#__PURE__*/function (_DatasetController6) { - _inherits$w(RadarController, _DatasetController6); - var _super7 = _createSuper$w(RadarController); + _inherits$1(RadarController, _DatasetController6); + var _super7 = _createSuper$1(RadarController); function RadarController() { - _classCallCheck$x(this, RadarController); + _classCallCheck$1(this, RadarController); return _super7.apply(this, arguments); } - _createClass$x(RadarController, [{ + _createClass$1(RadarController, [{ key: "getLabelAndValue", value: function getLabelAndValue(index) { var vScale = this._cachedMeta.vScale; @@ -6863,8 +6863,8 @@ }]); return RadarController; }(DatasetController); - _defineProperty$w(RadarController, "id", 'radar'); - _defineProperty$w(RadarController, "defaults", { + _defineProperty$1(RadarController, "id", 'radar'); + _defineProperty$1(RadarController, "defaults", { datasetElementType: 'line', dataElementType: 'point', indexAxis: 'r', @@ -6875,7 +6875,7 @@ } } }); - _defineProperty$w(RadarController, "overrides", { + _defineProperty$1(RadarController, "overrides", { aspectRatio: 1, scales: { r: { @@ -6884,13 +6884,13 @@ } }); var ScatterController = /*#__PURE__*/function (_DatasetController7) { - _inherits$w(ScatterController, _DatasetController7); - var _super8 = _createSuper$w(ScatterController); + _inherits$1(ScatterController, _DatasetController7); + var _super8 = _createSuper$1(ScatterController); function ScatterController() { - _classCallCheck$x(this, ScatterController); + _classCallCheck$1(this, ScatterController); return _super8.apply(this, arguments); } - _createClass$x(ScatterController, [{ + _createClass$1(ScatterController, [{ key: "getLabelAndValue", value: function getLabelAndValue(index) { var meta = this._cachedMeta; @@ -6922,6 +6922,9 @@ count = points.length; } if (this.options.showLine) { + if (!this.datasetElementType) { + this.addElements(); + } var line = meta.dataset, _dataset = meta._dataset; line._chart = this.chart; @@ -6934,6 +6937,9 @@ animated: !animationsDisabled, options: options }, mode); + } else if (this.datasetElementType) { + delete meta.dataset; + this.datasetElementType = false; } this.updateElements(points, start, count, mode); } @@ -6944,7 +6950,7 @@ if (!this.datasetElementType && showLine) { this.datasetElementType = this.chart.registry.getElement('line'); } - _get(_getPrototypeOf$w(ScatterController.prototype), "addElements", this).call(this); + _get(_getPrototypeOf$1(ScatterController.prototype), "addElements", this).call(this); } }, { key: "updateElements", @@ -7013,14 +7019,14 @@ }]); return ScatterController; }(DatasetController); - _defineProperty$w(ScatterController, "id", 'scatter'); - _defineProperty$w(ScatterController, "defaults", { + _defineProperty$1(ScatterController, "id", 'scatter'); + _defineProperty$1(ScatterController, "defaults", { datasetElementType: false, dataElementType: 'point', showLine: false, fill: false }); - _defineProperty$w(ScatterController, "overrides", { + _defineProperty$1(ScatterController, "overrides", { interaction: { mode: 'point' }, @@ -7061,12 +7067,12 @@ */ var DateAdapterBase = /*#__PURE__*/function () { function DateAdapterBase(options) { - _classCallCheck$x(this, DateAdapterBase); - _defineProperty$w(this, "options", void 0); + _classCallCheck$1(this, DateAdapterBase); + _defineProperty$1(this, "options", void 0); this.options = options || {}; } // eslint-disable-next-line @typescript-eslint/no-empty-function - _createClass$x(DateAdapterBase, [{ + _createClass$1(DateAdapterBase, [{ key: "init", value: function init() {} }, { @@ -7704,9 +7710,9 @@ }; var BasePlatform = /*#__PURE__*/function () { function BasePlatform() { - _classCallCheck$x(this, BasePlatform); + _classCallCheck$1(this, BasePlatform); } - _createClass$x(BasePlatform, [{ + _createClass$1(BasePlatform, [{ key: "acquireContext", value: function acquireContext(canvas, aspectRatio) {} }, { @@ -7747,13 +7753,13 @@ return BasePlatform; }(); var BasicPlatform = /*#__PURE__*/function (_BasePlatform) { - _inherits$w(BasicPlatform, _BasePlatform); - var _super9 = _createSuper$w(BasicPlatform); + _inherits$1(BasicPlatform, _BasePlatform); + var _super9 = _createSuper$1(BasicPlatform); function BasicPlatform() { - _classCallCheck$x(this, BasicPlatform); + _classCallCheck$1(this, BasicPlatform); return _super9.apply(this, arguments); } - _createClass$x(BasicPlatform, [{ + _createClass$1(BasicPlatform, [{ key: "acquireContext", value: function acquireContext(item) { return item && item.getContext && item.getContext('2d') || null; @@ -7979,13 +7985,13 @@ return proxy; } var DomPlatform = /*#__PURE__*/function (_BasePlatform2) { - _inherits$w(DomPlatform, _BasePlatform2); - var _super10 = _createSuper$w(DomPlatform); + _inherits$1(DomPlatform, _BasePlatform2); + var _super10 = _createSuper$1(DomPlatform); function DomPlatform() { - _classCallCheck$x(this, DomPlatform); + _classCallCheck$1(this, DomPlatform); return _super10.apply(this, arguments); } - _createClass$x(DomPlatform, [{ + _createClass$1(DomPlatform, [{ key: "acquireContext", value: function acquireContext(canvas, aspectRatio) { var context = canvas && canvas.getContext && canvas.getContext('2d'); @@ -8076,14 +8082,14 @@ } var Element = /*#__PURE__*/function () { function Element() { - _classCallCheck$x(this, Element); - _defineProperty$w(this, "x", void 0); - _defineProperty$w(this, "y", void 0); - _defineProperty$w(this, "active", false); - _defineProperty$w(this, "options", void 0); - _defineProperty$w(this, "$animations", void 0); - } - _createClass$x(Element, [{ + _classCallCheck$1(this, Element); + _defineProperty$1(this, "x", void 0); + _defineProperty$1(this, "y", void 0); + _defineProperty$1(this, "active", false); + _defineProperty$1(this, "options", void 0); + _defineProperty$1(this, "$animations", void 0); + } + _createClass$1(Element, [{ key: "tooltipPosition", value: function tooltipPosition(useFinalPosition) { var _this$getProps = this.getProps(['x', 'y'], useFinalPosition), @@ -8117,8 +8123,8 @@ }]); return Element; }(); - _defineProperty$w(Element, "defaults", {}); - _defineProperty$w(Element, "defaultRoutes", undefined); + _defineProperty$1(Element, "defaults", {}); + _defineProperty$1(Element, "defaultRoutes", undefined); function autoSkip(scale, ticks) { var tickOpts = scale.options.ticks; var determinedMaxTicks = determineMaxTicks(scale); @@ -8359,11 +8365,11 @@ }; } var Scale = /*#__PURE__*/function (_Element) { - _inherits$w(Scale, _Element); - var _super11 = _createSuper$w(Scale); + _inherits$1(Scale, _Element); + var _super11 = _createSuper$1(Scale); function Scale(cfg) { var _this9; - _classCallCheck$x(this, Scale); + _classCallCheck$1(this, Scale); _this9 = _super11.call(this); _this9.id = cfg.id; _this9.type = cfg.type; @@ -8414,7 +8420,7 @@ _this9.$context = undefined; return _this9; } - _createClass$x(Scale, [{ + _createClass$1(Scale, [{ key: "init", value: function init(options) { this.options = options.setContext(this.getContext()); @@ -9678,13 +9684,13 @@ }(Element); var TypedRegistry = /*#__PURE__*/function () { function TypedRegistry(type, scope, override) { - _classCallCheck$x(this, TypedRegistry); + _classCallCheck$1(this, TypedRegistry); this.type = type; this.scope = scope; this.override = override; this.items = Object.create(null); } - _createClass$x(TypedRegistry, [{ + _createClass$1(TypedRegistry, [{ key: "isForType", value: function isForType(type) { return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype); @@ -9763,14 +9769,14 @@ } var Registry = /*#__PURE__*/function () { function Registry() { - _classCallCheck$x(this, Registry); + _classCallCheck$1(this, Registry); this.controllers = new TypedRegistry(DatasetController, 'datasets', true); this.elements = new TypedRegistry(Element, 'elements'); this.plugins = new TypedRegistry(Object, 'plugins'); this.scales = new TypedRegistry(Scale, 'scales'); this._typedRegistries = [this.controllers, this.scales, this.elements]; } - _createClass$x(Registry, [{ + _createClass$1(Registry, [{ key: "add", value: function add() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { @@ -9920,10 +9926,10 @@ var registry = /* #__PURE__ */new Registry(); var PluginService = /*#__PURE__*/function () { function PluginService() { - _classCallCheck$x(this, PluginService); + _classCallCheck$1(this, PluginService); this._init = []; } - _createClass$x(PluginService, [{ + _createClass$1(PluginService, [{ key: "notify", value: function notify(chart, hook, args, filter) { if (hook === 'beforeInit') { @@ -10220,12 +10226,12 @@ }; var Config = /*#__PURE__*/function () { function Config(config) { - _classCallCheck$x(this, Config); + _classCallCheck$1(this, Config); this._config = initConfig(config); this._scopeCache = new Map(); this._resolverCache = new Map(); } - _createClass$x(Config, [{ + _createClass$1(Config, [{ key: "platform", get: function get() { return this._config.platform; @@ -10453,7 +10459,7 @@ } return false; } - var version = "4.3.0"; + var version = "4.3.1"; var KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea']; function positionIsHorizontal(position, axis) { return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x'; @@ -10530,7 +10536,7 @@ var Chart = /*#__PURE__*/function () { function Chart(item, userConfig) { var _this12 = this; - _classCallCheck$x(this, Chart); + _classCallCheck$1(this, Chart); var config = this.config = new Config(userConfig); var initialCanvas = getCanvas(item); var existingChart = getChart(initialCanvas); @@ -10585,7 +10591,7 @@ this.update(); } } - _createClass$x(Chart, [{ + _createClass$1(Chart, [{ key: "aspectRatio", get: function get() { var _this$options12 = this.options, @@ -11536,12 +11542,12 @@ }]); return Chart; }(); - _defineProperty$w(Chart, "defaults", defaults); - _defineProperty$w(Chart, "instances", instances); - _defineProperty$w(Chart, "overrides", overrides); - _defineProperty$w(Chart, "registry", registry); - _defineProperty$w(Chart, "version", version); - _defineProperty$w(Chart, "getChart", getChart); + _defineProperty$1(Chart, "defaults", defaults); + _defineProperty$1(Chart, "instances", instances); + _defineProperty$1(Chart, "overrides", overrides); + _defineProperty$1(Chart, "registry", registry); + _defineProperty$1(Chart, "version", version); + _defineProperty$1(Chart, "getChart", getChart); function invalidatePlugins() { return each(Chart.instances, function (chart) { return chart._plugins.invalidate(); @@ -11762,19 +11768,19 @@ } } var ArcElement = /*#__PURE__*/function (_Element2) { - _inherits$w(ArcElement, _Element2); - var _super12 = _createSuper$w(ArcElement); + _inherits$1(ArcElement, _Element2); + var _super12 = _createSuper$1(ArcElement); function ArcElement(cfg) { var _this23; - _classCallCheck$x(this, ArcElement); + _classCallCheck$1(this, ArcElement); _this23 = _super12.call(this); - _defineProperty$w(_assertThisInitialized$w(_this23), "circumference", void 0); - _defineProperty$w(_assertThisInitialized$w(_this23), "endAngle", void 0); - _defineProperty$w(_assertThisInitialized$w(_this23), "fullCircles", void 0); - _defineProperty$w(_assertThisInitialized$w(_this23), "innerRadius", void 0); - _defineProperty$w(_assertThisInitialized$w(_this23), "outerRadius", void 0); - _defineProperty$w(_assertThisInitialized$w(_this23), "pixelMargin", void 0); - _defineProperty$w(_assertThisInitialized$w(_this23), "startAngle", void 0); + _defineProperty$1(_assertThisInitialized$1(_this23), "circumference", void 0); + _defineProperty$1(_assertThisInitialized$1(_this23), "endAngle", void 0); + _defineProperty$1(_assertThisInitialized$1(_this23), "fullCircles", void 0); + _defineProperty$1(_assertThisInitialized$1(_this23), "innerRadius", void 0); + _defineProperty$1(_assertThisInitialized$1(_this23), "outerRadius", void 0); + _defineProperty$1(_assertThisInitialized$1(_this23), "pixelMargin", void 0); + _defineProperty$1(_assertThisInitialized$1(_this23), "startAngle", void 0); _this23.options = undefined; _this23.circumference = undefined; _this23.startAngle = undefined; @@ -11784,11 +11790,11 @@ _this23.pixelMargin = 0; _this23.fullCircles = 0; if (cfg) { - Object.assign(_assertThisInitialized$w(_this23), cfg); + Object.assign(_assertThisInitialized$1(_this23), cfg); } return _this23; } - _createClass$x(ArcElement, [{ + _createClass$1(ArcElement, [{ key: "inRange", value: function inRange(chartX, chartY, useFinalPosition) { var point = this.getProps(['x', 'y'], useFinalPosition); @@ -11862,8 +11868,8 @@ }]); return ArcElement; }(Element); - _defineProperty$w(ArcElement, "id", 'arc'); - _defineProperty$w(ArcElement, "defaults", { + _defineProperty$1(ArcElement, "id", 'arc'); + _defineProperty$1(ArcElement, "defaults", { borderAlign: 'center', borderColor: '#fff', borderDash: [], @@ -11876,10 +11882,10 @@ angle: undefined, circular: true }); - _defineProperty$w(ArcElement, "defaultRoutes", { + _defineProperty$1(ArcElement, "defaultRoutes", { backgroundColor: 'backgroundColor' }); - _defineProperty$w(ArcElement, "descriptors", { + _defineProperty$1(ArcElement, "descriptors", { _scriptable: true, _indexable: function _indexable(name) { return name !== 'borderDash'; @@ -12070,11 +12076,11 @@ } } var LineElement = /*#__PURE__*/function (_Element3) { - _inherits$w(LineElement, _Element3); - var _super13 = _createSuper$w(LineElement); + _inherits$1(LineElement, _Element3); + var _super13 = _createSuper$1(LineElement); function LineElement(cfg) { var _this24; - _classCallCheck$x(this, LineElement); + _classCallCheck$1(this, LineElement); _this24 = _super13.call(this); _this24.animated = true; _this24.options = undefined; @@ -12088,11 +12094,11 @@ _this24._pointsUpdated = false; _this24._datasetIndex = undefined; if (cfg) { - Object.assign(_assertThisInitialized$w(_this24), cfg); + Object.assign(_assertThisInitialized$1(_this24), cfg); } return _this24; } - _createClass$x(LineElement, [{ + _createClass$1(LineElement, [{ key: "updateControlPoints", value: function updateControlPoints(chartArea, indexAxis) { var options = this.options; @@ -12216,8 +12222,8 @@ }]); return LineElement; }(Element); - _defineProperty$w(LineElement, "id", 'line'); - _defineProperty$w(LineElement, "defaults", { + _defineProperty$1(LineElement, "id", 'line'); + _defineProperty$1(LineElement, "defaults", { borderCapStyle: 'butt', borderDash: [], borderDashOffset: 0, @@ -12230,11 +12236,11 @@ stepped: false, tension: 0 }); - _defineProperty$w(LineElement, "defaultRoutes", { + _defineProperty$1(LineElement, "defaultRoutes", { backgroundColor: 'backgroundColor', borderColor: 'borderColor' }); - _defineProperty$w(LineElement, "descriptors", { + _defineProperty$1(LineElement, "descriptors", { _scriptable: true, _indexable: function _indexable(name) { return name !== 'borderDash' && name !== 'fill'; @@ -12247,25 +12253,25 @@ return Math.abs(pos - value) < options.radius + options.hitRadius; } var PointElement = /*#__PURE__*/function (_Element4) { - _inherits$w(PointElement, _Element4); - var _super14 = _createSuper$w(PointElement); + _inherits$1(PointElement, _Element4); + var _super14 = _createSuper$1(PointElement); function PointElement(cfg) { var _this25; - _classCallCheck$x(this, PointElement); + _classCallCheck$1(this, PointElement); _this25 = _super14.call(this); - _defineProperty$w(_assertThisInitialized$w(_this25), "parsed", void 0); - _defineProperty$w(_assertThisInitialized$w(_this25), "skip", void 0); - _defineProperty$w(_assertThisInitialized$w(_this25), "stop", void 0); + _defineProperty$1(_assertThisInitialized$1(_this25), "parsed", void 0); + _defineProperty$1(_assertThisInitialized$1(_this25), "skip", void 0); + _defineProperty$1(_assertThisInitialized$1(_this25), "stop", void 0); _this25.options = undefined; _this25.parsed = undefined; _this25.skip = undefined; _this25.stop = undefined; if (cfg) { - Object.assign(_assertThisInitialized$w(_this25), cfg); + Object.assign(_assertThisInitialized$1(_this25), cfg); } return _this25; } - _createClass$x(PointElement, [{ + _createClass$1(PointElement, [{ key: "inRange", value: function inRange(mouseX, mouseY, useFinalPosition) { var options = this.options; @@ -12326,11 +12332,11 @@ }]); return PointElement; }(Element); - _defineProperty$w(PointElement, "id", 'point'); + _defineProperty$1(PointElement, "id", 'point'); /** * @type {any} */ - _defineProperty$w(PointElement, "defaults", { + _defineProperty$1(PointElement, "defaults", { borderWidth: 1, hitRadius: 1, hoverBorderWidth: 1, @@ -12342,7 +12348,7 @@ /** * @type {any} */ - _defineProperty$w(PointElement, "defaultRoutes", { + _defineProperty$1(PointElement, "defaultRoutes", { backgroundColor: 'backgroundColor', borderColor: 'borderColor' }); @@ -12459,11 +12465,11 @@ }; } var BarElement = /*#__PURE__*/function (_Element5) { - _inherits$w(BarElement, _Element5); - var _super15 = _createSuper$w(BarElement); + _inherits$1(BarElement, _Element5); + var _super15 = _createSuper$1(BarElement); function BarElement(cfg) { var _this26; - _classCallCheck$x(this, BarElement); + _classCallCheck$1(this, BarElement); _this26 = _super15.call(this); _this26.options = undefined; _this26.horizontal = undefined; @@ -12472,11 +12478,11 @@ _this26.height = undefined; _this26.inflateAmount = undefined; if (cfg) { - Object.assign(_assertThisInitialized$w(_this26), cfg); + Object.assign(_assertThisInitialized$1(_this26), cfg); } return _this26; } - _createClass$x(BarElement, [{ + _createClass$1(BarElement, [{ key: "draw", value: function draw(ctx) { var inflateAmount = this.inflateAmount, @@ -12538,15 +12544,15 @@ }]); return BarElement; }(Element); - _defineProperty$w(BarElement, "id", 'bar'); - _defineProperty$w(BarElement, "defaults", { + _defineProperty$1(BarElement, "id", 'bar'); + _defineProperty$1(BarElement, "defaults", { borderSkipped: 'start', borderWidth: 0, borderRadius: 0, inflateAmount: 'auto', pointStyle: undefined }); - _defineProperty$w(BarElement, "defaultRoutes", { + _defineProperty$1(BarElement, "defaultRoutes", { backgroundColor: 'backgroundColor', borderColor: 'borderColor' }); @@ -12878,8 +12884,8 @@ parts.push({ source: fillSource, target: tgt, - start: _defineProperty$w({}, property, _getEdge(bounds, subBounds, 'start', Math.max)), - end: _defineProperty$w({}, property, _getEdge(bounds, subBounds, 'end', Math.min)) + start: _defineProperty$1({}, property, _getEdge(bounds, subBounds, 'start', Math.max)), + end: _defineProperty$1({}, property, _getEdge(bounds, subBounds, 'end', Math.min)) }); } } catch (err) { @@ -13161,12 +13167,12 @@ } var simpleArc = /*#__PURE__*/function () { function simpleArc(opts) { - _classCallCheck$x(this, simpleArc); + _classCallCheck$1(this, simpleArc); this.x = opts.x; this.y = opts.y; this.radius = opts.radius; } - _createClass$x(simpleArc, [{ + _createClass$1(simpleArc, [{ key: "pathSegment", value: function pathSegment(ctx, bounds, opts) { var x = this.x, @@ -13521,11 +13527,11 @@ return a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index; }; var Legend = /*#__PURE__*/function (_Element6) { - _inherits$w(Legend, _Element6); - var _super16 = _createSuper$w(Legend); + _inherits$1(Legend, _Element6); + var _super16 = _createSuper$1(Legend); function Legend(config) { var _this27; - _classCallCheck$x(this, Legend); + _classCallCheck$1(this, Legend); _this27 = _super16.call(this); _this27._added = false; _this27.legendHitBoxes = []; @@ -13551,7 +13557,7 @@ _this27.fullSize = undefined; return _this27; } - _createClass$x(Legend, [{ + _createClass$1(Legend, [{ key: "update", value: function update(maxWidth, maxHeight, margins) { this.maxWidth = maxWidth; @@ -13899,7 +13905,7 @@ cursor.x += width + padding; } else if (typeof legendItem.text !== 'string') { var fontLineHeight = labelFont.lineHeight; - cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight); + cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding; } else { cursor.y += lineHeight; } @@ -14015,7 +14021,7 @@ return itemHeight; } function calculateLegendItemHeight(legendItem, fontLineHeight) { - var labelHeight = legendItem.text ? legendItem.text.length + 0.5 : 0; + var labelHeight = legendItem.text ? legendItem.text.length : 0; return fontLineHeight * labelHeight; } function isListened(type, opts) { @@ -14137,11 +14143,11 @@ } }; var Title = /*#__PURE__*/function (_Element7) { - _inherits$w(Title, _Element7); - var _super17 = _createSuper$w(Title); + _inherits$1(Title, _Element7); + var _super17 = _createSuper$1(Title); function Title(config) { var _this30; - _classCallCheck$x(this, Title); + _classCallCheck$1(this, Title); _this30 = _super17.call(this); _this30.chart = config.chart; _this30.options = config.options; @@ -14158,7 +14164,7 @@ _this30.fullSize = undefined; return _this30; } - _createClass$x(Title, [{ + _createClass$1(Title, [{ key: "update", value: function update(maxWidth, maxHeight) { var opts = this.options; @@ -14668,11 +14674,11 @@ return result; } var Tooltip = /*#__PURE__*/function (_Element8) { - _inherits$w(Tooltip, _Element8); - var _super18 = _createSuper$w(Tooltip); + _inherits$1(Tooltip, _Element8); + var _super18 = _createSuper$1(Tooltip); function Tooltip(config) { var _this31; - _classCallCheck$x(this, Tooltip); + _classCallCheck$1(this, Tooltip); _this31 = _super18.call(this); _this31.opacity = 0; _this31._active = []; @@ -14703,7 +14709,7 @@ _this31.labelTextColors = undefined; return _this31; } - _createClass$x(Tooltip, [{ + _createClass$1(Tooltip, [{ key: "initialize", value: function initialize(options) { this.options = options; @@ -15299,7 +15305,7 @@ }]); return Tooltip; }(Element); - _defineProperty$w(Tooltip, "positioners", positioners); + _defineProperty$1(Tooltip, "positioners", positioners); var plugin_tooltip = { id: 'tooltip', _element: Tooltip, @@ -15463,18 +15469,18 @@ return value; } var CategoryScale = /*#__PURE__*/function (_Scale) { - _inherits$w(CategoryScale, _Scale); - var _super19 = _createSuper$w(CategoryScale); + _inherits$1(CategoryScale, _Scale); + var _super19 = _createSuper$1(CategoryScale); function CategoryScale(cfg) { var _this35; - _classCallCheck$x(this, CategoryScale); + _classCallCheck$1(this, CategoryScale); _this35 = _super19.call(this, cfg); _this35._startValue = undefined; _this35._valueRange = 0; _this35._addedLabels = []; return _this35; } - _createClass$x(CategoryScale, [{ + _createClass$1(CategoryScale, [{ key: "init", value: function init(scaleOptions) { var added = this._addedLabels; @@ -15498,7 +15504,7 @@ } this._addedLabels = []; } - _get(_getPrototypeOf$w(CategoryScale.prototype), "init", this).call(this, scaleOptions); + _get(_getPrototypeOf$1(CategoryScale.prototype), "init", this).call(this, scaleOptions); } }, { key: "parse", @@ -15556,7 +15562,7 @@ }, { key: "configure", value: function configure() { - _get(_getPrototypeOf$w(CategoryScale.prototype), "configure", this).call(this); + _get(_getPrototypeOf$1(CategoryScale.prototype), "configure", this).call(this); if (!this.isHorizontal()) { this._reversePixels = !this._reversePixels; } @@ -15591,8 +15597,8 @@ }]); return CategoryScale; }(Scale); - _defineProperty$w(CategoryScale, "id", 'category'); - _defineProperty$w(CategoryScale, "defaults", { + _defineProperty$1(CategoryScale, "id", 'category'); + _defineProperty$1(CategoryScale, "defaults", { ticks: { callback: _getLabelForValue } @@ -15712,11 +15718,11 @@ return Math.min(minSpacing / ratio, length); } var LinearScaleBase = /*#__PURE__*/function (_Scale2) { - _inherits$w(LinearScaleBase, _Scale2); - var _super20 = _createSuper$w(LinearScaleBase); + _inherits$1(LinearScaleBase, _Scale2); + var _super20 = _createSuper$1(LinearScaleBase); function LinearScaleBase(cfg) { var _this36; - _classCallCheck$x(this, LinearScaleBase); + _classCallCheck$1(this, LinearScaleBase); _this36 = _super20.call(this, cfg); _this36.start = undefined; _this36.end = undefined; @@ -15725,7 +15731,7 @@ _this36._valueRange = 0; return _this36; } - _createClass$x(LinearScaleBase, [{ + _createClass$1(LinearScaleBase, [{ key: "parse", value: function parse(raw, index) { if (isNullOrUndef(raw)) { @@ -15838,7 +15844,7 @@ var ticks = this.ticks; var start = this.min; var end = this.max; - _get(_getPrototypeOf$w(LinearScaleBase.prototype), "configure", this).call(this); + _get(_getPrototypeOf$1(LinearScaleBase.prototype), "configure", this).call(this); if (this.options.offset && ticks.length) { var offset = (end - start) / Math.max(ticks.length - 1, 1) / 2; start -= offset; @@ -15857,13 +15863,13 @@ return LinearScaleBase; }(Scale); var LinearScale = /*#__PURE__*/function (_LinearScaleBase) { - _inherits$w(LinearScale, _LinearScaleBase); - var _super21 = _createSuper$w(LinearScale); + _inherits$1(LinearScale, _LinearScaleBase); + var _super21 = _createSuper$1(LinearScale); function LinearScale() { - _classCallCheck$x(this, LinearScale); + _classCallCheck$1(this, LinearScale); return _super21.apply(this, arguments); } - _createClass$x(LinearScale, [{ + _createClass$1(LinearScale, [{ key: "determineDataLimits", value: function determineDataLimits() { var _this$getMinMax2 = this.getMinMax(true), @@ -15896,8 +15902,8 @@ }]); return LinearScale; }(LinearScaleBase); - _defineProperty$w(LinearScale, "id", 'linear'); - _defineProperty$w(LinearScale, "defaults", { + _defineProperty$1(LinearScale, "id", 'linear'); + _defineProperty$1(LinearScale, "defaults", { ticks: { callback: Ticks.formatters.numeric } @@ -15970,11 +15976,11 @@ return ticks; } var LogarithmicScale = /*#__PURE__*/function (_Scale3) { - _inherits$w(LogarithmicScale, _Scale3); - var _super22 = _createSuper$w(LogarithmicScale); + _inherits$1(LogarithmicScale, _Scale3); + var _super22 = _createSuper$1(LogarithmicScale); function LogarithmicScale(cfg) { var _this37; - _classCallCheck$x(this, LogarithmicScale); + _classCallCheck$1(this, LogarithmicScale); _this37 = _super22.call(this, cfg); _this37.start = undefined; _this37.end = undefined; @@ -15982,7 +15988,7 @@ _this37._valueRange = 0; return _this37; } - _createClass$x(LogarithmicScale, [{ + _createClass$1(LogarithmicScale, [{ key: "parse", value: function parse(raw, index) { var value = LinearScaleBase.prototype.parse.apply(this, [raw, index]); @@ -16071,7 +16077,7 @@ key: "configure", value: function configure() { var start = this.min; - _get(_getPrototypeOf$w(LogarithmicScale.prototype), "configure", this).call(this); + _get(_getPrototypeOf$1(LogarithmicScale.prototype), "configure", this).call(this); this._startValue = log10(start); this._valueRange = log10(this.max) - log10(start); } @@ -16095,8 +16101,8 @@ }]); return LogarithmicScale; }(Scale); - _defineProperty$w(LogarithmicScale, "id", 'logarithmic'); - _defineProperty$w(LogarithmicScale, "defaults", { + _defineProperty$1(LogarithmicScale, "id", 'logarithmic'); + _defineProperty$1(LogarithmicScale, "defaults", { ticks: { callback: Ticks.formatters.logarithmic, major: { @@ -16372,11 +16378,11 @@ }); } var RadialLinearScale = /*#__PURE__*/function (_LinearScaleBase2) { - _inherits$w(RadialLinearScale, _LinearScaleBase2); - var _super23 = _createSuper$w(RadialLinearScale); + _inherits$1(RadialLinearScale, _LinearScaleBase2); + var _super23 = _createSuper$1(RadialLinearScale); function RadialLinearScale(cfg) { var _this38; - _classCallCheck$x(this, RadialLinearScale); + _classCallCheck$1(this, RadialLinearScale); _this38 = _super23.call(this, cfg); _this38.xCenter = undefined; _this38.yCenter = undefined; @@ -16385,7 +16391,7 @@ _this38._pointLabelItems = []; return _this38; } - _createClass$x(RadialLinearScale, [{ + _createClass$1(RadialLinearScale, [{ key: "setDimensions", value: function setDimensions() { var padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2); @@ -16612,7 +16618,9 @@ ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height); } renderText(ctx, tick.label, 0, -offset, tickFont, { - color: optsAtIndex.color + color: optsAtIndex.color, + strokeColor: optsAtIndex.textStrokeColor, + strokeWidth: optsAtIndex.textStrokeWidth }); }); ctx.restore(); @@ -16623,8 +16631,8 @@ }]); return RadialLinearScale; }(LinearScaleBase); - _defineProperty$w(RadialLinearScale, "id", 'radialLinear'); - _defineProperty$w(RadialLinearScale, "defaults", { + _defineProperty$1(RadialLinearScale, "id", 'radialLinear'); + _defineProperty$1(RadialLinearScale, "defaults", { display: true, animate: true, position: 'chartArea', @@ -16656,12 +16664,12 @@ centerPointLabels: false } }); - _defineProperty$w(RadialLinearScale, "defaultRoutes", { + _defineProperty$1(RadialLinearScale, "defaultRoutes", { 'angleLines.color': 'borderColor', 'pointLabels.color': 'color', 'ticks.color': 'color' }); - _defineProperty$w(RadialLinearScale, "descriptors", { + _defineProperty$1(RadialLinearScale, "descriptors", { angleLines: { _fallback: 'grid' } @@ -16807,11 +16815,11 @@ return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit); } var TimeScale = /*#__PURE__*/function (_Scale4) { - _inherits$w(TimeScale, _Scale4); - var _super24 = _createSuper$w(TimeScale); + _inherits$1(TimeScale, _Scale4); + var _super24 = _createSuper$1(TimeScale); function TimeScale(props) { var _this42; - _classCallCheck$x(this, TimeScale); + _classCallCheck$1(this, TimeScale); _this42 = _super24.call(this, props); _this42._cache = { data: [], @@ -16825,7 +16833,7 @@ _this42._parseOpts = undefined; return _this42; } - _createClass$x(TimeScale, [{ + _createClass$1(TimeScale, [{ key: "init", value: function init(scaleOpts) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -16838,7 +16846,7 @@ round: time.round, isoWeekday: time.isoWeekday }; - _get(_getPrototypeOf$w(TimeScale.prototype), "init", this).call(this, scaleOpts); + _get(_getPrototypeOf$1(TimeScale.prototype), "init", this).call(this, scaleOpts); this._normalized = opts.normalized; } }, { @@ -16852,7 +16860,7 @@ }, { key: "beforeLayout", value: function beforeLayout() { - _get(_getPrototypeOf$w(TimeScale.prototype), "beforeLayout", this).call(this); + _get(_getPrototypeOf$1(TimeScale.prototype), "beforeLayout", this).call(this); this._cache = { data: [], labels: [], @@ -16994,9 +17002,7 @@ if (time === max || options.bounds === 'ticks' || count === 1) { addTick(ticks, time, timestamps); } - return Object.keys(ticks).sort(function (a, b) { - return a - b; - }).map(function (x) { + return Object.keys(ticks).sort(sorter).map(function (x) { return +x; }); } @@ -17128,8 +17134,8 @@ }]); return TimeScale; }(Scale); - _defineProperty$w(TimeScale, "id", 'time'); - _defineProperty$w(TimeScale, "defaults", { + _defineProperty$1(TimeScale, "id", 'time'); + _defineProperty$1(TimeScale, "defaults", { bounds: 'data', adapters: {}, time: { @@ -17181,25 +17187,25 @@ return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget; } var TimeSeriesScale = /*#__PURE__*/function (_TimeScale) { - _inherits$w(TimeSeriesScale, _TimeScale); - var _super25 = _createSuper$w(TimeSeriesScale); + _inherits$1(TimeSeriesScale, _TimeScale); + var _super25 = _createSuper$1(TimeSeriesScale); function TimeSeriesScale(props) { var _this43; - _classCallCheck$x(this, TimeSeriesScale); + _classCallCheck$1(this, TimeSeriesScale); _this43 = _super25.call(this, props); _this43._table = []; _this43._minPos = undefined; _this43._tableRange = undefined; return _this43; } - _createClass$x(TimeSeriesScale, [{ + _createClass$1(TimeSeriesScale, [{ key: "initOffsets", value: function initOffsets() { var timestamps = this._getTimestampsForTable(); var table = this._table = this.buildLookupTable(timestamps); this._minPos = interpolate(table, this.min); this._tableRange = interpolate(table, this.max) - this._minPos; - _get(_getPrototypeOf$w(TimeSeriesScale.prototype), "initOffsets", this).call(this, timestamps); + _get(_getPrototypeOf$1(TimeSeriesScale.prototype), "initOffsets", this).call(this, timestamps); } }, { key: "buildLookupTable", @@ -17237,6 +17243,22 @@ } return table; } + }, { + key: "_generate", + value: function _generate() { + var min = this.min; + var max = this.max; + var timestamps = _get(_getPrototypeOf$1(TimeSeriesScale.prototype), "getDataTimestamps", this).call(this); + if (!timestamps.includes(min) || !timestamps.length) { + timestamps.splice(0, 0, min); + } + if (!timestamps.includes(max) || timestamps.length === 1) { + timestamps.push(max); + } + return timestamps.sort(function (a, b) { + return a - b; + }); + } }, { key: "_getTimestampsForTable", value: function _getTimestampsForTable() { @@ -17269,8 +17291,8 @@ }]); return TimeSeriesScale; }(TimeScale); - _defineProperty$w(TimeSeriesScale, "id", 'timeseries'); - _defineProperty$w(TimeSeriesScale, "defaults", TimeScale.defaults); + _defineProperty$1(TimeSeriesScale, "id", 'timeseries'); + _defineProperty$1(TimeSeriesScale, "defaults", TimeScale.defaults); var scales = /*#__PURE__*/Object.freeze({ __proto__: null, CategoryScale: CategoryScale, @@ -17409,6 +17431,16 @@ valueOrDefault: valueOrDefault }); + function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); + } + function toInteger(dirtyNumber) { if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) { return NaN; @@ -17426,20 +17458,6 @@ } } - function _typeof$y(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$y = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$y = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$y(obj); - } /** * @name toDate * @category Common Helpers @@ -17470,12 +17488,12 @@ * const result = toDate(1392098430000) * //=> Tue Feb 11 2014 11:30:30 */ - function toDate(argument) { requiredArgs(1, arguments); - var argStr = Object.prototype.toString.call(argument); // Clone the date + var argStr = Object.prototype.toString.call(argument); - if (argument instanceof Date || _typeof$y(argument) === 'object' && argStr === '[object Date]') { + // Clone the date + if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') { // Prevent the date to lose the milliseconds when passed to new Date() in IE10 return new Date(argument.getTime()); } else if (typeof argument === 'number' || argStr === '[object Number]') { @@ -17483,8 +17501,8 @@ } else { if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') { // eslint-disable-next-line no-console - console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console - + console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); + // eslint-disable-next-line no-console console.warn(new Error().stack); } return new Date(NaN); @@ -17509,7 +17527,6 @@ * const result = addDays(new Date(2014, 8, 1), 10) * //=> Thu Sep 11 2014 00:00:00 */ - function addDays(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var date = toDate(dirtyDate); @@ -17543,7 +17560,6 @@ * const result = addMonths(new Date(2014, 8, 1), 5) * //=> Sun Feb 01 2015 00:00:00 */ - function addMonths(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var date = toDate(dirtyDate); @@ -17555,7 +17571,9 @@ // If 0 months, no-op to avoid changing times in the hour before end of DST return date; } - var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for + var dayOfMonth = date.getDate(); + + // The JS Date object supports date math by accepting out-of-bounds values for // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we // want except that dates will wrap around the end of a month, meaning that @@ -17563,7 +17581,6 @@ // we'll default to the end of the desired month by adding 1 to the desired // month and using a date of 0 to back up one day to the end of the desired // month. - var endOfDesiredMonth = new Date(date.getTime()); endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0); var daysInMonth = endOfDesiredMonth.getDate(); @@ -17602,7 +17619,6 @@ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) * //=> Thu Jul 10 2014 12:45:30.750 */ - function addMilliseconds(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var timestamp = toDate(dirtyDate).getTime(); @@ -17611,6 +17627,7 @@ } var MILLISECONDS_IN_HOUR = 3600000; + /** * @name addHours * @category Hour Helpers @@ -17629,7 +17646,6 @@ * const result = addHours(new Date(2014, 6, 10, 23, 0), 2) * //=> Fri Jul 11 2014 01:00:00 */ - function addHours(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var amount = toInteger(dirtyAmount); @@ -17668,13 +17684,13 @@ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) * //=> Mon Sep 01 2014 00:00:00 */ - function startOfWeek(dirtyDate, options) { var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; requiredArgs(1, arguments); var defaultOptions = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } @@ -17721,7 +17737,6 @@ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 00:00:00 */ - function startOfDay(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -17730,6 +17745,7 @@ } var MILLISECONDS_IN_DAY$1 = 86400000; + /** * @name differenceInCalendarDays * @category Day Helpers @@ -17760,20 +17776,21 @@ * ) * //=> 1 */ - function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) { requiredArgs(2, arguments); var startOfDayLeft = startOfDay(dirtyDateLeft); var startOfDayRight = startOfDay(dirtyDateRight); var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft); - var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); // Round the number of days to the nearest integer + var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); + + // Round the number of days to the nearest integer // because the number of milliseconds in a day is not constant // (e.g. it's different in the day of the daylight saving time clock shift) - return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY$1); } var MILLISECONDS_IN_MINUTE = 60000; + /** * @name addMinutes * @category Minute Helpers @@ -17792,7 +17809,6 @@ * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) * //=> Thu Jul 10 2014 12:30:00 */ - function addMinutes(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var amount = toInteger(dirtyAmount); @@ -17817,7 +17833,6 @@ * const result = addQuarters(new Date(2014, 8, 1), 1) * //=> Mon Dec 01 2014 00:00:00 */ - function addQuarters(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var amount = toInteger(dirtyAmount); @@ -17843,7 +17858,6 @@ * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) * //=> Thu Jul 10 2014 12:45:30 */ - function addSeconds(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var amount = toInteger(dirtyAmount); @@ -17868,7 +17882,6 @@ * const result = addWeeks(new Date(2014, 8, 1), 4) * //=> Mon Sep 29 2014 00:00:00 */ - function addWeeks(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var amount = toInteger(dirtyAmount); @@ -17894,7 +17907,6 @@ * const result = addYears(new Date(2014, 8, 1), 5) * //=> Sun Sep 01 2019 00:00:00 */ - function addYears(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var amount = toInteger(dirtyAmount); @@ -17933,7 +17945,6 @@ * // Sun Jul 02 1995 00:00:00 * // ] */ - function compareAsc(dirtyDateLeft, dirtyDateRight) { requiredArgs(2, arguments); var dateLeft = toDate(dirtyDateLeft); @@ -17942,7 +17953,8 @@ if (diff < 0) { return -1; } else if (diff > 0) { - return 1; // Return 0 if diff is 0; return NaN if diff is NaN + return 1; + // Return 0 if diff is 0; return NaN if diff is NaN } else { return diff; } @@ -17956,6 +17968,7 @@ * @type {number} * @default */ + /** * Milliseconds in 1 minute * @@ -17964,8 +17977,8 @@ * @type {number} * @default */ - var millisecondsInMinute = 60000; + /** * Milliseconds in 1 hour * @@ -17974,8 +17987,8 @@ * @type {number} * @default */ - var millisecondsInHour = 3600000; + /** * Milliseconds in 1 second * @@ -17984,23 +17997,8 @@ * @type {number} * @default */ - var millisecondsInSecond = 1000; - function _typeof$x(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$x = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$x = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$x(obj); - } /** * @name isDate * @category Common Helpers @@ -18033,10 +18031,9 @@ * const result = isDate({}) * //=> false */ - function isDate(value) { requiredArgs(1, arguments); - return value instanceof Date || _typeof$x(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]'; + return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]'; } /** @@ -18070,7 +18067,6 @@ * const result = isValid(new Date('')) * //=> false */ - function isValid(dirtyDate) { requiredArgs(1, arguments); if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') { @@ -18101,7 +18097,6 @@ * ) * //=> 8 */ - function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) { requiredArgs(2, arguments); var dateLeft = toDate(dirtyDateLeft); @@ -18132,7 +18127,6 @@ * ) * //=> 2 */ - function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) { requiredArgs(2, arguments); var dateLeft = toDate(dirtyDateLeft); @@ -18143,17 +18137,18 @@ // for accurate equality comparisons of UTC timestamps that end up // having the same representation in local time, e.g. one hour before // DST ends vs. the instant that DST ends. - function compareLocalAsc(dateLeft, dateRight) { var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds(); if (diff < 0) { return -1; } else if (diff > 0) { - return 1; // Return 0 if diff is 0; return NaN if diff is NaN + return 1; + // Return 0 if diff is 0; return NaN if diff is NaN } else { return diff; } } + /** * @name differenceInDays * @category Day Helpers @@ -18203,19 +18198,19 @@ * ) //=> 92 */ - function differenceInDays(dirtyDateLeft, dirtyDateRight) { requiredArgs(2, arguments); var dateLeft = toDate(dirtyDateLeft); var dateRight = toDate(dirtyDateRight); var sign = compareLocalAsc(dateLeft, dateRight); var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight)); - dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full - // If so, result must be decreased by 1 in absolute value + dateLeft.setDate(dateLeft.getDate() - sign * difference); + // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full + // If so, result must be decreased by 1 in absolute value var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign); - var result = sign * (difference - isLastDayNotFull); // Prevent negative zero - + var result = sign * (difference - isLastDayNotFull); + // Prevent negative zero return result === 0 ? 0 : result; } @@ -18241,7 +18236,6 @@ * ) * //=> 1100 */ - function differenceInMilliseconds(dateLeft, dateRight) { requiredArgs(2, arguments); return toDate(dateLeft).getTime() - toDate(dateRight).getTime(); @@ -18284,7 +18278,6 @@ * ) * //=> 12 */ - function differenceInHours(dateLeft, dateRight, options) { requiredArgs(2, arguments); var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour; @@ -18322,7 +18315,6 @@ * ) * //=> -1 */ - function differenceInMinutes(dateLeft, dateRight, options) { requiredArgs(2, arguments); var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute; @@ -18347,7 +18339,6 @@ * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 23:59:59.999 */ - function endOfDay(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18373,7 +18364,6 @@ * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 23:59:59.999 */ - function endOfMonth(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18400,7 +18390,6 @@ * const result = isLastDayOfMonth(new Date(2014, 1, 28)) * //=> true */ - function isLastDayOfMonth(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18425,15 +18414,15 @@ * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31)) * //=> 7 */ - function differenceInMonths(dirtyDateLeft, dirtyDateRight) { requiredArgs(2, arguments); var dateLeft = toDate(dirtyDateLeft); var dateRight = toDate(dirtyDateRight); var sign = compareAsc(dateLeft, dateRight); var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight)); - var result; // Check for the difference of less than month + var result; + // Check for the difference of less than month if (difference < 1) { result = 0; } else { @@ -18442,17 +18431,20 @@ // to compare it with Jan dateLeft.setDate(30); } - dateLeft.setMonth(dateLeft.getMonth() - sign * difference); // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full - // If so, result must be decreased by 1 in absolute value + dateLeft.setMonth(dateLeft.getMonth() - sign * difference); - var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign; // Check for cases of one full calendar month + // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full + // If so, result must be decreased by 1 in absolute value + var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign; + // Check for cases of one full calendar month if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) { isLastMonthNotFull = false; } result = sign * (difference - Number(isLastMonthNotFull)); - } // Prevent negative zero + } + // Prevent negative zero return result === 0 ? 0 : result; } @@ -18476,7 +18468,6 @@ * const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31)) * //=> 2 */ - function differenceInQuarters(dateLeft, dateRight, options) { requiredArgs(2, arguments); var diff = differenceInMonths(dateLeft, dateRight) / 3; @@ -18507,7 +18498,6 @@ * ) * //=> 12 */ - function differenceInSeconds(dateLeft, dateRight, options) { requiredArgs(2, arguments); var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000; @@ -18555,7 +18545,6 @@ * ) * //=> 8 */ - function differenceInWeeks(dateLeft, dateRight, options) { requiredArgs(2, arguments); var diff = differenceInDays(dateLeft, dateRight) / 7; @@ -18580,22 +18569,23 @@ * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) * //=> 1 */ - function differenceInYears(dirtyDateLeft, dirtyDateRight) { requiredArgs(2, arguments); var dateLeft = toDate(dirtyDateLeft); var dateRight = toDate(dirtyDateRight); var sign = compareAsc(dateLeft, dateRight); - var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight)); // Set both dates to a valid leap year for accurate comparison when dealing - // with leap days + var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight)); + // Set both dates to a valid leap year for accurate comparison when dealing + // with leap days dateLeft.setFullYear(1584); - dateRight.setFullYear(1584); // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full - // If so, result must be decreased by 1 in absolute value + dateRight.setFullYear(1584); + // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full + // If so, result must be decreased by 1 in absolute value var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign; - var result = sign * (difference - Number(isLastYearNotFull)); // Prevent negative zero - + var result = sign * (difference - Number(isLastYearNotFull)); + // Prevent negative zero return result === 0 ? 0 : result; } @@ -18617,7 +18607,6 @@ * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:00 */ - function startOfMinute(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18643,7 +18632,6 @@ * const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Jul 01 2014 00:00:00 */ - function startOfQuarter(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18672,7 +18660,6 @@ * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Mon Sep 01 2014 00:00:00 */ - function startOfMonth(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18699,7 +18686,6 @@ * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 00)) * //=> Wed Dec 31 2014 23:59:59.999 */ - function endOfYear(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18727,7 +18713,6 @@ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) * //=> Wed Jan 01 2014 00:00:00 */ - function startOfYear(dirtyDate) { requiredArgs(1, arguments); var cleanDate = toDate(dirtyDate); @@ -18755,7 +18740,6 @@ * const result = endOfHour(new Date(2014, 8, 2, 11, 55)) * //=> Tue Sep 02 2014 11:59:59.999 */ - function endOfHour(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18794,8 +18778,9 @@ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; requiredArgs(1, arguments); var defaultOptions = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } @@ -18825,7 +18810,6 @@ * const result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:59.999 */ - function endOfMinute(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18851,7 +18835,6 @@ * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 23:59:59.999 */ - function endOfQuarter(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18880,7 +18863,6 @@ * const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:45.999 */ - function endOfSecond(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -18906,7 +18888,6 @@ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) * //=> Thu Jul 10 2014 12:45:29.250 */ - function subMilliseconds(dirtyDate, dirtyAmount) { requiredArgs(2, arguments); var amount = toInteger(dirtyAmount); @@ -18971,10 +18952,11 @@ function getUTCISOWeek(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); - var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer + var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); + + // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1; } @@ -18982,8 +18964,9 @@ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; requiredArgs(1, arguments); var defaultOptions = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } @@ -19001,8 +18984,9 @@ var date = toDate(dirtyDate); var year = date.getUTCFullYear(); var defaultOptions = getDefaultOptions(); - var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN + var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); + // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } @@ -19040,10 +19024,11 @@ function getUTCWeek(dirtyDate, options) { requiredArgs(1, arguments); var date = toDate(dirtyDate); - var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer + var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); + + // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; } @@ -19068,7 +19053,6 @@ * * Letters marked by * are not implemented but reserved by Unicode standard. */ - var formatters$2 = { // Year y: function y(date, token) { @@ -19080,8 +19064,9 @@ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 | // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | - var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript) + var signedYear = date.getUTCFullYear(); + // Returns 1 for 1 BC (which is year 0 in JavaScript) var year = signedYear > 0 ? signedYear : 1 - signedYear; return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length); }, @@ -19146,7 +19131,6 @@ evening: 'evening', night: 'night' }; - /* * | | Unit | | Unit | * |-----|--------------------------------|-----|--------------------------------| @@ -19192,6 +19176,7 @@ * - `P` is long localized date format * - `p` is long localized time format */ + var formatters = { // Era G: function G(date, token, localize) { @@ -19205,13 +19190,11 @@ width: 'abbreviated' }); // A, B - case 'GGGGG': return localize.era(era, { width: 'narrow' }); // Anno Domini, Before Christ - case 'GGGG': default: return localize.era(era, { @@ -19223,8 +19206,8 @@ y: function y(date, token, localize) { // Ordinal number if (token === 'yo') { - var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript) - + var signedYear = date.getUTCFullYear(); + // Returns 1 for 1 BC (which is year 0 in JavaScript) var year = signedYear > 0 ? signedYear : 1 - signedYear; return localize.ordinalNumber(year, { unit: 'year' @@ -19234,27 +19217,31 @@ }, // Local week-numbering year Y: function Y(date, token, localize, options) { - var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript) - - var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year + var signedWeekYear = getUTCWeekYear(date, options); + // Returns 1 for 1 BC (which is year 0 in JavaScript) + var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; + // Two digit year if (token === 'YY') { var twoDigitYear = weekYear % 100; return addLeadingZeros(twoDigitYear, 2); - } // Ordinal number + } + // Ordinal number if (token === 'Yo') { return localize.ordinalNumber(weekYear, { unit: 'year' }); - } // Padding + } + // Padding return addLeadingZeros(weekYear, token.length); }, // ISO week-numbering year R: function R(date, token) { - var isoWeekYear = getUTCISOWeekYear(date); // Padding + var isoWeekYear = getUTCISOWeekYear(date); + // Padding return addLeadingZeros(isoWeekYear, token.length); }, // Extended year. This is a single number designating the year of this calendar system. @@ -19278,31 +19265,26 @@ case 'Q': return String(quarter); // 01, 02, 03, 04 - case 'QQ': return addLeadingZeros(quarter, 2); // 1st, 2nd, 3rd, 4th - case 'Qo': return localize.ordinalNumber(quarter, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 - case 'QQQ': return localize.quarter(quarter, { width: 'abbreviated', context: 'formatting' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case 'QQQQQ': return localize.quarter(quarter, { width: 'narrow', context: 'formatting' }); // 1st quarter, 2nd quarter, ... - case 'QQQQ': default: return localize.quarter(quarter, { @@ -19319,31 +19301,26 @@ case 'q': return String(quarter); // 01, 02, 03, 04 - case 'qq': return addLeadingZeros(quarter, 2); // 1st, 2nd, 3rd, 4th - case 'qo': return localize.ordinalNumber(quarter, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 - case 'qqq': return localize.quarter(quarter, { width: 'abbreviated', context: 'standalone' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case 'qqqqq': return localize.quarter(quarter, { width: 'narrow', context: 'standalone' }); // 1st quarter, 2nd quarter, ... - case 'qqqq': default: return localize.quarter(quarter, { @@ -19360,27 +19337,23 @@ case 'MM': return formatters$3.M(date, token); // 1st, 2nd, ..., 12th - case 'Mo': return localize.ordinalNumber(month + 1, { unit: 'month' }); // Jan, Feb, ..., Dec - case 'MMM': return localize.month(month, { width: 'abbreviated', context: 'formatting' }); // J, F, ..., D - case 'MMMMM': return localize.month(month, { width: 'narrow', context: 'formatting' }); // January, February, ..., December - case 'MMMM': default: return localize.month(month, { @@ -19397,31 +19370,26 @@ case 'L': return String(month + 1); // 01, 02, ..., 12 - case 'LL': return addLeadingZeros(month + 1, 2); // 1st, 2nd, ..., 12th - case 'Lo': return localize.ordinalNumber(month + 1, { unit: 'month' }); // Jan, Feb, ..., Dec - case 'LLL': return localize.month(month, { width: 'abbreviated', context: 'standalone' }); // J, F, ..., D - case 'LLLLL': return localize.month(month, { width: 'narrow', context: 'standalone' }); // January, February, ..., December - case 'LLLL': default: return localize.month(month, { @@ -19482,21 +19450,18 @@ context: 'formatting' }); // T - case 'EEEEE': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu - case 'EEEEEE': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday - case 'EEEE': default: return localize.day(dayOfWeek, { @@ -19514,11 +19479,9 @@ case 'e': return String(localDayOfWeek); // Padded numerical value - case 'ee': return addLeadingZeros(localDayOfWeek, 2); // 1st, 2nd, ..., 7th - case 'eo': return localize.ordinalNumber(localDayOfWeek, { unit: 'day' @@ -19529,21 +19492,18 @@ context: 'formatting' }); // T - case 'eeeee': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu - case 'eeeeee': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday - case 'eeee': default: return localize.day(dayOfWeek, { @@ -19561,11 +19521,9 @@ case 'c': return String(localDayOfWeek); // Padded numerical value - case 'cc': return addLeadingZeros(localDayOfWeek, token.length); // 1st, 2nd, ..., 7th - case 'co': return localize.ordinalNumber(localDayOfWeek, { unit: 'day' @@ -19576,21 +19534,18 @@ context: 'standalone' }); // T - case 'ccccc': return localize.day(dayOfWeek, { width: 'narrow', context: 'standalone' }); // Tu - case 'cccccc': return localize.day(dayOfWeek, { width: 'short', context: 'standalone' }); // Tuesday - case 'cccc': default: return localize.day(dayOfWeek, { @@ -19608,38 +19563,32 @@ case 'i': return String(isoDayOfWeek); // 02 - case 'ii': return addLeadingZeros(isoDayOfWeek, token.length); // 2nd - case 'io': return localize.ordinalNumber(isoDayOfWeek, { unit: 'day' }); // Tue - case 'iii': return localize.day(dayOfWeek, { width: 'abbreviated', context: 'formatting' }); // T - case 'iiiii': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu - case 'iiiiii': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday - case 'iiii': default: return localize.day(dayOfWeek, { @@ -19821,21 +19770,20 @@ // Hours and optional minutes case 'X': return formatTimezoneWithOptionalMinutes(timezoneOffset); + // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XX` - case 'XXXX': case 'XX': // Hours and minutes without `:` delimiter return formatTimezone(timezoneOffset); + // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XXX` - case 'XXXXX': case 'XXX': // Hours and minutes with `:` delimiter - default: return formatTimezone(timezoneOffset, ':'); } @@ -19848,21 +19796,20 @@ // Hours and optional minutes case 'x': return formatTimezoneWithOptionalMinutes(timezoneOffset); + // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xx` - case 'xxxx': case 'xx': // Hours and minutes without `:` delimiter return formatTimezone(timezoneOffset); + // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xxx` - case 'xxxxx': case 'xxx': // Hours and minutes with `:` delimiter - default: return formatTimezone(timezoneOffset, ':'); } @@ -19878,7 +19825,6 @@ case 'OOO': return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); // Long - case 'OOOO': default: return 'GMT' + formatTimezone(timezoneOffset, ':'); @@ -19895,7 +19841,6 @@ case 'zzz': return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); // Long - case 'zzzz': default: return 'GMT' + formatTimezone(timezoneOffset, ':'); @@ -20197,8 +20142,8 @@ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth; valuesArray = args.values[_width] || args.values[_defaultWidth]; } - var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it! - + var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; + // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it! return valuesArray[index]; }; } @@ -20212,11 +20157,12 @@ narrow: ['1', '2', '3', '4'], abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'], wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] - }; // Note: in English, the names of days of the week and months are capitalized. + }; + + // Note: in English, the names of days of the week and months are capitalized. // If you are making a new locale based on this one, check if the same is true for the language you're working on. // Generally, formatted dates should look like they are in the middle of a sentence, // e.g. in Spanish language the weekdays and months should be in the lowercase. - var monthValues = { narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'], abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], @@ -20293,7 +20239,9 @@ } }; var ordinalNumber = function ordinalNumber(dirtyNumber, _options) { - var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example, + var number = Number(dirtyNumber); + + // If ordinal numbers depend on context, for example, // if they are different for different grammatical genders, // use `options.unit`. // @@ -20518,9 +20466,7 @@ localize: localize$1, match: match$1, options: { - weekStartsOn: 0 - /* Sunday */, - + weekStartsOn: 0 /* Sunday */, firstWeekContainsDate: 1 } }; @@ -20536,14 +20482,15 @@ // If there is no matching single quote // then the sequence will continue until the end of the string. // - . matches any single character unmatched by previous parts of the RegExps + var formattingTokensRegExp$1 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; - var formattingTokensRegExp$1 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also + // This RegExp catches symbols escaped by quotes, and also // sequences of symbols P, p, and the combinations like `PPPPPPPppppp` - var longFormattingTokensRegExp$1 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; var escapedStringRegExp$1 = /^'([^]*?)'?$/; var doubleQuoteRegExp$1 = /''/g; var unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/; + /** * @name format * @category Common Helpers @@ -20842,13 +20789,15 @@ var formatStr = String(dirtyFormatStr); var defaultOptions = getDefaultOptions(); var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale; - var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN + var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); + // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } - var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } @@ -20861,10 +20810,11 @@ var originalDate = toDate(dirtyDate); if (!isValid(originalDate)) { throw new RangeError('Invalid time value'); - } // Convert the date in system timezone to the same date in UTC+00:00 timezone. + } + + // Convert the date in system timezone to the same date in UTC+00:00 timezone. // This ensures that when UTC functions will be implemented, locales will be compatible with them. // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376 - var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate); var utcDate = subMilliseconds(originalDate, timezoneOffset); var formatterOptions = { @@ -20926,67 +20876,113 @@ return target; } - function _typeof$w(obj) { - "@babel/helpers - typeof"; + 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; + } - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$w = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$w = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$w(obj); + 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); } - function _inherits$v(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + + 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."); } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true + 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; + } } - }); - if (superClass) _setPrototypeOf$v(subClass, superClass); + }; + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self; } - function _setPrototypeOf$v(o, p) { - _setPrototypeOf$v = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; - return _setPrototypeOf$v(o, p); - } - function _createSuper$v(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$v(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$v(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$v(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$v(this, result); - }; + return _setPrototypeOf(o, p); } - function _possibleConstructorReturn$v(self, call) { - if (call && (_typeof$w(call) === "object" || typeof call === "function")) { - return call; + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); } - return _assertThisInitialized$v(self); + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) _setPrototypeOf(subClass, superClass); } - function _assertThisInitialized$v(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; + + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); } - function _isNativeReflectConstruct$v() { + + function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; @@ -20997,32 +20993,73 @@ return false; } } - function _getPrototypeOf$v(o) { - _getPrototypeOf$v = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); + + 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); + } + + 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); }; - return _getPrototypeOf$v(o); } - function _classCallCheck$w(instance, Constructor) { + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _defineProperties$w(target, props) { + + function _toPrimitive(input, hint) { + if (_typeof(input) !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (_typeof(res) !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return _typeof(key) === "symbol" ? key : String(key); + } + + 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); + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } - function _createClass$w(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$w(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$w(Constructor, staticProps); + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); return Constructor; } - function _defineProperty$v(obj, key, value) { + + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, @@ -21035,13 +21072,15 @@ } return obj; } + var TIMEZONE_UNIT_PRIORITY = 10; var Setter = /*#__PURE__*/function () { function Setter() { - _classCallCheck$w(this, Setter); - _defineProperty$v(this, "subPriority", 0); + _classCallCheck(this, Setter); + _defineProperty(this, "priority", void 0); + _defineProperty(this, "subPriority", 0); } - _createClass$w(Setter, [{ + _createClass(Setter, [{ key: "validate", value: function validate(_utcDate, _options) { return true; @@ -21050,11 +21089,11 @@ return Setter; }(); var ValueSetter = /*#__PURE__*/function (_Setter) { - _inherits$v(ValueSetter, _Setter); - var _super = _createSuper$v(ValueSetter); + _inherits(ValueSetter, _Setter); + var _super = _createSuper(ValueSetter); function ValueSetter(value, validateValue, setValue, priority, subPriority) { var _this; - _classCallCheck$w(this, ValueSetter); + _classCallCheck(this, ValueSetter); _this = _super.call(this); _this.value = value; _this.validateValue = validateValue; @@ -21065,7 +21104,7 @@ } return _this; } - _createClass$w(ValueSetter, [{ + _createClass(ValueSetter, [{ key: "validate", value: function validate(utcDate, options) { return this.validateValue(utcDate, this.value, options); @@ -21079,20 +21118,20 @@ return ValueSetter; }(Setter); var DateToSystemTimezoneSetter = /*#__PURE__*/function (_Setter2) { - _inherits$v(DateToSystemTimezoneSetter, _Setter2); - var _super2 = _createSuper$v(DateToSystemTimezoneSetter); + _inherits(DateToSystemTimezoneSetter, _Setter2); + var _super2 = _createSuper(DateToSystemTimezoneSetter); function DateToSystemTimezoneSetter() { var _this2; - _classCallCheck$w(this, DateToSystemTimezoneSetter); + _classCallCheck(this, DateToSystemTimezoneSetter); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this2 = _super2.call.apply(_super2, [this].concat(args)); - _defineProperty$v(_assertThisInitialized$v(_this2), "priority", TIMEZONE_UNIT_PRIORITY); - _defineProperty$v(_assertThisInitialized$v(_this2), "subPriority", -1); + _defineProperty(_assertThisInitialized(_this2), "priority", TIMEZONE_UNIT_PRIORITY); + _defineProperty(_assertThisInitialized(_this2), "subPriority", -1); return _this2; } - _createClass$w(DateToSystemTimezoneSetter, [{ + _createClass(DateToSystemTimezoneSetter, [{ key: "set", value: function set(date, flags) { if (flags.timestampIsSet) { @@ -21107,30 +21146,14 @@ return DateToSystemTimezoneSetter; }(Setter); - function _classCallCheck$v(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$v(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); - } - } - function _createClass$v(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$v(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$v(Constructor, staticProps); - return Constructor; - } var Parser = /*#__PURE__*/function () { function Parser() { - _classCallCheck$v(this, Parser); + _classCallCheck(this, Parser); + _defineProperty(this, "incompatibleTokens", void 0); + _defineProperty(this, "priority", void 0); + _defineProperty(this, "subPriority", void 0); } - _createClass$v(Parser, [{ + _createClass(Parser, [{ key: "run", value: function run(dateString, token, match, options) { var result = this.parse(dateString, token, match, options); @@ -21151,130 +21174,21 @@ return Parser; }(); - function _typeof$v(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$v = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$v = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$v(obj); - } - function _classCallCheck$u(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$u(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); - } - } - function _createClass$u(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$u(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$u(Constructor, staticProps); - return Constructor; - } - function _inherits$u(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$u(subClass, superClass); - } - function _setPrototypeOf$u(o, p) { - _setPrototypeOf$u = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$u(o, p); - } - function _createSuper$u(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$u(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$u(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$u(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$u(this, result); - }; - } - function _possibleConstructorReturn$u(self, call) { - if (call && (_typeof$v(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$u(self); - } - function _assertThisInitialized$u(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$u() { - 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; - } - } - function _getPrototypeOf$u(o) { - _getPrototypeOf$u = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$u(o); - } - function _defineProperty$u(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var EraParser = /*#__PURE__*/function (_Parser) { - _inherits$u(EraParser, _Parser); - var _super = _createSuper$u(EraParser); + _inherits(EraParser, _Parser); + var _super = _createSuper(EraParser); function EraParser() { var _this; - _classCallCheck$u(this, EraParser); + _classCallCheck(this, EraParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$u(_assertThisInitialized$u(_this), "priority", 140); - _defineProperty$u(_assertThisInitialized$u(_this), "incompatibleTokens", ['R', 'u', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 140); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['R', 'u', 't', 'T']); return _this; } - _createClass$u(EraParser, [{ + _createClass(EraParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -21288,13 +21202,11 @@ width: 'narrow' }); // A, B - case 'GGGGG': return match.era(dateString, { width: 'narrow' }); // Anno Domini, Before Christ - case 'GGGG': default: return match.era(dateString, { @@ -21339,6 +21251,7 @@ // 0 to 59 second: /^[0-5]?\d/, // 0 to 59 + singleDigit: /^\d/, // 0 to 9 twoDigits: /^\d{1,2}/, @@ -21347,6 +21260,7 @@ // 0 to 999 fourDigits: /^\d{1,4}/, // 0 to 9999 + anyDigitsSigned: /^-?\d+/, singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9 @@ -21388,8 +21302,9 @@ var matchResult = dateString.match(pattern); if (!matchResult) { return null; - } // Input is 'Z' + } + // Input is 'Z' if (matchResult[0] === 'Z') { return { value: 0, @@ -21454,11 +21369,11 @@ } } function normalizeTwoDigitYear(twoDigitYear, currentYear) { - var isCommonEra = currentYear > 0; // Absolute number of the current year: + var isCommonEra = currentYear > 0; + // Absolute number of the current year: // 1 -> 1 AC // 0 -> 1 BC // -1 -> 2 BC - var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear; var result; if (absCurrentYear <= 50) { @@ -21475,138 +21390,29 @@ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; } - function _typeof$u(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$u = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$u = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$u(obj); - } - function _classCallCheck$t(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$t(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); - } - } - function _createClass$t(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$t(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$t(Constructor, staticProps); - return Constructor; - } - function _inherits$t(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns + // | Year | y | yy | yyy | yyyy | yyyyy | + // |----------|-------|----|-------|-------|-------| + // | AD 1 | 1 | 01 | 001 | 0001 | 00001 | + // | AD 12 | 12 | 12 | 012 | 0012 | 00012 | + // | AD 123 | 123 | 23 | 123 | 0123 | 00123 | + // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | + // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | + var YearParser = /*#__PURE__*/function (_Parser) { + _inherits(YearParser, _Parser); + var _super = _createSuper(YearParser); + function YearParser() { + var _this; + _classCallCheck(this, YearParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "priority", 130); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']); + return _this; } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$t(subClass, superClass); - } - function _setPrototypeOf$t(o, p) { - _setPrototypeOf$t = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$t(o, p); - } - function _createSuper$t(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$t(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$t(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$t(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$t(this, result); - }; - } - function _possibleConstructorReturn$t(self, call) { - if (call && (_typeof$u(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$t(self); - } - function _assertThisInitialized$t(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$t() { - 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; - } - } - function _getPrototypeOf$t(o) { - _getPrototypeOf$t = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$t(o); - } - function _defineProperty$t(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns - // | Year | y | yy | yyy | yyyy | yyyyy | - // |----------|-------|----|-------|-------|-------| - // | AD 1 | 1 | 01 | 001 | 0001 | 00001 | - // | AD 12 | 12 | 12 | 012 | 0012 | 00012 | - // | AD 123 | 123 | 23 | 123 | 0123 | 00123 | - // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | - // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | - var YearParser = /*#__PURE__*/function (_Parser) { - _inherits$t(YearParser, _Parser); - var _super = _createSuper$t(YearParser); - function YearParser() { - var _this; - _classCallCheck$t(this, YearParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$t(_assertThisInitialized$t(_this), "priority", 130); - _defineProperty$t(_assertThisInitialized$t(_this), "incompatibleTokens", ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']); - return _this; - } - _createClass$t(YearParser, [{ + _createClass(YearParser, [{ key: "parse", value: function parse(dateString, token, match) { var valueCallback = function valueCallback(year) { @@ -21650,131 +21456,22 @@ return YearParser; }(Parser); - function _typeof$t(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$t = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$t = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$t(obj); - } - function _classCallCheck$s(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$s(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); - } - } - function _createClass$s(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$s(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$s(Constructor, staticProps); - return Constructor; - } - function _inherits$s(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$s(subClass, superClass); - } - function _setPrototypeOf$s(o, p) { - _setPrototypeOf$s = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$s(o, p); - } - function _createSuper$s(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$s(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$s(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$s(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$s(this, result); - }; - } - function _possibleConstructorReturn$s(self, call) { - if (call && (_typeof$t(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$s(self); - } - function _assertThisInitialized$s(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$s() { - 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; - } - } - function _getPrototypeOf$s(o) { - _getPrototypeOf$s = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$s(o); - } - function _defineProperty$s(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } // Local week-numbering year var LocalWeekYearParser = /*#__PURE__*/function (_Parser) { - _inherits$s(LocalWeekYearParser, _Parser); - var _super = _createSuper$s(LocalWeekYearParser); + _inherits(LocalWeekYearParser, _Parser); + var _super = _createSuper(LocalWeekYearParser); function LocalWeekYearParser() { var _this; - _classCallCheck$s(this, LocalWeekYearParser); + _classCallCheck(this, LocalWeekYearParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$s(_assertThisInitialized$s(_this), "priority", 130); - _defineProperty$s(_assertThisInitialized$s(_this), "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 130); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']); return _this; } - _createClass$s(LocalWeekYearParser, [{ + _createClass(LocalWeekYearParser, [{ key: "parse", value: function parse(dateString, token, match) { var valueCallback = function valueCallback(year) { @@ -21818,131 +21515,21 @@ return LocalWeekYearParser; }(Parser); - function _typeof$s(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$s = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$s = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$s(obj); - } - function _classCallCheck$r(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$r(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); - } - } - function _createClass$r(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$r(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$r(Constructor, staticProps); - return Constructor; - } - function _inherits$r(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$r(subClass, superClass); - } - function _setPrototypeOf$r(o, p) { - _setPrototypeOf$r = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$r(o, p); - } - function _createSuper$r(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$r(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$r(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$r(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$r(this, result); - }; - } - function _possibleConstructorReturn$r(self, call) { - if (call && (_typeof$s(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$r(self); - } - function _assertThisInitialized$r(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$r() { - 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; - } - } - function _getPrototypeOf$r(o) { - _getPrototypeOf$r = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$r(o); - } - function _defineProperty$r(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var ISOWeekYearParser = /*#__PURE__*/function (_Parser) { - _inherits$r(ISOWeekYearParser, _Parser); - var _super = _createSuper$r(ISOWeekYearParser); + _inherits(ISOWeekYearParser, _Parser); + var _super = _createSuper(ISOWeekYearParser); function ISOWeekYearParser() { var _this; - _classCallCheck$r(this, ISOWeekYearParser); + _classCallCheck(this, ISOWeekYearParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$r(_assertThisInitialized$r(_this), "priority", 130); - _defineProperty$r(_assertThisInitialized$r(_this), "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 130); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']); return _this; } - _createClass$r(ISOWeekYearParser, [{ + _createClass(ISOWeekYearParser, [{ key: "parse", value: function parse(dateString, token) { if (token === 'R') { @@ -21962,130 +21549,21 @@ return ISOWeekYearParser; }(Parser); - function _typeof$r(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$r = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$r = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$r(obj); - } - function _classCallCheck$q(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$q(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); - } - } - function _createClass$q(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$q(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$q(Constructor, staticProps); - return Constructor; - } - function _inherits$q(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + var ExtendedYearParser = /*#__PURE__*/function (_Parser) { + _inherits(ExtendedYearParser, _Parser); + var _super = _createSuper(ExtendedYearParser); + function ExtendedYearParser() { + var _this; + _classCallCheck(this, ExtendedYearParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "priority", 130); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']); + return _this; } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$q(subClass, superClass); - } - function _setPrototypeOf$q(o, p) { - _setPrototypeOf$q = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$q(o, p); - } - function _createSuper$q(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$q(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$q(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$q(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$q(this, result); - }; - } - function _possibleConstructorReturn$q(self, call) { - if (call && (_typeof$r(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$q(self); - } - function _assertThisInitialized$q(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$q() { - 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; - } - } - function _getPrototypeOf$q(o) { - _getPrototypeOf$q = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$q(o); - } - function _defineProperty$q(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var ExtendedYearParser = /*#__PURE__*/function (_Parser) { - _inherits$q(ExtendedYearParser, _Parser); - var _super = _createSuper$q(ExtendedYearParser); - function ExtendedYearParser() { - var _this; - _classCallCheck$q(this, ExtendedYearParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$q(_assertThisInitialized$q(_this), "priority", 130); - _defineProperty$q(_assertThisInitialized$q(_this), "incompatibleTokens", ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']); - return _this; - } - _createClass$q(ExtendedYearParser, [{ + _createClass(ExtendedYearParser, [{ key: "parse", value: function parse(dateString, token) { if (token === 'u') { @@ -22104,130 +21582,21 @@ return ExtendedYearParser; }(Parser); - function _typeof$q(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$q = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$q = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$q(obj); - } - function _classCallCheck$p(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$p(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); - } - } - function _createClass$p(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$p(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$p(Constructor, staticProps); - return Constructor; - } - function _inherits$p(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$p(subClass, superClass); - } - function _setPrototypeOf$p(o, p) { - _setPrototypeOf$p = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$p(o, p); - } - function _createSuper$p(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$p(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$p(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$p(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$p(this, result); - }; - } - function _possibleConstructorReturn$p(self, call) { - if (call && (_typeof$q(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$p(self); - } - function _assertThisInitialized$p(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$p() { - 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; - } - } - function _getPrototypeOf$p(o) { - _getPrototypeOf$p = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$p(o); - } - function _defineProperty$p(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var QuarterParser = /*#__PURE__*/function (_Parser) { - _inherits$p(QuarterParser, _Parser); - var _super = _createSuper$p(QuarterParser); + _inherits(QuarterParser, _Parser); + var _super = _createSuper(QuarterParser); function QuarterParser() { var _this; - _classCallCheck$p(this, QuarterParser); + _classCallCheck(this, QuarterParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$p(_assertThisInitialized$p(_this), "priority", 120); - _defineProperty$p(_assertThisInitialized$p(_this), "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 120); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']); return _this; } - _createClass$p(QuarterParser, [{ + _createClass(QuarterParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -22237,13 +21606,11 @@ // 01, 02, 03, 04 return parseNDigits(token.length, dateString); // 1st, 2nd, 3rd, 4th - case 'Qo': return match.ordinalNumber(dateString, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 - case 'QQQ': return match.quarter(dateString, { width: 'abbreviated', @@ -22253,14 +21620,12 @@ context: 'formatting' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case 'QQQQQ': return match.quarter(dateString, { width: 'narrow', context: 'formatting' }); // 1st quarter, 2nd quarter, ... - case 'QQQQ': default: return match.quarter(dateString, { @@ -22291,130 +21656,21 @@ return QuarterParser; }(Parser); - function _typeof$p(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$p = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$p = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$p(obj); - } - function _classCallCheck$o(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$o(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); - } - } - function _createClass$o(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$o(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$o(Constructor, staticProps); - return Constructor; - } - function _inherits$o(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$o(subClass, superClass); - } - function _setPrototypeOf$o(o, p) { - _setPrototypeOf$o = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$o(o, p); - } - function _createSuper$o(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$o(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$o(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$o(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$o(this, result); - }; - } - function _possibleConstructorReturn$o(self, call) { - if (call && (_typeof$p(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$o(self); - } - function _assertThisInitialized$o(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$o() { - 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; - } - } - function _getPrototypeOf$o(o) { - _getPrototypeOf$o = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$o(o); - } - function _defineProperty$o(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var StandAloneQuarterParser = /*#__PURE__*/function (_Parser) { - _inherits$o(StandAloneQuarterParser, _Parser); - var _super = _createSuper$o(StandAloneQuarterParser); + _inherits(StandAloneQuarterParser, _Parser); + var _super = _createSuper(StandAloneQuarterParser); function StandAloneQuarterParser() { var _this; - _classCallCheck$o(this, StandAloneQuarterParser); + _classCallCheck(this, StandAloneQuarterParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$o(_assertThisInitialized$o(_this), "priority", 120); - _defineProperty$o(_assertThisInitialized$o(_this), "incompatibleTokens", ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 120); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']); return _this; } - _createClass$o(StandAloneQuarterParser, [{ + _createClass(StandAloneQuarterParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -22424,13 +21680,11 @@ // 01, 02, 03, 04 return parseNDigits(token.length, dateString); // 1st, 2nd, 3rd, 4th - case 'qo': return match.ordinalNumber(dateString, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 - case 'qqq': return match.quarter(dateString, { width: 'abbreviated', @@ -22440,14 +21694,12 @@ context: 'standalone' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case 'qqqqq': return match.quarter(dateString, { width: 'narrow', context: 'standalone' }); // 1st quarter, 2nd quarter, ... - case 'qqqq': default: return match.quarter(dateString, { @@ -22478,130 +21730,21 @@ return StandAloneQuarterParser; }(Parser); - function _typeof$o(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$o = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$o = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$o(obj); - } - function _classCallCheck$n(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$n(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); - } - } - function _createClass$n(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$n(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$n(Constructor, staticProps); - return Constructor; - } - function _inherits$n(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + var MonthParser = /*#__PURE__*/function (_Parser) { + _inherits(MonthParser, _Parser); + var _super = _createSuper(MonthParser); + function MonthParser() { + var _this; + _classCallCheck(this, MonthParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 110); + return _this; } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$n(subClass, superClass); - } - function _setPrototypeOf$n(o, p) { - _setPrototypeOf$n = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$n(o, p); - } - function _createSuper$n(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$n(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$n(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$n(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$n(this, result); - }; - } - function _possibleConstructorReturn$n(self, call) { - if (call && (_typeof$o(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$n(self); - } - function _assertThisInitialized$n(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$n() { - 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; - } - } - function _getPrototypeOf$n(o) { - _getPrototypeOf$n = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$n(o); - } - function _defineProperty$n(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var MonthParser = /*#__PURE__*/function (_Parser) { - _inherits$n(MonthParser, _Parser); - var _super = _createSuper$n(MonthParser); - function MonthParser() { - var _this; - _classCallCheck$n(this, MonthParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$n(_assertThisInitialized$n(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); - _defineProperty$n(_assertThisInitialized$n(_this), "priority", 110); - return _this; - } - _createClass$n(MonthParser, [{ + _createClass(MonthParser, [{ key: "parse", value: function parse(dateString, token, match) { var valueCallback = function valueCallback(value) { @@ -22612,17 +21755,14 @@ case 'M': return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback); // 01, 02, ..., 12 - case 'MM': return mapValue(parseNDigits(2, dateString), valueCallback); // 1st, 2nd, ..., 12th - case 'Mo': return mapValue(match.ordinalNumber(dateString, { unit: 'month' }), valueCallback); // Jan, Feb, ..., Dec - case 'MMM': return match.month(dateString, { width: 'abbreviated', @@ -22632,14 +21772,12 @@ context: 'formatting' }); // J, F, ..., D - case 'MMMMM': return match.month(dateString, { width: 'narrow', context: 'formatting' }); // January, February, ..., December - case 'MMMM': default: return match.month(dateString, { @@ -22670,130 +21808,21 @@ return MonthParser; }(Parser); - function _typeof$n(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$n = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$n = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$n(obj); - } - function _classCallCheck$m(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$m(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); - } - } - function _createClass$m(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$m(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$m(Constructor, staticProps); - return Constructor; - } - function _inherits$m(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$m(subClass, superClass); - } - function _setPrototypeOf$m(o, p) { - _setPrototypeOf$m = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$m(o, p); - } - function _createSuper$m(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$m(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$m(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$m(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$m(this, result); - }; - } - function _possibleConstructorReturn$m(self, call) { - if (call && (_typeof$n(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$m(self); - } - function _assertThisInitialized$m(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$m() { - 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; - } - } - function _getPrototypeOf$m(o) { - _getPrototypeOf$m = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$m(o); - } - function _defineProperty$m(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var StandAloneMonthParser = /*#__PURE__*/function (_Parser) { - _inherits$m(StandAloneMonthParser, _Parser); - var _super = _createSuper$m(StandAloneMonthParser); + _inherits(StandAloneMonthParser, _Parser); + var _super = _createSuper(StandAloneMonthParser); function StandAloneMonthParser() { var _this; - _classCallCheck$m(this, StandAloneMonthParser); + _classCallCheck(this, StandAloneMonthParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$m(_assertThisInitialized$m(_this), "priority", 110); - _defineProperty$m(_assertThisInitialized$m(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 110); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); return _this; } - _createClass$m(StandAloneMonthParser, [{ + _createClass(StandAloneMonthParser, [{ key: "parse", value: function parse(dateString, token, match) { var valueCallback = function valueCallback(value) { @@ -22804,17 +21833,14 @@ case 'L': return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback); // 01, 02, ..., 12 - case 'LL': return mapValue(parseNDigits(2, dateString), valueCallback); // 1st, 2nd, ..., 12th - case 'Lo': return mapValue(match.ordinalNumber(dateString, { unit: 'month' }), valueCallback); // Jan, Feb, ..., Dec - case 'LLL': return match.month(dateString, { width: 'abbreviated', @@ -22824,14 +21850,12 @@ context: 'standalone' }); // J, F, ..., D - case 'LLLLL': return match.month(dateString, { width: 'narrow', context: 'standalone' }); // January, February, ..., December - case 'LLLL': default: return match.month(dateString, { @@ -22871,131 +21895,21 @@ return date; } - function _typeof$m(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$m = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$m = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$m(obj); - } - function _classCallCheck$l(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$l(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); - } - } - function _createClass$l(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$l(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$l(Constructor, staticProps); - return Constructor; - } - function _inherits$l(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$l(subClass, superClass); - } - function _setPrototypeOf$l(o, p) { - _setPrototypeOf$l = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$l(o, p); - } - function _createSuper$l(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$l(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$l(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$l(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$l(this, result); - }; - } - function _possibleConstructorReturn$l(self, call) { - if (call && (_typeof$m(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$l(self); - } - function _assertThisInitialized$l(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$l() { - 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; - } - } - function _getPrototypeOf$l(o) { - _getPrototypeOf$l = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$l(o); - } - function _defineProperty$l(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var LocalWeekParser = /*#__PURE__*/function (_Parser) { - _inherits$l(LocalWeekParser, _Parser); - var _super = _createSuper$l(LocalWeekParser); + _inherits(LocalWeekParser, _Parser); + var _super = _createSuper(LocalWeekParser); function LocalWeekParser() { var _this; - _classCallCheck$l(this, LocalWeekParser); + _classCallCheck(this, LocalWeekParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$l(_assertThisInitialized$l(_this), "priority", 100); - _defineProperty$l(_assertThisInitialized$l(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 100); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']); return _this; } - _createClass$l(LocalWeekParser, [{ + _createClass(LocalWeekParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -23032,131 +21946,21 @@ return date; } - function _typeof$l(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$l = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$l = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$l(obj); - } - function _classCallCheck$k(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$k(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); + var ISOWeekParser = /*#__PURE__*/function (_Parser) { + _inherits(ISOWeekParser, _Parser); + var _super = _createSuper(ISOWeekParser); + function ISOWeekParser() { + var _this; + _classCallCheck(this, ISOWeekParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "priority", 100); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']); + return _this; } - } - function _createClass$k(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$k(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$k(Constructor, staticProps); - return Constructor; - } - function _inherits$k(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$k(subClass, superClass); - } - function _setPrototypeOf$k(o, p) { - _setPrototypeOf$k = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$k(o, p); - } - function _createSuper$k(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$k(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$k(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$k(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$k(this, result); - }; - } - function _possibleConstructorReturn$k(self, call) { - if (call && (_typeof$l(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$k(self); - } - function _assertThisInitialized$k(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$k() { - 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; - } - } - function _getPrototypeOf$k(o) { - _getPrototypeOf$k = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$k(o); - } - function _defineProperty$k(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - - var ISOWeekParser = /*#__PURE__*/function (_Parser) { - _inherits$k(ISOWeekParser, _Parser); - var _super = _createSuper$k(ISOWeekParser); - function ISOWeekParser() { - var _this; - _classCallCheck$k(this, ISOWeekParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$k(_assertThisInitialized$k(_this), "priority", 100); - _defineProperty$k(_assertThisInitialized$k(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']); - return _this; - } - _createClass$k(ISOWeekParser, [{ + _createClass(ISOWeekParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -23184,134 +21988,26 @@ return ISOWeekParser; }(Parser); - function _typeof$k(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$k = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$k = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$k(obj); - } - function _classCallCheck$j(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$j(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); - } - } - function _createClass$j(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$j(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$j(Constructor, staticProps); - return Constructor; - } - function _inherits$j(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$j(subClass, superClass); - } - function _setPrototypeOf$j(o, p) { - _setPrototypeOf$j = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$j(o, p); - } - function _createSuper$j(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$j(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$j(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$j(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$j(this, result); - }; - } - function _possibleConstructorReturn$j(self, call) { - if (call && (_typeof$k(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$j(self); - } - function _assertThisInitialized$j(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$j() { - 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; - } - } - function _getPrototypeOf$j(o) { - _getPrototypeOf$j = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$j(o); - } - function _defineProperty$j(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // Day of the month + var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + // Day of the month var DateParser = /*#__PURE__*/function (_Parser) { - _inherits$j(DateParser, _Parser); - var _super = _createSuper$j(DateParser); + _inherits(DateParser, _Parser); + var _super = _createSuper(DateParser); function DateParser() { var _this; - _classCallCheck$j(this, DateParser); + _classCallCheck(this, DateParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$j(_assertThisInitialized$j(_this), "priority", 90); - _defineProperty$j(_assertThisInitialized$j(_this), "subPriority", 1); - _defineProperty$j(_assertThisInitialized$j(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 90); + _defineProperty(_assertThisInitialized(_this), "subPriority", 1); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); return _this; } - _createClass$j(DateParser, [{ + _createClass(DateParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -23348,131 +22044,22 @@ return DateParser; }(Parser); - function _typeof$j(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$j = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$j = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$j(obj); - } - function _classCallCheck$i(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$i(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); - } - } - function _createClass$i(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$i(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$i(Constructor, staticProps); - return Constructor; - } - function _inherits$i(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$i(subClass, superClass); - } - function _setPrototypeOf$i(o, p) { - _setPrototypeOf$i = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$i(o, p); - } - function _createSuper$i(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$i(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$i(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$i(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$i(this, result); - }; - } - function _possibleConstructorReturn$i(self, call) { - if (call && (_typeof$j(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$i(self); - } - function _assertThisInitialized$i(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$i() { - 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; - } - } - function _getPrototypeOf$i(o) { - _getPrototypeOf$i = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$i(o); - } - function _defineProperty$i(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var DayOfYearParser = /*#__PURE__*/function (_Parser) { - _inherits$i(DayOfYearParser, _Parser); - var _super = _createSuper$i(DayOfYearParser); + _inherits(DayOfYearParser, _Parser); + var _super = _createSuper(DayOfYearParser); function DayOfYearParser() { var _this; - _classCallCheck$i(this, DayOfYearParser); + _classCallCheck(this, DayOfYearParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$i(_assertThisInitialized$i(_this), "priority", 90); - _defineProperty$i(_assertThisInitialized$i(_this), "subpriority", 1); - _defineProperty$i(_assertThisInitialized$i(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 90); + _defineProperty(_assertThisInitialized(_this), "subpriority", 1); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']); return _this; } - _createClass$i(DayOfYearParser, [{ + _createClass(DayOfYearParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -23513,8 +22100,9 @@ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; requiredArgs(2, arguments); var defaultOptions = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } @@ -23528,131 +22116,21 @@ return date; } - function _typeof$i(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$i = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$i = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$i(obj); - } - function _classCallCheck$h(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$h(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); - } - } - function _createClass$h(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$h(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$h(Constructor, staticProps); - return Constructor; - } - function _inherits$h(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$h(subClass, superClass); - } - function _setPrototypeOf$h(o, p) { - _setPrototypeOf$h = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$h(o, p); - } - function _createSuper$h(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$h(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$h(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$h(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$h(this, result); - }; - } - function _possibleConstructorReturn$h(self, call) { - if (call && (_typeof$i(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$h(self); - } - function _assertThisInitialized$h(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$h() { - 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; - } - } - function _getPrototypeOf$h(o) { - _getPrototypeOf$h = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$h(o); - } - function _defineProperty$h(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - - var DayParser = /*#__PURE__*/function (_Parser) { - _inherits$h(DayParser, _Parser); - var _super = _createSuper$h(DayParser); - function DayParser() { - var _this; - _classCallCheck$h(this, DayParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + var DayParser = /*#__PURE__*/function (_Parser) { + _inherits(DayParser, _Parser); + var _super = _createSuper(DayParser); + function DayParser() { + var _this; + _classCallCheck(this, DayParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$h(_assertThisInitialized$h(_this), "priority", 90); - _defineProperty$h(_assertThisInitialized$h(_this), "incompatibleTokens", ['D', 'i', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 90); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['D', 'i', 'e', 'c', 't', 'T']); return _this; } - _createClass$h(DayParser, [{ + _createClass(DayParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -23671,14 +22149,12 @@ context: 'formatting' }); // T - case 'EEEEE': return match.day(dateString, { width: 'narrow', context: 'formatting' }); // Tu - case 'EEEEEE': return match.day(dateString, { width: 'short', @@ -23688,7 +22164,6 @@ context: 'formatting' }); // Tuesday - case 'EEEE': default: return match.day(dateString, { @@ -23722,131 +22197,21 @@ return DayParser; }(Parser); - function _typeof$h(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$h = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$h = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$h(obj); - } - function _classCallCheck$g(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$g(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); - } - } - function _createClass$g(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$g(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$g(Constructor, staticProps); - return Constructor; - } - function _inherits$g(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$g(subClass, superClass); - } - function _setPrototypeOf$g(o, p) { - _setPrototypeOf$g = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$g(o, p); - } - function _createSuper$g(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$g(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$g(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$g(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$g(this, result); - }; - } - function _possibleConstructorReturn$g(self, call) { - if (call && (_typeof$h(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$g(self); - } - function _assertThisInitialized$g(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$g() { - 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; - } - } - function _getPrototypeOf$g(o) { - _getPrototypeOf$g = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$g(o); - } - function _defineProperty$g(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var LocalDayParser = /*#__PURE__*/function (_Parser) { - _inherits$g(LocalDayParser, _Parser); - var _super = _createSuper$g(LocalDayParser); + _inherits(LocalDayParser, _Parser); + var _super = _createSuper(LocalDayParser); function LocalDayParser() { var _this; - _classCallCheck$g(this, LocalDayParser); + _classCallCheck(this, LocalDayParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$g(_assertThisInitialized$g(_this), "priority", 90); - _defineProperty$g(_assertThisInitialized$g(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 90); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']); return _this; } - _createClass$g(LocalDayParser, [{ + _createClass(LocalDayParser, [{ key: "parse", value: function parse(dateString, token, match, options) { var valueCallback = function valueCallback(value) { @@ -23860,13 +22225,11 @@ // 03 return mapValue(parseNDigits(token.length, dateString), valueCallback); // 3rd - case 'eo': return mapValue(match.ordinalNumber(dateString, { unit: 'day' }), valueCallback); // Tue - case 'eee': return match.day(dateString, { width: 'abbreviated', @@ -23879,14 +22242,12 @@ context: 'formatting' }); // T - case 'eeeee': return match.day(dateString, { width: 'narrow', context: 'formatting' }); // Tu - case 'eeeeee': return match.day(dateString, { width: 'short', @@ -23896,7 +22257,6 @@ context: 'formatting' }); // Tuesday - case 'eeee': default: return match.day(dateString, { @@ -23930,131 +22290,21 @@ return LocalDayParser; }(Parser); - function _typeof$g(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$g = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$g = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$g(obj); - } - function _classCallCheck$f(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$f(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); - } - } - function _createClass$f(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$f(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$f(Constructor, staticProps); - return Constructor; - } - function _inherits$f(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$f(subClass, superClass); - } - function _setPrototypeOf$f(o, p) { - _setPrototypeOf$f = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$f(o, p); - } - function _createSuper$f(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$f(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$f(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$f(this, result); - }; - } - function _possibleConstructorReturn$f(self, call) { - if (call && (_typeof$g(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$f(self); - } - function _assertThisInitialized$f(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$f() { - 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; - } - } - function _getPrototypeOf$f(o) { - _getPrototypeOf$f = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$f(o); - } - function _defineProperty$f(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser) { - _inherits$f(StandAloneLocalDayParser, _Parser); - var _super = _createSuper$f(StandAloneLocalDayParser); + _inherits(StandAloneLocalDayParser, _Parser); + var _super = _createSuper(StandAloneLocalDayParser); function StandAloneLocalDayParser() { var _this; - _classCallCheck$f(this, StandAloneLocalDayParser); + _classCallCheck(this, StandAloneLocalDayParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$f(_assertThisInitialized$f(_this), "priority", 90); - _defineProperty$f(_assertThisInitialized$f(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 90); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']); return _this; } - _createClass$f(StandAloneLocalDayParser, [{ + _createClass(StandAloneLocalDayParser, [{ key: "parse", value: function parse(dateString, token, match, options) { var valueCallback = function valueCallback(value) { @@ -24068,13 +22318,11 @@ // 03 return mapValue(parseNDigits(token.length, dateString), valueCallback); // 3rd - case 'co': return mapValue(match.ordinalNumber(dateString, { unit: 'day' }), valueCallback); // Tue - case 'ccc': return match.day(dateString, { width: 'abbreviated', @@ -24087,14 +22335,12 @@ context: 'standalone' }); // T - case 'ccccc': return match.day(dateString, { width: 'narrow', context: 'standalone' }); // Tu - case 'cccccc': return match.day(dateString, { width: 'short', @@ -24104,7 +22350,6 @@ context: 'standalone' }); // Tuesday - case 'cccc': default: return match.day(dateString, { @@ -24154,131 +22399,21 @@ return date; } - function _typeof$f(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$f = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$f = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$f(obj); - } - function _classCallCheck$e(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$e(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); - } - } - function _createClass$e(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$e(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$e(Constructor, staticProps); - return Constructor; - } - function _inherits$e(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$e(subClass, superClass); - } - function _setPrototypeOf$e(o, p) { - _setPrototypeOf$e = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$e(o, p); - } - function _createSuper$e(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$e(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$e(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$e(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$e(this, result); - }; - } - function _possibleConstructorReturn$e(self, call) { - if (call && (_typeof$f(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$e(self); - } - function _assertThisInitialized$e(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$e() { - 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; - } - } - function _getPrototypeOf$e(o) { - _getPrototypeOf$e = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$e(o); - } - function _defineProperty$e(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - - var ISODayParser = /*#__PURE__*/function (_Parser) { - _inherits$e(ISODayParser, _Parser); - var _super = _createSuper$e(ISODayParser); - function ISODayParser() { - var _this; - _classCallCheck$e(this, ISODayParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + var ISODayParser = /*#__PURE__*/function (_Parser) { + _inherits(ISODayParser, _Parser); + var _super = _createSuper(ISODayParser); + function ISODayParser() { + var _this; + _classCallCheck(this, ISODayParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$e(_assertThisInitialized$e(_this), "priority", 90); - _defineProperty$e(_assertThisInitialized$e(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 90); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']); return _this; } - _createClass$e(ISODayParser, [{ + _createClass(ISODayParser, [{ key: "parse", value: function parse(dateString, token, match) { var valueCallback = function valueCallback(value) { @@ -24294,13 +22429,11 @@ // 02 return parseNDigits(token.length, dateString); // 2nd - case 'io': return match.ordinalNumber(dateString, { unit: 'day' }); // Tue - case 'iii': return mapValue(match.day(dateString, { width: 'abbreviated', @@ -24313,14 +22446,12 @@ context: 'formatting' }), valueCallback); // T - case 'iiiii': return mapValue(match.day(dateString, { width: 'narrow', context: 'formatting' }), valueCallback); // Tu - case 'iiiiii': return mapValue(match.day(dateString, { width: 'short', @@ -24330,7 +22461,6 @@ context: 'formatting' }), valueCallback); // Tuesday - case 'iiii': default: return mapValue(match.day(dateString, { @@ -24364,130 +22494,21 @@ return ISODayParser; }(Parser); - function _typeof$e(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$e = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$e = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$e(obj); - } - function _classCallCheck$d(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$d(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); - } - } - function _createClass$d(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$d(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$d(Constructor, staticProps); - return Constructor; - } - function _inherits$d(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$d(subClass, superClass); - } - function _setPrototypeOf$d(o, p) { - _setPrototypeOf$d = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$d(o, p); - } - function _createSuper$d(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$d(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$d(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$d(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$d(this, result); - }; - } - function _possibleConstructorReturn$d(self, call) { - if (call && (_typeof$e(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$d(self); - } - function _assertThisInitialized$d(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$d() { - 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; - } - } - function _getPrototypeOf$d(o) { - _getPrototypeOf$d = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$d(o); - } - function _defineProperty$d(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var AMPMParser = /*#__PURE__*/function (_Parser) { - _inherits$d(AMPMParser, _Parser); - var _super = _createSuper$d(AMPMParser); + _inherits(AMPMParser, _Parser); + var _super = _createSuper(AMPMParser); function AMPMParser() { var _this; - _classCallCheck$d(this, AMPMParser); + _classCallCheck(this, AMPMParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$d(_assertThisInitialized$d(_this), "priority", 80); - _defineProperty$d(_assertThisInitialized$d(_this), "incompatibleTokens", ['b', 'B', 'H', 'k', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 80); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['b', 'B', 'H', 'k', 't', 'T']); return _this; } - _createClass$d(AMPMParser, [{ + _createClass(AMPMParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -24530,130 +22551,21 @@ return AMPMParser; }(Parser); - function _typeof$d(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$d = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$d = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$d(obj); - } - function _classCallCheck$c(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$c(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); - } - } - function _createClass$c(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$c(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$c(Constructor, staticProps); - return Constructor; - } - function _inherits$c(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$c(subClass, superClass); - } - function _setPrototypeOf$c(o, p) { - _setPrototypeOf$c = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$c(o, p); - } - function _createSuper$c(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$c(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$c(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$c(this, result); - }; - } - function _possibleConstructorReturn$c(self, call) { - if (call && (_typeof$d(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$c(self); - } - function _assertThisInitialized$c(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$c() { - 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; - } - } - function _getPrototypeOf$c(o) { - _getPrototypeOf$c = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$c(o); - } - function _defineProperty$c(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var AMPMMidnightParser = /*#__PURE__*/function (_Parser) { - _inherits$c(AMPMMidnightParser, _Parser); - var _super = _createSuper$c(AMPMMidnightParser); + _inherits(AMPMMidnightParser, _Parser); + var _super = _createSuper(AMPMMidnightParser); function AMPMMidnightParser() { var _this; - _classCallCheck$c(this, AMPMMidnightParser); + _classCallCheck(this, AMPMMidnightParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$c(_assertThisInitialized$c(_this), "priority", 80); - _defineProperty$c(_assertThisInitialized$c(_this), "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 80); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']); return _this; } - _createClass$c(AMPMMidnightParser, [{ + _createClass(AMPMMidnightParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -24696,131 +22608,21 @@ return AMPMMidnightParser; }(Parser); - function _typeof$c(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$c = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$c = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$c(obj); - } - function _classCallCheck$b(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$b(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); - } - } - function _createClass$b(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$b(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$b(Constructor, staticProps); - return Constructor; - } - function _inherits$b(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$b(subClass, superClass); - } - function _setPrototypeOf$b(o, p) { - _setPrototypeOf$b = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$b(o, p); - } - function _createSuper$b(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$b(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$b(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$b(this, result); - }; - } - function _possibleConstructorReturn$b(self, call) { - if (call && (_typeof$c(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$b(self); - } - function _assertThisInitialized$b(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$b() { - 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; - } - } - function _getPrototypeOf$b(o) { - _getPrototypeOf$b = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$b(o); - } - function _defineProperty$b(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - - var DayPeriodParser = /*#__PURE__*/function (_Parser) { - _inherits$b(DayPeriodParser, _Parser); - var _super = _createSuper$b(DayPeriodParser); - function DayPeriodParser() { - var _this; - _classCallCheck$b(this, DayPeriodParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + var DayPeriodParser = /*#__PURE__*/function (_Parser) { + _inherits(DayPeriodParser, _Parser); + var _super = _createSuper(DayPeriodParser); + function DayPeriodParser() { + var _this; + _classCallCheck(this, DayPeriodParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$b(_assertThisInitialized$b(_this), "priority", 80); - _defineProperty$b(_assertThisInitialized$b(_this), "incompatibleTokens", ['a', 'b', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 80); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 't', 'T']); return _this; } - _createClass$b(DayPeriodParser, [{ + _createClass(DayPeriodParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -24863,130 +22665,21 @@ return DayPeriodParser; }(Parser); - function _typeof$b(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$b = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$b = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$b(obj); - } - function _classCallCheck$a(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$a(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); - } - } - function _createClass$a(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$a(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$a(Constructor, staticProps); - return Constructor; - } - function _inherits$a(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$a(subClass, superClass); - } - function _setPrototypeOf$a(o, p) { - _setPrototypeOf$a = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$a(o, p); - } - function _createSuper$a(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$a(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$a(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$a(this, result); - }; - } - function _possibleConstructorReturn$a(self, call) { - if (call && (_typeof$b(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$a(self); - } - function _assertThisInitialized$a(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$a() { - 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; - } - } - function _getPrototypeOf$a(o) { - _getPrototypeOf$a = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$a(o); - } - function _defineProperty$a(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var Hour1to12Parser = /*#__PURE__*/function (_Parser) { - _inherits$a(Hour1to12Parser, _Parser); - var _super = _createSuper$a(Hour1to12Parser); + _inherits(Hour1to12Parser, _Parser); + var _super = _createSuper(Hour1to12Parser); function Hour1to12Parser() { var _this; - _classCallCheck$a(this, Hour1to12Parser); + _classCallCheck(this, Hour1to12Parser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$a(_assertThisInitialized$a(_this), "priority", 70); - _defineProperty$a(_assertThisInitialized$a(_this), "incompatibleTokens", ['H', 'K', 'k', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 70); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['H', 'K', 'k', 't', 'T']); return _this; } - _createClass$a(Hour1to12Parser, [{ + _createClass(Hour1to12Parser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -25022,130 +22715,21 @@ return Hour1to12Parser; }(Parser); - function _typeof$a(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$a = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$a = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$a(obj); - } - function _classCallCheck$9(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$9(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); - } - } - function _createClass$9(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$9(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$9(Constructor, staticProps); - return Constructor; - } - function _inherits$9(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$9(subClass, superClass); - } - function _setPrototypeOf$9(o, p) { - _setPrototypeOf$9 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$9(o, p); - } - function _createSuper$9(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$9(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$9(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$9(this, result); - }; - } - function _possibleConstructorReturn$9(self, call) { - if (call && (_typeof$a(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$9(self); - } - function _assertThisInitialized$9(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$9() { - 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; - } - } - function _getPrototypeOf$9(o) { - _getPrototypeOf$9 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$9(o); - } - function _defineProperty$9(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var Hour0to23Parser = /*#__PURE__*/function (_Parser) { - _inherits$9(Hour0to23Parser, _Parser); - var _super = _createSuper$9(Hour0to23Parser); + _inherits(Hour0to23Parser, _Parser); + var _super = _createSuper(Hour0to23Parser); function Hour0to23Parser() { var _this; - _classCallCheck$9(this, Hour0to23Parser); + _classCallCheck(this, Hour0to23Parser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$9(_assertThisInitialized$9(_this), "priority", 70); - _defineProperty$9(_assertThisInitialized$9(_this), "incompatibleTokens", ['a', 'b', 'h', 'K', 'k', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 70); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 'h', 'K', 'k', 't', 'T']); return _this; } - _createClass$9(Hour0to23Parser, [{ + _createClass(Hour0to23Parser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -25174,130 +22758,21 @@ return Hour0to23Parser; }(Parser); - function _typeof$9(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$9 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$9 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$9(obj); - } - function _classCallCheck$8(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$8(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); - } - } - function _createClass$8(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$8(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$8(Constructor, staticProps); - return Constructor; - } - function _inherits$8(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$8(subClass, superClass); - } - function _setPrototypeOf$8(o, p) { - _setPrototypeOf$8 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$8(o, p); - } - function _createSuper$8(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$8(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$8(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + var Hour0To11Parser = /*#__PURE__*/function (_Parser) { + _inherits(Hour0To11Parser, _Parser); + var _super = _createSuper(Hour0To11Parser); + function Hour0To11Parser() { + var _this; + _classCallCheck(this, Hour0To11Parser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - return _possibleConstructorReturn$8(this, result); - }; - } - function _possibleConstructorReturn$8(self, call) { - if (call && (_typeof$9(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$8(self); - } - function _assertThisInitialized$8(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "priority", 70); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['h', 'H', 'k', 't', 'T']); + return _this; } - return self; - } - function _isNativeReflectConstruct$8() { - 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; - } - } - function _getPrototypeOf$8(o) { - _getPrototypeOf$8 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$8(o); - } - function _defineProperty$8(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var Hour0To11Parser = /*#__PURE__*/function (_Parser) { - _inherits$8(Hour0To11Parser, _Parser); - var _super = _createSuper$8(Hour0To11Parser); - function Hour0To11Parser() { - var _this; - _classCallCheck$8(this, Hour0To11Parser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$8(_assertThisInitialized$8(_this), "priority", 70); - _defineProperty$8(_assertThisInitialized$8(_this), "incompatibleTokens", ['h', 'H', 'k', 't', 'T']); - return _this; - } - _createClass$8(Hour0To11Parser, [{ + _createClass(Hour0To11Parser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -25331,130 +22806,21 @@ return Hour0To11Parser; }(Parser); - function _typeof$8(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$8 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$8 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$8(obj); - } - function _classCallCheck$7(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$7(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); - } - } - function _createClass$7(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$7(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$7(Constructor, staticProps); - return Constructor; - } - function _inherits$7(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$7(subClass, superClass); - } - function _setPrototypeOf$7(o, p) { - _setPrototypeOf$7 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$7(o, p); - } - function _createSuper$7(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$7(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$7(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$7(this, result); - }; - } - function _possibleConstructorReturn$7(self, call) { - if (call && (_typeof$8(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$7(self); - } - function _assertThisInitialized$7(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$7() { - 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; - } - } - function _getPrototypeOf$7(o) { - _getPrototypeOf$7 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$7(o); - } - function _defineProperty$7(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var Hour1To24Parser = /*#__PURE__*/function (_Parser) { - _inherits$7(Hour1To24Parser, _Parser); - var _super = _createSuper$7(Hour1To24Parser); + _inherits(Hour1To24Parser, _Parser); + var _super = _createSuper(Hour1To24Parser); function Hour1To24Parser() { var _this; - _classCallCheck$7(this, Hour1To24Parser); + _classCallCheck(this, Hour1To24Parser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$7(_assertThisInitialized$7(_this), "priority", 70); - _defineProperty$7(_assertThisInitialized$7(_this), "incompatibleTokens", ['a', 'b', 'h', 'H', 'K', 't', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 70); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['a', 'b', 'h', 'H', 'K', 't', 'T']); return _this; } - _createClass$7(Hour1To24Parser, [{ + _createClass(Hour1To24Parser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -25484,130 +22850,21 @@ return Hour1To24Parser; }(Parser); - function _typeof$7(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$7 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$7 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$7(obj); - } - function _classCallCheck$6(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$6(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); - } - } - function _createClass$6(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$6(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$6(Constructor, staticProps); - return Constructor; - } - function _inherits$6(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$6(subClass, superClass); - } - function _setPrototypeOf$6(o, p) { - _setPrototypeOf$6 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$6(o, p); - } - function _createSuper$6(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$6(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$6(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$6(this, result); - }; - } - function _possibleConstructorReturn$6(self, call) { - if (call && (_typeof$7(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$6(self); - } - function _assertThisInitialized$6(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$6() { - 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; - } - } - function _getPrototypeOf$6(o) { - _getPrototypeOf$6 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$6(o); - } - function _defineProperty$6(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var MinuteParser = /*#__PURE__*/function (_Parser) { - _inherits$6(MinuteParser, _Parser); - var _super = _createSuper$6(MinuteParser); + _inherits(MinuteParser, _Parser); + var _super = _createSuper(MinuteParser); function MinuteParser() { var _this; - _classCallCheck$6(this, MinuteParser); + _classCallCheck(this, MinuteParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$6(_assertThisInitialized$6(_this), "priority", 60); - _defineProperty$6(_assertThisInitialized$6(_this), "incompatibleTokens", ['t', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 60); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']); return _this; } - _createClass$6(MinuteParser, [{ + _createClass(MinuteParser, [{ key: "parse", value: function parse(dateString, token, match) { switch (token) { @@ -25636,147 +22893,38 @@ return MinuteParser; }(Parser); - function _typeof$6(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$6 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$6 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$6(obj); - } - function _classCallCheck$5(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$5(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); - } - } - function _createClass$5(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$5(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$5(Constructor, staticProps); - return Constructor; - } - function _inherits$5(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + var SecondParser = /*#__PURE__*/function (_Parser) { + _inherits(SecondParser, _Parser); + var _super = _createSuper(SecondParser); + function SecondParser() { + var _this; + _classCallCheck(this, SecondParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "priority", 50); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']); + return _this; } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true + _createClass(SecondParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 's': + return parseNumericPattern(numericPatterns.second, dateString); + case 'so': + return match.ordinalNumber(dateString, { + unit: 'second' + }); + default: + return parseNDigits(token.length, dateString); + } } - }); - if (superClass) _setPrototypeOf$5(subClass, superClass); - } - function _setPrototypeOf$5(o, p) { - _setPrototypeOf$5 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$5(o, p); - } - function _createSuper$5(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$5(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$5(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$5(this, result); - }; - } - function _possibleConstructorReturn$5(self, call) { - if (call && (_typeof$6(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$5(self); - } - function _assertThisInitialized$5(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$5() { - 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; - } - } - function _getPrototypeOf$5(o) { - _getPrototypeOf$5 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$5(o); - } - function _defineProperty$5(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var SecondParser = /*#__PURE__*/function (_Parser) { - _inherits$5(SecondParser, _Parser); - var _super = _createSuper$5(SecondParser); - function SecondParser() { - var _this; - _classCallCheck$5(this, SecondParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$5(_assertThisInitialized$5(_this), "priority", 50); - _defineProperty$5(_assertThisInitialized$5(_this), "incompatibleTokens", ['t', 'T']); - return _this; - } - _createClass$5(SecondParser, [{ - key: "parse", - value: function parse(dateString, token, match) { - switch (token) { - case 's': - return parseNumericPattern(numericPatterns.second, dateString); - case 'so': - return match.ordinalNumber(dateString, { - unit: 'second' - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate(_date, value) { - return value >= 0 && value <= 59; + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 59; } }, { key: "set", @@ -25788,130 +22936,21 @@ return SecondParser; }(Parser); - function _typeof$5(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$5 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$5 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$5(obj); - } - function _classCallCheck$4(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$4(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); - } - } - function _createClass$4(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$4(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$4(Constructor, staticProps); - return Constructor; - } - function _inherits$4(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$4(subClass, superClass); - } - function _setPrototypeOf$4(o, p) { - _setPrototypeOf$4 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$4(o, p); - } - function _createSuper$4(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$4(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$4(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$4(this, result); - }; - } - function _possibleConstructorReturn$4(self, call) { - if (call && (_typeof$5(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$4(self); - } - function _assertThisInitialized$4(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$4() { - 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; - } - } - function _getPrototypeOf$4(o) { - _getPrototypeOf$4 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$4(o); - } - function _defineProperty$4(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var FractionOfSecondParser = /*#__PURE__*/function (_Parser) { - _inherits$4(FractionOfSecondParser, _Parser); - var _super = _createSuper$4(FractionOfSecondParser); + _inherits(FractionOfSecondParser, _Parser); + var _super = _createSuper(FractionOfSecondParser); function FractionOfSecondParser() { var _this; - _classCallCheck$4(this, FractionOfSecondParser); + _classCallCheck(this, FractionOfSecondParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$4(_assertThisInitialized$4(_this), "priority", 30); - _defineProperty$4(_assertThisInitialized$4(_this), "incompatibleTokens", ['t', 'T']); + _defineProperty(_assertThisInitialized(_this), "priority", 30); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T']); return _this; } - _createClass$4(FractionOfSecondParser, [{ + _createClass(FractionOfSecondParser, [{ key: "parse", value: function parse(dateString, token) { var valueCallback = function valueCallback(value) { @@ -25929,436 +22968,107 @@ return FractionOfSecondParser; }(Parser); - function _typeof$4(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$4 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$4 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$4(obj); - } - function _classCallCheck$3(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$3(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); - } - } - function _createClass$3(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$3(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$3(Constructor, staticProps); - return Constructor; - } - function _inherits$3(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$3(subClass, superClass); - } - function _setPrototypeOf$3(o, p) { - _setPrototypeOf$3 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$3(o, p); - } - function _createSuper$3(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$3(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$3(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$3(this, result); - }; - } - function _possibleConstructorReturn$3(self, call) { - if (call && (_typeof$4(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$3(self); - } - function _assertThisInitialized$3(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$3() { - 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; - } - } - function _getPrototypeOf$3(o) { - _getPrototypeOf$3 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$3(o); - } - function _defineProperty$3(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser) { - _inherits$3(ISOTimezoneWithZParser, _Parser); - var _super = _createSuper$3(ISOTimezoneWithZParser); + _inherits(ISOTimezoneWithZParser, _Parser); + var _super = _createSuper(ISOTimezoneWithZParser); function ISOTimezoneWithZParser() { var _this; - _classCallCheck$3(this, ISOTimezoneWithZParser); + _classCallCheck(this, ISOTimezoneWithZParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$3(_assertThisInitialized$3(_this), "priority", 10); - _defineProperty$3(_assertThisInitialized$3(_this), "incompatibleTokens", ['t', 'T', 'x']); + _defineProperty(_assertThisInitialized(_this), "priority", 10); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T', 'x']); return _this; } - _createClass$3(ISOTimezoneWithZParser, [{ + _createClass(ISOTimezoneWithZParser, [{ key: "parse", value: function parse(dateString, token) { switch (token) { - case 'X': - return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString); - case 'XX': - return parseTimezonePattern(timezonePatterns.basic, dateString); - case 'XXXX': - return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString); - case 'XXXXX': - return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString); - case 'XXX': - default: - return parseTimezonePattern(timezonePatterns.extended, dateString); - } - } - }, { - key: "set", - value: function set(date, flags, value) { - if (flags.timestampIsSet) { - return date; - } - return new Date(date.getTime() - value); - } - }]); - return ISOTimezoneWithZParser; - }(Parser); - - function _typeof$3(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$3 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$3 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$3(obj); - } - function _classCallCheck$2(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$2(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); - } - } - function _createClass$2(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$2(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$2(Constructor, staticProps); - return Constructor; - } - function _inherits$2(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$2(subClass, superClass); - } - function _setPrototypeOf$2(o, p) { - _setPrototypeOf$2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$2(o, p); - } - function _createSuper$2(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$2(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$2(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$2(this, result); - }; - } - function _possibleConstructorReturn$2(self, call) { - if (call && (_typeof$3(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$2(self); - } - function _assertThisInitialized$2(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$2() { - 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; - } - } - function _getPrototypeOf$2(o) { - _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$2(o); - } - function _defineProperty$2(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - - var ISOTimezoneParser = /*#__PURE__*/function (_Parser) { - _inherits$2(ISOTimezoneParser, _Parser); - var _super = _createSuper$2(ISOTimezoneParser); - function ISOTimezoneParser() { - var _this; - _classCallCheck$2(this, ISOTimezoneParser); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$2(_assertThisInitialized$2(_this), "priority", 10); - _defineProperty$2(_assertThisInitialized$2(_this), "incompatibleTokens", ['t', 'T', 'X']); - return _this; - } - _createClass$2(ISOTimezoneParser, [{ - key: "parse", - value: function parse(dateString, token) { - switch (token) { - case 'x': - return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString); - case 'xx': - return parseTimezonePattern(timezonePatterns.basic, dateString); - case 'xxxx': - return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString); - case 'xxxxx': - return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString); - case 'xxx': - default: - return parseTimezonePattern(timezonePatterns.extended, dateString); - } - } - }, { - key: "set", - value: function set(date, flags, value) { - if (flags.timestampIsSet) { - return date; - } - return new Date(date.getTime() - value); - } - }]); - return ISOTimezoneParser; - }(Parser); - - function _typeof$2(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$2 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$2 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$2(obj); - } - function _classCallCheck$1(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties$1(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); - } - } - function _createClass$1(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$1(Constructor, staticProps); - return Constructor; - } - function _inherits$1(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$1(subClass, superClass); - } - function _setPrototypeOf$1(o, p) { - _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf$1(o, p); - } - function _createSuper$1(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); - return function _createSuperInternal() { - var Super = _getPrototypeOf$1(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$1(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn$1(this, result); - }; - } - function _possibleConstructorReturn$1(self, call) { - if (call && (_typeof$2(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized$1(self); - } - function _assertThisInitialized$1(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _isNativeReflectConstruct$1() { - 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; - } - } - function _getPrototypeOf$1(o) { - _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$1(o); - } - function _defineProperty$1(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; + case 'X': + return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString); + case 'XX': + return parseTimezonePattern(timezonePatterns.basic, dateString); + case 'XXXX': + return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString); + case 'XXXXX': + return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString); + case 'XXX': + default: + return parseTimezonePattern(timezonePatterns.extended, dateString); + } + } + }, { + key: "set", + value: function set(date, flags, value) { + if (flags.timestampIsSet) { + return date; + } + return new Date(date.getTime() - value); + } + }]); + return ISOTimezoneWithZParser; + }(Parser); + + var ISOTimezoneParser = /*#__PURE__*/function (_Parser) { + _inherits(ISOTimezoneParser, _Parser); + var _super = _createSuper(ISOTimezoneParser); + function ISOTimezoneParser() { + var _this; + _classCallCheck(this, ISOTimezoneParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "priority", 10); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ['t', 'T', 'X']); + return _this; } - return obj; - } + _createClass(ISOTimezoneParser, [{ + key: "parse", + value: function parse(dateString, token) { + switch (token) { + case 'x': + return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString); + case 'xx': + return parseTimezonePattern(timezonePatterns.basic, dateString); + case 'xxxx': + return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString); + case 'xxxxx': + return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString); + case 'xxx': + default: + return parseTimezonePattern(timezonePatterns.extended, dateString); + } + } + }, { + key: "set", + value: function set(date, flags, value) { + if (flags.timestampIsSet) { + return date; + } + return new Date(date.getTime() - value); + } + }]); + return ISOTimezoneParser; + }(Parser); + var TimestampSecondsParser = /*#__PURE__*/function (_Parser) { - _inherits$1(TimestampSecondsParser, _Parser); - var _super = _createSuper$1(TimestampSecondsParser); + _inherits(TimestampSecondsParser, _Parser); + var _super = _createSuper(TimestampSecondsParser); function TimestampSecondsParser() { var _this; - _classCallCheck$1(this, TimestampSecondsParser); + _classCallCheck(this, TimestampSecondsParser); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty$1(_assertThisInitialized$1(_this), "priority", 40); - _defineProperty$1(_assertThisInitialized$1(_this), "incompatibleTokens", '*'); + _defineProperty(_assertThisInitialized(_this), "priority", 40); + _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", '*'); return _this; } - _createClass$1(TimestampSecondsParser, [{ + _createClass(TimestampSecondsParser, [{ key: "parse", value: function parse(dateString) { return parseAnyDigitsSigned(dateString); @@ -26374,115 +23084,6 @@ return TimestampSecondsParser; }(Parser); - function _typeof$1(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$1 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$1 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof$1(obj); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - 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); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - 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); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - 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); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof$1(call) === "object" || typeof call === "function")) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - 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; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser) { _inherits(TimestampMillisecondsParser, _Parser); var _super = _createSuper(TimestampMillisecondsParser); @@ -26556,7 +23157,6 @@ * `Y` is supposed to be used in conjunction with `w` and `e` * for week-numbering date specific to the locale. */ - var parsers = { G: new EraParser(), y: new YearParser(), @@ -26591,86 +23191,6 @@ T: new TimestampMillisecondsParser() }; - 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); - } - function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - 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 = o[Symbol.iterator](); - }, - 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; - } - } - }; - } - 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); - } - 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; - } // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token // (one of the certain letters followed by `o`) // - (\w)\1* matches any sequences of the same letter @@ -26681,15 +23201,16 @@ // If there is no matching single quote // then the sequence will continue until the end of the string. // - . matches any single character unmatched by previous parts of the RegExps + var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; - var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also + // This RegExp catches symbols escaped by quotes, and also // sequences of symbols P, p, and the combinations like `PPPPPPPppppp` - var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; var escapedStringRegExp = /^'([^]*?)'?$/; var doubleQuoteRegExp = /''/g; var notWhitespaceRegExp = /\S/; var unescapedLatinCharacterRegExp = /[a-zA-Z]/; + /** * @name parse * @category Common Helpers @@ -26991,7 +23512,6 @@ * }) * //=> Sun Feb 28 2010 00:00:00 */ - function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, options) { var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4; requiredArgs(3, arguments); @@ -27002,13 +23522,15 @@ if (!locale.match) { throw new RangeError('locale must contain match property'); } - var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN + var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); + // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } - var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } @@ -27023,8 +23545,9 @@ firstWeekContainsDate: firstWeekContainsDate, weekStartsOn: weekStartsOn, locale: locale - }; // If timezone isn't specified, it will be set to the system timezone + }; + // If timezone isn't specified, it will be set to the system timezone var setters = [new DateToSystemTimezoneSetter()]; var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) { var firstCharacter = substring[0]; @@ -27075,14 +23598,16 @@ } else { if (firstCharacter.match(unescapedLatinCharacterRegExp)) { throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); - } // Replace two single quote characters with one single quote character + } + // Replace two single quote characters with one single quote character if (token === "''") { token = "'"; } else if (firstCharacter === "'") { token = cleanEscapedString(token); - } // Cut token from string, or, if string doesn't match the token, return Invalid Date + } + // Cut token from string, or, if string doesn't match the token, return Invalid Date if (dateString.indexOf(token) === 0) { dateString = dateString.slice(token.length); } else { @@ -27095,7 +23620,9 @@ for (_iterator.s(); !(_step = _iterator.n()).done;) { var _ret = _loop(); if (_typeof(_ret) === "object") return _ret.v; - } // Check if the remaining input contains something other than whitespace + } + + // Check if the remaining input contains something other than whitespace } catch (err) { _iterator.e(err); } finally { @@ -27122,8 +23649,9 @@ var date = toDate(dirtyReferenceDate); if (isNaN(date.getTime())) { return new Date(NaN); - } // Convert the date in system timezone to the same date in UTC+00:00 timezone. + } + // Convert the date in system timezone to the same date in UTC+00:00 timezone. var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date)); var flags = {}; var _iterator2 = _createForOfIteratorHelper(uniquePrioritySetters), @@ -27134,11 +23662,12 @@ if (!setter.validate(utcDate, subFnOptions)) { return new Date(NaN); } - var result = setter.set(utcDate, flags, subFnOptions); // Result is tuple (date, flags) - + var result = setter.set(utcDate, flags, subFnOptions); + // Result is tuple (date, flags) if (Array.isArray(result)) { utcDate = result[0]; - assign(flags, result[1]); // Result is date + assign(flags, result[1]); + // Result is date } else { utcDate = result; } @@ -27172,7 +23701,6 @@ * const result = startOfHour(new Date(2014, 8, 2, 11, 55)) * //=> Tue Sep 02 2014 11:00:00 */ - function startOfHour(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -27198,7 +23726,6 @@ * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:45.000 */ - function startOfSecond(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -27238,7 +23765,6 @@ * const result = parseISO('+02014101', { additionalDigits: 1 }) * //=> Fri Apr 11 2014 00:00:00 */ - function parseISO(argument, options) { var _options$additionalDi; requiredArgs(1, arguments); @@ -27273,12 +23799,12 @@ return new Date(NaN); } } else { - var dirtyDate = new Date(timestamp + time); // js parsed string assuming it's in UTC timezone + var dirtyDate = new Date(timestamp + time); + // js parsed string assuming it's in UTC timezone // but we need it to be parsed in our timezone // so we use utc values to build date in our timezone. // Year values from 0 to 99 map to the years 1900 to 1999 // so set year explicitly with setFullYear. - var result = new Date(0); result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate()); result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds()); @@ -27297,9 +23823,10 @@ function splitDateString(dateString) { var dateStrings = {}; var array = dateString.split(patterns.dateTimeDelimiter); - var timeString; // The regex match should only return at maximum two array elements. - // [date], [time], or [date, time]. + var timeString; + // The regex match should only return at maximum two array elements. + // [date], [time], or [date, time]. if (array.length > 2) { return dateStrings; } @@ -27326,15 +23853,16 @@ } function parseYear(dateString, additionalDigits) { var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)'); - var captures = dateString.match(regex); // Invalid ISO-formatted year - + var captures = dateString.match(regex); + // Invalid ISO-formatted year if (!captures) return { year: NaN, restDateString: '' }; var year = captures[1] ? parseInt(captures[1]) : null; - var century = captures[2] ? parseInt(captures[2]) : null; // either year or century is null, not both + var century = captures[2] ? parseInt(captures[2]) : null; + // either year or century is null, not both return { year: century === null ? year : century * 100, restDateString: dateString.slice((captures[1] || captures[2]).length) @@ -27343,8 +23871,8 @@ function parseDate(dateString, year) { // Invalid ISO-formatted year if (year === null) return new Date(NaN); - var captures = dateString.match(dateRegex); // Invalid ISO-formatted string - + var captures = dateString.match(dateRegex); + // Invalid ISO-formatted string if (!captures) return new Date(NaN); var isWeekDate = !!captures[4]; var dayOfYear = parseDateUnit(captures[1]); @@ -27403,9 +23931,11 @@ var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay; date.setUTCDate(date.getUTCDate() + diff); return date; - } // Validation functions - // February is null to handle the leap year (using ||) + } + // Validation functions + + // February is null to handle the leap year (using ||) var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function isLeapYearIndex(year) { return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; @@ -27452,7 +23982,7 @@ if (value === null || typeof value === 'undefined') { return null; } - var type = _typeof$z(value); + var type = _typeof$1(value); if (type === 'number' || value instanceof Date) { value = toDate(value); } else if (type === 'string') {