diff --git a/dist/libyear/index.js b/dist/libyear/index.js index 7a59354..8ddb92c 100755 --- a/dist/libyear/index.js +++ b/dist/libyear/index.js @@ -1,7340 +1,5847 @@ #!/usr/bin/env node -module.exports = -/******/ (function(modules, runtime) { // webpackBootstrap -/******/ "use strict"; -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ __webpack_require__.ab = __dirname + "/"; -/******/ -/******/ // the startup function -/******/ function startup() { -/******/ // Load entry module and return exports -/******/ return __webpack_require__(949); -/******/ }; -/******/ // initialize runtime -/******/ runtime(__webpack_require__); -/******/ -/******/ // run startup -/******/ return startup(); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 5211: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getISODay; - -var _index = _interopRequireDefault(__webpack_require__(773)); +})); +exports.codeFrameColumns = codeFrameColumns; +exports["default"] = _default; -var _index2 = _interopRequireDefault(__webpack_require__(217)); +var _highlight = _interopRequireWildcard(__nccwpck_require__(6860)); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } -/** - * @name getISODay - * @category Weekday Helpers - * @summary Get the day of the ISO week of the given date. - * - * @description - * Get the day of the ISO week of the given date, - * which is 7 for Sunday, 1 for Monday etc. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @returns {Number} the day of ISO week - * @throws {TypeError} 1 argument required - * - * @example - * // Which day of the ISO week is 26 February 2012? - * const result = getISODay(new Date(2012, 1, 26)) - * //=> 7 - */ -function getISODay(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var day = date.getDay(); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - if (day === 0) { - day = 7; - } +let deprecationWarningShown = false; - return day; +function getDefs(chalk) { + return { + gutter: chalk.grey, + marker: chalk.red.bold, + message: chalk.red.bold + }; } -module.exports = exports.default; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = setUTCWeek; +function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); -var _index = _interopRequireDefault(__webpack_require__(841)); + if (startLine === -1) { + start = 0; + } -var _index2 = _interopRequireDefault(__webpack_require__(773)); + if (endLine === -1) { + end = source.length; + } -var _index3 = _interopRequireDefault(__webpack_require__(102)); + const lineDiff = endLine - startLine; + const markerLines = {}; -var _index4 = _interopRequireDefault(__webpack_require__(217)); + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function setUTCWeek(dirtyDate, dirtyWeek, options) { - (0, _index4.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var week = (0, _index.default)(dirtyWeek); - var diff = (0, _index3.default)(date, options) - week; - date.setUTCDate(date.getUTCDate() - diff * 7); - return date; + return { + start, + end, + markerLines + }; } -module.exports = exports.default; +function codeFrameColumns(rawLines, loc, opts = {}) { + const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); + const chalk = (0, _highlight.getChalk)(opts); + const defs = getDefs(chalk); -/***/ }), -/* 2 */, -/* 3 */, -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { + const maybeHighlight = (chalkFn, string) => { + return highlighted ? chalkFn(string) : string; + }; -"use strict"; + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; + let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getDate; + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); -var _index = _interopRequireDefault(__webpack_require__(773)); + if (lastMarkerLine && opts.message) { + markerLine += " " + maybeHighlight(defs.message, opts.message); + } + } -var _index2 = _interopRequireDefault(__webpack_require__(217)); + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); + } else { + return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; + } + }).join("\n"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; + } -/** - * @name getDate - * @category Day Helpers - * @summary Get the day of the month of the given date. - * - * @description - * Get the day of the month of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @returns {Number} the day of month - * @throws {TypeError} 1 argument required - * - * @example - * // Which day of the month is 29 February 2012? - * const result = getDate(new Date(2012, 1, 29)) - * //=> 29 - */ -function getDate(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var dayOfMonth = date.getDate(); - return dayOfMonth; + if (highlighted) { + return chalk.reset(frame); + } else { + return frame; + } } -module.exports = exports.default; - -/***/ }), -/* 5 */, -/* 6 */, -/* 7 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +function _default(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; -// given a set of versions and a range, create a "simplified" range -// that includes the same versions that the original range does -// If the original range is shorter than the simplified one, return that. -const satisfies = __webpack_require__(517) -const compare = __webpack_require__(164) -module.exports = (versions, range, options) => { - const set = [] - let min = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!min) - min = version + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); } else { - if (prev) { - set.push([min, prev]) - } - prev = null - min = null + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); } } - if (min) - set.push([min, null]) - const ranges = [] - for (const [min, max] of set) { - if (min === max) - ranges.push(min) - else if (!max && min === v[0]) - ranges.push('*') - else if (!max) - ranges.push(`>=${min}`) - else if (min === v[0]) - ranges.push(`<=${max}`) - else - ranges.push(`${min} - ${max}`) - } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); } - /***/ }), -/* 8 */, -/* 9 */, -/* 10 */, -/* 11 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -// Note: since nyc uses this module to output coverage, any lines -// that are in the direct sync flow of nyc's outputCoverage are -// ignored, since we can never get coverage for them. -var assert = __webpack_require__(357) -var signals = __webpack_require__(306) -var isWin = /^win/i.test(process.platform) +/***/ 6396: +/***/ ((__unused_webpack_module, exports) => { -var EE = __webpack_require__(614) -/* istanbul ignore if */ -if (typeof EE !== 'function') { - EE = EE.EventEmitter -} +"use strict"; -var emitter -if (process.__signal_exit_emitter__) { - emitter = process.__signal_exit_emitter__ -} else { - emitter = process.__signal_exit_emitter__ = new EE() - emitter.count = 0 - emitter.emitted = {} -} -// Because this emitter is a global, we have to check to see if a -// previous version of this library failed to enable infinite listeners. -// I know what you're about to say. But literally everything about -// signal-exit is a compromise with evil. Get used to it. -if (!emitter.infinite) { - emitter.setMaxListeners(Infinity) - emitter.infinite = true -} +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isIdentifierStart = isIdentifierStart; +exports.isIdentifierChar = isIdentifierChar; +exports.isIdentifierName = isIdentifierName; +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; -module.exports = function (cb, opts) { - assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') +function isInAstralSet(code, set) { + let pos = 0x10000; - if (loaded === false) { - load() + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; } - var ev = 'exit' - if (opts && opts.alwaysLast) { - ev = 'afterexit' - } + return false; +} - var remove = function () { - emitter.removeListener(ev, cb) - if (emitter.listeners('exit').length === 0 && - emitter.listeners('afterexit').length === 0) { - unload() - } +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); } - emitter.on(ev, cb) - return remove + return isInAstralSet(code, astralIdentifierStartCodes); } -module.exports.unload = unload -function unload () { - if (!loaded) { - return +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); } - loaded = false - signals.forEach(function (sig) { - try { - process.removeListener(sig, sigListeners[sig]) - } catch (er) {} - }) - process.emit = originalProcessEmit - process.reallyExit = originalProcessReallyExit - emitter.count -= 1 + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); } -function emit (event, code, signal) { - if (emitter.emitted[event]) { - return - } - emitter.emitted[event] = true - emitter.emit(event, code, signal) -} - -// { : , ... } -var sigListeners = {} -signals.forEach(function (sig) { - sigListeners[sig] = function listener () { - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - var listeners = process.listeners(sig) - if (listeners.length === emitter.count) { - unload() - emit('exit', null, sig) - /* istanbul ignore next */ - emit('afterexit', null, sig) - /* istanbul ignore next */ - if (isWin && sig === 'SIGHUP') { - // "SIGHUP" throws an `ENOSYS` error on Windows, - // so use a supported signal instead - sig = 'SIGINT' +function isIdentifierName(name) { + let isFirst = true; + + for (let i = 0; i < name.length; i++) { + let cp = name.charCodeAt(i); + + if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { + const trail = name.charCodeAt(++i); + + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + + if (isFirst) { + isFirst = false; + + if (!isIdentifierStart(cp)) { + return false; } - process.kill(process.pid, sig) + } else if (!isIdentifierChar(cp)) { + return false; } } -}) -module.exports.signals = function () { - return signals + return !isFirst; } -module.exports.load = load +/***/ }), -var loaded = false +/***/ 6607: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function load () { - if (loaded) { - return +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "isIdentifierName", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierName; + } +})); +Object.defineProperty(exports, "isIdentifierChar", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierChar; + } +})); +Object.defineProperty(exports, "isIdentifierStart", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierStart; + } +})); +Object.defineProperty(exports, "isReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isReservedWord; + } +})); +Object.defineProperty(exports, "isStrictBindOnlyReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictBindOnlyReservedWord; + } +})); +Object.defineProperty(exports, "isStrictBindReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictBindReservedWord; + } +})); +Object.defineProperty(exports, "isStrictReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictReservedWord; + } +})); +Object.defineProperty(exports, "isKeyword", ({ + enumerable: true, + get: function () { + return _keyword.isKeyword; } - loaded = true +})); - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - emitter.count += 1 +var _identifier = __nccwpck_require__(6396); - signals = signals.filter(function (sig) { - try { - process.on(sig, sigListeners[sig]) - return true - } catch (er) { - return false - } - }) +var _keyword = __nccwpck_require__(7249); + +/***/ }), + +/***/ 7249: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isReservedWord = isReservedWord; +exports.isStrictReservedWord = isStrictReservedWord; +exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; +exports.isStrictBindReservedWord = isStrictBindReservedWord; +exports.isKeyword = isKeyword; +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); - process.emit = processEmit - process.reallyExit = processReallyExit +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; } -var originalProcessReallyExit = process.reallyExit -function processReallyExit (code) { - process.exitCode = code || 0 - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - /* istanbul ignore next */ - originalProcessReallyExit.call(process, process.exitCode) +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); } -var originalProcessEmit = process.emit -function processEmit (ev, arg) { - if (ev === 'exit') { - if (arg !== undefined) { - process.exitCode = arg - } - var ret = originalProcessEmit.apply(this, arguments) - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - return ret - } else { - return originalProcessEmit.apply(this, arguments) - } +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); } +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} -/***/ }), -/* 12 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +function isKeyword(word) { + return keywords.has(word); +} -"use strict"; +/***/ }), -const path = __webpack_require__(492); -const pathKey = __webpack_require__(572); +/***/ 6860: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const npmRunPath = options => { - options = { - cwd: process.cwd(), - path: process.env[pathKey()], - execPath: process.execPath, - ...options - }; +"use strict"; - let previous; - let cwdPath = path.resolve(options.cwd); - const result = []; - while (previous !== cwdPath) { - result.push(path.join(cwdPath, 'node_modules/.bin')); - previous = cwdPath; - cwdPath = path.resolve(cwdPath, '..'); - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.shouldHighlight = shouldHighlight; +exports.getChalk = getChalk; +exports["default"] = highlight; - // Ensure the running `node` binary is used - const execPathDir = path.resolve(options.cwd, options.execPath, '..'); - result.push(execPathDir); +var _helperValidatorIdentifier = __nccwpck_require__(6607); - return result.concat(options.path).join(path.delimiter); -}; +const jsTokens = __nccwpck_require__(1531); -module.exports = npmRunPath; -// TODO: Remove this for the next major release -module.exports.default = npmRunPath; +const Chalk = __nccwpck_require__(7658); -module.exports.env = options => { - options = { - env: process.env, - ...options - }; +const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); - const env = {...options.env}; - const path = pathKey({env}); +function getDefs(chalk) { + return { + keyword: chalk.cyan, + capitalized: chalk.yellow, + jsxIdentifier: chalk.yellow, + punctuator: chalk.yellow, + number: chalk.magenta, + string: chalk.green, + regex: chalk.magenta, + comment: chalk.grey, + invalid: chalk.white.bgRed.bold + }; +} - options.path = env[path]; - env[path] = module.exports(options); +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +const BRACKET = /^[()[\]{}]$/; +let tokenize; +{ + const JSX_TAG = /^[a-z][\w-]*$/i; - return env; -}; + const getTokenType = function (token, offset, text) { + if (token.type === "name") { + if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) { + return "keyword"; + } + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " '2019-09-18 19:00:52' - * - * @example - * // Represent 18 September 2019 in ISO 9075, short format: - * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' }) - * //=> '20190918 190052' - * - * @example - * // Represent 18 September 2019 in ISO 9075 format, date only: - * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' }) - * //=> '2019-09-18' - * - * @example - * // Represent 18 September 2019 in ISO 9075 format, time only: - * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) - * //=> '19:00:52' - */ -function formatISO9075(dirtyDate, dirtyOptions) { - if (arguments.length < 1) { - throw new TypeError("1 argument required, but only ".concat(arguments.length, " present")); + if (colorize) { + highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n"); + } else { + highlighted += value; + } } - var originalDate = (0, _index.default)(dirtyDate); - - if (!(0, _index2.default)(originalDate)) { - throw new RangeError('Invalid time value'); - } + return highlighted; +} - var options = dirtyOptions || {}; - var format = options.format == null ? 'extended' : String(options.format); - var representation = options.representation == null ? 'complete' : String(options.representation); +function shouldHighlight(options) { + return !!Chalk.supportsColor || options.forceColor; +} - if (format !== 'extended' && format !== 'basic') { - throw new RangeError("format must be 'extended' or 'basic'"); - } +function getChalk(options) { + return options.forceColor ? new Chalk.constructor({ + enabled: true, + level: 1 + }) : Chalk; +} - if (representation !== 'date' && representation !== 'time' && representation !== 'complete') { - throw new RangeError("representation must be 'date', 'time', or 'complete'"); +function highlight(code, options = {}) { + if (shouldHighlight(options)) { + const chalk = getChalk(options); + const defs = getDefs(chalk); + return highlightTokens(defs, code); + } else { + return code; } +} - var result = ''; - var dateDelimiter = format === 'extended' ? '-' : ''; - var timeDelimiter = format === 'extended' ? ':' : ''; // Representation is either 'date' or 'complete' - - if (representation !== 'time') { - var day = (0, _index3.default)(originalDate.getDate(), 2); - var month = (0, _index3.default)(originalDate.getMonth() + 1, 2); - var year = (0, _index3.default)(originalDate.getFullYear(), 4); // yyyyMMdd or yyyy-MM-dd. - - result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day); - } // Representation is either 'time' or 'complete' +/***/ }), +/***/ 6538: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (representation !== 'date') { - var hour = (0, _index3.default)(originalDate.getHours(), 2); - var minute = (0, _index3.default)(originalDate.getMinutes(), 2); - var second = (0, _index3.default)(originalDate.getSeconds(), 2); // If there's also date, separate it with time with a space +"use strict"; +/* module decorator */ module = __nccwpck_require__.nmd(module); - var separator = result === '' ? '' : ' '; // HHmmss or HH:mm:ss. +const colorConvert = __nccwpck_require__(5458); - result = "".concat(result).concat(separator).concat(hour).concat(timeDelimiter).concat(minute).concat(timeDelimiter).concat(second); - } +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; - return result; -} +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; -module.exports = exports.default; +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], -"use strict"; + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = lastDayOfMonth; + // Fix humans + styles.color.grey = styles.color.gray; -var _index = _interopRequireDefault(__webpack_require__(773)); + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; -var _index2 = _interopRequireDefault(__webpack_require__(217)); + for (const styleName of Object.keys(group)) { + const style = group[styleName]; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; -/** - * @name lastDayOfMonth - * @category Month Helpers - * @summary Return the last day of a month for the given date. - * - * @description - * Return the last day of a month for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the original date - * @returns {Date} the last day of a month - * @throws {TypeError} 1 argument required - * - * @example - * // The last day of a month for 2 September 2014 11:55:00: - * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 00:00:00 - */ -function lastDayOfMonth(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var month = date.getMonth(); - date.setFullYear(date.getFullYear(), month + 1, 0); - date.setHours(0, 0, 0, 0); - return date; -} + group[styleName] = styles[styleName]; -module.exports = exports.default; + codes.set(style[0], style[1]); + } -/***/ }), -/* 19 */, -/* 20 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); -"use strict"; + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculatePulse = exports.calculateDrift = void 0; -const date_fns_1 = __webpack_require__(684); -const DAYS_PER_YEAR = 365.25; -/** - * Time since last version update. - * Measure of dependency drift. - */ -const calculateDrift = (currentVersion, latestVersion) => date_fns_1.differenceInDays(date_fns_1.parseISO(latestVersion), date_fns_1.parseISO(currentVersion)) / - DAYS_PER_YEAR; -exports.calculateDrift = calculateDrift; -/** - * Time since latest version release. - * Pulse check of dependency activity and maintenance. - */ -const calculatePulse = (latestVersion) => date_fns_1.differenceInDays(Date.now(), date_fns_1.parseISO(latestVersion)) / DAYS_PER_YEAR; -exports.calculatePulse = calculatePulse; + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; -/***/ }), -/* 21 */ -/***/ (function(module, exports) { + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; -"use strict"; + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = startOfYesterday; + const suite = colorConvert[key]; -/** - * @name startOfYesterday - * @category Day Helpers - * @summary Return the start of yesterday. - * @pure false - * - * @description - * Return the start of yesterday. - * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `new Date()` internally hence impure and can't be safely curried. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @returns {Date} the start of yesterday - * - * @example - * // If today is 6 October 2014: - * const result = startOfYesterday() - * //=> Sun Oct 5 2014 00:00:00 - */ -function startOfYesterday() { - var now = new Date(); - var year = now.getFullYear(); - var month = now.getMonth(); - var day = now.getDate(); - var date = new Date(0); - date.setFullYear(year, month, day - 1); - date.setHours(0, 0, 0, 0); - return date; -} + if (key === 'ansi16') { + key = 'ansi'; + } -module.exports = exports.default; + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } -/***/ }), -/* 22 */, -/* 23 */, -/* 24 */, -/* 25 */, -/* 26 */, -/* 27 */, -/* 28 */, -/* 29 */, -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } -"use strict"; + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + return styles; +} -Object.defineProperty(exports, "__esModule", { - value: true +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles }); -exports.default = void 0; -var _index = _interopRequireDefault(__webpack_require__(554)); -var _index2 = _interopRequireDefault(__webpack_require__(93)); +/***/ }), -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ 7658: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; -var parseOrdinalNumberPattern = /\d+/i; -var matchEraPatterns = { - narrow: /^(b|a)/i, - abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, - wide: /^(before christ|before common era|anno domini|common era)/i -}; -var parseEraPatterns = { - any: [/^b/i, /^(a|c)/i] -}; -var matchQuarterPatterns = { - narrow: /^[1234]/i, - abbreviated: /^q[1234]/i, - wide: /^[1234](th|st|nd|rd)? quarter/i -}; -var parseQuarterPatterns = { - any: [/1/i, /2/i, /3/i, /4/i] -}; -var matchMonthPatterns = { - narrow: /^[jfmasond]/i, - abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, - wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i -}; -var parseMonthPatterns = { - narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i], - any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] -}; -var matchDayPatterns = { - narrow: /^[smtwf]/i, - short: /^(su|mo|tu|we|th|fr|sa)/i, - abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, - wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i -}; -var parseDayPatterns = { - narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], - any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] -}; -var matchDayPeriodPatterns = { - narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, - any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i -}; -var parseDayPeriodPatterns = { - any: { - am: /^a/i, - pm: /^p/i, - midnight: /^mi/i, - noon: /^no/i, - morning: /morning/i, - afternoon: /afternoon/i, - evening: /evening/i, - night: /night/i - } -}; -var match = { - ordinalNumber: (0, _index.default)({ - matchPattern: matchOrdinalNumberPattern, - parsePattern: parseOrdinalNumberPattern, - valueCallback: function (value) { - return parseInt(value, 10); - } - }), - era: (0, _index2.default)({ - matchPatterns: matchEraPatterns, - defaultMatchWidth: 'wide', - parsePatterns: parseEraPatterns, - defaultParseWidth: 'any' - }), - quarter: (0, _index2.default)({ - matchPatterns: matchQuarterPatterns, - defaultMatchWidth: 'wide', - parsePatterns: parseQuarterPatterns, - defaultParseWidth: 'any', - valueCallback: function (index) { - return index + 1; - } - }), - month: (0, _index2.default)({ - matchPatterns: matchMonthPatterns, - defaultMatchWidth: 'wide', - parsePatterns: parseMonthPatterns, - defaultParseWidth: 'any' - }), - day: (0, _index2.default)({ - matchPatterns: matchDayPatterns, - defaultMatchWidth: 'wide', - parsePatterns: parseDayPatterns, - defaultParseWidth: 'any' - }), - dayPeriod: (0, _index2.default)({ - matchPatterns: matchDayPeriodPatterns, - defaultMatchWidth: 'any', - parsePatterns: parseDayPeriodPatterns, - defaultParseWidth: 'any' - }) -}; -var _default = match; -exports.default = _default; -module.exports = exports.default; +"use strict"; -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { +const escapeStringRegexp = __nccwpck_require__(8691); +const ansiStyles = __nccwpck_require__(6538); +const stdoutColor = (__nccwpck_require__(5317).stdout); -"use strict"; +const template = __nccwpck_require__(2558); +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = eachMinuteOfInterval; +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; -var _index = _interopRequireDefault(__webpack_require__(263)); +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); -var _index2 = _interopRequireDefault(__webpack_require__(773)); +const styles = Object.create(null); -var _index3 = _interopRequireDefault(__webpack_require__(728)); +function applyOptions(obj, options) { + options = options || {}; -var _index4 = _interopRequireDefault(__webpack_require__(217)); + // Detect level if not set manually + const scLevel = stdoutColor ? stdoutColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); -/** - * @name eachMinuteOfInterval - * @category Interval Helpers - * @summary Return the array of minutes within the specified time interval. - * - * @description - * Returns the array of minutes within the specified time interval. - * - * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} - * @param {Object} [options] - an object with options. - * @param {Number} [options.step=1] - the step to increment by. The starts of minutes from the hour of the interval start to the hour of the interval end - * @throws {TypeError} 1 argument requie value should be more than 1. - * @returns {Date[]} the array withred - * @throws {RangeError} `options.step` must be a number equal or greater than 1 - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` - * - * @example - * // Each minute between 14 October 2020, 13:00 and 14 October 2020, 13:03 - * const result = eachMinuteOfInterval({ - * start: new Date(2014, 9, 14, 13), - * end: new Date(2014, 9, 14, 13, 3) - * }) - * //=> [ - * // Wed Oct 14 2014 13:00:00, - * // Wed Oct 14 2014 13:01:00, - * // Wed Oct 14 2014 13:02:00, - * // Wed Oct 14 2014 13:03:00 - * // ] - */ -function eachMinuteOfInterval(interval, options) { - (0, _index4.default)(1, arguments); - var startDate = (0, _index3.default)((0, _index2.default)(interval.start)); - var endDate = (0, _index3.default)((0, _index2.default)(interval.end)); - var startTime = startDate.getTime(); - var endTime = endDate.getTime(); + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; - if (startTime >= endTime) { - throw new RangeError('Invalid interval'); - } + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); - var dates = []; - var currentDate = startDate; - var step = options && 'step' in options ? Number(options.step) : 1; - if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number equal or greater than 1'); + chalk.template.constructor = Chalk; - while (currentDate.getTime() <= endTime) { - dates.push((0, _index2.default)(currentDate)); - currentDate = (0, _index.default)(currentDate, step); - } + return chalk.template; + } - return dates; + applyOptions(this, options); } -module.exports = exports.default; +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} -/***/ }), -/* 32 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); -"use strict"; + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); + } + }; +} -const errorEx = __webpack_require__(518); -const fallback = __webpack_require__(938); -const {default: LinesAndColumns} = __webpack_require__(552); -const {codeFrameColumns} = __webpack_require__(819); +styles.visible = { + get() { + return build.call(this, this._styles || [], true, 'visible'); + } +}; -const JSONError = errorEx('JSONError', { - fileName: errorEx.append('in %s'), - codeFrame: errorEx.append('\n\n%s\n') -}); - -const parseJson = (string, reviver, filename) => { - if (typeof reviver === 'string') { - filename = reviver; - reviver = null; +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; } - try { - try { - return JSON.parse(string, reviver); - } catch (error) { - fallback(string, reviver); - throw error; + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; } - } catch (error) { - error.message = error.message.replace(/\n/g, ''); - const indexMatch = error.message.match(/in JSON at position (\d+) while parsing/); + }; +} - const jsonError = new JSONError(error); - if (filename) { - jsonError.fileName = filename; +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; } + }; +} - if (indexMatch && indexMatch.length > 0) { - const lines = new LinesAndColumns(string); - const index = Number(indexMatch[1]); - const location = lines.locationForIndex(index); +const proto = Object.defineProperties(() => {}, styles); - const codeFrame = codeFrameColumns( - string, - {start: {line: location.line + 1, column: location.column + 1}}, - {highlightCode: true} - ); +function build(_styles, _empty, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; - jsonError.codeFrame = codeFrame; - } + builder._styles = _styles; + builder._empty = _empty; - throw jsonError; - } -}; + const self = this; -parseJson.JSONError = JSONError; + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); -module.exports = parseJson; + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; -/***/ }), -/* 33 */, -/* 34 */, -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto -"use strict"; + return builder; +} +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = startOfUTCWeek; + if (argsLen === 0) { + return ''; + } -var _index = _interopRequireDefault(__webpack_require__(841)); + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } -var _index2 = _interopRequireDefault(__webpack_require__(773)); + if (!this.enabled || this.level <= 0 || !str) { + return this._empty ? '' : str; + } -var _index3 = _interopRequireDefault(__webpack_require__(217)); + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + for (const code of this._styles.slice().reverse()) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function startOfUTCWeek(dirtyDate, dirtyOptions) { - (0, _index3.default)(1, arguments); - var options = dirtyOptions || {}; - var locale = options.locale; - var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; - var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index.default)(localeWeekStartsOn); - var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index.default)(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); - } + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; - var date = (0, _index2.default)(dirtyDate); - var day = date.getUTCDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - date.setUTCDate(date.getUTCDate() - diff); - date.setUTCHours(0, 0, 0, 0); - return date; + return str; } -module.exports = exports.default; - -/***/ }), -/* 36 */, -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = closestTo; + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } -var _index = _interopRequireDefault(__webpack_require__(773)); + return template(chalk, parts.join('')); +} -var _index2 = _interopRequireDefault(__webpack_require__(217)); +Object.defineProperties(Chalk.prototype, styles); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = stdoutColor; +module.exports["default"] = module.exports; // For TypeScript -/** - * @name closestTo - * @category Common Helpers - * @summary Return a date from the array closest to the given date. - * - * @description - * Return a date from the array closest to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * - Now, `closestTo` doesn't throw an exception - * when the second argument is not an array, and returns Invalid Date instead. - * - * @param {Date|Number} dateToCompare - the date to compare with - * @param {Date[]|Number[]} datesArray - the array to search - * @returns {Date} the date from the array closest to the given date - * @throws {TypeError} 2 arguments required - * - * @example - * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030? - * var dateToCompare = new Date(2015, 8, 6) - * var result = closestTo(dateToCompare, [ - * new Date(2000, 0, 1), - * new Date(2030, 0, 1) - * ]) - * //=> Tue Jan 01 2030 00:00:00 - */ -function closestTo(dirtyDateToCompare, dirtyDatesArray) { - (0, _index2.default)(2, arguments); - var dateToCompare = (0, _index.default)(dirtyDateToCompare); - if (isNaN(dateToCompare)) { - return new Date(NaN); - } +/***/ }), - var timeToCompare = dateToCompare.getTime(); - var datesArray; // `dirtyDatesArray` is undefined or null +/***/ 2558: +/***/ ((module) => { - if (dirtyDatesArray == null) { - datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method - } else if (typeof dirtyDatesArray.forEach === 'function') { - datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array - } else { - datesArray = Array.prototype.slice.call(dirtyDatesArray); - } +"use strict"; - var result; - var minDistance; - datesArray.forEach(function (dirtyDate) { - var currentDate = (0, _index.default)(dirtyDate); +const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; +const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; +const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; +const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; - if (isNaN(currentDate)) { - result = new Date(NaN); - minDistance = NaN; - return; - } +const ESCAPES = new Map([ + ['n', '\n'], + ['r', '\r'], + ['t', '\t'], + ['b', '\b'], + ['f', '\f'], + ['v', '\v'], + ['0', '\0'], + ['\\', '\\'], + ['e', '\u001B'], + ['a', '\u0007'] +]); - var distance = Math.abs(timeToCompare - currentDate.getTime()); +function unescape(c) { + if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) { + return String.fromCharCode(parseInt(c.slice(1), 16)); + } - if (result == null || distance < minDistance) { - result = currentDate; - minDistance = distance; - } - }); - return result; + return ESCAPES.get(c) || c; } -module.exports = exports.default; - -/***/ }), -/* 38 */ -/***/ (function(module, exports) { +function parseArguments(name, args) { + const results = []; + const chunks = args.trim().split(/\s*,\s*/g); + let matches; -"use strict"; + for (const chunk of chunks) { + if (!isNaN(chunk)) { + results.push(Number(chunk)); + } else if ((matches = chunk.match(STRING_REGEX))) { + results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); + } + } + return results; +} -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = assign; +function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; -function assign(target, dirtyObject) { - if (target == null) { - throw new TypeError('assign requires that input parameter not be null or undefined'); - } + const results = []; + let matches; - dirtyObject = dirtyObject || {}; + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; - for (var property in dirtyObject) { - if (dirtyObject.hasOwnProperty(property)) { - target[property] = dirtyObject[property]; - } - } + if (matches[2]) { + const args = parseArguments(name, matches[2]); + results.push([name].concat(args)); + } else { + results.push([name]); + } + } - return target; + return results; } -module.exports = exports.default; +function buildStyle(chalk, styles) { + const enabled = {}; -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { + for (const layer of styles) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } + } -"use strict"; + let current = chalk; + for (const styleName of Object.keys(enabled)) { + if (Array.isArray(enabled[styleName])) { + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } + if (enabled[styleName].length > 0) { + current = current[styleName].apply(current, enabled[styleName]); + } else { + current = current[styleName]; + } + } + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = addHours; + return current; +} -var _index = _interopRequireDefault(__webpack_require__(841)); +module.exports = (chalk, tmp) => { + const styles = []; + const chunks = []; + let chunk = []; -var _index2 = _interopRequireDefault(__webpack_require__(120)); + // eslint-disable-next-line max-params + tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { + if (escapeChar) { + chunk.push(unescape(escapeChar)); + } else if (style) { + const str = chunk.join(''); + chunk = []; + chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str)); + styles.push({inverse, styles: parseStyle(style)}); + } else if (close) { + if (styles.length === 0) { + throw new Error('Found extraneous } in Chalk template literal'); + } -var _index3 = _interopRequireDefault(__webpack_require__(217)); + chunks.push(buildStyle(chalk, styles)(chunk.join(''))); + chunk = []; + styles.pop(); + } else { + chunk.push(chr); + } + }); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + chunks.push(chunk.join('')); -var MILLISECONDS_IN_HOUR = 3600000; -/** - * @name addHours - * @category Hour Helpers - * @summary Add the specified number of hours to the given date. - * - * @description - * Add the specified number of hours to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of hours to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the hours added - * @throws {TypeError} 2 arguments required - * - * @example - * // Add 2 hours to 10 July 2014 23:00:00: - * const result = addHours(new Date(2014, 6, 10, 23, 0), 2) - * //=> Fri Jul 11 2014 01:00:00 - */ + if (styles.length > 0) { + const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; + throw new Error(errMsg); + } -function addHours(dirtyDate, dirtyAmount) { - (0, _index3.default)(2, arguments); - var amount = (0, _index.default)(dirtyAmount); - return (0, _index2.default)(dirtyDate, amount * MILLISECONDS_IN_HOUR); -} + return chunks.join(''); +}; -module.exports = exports.default; /***/ }), -/* 40 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; +/***/ 591: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ExplorerSync = void 0; - -var _path = _interopRequireDefault(__webpack_require__(492)); +/* MIT license */ +var cssKeywords = __nccwpck_require__(2780); -var _ExplorerBase = __webpack_require__(594); +// NOTE: conversions should only return primitive values (i.e. arrays, or +// values that give correct `typeof` results). +// do not use box values types (i.e. Number(), String(), etc.) -var _readFile = __webpack_require__(780); +var reverseKeywords = {}; +for (var key in cssKeywords) { + if (cssKeywords.hasOwnProperty(key)) { + reverseKeywords[cssKeywords[key]] = key; + } +} -var _cacheWrapper = __webpack_require__(270); +var convert = module.exports = { + rgb: {channels: 3, labels: 'rgb'}, + hsl: {channels: 3, labels: 'hsl'}, + hsv: {channels: 3, labels: 'hsv'}, + hwb: {channels: 3, labels: 'hwb'}, + cmyk: {channels: 4, labels: 'cmyk'}, + xyz: {channels: 3, labels: 'xyz'}, + lab: {channels: 3, labels: 'lab'}, + lch: {channels: 3, labels: 'lch'}, + hex: {channels: 1, labels: ['hex']}, + keyword: {channels: 1, labels: ['keyword']}, + ansi16: {channels: 1, labels: ['ansi16']}, + ansi256: {channels: 1, labels: ['ansi256']}, + hcg: {channels: 3, labels: ['h', 'c', 'g']}, + apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, + gray: {channels: 1, labels: ['gray']} +}; -var _getDirectory = __webpack_require__(898); +// hide .channels and .labels properties +for (var model in convert) { + if (convert.hasOwnProperty(model)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } -class ExplorerSync extends _ExplorerBase.ExplorerBase { - constructor(options) { - super(options); - } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } - searchSync(searchFrom = process.cwd()) { - const startDirectory = (0, _getDirectory.getDirectorySync)(searchFrom); - const result = this.searchFromDirectorySync(startDirectory); - return result; - } + var channels = convert[model].channels; + var labels = convert[model].labels; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); + } +} - searchFromDirectorySync(dir) { - const absoluteDir = _path.default.resolve(process.cwd(), dir); +convert.rgb.hsl = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h; + var s; + var l; - const run = () => { - const result = this.searchDirectorySync(absoluteDir); - const nextDir = this.nextDirectoryToSearch(absoluteDir, result); + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } - if (nextDir) { - return this.searchFromDirectorySync(nextDir); - } + h = Math.min(h * 60, 360); - const transformResult = this.config.transform(result); - return transformResult; - }; + if (h < 0) { + h += 360; + } - if (this.searchCache) { - return (0, _cacheWrapper.cacheWrapperSync)(this.searchCache, absoluteDir, run); - } + l = (min + max) / 2; - return run(); - } + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } - searchDirectorySync(dir) { - for (const place of this.config.searchPlaces) { - const placeResult = this.loadSearchPlaceSync(dir, place); + return [h, s * 100, l * 100]; +}; - if (this.shouldSearchStopWithResult(placeResult) === true) { - return placeResult; - } - } // config not found +convert.rgb.hsv = function (rgb) { + var rdif; + var gdif; + var bdif; + var h; + var s; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var v = Math.max(r, g, b); + var diff = v - Math.min(r, g, b); + var diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; - return null; - } + if (diff === 0) { + h = s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); - loadSearchPlaceSync(dir, place) { - const filepath = _path.default.join(dir, place); + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } - const content = (0, _readFile.readFileSync)(filepath); - const result = this.createCosmiconfigResultSync(filepath, content); - return result; - } + return [ + h * 360, + s * 100, + v * 100 + ]; +}; - loadFileContentSync(filepath, content) { - if (content === null) { - return null; - } +convert.rgb.hwb = function (rgb) { + var r = rgb[0]; + var g = rgb[1]; + var b = rgb[2]; + var h = convert.rgb.hsl(rgb)[0]; + var w = 1 / 255 * Math.min(r, Math.min(g, b)); - if (content.trim() === '') { - return undefined; - } + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - const loader = this.getLoaderEntryForFile(filepath); - const loaderResult = loader(filepath, content); - return loaderResult; - } + return [h, w * 100, b * 100]; +}; - createCosmiconfigResultSync(filepath, content) { - const fileContent = this.loadFileContentSync(filepath, content); - const result = this.loadedContentToCosmiconfigResult(filepath, fileContent); - return result; - } +convert.rgb.cmyk = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var c; + var m; + var y; + var k; - loadSync(filepath) { - this.validateFilePath(filepath); + k = Math.min(1 - r, 1 - g, 1 - b); + c = (1 - r - k) / (1 - k) || 0; + m = (1 - g - k) / (1 - k) || 0; + y = (1 - b - k) / (1 - k) || 0; - const absoluteFilePath = _path.default.resolve(process.cwd(), filepath); + return [c * 100, m * 100, y * 100, k * 100]; +}; - const runLoadSync = () => { - const content = (0, _readFile.readFileSync)(absoluteFilePath, { - throwNotFound: true - }); - const cosmiconfigResult = this.createCosmiconfigResultSync(absoluteFilePath, content); - const transformResult = this.config.transform(cosmiconfigResult); - return transformResult; - }; +/** + * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + * */ +function comparativeDistance(x, y) { + return ( + Math.pow(x[0] - y[0], 2) + + Math.pow(x[1] - y[1], 2) + + Math.pow(x[2] - y[2], 2) + ); +} - if (this.loadCache) { - return (0, _cacheWrapper.cacheWrapperSync)(this.loadCache, absoluteFilePath, runLoadSync); - } +convert.rgb.keyword = function (rgb) { + var reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } - return runLoadSync(); - } + var currentClosestDistance = Infinity; + var currentClosestKeyword; -} + for (var keyword in cssKeywords) { + if (cssKeywords.hasOwnProperty(keyword)) { + var value = cssKeywords[keyword]; -exports.ExplorerSync = ExplorerSync; -//# sourceMappingURL=ExplorerSync.js.map + // Compute comparative distance + var distance = comparativeDistance(rgb, value); -/***/ }), -/* 41 */, -/* 42 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + } -const Range = __webpack_require__(57) + return currentClosestKeyword; +}; -// Mostly just for testing and legacy API reasons -const toComparators = (range, options) => - new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) +convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; +}; -module.exports = toComparators +convert.rgb.xyz = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + // assume sRGB + r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); + g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); + b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); -/***/ }), -/* 43 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); -const SemVer = __webpack_require__(653) -const Range = __webpack_require__(57) -const gt = __webpack_require__(827) + return [x * 100, y * 100, z * 100]; +}; -const minVersion = (range, loose) => { - range = new Range(range, loose) +convert.rgb.lab = function (rgb) { + var xyz = convert.rgb.xyz(rgb); + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; - let minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } + x /= 95.047; + y /= 100; + z /= 108.883; - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); - minver = null - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); - let setMin = null - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!setMin || gt(compver, setMin)) { - setMin = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`) - } - }) - if (setMin && (!minver || gt(minver, setMin))) - minver = setMin - } + return [l, a, b]; +}; - if (minver && range.test(minver)) { - return minver - } +convert.hsl.rgb = function (hsl) { + var h = hsl[0] / 360; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var t1; + var t2; + var t3; + var rgb; + var val; - return null -} -module.exports = minVersion + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } -/***/ }), -/* 44 */, -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { + t1 = 2 * l - t2; -"use strict"; + rgb = [0, 0, 0]; + for (var i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } + if (t3 > 1) { + t3--; + } + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = startOfWeekYear; + rgb[i] = val * 255; + } -var _index = _interopRequireDefault(__webpack_require__(646)); + return rgb; +}; -var _index2 = _interopRequireDefault(__webpack_require__(343)); +convert.hsl.hsv = function (hsl) { + var h = hsl[0]; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var smin = s; + var lmin = Math.max(l, 0.01); + var sv; + var v; -var _index3 = _interopRequireDefault(__webpack_require__(841)); + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + v = (l + s) / 2; + sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); -var _index4 = _interopRequireDefault(__webpack_require__(217)); + return [h, sv * 100, v * 100]; +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +convert.hsv.rgb = function (hsv) { + var h = hsv[0] / 60; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var hi = Math.floor(h) % 6; -/** - * @name startOfWeekYear - * @category Week-Numbering Year Helpers - * @summary Return the start of a local week-numbering year for the given date. - * - * @description - * Return the start of a local week-numbering year. - * The exact calculation depends on the values of - * `options.weekStartsOn` (which is the index of the first day of the week) - * and `options.firstWeekContainsDate` (which is the day of January, which is always in - * the first week of the week-numbering year) - * - * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the original date - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year - * @returns {Date} the start of a week-numbering year - * @throws {TypeError} 1 argument required - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 - * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 - * - * @example - * // The start of an a week-numbering year for 2 July 2005 with default settings: - * var result = startOfWeekYear(new Date(2005, 6, 2)) - * //=> Sun Dec 26 2004 00:00:00 - * - * @example - * // The start of a week-numbering year for 2 July 2005 - * // if Monday is the first day of week - * // and 4 January is always in the first week of the year: - * var result = startOfWeekYear(new Date(2005, 6, 2), { - * weekStartsOn: 1, - * firstWeekContainsDate: 4 - * }) - * //=> Mon Jan 03 2005 00:00:00 - */ -function startOfWeekYear(dirtyDate, dirtyOptions) { - (0, _index4.default)(1, arguments); - var options = dirtyOptions || {}; - var locale = options.locale; - var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; - var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0, _index3.default)(localeFirstWeekContainsDate); - var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0, _index3.default)(options.firstWeekContainsDate); - var year = (0, _index.default)(dirtyDate, dirtyOptions); - var firstWeek = new Date(0); - firstWeek.setFullYear(year, 0, firstWeekContainsDate); - firstWeek.setHours(0, 0, 0, 0); - var date = (0, _index2.default)(firstWeek, dirtyOptions); - return date; -} + var f = h - Math.floor(h); + var p = 255 * v * (1 - s); + var q = 255 * v * (1 - (s * f)); + var t = 255 * v * (1 - (s * (1 - f))); + v *= 255; -module.exports = exports.default; + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } +}; -/***/ }), -/* 46 */, -/* 47 */, -/* 48 */, -/* 49 */, -/* 50 */, -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { +convert.hsv.hsl = function (hsv) { + var h = hsv[0]; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var vmin = Math.max(v, 0.01); + var lmin; + var sl; + var l; -"use strict"; + l = (2 - s) * v; + lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + return [h, sl * 100, l * 100]; +}; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = intervalToDuration; +// http://dev.w3.org/csswg/css-color/#hwb-to-rgb +convert.hwb.rgb = function (hwb) { + var h = hwb[0] / 360; + var wh = hwb[1] / 100; + var bl = hwb[2] / 100; + var ratio = wh + bl; + var i; + var v; + var f; + var n; -var _index = _interopRequireDefault(__webpack_require__(432)); + // wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } -var _index2 = _interopRequireDefault(__webpack_require__(380)); + i = Math.floor(6 * h); + v = 1 - bl; + f = 6 * h - i; -var _index3 = _interopRequireDefault(__webpack_require__(549)); + if ((i & 0x01) !== 0) { + f = 1 - f; + } -var _index4 = _interopRequireDefault(__webpack_require__(936)); + n = wh + f * (v - wh); // linear interpolation -var _index5 = _interopRequireDefault(__webpack_require__(458)); + var r; + var g; + var b; + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; + } -var _index6 = _interopRequireDefault(__webpack_require__(128)); + return [r * 255, g * 255, b * 255]; +}; -var _index7 = _interopRequireDefault(__webpack_require__(437)); +convert.cmyk.rgb = function (cmyk) { + var c = cmyk[0] / 100; + var m = cmyk[1] / 100; + var y = cmyk[2] / 100; + var k = cmyk[3] / 100; + var r; + var g; + var b; -var _index8 = _interopRequireDefault(__webpack_require__(909)); + r = 1 - Math.min(1, c * (1 - k) + k); + g = 1 - Math.min(1, m * (1 - k) + k); + b = 1 - Math.min(1, y * (1 - k) + k); -var _index9 = _interopRequireDefault(__webpack_require__(217)); + return [r * 255, g * 255, b * 255]; +}; -var _index10 = _interopRequireDefault(__webpack_require__(773)); +convert.xyz.rgb = function (xyz) { + var x = xyz[0] / 100; + var y = xyz[1] / 100; + var z = xyz[2] / 100; + var r; + var g; + var b; -var _index11 = _interopRequireDefault(__webpack_require__(759)); + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // assume sRGB + r = r > 0.0031308 + ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) + : r * 12.92; -/** - * @name intervalToDuration - * @category Common Helpers - * @summary Convert interval to duration - * - * @description - * Convert a interval object to a duration object. - * - * @param {Interval} interval - the interval to convert to duration - * - * @returns {Duration} The duration Object - * @throws {TypeError} Requires 2 arguments - * @throws {RangeError} `start` must not be Invalid Date - * @throws {RangeError} `end` must not be Invalid Date - * - * @example - * // Get the duration between January 15, 1929 and April 4, 1968. - * intervalToDuration({ - * start: new Date(1929, 0, 15, 12, 0, 0), - * end: new Date(1968, 3, 4, 19, 5, 0) - * }) - * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 } - */ -function intervalToDuration(_ref) { - var start = _ref.start, - end = _ref.end; - (0, _index9.default)(1, arguments); - var dateLeft = (0, _index10.default)(start); - var dateRight = (0, _index10.default)(end); + g = g > 0.0031308 + ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) + : g * 12.92; - if (!(0, _index8.default)(dateLeft)) { - throw new RangeError('Start Date is invalid'); - } + b = b > 0.0031308 + ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) + : b * 12.92; - if (!(0, _index8.default)(dateRight)) { - throw new RangeError('End Date is invalid'); - } + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); - var duration = { - years: 0, - months: 0, - days: 0, - hours: 0, - minutes: 0, - seconds: 0 - }; - var sign = (0, _index.default)(dateLeft, dateRight); - duration.years = Math.abs((0, _index2.default)(dateLeft, dateRight)); - var remainingMonths = (0, _index11.default)(dateLeft, { - years: sign * duration.years - }); - duration.months = Math.abs((0, _index3.default)(remainingMonths, dateRight)); - var remainingDays = (0, _index11.default)(remainingMonths, { - months: sign * duration.months - }); - duration.days = Math.abs((0, _index4.default)(remainingDays, dateRight)); - var remainingHours = (0, _index11.default)(remainingDays, { - days: sign * duration.days - }); - duration.hours = Math.abs((0, _index5.default)(remainingHours, dateRight)); - var remainingMinutes = (0, _index11.default)(remainingHours, { - hours: sign * duration.hours - }); - duration.minutes = Math.abs((0, _index6.default)(remainingMinutes, dateRight)); - var remainingSeconds = (0, _index11.default)(remainingMinutes, { - minutes: sign * duration.minutes - }); - duration.seconds = Math.abs((0, _index7.default)(remainingSeconds, dateRight)); - return duration; -} + return [r * 255, g * 255, b * 255]; +}; -module.exports = exports.default; +convert.xyz.lab = function (xyz) { + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; -/***/ }), -/* 52 */, -/* 53 */, -/* 54 */, -/* 55 */, -/* 56 */, -/* 57 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + x /= 95.047; + y /= 100; + z /= 108.883; -// hoisted class for cyclic dependency -class Range { - constructor (range, options) { - options = parseOptions(options) + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range - } else { - return new Range(range.raw, options) - } - } + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value - this.set = [[range]] - this.format() - return this - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease + return [l, a, b]; +}; - // First, split based on boolean or || - this.raw = range - this.set = range - .split(/\s*\|\|\s*/) - // map the range to a 2d array of comparators - .map(range => this.parseRange(range.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) +convert.lab.xyz = function (lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var x; + var y; + var z; - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${range}`) - } + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0] - this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) - this.set = [first] - else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c] - break - } - } - } - } + var y2 = Math.pow(y, 3); + var x2 = Math.pow(x, 3); + var z2 = Math.pow(z, 3); + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - this.format() - } + x *= 95.047; + y *= 100; + z *= 108.883; - format () { - this.range = this.set - .map((comps) => { - return comps.join(' ').trim() - }) - .join('||') - .trim() - return this.range - } + return [x, y, z]; +}; - toString () { - return this.range - } +convert.lab.lch = function (lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var hr; + var h; + var c; - parseRange (range) { - range = range.trim() + hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = Object.keys(this.options).join(',') - const memoKey = `parseRange:${memoOpts}:${range}` - const cached = cache.get(memoKey) - if (cached) - return cached + if (h < 0) { + h += 360; + } - const loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) + c = Math.sqrt(a * a + b * b); - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + return [l, c, h]; +}; - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) +convert.lch.lab = function (lch) { + var l = lch[0]; + var c = lch[1]; + var h = lch[2]; + var a; + var b; + var hr; - // normalize spaces - range = range.split(/\s+/).join(' ') + hr = h / 360 * 2 * Math.PI; + a = c * Math.cos(hr); + b = c * Math.sin(hr); - // At this point, the range is completely trimmed and - // ready to be split into comparators. + return [l, a, b]; +}; - const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - // in loose mode, throw out any that are not valid comparators - .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) - .map(comp => new Comparator(comp, this.options)) +convert.rgb.ansi16 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const l = rangeList.length - const rangeMap = new Map() - for (const comp of rangeList) { - if (isNullSet(comp)) - return [comp] - rangeMap.set(comp.value, comp) - } - if (rangeMap.size > 1 && rangeMap.has('')) - rangeMap.delete('') + value = Math.round(value / 50); - const result = [...rangeMap.values()] - cache.set(memoKey, result) - return result - } + if (value === 0) { + return 30; + } - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } + var ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } + if (value === 2) { + ansi += 60; + } - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } + return ansi; +}; - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } +convert.hsv.ansi16 = function (args) { + // optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); +}; - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false - } -} -module.exports = Range +convert.rgb.ansi256 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; -const LRU = __webpack_require__(702) -const cache = new LRU({ max: 1000 }) + // we use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; + } -const parseOptions = __webpack_require__(834) -const Comparator = __webpack_require__(538) -const debug = __webpack_require__(894) -const SemVer = __webpack_require__(653) -const { - re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace -} = __webpack_require__(947) + if (r > 248) { + return 231; + } -const isNullSet = c => c.value === '<0.0.0-0' -const isAny = c => c.value === '' + return Math.round(((r - 8) / 247) * 24) + 232; + } -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() + var ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) + return ansi; +}; - testComparator = remainingComparators.pop() - } +convert.ansi16.rgb = function (args) { + var color = args % 10; - return result -} + // handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} + color = color / 10.5 * 255; -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + return [color, color, color]; + } -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -const replaceTildes = (comp, options) => - comp.trim().split(/\s+/).map((comp) => { - return replaceTilde(comp, options) - }).join(' ') + var mult = (~~(args > 50) + 1) * 0.5; + var r = ((color & 1) * mult) * 255; + var g = (((color >> 1) & 1) * mult) * 255; + var b = (((color >> 2) & 1) * mult) * 255; -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret + return [r, g, b]; +}; - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } +convert.ansi256.rgb = function (args) { + // handle greyscale + if (args >= 232) { + var c = (args - 232) * 10 + 8; + return [c, c, c]; + } - debug('tilde return', ret) - return ret - }) -} + args -= 16; -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -const replaceCarets = (comp, options) => - comp.trim().split(/\s+/).map((comp) => { - return replaceCaret(comp, options) - }).join(' ') + var rem; + var r = Math.floor(args / 36) / 5 * 255; + var g = Math.floor((rem = args % 36) / 6) / 5 * 255; + var b = (rem % 6) / 5 * 255; -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret + return [r, g, b]; +}; - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } +convert.rgb.hex = function (args) { + var integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); - debug('caret return', ret) - return ret - }) -} + var string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map((comp) => { - return replaceXRange(comp, options) - }).join(' ') -} +convert.hex.rgb = function (args) { + var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp + var colorString = match[0]; - if (gtlt === '=' && anyX) { - gtlt = '' - } + if (match[0].length === 3) { + colorString = colorString.split('').map(function (char) { + return char + char; + }).join(''); + } - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' + var integer = parseInt(colorString, 16); + var r = (integer >> 16) & 0xFF; + var g = (integer >> 8) & 0xFF; + var b = integer & 0xFF; - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 + return [r, g, b]; +}; - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } +convert.rgb.hcg = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var max = Math.max(Math.max(r, g), b); + var min = Math.min(Math.min(r, g), b); + var chroma = (max - min); + var grayscale; + var hue; - if (gtlt === '<') - pr = '-0' + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma + 4; + } - debug('xRange return', ret) + hue /= 6; + hue %= 1; - return ret - }) -} + return [hue * 360, chroma * 100, grayscale * 100]; +}; -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') -} +convert.hsl.hcg = function (hsl) { + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var c = 1; + var f = 0; -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp.trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') -} + if (l < 0.5) { + c = 2.0 * s * l; + } else { + c = 2.0 * s * (1.0 - l); + } -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) => { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? '-0' : ''}` - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` - } else if (fpr) { - from = `>=${from}` - } else { - from = `>=${from}${incPr ? '-0' : ''}` - } + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0` - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0` - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}` - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0` - } else { - to = `<=${to}` - } + return [hsl[0], c * 100, f * 100]; +}; - return (`${from} ${to}`).trim() -} +convert.hsv.hcg = function (hsv) { + var s = hsv[1] / 100; + var v = hsv[2] / 100; -const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } + var c = s * v; + var f = 0; - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === Comparator.ANY) { - continue - } + if (c < 1.0) { + f = (v - c) / (1 - c); + } - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } + return [hsv[0], c * 100, f * 100]; +}; - // Version has a -pre, but it's not one of the ones we like. - return false - } +convert.hcg.rgb = function (hcg) { + var h = hcg[0] / 360; + var c = hcg[1] / 100; + var g = hcg[2] / 100; - return true -} + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } + var pure = [0, 0, 0]; + var hi = (h % 1) * 6; + var v = hi % 1; + var w = 1 - v; + var mg = 0; -/***/ }), -/* 58 */ -/***/ (function(module) { + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; + } -"use strict"; + mg = (1.0 - c) * g; -const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; +}; -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); +convert.hcg.hsv = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; -function unescape(c) { - const u = c[0] === 'u'; - const bracket = c[1] === '{'; + var v = c + g * (1.0 - c); + var f = 0; - if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); + if (v > 0.0) { + f = c / v; } - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } + return [hcg[0], f * 100, v * 100]; +}; - return ESCAPES.get(c) || c; -} +convert.hcg.hsl = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; -function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; + var l = g * (1.0 - c) + 0.5 * c; + var s = 0; - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); } - return results; -} - -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; + return [hcg[0], s * 100, l * 100]; +}; - const results = []; - let matches; +convert.hcg.hwb = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; +}; - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; +convert.hwb.hcg = function (hwb) { + var w = hwb[1] / 100; + var b = hwb[2] / 100; + var v = 1 - b; + var c = v - w; + var g = 0; - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } + if (c < 1) { + g = (v - c) / (1 - c); } - return results; -} - -function buildStyle(chalk, styles) { - const enabled = {}; - - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } + return [hwb[0], c * 100, g * 100]; +}; - let current = chalk; - for (const [styleName, styles] of Object.entries(enabled)) { - if (!Array.isArray(styles)) { - continue; - } +convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; +}; - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } +convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; +}; - current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; - } +convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +}; - return current; -} +convert.gray.hsl = convert.gray.hsv = function (args) { + return [0, 0, args[0]]; +}; -module.exports = (chalk, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; +convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; +}; - // eslint-disable-next-line max-params - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape(escapeCharacter)); - } else if (style) { - const string = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } +convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; +}; - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); +convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; +}; - chunks.push(chunk.join('')); +convert.gray.hex = function (gray) { + var val = Math.round(gray[0] / 100 * 255) & 0xFF; + var integer = (val << 16) + (val << 8) + val; - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMessage); - } + var string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; - return chunks.join(''); +convert.rgb.gray = function (rgb) { + var val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; }; /***/ }), -/* 59 */, -/* 60 */, -/* 61 */, -/* 62 */, -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +/***/ 5458: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var conversions = __nccwpck_require__(591); +var route = __nccwpck_require__(9769); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = startOfUTCISOWeek; +var convert = {}; -var _index = _interopRequireDefault(__webpack_require__(773)); +var models = Object.keys(conversions); -var _index2 = _interopRequireDefault(__webpack_require__(217)); +function wrapRaw(fn) { + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function startOfUTCISOWeek(dirtyDate) { - (0, _index2.default)(1, arguments); - var weekStartsOn = 1; - var date = (0, _index.default)(dirtyDate); - var day = date.getUTCDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - date.setUTCDate(date.getUTCDate() - diff); - date.setUTCHours(0, 0, 0, 0); - return date; + return fn(args); + }; + + // preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; } -module.exports = exports.default; +function wrapRounded(fn) { + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; + } -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } -"use strict"; + var result = fn(args); + // we're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (var len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = areIntervalsOverlapping; + return result; + }; -var _index = _interopRequireDefault(__webpack_require__(773)); + // preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } -var _index2 = _interopRequireDefault(__webpack_require__(217)); + return wrappedFn; +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +models.forEach(function (fromModel) { + convert[fromModel] = {}; -/** - * @name areIntervalsOverlapping - * @category Interval Helpers - * @summary Is the given time interval overlapping with another time interval? - * - * @description - * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * - The function was renamed from `areRangesOverlapping` to `areIntervalsOverlapping`. - * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology: - * - * ``` - * 2.1.3 - * time interval - * part of the time axis limited by two instants - * ``` - * - * Also, this function now accepts an object with `start` and `end` properties - * instead of two arguments as an interval. - * This function now throws `RangeError` if the start of the interval is after its end - * or if any date in the interval is `Invalid Date`. - * - * ```javascript - * // Before v2.0.0 - * - * areRangesOverlapping( - * new Date(2014, 0, 10), new Date(2014, 0, 20), - * new Date(2014, 0, 17), new Date(2014, 0, 21) - * ) - * - * // v2.0.0 onward - * - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } - * ) - * ``` - * - * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval} - * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval} - * @param {Object} [options] - the object with options - * @param {Boolean} [options.inclusive=false] - whether the comparison is inclusive or not - * @returns {Boolean} whether the time intervals are overlapping - * @throws {TypeError} 2 arguments required - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` - * - * @example - * // For overlapping time intervals: - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } - * ) - * //=> true - * - * @example - * // For non-overlapping time intervals: - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } - * ) - * //=> false - * - * @example - * // For adjacent time intervals: - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) } - * ) - * //=> false - * - * @example - * // Using the inclusive option: - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) } - * ) - * //=> false - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }, - * { inclusive: true } - * ) - * //=> true - */ -function areIntervalsOverlapping(dirtyIntervalLeft, dirtyIntervalRight) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - inclusive: false - }; - (0, _index2.default)(2, arguments); - var intervalLeft = dirtyIntervalLeft || {}; - var intervalRight = dirtyIntervalRight || {}; - var leftStartTime = (0, _index.default)(intervalLeft.start).getTime(); - var leftEndTime = (0, _index.default)(intervalLeft.end).getTime(); - var rightStartTime = (0, _index.default)(intervalRight.start).getTime(); - var rightEndTime = (0, _index.default)(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) { - throw new RangeError('Invalid interval'); - } + var routes = route(fromModel); + var routeModels = Object.keys(routes); - if (options.inclusive) { - return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime; - } + routeModels.forEach(function (toModel) { + var fn = routes[toModel]; - return leftStartTime < rightEndTime && rightStartTime < leftEndTime; -} + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); + +module.exports = convert; -module.exports = exports.default; /***/ }), -/* 65 */, -/* 66 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -const parse = __webpack_require__(842) -const eq = __webpack_require__(450) +/***/ 9769: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const diff = (version1, version2) => { - if (eq(version1, version2)) { - return null - } else { - const v1 = parse(version1) - const v2 = parse(version2) - const hasPre = v1.prerelease.length || v2.prerelease.length - const prefix = hasPre ? 'pre' : '' - const defaultResult = hasPre ? 'prerelease' : '' - for (const key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } - } - return defaultResult // may be undefined - } -} -module.exports = diff +var conversions = __nccwpck_require__(591); +/* + this function routes a model to all other models. -/***/ }), -/* 67 */, -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). -"use strict"; + conversions that are not possible simply are not included. +*/ +function buildGraph() { + var graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + var models = Object.keys(conversions); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getWeekOfMonth; + for (var len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } -var _index = _interopRequireDefault(__webpack_require__(4)); + return graph; +} -var _index2 = _interopRequireDefault(__webpack_require__(969)); +// https://en.wikipedia.org/wiki/Breadth-first_search +function deriveBFS(fromModel) { + var graph = buildGraph(); + var queue = [fromModel]; // unshift -> queue -> pop -var _index3 = _interopRequireDefault(__webpack_require__(431)); + graph[fromModel].distance = 0; -var _index4 = _interopRequireDefault(__webpack_require__(841)); + while (queue.length) { + var current = queue.pop(); + var adjacents = Object.keys(conversions[current]); -var _index5 = _interopRequireDefault(__webpack_require__(217)); + for (var len = adjacents.length, i = 0; i < len; i++) { + var adjacent = adjacents[i]; + var node = graph[adjacent]; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } -/** - * @name getWeekOfMonth - * @category Week Helpers - * @summary Get the week of the month of the given date. - * - * @description - * Get the week of the month of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Number} the week of month - * @throws {TypeError} 1 argument required - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 - * - * @example - * // Which week of the month is 9 November 2017? - * var result = getWeekOfMonth(new Date(2017, 10, 9)) - * //=> 2 - */ -function getWeekOfMonth(date, dirtyOptions) { - (0, _index5.default)(1, arguments); - var options = dirtyOptions || {}; - var locale = options.locale; - var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; - var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index4.default)(localeWeekStartsOn); - var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index4.default)(options.weekStartsOn); // 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'); - } - - var currentDayOfMonth = (0, _index.default)(date); - - if (isNaN(currentDayOfMonth)) { - return currentDayOfMonth; - } - - var startWeekDay = (0, _index2.default)((0, _index3.default)(date)); - var lastDayOfFirstWeek = 0; + return graph; +} - if (startWeekDay >= weekStartsOn) { - lastDayOfFirstWeek = weekStartsOn + 7 - startWeekDay; - } else { - lastDayOfFirstWeek = weekStartsOn - startWeekDay; - } +function link(from, to) { + return function (args) { + return to(from(args)); + }; +} - var weekNumber = 1; +function wrapConversion(toModel, graph) { + var path = [graph[toModel].parent, toModel]; + var fn = conversions[graph[toModel].parent][toModel]; - if (currentDayOfMonth > lastDayOfFirstWeek) { - var remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek; - weekNumber = weekNumber + Math.ceil(remainingDaysAfterFirstWeek / 7); - } + var cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } - return weekNumber; + fn.conversion = path; + return fn; } -module.exports = exports.default; +module.exports = function (fromModel) { + var graph = deriveBFS(fromModel); + var conversion = {}; -/***/ }), -/* 69 */, -/* 70 */, -/* 71 */ -/***/ (function(module) { + var models = Object.keys(graph); + for (var len = models.length, i = 0; i < len; i++) { + var toModel = models[i]; + var node = graph[toModel]; -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0' + if (node.parent === null) { + // no possible conversion, or this node is the source model. + continue; + } -const MAX_LENGTH = 256 -const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 + conversion[toModel] = wrapConversion(toModel, graph); + } -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16 + return conversion; +}; -module.exports = { - SEMVER_SPEC_VERSION, - MAX_LENGTH, - MAX_SAFE_INTEGER, - MAX_SAFE_COMPONENT_LENGTH -} /***/ }), -/* 72 */, -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +/***/ 2780: +/***/ ((module) => { +"use strict"; + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isSameSecond; -var _index = _interopRequireDefault(__webpack_require__(350)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(217)); +/***/ 3226: +/***/ ((module) => { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; -/** - * @name isSameSecond - * @category Second Helpers - * @summary Are the given dates in the same second? - * - * @description - * Are the given dates in the same second? - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} dateLeft - the first date to check - * @param {Date|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same second - * @throws {TypeError} 2 arguments required - * - * @example - * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 - * // in the same second? - * var result = isSameSecond( - * new Date(2014, 8, 4, 6, 30, 15), - * new Date(2014, 8, 4, 6, 30, 15, 500) - * ) - * //=> true - */ -function isSameSecond(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - var dateLeftStartOfSecond = (0, _index.default)(dirtyDateLeft); - var dateRightStartOfSecond = (0, _index.default)(dirtyDateRight); - return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime(); -} +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; -module.exports = exports.default; /***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +/***/ 5317: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isThisMinute; +const os = __nccwpck_require__(2037); +const hasFlag = __nccwpck_require__(3226); -var _index = _interopRequireDefault(__webpack_require__(979)); +const env = process.env; -var _index2 = _interopRequireDefault(__webpack_require__(217)); +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function translateLevel(level) { + if (level === 0) { + return false; + } -/** - * @name isThisMinute - * @category Minute Helpers - * @summary Is the given date in the same minute as the current date? - * @pure false - * - * @description - * Is the given date in the same minute as the current date? - * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `Date.now()` internally hence impure and can't be safely curried. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is in this minute - * @throws {TypeError} 1 argument required - * - * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:30:00 in this minute? - * var result = isThisMinute(new Date(2014, 8, 25, 18, 30)) - * //=> true - */ -function isThisMinute(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(Date.now(), dirtyDate); + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; } -module.exports = exports.default; +function supportsColor(stream) { + if (forceColor === false) { + return 0; + } -/***/ }), -/* 75 */, -/* 76 */, -/* 77 */, -/* 78 */, -/* 79 */, -/* 80 */, -/* 81 */, -/* 82 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } -"use strict"; + if (hasFlag('color=256')) { + return 2; + } -const path = __webpack_require__(492); -const childProcess = __webpack_require__(129); -const crossSpawn = __webpack_require__(456); -const stripFinalNewline = __webpack_require__(588); -const npmRunPath = __webpack_require__(12); -const onetime = __webpack_require__(723); -const makeError = __webpack_require__(872); -const normalizeStdio = __webpack_require__(404); -const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(709); -const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(539); -const {mergePromise, getSpawnedPromise} = __webpack_require__(797); -const {joinCommand, parseCommand} = __webpack_require__(83); + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } -const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; + const min = forceColor ? 1 : 0; -const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { - const env = extendEnv ? {...process.env, ...envOption} : envOption; + if (process.platform === 'win32') { + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(process.versions.node.split('.')[0]) >= 8 && + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } - if (preferLocal) { - return npmRunPath.env({env, cwd: localDir, execPath}); + return 1; } - return env; -}; - -const handleArguments = (file, args, options = {}) => { - const parsed = crossSpawn._parse(file, args, options); - file = parsed.command; - args = parsed.args; - options = parsed.options; - - options = { - maxBuffer: DEFAULT_MAX_BUFFER, - buffer: true, - stripFinalNewline: true, - extendEnv: true, - preferLocal: false, - localDir: options.cwd || process.cwd(), - execPath: process.execPath, - encoding: 'utf8', - reject: true, - cleanup: true, - all: false, - windowsHide: true, - ...options - }; + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } - options.env = getEnv(options); + return min; + } - options.stdio = normalizeStdio(options); + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } - if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { - // #116 - args.unshift('/q'); + if (env.COLORTERM === 'truecolor') { + return 3; } - return {file, args, options, parsed}; -}; + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); -const handleOutput = (options, value, error) => { - if (typeof value !== 'string' && !Buffer.isBuffer(value)) { - // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` - return error === undefined ? undefined : ''; + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } } - if (options.stripFinalNewline) { - return stripFinalNewline(value); + if (/-256(color)?$/i.test(env.TERM)) { + return 2; } - return value; -}; - -const execa = (file, args, options) => { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - - let spawned; - try { - spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); - } catch (error) { - // Ensure the returned error is always both a promise and a child process - const dummySpawned = new childProcess.ChildProcess(); - const errorPromise = Promise.reject(makeError({ - error, - stdout: '', - stderr: '', - all: '', - command, - parsed, - timedOut: false, - isCanceled: false, - killed: false - })); - return mergePromise(dummySpawned, errorPromise); + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; } - const spawnedPromise = getSpawnedPromise(spawned); - const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); - const processDone = setExitHandler(spawned, parsed.options, timedPromise); + if ('COLORTERM' in env) { + return 1; + } - const context = {isCanceled: false}; + if (env.TERM === 'dumb') { + return min; + } - spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); - spawned.cancel = spawnedCancel.bind(null, spawned, context); + return min; +} - const handlePromise = async () => { - const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); - const stdout = handleOutput(parsed.options, stdoutResult); - const stderr = handleOutput(parsed.options, stderrResult); - const all = handleOutput(parsed.options, allResult); +function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); +} - if (error || exitCode !== 0 || signal !== null) { - const returnedError = makeError({ - error, - exitCode, - signal, - stdout, - stderr, - all, - command, - parsed, - timedOut, - isCanceled: context.isCanceled, - killed: spawned.killed - }); +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) +}; - if (!parsed.options.reject) { - return returnedError; - } - throw returnedError; - } +/***/ }), - return { - command, - exitCode: 0, - stdout, - stderr, - all, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; - }; +/***/ 2068: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const handlePromiseOnce = onetime(handlePromise); +"use strict"; +/* module decorator */ module = __nccwpck_require__.nmd(module); - handleInput(spawned, parsed.options.input); - spawned.all = makeAllStream(spawned, parsed.options); +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; - return mergePromise(spawned, handlePromiseOnce); +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; }; -module.exports = execa; - -module.exports.sync = (file, args, options) => { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - - validateInputSync(parsed.options); +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; - let result; - try { - result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); - } catch (error) { - throw makeError({ - error, - stdout: '', - stderr: '', - all: '', - command, - parsed, - timedOut: false, - isCanceled: false, - killed: false - }); - } +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; - const stdout = handleOutput(parsed.options, result.stdout, result.error); - const stderr = handleOutput(parsed.options, result.stderr, result.error); +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); - if (result.error || result.status !== 0 || result.signal !== null) { - const error = makeError({ - stdout, - stderr, - error: result.error, - signal: result.signal, - exitCode: result.status, - command, - parsed, - timedOut: result.error && result.error.code === 'ETIMEDOUT', - isCanceled: false, - killed: result.signal !== null - }); + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); - if (!parsed.options.reject) { - return error; - } + return value; + }, + enumerable: true, + configurable: true + }); +}; - throw error; +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = __nccwpck_require__(6931); } - return { - command, - exitCode: 0, - stdout, - stderr, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; -}; + const offset = isBackground ? 10 : 0; + const styles = {}; -module.exports.command = (command, options) => { - const [file, ...args] = parseCommand(command); - return execa(file, args, options); -}; + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } -module.exports.commandSync = (command, options) => { - const [file, ...args] = parseCommand(command); - return execa.sync(file, args, options); + return styles; }; -module.exports.node = (scriptPath, args, options = {}) => { - if (args && !Array.isArray(args) && typeof args === 'object') { - options = args; - args = []; - } - - const stdio = normalizeStdio.node(options); - const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect')); +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], - const { - nodePath = process.execPath, - nodeOptions = defaultExecArgv - } = options; + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], - return execa( - nodePath, - [ - ...nodeOptions, - scriptPath, - ...(Array.isArray(args) ? args : []) - ], - { - ...options, - stdin: undefined, - stdout: undefined, - stderr: undefined, - stdio, - shell: false + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] } - ); -}; + }; + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; -/***/ }), -/* 83 */ -/***/ (function(module) { + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; -"use strict"; + group[styleName] = styles[styleName]; -const SPACES_REGEXP = / +/g; + codes.set(style[0], style[1]); + } -const joinCommand = (file, args = []) => { - if (!Array.isArray(args)) { - return file; + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); } - return [file, ...args].join(' '); -}; - -// Handle `execa.command()` -const parseCommand = command => { - const tokens = []; - for (const token of command.trim().split(SPACES_REGEXP)) { - // Allow spaces to be escaped by a backslash if not meant as a delimiter - const previousToken = tokens[tokens.length - 1]; - if (previousToken && previousToken.endsWith('\\')) { - // Merge previous token with current one - tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; - } else { - tokens.push(token); - } - } + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); - return tokens; -}; + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; -module.exports = { - joinCommand, - parseCommand -}; + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + return styles; +} -/***/ }), -/* 84 */, -/* 85 */, -/* 86 */, -/* 87 */ -/***/ (function(module) { +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); -module.exports = require("os"); /***/ }), -/* 88 */, -/* 89 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -// just pre-load all the stuff that index.js lazily exports -const internalRe = __webpack_require__(947) -module.exports = { - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: __webpack_require__(71).SEMVER_SPEC_VERSION, - SemVer: __webpack_require__(653), - compareIdentifiers: __webpack_require__(127).compareIdentifiers, - rcompareIdentifiers: __webpack_require__(127).rcompareIdentifiers, - parse: __webpack_require__(842), - valid: __webpack_require__(666), - clean: __webpack_require__(106), - inc: __webpack_require__(460), - diff: __webpack_require__(66), - major: __webpack_require__(864), - minor: __webpack_require__(519), - patch: __webpack_require__(315), - prerelease: __webpack_require__(228), - compare: __webpack_require__(164), - rcompare: __webpack_require__(323), - compareLoose: __webpack_require__(609), - compareBuild: __webpack_require__(126), - sort: __webpack_require__(331), - rsort: __webpack_require__(365), - gt: __webpack_require__(827), - lt: __webpack_require__(746), - eq: __webpack_require__(450), - neq: __webpack_require__(917), - gte: __webpack_require__(751), - lte: __webpack_require__(817), - cmp: __webpack_require__(548), - coerce: __webpack_require__(812), - Comparator: __webpack_require__(538), - Range: __webpack_require__(57), - satisfies: __webpack_require__(517), - toComparators: __webpack_require__(42), - maxSatisfying: __webpack_require__(863), - minSatisfying: __webpack_require__(470), - minVersion: __webpack_require__(43), - validRange: __webpack_require__(907), - outside: __webpack_require__(324), - gtr: __webpack_require__(90), - ltr: __webpack_require__(113), - intersects: __webpack_require__(489), - simplifyRange: __webpack_require__(7), - subset: __webpack_require__(769), -} - - -/***/ }), -/* 90 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -// Determine if version is greater than all the versions possible in the range. -const outside = __webpack_require__(324) -const gtr = (version, range, options) => outside(version, range, '>', options) -module.exports = gtr - -/***/ }), -/* 91 */, -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 5018: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = nextThursday; - -var _index = _interopRequireDefault(__webpack_require__(217)); - -var _index2 = _interopRequireDefault(__webpack_require__(940)); +const callsites = () => { + const _prepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = (_, stack) => stack; + const stack = new Error().stack.slice(1); + Error.prepareStackTrace = _prepareStackTrace; + return stack; +}; -var _index3 = _interopRequireDefault(__webpack_require__(773)); +module.exports = callsites; +// TODO: Remove this for the next major release +module.exports["default"] = callsites; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * @name nextThursday - * @category Weekday Helpers - * @summary When is the next Thursday? - * - * @description - * When is the next Thursday? - * - * @param {Date | number} date - the date to start counting from - * @returns {Date} the next Thursday - * @throws {TypeError} 1 argument required - * - * @example - * // When is the next Thursday after Mar, 22, 2020? - * const result = nextThursday(new Date(2020, 2, 22)) - * //=> Thur Mar 26 2020 00:00:00 - */ -function nextThursday(date) { - (0, _index.default)(1, arguments); - return (0, _index2.default)((0, _index3.default)(date), 4); -} +/***/ }), -module.exports = exports.default; +/***/ 7391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), -/* 93 */ -/***/ (function(module, exports) { +/* MIT license */ +/* eslint-disable no-mixed-operators */ +const cssKeywords = __nccwpck_require__(8510); -"use strict"; +// NOTE: conversions should only return primitive values (i.e. arrays, or +// values that give correct `typeof` results). +// do not use box values types (i.e. Number(), String(), etc.) +const reverseKeywords = {}; +for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; +} -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildMatchFn; +const convert = { + rgb: {channels: 3, labels: 'rgb'}, + hsl: {channels: 3, labels: 'hsl'}, + hsv: {channels: 3, labels: 'hsv'}, + hwb: {channels: 3, labels: 'hwb'}, + cmyk: {channels: 4, labels: 'cmyk'}, + xyz: {channels: 3, labels: 'xyz'}, + lab: {channels: 3, labels: 'lab'}, + lch: {channels: 3, labels: 'lch'}, + hex: {channels: 1, labels: ['hex']}, + keyword: {channels: 1, labels: ['keyword']}, + ansi16: {channels: 1, labels: ['ansi16']}, + ansi256: {channels: 1, labels: ['ansi256']}, + hcg: {channels: 3, labels: ['h', 'c', 'g']}, + apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, + gray: {channels: 1, labels: ['gray']} +}; -function buildMatchFn(args) { - return function (dirtyString, dirtyOptions) { - var string = String(dirtyString); - var options = dirtyOptions || {}; - var width = options.width; - var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; - var matchResult = string.match(matchPattern); +module.exports = convert; - if (!matchResult) { - return null; - } +// Hide .channels and .labels properties +for (const model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } - var matchedString = matchResult[0]; - var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; - var value; + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } - if (Object.prototype.toString.call(parsePatterns) === '[object Array]') { - value = findIndex(parsePatterns, function (pattern) { - return pattern.test(matchedString); - }); - } else { - value = findKey(parsePatterns, function (pattern) { - return pattern.test(matchedString); - }); - } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } - value = args.valueCallback ? args.valueCallback(value) : value; - value = options.valueCallback ? options.valueCallback(value) : value; - return { - value: value, - rest: string.slice(matchedString.length) - }; - }; + const {channels, labels} = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); } -function findKey(object, predicate) { - for (var key in object) { - if (object.hasOwnProperty(key) && predicate(object[key])) { - return key; - } - } -} +convert.rgb.hsl = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; -function findIndex(array, predicate) { - for (var key = 0; key < array.length; key++) { - if (predicate(array[key])) { - return key; - } - } -} + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } -module.exports = exports.default; + h = Math.min(h * 60, 360); -/***/ }), -/* 94 */, -/* 95 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { + if (h < 0) { + h += 360; + } -"use strict"; + const l = (min + max) / 2; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getInferredPackageManager = exports.getParsedPackageManager = void 0; -const execa = __webpack_require__(82); -const path = __webpack_require__(492); -const semver_1 = __webpack_require__(89); -const getParsedPackageManager = (packageManager) => { - switch (packageManager) { - case "berry": - case "npm": - case "pnpm": - case "yarn": - return packageManager; - default: - return "npm"; - } -}; -exports.getParsedPackageManager = getParsedPackageManager; -const getInferredPackageManager = async () => { - const packageManager = path.basename(process.env.npm_execpath || "npm"); - if (packageManager.startsWith("yarn")) { - const { stdout } = await execa.command("yarn --version"); - return semver_1.satisfies(stdout, "^0 || ^1") ? "yarn" : "berry"; - } - else if (packageManager.startsWith("pnpm")) { - return Promise.resolve("pnpm"); - } - else { - return Promise.resolve(exports.getParsedPackageManager(packageManager)); - } + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } + + return [h, s * 100, l * 100]; }; -exports.getInferredPackageManager = getInferredPackageManager; +convert.rgb.hsv = function (rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s; -/***/ }), -/* 96 */, -/* 97 */, -/* 98 */, -/* 99 */, -/* 100 */, -/* 101 */, -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; -"use strict"; + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getUTCWeek; + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } -var _index = _interopRequireDefault(__webpack_require__(773)); + return [ + h * 360, + s * 100, + v * 100 + ]; +}; -var _index2 = _interopRequireDefault(__webpack_require__(35)); +convert.rgb.hwb = function (rgb) { + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); -var _index3 = _interopRequireDefault(__webpack_require__(853)); + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); -var _index4 = _interopRequireDefault(__webpack_require__(217)); + return [h, w * 100, b * 100]; +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +convert.rgb.cmyk = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; -var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; -function getUTCWeek(dirtyDate, options) { - (0, _index4.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var diff = (0, _index2.default)(date, options).getTime() - (0, _index3.default)(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 [c * 100, m * 100, y * 100, k * 100]; +}; - return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; +function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ + return ( + ((x[0] - y[0]) ** 2) + + ((x[1] - y[1]) ** 2) + + ((x[2] - y[2]) ** 2) + ); } -module.exports = exports.default; +convert.rgb.keyword = function (rgb) { + const reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { + let currentClosestDistance = Infinity; + let currentClosestKeyword; -"use strict"; + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; + // Compute comparative distance + const distance = comparativeDistance(rgb, value); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = subMonths; + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } -var _index = _interopRequireDefault(__webpack_require__(841)); + return currentClosestKeyword; +}; -var _index2 = _interopRequireDefault(__webpack_require__(875)); +convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; +}; -var _index3 = _interopRequireDefault(__webpack_require__(217)); +convert.rgb.xyz = function (rgb) { + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // Assume sRGB + r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); + g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); + b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); -/** - * @name subMonths - * @category Month Helpers - * @summary Subtract the specified number of months from the given date. - * - * @description - * Subtract the specified number of months from the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the months subtracted - * @throws {TypeError} 2 arguments required - * - * @example - * // Subtract 5 months from 1 February 2015: - * const result = subMonths(new Date(2015, 1, 1), 5) - * //=> Mon Sep 01 2014 00:00:00 - */ -function subMonths(dirtyDate, dirtyAmount) { - (0, _index3.default)(2, arguments); - var amount = (0, _index.default)(dirtyAmount); - return (0, _index2.default)(dirtyDate, -amount); -} + const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); -module.exports = exports.default; + return [x * 100, y * 100, z * 100]; +}; -/***/ }), -/* 104 */, -/* 105 */, -/* 106 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +convert.rgb.lab = function (rgb) { + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; -const parse = __webpack_require__(842) -const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -module.exports = clean + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); -/***/ }), -/* 107 */, -/* 108 */, -/* 109 */, -/* 110 */, -/* 111 */, -/* 112 */, -/* 113 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); -const outside = __webpack_require__(324) -// Determine if version is less than all the versions possible in the range -const ltr = (version, range, options) => outside(version, range, '<', options) -module.exports = ltr + return [l, a, b]; +}; +convert.hsl.rgb = function (hsl) { + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; -/***/ }), -/* 114 */, -/* 115 */, -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { + if (s === 0) { + val = l * 255; + return [val, val, val]; + } -"use strict"; + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + const t1 = 2 * l - t2; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isSaturday; + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } -var _index = _interopRequireDefault(__webpack_require__(773)); + if (t3 > 1) { + t3--; + } -var _index2 = _interopRequireDefault(__webpack_require__(217)); + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + rgb[i] = val * 255; + } -/** - * @name isSaturday - * @category Weekday Helpers - * @summary Is the given date Saturday? - * - * @description - * Is the given date Saturday? - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is Saturday - * @throws {TypeError} 1 argument required - * - * @example - * // Is 27 September 2014 Saturday? - * var result = isSaturday(new Date(2014, 8, 27)) - * //=> true - */ -function isSaturday(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate).getDay() === 6; -} + return rgb; +}; -module.exports = exports.default; +convert.hsl.hsv = function (hsl) { + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); -/***/ }), -/* 117 */, -/* 118 */, -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); -"use strict"; + return [h, sv * 100, v * 100]; +}; +convert.hsv.rgb = function (hsv) { + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = subQuarters; + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - (s * f)); + const t = 255 * v * (1 - (s * (1 - f))); + v *= 255; -var _index = _interopRequireDefault(__webpack_require__(841)); + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } +}; -var _index2 = _interopRequireDefault(__webpack_require__(648)); +convert.hsv.hsl = function (hsv) { + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; -var _index3 = _interopRequireDefault(__webpack_require__(217)); + l = (2 - s) * v; + const lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return [h, sl * 100, l * 100]; +}; -/** - * @name subQuarters - * @category Quarter Helpers - * @summary Subtract the specified number of year quarters from the given date. - * - * @description - * Subtract the specified number of year quarters from the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of quarters to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the quarters subtracted - * @throws {TypeError} 2 arguments required - * - * @example - * // Subtract 3 quarters from 1 September 2014: - * const result = subQuarters(new Date(2014, 8, 1), 3) - * //=> Sun Dec 01 2013 00:00:00 - */ -function subQuarters(dirtyDate, dirtyAmount) { - (0, _index3.default)(2, arguments); - var amount = (0, _index.default)(dirtyAmount); - return (0, _index2.default)(dirtyDate, -amount); -} +// http://dev.w3.org/csswg/css-color/#hwb-to-rgb +convert.hwb.rgb = function (hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; -module.exports = exports.default; + // Wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { + const i = Math.floor(6 * h); + const v = 1 - bl; + f = 6 * h - i; -"use strict"; + if ((i & 0x01) !== 0) { + f = 1 - f; + } + const n = wh + f * (v - wh); // Linear interpolation -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = addMilliseconds; + let r; + let g; + let b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; + } + /* eslint-enable max-statements-per-line,no-multi-spaces */ -var _index = _interopRequireDefault(__webpack_require__(841)); + return [r * 255, g * 255, b * 255]; +}; -var _index2 = _interopRequireDefault(__webpack_require__(773)); +convert.cmyk.rgb = function (cmyk) { + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; -var _index3 = _interopRequireDefault(__webpack_require__(217)); + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return [r * 255, g * 255, b * 255]; +}; -/** - * @name addMilliseconds - * @category Millisecond Helpers - * @summary Add the specified number of milliseconds to the given date. - * - * @description - * Add the specified number of milliseconds to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the milliseconds added - * @throws {TypeError} 2 arguments required - * - * @example - * // Add 750 milliseconds to 10 July 2014 12:45:30.000: - * 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) { - (0, _index3.default)(2, arguments); - var timestamp = (0, _index2.default)(dirtyDate).getTime(); - var amount = (0, _index.default)(dirtyAmount); - return new Date(timestamp + amount); -} +convert.xyz.rgb = function (xyz) { + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; -module.exports = exports.default; + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); -/***/ }), -/* 121 */, -/* 122 */ -/***/ (function(module, exports) { + // Assume sRGB + r = r > 0.0031308 + ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) + : r * 12.92; -"use strict"; + g = g > 0.0031308 + ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) + : g * 12.92; + b = b > 0.0031308 + ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) + : b * 12.92; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = formatDistance; -var formatDistanceLocale = { - lessThanXSeconds: { - one: 'less than a second', - other: 'less than {{count}} seconds' - }, - xSeconds: { - one: '1 second', - other: '{{count}} seconds' - }, - halfAMinute: 'half a minute', - lessThanXMinutes: { - one: 'less than a minute', - other: 'less than {{count}} minutes' - }, - xMinutes: { - one: '1 minute', - other: '{{count}} minutes' - }, - aboutXHours: { - one: 'about 1 hour', - other: 'about {{count}} hours' - }, - xHours: { - one: '1 hour', - other: '{{count}} hours' - }, - xDays: { - one: '1 day', - other: '{{count}} days' - }, - aboutXWeeks: { - one: 'about 1 week', - other: 'about {{count}} weeks' - }, - xWeeks: { - one: '1 week', - other: '{{count}} weeks' - }, - aboutXMonths: { - one: 'about 1 month', - other: 'about {{count}} months' - }, - xMonths: { - one: '1 month', - other: '{{count}} months' - }, - aboutXYears: { - one: 'about 1 year', - other: 'about {{count}} years' - }, - xYears: { - one: '1 year', - other: '{{count}} years' - }, - overXYears: { - one: 'over 1 year', - other: 'over {{count}} years' - }, - almostXYears: { - one: 'almost 1 year', - other: 'almost {{count}} years' - } -}; + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); -function formatDistance(token, count, options) { - options = options || {}; - var result; + return [r * 255, g * 255, b * 255]; +}; - if (typeof formatDistanceLocale[token] === 'string') { - result = formatDistanceLocale[token]; - } else if (count === 1) { - result = formatDistanceLocale[token].one; - } else { - result = formatDistanceLocale[token].other.replace('{{count}}', count); - } +convert.xyz.lab = function (xyz) { + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; - if (options.addSuffix) { - if (options.comparison > 0) { - return 'in ' + result; - } else { - return result + ' ago'; - } - } + x /= 95.047; + y /= 100; + z /= 108.883; - return result; -} + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); -module.exports = exports.default; + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); -/***/ }), -/* 123 */, -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { + return [l, a, b]; +}; -"use strict"; +convert.lab.xyz = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isToday; + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; -var _index = _interopRequireDefault(__webpack_require__(491)); + x *= 95.047; + y *= 100; + z *= 108.883; -var _index2 = _interopRequireDefault(__webpack_require__(217)); + return [x, y, z]; +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +convert.lab.lch = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; -/** - * @name isToday - * @category Day Helpers - * @summary Is the given date today? - * @pure false - * - * @description - * Is the given date today? - * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `Date.now()` internally hence impure and can't be safely curried. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is today - * @throws {TypeError} 1 argument required - * - * @example - * // If today is 6 October 2014, is 6 October 14:00:00 today? - * var result = isToday(new Date(2014, 9, 6, 14, 0)) - * //=> true - */ -function isToday(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate, Date.now()); -} + const hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; -module.exports = exports.default; + if (h < 0) { + h += 360; + } -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { + const c = Math.sqrt(a * a + b * b); -"use strict"; + return [l, c, h]; +}; +convert.lch.lab = function (lch) { + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = formatDuration; + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); -var _index = _interopRequireDefault(__webpack_require__(275)); + return [l, a, b]; +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization -var defaultFormat = ['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']; -/** - * @name formatDuration - * @category Common Helpers - * @summary Formats a duration in human-readable format - * - * @description - * Return human-readable duration string i.e. "9 months 2 days" - * - * @param {Duration} duration - the duration to format - * @param {Object} [options] - an object with options. + value = Math.round(value / 50); - * @param {string[]} [options.format=['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']] - the array of units to format - * @param {boolean} [options.zero=false] - should be zeros be included in the output? - * @param {string} [options.delimiter=' '] - delimiter string - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @returns {string} the formatted date string - * @throws {TypeError} 1 argument required - * - * @example - * // Format full duration - * formatDuration({ - * years: 2, - * months: 9, - * weeks: 1, - * days: 7, - * hours: 5, - * minutes: 9, - * seconds: 30 - * }) - * //=> '2 years 9 months 1 week 7 days 5 hours 9 minutes 30 seconds - * - * @example - * // Format partial duration - * formatDuration({ months: 9, days: 2 }) - * //=> '9 months 2 days' - * - * @example - * // Customize the format - * formatDuration( - * { - * years: 2, - * months: 9, - * weeks: 1, - * days: 7, - * hours: 5, - * minutes: 9, - * seconds: 30 - * }, - * { format: ['months', 'weeks'] } - * ) === '9 months 1 week' - * - * @example - * // Customize the zeros presence - * formatDuration({ years: 0, months: 9 }) - * //=> '9 months' - * formatDuration({ years: 0, months: 9 }, { zero: true }) - * //=> '0 years 9 months' - * - * @example - * // Customize the delimiter - * formatDuration({ years: 2, months: 9, weeks: 3 }, { delimiter: ', ' }) - * //=> '2 years, 9 months, 3 weeks' - */ + if (value === 0) { + return 30; + } -function formatDuration(duration, options) { - if (arguments.length < 1) { - throw new TypeError("1 argument required, but only ".concat(arguments.length, " present")); - } + let ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); - var format = (options === null || options === void 0 ? void 0 : options.format) || defaultFormat; - var locale = (options === null || options === void 0 ? void 0 : options.locale) || _index.default; - var zero = (options === null || options === void 0 ? void 0 : options.zero) || false; - var delimiter = (options === null || options === void 0 ? void 0 : options.delimiter) || ' '; - var result = format.reduce(function (acc, unit) { - var token = "x".concat(unit.replace(/(^.)/, function (m) { - return m.toUpperCase(); - })); - var addChunk = typeof duration[unit] === 'number' && (zero || duration[unit]); - return addChunk ? acc.concat(locale.formatDistance(token, duration[unit])) : acc; - }, []).join(delimiter); - return result; -} + if (value === 2) { + ansi += 60; + } -module.exports = exports.default; + return ansi; +}; -/***/ }), -/* 126 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +convert.hsv.ansi16 = function (args) { + // Optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); +}; -const SemVer = __webpack_require__(653) -const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose) - const versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} -module.exports = compareBuild +convert.rgb.ansi256 = function (args) { + const r = args[0]; + const g = args[1]; + const b = args[2]; + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; + } -/***/ }), -/* 127 */ -/***/ (function(module) { + if (r > 248) { + return 231; + } -const numeric = /^[0-9]+$/ -const compareIdentifiers = (a, b) => { - const anum = numeric.test(a) - const bnum = numeric.test(b) + return Math.round(((r - 8) / 247) * 24) + 232; + } - if (anum && bnum) { - a = +a - b = +b - } + const ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} + return ansi; +}; -const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) +convert.ansi16.rgb = function (args) { + let color = args % 10; -module.exports = { - compareIdentifiers, - rcompareIdentifiers -} + // Handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } + color = color / 10.5 * 255; -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { + return [color, color, color]; + } -"use strict"; + const mult = (~~(args > 50) + 1) * 0.5; + const r = ((color & 1) * mult) * 255; + const g = (((color >> 1) & 1) * mult) * 255; + const b = (((color >> 2) & 1) * mult) * 255; + return [r, g, b]; +}; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = differenceInMinutes; +convert.ansi256.rgb = function (args) { + // Handle greyscale + if (args >= 232) { + const c = (args - 232) * 10 + 8; + return [c, c, c]; + } -var _index = _interopRequireDefault(__webpack_require__(647)); + args -= 16; -var _index2 = _interopRequireDefault(__webpack_require__(217)); + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = (rem % 6) / 5 * 255; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return [r, g, b]; +}; -var MILLISECONDS_IN_MINUTE = 60000; -/** - * @name differenceInMinutes - * @category Minute Helpers - * @summary Get the number of minutes between the given dates. - * - * @description - * Get the signed number of full (rounded towards 0) minutes between the given dates. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of minutes - * @throws {TypeError} 2 arguments required - * - * @example - * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00? - * var result = differenceInMinutes( - * new Date(2014, 6, 2, 12, 20, 0), - * new Date(2014, 6, 2, 12, 7, 59) - * ) - * //=> 12 - * - * @example - * // How many minutes are from 10:01:59 to 10:00:00 - * var result = differenceInMinutes( - * new Date(2000, 0, 1, 10, 0, 0), - * new Date(2000, 0, 1, 10, 1, 59) - * ) - * //=> -1 - */ +convert.rgb.hex = function (args) { + const integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); -function differenceInMinutes(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - var diff = (0, _index.default)(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE; - return diff > 0 ? Math.floor(diff) : Math.ceil(diff); -} + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; -module.exports = exports.default; +convert.hex.rgb = function (args) { + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } -/***/ }), -/* 129 */ -/***/ (function(module) { + let colorString = match[0]; -module.exports = require("child_process"); + if (match[0].length === 3) { + colorString = colorString.split('').map(char => { + return char + char; + }).join(''); + } -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 0xFF; + const g = (integer >> 8) & 0xFF; + const b = integer & 0xFF; -"use strict"; + return [r, g, b]; +}; + +convert.rgb.hcg = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + const chroma = (max - min); + let grayscale; + let hue; + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getYear; + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; + } -var _index = _interopRequireDefault(__webpack_require__(773)); + hue /= 6; + hue %= 1; -var _index2 = _interopRequireDefault(__webpack_require__(217)); + return [hue * 360, chroma * 100, grayscale * 100]; +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +convert.hsl.hcg = function (hsl) { + const s = hsl[1] / 100; + const l = hsl[2] / 100; -/** - * @name getYear - * @category Year Helpers - * @summary Get the year of the given date. - * - * @description - * Get the year of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @returns {Number} the year - * @throws {TypeError} 1 argument required - * - * @example - * // Which year is 2 July 2014? - * const result = getYear(new Date(2014, 6, 2)) - * //=> 2014 - */ -function getYear(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var year = date.getFullYear(); - return year; -} + const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); -module.exports = exports.default; + let f = 0; + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } -/***/ }), -/* 131 */ -/***/ (function(module, exports) { + return [hsl[0], c * 100, f * 100]; +}; -"use strict"; +convert.hsv.hcg = function (hsv) { + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const c = s * v; + let f = 0; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = startOfTomorrow; + if (c < 1.0) { + f = (v - c) / (1 - c); + } -/** - * @name startOfTomorrow - * @category Day Helpers - * @summary Return the start of tomorrow. - * @pure false - * - * @description - * Return the start of tomorrow. - * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `new Date()` internally hence impure and can't be safely curried. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @returns {Date} the start of tomorrow - * - * @example - * // If today is 6 October 2014: - * const result = startOfTomorrow() - * //=> Tue Oct 7 2014 00:00:00 - */ -function startOfTomorrow() { - var now = new Date(); - var year = now.getFullYear(); - var month = now.getMonth(); - var day = now.getDate(); - var date = new Date(0); - date.setFullYear(year, month, day + 1); - date.setHours(0, 0, 0, 0); - return date; -} + return [hsv[0], c * 100, f * 100]; +}; -module.exports = exports.default; +convert.hcg.rgb = function (hcg) { + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; -/***/ }), -/* 132 */, -/* 133 */, -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } -"use strict"; + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; + /* eslint-disable max-statements-per-line */ + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; + } + /* eslint-enable max-statements-per-line */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = setDayOfYear; + mg = (1.0 - c) * g; -var _index = _interopRequireDefault(__webpack_require__(841)); + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; +}; -var _index2 = _interopRequireDefault(__webpack_require__(773)); +convert.hcg.hsv = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; -var _index3 = _interopRequireDefault(__webpack_require__(217)); + const v = c + g * (1.0 - c); + let f = 0; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (v > 0.0) { + f = c / v; + } -/** - * @name setDayOfYear - * @category Day Helpers - * @summary Set the day of the year to the given date. - * - * @description - * Set the day of the year to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} dayOfYear - the day of the year of the new date - * @returns {Date} the new date with the day of the year set - * @throws {TypeError} 2 arguments required - * - * @example - * // Set the 2nd day of the year to 2 July 2014: - * var result = setDayOfYear(new Date(2014, 6, 2), 2) - * //=> Thu Jan 02 2014 00:00:00 - */ -function setDayOfYear(dirtyDate, dirtyDayOfYear) { - (0, _index3.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var dayOfYear = (0, _index.default)(dirtyDayOfYear); - date.setMonth(0); - date.setDate(dayOfYear); - return date; -} + return [hcg[0], f * 100, v * 100]; +}; -module.exports = exports.default; +convert.hcg.hsl = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; -/***/ }), -/* 135 */, -/* 136 */, -/* 137 */, -/* 138 */ -/***/ (function(module) { + const l = g * (1.0 - c) + 0.5 * c; + let s = 0; -"use strict"; + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); + } + return [hcg[0], s * 100, l * 100]; +}; -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; +convert.hcg.hwb = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; +}; -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); +convert.hwb.hcg = function (hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; + + if (c < 1) { + g = (v - c) / (1 - c); } - return str.replace(matchOperatorsRe, '\\$&'); + return [hwb[0], c * 100, g * 100]; }; +convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; +}; -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { +convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; +}; -"use strict"; +convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +}; +convert.gray.hsl = function (args) { + return [0, 0, args[0]]; +}; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = parse; +convert.gray.hsv = convert.gray.hsl; -var _index = _interopRequireDefault(__webpack_require__(275)); +convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; +}; -var _index2 = _interopRequireDefault(__webpack_require__(564)); +convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; +}; -var _index3 = _interopRequireDefault(__webpack_require__(773)); +convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; +}; -var _index4 = _interopRequireDefault(__webpack_require__(38)); +convert.gray.hex = function (gray) { + const val = Math.round(gray[0] / 100 * 255) & 0xFF; + const integer = (val << 16) + (val << 8) + val; -var _index5 = _interopRequireDefault(__webpack_require__(201)); + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; -var _index6 = _interopRequireDefault(__webpack_require__(151)); +convert.rgb.gray = function (rgb) { + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; +}; -var _index7 = __webpack_require__(761); -var _index8 = _interopRequireDefault(__webpack_require__(841)); +/***/ }), -var _index9 = _interopRequireDefault(__webpack_require__(462)); +/***/ 6931: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var _index10 = _interopRequireDefault(__webpack_require__(217)); +const conversions = __nccwpck_require__(7391); +const route = __nccwpck_require__(880); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const convert = {}; -var TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`: -// - [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 -// - '' matches two quote characters in a row -// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), -// except a single quote symbol, which ends the sequence. -// Two quote characters do not end the sequence. -// 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; // 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 - * @summary Parse the date. - * - * @description - * Return the date parsed from string using the given format string. - * - * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. - * > See: https://git.io/fxCyr - * - * The characters in the format string wrapped between two single quotes characters (') are escaped. - * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. - * - * Format of the format string is based on Unicode Technical Standard #35: - * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * with a few additions (see note 5 below the table). - * - * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited - * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception: - * - * ```javascript - * parse('23 AM', 'HH a', new Date()) - * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time - * ``` - * - * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true - * - * Accepted format string patterns: - * | Unit |Prior| Pattern | Result examples | Notes | - * |---------------------------------|-----|---------|-----------------------------------|-------| - * | Era | 140 | G..GGG | AD, BC | | - * | | | GGGG | Anno Domini, Before Christ | 2 | - * | | | GGGGG | A, B | | - * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | - * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | - * | | | yy | 44, 01, 00, 17 | 4 | - * | | | yyy | 044, 001, 123, 999 | 4 | - * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | - * | | | yyyyy | ... | 2,4 | - * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | - * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | - * | | | YY | 44, 01, 00, 17 | 4,6 | - * | | | YYY | 044, 001, 123, 999 | 4 | - * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | - * | | | YYYYY | ... | 2,4 | - * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | - * | | | RR | -43, 01, 00, 17 | 4,5 | - * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | - * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | - * | | | RRRRR | ... | 2,4,5 | - * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | - * | | | uu | -43, 01, 99, -99 | 4 | - * | | | uuu | -043, 001, 123, 999, -999 | 4 | - * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | - * | | | uuuuu | ... | 2,4 | - * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | - * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | - * | | | QQ | 01, 02, 03, 04 | | - * | | | QQQ | Q1, Q2, Q3, Q4 | | - * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | - * | | | QQQQQ | 1, 2, 3, 4 | 4 | - * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | - * | | | qo | 1st, 2nd, 3rd, 4th | 5 | - * | | | qq | 01, 02, 03, 04 | | - * | | | qqq | Q1, Q2, Q3, Q4 | | - * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | - * | | | qqqqq | 1, 2, 3, 4 | 3 | - * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | - * | | | Mo | 1st, 2nd, ..., 12th | 5 | - * | | | MM | 01, 02, ..., 12 | | - * | | | MMM | Jan, Feb, ..., Dec | | - * | | | MMMM | January, February, ..., December | 2 | - * | | | MMMMM | J, F, ..., D | | - * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | - * | | | Lo | 1st, 2nd, ..., 12th | 5 | - * | | | LL | 01, 02, ..., 12 | | - * | | | LLL | Jan, Feb, ..., Dec | | - * | | | LLLL | January, February, ..., December | 2 | - * | | | LLLLL | J, F, ..., D | | - * | Local week of year | 100 | w | 1, 2, ..., 53 | | - * | | | wo | 1st, 2nd, ..., 53th | 5 | - * | | | ww | 01, 02, ..., 53 | | - * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | - * | | | Io | 1st, 2nd, ..., 53th | 5 | - * | | | II | 01, 02, ..., 53 | 5 | - * | Day of month | 90 | d | 1, 2, ..., 31 | | - * | | | do | 1st, 2nd, ..., 31st | 5 | - * | | | dd | 01, 02, ..., 31 | | - * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 | - * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | - * | | | DD | 01, 02, ..., 365, 366 | 7 | - * | | | DDD | 001, 002, ..., 365, 366 | | - * | | | DDDD | ... | 2 | - * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | | - * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | - * | | | EEEEE | M, T, W, T, F, S, S | | - * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | | - * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | - * | | | io | 1st, 2nd, ..., 7th | 5 | - * | | | ii | 01, 02, ..., 07 | 5 | - * | | | iii | Mon, Tue, Wed, ..., Sun | 5 | - * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | - * | | | iiiii | M, T, W, T, F, S, S | 5 | - * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 | - * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | - * | | | eo | 2nd, 3rd, ..., 1st | 5 | - * | | | ee | 02, 03, ..., 01 | | - * | | | eee | Mon, Tue, Wed, ..., Sun | | - * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | - * | | | eeeee | M, T, W, T, F, S, S | | - * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | | - * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | - * | | | co | 2nd, 3rd, ..., 1st | 5 | - * | | | cc | 02, 03, ..., 01 | | - * | | | ccc | Mon, Tue, Wed, ..., Sun | | - * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | - * | | | ccccc | M, T, W, T, F, S, S | | - * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | | - * | AM, PM | 80 | a..aaa | AM, PM | | - * | | | aaaa | a.m., p.m. | 2 | - * | | | aaaaa | a, p | | - * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | - * | | | bbbb | a.m., p.m., noon, midnight | 2 | - * | | | bbbbb | a, p, n, mi | | - * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | - * | | | BBBB | at night, in the morning, ... | 2 | - * | | | BBBBB | at night, in the morning, ... | | - * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | - * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | - * | | | hh | 01, 02, ..., 11, 12 | | - * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | - * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | - * | | | HH | 00, 01, 02, ..., 23 | | - * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | - * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | - * | | | KK | 01, 02, ..., 11, 00 | | - * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | - * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | - * | | | kk | 24, 01, 02, ..., 23 | | - * | Minute | 60 | m | 0, 1, ..., 59 | | - * | | | mo | 0th, 1st, ..., 59th | 5 | - * | | | mm | 00, 01, ..., 59 | | - * | Second | 50 | s | 0, 1, ..., 59 | | - * | | | so | 0th, 1st, ..., 59th | 5 | - * | | | ss | 00, 01, ..., 59 | | - * | Seconds timestamp | 40 | t | 512969520 | | - * | | | tt | ... | 2 | - * | Fraction of second | 30 | S | 0, 1, ..., 9 | | - * | | | SS | 00, 01, ..., 99 | | - * | | | SSS | 000, 0001, ..., 999 | | - * | | | SSSS | ... | 2 | - * | Milliseconds timestamp | 20 | T | 512969520900 | | - * | | | TT | ... | 2 | - * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | - * | | | XX | -0800, +0530, Z | | - * | | | XXX | -08:00, +05:30, Z | | - * | | | XXXX | -0800, +0530, Z, +123456 | 2 | - * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | - * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | - * | | | xx | -0800, +0530, +0000 | | - * | | | xxx | -08:00, +05:30, +00:00 | 2 | - * | | | xxxx | -0800, +0530, +0000, +123456 | | - * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | - * | Long localized date | NA | P | 05/29/1453 | 5,8 | - * | | | PP | May 29, 1453 | | - * | | | PPP | May 29th, 1453 | | - * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 | - * | Long localized time | NA | p | 12:00 AM | 5,8 | - * | | | pp | 12:00:00 AM | | - * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | | - * | | | PPpp | May 29, 1453, 12:00:00 AM | | - * | | | PPPpp | May 29th, 1453 at ... | | - * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 | - * Notes: - * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale - * are the same as "stand-alone" units, but are different in some languages. - * "Formatting" units are declined according to the rules of the language - * in the context of a date. "Stand-alone" units are always nominative singular. - * In `format` function, they will produce different result: - * - * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` - * - * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` - * - * `parse` will try to match both formatting and stand-alone units interchangably. - * - * 2. Any sequence of the identical letters is a pattern, unless it is escaped by - * the single quote characters (see below). - * If the sequence is longer than listed in table: - * - for numerical units (`yyyyyyyy`) `parse` will try to match a number - * as wide as the sequence - * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit. - * These variations are marked with "2" in the last column of the table. - * - * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. - * These tokens represent the shortest form of the quarter. - * - * 4. The main difference between `y` and `u` patterns are B.C. years: - * - * | Year | `y` | `u` | - * |------|-----|-----| - * | AC 1 | 1 | 1 | - * | BC 1 | 1 | 0 | - * | BC 2 | 2 | -1 | - * - * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`: - * - * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00` - * - * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00` - * - * while `uu` will just assign the year as is: - * - * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00` - * - * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00` - * - * The same difference is true for local and ISO week-numbering years (`Y` and `R`), - * except local week-numbering years are dependent on `options.weekStartsOn` - * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear} - * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}). - * - * 5. These patterns are not in the Unicode Technical Standard #35: - * - `i`: ISO day of week - * - `I`: ISO week of year - * - `R`: ISO week-numbering year - * - `o`: ordinal number modifier - * - `P`: long localized date - * - `p`: long localized time - * - * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. - * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr - * - * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month. - * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr - * - * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based - * on the given locale. - * - * using `en-US` locale: `P` => `MM/dd/yyyy` - * using `en-US` locale: `p` => `hh:mm a` - * using `pt-BR` locale: `P` => `dd/MM/yyyy` - * using `pt-BR` locale: `p` => `HH:mm` - * - * Values will be assigned to the date in the descending order of its unit's priority. - * Units of an equal priority overwrite each other in the order of appearance. - * - * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), - * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing. - * - * `referenceDate` must be passed for correct work of the function. - * If you're not sure which `referenceDate` to supply, create a new instance of Date: - * `parse('02/11/2014', 'MM/dd/yyyy', new Date())` - * In this case parsing will be done in the context of the current date. - * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`, - * then `Invalid Date` will be returned. - * - * The result may vary by locale. - * - * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. - * - * If parsing failed, `Invalid Date` will be returned. - * Invalid Date is a Date, whose time value is NaN. - * Time value of Date: http://es5.github.io/#x15.9.1.1 - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * - Old `parse` was renamed to `toDate`. - * Now `parse` is a new function which parses a string using a provided format. - * - * ```javascript - * // Before v2.0.0 - * parse('2016-01-01') - * - * // v2.0.0 onward (toDate no longer accepts a string) - * toDate(1392098430000) // Unix to timestamp - * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date - * parse('2016-01-01', 'yyyy-MM-dd', new Date()) - * ``` - * - * @param {String} dateString - the string to parse - * @param {String} formatString - the string of tokens - * @param {Date|Number} referenceDate - defines values missing from the parsed dateString - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year - * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`; - * see: https://git.io/fxCyr - * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`; - * see: https://git.io/fxCyr - * @returns {Date} the parsed date - * @throws {TypeError} 3 arguments required - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 - * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 - * @throws {RangeError} `options.locale` must contain `match` property - * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr - * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr - * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr - * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr - * @throws {RangeError} format string contains an unescaped latin alphabet character - * - * @example - * // Parse 11 February 2014 from middle-endian format: - * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date()) - * //=> Tue Feb 11 2014 00:00:00 - * - * @example - * // Parse 28th of February in Esperanto locale in the context of 2010 year: - * import eo from 'date-fns/locale/eo' - * var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), { - * locale: eo - * }) - * //=> Sun Feb 28 2010 00:00:00 - */ - -function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) { - (0, _index10.default)(3, arguments); - var dateString = String(dirtyDateString); - var formatString = String(dirtyFormatString); - var options = dirtyOptions || {}; - var locale = options.locale || _index.default; - - if (!locale.match) { - throw new RangeError('locale must contain match property'); - } - - var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate; - var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0, _index8.default)(localeFirstWeekContainsDate); - var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0, _index8.default)(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN +const models = Object.keys(conversions); - if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { - throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); - } +function wrapRaw(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } - var localeWeekStartsOn = locale.options && locale.options.weekStartsOn; - var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index8.default)(localeWeekStartsOn); - var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index8.default)(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + if (arg0.length > 1) { + args = arg0; + } - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); - } + return fn(args); + }; - if (formatString === '') { - if (dateString === '') { - return (0, _index3.default)(dirtyReferenceDate); - } else { - return new Date(NaN); - } - } + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } - var subFnOptions = { - firstWeekContainsDate: firstWeekContainsDate, - weekStartsOn: weekStartsOn, - locale: locale // If timezone isn't specified, it will be set to the system timezone + return wrappedFn; +} - }; - var setters = [{ - priority: TIMEZONE_UNIT_PRIORITY, - subPriority: -1, - set: dateToSystemTimezone, - index: 0 - }]; - var i; - var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) { - var firstCharacter = substring[0]; +function wrapRounded(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; - if (firstCharacter === 'p' || firstCharacter === 'P') { - var longFormatter = _index5.default[firstCharacter]; - return longFormatter(substring, locale.formatLong, subFnOptions); - } + if (arg0 === undefined || arg0 === null) { + return arg0; + } - return substring; - }).join('').match(formattingTokensRegExp); - var usedTokens = []; + if (arg0.length > 1) { + args = arg0; + } - for (i = 0; i < tokens.length; i++) { - var token = tokens[i]; + const result = fn(args); - if (!options.useAdditionalWeekYearTokens && (0, _index7.isProtectedWeekYearToken)(token)) { - (0, _index7.throwProtectedError)(token, formatString, dirtyDateString); - } + // We're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (let len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } - if (!options.useAdditionalDayOfYearTokens && (0, _index7.isProtectedDayOfYearToken)(token)) { - (0, _index7.throwProtectedError)(token, formatString, dirtyDateString); - } + return result; + }; - var firstCharacter = token[0]; - var parser = _index9.default[firstCharacter]; + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } - if (parser) { - var incompatibleTokens = parser.incompatibleTokens; + return wrappedFn; +} - if (Array.isArray(incompatibleTokens)) { - var incompatibleToken = void 0; +models.forEach(fromModel => { + convert[fromModel] = {}; - for (var _i = 0; _i < usedTokens.length; _i++) { - var usedToken = usedTokens[_i].token; + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) { - incompatibleToken = usedTokens[_i]; - break; - } - } + const routes = route(fromModel); + const routeModels = Object.keys(routes); - if (incompatibleToken) { - throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time")); - } - } else if (parser.incompatibleTokens === '*' && usedTokens.length) { - throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time")); - } + routeModels.forEach(toModel => { + const fn = routes[toModel]; - usedTokens.push({ - token: firstCharacter, - fullToken: token - }); - var parseResult = parser.parse(dateString, token, locale.match, subFnOptions); + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); - if (!parseResult) { - return new Date(NaN); - } +module.exports = convert; - setters.push({ - priority: parser.priority, - subPriority: parser.subPriority || 0, - set: parser.set, - validate: parser.validate, - value: parseResult.value, - index: setters.length - }); - dateString = parseResult.rest; - } 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 +/***/ }), - if (token === "''") { - token = "'"; - } else if (firstCharacter === "'") { - token = cleanEscapedString(token); - } // Cut token from string, or, if string doesn't match the token, return Invalid Date +/***/ 880: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const conversions = __nccwpck_require__(7391); - if (dateString.indexOf(token) === 0) { - dateString = dateString.slice(token.length); - } else { - return new Date(NaN); - } - } - } // Check if the remaining input contains something other than whitespace +/* + This function routes a model to all other models. + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). - if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) { - return new Date(NaN); - } + conversions that are not possible simply are not included. +*/ - var uniquePrioritySetters = setters.map(function (setter) { - return setter.priority; - }).sort(function (a, b) { - return b - a; - }).filter(function (priority, index, array) { - return array.indexOf(priority) === index; - }).map(function (priority) { - return setters.filter(function (setter) { - return setter.priority === priority; - }).sort(function (a, b) { - return b.subPriority - a.subPriority; - }); - }).map(function (setterArray) { - return setterArray[0]; - }); - var date = (0, _index3.default)(dirtyReferenceDate); +function buildGraph() { + const graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + const models = Object.keys(conversions); - if (isNaN(date)) { - return new Date(NaN); - } // 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/37 + for (let len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + return graph; +} - var utcDate = (0, _index2.default)(date, (0, _index6.default)(date)); - var flags = {}; +// https://en.wikipedia.org/wiki/Breadth-first_search +function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; // Unshift -> queue -> pop - for (i = 0; i < uniquePrioritySetters.length; i++) { - var setter = uniquePrioritySetters[i]; + graph[fromModel].distance = 0; - if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) { - return new Date(NaN); - } + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); - var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags) + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; - if (result[0]) { - utcDate = result[0]; - (0, _index4.default)(flags, result[1]); // Result is date - } else { - utcDate = result; - } - } + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } - return utcDate; + return graph; } -function dateToSystemTimezone(date, flags) { - if (flags.timestampIsSet) { - return date; - } - - var convertedDate = new Date(0); - convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()); - convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds()); - return convertedDate; +function link(from, to) { + return function (args) { + return to(from(args)); + }; } -function cleanEscapedString(input) { - return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'"); -} +function wrapConversion(toModel, graph) { + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; -module.exports = exports.default; + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { + fn.conversion = path; + return fn; +} -"use strict"; +module.exports = function (fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = subDays; + if (node.parent === null) { + // No possible conversion, or this node is the source model. + continue; + } -var _index = _interopRequireDefault(__webpack_require__(841)); + conversion[toModel] = wrapConversion(toModel, graph); + } -var _index2 = _interopRequireDefault(__webpack_require__(865)); + return conversion; +}; -var _index3 = _interopRequireDefault(__webpack_require__(217)); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * @name subDays - * @category Day Helpers - * @summary Subtract the specified number of days from the given date. - * - * @description - * Subtract the specified number of days from the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the days subtracted - * @throws {TypeError} 2 arguments required - * - * @example - * // Subtract 10 days from 1 September 2014: - * const result = subDays(new Date(2014, 8, 1), 10) - * //=> Fri Aug 22 2014 00:00:00 - */ -function subDays(dirtyDate, dirtyAmount) { - (0, _index3.default)(2, arguments); - var amount = (0, _index.default)(dirtyAmount); - return (0, _index2.default)(dirtyDate, -amount); -} +/***/ }), + +/***/ 8510: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; -module.exports = exports.default; /***/ }), -/* 141 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { + +/***/ 4638: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var PlainValue = __webpack_require__(513); -var resolveSeq = __webpack_require__(329); -var warnings = __webpack_require__(892); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Explorer = void 0; -function createMap(schema, obj, ctx) { - const map = new resolveSeq.YAMLMap(schema); +var _path = _interopRequireDefault(__nccwpck_require__(1017)); - if (obj instanceof Map) { - for (const [key, value] of obj) map.items.push(schema.createPair(key, value, ctx)); - } else if (obj && typeof obj === 'object') { - for (const key of Object.keys(obj)) map.items.push(schema.createPair(key, obj[key], ctx)); +var _ExplorerBase = __nccwpck_require__(4135); + +var _readFile = __nccwpck_require__(1238); + +var _cacheWrapper = __nccwpck_require__(6905); + +var _getDirectory = __nccwpck_require__(6427); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class Explorer extends _ExplorerBase.ExplorerBase { + constructor(options) { + super(options); } - if (typeof schema.sortMapEntries === 'function') { - map.items.sort(schema.sortMapEntries); + async search(searchFrom = process.cwd()) { + const startDirectory = await (0, _getDirectory.getDirectory)(searchFrom); + const result = await this.searchFromDirectory(startDirectory); + return result; } - return map; -} + async searchFromDirectory(dir) { + const absoluteDir = _path.default.resolve(process.cwd(), dir); -const map = { - createNode: createMap, - default: true, - nodeClass: resolveSeq.YAMLMap, - tag: 'tag:yaml.org,2002:map', - resolve: resolveSeq.resolveMap -}; + const run = async () => { + const result = await this.searchDirectory(absoluteDir); + const nextDir = this.nextDirectoryToSearch(absoluteDir, result); -function createSeq(schema, obj, ctx) { - const seq = new resolveSeq.YAMLSeq(schema); + if (nextDir) { + return this.searchFromDirectory(nextDir); + } - if (obj && obj[Symbol.iterator]) { - for (const it of obj) { - const v = schema.createNode(it, ctx.wrapScalars, null, ctx); - seq.items.push(v); + const transformResult = await this.config.transform(result); + return transformResult; + }; + + if (this.searchCache) { + return (0, _cacheWrapper.cacheWrapper)(this.searchCache, absoluteDir, run); } + + return run(); } - return seq; -} + async searchDirectory(dir) { + for await (const place of this.config.searchPlaces) { + const placeResult = await this.loadSearchPlace(dir, place); -const seq = { - createNode: createSeq, - default: true, - nodeClass: resolveSeq.YAMLSeq, - tag: 'tag:yaml.org,2002:seq', - resolve: resolveSeq.resolveSeq -}; + if (this.shouldSearchStopWithResult(placeResult) === true) { + return placeResult; + } + } // config not found -const string = { - identify: value => typeof value === 'string', - default: true, - tag: 'tag:yaml.org,2002:str', - resolve: resolveSeq.resolveString, - stringify(item, ctx, onComment, onChompKeep) { - ctx = Object.assign({ - actualString: true - }, ctx); - return resolveSeq.stringifyString(item, ctx, onComment, onChompKeep); - }, + return null; + } - options: resolveSeq.strOptions -}; + async loadSearchPlace(dir, place) { + const filepath = _path.default.join(dir, place); -const failsafe = [map, seq, string]; + const fileContents = await (0, _readFile.readFile)(filepath); + const result = await this.createCosmiconfigResult(filepath, fileContents); + return result; + } -/* global BigInt */ + async loadFileContent(filepath, content) { + if (content === null) { + return null; + } -const intIdentify$2 = value => typeof value === 'bigint' || Number.isInteger(value); + if (content.trim() === '') { + return undefined; + } -const intResolve$1 = (src, part, radix) => resolveSeq.intOptions.asBigInt ? BigInt(src) : parseInt(part, radix); + const loader = this.getLoaderEntryForFile(filepath); + const loaderResult = await loader(filepath, content); + return loaderResult; + } -function intStringify$1(node, radix, prefix) { - const { - value - } = node; - if (intIdentify$2(value) && value >= 0) return prefix + value.toString(radix); - return resolveSeq.stringifyNumber(node); -} + async createCosmiconfigResult(filepath, content) { + const fileContent = await this.loadFileContent(filepath, content); + const result = this.loadedContentToCosmiconfigResult(filepath, fileContent); + return result; + } -const nullObj = { - identify: value => value == null, - createNode: (schema, value, ctx) => ctx.wrapScalars ? new resolveSeq.Scalar(null) : null, - default: true, - tag: 'tag:yaml.org,2002:null', - test: /^(?:~|[Nn]ull|NULL)?$/, - resolve: () => null, - options: resolveSeq.nullOptions, - stringify: () => resolveSeq.nullOptions.nullStr -}; -const boolObj = { - identify: value => typeof value === 'boolean', - default: true, - tag: 'tag:yaml.org,2002:bool', - test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, - resolve: str => str[0] === 't' || str[0] === 'T', - options: resolveSeq.boolOptions, - stringify: ({ - value - }) => value ? resolveSeq.boolOptions.trueStr : resolveSeq.boolOptions.falseStr -}; -const octObj = { - identify: value => intIdentify$2(value) && value >= 0, - default: true, - tag: 'tag:yaml.org,2002:int', - format: 'OCT', - test: /^0o([0-7]+)$/, - resolve: (str, oct) => intResolve$1(str, oct, 8), - options: resolveSeq.intOptions, - stringify: node => intStringify$1(node, 8, '0o') -}; -const intObj = { - identify: intIdentify$2, - default: true, - tag: 'tag:yaml.org,2002:int', - test: /^[-+]?[0-9]+$/, - resolve: str => intResolve$1(str, str, 10), - options: resolveSeq.intOptions, - stringify: resolveSeq.stringifyNumber -}; -const hexObj = { - identify: value => intIdentify$2(value) && value >= 0, - default: true, - tag: 'tag:yaml.org,2002:int', - format: 'HEX', - test: /^0x([0-9a-fA-F]+)$/, - resolve: (str, hex) => intResolve$1(str, hex, 16), - options: resolveSeq.intOptions, - stringify: node => intStringify$1(node, 16, '0x') -}; -const nanObj = { - identify: value => typeof value === 'number', - default: true, - tag: 'tag:yaml.org,2002:float', - test: /^(?:[-+]?\.inf|(\.nan))$/i, - resolve: (str, nan) => nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, - stringify: resolveSeq.stringifyNumber -}; -const expObj = { - identify: value => typeof value === 'number', - default: true, - tag: 'tag:yaml.org,2002:float', - format: 'EXP', - test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, - resolve: str => parseFloat(str), - stringify: ({ - value - }) => Number(value).toExponential() -}; -const floatObj = { - identify: value => typeof value === 'number', - default: true, - tag: 'tag:yaml.org,2002:float', - test: /^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/, + async load(filepath) { + this.validateFilePath(filepath); - resolve(str, frac1, frac2) { - const frac = frac1 || frac2; - const node = new resolveSeq.Scalar(parseFloat(str)); - if (frac && frac[frac.length - 1] === '0') node.minFractionDigits = frac.length; - return node; - }, + const absoluteFilePath = _path.default.resolve(process.cwd(), filepath); - stringify: resolveSeq.stringifyNumber -}; -const core = failsafe.concat([nullObj, boolObj, octObj, intObj, hexObj, nanObj, expObj, floatObj]); + const runLoad = async () => { + const fileContents = await (0, _readFile.readFile)(absoluteFilePath, { + throwNotFound: true + }); + const result = await this.createCosmiconfigResult(absoluteFilePath, fileContents); + const transformResult = await this.config.transform(result); + return transformResult; + }; -/* global BigInt */ + if (this.loadCache) { + return (0, _cacheWrapper.cacheWrapper)(this.loadCache, absoluteFilePath, runLoad); + } -const intIdentify$1 = value => typeof value === 'bigint' || Number.isInteger(value); + return runLoad(); + } -const stringifyJSON = ({ - value -}) => JSON.stringify(value); +} -const json = [map, seq, { - identify: value => typeof value === 'string', - default: true, - tag: 'tag:yaml.org,2002:str', - resolve: resolveSeq.resolveString, - stringify: stringifyJSON -}, { - identify: value => value == null, - createNode: (schema, value, ctx) => ctx.wrapScalars ? new resolveSeq.Scalar(null) : null, - default: true, - tag: 'tag:yaml.org,2002:null', - test: /^null$/, - resolve: () => null, - stringify: stringifyJSON -}, { - identify: value => typeof value === 'boolean', - default: true, - tag: 'tag:yaml.org,2002:bool', - test: /^true|false$/, - resolve: str => str === 'true', - stringify: stringifyJSON -}, { - identify: intIdentify$1, - default: true, - tag: 'tag:yaml.org,2002:int', - test: /^-?(?:0|[1-9][0-9]*)$/, - resolve: str => resolveSeq.intOptions.asBigInt ? BigInt(str) : parseInt(str, 10), - stringify: ({ - value - }) => intIdentify$1(value) ? value.toString() : JSON.stringify(value) -}, { - identify: value => typeof value === 'number', - default: true, - tag: 'tag:yaml.org,2002:float', - test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, - resolve: str => parseFloat(str), - stringify: stringifyJSON -}]; +exports.Explorer = Explorer; +//# sourceMappingURL=Explorer.js.map -json.scalarFallback = str => { - throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(str)}`); -}; +/***/ }), -/* global BigInt */ +/***/ 4135: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const boolStringify = ({ - value -}) => value ? resolveSeq.boolOptions.trueStr : resolveSeq.boolOptions.falseStr; +"use strict"; -const intIdentify = value => typeof value === 'bigint' || Number.isInteger(value); -function intResolve(sign, src, radix) { - let str = src.replace(/_/g, ''); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ExplorerBase = void 0; +exports.getExtensionDescription = getExtensionDescription; - if (resolveSeq.intOptions.asBigInt) { - switch (radix) { - case 2: - str = `0b${str}`; - break; +var _path = _interopRequireDefault(__nccwpck_require__(1017)); - case 8: - str = `0o${str}`; - break; +var _loaders = __nccwpck_require__(8751); - case 16: - str = `0x${str}`; - break; - } +var _getPropertyByPath = __nccwpck_require__(1719); - const n = BigInt(str); - return sign === '-' ? BigInt(-1) * n : n; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - const n = parseInt(str, radix); - return sign === '-' ? -1 * n : n; -} +class ExplorerBase { + constructor(options) { + if (options.cache === true) { + this.loadCache = new Map(); + this.searchCache = new Map(); + } -function intStringify(node, radix, prefix) { - const { - value - } = node; + this.config = options; + this.validateConfig(); + } - if (intIdentify(value)) { - const str = value.toString(radix); - return value < 0 ? '-' + prefix + str.substr(1) : prefix + str; + clearLoadCache() { + if (this.loadCache) { + this.loadCache.clear(); + } } - return resolveSeq.stringifyNumber(node); -} + clearSearchCache() { + if (this.searchCache) { + this.searchCache.clear(); + } + } -const yaml11 = failsafe.concat([{ - identify: value => value == null, - createNode: (schema, value, ctx) => ctx.wrapScalars ? new resolveSeq.Scalar(null) : null, - default: true, - tag: 'tag:yaml.org,2002:null', - test: /^(?:~|[Nn]ull|NULL)?$/, - resolve: () => null, - options: resolveSeq.nullOptions, - stringify: () => resolveSeq.nullOptions.nullStr -}, { - identify: value => typeof value === 'boolean', - default: true, - tag: 'tag:yaml.org,2002:bool', - test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, - resolve: () => true, - options: resolveSeq.boolOptions, - stringify: boolStringify -}, { - identify: value => typeof value === 'boolean', - default: true, - tag: 'tag:yaml.org,2002:bool', - test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i, - resolve: () => false, - options: resolveSeq.boolOptions, - stringify: boolStringify -}, { - identify: intIdentify, - default: true, - tag: 'tag:yaml.org,2002:int', - format: 'BIN', - test: /^([-+]?)0b([0-1_]+)$/, - resolve: (str, sign, bin) => intResolve(sign, bin, 2), - stringify: node => intStringify(node, 2, '0b') -}, { - identify: intIdentify, - default: true, - tag: 'tag:yaml.org,2002:int', - format: 'OCT', - test: /^([-+]?)0([0-7_]+)$/, - resolve: (str, sign, oct) => intResolve(sign, oct, 8), - stringify: node => intStringify(node, 8, '0') -}, { - identify: intIdentify, - default: true, - tag: 'tag:yaml.org,2002:int', - test: /^([-+]?)([0-9][0-9_]*)$/, - resolve: (str, sign, abs) => intResolve(sign, abs, 10), - stringify: resolveSeq.stringifyNumber -}, { - identify: intIdentify, - default: true, - tag: 'tag:yaml.org,2002:int', - format: 'HEX', - test: /^([-+]?)0x([0-9a-fA-F_]+)$/, - resolve: (str, sign, hex) => intResolve(sign, hex, 16), - stringify: node => intStringify(node, 16, '0x') -}, { - identify: value => typeof value === 'number', - default: true, - tag: 'tag:yaml.org,2002:float', - test: /^(?:[-+]?\.inf|(\.nan))$/i, - resolve: (str, nan) => nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, - stringify: resolveSeq.stringifyNumber -}, { - identify: value => typeof value === 'number', - default: true, - tag: 'tag:yaml.org,2002:float', - format: 'EXP', - test: /^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/, - resolve: str => parseFloat(str.replace(/_/g, '')), - stringify: ({ - value - }) => Number(value).toExponential() -}, { - identify: value => typeof value === 'number', - default: true, - tag: 'tag:yaml.org,2002:float', - test: /^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/, + clearCaches() { + this.clearLoadCache(); + this.clearSearchCache(); + } - resolve(str, frac) { - const node = new resolveSeq.Scalar(parseFloat(str.replace(/_/g, ''))); + validateConfig() { + const config = this.config; + config.searchPlaces.forEach(place => { + const loaderKey = _path.default.extname(place) || 'noExt'; + const loader = config.loaders[loaderKey]; - if (frac) { - const f = frac.replace(/_/g, ''); - if (f[f.length - 1] === '0') node.minFractionDigits = f.length; - } + if (!loader) { + throw new Error(`No loader specified for ${getExtensionDescription(place)}, so searchPlaces item "${place}" is invalid`); + } - return node; - }, + if (typeof loader !== 'function') { + throw new Error(`loader for ${getExtensionDescription(place)} is not a function (type provided: "${typeof loader}"), so searchPlaces item "${place}" is invalid`); + } + }); + } - stringify: resolveSeq.stringifyNumber -}], warnings.binary, warnings.omap, warnings.pairs, warnings.set, warnings.intTime, warnings.floatTime, warnings.timestamp); + shouldSearchStopWithResult(result) { + if (result === null) return false; + if (result.isEmpty && this.config.ignoreEmptySearchPlaces) return false; + return true; + } -const schemas = { - core, - failsafe, - json, - yaml11 -}; -const tags = { - binary: warnings.binary, - bool: boolObj, - float: floatObj, - floatExp: expObj, - floatNaN: nanObj, - floatTime: warnings.floatTime, - int: intObj, - intHex: hexObj, - intOct: octObj, - intTime: warnings.intTime, - map, - null: nullObj, - omap: warnings.omap, - pairs: warnings.pairs, - seq, - set: warnings.set, - timestamp: warnings.timestamp -}; + nextDirectoryToSearch(currentDir, currentResult) { + if (this.shouldSearchStopWithResult(currentResult)) { + return null; + } -function findTagObject(value, tagName, tags) { - if (tagName) { - const match = tags.filter(t => t.tag === tagName); - const tagObj = match.find(t => !t.format) || match[0]; - if (!tagObj) throw new Error(`Tag ${tagName} not found`); - return tagObj; - } // TODO: deprecate/remove class check + const nextDir = nextDirUp(currentDir); + if (nextDir === currentDir || currentDir === this.config.stopDir) { + return null; + } - return tags.find(t => (t.identify && t.identify(value) || t.class && value instanceof t.class) && !t.format); -} + return nextDir; + } -function createNode(value, tagName, ctx) { - if (value instanceof resolveSeq.Node) return value; - const { - defaultPrefix, - onTagObj, - prevObjects, - schema, - wrapScalars - } = ctx; - if (tagName && tagName.startsWith('!!')) tagName = defaultPrefix + tagName.slice(2); - let tagObj = findTagObject(value, tagName, schema.tags); + loadPackageProp(filepath, content) { + const parsedContent = _loaders.loaders.loadJson(filepath, content); - if (!tagObj) { - if (typeof value.toJSON === 'function') value = value.toJSON(); - if (!value || typeof value !== 'object') return wrapScalars ? new resolveSeq.Scalar(value) : value; - tagObj = value instanceof Map ? map : value[Symbol.iterator] ? seq : map; + const packagePropValue = (0, _getPropertyByPath.getPropertyByPath)(parsedContent, this.config.packageProp); + return packagePropValue || null; } - if (onTagObj) { - onTagObj(tagObj); - delete ctx.onTagObj; - } // Detect duplicate references to the same object & use Alias nodes for all - // after first. The `obj` wrapper allows for circular references to resolve. - + getLoaderEntryForFile(filepath) { + if (_path.default.basename(filepath) === 'package.json') { + const loader = this.loadPackageProp.bind(this); + return loader; + } - const obj = { - value: undefined, - node: undefined - }; + const loaderKey = _path.default.extname(filepath) || 'noExt'; + const loader = this.config.loaders[loaderKey]; - if (value && typeof value === 'object' && prevObjects) { - const prev = prevObjects.get(value); + if (!loader) { + throw new Error(`No loader specified for ${getExtensionDescription(filepath)}`); + } - if (prev) { - const alias = new resolveSeq.Alias(prev); // leaves source dirty; must be cleaned by caller + return loader; + } - ctx.aliasNodes.push(alias); // defined along with prevObjects + loadedContentToCosmiconfigResult(filepath, loadedContent) { + if (loadedContent === null) { + return null; + } - return alias; + if (loadedContent === undefined) { + return { + filepath, + config: undefined, + isEmpty: true + }; } - obj.value = value; - prevObjects.set(value, obj); + return { + config: loadedContent, + filepath + }; + } + + validateFilePath(filepath) { + if (!filepath) { + throw new Error('load must pass a non-empty string'); + } } - obj.node = tagObj.createNode ? tagObj.createNode(ctx.schema, value, ctx) : wrapScalars ? new resolveSeq.Scalar(value) : value; - if (tagName && obj.node instanceof resolveSeq.Node) obj.node.tag = tagName; - return obj.node; } -function getSchemaTags(schemas, knownTags, customTags, schemaId) { - let tags = schemas[schemaId.replace(/\W/g, '')]; // 'yaml-1.1' -> 'yaml11' +exports.ExplorerBase = ExplorerBase; - if (!tags) { - const keys = Object.keys(schemas).map(key => JSON.stringify(key)).join(', '); - throw new Error(`Unknown schema "${schemaId}"; use one of ${keys}`); - } +function nextDirUp(dir) { + return _path.default.dirname(dir); +} - if (Array.isArray(customTags)) { - for (const tag of customTags) tags = tags.concat(tag); - } else if (typeof customTags === 'function') { - tags = customTags(tags.slice()); - } +function getExtensionDescription(filepath) { + const ext = _path.default.extname(filepath); - for (let i = 0; i < tags.length; ++i) { - const tag = tags[i]; + return ext ? `extension "${ext}"` : 'files without extensions'; +} +//# sourceMappingURL=ExplorerBase.js.map - if (typeof tag === 'string') { - const tagObj = knownTags[tag]; +/***/ }), - if (!tagObj) { - const keys = Object.keys(knownTags).map(key => JSON.stringify(key)).join(', '); - throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`); - } +/***/ 6239: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - tags[i] = tagObj; - } - } +"use strict"; - return tags; -} -const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ExplorerSync = void 0; -class Schema { - // TODO: remove in v2 - // TODO: remove in v2 - constructor({ - customTags, - merge, - schema, - sortMapEntries, - tags: deprecatedCustomTags - }) { - this.merge = !!merge; - this.name = schema; - this.sortMapEntries = sortMapEntries === true ? sortMapEntriesByKey : sortMapEntries || null; - if (!customTags && deprecatedCustomTags) warnings.warnOptionDeprecation('tags', 'customTags'); - this.tags = getSchemaTags(schemas, tags, customTags || deprecatedCustomTags, schema); - } +var _path = _interopRequireDefault(__nccwpck_require__(1017)); - createNode(value, wrapScalars, tagName, ctx) { - const baseCtx = { - defaultPrefix: Schema.defaultPrefix, - schema: this, - wrapScalars - }; - const createCtx = ctx ? Object.assign(ctx, baseCtx) : baseCtx; - return createNode(value, tagName, createCtx); +var _ExplorerBase = __nccwpck_require__(4135); + +var _readFile = __nccwpck_require__(1238); + +var _cacheWrapper = __nccwpck_require__(6905); + +var _getDirectory = __nccwpck_require__(6427); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class ExplorerSync extends _ExplorerBase.ExplorerBase { + constructor(options) { + super(options); } - createPair(key, value, ctx) { - if (!ctx) ctx = { - wrapScalars: true - }; - const k = this.createNode(key, ctx.wrapScalars, null, ctx); - const v = this.createNode(value, ctx.wrapScalars, null, ctx); - return new resolveSeq.Pair(k, v); + searchSync(searchFrom = process.cwd()) { + const startDirectory = (0, _getDirectory.getDirectorySync)(searchFrom); + const result = this.searchFromDirectorySync(startDirectory); + return result; } -} + searchFromDirectorySync(dir) { + const absoluteDir = _path.default.resolve(process.cwd(), dir); -PlainValue._defineProperty(Schema, "defaultPrefix", PlainValue.defaultTagPrefix); + const run = () => { + const result = this.searchDirectorySync(absoluteDir); + const nextDir = this.nextDirectoryToSearch(absoluteDir, result); -PlainValue._defineProperty(Schema, "defaultTags", PlainValue.defaultTags); + if (nextDir) { + return this.searchFromDirectorySync(nextDir); + } -exports.Schema = Schema; + const transformResult = this.config.transform(result); + return transformResult; + }; + if (this.searchCache) { + return (0, _cacheWrapper.cacheWrapperSync)(this.searchCache, absoluteDir, run); + } -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { + return run(); + } -"use strict"; + searchDirectorySync(dir) { + for (const place of this.config.searchPlaces) { + const placeResult = this.loadSearchPlaceSync(dir, place); + if (this.shouldSearchStopWithResult(placeResult) === true) { + return placeResult; + } + } // config not found -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isSameISOWeek; -var _index = _interopRequireDefault(__webpack_require__(249)); + return null; + } -var _index2 = _interopRequireDefault(__webpack_require__(217)); + loadSearchPlaceSync(dir, place) { + const filepath = _path.default.join(dir, place); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + const content = (0, _readFile.readFileSync)(filepath); + const result = this.createCosmiconfigResultSync(filepath, content); + return result; + } -/** - * @name isSameISOWeek - * @category ISO Week Helpers - * @summary Are the given dates in the same ISO week? - * - * @description - * Are the given dates in the same ISO week? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} dateLeft - the first date to check - * @param {Date|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same ISO week - * @throws {TypeError} 2 arguments required - * - * @example - * // Are 1 September 2014 and 7 September 2014 in the same ISO week? - * var result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7)) - * //=> true - */ -function isSameISOWeek(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - return (0, _index.default)(dirtyDateLeft, dirtyDateRight, { - weekStartsOn: 1 - }); -} + loadFileContentSync(filepath, content) { + if (content === null) { + return null; + } -module.exports = exports.default; + if (content.trim() === '') { + return undefined; + } -/***/ }), -/* 143 */, -/* 144 */, -/* 145 */, -/* 146 */, -/* 147 */, -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { + const loader = this.getLoaderEntryForFile(filepath); + const loaderResult = loader(filepath, content); + return loaderResult; + } -"use strict"; + createCosmiconfigResultSync(filepath, content) { + const fileContent = this.loadFileContentSync(filepath, content); + const result = this.loadedContentToCosmiconfigResult(filepath, fileContent); + return result; + } + loadSync(filepath) { + this.validateFilePath(filepath); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isFirstDayOfMonth; + const absoluteFilePath = _path.default.resolve(process.cwd(), filepath); -var _index = _interopRequireDefault(__webpack_require__(773)); + const runLoadSync = () => { + const content = (0, _readFile.readFileSync)(absoluteFilePath, { + throwNotFound: true + }); + const cosmiconfigResult = this.createCosmiconfigResultSync(absoluteFilePath, content); + const transformResult = this.config.transform(cosmiconfigResult); + return transformResult; + }; -var _index2 = _interopRequireDefault(__webpack_require__(217)); + if (this.loadCache) { + return (0, _cacheWrapper.cacheWrapperSync)(this.loadCache, absoluteFilePath, runLoadSync); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return runLoadSync(); + } -/** - * @name isFirstDayOfMonth - * @category Month Helpers - * @summary Is the given date the first day of a month? - * - * @description - * Is the given date the first day of a month? - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is the first day of a month - * @throws {TypeError} 1 argument required - * - * @example - * // Is 1 September 2014 the first day of a month? - * var result = isFirstDayOfMonth(new Date(2014, 8, 1)) - * //=> true - */ -function isFirstDayOfMonth(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate).getDate() === 1; } -module.exports = exports.default; +exports.ExplorerSync = ExplorerSync; +//# sourceMappingURL=ExplorerSync.js.map /***/ }), -/* 149 */, -/* 150 */, -/* 151 */ -/***/ (function(module, exports) { + +/***/ 6905: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getTimezoneOffsetInMilliseconds; - -/** - * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. - * They usually appear for dates that denote time before the timezones were introduced - * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 - * and GMT+01:00:00 after that date) - * - * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above, - * which would lead to incorrect calculations. - * - * This function returns the timezone offset in milliseconds that takes seconds in account. - */ -function getTimezoneOffsetInMilliseconds(date) { - var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())); - utcDate.setUTCFullYear(date.getFullYear()); - return date.getTime() - utcDate.getTime(); -} - -module.exports = exports.default; +})); +exports.cacheWrapper = cacheWrapper; +exports.cacheWrapperSync = cacheWrapperSync; -/***/ }), -/* 152 */, -/* 153 */, -/* 154 */, -/* 155 */, -/* 156 */ -/***/ (function(module) { +async function cacheWrapper(cache, key, fn) { + const cached = cache.get(key); -"use strict"; + if (cached !== undefined) { + return cached; + } + const result = await fn(); + cache.set(key, result); + return result; +} -module.exports = function isArrayish(obj) { - if (!obj) { - return false; - } +function cacheWrapperSync(cache, key, fn) { + const cached = cache.get(key); - return obj instanceof Array || Array.isArray(obj) || - (obj.length >= 0 && obj.splice instanceof Function); -}; + if (cached !== undefined) { + return cached; + } + const result = fn(); + cache.set(key, result); + return result; +} +//# sourceMappingURL=cacheWrapper.js.map /***/ }), -/* 157 */, -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6427: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInBusinessDays; +})); +exports.getDirectory = getDirectory; +exports.getDirectorySync = getDirectorySync; -var _index = _interopRequireDefault(__webpack_require__(909)); +var _path = _interopRequireDefault(__nccwpck_require__(1017)); -var _index2 = _interopRequireDefault(__webpack_require__(807)); +var _pathType = __nccwpck_require__(3433); -var _index3 = _interopRequireDefault(__webpack_require__(773)); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _index4 = _interopRequireDefault(__webpack_require__(580)); +async function getDirectory(filepath) { + const filePathIsDirectory = await (0, _pathType.isDirectory)(filepath); -var _index5 = _interopRequireDefault(__webpack_require__(865)); + if (filePathIsDirectory === true) { + return filepath; + } -var _index6 = _interopRequireDefault(__webpack_require__(491)); + const directory = _path.default.dirname(filepath); -var _index7 = _interopRequireDefault(__webpack_require__(841)); + return directory; +} -var _index8 = _interopRequireDefault(__webpack_require__(217)); +function getDirectorySync(filepath) { + const filePathIsDirectory = (0, _pathType.isDirectorySync)(filepath); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (filePathIsDirectory === true) { + return filepath; + } -/** - * @name differenceInBusinessDays - * @category Day Helpers - * @summary Get the number of business days between the given dates. - * - * @description - * Get the number of business day periods between the given dates. - * Business days being days that arent in the weekend. - * Like `differenceInCalendarDays`, the function removes the times from - * the dates before calculating the difference. - * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of business days - * @throws {TypeError} 2 arguments required - * - * @example - * // How many business days are between - * // 10 January 2014 and 20 July 2014? - * var result = differenceInBusinessDays( - * new Date(2014, 6, 20), - * new Date(2014, 0, 10) - * ) - * //=> 136 - */ -function differenceInBusinessDays(dirtyDateLeft, dirtyDateRight) { - (0, _index8.default)(2, arguments); - var dateLeft = (0, _index3.default)(dirtyDateLeft); - var dateRight = (0, _index3.default)(dirtyDateRight); - if (!(0, _index.default)(dateLeft) || !(0, _index.default)(dateRight)) return NaN; - var calendarDifference = (0, _index4.default)(dateLeft, dateRight); - var sign = calendarDifference < 0 ? -1 : 1; - var weeks = (0, _index7.default)(calendarDifference / 7); - var result = weeks * 5; - dateRight = (0, _index5.default)(dateRight, weeks * 7); // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week - - while (!(0, _index6.default)(dateLeft, dateRight)) { - // sign is used to account for both negative and positive differences - result += (0, _index2.default)(dateRight) ? 0 : sign; - dateRight = (0, _index5.default)(dateRight, sign); - } + const directory = _path.default.dirname(filepath); - return result === 0 ? 0 : result; + return directory; } - -module.exports = exports.default; +//# sourceMappingURL=getDirectory.js.map /***/ }), -/* 159 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1719: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = eachMonthOfInterval; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name eachMonthOfInterval - * @category Interval Helpers - * @summary Return the array of months within the specified time interval. - * - * @description - * Return the array of months within the specified time interval. - * - * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} - * @returns {Date[]} the array with starts of months from the month of the interval start to the month of the interval end - * @throws {TypeError} 1 argument required - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` - * - * @example - * // Each month between 6 February 2014 and 10 August 2014: - * var result = eachMonthOfInterval({ - * start: new Date(2014, 1, 6), - * end: new Date(2014, 7, 10) - * }) - * //=> [ - * // Sat Feb 01 2014 00:00:00, - * // Sat Mar 01 2014 00:00:00, - * // Tue Apr 01 2014 00:00:00, - * // Thu May 01 2014 00:00:00, - * // Sun Jun 01 2014 00:00:00, - * // Tue Jul 01 2014 00:00:00, - * // Fri Aug 01 2014 00:00:00 - * // ] - */ -function eachMonthOfInterval(dirtyInterval) { - (0, _index2.default)(1, arguments); - var interval = dirtyInterval || {}; - var startDate = (0, _index.default)(interval.start); - var endDate = (0, _index.default)(interval.end); - var endTime = endDate.getTime(); - var dates = []; // Throw an exception if start date is after end date or if any date is `Invalid Date` +})); +exports.getPropertyByPath = getPropertyByPath; - if (!(startDate.getTime() <= endTime)) { - throw new RangeError('Invalid interval'); +// Resolves property names or property paths defined with period-delimited +// strings or arrays of strings. Property names that are found on the source +// object are used directly (even if they include a period). +// Nested property names that include periods, within a path, are only +// understood in array paths. +function getPropertyByPath(source, path) { + if (typeof path === 'string' && Object.prototype.hasOwnProperty.call(source, path)) { + return source[path]; } - var currentDate = startDate; - currentDate.setHours(0, 0, 0, 0); - currentDate.setDate(1); + const parsedPath = typeof path === 'string' ? path.split('.') : path; // eslint-disable-next-line @typescript-eslint/no-explicit-any - while (currentDate.getTime() <= endTime) { - dates.push((0, _index.default)(currentDate)); - currentDate.setMonth(currentDate.getMonth() + 1); - } + return parsedPath.reduce((previous, key) => { + if (previous === undefined) { + return previous; + } - return dates; + return previous[key]; + }, source); } - -module.exports = exports.default; +//# sourceMappingURL=getPropertyByPath.js.map /***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4066: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInCalendarISOWeekYears; +})); +exports.cosmiconfig = cosmiconfig; +exports.cosmiconfigSync = cosmiconfigSync; +exports.defaultLoaders = void 0; + +var _os = _interopRequireDefault(__nccwpck_require__(2037)); -var _index = _interopRequireDefault(__webpack_require__(976)); +var _Explorer = __nccwpck_require__(4638); -var _index2 = _interopRequireDefault(__webpack_require__(217)); +var _ExplorerSync = __nccwpck_require__(6239); + +var _loaders = __nccwpck_require__(8751); + +var _types = __nccwpck_require__(1943); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * @name differenceInCalendarISOWeekYears - * @category ISO Week-Numbering Year Helpers - * @summary Get the number of calendar ISO week-numbering years between the given dates. - * - * @description - * Get the number of calendar ISO week-numbering years between the given dates. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * - The function was renamed from `differenceInCalendarISOYears` to `differenceInCalendarISOWeekYears`. - * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). - * This change makes the name consistent with - * locale-dependent week-numbering year helpers, e.g., `addWeekYears`. - * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of calendar ISO week-numbering years - * @throws {TypeError} 2 arguments required - * - * @example - * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012? - * const result = differenceInCalendarISOWeekYears( - * new Date(2012, 0, 1), - * new Date(2010, 0, 1) - * ) - * //=> 2 - */ -function differenceInCalendarISOWeekYears(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - return (0, _index.default)(dirtyDateLeft) - (0, _index.default)(dirtyDateRight); -} +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +function cosmiconfig(moduleName, options = {}) { + const normalizedOptions = normalizeOptions(moduleName, options); + const explorer = new _Explorer.Explorer(normalizedOptions); + return { + search: explorer.search.bind(explorer), + load: explorer.load.bind(explorer), + clearLoadCache: explorer.clearLoadCache.bind(explorer), + clearSearchCache: explorer.clearSearchCache.bind(explorer), + clearCaches: explorer.clearCaches.bind(explorer) + }; +} // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -module.exports = exports.default; + +function cosmiconfigSync(moduleName, options = {}) { + const normalizedOptions = normalizeOptions(moduleName, options); + const explorerSync = new _ExplorerSync.ExplorerSync(normalizedOptions); + return { + search: explorerSync.searchSync.bind(explorerSync), + load: explorerSync.loadSync.bind(explorerSync), + clearLoadCache: explorerSync.clearLoadCache.bind(explorerSync), + clearSearchCache: explorerSync.clearSearchCache.bind(explorerSync), + clearCaches: explorerSync.clearCaches.bind(explorerSync) + }; +} // do not allow mutation of default loaders. Make sure it is set inside options + + +const defaultLoaders = Object.freeze({ + '.cjs': _loaders.loaders.loadJs, + '.js': _loaders.loaders.loadJs, + '.json': _loaders.loaders.loadJson, + '.yaml': _loaders.loaders.loadYaml, + '.yml': _loaders.loaders.loadYaml, + noExt: _loaders.loaders.loadYaml +}); +exports.defaultLoaders = defaultLoaders; + +const identity = function identity(x) { + return x; +}; + +function normalizeOptions(moduleName, options) { + const defaults = { + packageProp: moduleName, + searchPlaces: ['package.json', `.${moduleName}rc`, `.${moduleName}rc.json`, `.${moduleName}rc.yaml`, `.${moduleName}rc.yml`, `.${moduleName}rc.js`, `.${moduleName}rc.cjs`, `.config/${moduleName}rc`, `.config/${moduleName}rc.json`, `.config/${moduleName}rc.yaml`, `.config/${moduleName}rc.yml`, `.config/${moduleName}rc.js`, `.config/${moduleName}rc.cjs`, `${moduleName}.config.js`, `${moduleName}.config.cjs`], + ignoreEmptySearchPlaces: true, + stopDir: _os.default.homedir(), + cache: true, + transform: identity, + loaders: defaultLoaders + }; + const normalizedOptions = { ...defaults, + ...options, + loaders: { ...defaults.loaders, + ...options.loaders + } + }; + return normalizedOptions; +} +//# sourceMappingURL=index.js.map /***/ }), -/* 161 */, -/* 162 */, -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8751: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getUTCISOWeekYear; - -var _index = _interopRequireDefault(__webpack_require__(773)); +})); +exports.loaders = void 0; -var _index2 = _interopRequireDefault(__webpack_require__(63)); +/* eslint-disable @typescript-eslint/no-require-imports */ +let importFresh; -var _index3 = _interopRequireDefault(__webpack_require__(217)); +const loadJs = function loadJs(filepath) { + if (importFresh === undefined) { + importFresh = __nccwpck_require__(2714); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + const result = importFresh(filepath); + return result; +}; -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function getUTCISOWeekYear(dirtyDate) { - (0, _index3.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var year = date.getUTCFullYear(); - var fourthOfJanuaryOfNextYear = new Date(0); - fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); - fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); - var startOfNextYear = (0, _index2.default)(fourthOfJanuaryOfNextYear); - var fourthOfJanuaryOfThisYear = new Date(0); - fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); - fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); - var startOfThisYear = (0, _index2.default)(fourthOfJanuaryOfThisYear); +let parseJson; - if (date.getTime() >= startOfNextYear.getTime()) { - return year + 1; - } else if (date.getTime() >= startOfThisYear.getTime()) { - return year; - } else { - return year - 1; +const loadJson = function loadJson(filepath, content) { + if (parseJson === undefined) { + parseJson = __nccwpck_require__(6615); } -} -module.exports = exports.default; + try { + const result = parseJson(content); + return result; + } catch (error) { + error.message = `JSON Error in ${filepath}:\n${error.message}`; + throw error; + } +}; -/***/ }), -/* 164 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +let yaml; -const SemVer = __webpack_require__(653) -const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)) +const loadYaml = function loadYaml(filepath, content) { + if (yaml === undefined) { + yaml = __nccwpck_require__(4603); + } -module.exports = compare + try { + const result = yaml.parse(content, { + prettyErrors: true + }); + return result; + } catch (error) { + error.message = `YAML Error in ${filepath}:\n${error.message}`; + throw error; + } +}; +const loaders = { + loadJs, + loadJson, + loadYaml +}; +exports.loaders = loaders; +//# sourceMappingURL=loaders.js.map /***/ }), -/* 165 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1238: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = startOfISOWeekYear; +})); +exports.readFile = readFile; +exports.readFileSync = readFileSync; -var _index = _interopRequireDefault(__webpack_require__(976)); +var _fs = _interopRequireDefault(__nccwpck_require__(7147)); -var _index2 = _interopRequireDefault(__webpack_require__(408)); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _index3 = _interopRequireDefault(__webpack_require__(217)); +async function fsReadFileAsync(pathname, encoding) { + return new Promise((resolve, reject) => { + _fs.default.readFile(pathname, encoding, (error, contents) => { + if (error) { + reject(error); + return; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + resolve(contents); + }); + }); +} -/** - * @name startOfISOWeekYear - * @category ISO Week-Numbering Year Helpers - * @summary Return the start of an ISO week-numbering year for the given date. - * - * @description - * Return the start of an ISO week-numbering year, - * which always starts 3 days before the year's first Thursday. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the original date - * @returns {Date} the start of an ISO week-numbering year - * @throws {TypeError} 1 argument required - * - * @example - * // The start of an ISO week-numbering year for 2 July 2005: - * const result = startOfISOWeekYear(new Date(2005, 6, 2)) - * //=> Mon Jan 03 2005 00:00:00 - */ -function startOfISOWeekYear(dirtyDate) { - (0, _index3.default)(1, arguments); - var year = (0, _index.default)(dirtyDate); - var fourthOfJanuary = new Date(0); - fourthOfJanuary.setFullYear(year, 0, 4); - fourthOfJanuary.setHours(0, 0, 0, 0); - var date = (0, _index2.default)(fourthOfJanuary); - return date; +async function readFile(filepath, options = {}) { + const throwNotFound = options.throwNotFound === true; + + try { + const content = await fsReadFileAsync(filepath, 'utf8'); + return content; + } catch (error) { + if (throwNotFound === false && (error.code === 'ENOENT' || error.code === 'EISDIR')) { + return null; + } + + throw error; + } } -module.exports = exports.default; +function readFileSync(filepath, options = {}) { + const throwNotFound = options.throwNotFound === true; + + try { + const content = _fs.default.readFileSync(filepath, 'utf8'); + + return content; + } catch (error) { + if (throwNotFound === false && (error.code === 'ENOENT' || error.code === 'EISDIR')) { + return null; + } + + throw error; + } +} +//# sourceMappingURL=readFile.js.map /***/ }), -/* 166 */, -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1943: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = intlFormat; +})); +//# sourceMappingURL=types.js.map -var _index = _interopRequireDefault(__webpack_require__(217)); +/***/ }), -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ 8794: +/***/ ((module, exports) => { -/** - * @name intlFormat - * @category Common Helpers - * @summary Format the date with Intl.DateTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat). - * - * @description - * Return the formatted date string in the given format. - * The method uses [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) inside. - * formatOptions are the same as [`Intl.DateTimeFormat` options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options) - * - * > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default. - * - * @param {Date|Number} argument - the original date. - * @param {Object} [formatOptions] - an object with options. - * @param {'lookup'|'best fit'} [formatOptions.localeMatcher='best fit'] - locale selection algorithm. - * @param {'narrow'|'short'|'long'} [formatOptions.weekday] - representation the days of the week. - * @param {'narrow'|'short'|'long'} [formatOptions.era] - representation of eras. - * @param {'numeric'|'2-digit'} [formatOptions.year] - representation of years. - * @param {'numeric'|'2-digit'|'narrow'|'short'|'long'} [formatOptions.month='numeric'] - representation of month. - * @param {'numeric'|'2-digit'} [formatOptions.day='numeric'] - representation of day. - * @param {'numeric'|'2-digit'} [formatOptions.hour='numeric'] - representation of hours. - * @param {'numeric'|'2-digit'} [formatOptions.minute] - representation of minutes. - * @param {'numeric'|'2-digit'} [formatOptions.second] - representation of seconds. - * @param {'short'|'long'} [formatOptions.timeZoneName] - representation of names of time zones. - * @param {'basic'|'best fit'} [formatOptions.formatMatcher='best fit'] - format selection algorithm. - * @param {Boolean} [formatOptions.hour12] - determines whether to use 12-hour time format. - * @param {String} [formatOptions.timeZone] - the time zone to use. - * @param {Object} [localeOptions] - an object with locale. - * @param {String|String[]} [localeOptions.locale] - the locale code - * @returns {String} the formatted date string. - * @throws {TypeError} 1 argument required. - * @throws {RangeError} `date` must not be Invalid Date - * - * @example - * // Represent 10 October 2019 in German. - * // Convert the date with format's options and locale's options. - * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), { - * weekday: 'long', - * year: 'numeric', - * month: 'long', - * day: 'numeric', - * }, { - * locale: 'de-DE', - * }) - * //=> Freitag, 4. Oktober 2019 - * - * @example - * // Represent 10 October 2019. - * // Convert the date with format's options. - * const result = intlFormat.default(new Date(2019, 9, 4, 12, 30, 13, 456), { - * year: 'numeric', - * month: 'numeric', - * day: 'numeric', - * hour: 'numeric', - * }) - * //=> 10/4/2019, 12 PM - * - * @example - * // Represent 10 October 2019 in Korean. - * // Convert the date with locale's options. - * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), { - * locale: 'ko-KR', - * }) - * //=> 2019. 10. 4. - * - * @example - * // Represent 10 October 2019 in middle-endian format: - * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456)) - * //=> 10/4/2019 - */ -function intlFormat(date, formatOrLocale, localeOptions) { - var _localeOptions; +"use strict"; - (0, _index.default)(1, arguments); - var formatOptions; - if (isFormatOptions(formatOrLocale)) { - formatOptions = formatOrLocale; - } else { - localeOptions = formatOrLocale; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = addLeadingZeros; +function addLeadingZeros(number, targetLength) { + var sign = number < 0 ? '-' : ''; + var output = Math.abs(number).toString(); + while (output.length < targetLength) { + output = '0' + output; } - - return new Intl.DateTimeFormat((_localeOptions = localeOptions) === null || _localeOptions === void 0 ? void 0 : _localeOptions.locale, formatOptions).format(date); + return sign + output; } +module.exports = exports.default; -function isFormatOptions(opts) { - return opts !== undefined && !('locale' in opts); -} +/***/ }), + +/***/ 2631: +/***/ ((module, exports) => { +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = assign; +function assign(target, object) { + if (target == null) { + throw new TypeError('assign requires that input parameter not be null or undefined'); + } + for (var property in object) { + if (Object.prototype.hasOwnProperty.call(object, property)) { + ; + target[property] = object[property]; + } + } + return target; +} module.exports = exports.default; /***/ }), -/* 168 */, -/* 169 */, -/* 170 */, -/* 171 */, -/* 172 */, -/* 173 */, -/* 174 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7934: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = endOfMonth; +})); +exports["default"] = cloneObject; +var _index = _interopRequireDefault(__nccwpck_require__(2631)); +function cloneObject(object) { + return (0, _index.default)({}, object); +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(773)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(217)); +/***/ 618: +/***/ ((module, exports, __nccwpck_require__) => { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; -/** - * @name endOfMonth - * @category Month Helpers - * @summary Return the end of a month for the given date. - * - * @description - * Return the end of a month for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the original date - * @returns {Date} the end of a month - * @throws {TypeError} 1 argument required - * - * @example - * // The end of a month for 2 September 2014 11:55:00: - * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 23:59:59.999 - */ -function endOfMonth(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var month = date.getMonth(); - date.setFullYear(date.getFullYear(), month + 1, 0); - date.setHours(23, 59, 59, 999); - return date; -} +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _index = _interopRequireDefault(__nccwpck_require__(1773)); +var _default = _index.default; +exports["default"] = _default; module.exports = exports.default; /***/ }), -/* 175 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 9307: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = milliseconds; +})); +exports.getDefaultOptions = getDefaultOptions; +exports.setDefaultOptions = setDefaultOptions; +var defaultOptions = {}; +function getDefaultOptions() { + return defaultOptions; +} +function setDefaultOptions(newOptions) { + defaultOptions = newOptions; +} -var _index = _interopRequireDefault(__webpack_require__(217)); +/***/ }), -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. -// 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days -var yearInDays = 365.2425; -/** - * @name milliseconds - * @category Millisecond Helpers - * @summary - * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. - * - * @description - * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. - * - * One years equals 365.2425 days according to the formula: - * - * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. - * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days - * - * One month is a year divided by 12. - * - * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {number} the milliseconds - * @throws {TypeError} 1 argument required - * - * @example - * // 1 year in milliseconds - * milliseconds({ years: 1 }) - * //=> 31556952000 - * - * // 3 months in milliseconds - * milliseconds({ months: 3 }) - * //=> 7889238000 - */ - -function milliseconds(_ref) { - var years = _ref.years, - months = _ref.months, - weeks = _ref.weeks, - days = _ref.days, - hours = _ref.hours, - minutes = _ref.minutes, - seconds = _ref.seconds; - (0, _index.default)(1, arguments); - var totalDays = 0; - if (years) totalDays += years * yearInDays; - if (months) totalDays += months * (yearInDays / 12); - if (weeks) totalDays += weeks * 7; - if (days) totalDays += days; - var totalSeconds = totalDays * 24 * 60 * 60; - if (hours) totalSeconds += hours * 60 * 60; - if (minutes) totalSeconds += minutes * 60; - if (seconds) totalSeconds += seconds; - return Math.round(totalSeconds * 1000); -} - -module.exports = exports.default; - -/***/ }), -/* 176 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getUTCISOWeek; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(63)); - -var _index3 = _interopRequireDefault(__webpack_require__(753)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 - -function getUTCISOWeek(dirtyDate) { - (0, _index4.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(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; -} - -module.exports = exports.default; - -/***/ }), -/* 177 */, -/* 178 */, -/* 179 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 9257: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getDaysInMonth; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name getDaysInMonth - * @category Month Helpers - * @summary Get the number of days in a month of the given date. - * - * @description - * Get the number of days in a month of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @returns {Number} the number of days in a month - * @throws {TypeError} 1 argument required - * - * @example - * // How many days are in February 2000? - * const result = getDaysInMonth(new Date(2000, 1)) - * //=> 29 - */ -function getDaysInMonth(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var year = date.getFullYear(); - var monthIndex = date.getMonth(); - var lastDayOfMonth = new Date(0); - lastDayOfMonth.setFullYear(year, monthIndex + 1, 0); - lastDayOfMonth.setHours(0, 0, 0, 0); - return lastDayOfMonth.getDate(); -} - -module.exports = exports.default; - -/***/ }), -/* 180 */, -/* 181 */, -/* 182 */, -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = eachWeekendOfInterval; - -var _index = _interopRequireDefault(__webpack_require__(448)); - -var _index2 = _interopRequireDefault(__webpack_require__(757)); - -var _index3 = _interopRequireDefault(__webpack_require__(807)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name eachWeekendOfInterval - * @category Interval Helpers - * @summary List all the Saturdays and Sundays in the given date interval. - * - * @description - * Get all the Saturdays and Sundays in the given date interval. +})); +exports["default"] = void 0; +var _index = _interopRequireDefault(__nccwpck_require__(2966)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8493)); +var _index3 = _interopRequireDefault(__nccwpck_require__(7170)); +var _index4 = _interopRequireDefault(__nccwpck_require__(8761)); +var _index5 = _interopRequireDefault(__nccwpck_require__(8050)); +var _index6 = _interopRequireDefault(__nccwpck_require__(8794)); +var _index7 = _interopRequireDefault(__nccwpck_require__(289)); +var dayPeriodEnum = { + am: 'am', + pm: 'pm', + midnight: 'midnight', + noon: 'noon', + morning: 'morning', + afternoon: 'afternoon', + evening: 'evening', + night: 'night' +}; +/* + * | | Unit | | Unit | + * |-----|--------------------------------|-----|--------------------------------| + * | a | AM, PM | A* | Milliseconds in day | + * | b | AM, PM, noon, midnight | B | Flexible day period | + * | c | Stand-alone local day of week | C* | Localized hour w/ day period | + * | d | Day of month | D | Day of year | + * | e | Local day of week | E | Day of week | + * | f | | F* | Day of week in month | + * | g* | Modified Julian day | G | Era | + * | h | Hour [1-12] | H | Hour [0-23] | + * | i! | ISO day of week | I! | ISO week of year | + * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | + * | k | Hour [1-24] | K | Hour [0-11] | + * | l* | (deprecated) | L | Stand-alone month | + * | m | Minute | M | Month | + * | n | | N | | + * | o! | Ordinal number modifier | O | Timezone (GMT) | + * | p! | Long localized time | P! | Long localized date | + * | q | Stand-alone quarter | Q | Quarter | + * | r* | Related Gregorian year | R! | ISO week-numbering year | + * | s | Second | S | Fraction of second | + * | t! | Seconds timestamp | T! | Milliseconds timestamp | + * | u | Extended year | U* | Cyclic year | + * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | + * | w | Local week of year | W* | Week of month | + * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | + * | y | Year (abs) | Y | Local week-numbering year | + * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) | * - * @param {Interval} interval - the given interval. See [Interval]{@link https://date-fns.org/docs/Interval} - * @returns {Date[]} an array containing all the Saturdays and Sundays - * @throws {TypeError} 1 argument required - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` + * Letters marked by * are not implemented but reserved by Unicode standard. * - * @example - * // Lists all Saturdays and Sundays in the given date interval - * const result = eachWeekendOfInterval({ - * start: new Date(2018, 8, 17), - * end: new Date(2018, 8, 30) - * }) - * //=> [ - * // Sat Sep 22 2018 00:00:00, - * // Sun Sep 23 2018 00:00:00, - * // Sat Sep 29 2018 00:00:00, - * // Sun Sep 30 2018 00:00:00 - * // ] + * Letters marked by ! are non-standard, but implemented by date-fns: + * - `o` modifies the previous token to turn it into an ordinal (see `format` docs) + * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, + * i.e. 7 for Sunday, 1 for Monday, etc. + * - `I` is ISO week of year, as opposed to `w` which is local week of year. + * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. + * `R` is supposed to be used in conjunction with `I` and `i` + * for universal ISO week-numbering date, whereas + * `Y` is supposed to be used in conjunction with `w` and `e` + * for week-numbering date specific to the locale. + * - `P` is long localized date format + * - `p` is long localized time format */ -function eachWeekendOfInterval(interval) { - (0, _index4.default)(1, arguments); - var dateInterval = (0, _index.default)(interval); - var weekends = []; - var index = 0; - - while (index < dateInterval.length) { - var date = dateInterval[index++]; - if ((0, _index3.default)(date)) { - weekends.push(date); - if ((0, _index2.default)(date)) index = index + 5; +var formatters = { + // Era + G: function G(date, token, localize) { + var era = date.getUTCFullYear() > 0 ? 1 : 0; + switch (token) { + // AD, BC + case 'G': + case 'GG': + case 'GGG': + return localize.era(era, { + width: 'abbreviated' + }); + // A, B + case 'GGGGG': + return localize.era(era, { + width: 'narrow' + }); + // Anno Domini, Before Christ + case 'GGGG': + default: + return localize.era(era, { + width: 'wide' + }); } - } - - return weekends; -} - -module.exports = exports.default; - -/***/ }), -/* 184 */, -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = endOfQuarter; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name endOfQuarter - * @category Quarter Helpers - * @summary Return the end of a year quarter for the given date. - * - * @description - * Return the end of a year quarter for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the original date - * @returns {Date} the end of a quarter - * @throws {TypeError} 1 argument required - * - * @example - * // The end of a quarter for 2 September 2014 11:55:00: - * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 23:59:59.999 - */ -function endOfQuarter(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var currentMonth = date.getMonth(); - var month = currentMonth - currentMonth % 3 + 3; - date.setMonth(month, 0); - date.setHours(23, 59, 59, 999); - return date; -} - -module.exports = exports.default; - -/***/ }), -/* 186 */, -/* 187 */, -/* 188 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = setHours; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(773)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name setHours - * @category Hour Helpers - * @summary Set the hours to the given date. - * - * @description - * Set the hours to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} hours - the hours of the new date - * @returns {Date} the new date with the hours set - * @throws {TypeError} 2 arguments required - * - * @example - * // Set 4 hours to 1 September 2014 11:30:00: - * var result = setHours(new Date(2014, 8, 1, 11, 30), 4) - * //=> Mon Sep 01 2014 04:30:00 - */ -function setHours(dirtyDate, dirtyHours) { - (0, _index3.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var hours = (0, _index.default)(dirtyHours); - date.setHours(hours); - return date; -} - -module.exports = exports.default; - -/***/ }), -/* 189 */, -/* 190 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -const fs = __webpack_require__(826); -const shebangCommand = __webpack_require__(541); - -function readShebang(command) { - // Read the first 150 bytes from the file - const size = 150; - const buffer = Buffer.alloc(size); - - let fd; - - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, size, 0); - fs.closeSync(fd); - } catch (e) { /* Empty */ } - - // Attempt to extract shebang (null is returned if not a shebang) - return shebangCommand(buffer.toString()); -} - -module.exports = readShebang; - - -/***/ }), -/* 191 */, -/* 192 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getISOWeeksInYear; - -var _index = _interopRequireDefault(__webpack_require__(165)); - -var _index2 = _interopRequireDefault(__webpack_require__(433)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var MILLISECONDS_IN_WEEK = 604800000; -/** - * @name getISOWeeksInYear - * @category ISO Week-Numbering Year Helpers - * @summary Get the number of weeks in an ISO week-numbering year of the given date. - * - * @description - * Get the number of weeks in an ISO week-numbering year of the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @returns {Number} the number of ISO weeks in a year - * @throws {TypeError} 1 argument required - * - * @example - * // How many weeks are in ISO week-numbering year 2015? - * const result = getISOWeeksInYear(new Date(2015, 1, 11)) - * //=> 53 - */ - -function getISOWeeksInYear(dirtyDate) { - (0, _index3.default)(1, arguments); - var thisYear = (0, _index.default)(dirtyDate); - var nextYear = (0, _index.default)((0, _index2.default)(thisYear, 60)); - var diff = nextYear.valueOf() - thisYear.valueOf(); // Round the number of weeks 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); -} - -module.exports = exports.default; - -/***/ }), -/* 193 */, -/* 194 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var conversions = __webpack_require__(626); -var route = __webpack_require__(512); - -var convert = {}; - -var models = Object.keys(conversions); - -function wrapRaw(fn) { - var wrappedFn = function (args) { - if (args === undefined || args === null) { - return args; - } - - if (arguments.length > 1) { - args = Array.prototype.slice.call(arguments); - } - - return fn(args); - }; - - // preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -function wrapRounded(fn) { - var wrappedFn = function (args) { - if (args === undefined || args === null) { - return args; - } - - if (arguments.length > 1) { - args = Array.prototype.slice.call(arguments); - } - - var result = fn(args); - - // we're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (var len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - - return result; - }; - - // preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -models.forEach(function (fromModel) { - convert[fromModel] = {}; - - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - - var routes = route(fromModel); - var routeModels = Object.keys(routes); - - routeModels.forEach(function (toModel) { - var fn = routes[toModel]; - - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); -}); - -module.exports = convert; - - -/***/ }), -/* 195 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getSeconds; + }, + // Year + 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 year = signedYear > 0 ? signedYear : 1 - signedYear; + return localize.ordinalNumber(year, { + unit: 'year' + }); + } + return _index7.default.y(date, token); + }, + // Local week-numbering year + Y: function Y(date, token, localize, options) { + var signedWeekYear = (0, _index5.default)(date, options); + // Returns 1 for 1 BC (which is year 0 in JavaScript) + var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; -var _index = _interopRequireDefault(__webpack_require__(773)); + // Two digit year + if (token === 'YY') { + var twoDigitYear = weekYear % 100; + return (0, _index6.default)(twoDigitYear, 2); + } -var _index2 = _interopRequireDefault(__webpack_require__(217)); + // Ordinal number + if (token === 'Yo') { + return localize.ordinalNumber(weekYear, { + unit: 'year' + }); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // Padding + return (0, _index6.default)(weekYear, token.length); + }, + // ISO week-numbering year + R: function R(date, token) { + var isoWeekYear = (0, _index3.default)(date); -/** - * @name getSeconds - * @category Second Helpers - * @summary Get the seconds of the given date. - * - * @description - * Get the seconds of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @returns {Number} the seconds - * @throws {TypeError} 1 argument required - * - * @example - * // Get the seconds of 29 February 2012 11:45:05.123: - * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123)) - * //=> 5 - */ -function getSeconds(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var seconds = date.getSeconds(); - return seconds; -} - -module.exports = exports.default; - -/***/ }), -/* 196 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = setMilliseconds; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(773)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name setMilliseconds - * @category Millisecond Helpers - * @summary Set the milliseconds to the given date. - * - * @description - * Set the milliseconds to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} milliseconds - the milliseconds of the new date - * @returns {Date} the new date with the milliseconds set - * @throws {TypeError} 2 arguments required - * - * @example - * // Set 300 milliseconds to 1 September 2014 11:30:40.500: - * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300) - * //=> Mon Sep 01 2014 11:30:40.300 - */ -function setMilliseconds(dirtyDate, dirtyMilliseconds) { - (0, _index3.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var milliseconds = (0, _index.default)(dirtyMilliseconds); - date.setMilliseconds(milliseconds); - return date; -} - -module.exports = exports.default; - -/***/ }), -/* 197 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = isexe -isexe.sync = sync - -var fs = __webpack_require__(826) - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), options) -} - -function checkStat (stat, options) { - return stat.isFile() && checkMode(stat, options) -} - -function checkMode (stat, options) { - var mod = stat.mode - var uid = stat.uid - var gid = stat.gid - - var myUid = options.uid !== undefined ? - options.uid : process.getuid && process.getuid() - var myGid = options.gid !== undefined ? - options.gid : process.getgid && process.getgid() - - var u = parseInt('100', 8) - var g = parseInt('010', 8) - var o = parseInt('001', 8) - var ug = u | g - - var ret = (mod & o) || - (mod & g) && gid === myGid || - (mod & u) && uid === myUid || - (mod & ug) && myUid === 0 - - return ret -} - - -/***/ }), -/* 198 */ -/***/ (function(module) { - -"use strict"; - - -// See http://www.robvanderwoude.com/escapechars.php -const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; - -function escapeCommand(arg) { - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - return arg; -} - -function escapeArgument(arg, doubleEscapeMetaChars) { - // Convert to string - arg = `${arg}`; - - // Algorithm below is based on https://qntm.org/cmd - - // Sequence of backslashes followed by a double quote: - // double up all the backslashes and escape the double quote - arg = arg.replace(/(\\*)"/g, '$1$1\\"'); - - // Sequence of backslashes followed by the end of the string - // (which will become a double quote later): - // double up all the backslashes - arg = arg.replace(/(\\*)$/, '$1$1'); - - // All other backslashes occur literally - - // Quote the whole thing: - arg = `"${arg}"`; - - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - // Double escape meta chars if necessary - if (doubleEscapeMetaChars) { - arg = arg.replace(metaCharsRegExp, '^$1'); + // Padding + return (0, _index6.default)(isoWeekYear, token.length); + }, + // Extended year. This is a single number designating the year of this calendar system. + // The main difference between `y` and `u` localizers are B.C. years: + // | Year | `y` | `u` | + // |------|-----|-----| + // | AC 1 | 1 | 1 | + // | BC 1 | 1 | 0 | + // | BC 2 | 2 | -1 | + // Also `yy` always returns the last two digits of a year, + // while `uu` pads single digit years to 2 characters and returns other years unchanged. + u: function u(date, token) { + var year = date.getUTCFullYear(); + return (0, _index6.default)(year, token.length); + }, + // Quarter + Q: function Q(date, token, localize) { + var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); + switch (token) { + // 1, 2, 3, 4 + case 'Q': + return String(quarter); + // 01, 02, 03, 04 + case 'QQ': + return (0, _index6.default)(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, { + width: 'wide', + context: 'formatting' + }); } - - return arg; -} - -module.exports.command = escapeCommand; -module.exports.argument = escapeArgument; - - -/***/ }), -/* 199 */, -/* 200 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = setSeconds; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(773)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name setSeconds - * @category Second Helpers - * @summary Set the seconds to the given date. - * - * @description - * Set the seconds to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} seconds - the seconds of the new date - * @returns {Date} the new date with the seconds set - * @throws {TypeError} 2 arguments required - * - * @example - * // Set 45 seconds to 1 September 2014 11:30:40: - * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45) - * //=> Mon Sep 01 2014 11:30:45 - */ -function setSeconds(dirtyDate, dirtySeconds) { - (0, _index3.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var seconds = (0, _index.default)(dirtySeconds); - date.setSeconds(seconds); - return date; -} - -module.exports = exports.default; - -/***/ }), -/* 201 */ -/***/ (function(module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function dateLongFormatter(pattern, formatLong) { - switch (pattern) { - case 'P': - return formatLong.date({ - width: 'short' - }); - - case 'PP': - return formatLong.date({ - width: 'medium' - }); - - case 'PPP': - return formatLong.date({ - width: 'long' - }); - - case 'PPPP': - default: - return formatLong.date({ - width: 'full' - }); - } -} - -function timeLongFormatter(pattern, formatLong) { - switch (pattern) { - case 'p': - return formatLong.time({ - width: 'short' - }); - - case 'pp': - return formatLong.time({ - width: 'medium' - }); - - case 'ppp': - return formatLong.time({ - width: 'long' - }); - - case 'pppp': - default: - return formatLong.time({ - width: 'full' - }); - } -} - -function dateTimeLongFormatter(pattern, formatLong) { - var matchResult = pattern.match(/(P+)(p+)?/); - var datePattern = matchResult[1]; - var timePattern = matchResult[2]; - - if (!timePattern) { - return dateLongFormatter(pattern, formatLong); - } - - var dateTimeFormat; - - switch (datePattern) { - case 'P': - dateTimeFormat = formatLong.dateTime({ - width: 'short' + }, + // Stand-alone quarter + q: function q(date, token, localize) { + var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); + switch (token) { + // 1, 2, 3, 4 + case 'q': + return String(quarter); + // 01, 02, 03, 04 + case 'qq': + return (0, _index6.default)(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, { + width: 'wide', + context: 'standalone' + }); + } + }, + // Month + M: function M(date, token, localize) { + var month = date.getUTCMonth(); + switch (token) { + case 'M': + case 'MM': + return _index7.default.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, { + width: 'wide', + context: 'formatting' + }); + } + }, + // Stand-alone month + L: function L(date, token, localize) { + var month = date.getUTCMonth(); + switch (token) { + // 1, 2, ..., 12 + case 'L': + return String(month + 1); + // 01, 02, ..., 12 + case 'LL': + return (0, _index6.default)(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, { + width: 'wide', + context: 'standalone' + }); + } + }, + // Local week of year + w: function w(date, token, localize, options) { + var week = (0, _index4.default)(date, options); + if (token === 'wo') { + return localize.ordinalNumber(week, { + unit: 'week' }); - break; - - case 'PP': - dateTimeFormat = formatLong.dateTime({ - width: 'medium' + } + return (0, _index6.default)(week, token.length); + }, + // ISO week of year + I: function I(date, token, localize) { + var isoWeek = (0, _index2.default)(date); + if (token === 'Io') { + return localize.ordinalNumber(isoWeek, { + unit: 'week' }); - break; - - case 'PPP': - dateTimeFormat = formatLong.dateTime({ - width: 'long' + } + return (0, _index6.default)(isoWeek, token.length); + }, + // Day of the month + d: function d(date, token, localize) { + if (token === 'do') { + return localize.ordinalNumber(date.getUTCDate(), { + unit: 'date' }); - break; - - case 'PPPP': - default: - dateTimeFormat = formatLong.dateTime({ - width: 'full' + } + return _index7.default.d(date, token); + }, + // Day of year + D: function D(date, token, localize) { + var dayOfYear = (0, _index.default)(date); + if (token === 'Do') { + return localize.ordinalNumber(dayOfYear, { + unit: 'dayOfYear' }); - break; - } - - return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong)); -} - -var longFormatters = { - p: timeLongFormatter, - P: dateTimeLongFormatter -}; -var _default = longFormatters; -exports.default = _default; -module.exports = exports.default; - -/***/ }), -/* 202 */, -/* 203 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getViolations = exports.getTotals = void 0; -const constants_1 = __webpack_require__(286); -const isExcused = (dependency, overrides) => Object.entries(overrides).some(([pattern, { defer }]) => RegExp(pattern).test(dependency) && Date.now() < Date.parse(defer)); -const isBreach = (value, limit, dependency, overrides) => limit != null && value > limit && !isExcused(dependency, overrides !== null && overrides !== void 0 ? overrides : {}); -const getMatchingPattern = (dependency, overrides) => Object.keys(overrides).find((pattern) => RegExp(pattern).test(dependency)); -const getTotals = (dependencies) => { - const totals = new Map(); - dependencies.forEach((dependency) => { - constants_1.metrics.forEach((metric) => { - if (!isNaN(dependency[metric])) { - const acc = totals.has(metric) ? totals.get(metric) : 0; - const cur = dependency[metric]; - totals.set(metric, acc + cur); - } - }); - }); - return totals; -}; -exports.getTotals = getTotals; -const getCollectiveViolations = (totals, threshold) => { - const violations = new Map(); - constants_1.metrics.forEach((metric) => { - const value = totals.get(metric); - const limit = threshold === null || threshold === void 0 ? void 0 : threshold[`${metric}Collective`]; - if (isBreach(value, limit)) { - violations.set(metric, value); - } - }); - return violations; -}; -const getIndividualViolations = (dependencies, threshold, overrides) => { - const violations = new Map(); - dependencies.forEach(({ dependency, ...rest }) => { - constants_1.metrics.forEach((metric) => { - var _a, _b; - const value = rest[metric]; - const limit = (_b = (_a = overrides === null || overrides === void 0 ? void 0 : overrides[getMatchingPattern(dependency, overrides)]) === null || _a === void 0 ? void 0 : _a[metric]) !== null && _b !== void 0 ? _b : threshold === null || threshold === void 0 ? void 0 : threshold[`${metric}Individual`]; - if (isBreach(value, limit, dependency, overrides)) { - if (!violations.has(metric)) { - violations.set(metric, new Map()); - } - violations.get(metric).set(dependency, { threshold: limit, value }); - } + } + return (0, _index6.default)(dayOfYear, token.length); + }, + // Day of week + E: function E(date, token, localize) { + var dayOfWeek = date.getUTCDay(); + switch (token) { + // Tue + case 'E': + case 'EE': + case 'EEE': + return localize.day(dayOfWeek, { + width: 'abbreviated', + context: 'formatting' }); - }); - return violations; -}; -const getViolations = (dependencies, totals, threshold, overrides) => ({ - collective: getCollectiveViolations(totals, threshold), - individual: getIndividualViolations(dependencies, threshold, overrides), -}); -exports.getViolations = getViolations; + // 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, { + width: 'wide', + context: 'formatting' + }); + } + }, + // Local day of week + e: function e(date, token, localize, options) { + var dayOfWeek = date.getUTCDay(); + var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; + switch (token) { + // Numerical value (Nth day of week with current locale or weekStartsOn) + case 'e': + return String(localDayOfWeek); + // Padded numerical value + case 'ee': + return (0, _index6.default)(localDayOfWeek, 2); + // 1st, 2nd, ..., 7th + case 'eo': + return localize.ordinalNumber(localDayOfWeek, { + unit: 'day' + }); + case 'eee': + return localize.day(dayOfWeek, { + width: 'abbreviated', + 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, { + width: 'wide', + context: 'formatting' + }); + } + }, + // Stand-alone local day of week + c: function c(date, token, localize, options) { + var dayOfWeek = date.getUTCDay(); + var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; + switch (token) { + // Numerical value (same as in `e`) + case 'c': + return String(localDayOfWeek); + // Padded numerical value + case 'cc': + return (0, _index6.default)(localDayOfWeek, token.length); + // 1st, 2nd, ..., 7th + case 'co': + return localize.ordinalNumber(localDayOfWeek, { + unit: 'day' + }); + case 'ccc': + return localize.day(dayOfWeek, { + width: 'abbreviated', + 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, { + width: 'wide', + context: 'standalone' + }); + } + }, + // ISO day of week + i: function i(date, token, localize) { + var dayOfWeek = date.getUTCDay(); + var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; + switch (token) { + // 2 + case 'i': + return String(isoDayOfWeek); + // 02 + case 'ii': + return (0, _index6.default)(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, { + width: 'wide', + context: 'formatting' + }); + } + }, + // AM or PM + a: function a(date, token, localize) { + var hours = date.getUTCHours(); + var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'; + switch (token) { + case 'a': + case 'aa': + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'abbreviated', + context: 'formatting' + }); + case 'aaa': + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'abbreviated', + context: 'formatting' + }).toLowerCase(); + case 'aaaaa': + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'narrow', + context: 'formatting' + }); + case 'aaaa': + default: + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'wide', + context: 'formatting' + }); + } + }, + // AM, PM, midnight, noon + b: function b(date, token, localize) { + var hours = date.getUTCHours(); + var dayPeriodEnumValue; + if (hours === 12) { + dayPeriodEnumValue = dayPeriodEnum.noon; + } else if (hours === 0) { + dayPeriodEnumValue = dayPeriodEnum.midnight; + } else { + dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'; + } + switch (token) { + case 'b': + case 'bb': + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'abbreviated', + context: 'formatting' + }); + case 'bbb': + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'abbreviated', + context: 'formatting' + }).toLowerCase(); + case 'bbbbb': + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'narrow', + context: 'formatting' + }); + case 'bbbb': + default: + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'wide', + context: 'formatting' + }); + } + }, + // in the morning, in the afternoon, in the evening, at night + B: function B(date, token, localize) { + var hours = date.getUTCHours(); + var dayPeriodEnumValue; + if (hours >= 17) { + dayPeriodEnumValue = dayPeriodEnum.evening; + } else if (hours >= 12) { + dayPeriodEnumValue = dayPeriodEnum.afternoon; + } else if (hours >= 4) { + dayPeriodEnumValue = dayPeriodEnum.morning; + } else { + dayPeriodEnumValue = dayPeriodEnum.night; + } + switch (token) { + case 'B': + case 'BB': + case 'BBB': + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'abbreviated', + context: 'formatting' + }); + case 'BBBBB': + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'narrow', + context: 'formatting' + }); + case 'BBBB': + default: + return localize.dayPeriod(dayPeriodEnumValue, { + width: 'wide', + context: 'formatting' + }); + } + }, + // Hour [1-12] + h: function h(date, token, localize) { + if (token === 'ho') { + var hours = date.getUTCHours() % 12; + if (hours === 0) hours = 12; + return localize.ordinalNumber(hours, { + unit: 'hour' + }); + } + return _index7.default.h(date, token); + }, + // Hour [0-23] + H: function H(date, token, localize) { + if (token === 'Ho') { + return localize.ordinalNumber(date.getUTCHours(), { + unit: 'hour' + }); + } + return _index7.default.H(date, token); + }, + // Hour [0-11] + K: function K(date, token, localize) { + var hours = date.getUTCHours() % 12; + if (token === 'Ko') { + return localize.ordinalNumber(hours, { + unit: 'hour' + }); + } + return (0, _index6.default)(hours, token.length); + }, + // Hour [1-24] + k: function k(date, token, localize) { + var hours = date.getUTCHours(); + if (hours === 0) hours = 24; + if (token === 'ko') { + return localize.ordinalNumber(hours, { + unit: 'hour' + }); + } + return (0, _index6.default)(hours, token.length); + }, + // Minute + m: function m(date, token, localize) { + if (token === 'mo') { + return localize.ordinalNumber(date.getUTCMinutes(), { + unit: 'minute' + }); + } + return _index7.default.m(date, token); + }, + // Second + s: function s(date, token, localize) { + if (token === 'so') { + return localize.ordinalNumber(date.getUTCSeconds(), { + unit: 'second' + }); + } + return _index7.default.s(date, token); + }, + // Fraction of second + S: function S(date, token) { + return _index7.default.S(date, token); + }, + // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) + X: function X(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timezoneOffset = originalDate.getTimezoneOffset(); + if (timezoneOffset === 0) { + return 'Z'; + } + switch (token) { + // 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, ':'); + } + }, + // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) + x: function x(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timezoneOffset = originalDate.getTimezoneOffset(); + switch (token) { + // 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, ':'); + } + }, + // Timezone (GMT) + O: function O(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timezoneOffset = originalDate.getTimezoneOffset(); + switch (token) { + // Short + case 'O': + case 'OO': + case 'OOO': + return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); + // Long + case 'OOOO': + default: + return 'GMT' + formatTimezone(timezoneOffset, ':'); + } + }, + // Timezone (specific non-location) + z: function z(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timezoneOffset = originalDate.getTimezoneOffset(); + switch (token) { + // Short + case 'z': + case 'zz': + case 'zzz': + return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); + // Long + case 'zzzz': + default: + return 'GMT' + formatTimezone(timezoneOffset, ':'); + } + }, + // Seconds timestamp + t: function t(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timestamp = Math.floor(originalDate.getTime() / 1000); + return (0, _index6.default)(timestamp, token.length); + }, + // Milliseconds timestamp + T: function T(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timestamp = originalDate.getTime(); + return (0, _index6.default)(timestamp, token.length); + } +}; +function formatTimezoneShort(offset, dirtyDelimiter) { + var sign = offset > 0 ? '-' : '+'; + var absOffset = Math.abs(offset); + var hours = Math.floor(absOffset / 60); + var minutes = absOffset % 60; + if (minutes === 0) { + return sign + String(hours); + } + var delimiter = dirtyDelimiter || ''; + return sign + String(hours) + delimiter + (0, _index6.default)(minutes, 2); +} +function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) { + if (offset % 60 === 0) { + var sign = offset > 0 ? '-' : '+'; + return sign + (0, _index6.default)(Math.abs(offset) / 60, 2); + } + return formatTimezone(offset, dirtyDelimiter); +} +function formatTimezone(offset, dirtyDelimiter) { + var delimiter = dirtyDelimiter || ''; + var sign = offset > 0 ? '-' : '+'; + var absOffset = Math.abs(offset); + var hours = (0, _index6.default)(Math.floor(absOffset / 60), 2); + var minutes = (0, _index6.default)(absOffset % 60, 2); + return sign + hours + delimiter + minutes; +} +var _default = formatters; +exports["default"] = _default; +module.exports = exports.default; /***/ }), -/* 204 */, -/* 205 */, -/* 206 */, -/* 207 */ -/***/ (function(module, exports) { + +/***/ 289: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = endOfYesterday; - -/** - * @name endOfYesterday - * @category Day Helpers - * @summary Return the end of yesterday. - * @pure false - * - * @description - * Return the end of yesterday. - * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `new Date()` internally hence impure and can't be safely curried. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @returns {Date} the end of yesterday +})); +exports["default"] = void 0; +var _index = _interopRequireDefault(__nccwpck_require__(8794)); +/* + * | | Unit | | Unit | + * |-----|--------------------------------|-----|--------------------------------| + * | a | AM, PM | A* | | + * | d | Day of month | D | | + * | h | Hour [1-12] | H | Hour [0-23] | + * | m | Minute | M | Month | + * | s | Second | S | Fraction of second | + * | y | Year (abs) | Y | | * - * @example - * // If today is 6 October 2014: - * const result = endOfYesterday() - * //=> Sun Oct 5 2014 23:59:59.999 + * Letters marked by * are not implemented but reserved by Unicode standard. */ -function endOfYesterday() { - var now = new Date(); - var year = now.getFullYear(); - var month = now.getMonth(); - var day = now.getDate(); - var date = new Date(0); - date.setFullYear(year, month, day - 1); - date.setHours(23, 59, 59, 999); - return date; -} +var formatters = { + // Year + y: function y(date, token) { + // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens + // | 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 signedYear = date.getUTCFullYear(); + // Returns 1 for 1 BC (which is year 0 in JavaScript) + var year = signedYear > 0 ? signedYear : 1 - signedYear; + return (0, _index.default)(token === 'yy' ? year % 100 : year, token.length); + }, + // Month + M: function M(date, token) { + var month = date.getUTCMonth(); + return token === 'M' ? String(month + 1) : (0, _index.default)(month + 1, 2); + }, + // Day of the month + d: function d(date, token) { + return (0, _index.default)(date.getUTCDate(), token.length); + }, + // AM or PM + a: function a(date, token) { + var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am'; + switch (token) { + case 'a': + case 'aa': + return dayPeriodEnumValue.toUpperCase(); + case 'aaa': + return dayPeriodEnumValue; + case 'aaaaa': + return dayPeriodEnumValue[0]; + case 'aaaa': + default: + return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.'; + } + }, + // Hour [1-12] + h: function h(date, token) { + return (0, _index.default)(date.getUTCHours() % 12 || 12, token.length); + }, + // Hour [0-23] + H: function H(date, token) { + return (0, _index.default)(date.getUTCHours(), token.length); + }, + // Minute + m: function m(date, token) { + return (0, _index.default)(date.getUTCMinutes(), token.length); + }, + // Second + s: function s(date, token) { + return (0, _index.default)(date.getUTCSeconds(), token.length); + }, + // Fraction of second + S: function S(date, token) { + var numberOfDigits = token.length; + var milliseconds = date.getUTCMilliseconds(); + var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3)); + return (0, _index.default)(fractionalSeconds, token.length); + } +}; +var _default = formatters; +exports["default"] = _default; module.exports = exports.default; /***/ }), -/* 208 */ -/***/ (function(__unusedmodule, exports) { + +/***/ 8387: +/***/ ((module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.getPropertyByPath = getPropertyByPath; - -// Resolves property names or property paths defined with period-delimited -// strings or arrays of strings. Property names that are found on the source -// object are used directly (even if they include a period). -// Nested property names that include periods, within a path, are only -// understood in array paths. -function getPropertyByPath(source, path) { - if (typeof path === 'string' && Object.prototype.hasOwnProperty.call(source, path)) { - return source[path]; +})); +exports["default"] = void 0; +var dateLongFormatter = function dateLongFormatter(pattern, formatLong) { + switch (pattern) { + case 'P': + return formatLong.date({ + width: 'short' + }); + case 'PP': + return formatLong.date({ + width: 'medium' + }); + case 'PPP': + return formatLong.date({ + width: 'long' + }); + case 'PPPP': + default: + return formatLong.date({ + width: 'full' + }); } - - const parsedPath = typeof path === 'string' ? path.split('.') : path; // eslint-disable-next-line @typescript-eslint/no-explicit-any - - return parsedPath.reduce((previous, key) => { - if (previous === undefined) { - return previous; - } - - return previous[key]; - }, source); -} -//# sourceMappingURL=getPropertyByPath.js.map +}; +var timeLongFormatter = function timeLongFormatter(pattern, formatLong) { + switch (pattern) { + case 'p': + return formatLong.time({ + width: 'short' + }); + case 'pp': + return formatLong.time({ + width: 'medium' + }); + case 'ppp': + return formatLong.time({ + width: 'long' + }); + case 'pppp': + default: + return formatLong.time({ + width: 'full' + }); + } +}; +var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) { + var matchResult = pattern.match(/(P+)(p+)?/) || []; + var datePattern = matchResult[1]; + var timePattern = matchResult[2]; + if (!timePattern) { + return dateLongFormatter(pattern, formatLong); + } + var dateTimeFormat; + switch (datePattern) { + case 'P': + dateTimeFormat = formatLong.dateTime({ + width: 'short' + }); + break; + case 'PP': + dateTimeFormat = formatLong.dateTime({ + width: 'medium' + }); + break; + case 'PPP': + dateTimeFormat = formatLong.dateTime({ + width: 'long' + }); + break; + case 'PPPP': + default: + dateTimeFormat = formatLong.dateTime({ + width: 'full' + }); + break; + } + return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong)); +}; +var longFormatters = { + p: timeLongFormatter, + P: dateTimeLongFormatter +}; +var _default = longFormatters; +exports["default"] = _default; +module.exports = exports.default; /***/ }), -/* 209 */, -/* 210 */, -/* 211 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - - -const path = __webpack_require__(492); -const resolveCommand = __webpack_require__(669); -const escape = __webpack_require__(198); -const readShebang = __webpack_require__(190); - -const isWin = process.platform === 'win32'; -const isExecutableRegExp = /\.(?:com|exe)$/i; -const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; - -function detectShebang(parsed) { - parsed.file = resolveCommand(parsed); - - const shebang = parsed.file && readShebang(parsed.file); - - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; - - return resolveCommand(parsed); - } - - return parsed.file; -} - -function parseNonShell(parsed) { - if (!isWin) { - return parsed; - } - - // Detect & add support for shebangs - const commandFile = detectShebang(parsed); - - // We don't need a shell if the command filename is an executable - const needsShell = !isExecutableRegExp.test(commandFile); - - // If a shell is required, use cmd.exe and take care of escaping everything correctly - // Note that `forceShell` is an hidden option used only in tests - if (parsed.options.forceShell || needsShell) { - // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` - // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument - // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, - // we need to double escape them - const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - - // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) - // This is necessary otherwise it will always fail with ENOENT in those cases - parsed.command = path.normalize(parsed.command); - - // Escape command & arguments - parsed.command = escape.command(parsed.command); - parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); - - const shellCommand = [parsed.command].concat(parsed.args).join(' '); - - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.command = process.env.comspec || 'cmd.exe'; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } - - return parsed; -} - -function parse(command, args, options) { - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } - - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = Object.assign({}, options); // Clone object to avoid changing the original - - // Build our parsed object - const parsed = { - command, - args, - options, - file: undefined, - original: { - command, - args, - }, - }; - - // Delegate further parsing to shell or non-shell - return options.shell ? parsed : parseNonShell(parsed); -} - -module.exports = parse; - -/***/ }), -/* 212 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 7032: +/***/ ((module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getOverlappingDaysInIntervals; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000; +})); +exports["default"] = getTimezoneOffsetInMilliseconds; /** - * @name getOverlappingDaysInIntervals - * @category Interval Helpers - * @summary Get the number of days that overlap in two time intervals - * - * @description - * Get the number of days that overlap in two time intervals - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * - The function was renamed from `getOverlappingDaysInRanges` to `getOverlappingDaysInIntervals`. - * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology: - * - * ``` - * 2.1.3 - * time interval - * part of the time axis limited by two instants - * ``` - * - * Also, this function now accepts an object with `start` and `end` properties - * instead of two arguments as an interval. - * This function now throws `RangeError` if the start of the interval is after its end - * or if any date in the interval is `Invalid Date`. - * - * ```javascript - * // Before v2.0.0 - * - * getOverlappingDaysInRanges( - * new Date(2014, 0, 10), new Date(2014, 0, 20), - * new Date(2014, 0, 17), new Date(2014, 0, 21) - * ) - * - * // v2.0.0 onward - * - * getOverlappingDaysInIntervals( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } - * ) - * ``` - * - * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/Interval} - * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/Interval} - * @returns {Number} the number of days that overlap in two time intervals - * @throws {TypeError} 2 arguments required - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` + * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. + * They usually appear for dates that denote time before the timezones were introduced + * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 + * and GMT+01:00:00 after that date) * - * @example - * // For overlapping time intervals adds 1 for each started overlapping day: - * getOverlappingDaysInIntervals( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } - * ) - * //=> 3 + * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above, + * which would lead to incorrect calculations. * - * @example - * // For non-overlapping time intervals returns 0: - * getOverlappingDaysInIntervals( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } - * ) - * //=> 0 + * This function returns the timezone offset in milliseconds that takes seconds in account. */ - -function getOverlappingDaysInIntervals(dirtyIntervalLeft, dirtyIntervalRight) { - (0, _index2.default)(2, arguments); - var intervalLeft = dirtyIntervalLeft || {}; - var intervalRight = dirtyIntervalRight || {}; - var leftStartTime = (0, _index.default)(intervalLeft.start).getTime(); - var leftEndTime = (0, _index.default)(intervalLeft.end).getTime(); - var rightStartTime = (0, _index.default)(intervalRight.start).getTime(); - var rightEndTime = (0, _index.default)(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` - - if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) { - throw new RangeError('Invalid interval'); - } - - var isOverlapping = leftStartTime < rightEndTime && rightStartTime < leftEndTime; - - if (!isOverlapping) { - return 0; - } - - var overlapStartDate = rightStartTime < leftStartTime ? leftStartTime : rightStartTime; - var overlapEndDate = rightEndTime > leftEndTime ? leftEndTime : rightEndTime; - var differenceInMs = overlapEndDate - overlapStartDate; - return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY); +function getTimezoneOffsetInMilliseconds(date) { + var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())); + utcDate.setUTCFullYear(date.getFullYear()); + return date.getTime() - utcDate.getTime(); } - module.exports = exports.default; /***/ }), -/* 213 */, -/* 214 */, -/* 215 */, -/* 216 */, -/* 217 */ -/***/ (function(module, exports) { + +/***/ 2966: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = requiredArgs; - -function requiredArgs(required, args) { - if (args.length < required) { - throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present'); - } +})); +exports["default"] = getUTCDayOfYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_DAY = 86400000; +function getUTCDayOfYear(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var timestamp = date.getTime(); + date.setUTCMonth(0, 1); + date.setUTCHours(0, 0, 0, 0); + var startOfYearTimestamp = date.getTime(); + var difference = timestamp - startOfYearTimestamp; + return Math.floor(difference / MILLISECONDS_IN_DAY) + 1; } - module.exports = exports.default; /***/ }), -/* 218 */, -/* 219 */, -/* 220 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8493: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = closestIndexTo; - -var _index = _interopRequireDefault(__webpack_require__(773)); +})); +exports["default"] = getUTCISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(3061)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1478)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_WEEK = 604800000; +function getUTCISOWeek(dirtyDate) { + (0, _index4.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(date).getTime(); -var _index2 = _interopRequireDefault(__webpack_require__(217)); + // 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; +} +module.exports = exports.default; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), -/** - * @name closestIndexTo - * @category Common Helpers - * @summary Return an index of the closest date from the array comparing to the given date. - * - * @description - * Return an index of the closest date from the array comparing to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * - Now, `closestIndexTo` doesn't throw an exception - * when the second argument is not an array, and returns Invalid Date instead. - * - * @param {Date|Number} dateToCompare - the date to compare with - * @param {Date[]|Number[]} datesArray - the array to search - * @returns {Number} an index of the date closest to the given date - * @throws {TypeError} 2 arguments required - * - * @example - * // Which date is closer to 6 September 2015? - * var dateToCompare = new Date(2015, 8, 6) - * var datesArray = [ - * new Date(2015, 0, 1), - * new Date(2016, 0, 1), - * new Date(2017, 0, 1) - * ] - * var result = closestIndexTo(dateToCompare, datesArray) - * //=> 1 - */ -function closestIndexTo(dirtyDateToCompare, dirtyDatesArray) { - (0, _index2.default)(2, arguments); - var dateToCompare = (0, _index.default)(dirtyDateToCompare); +/***/ 7170: +/***/ ((module, exports, __nccwpck_require__) => { - if (isNaN(dateToCompare)) { - return NaN; - } +"use strict"; - var timeToCompare = dateToCompare.getTime(); - var datesArray; // `dirtyDatesArray` is undefined or null - if (dirtyDatesArray == null) { - datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method - } else if (typeof dirtyDatesArray.forEach === 'function') { - datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getUTCISOWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(3061)); +function getUTCISOWeekYear(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getUTCFullYear(); + var fourthOfJanuaryOfNextYear = new Date(0); + fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); + var startOfNextYear = (0, _index3.default)(fourthOfJanuaryOfNextYear); + var fourthOfJanuaryOfThisYear = new Date(0); + fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); + fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); + var startOfThisYear = (0, _index3.default)(fourthOfJanuaryOfThisYear); + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1; + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year; } else { - datesArray = Array.prototype.slice.call(dirtyDatesArray); + return year - 1; } - - var result; - var minDistance; - datesArray.forEach(function (dirtyDate, index) { - var currentDate = (0, _index.default)(dirtyDate); - - if (isNaN(currentDate)) { - result = NaN; - minDistance = NaN; - return; - } - - var distance = Math.abs(timeToCompare - currentDate.getTime()); - - if (result == null || distance < minDistance) { - result = index; - minDistance = distance; - } - }); - return result; } - module.exports = exports.default; /***/ }), -/* 221 */, -/* 222 */, -/* 223 */, -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8761: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = formatDistanceToNowStrict; - -var _index = _interopRequireDefault(__webpack_require__(379)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +})); +exports["default"] = getUTCWeek; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2258)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2629)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_WEEK = 604800000; +function getUTCWeek(dirtyDate, options) { + (0, _index4.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var diff = (0, _index2.default)(date, options).getTime() - (0, _index3.default)(date, options).getTime(); -/** - * @name formatDistanceToNowStrict - * @category Common Helpers - * @summary Return the distance between the given date and now in words. - * @pure false - * - * @description - * Return the distance between the given dates in words, using strict units. - * This is like `formatDistance`, but does not use helpers like 'almost', 'over', - * 'less than' and the like. - * - * | Distance between dates | Result | - * |------------------------|---------------------| - * | 0 ... 59 secs | [0..59] seconds | - * | 1 ... 59 mins | [1..59] minutes | - * | 1 ... 23 hrs | [1..23] hours | - * | 1 ... 29 days | [1..29] days | - * | 1 ... 11 months | [1..11] months | - * | 1 ... N years | [1..N] years | - * - * @param {Date|Number} date - the given date - * @param {Object} [options] - an object with options. - * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first - * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit - * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @returns {String} the distance in words - * @throws {TypeError} 1 argument required - * @throws {RangeError} `date` must not be Invalid Date - * @throws {RangeError} `options.locale` must contain `formatDistance` property - * - * @example - * // If today is 1 January 2015, what is the distance to 2 July 2014? - * var result = formatDistanceToNowStrict( - * new Date(2014, 6, 2) - * ) - * //=> '6 months' - * - * @example - * // If now is 1 January 2015 00:00:00, - * // what is the distance to 1 January 2015 00:00:15, including seconds? - * var result = formatDistanceToNowStrict( - * new Date(2015, 0, 1, 0, 0, 15) - * ) - * //=> '20 seconds' - * - * @example - * // If today is 1 January 2015, - * // what is the distance to 1 January 2016, with a suffix? - * var result = formatDistanceToNowStrict( - * new Date(2016, 0, 1), - * {addSuffix: true} - * ) - * //=> 'in 1 year' - * - * @example - * // If today is 28 January 2015, - * // what is the distance to 1 January 2015, in months, rounded up?? - * var result = formatDistanceToNowStrict(new Date(2015, 0, 1), { - * unit: 'month', - * roundingMethod: 'ceil' - * }) - * //=> '1 month' - * - * @example - * // If today is 1 January 2015, - * // what is the distance to 1 August 2016 in Esperanto? - * var eoLocale = require('date-fns/locale/eo') - * var result = formatDistanceToNowStrict( - * new Date(2016, 7, 1), - * {locale: eoLocale} - * ) - * //=> '1 jaro' - */ -function formatDistanceToNowStrict(dirtyDate, dirtyOptions) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate, Date.now(), dirtyOptions); + // 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; } - module.exports = exports.default; /***/ }), -/* 225 */, -/* 226 */, -/* 227 */, -/* 228 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const parse = __webpack_require__(842) -const prerelease = (version, options) => { - const parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -module.exports = prerelease - -/***/ }), -/* 229 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 8050: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getUTCWeekYear; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(773)); - -var _index3 = _interopRequireDefault(__webpack_require__(35)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function getUTCWeekYear(dirtyDate, dirtyOptions) { - (0, _index4.default)(1, arguments); - var date = (0, _index2.default)(dirtyDate, dirtyOptions); +})); +exports["default"] = getUTCWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2258)); +var _index4 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index5 = __nccwpck_require__(9307); +function getUTCWeekYear(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); var year = date.getUTCFullYear(); - var options = dirtyOptions || {}; - var locale = options.locale; - var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; - var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0, _index.default)(localeFirstWeekContainsDate); - var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0, _index.default)(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN + var defaultOptions = (0, _index5.getDefaultOptions)(); + var firstWeekContainsDate = (0, _index4.default)((_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'); } - var firstWeekOfNextYear = new Date(0); firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate); firstWeekOfNextYear.setUTCHours(0, 0, 0, 0); - var startOfNextYear = (0, _index3.default)(firstWeekOfNextYear, dirtyOptions); + var startOfNextYear = (0, _index3.default)(firstWeekOfNextYear, options); var firstWeekOfThisYear = new Date(0); firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate); firstWeekOfThisYear.setUTCHours(0, 0, 0, 0); - var startOfThisYear = (0, _index3.default)(firstWeekOfThisYear, dirtyOptions); - + var startOfThisYear = (0, _index3.default)(firstWeekOfThisYear, options); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { @@ -7343,14847 +5850,17885 @@ function getUTCWeekYear(dirtyDate, dirtyOptions) { return year - 1; } } - module.exports = exports.default; /***/ }), -/* 230 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2509: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = setUTCISOWeek; - -var _index = _interopRequireDefault(__webpack_require__(841)); +})); +exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken; +exports.isProtectedWeekYearToken = isProtectedWeekYearToken; +exports.throwProtectedError = throwProtectedError; +var protectedDayOfYearTokens = ['D', 'DD']; +var protectedWeekYearTokens = ['YY', 'YYYY']; +function isProtectedDayOfYearToken(token) { + return protectedDayOfYearTokens.indexOf(token) !== -1; +} +function isProtectedWeekYearToken(token) { + return protectedWeekYearTokens.indexOf(token) !== -1; +} +function throwProtectedError(token, format, input) { + if (token === 'YYYY') { + throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); + } else if (token === 'YY') { + throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); + } else if (token === 'D') { + throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); + } else if (token === 'DD') { + throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); + } +} -var _index2 = _interopRequireDefault(__webpack_require__(773)); +/***/ }), -var _index3 = _interopRequireDefault(__webpack_require__(176)); +/***/ 2063: +/***/ ((module, exports) => { -var _index4 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function setUTCISOWeek(dirtyDate, dirtyISOWeek) { - (0, _index4.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var isoWeek = (0, _index.default)(dirtyISOWeek); - var diff = (0, _index3.default)(date) - isoWeek; - date.setUTCDate(date.getUTCDate() - diff * 7); - return date; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = requiredArgs; +function requiredArgs(required, args) { + if (args.length < required) { + throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present'); + } } - module.exports = exports.default; /***/ }), -/* 231 */, -/* 232 */, -/* 233 */, -/* 234 */, -/* 235 */ -/***/ (function(module) { + +/***/ 8016: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -const isWin = process.platform === 'win32'; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getRoundingMethod = getRoundingMethod; +var roundingMap = { + ceil: Math.ceil, + round: Math.round, + floor: Math.floor, + trunc: function trunc(value) { + return value < 0 ? Math.ceil(value) : Math.floor(value); + } // Math.trunc is not supported by IE +}; -function notFoundError(original, syscall) { - return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { - code: 'ENOENT', - errno: 'ENOENT', - syscall: `${syscall} ${original.command}`, - path: original.command, - spawnargs: original.args, - }); +var defaultRoundingMethod = 'trunc'; +function getRoundingMethod(method) { + return method ? roundingMap[method] : roundingMap[defaultRoundingMethod]; } -function hookChildProcess(cp, parsed) { - if (!isWin) { - return; - } +/***/ }), - const originalEmit = cp.emit; +/***/ 2694: +/***/ ((module, exports, __nccwpck_require__) => { - cp.emit = function (name, arg1) { - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === 'exit') { - const err = verifyENOENT(arg1, parsed, 'spawn'); +"use strict"; - if (err) { - return originalEmit.call(cp, 'error', err); - } - } - return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params - }; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setUTCDay; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index4 = __nccwpck_require__(9307); +function setUTCDay(dirtyDate, dirtyDay, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index2.default)(2, arguments); + var defaultOptions = (0, _index4.getDefaultOptions)(); + var weekStartsOn = (0, _index3.default)((_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'); + } + var date = (0, _index.default)(dirtyDate); + var day = (0, _index3.default)(dirtyDay); + var currentDay = date.getUTCDay(); + var remainder = day % 7; + var dayIndex = (remainder + 7) % 7; + var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; + date.setUTCDate(date.getUTCDate() + diff); + return date; } +module.exports = exports.default; -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); - } +/***/ }), - return null; +/***/ 7985: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setUTCISODay; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +function setUTCISODay(dirtyDate, dirtyDay) { + (0, _index2.default)(2, arguments); + var day = (0, _index3.default)(dirtyDay); + if (day % 7 === 0) { + day = day - 7; + } + var weekStartsOn = 1; + var date = (0, _index.default)(dirtyDate); + var currentDay = date.getUTCDay(); + var remainder = day % 7; + var dayIndex = (remainder + 7) % 7; + var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; + date.setUTCDate(date.getUTCDate() + diff); + return date; } +module.exports = exports.default; -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } +/***/ }), - return null; +/***/ 8921: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setUTCISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(8493)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +function setUTCISOWeek(dirtyDate, dirtyISOWeek) { + (0, _index4.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var isoWeek = (0, _index.default)(dirtyISOWeek); + var diff = (0, _index3.default)(date) - isoWeek; + date.setUTCDate(date.getUTCDate() - diff * 7); + return date; } +module.exports = exports.default; -module.exports = { - hookChildProcess, - verifyENOENT, - verifyENOENTSync, - notFoundError, -}; +/***/ }), + +/***/ 3285: +/***/ ((module, exports, __nccwpck_require__) => { +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setUTCWeek; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(8761)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +function setUTCWeek(dirtyDate, dirtyWeek, options) { + (0, _index4.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var week = (0, _index.default)(dirtyWeek); + var diff = (0, _index3.default)(date, options) - week; + date.setUTCDate(date.getUTCDate() - diff * 7); + return date; +} +module.exports = exports.default; /***/ }), -/* 236 */, -/* 237 */, -/* 238 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3061: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = endOfSecond; +})); +exports["default"] = startOfUTCISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +function startOfUTCISOWeek(dirtyDate) { + (0, _index2.default)(1, arguments); + var weekStartsOn = 1; + var date = (0, _index.default)(dirtyDate); + var day = date.getUTCDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + date.setUTCDate(date.getUTCDate() - diff); + date.setUTCHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(773)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(217)); +/***/ 1478: +/***/ ((module, exports, __nccwpck_require__) => { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; -/** - * @name endOfSecond - * @category Second Helpers - * @summary Return the end of a second for the given date. - * - * @description - * Return the end of a second for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the original date - * @returns {Date} the end of a second - * @throws {TypeError} 1 argument required - * - * @example - * // The end of a second for 1 December 2014 22:15:45.400: - * const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:45.999 - */ -function endOfSecond(dirtyDate) { + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfUTCISOWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(7170)); +var _index2 = _interopRequireDefault(__nccwpck_require__(3061)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +function startOfUTCISOWeekYear(dirtyDate) { + (0, _index3.default)(1, arguments); + var year = (0, _index.default)(dirtyDate); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setUTCFullYear(year, 0, 4); + fourthOfJanuary.setUTCHours(0, 0, 0, 0); + var date = (0, _index2.default)(fourthOfJanuary); + return date; +} +module.exports = exports.default; + +/***/ }), + +/***/ 2258: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfUTCWeek; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index4 = __nccwpck_require__(9307); +function startOfUTCWeek(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; (0, _index2.default)(1, arguments); + var defaultOptions = (0, _index4.getDefaultOptions)(); + var weekStartsOn = (0, _index3.default)((_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'); + } var date = (0, _index.default)(dirtyDate); - date.setMilliseconds(999); + var day = date.getUTCDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + date.setUTCDate(date.getUTCDate() - diff); + date.setUTCHours(0, 0, 0, 0); return date; } +module.exports = exports.default; + +/***/ }), + +/***/ 2629: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfUTCWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(8050)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2258)); +var _index4 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index5 = __nccwpck_require__(9307); +function startOfUTCWeekYear(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index2.default)(1, arguments); + var defaultOptions = (0, _index5.getDefaultOptions)(); + var firstWeekContainsDate = (0, _index4.default)((_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); + var year = (0, _index.default)(dirtyDate, options); + var firstWeek = new Date(0); + firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate); + firstWeek.setUTCHours(0, 0, 0, 0); + var date = (0, _index3.default)(firstWeek, options); + return date; +} module.exports = exports.default; /***/ }), -/* 239 */, -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1985: +/***/ ((module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isThursday; +})); +exports["default"] = toInteger; +function toInteger(dirtyNumber) { + if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) { + return NaN; + } + var number = Number(dirtyNumber); + if (isNaN(number)) { + return number; + } + return number < 0 ? Math.ceil(number) : Math.floor(number); +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(773)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(217)); +/***/ 6211: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = add; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _index = _interopRequireDefault(__nccwpck_require__(6227)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2995)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index5 = _interopRequireDefault(__nccwpck_require__(1985)); /** - * @name isThursday - * @category Weekday Helpers - * @summary Is the given date Thursday? + * @name add + * @category Common Helpers + * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date. * * @description - * Is the given date Thursday? + * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date. * - * ### v2.0.0 breaking changes: + * @param {Date|Number} date - the date to be changed + * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * | Key | Description | + * |----------------|------------------------------------| + * | years | Amount of years to be added | + * | months | Amount of months to be added | + * | weeks | Amount of weeks to be added | + * | days | Amount of days to be added | + * | hours | Amount of hours to be added | + * | minutes | Amount of minutes to be added | + * | seconds | Amount of seconds to be added | * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is Thursday - * @throws {TypeError} 1 argument required + * All values default to 0 + * + * @returns {Date} the new date with the seconds added + * @throws {TypeError} 2 arguments required * * @example - * // Is 25 September 2014 Thursday? - * var result = isThursday(new Date(2014, 8, 25)) - * //=> true + * // Add the following duration to 1 September 2014, 10:19:50 + * const result = add(new Date(2014, 8, 1, 10, 19, 50), { + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30, + * }) + * //=> Thu Jun 15 2017 15:29:20 */ -function isThursday(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate).getDay() === 4; -} +function add(dirtyDate, duration) { + (0, _index4.default)(2, arguments); + if (!duration || (0, _typeof2.default)(duration) !== 'object') return new Date(NaN); + var years = duration.years ? (0, _index5.default)(duration.years) : 0; + var months = duration.months ? (0, _index5.default)(duration.months) : 0; + var weeks = duration.weeks ? (0, _index5.default)(duration.weeks) : 0; + var days = duration.days ? (0, _index5.default)(duration.days) : 0; + var hours = duration.hours ? (0, _index5.default)(duration.hours) : 0; + var minutes = duration.minutes ? (0, _index5.default)(duration.minutes) : 0; + var seconds = duration.seconds ? (0, _index5.default)(duration.seconds) : 0; + + // Add years and months + var date = (0, _index3.default)(dirtyDate); + var dateWithMonths = months || years ? (0, _index2.default)(date, months + years * 12) : date; + // Add weeks and days + var dateWithDays = days || weeks ? (0, _index.default)(dateWithMonths, days + weeks * 7) : dateWithMonths; + + // Add days, hours, minutes and seconds + var minutesToAdd = minutes + hours * 60; + var secondsToAdd = seconds + minutesToAdd * 60; + var msToAdd = secondsToAdd * 1000; + var finalDate = new Date(dateWithDays.getTime() + msToAdd); + return finalDate; +} module.exports = exports.default; /***/ }), -/* 241 */, -/* 242 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1727: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isWithinInterval; +})); +exports["default"] = addBusinessDays; +var _index = _interopRequireDefault(__nccwpck_require__(403)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index5 = _interopRequireDefault(__nccwpck_require__(5852)); +var _index6 = _interopRequireDefault(__nccwpck_require__(6308)); +/** + * @name addBusinessDays + * @category Day Helpers + * @summary Add the specified number of business days (mon - fri) to the given date. + * + * @description + * Add the specified number of business days (mon - fri) to the given date, ignoring weekends. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of business days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the business days added + * @throws {TypeError} 2 arguments required + * + * @example + * // Add 10 business days to 1 September 2014: + * const result = addBusinessDays(new Date(2014, 8, 1), 10) + * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days) + */ +function addBusinessDays(dirtyDate, dirtyAmount) { + (0, _index4.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var startedOnWeekend = (0, _index.default)(date); + var amount = (0, _index3.default)(dirtyAmount); + if (isNaN(amount)) return new Date(NaN); + var hours = date.getHours(); + var sign = amount < 0 ? -1 : 1; + var fullWeeks = (0, _index3.default)(amount / 5); + date.setDate(date.getDate() + fullWeeks * 7); + + // Get remaining days not part of a full week + var restDays = Math.abs(amount % 5); + + // Loops over remaining days + while (restDays > 0) { + date.setDate(date.getDate() + sign); + if (!(0, _index.default)(date)) restDays -= 1; + } -var _index = _interopRequireDefault(__webpack_require__(773)); + // If the date is a weekend day and we reduce a dividable of + // 5 from it, we land on a weekend date. + // To counter this, we add days accordingly to land on the next business day + if (startedOnWeekend && (0, _index.default)(date) && amount !== 0) { + // If we're reducing days, we want to add days until we land on a weekday + // If we're adding days we want to reduce days until we land on a weekday + if ((0, _index6.default)(date)) date.setDate(date.getDate() + (sign < 0 ? 2 : -1)); + if ((0, _index5.default)(date)) date.setDate(date.getDate() + (sign < 0 ? 1 : -2)); + } -var _index2 = _interopRequireDefault(__webpack_require__(217)); + // Restore hours to avoid DST lag + date.setHours(hours); + return date; +} +module.exports = exports.default; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/***/ 6227: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = addDays; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isWithinInterval - * @category Interval Helpers - * @summary Is the given date within the interval? + * @name addDays + * @category Day Helpers + * @summary Add the specified number of days to the given date. * * @description - * Is the given date within the interval? (Including start and end.) - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Add the specified number of days to the given date. * - * - The function was renamed from `isWithinRange` to `isWithinInterval`. - * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology: + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} - the new date with the days added + * @throws {TypeError} - 2 arguments required * - * ``` - * 2.1.3 - * time interval - * part of the time axis limited by two instants - * ``` + * @example + * // Add 10 days to 1 September 2014: + * const result = addDays(new Date(2014, 8, 1), 10) + * //=> Thu Sep 11 2014 00:00:00 + */ +function addDays(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var amount = (0, _index.default)(dirtyAmount); + if (isNaN(amount)) { + return new Date(NaN); + } + if (!amount) { + // If 0 days, no-op to avoid changing times in the hour before end of DST + return date; + } + date.setDate(date.getDate() + amount); + return date; +} +module.exports = exports.default; + +/***/ }), + +/***/ 9956: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = addHours; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(524)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_HOUR = 3600000; + +/** + * @name addHours + * @category Hour Helpers + * @summary Add the specified number of hours to the given date. * - * Also, this function now accepts an object with `start` and `end` properties - * instead of two arguments as an interval. - * This function now throws `RangeError` if the start of the interval is after its end - * or if any date in the interval is `Invalid Date`. + * @description + * Add the specified number of hours to the given date. * - * ```javascript - * // Before v2.0.0 + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of hours to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the hours added + * @throws {TypeError} 2 arguments required * - * isWithinRange( - * new Date(2014, 0, 3), - * new Date(2014, 0, 1), new Date(2014, 0, 7) - * ) + * @example + * // Add 2 hours to 10 July 2014 23:00:00: + * const result = addHours(new Date(2014, 6, 10, 23, 0), 2) + * //=> Fri Jul 11 2014 01:00:00 + */ +function addHours(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, amount * MILLISECONDS_IN_HOUR); +} +module.exports = exports.default; + +/***/ }), + +/***/ 5318: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = addISOWeekYears; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6991)); +var _index3 = _interopRequireDefault(__nccwpck_require__(822)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name addISOWeekYears + * @category ISO Week-Numbering Year Helpers + * @summary Add the specified number of ISO week-numbering years to the given date. * - * // v2.0.0 onward + * @description + * Add the specified number of ISO week-numbering years to the given date. * - * isWithinInterval( - * new Date(2014, 0, 3), - * { start: new Date(2014, 0, 1), end: new Date(2014, 0, 7) } - * ) - * ``` + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @param {Date|Number} date - the date to check - * @param {Interval} interval - the interval to check - * @returns {Boolean} the date is within the interval + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of ISO week-numbering years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the ISO week-numbering years added * @throws {TypeError} 2 arguments required - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * // For the date within the interval: - * isWithinInterval(new Date(2014, 0, 3), { - * start: new Date(2014, 0, 1), - * end: new Date(2014, 0, 7) - * }) - * //=> true + * // Add 5 ISO week-numbering years to 2 July 2010: + * const result = addISOWeekYears(new Date(2010, 6, 2), 5) + * //=> Fri Jun 26 2015 00:00:00 + */ +function addISOWeekYears(dirtyDate, dirtyAmount) { + (0, _index4.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index3.default)(dirtyDate, (0, _index2.default)(dirtyDate) + amount); +} +module.exports = exports.default; + +/***/ }), + +/***/ 524: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = addMilliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name addMilliseconds + * @category Millisecond Helpers + * @summary Add the specified number of milliseconds to the given date. * - * @example - * // For the date outside of the interval: - * isWithinInterval(new Date(2014, 0, 10), { - * start: new Date(2014, 0, 1), - * end: new Date(2014, 0, 7) - * }) - * //=> false + * @description + * Add the specified number of milliseconds to the given date. * - * @example - * // For date equal to interval start: - * isWithinInterval(date, { start, end: date }) // => true + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the milliseconds added + * @throws {TypeError} 2 arguments required * * @example - * // For date equal to interval end: - * isWithinInterval(date, { start: date, end }) // => true + * // Add 750 milliseconds to 10 July 2014 12:45:30.000: + * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) + * //=> Thu Jul 10 2014 12:45:30.750 */ -function isWithinInterval(dirtyDate, interval) { - (0, _index2.default)(2, arguments); - var time = (0, _index.default)(dirtyDate).getTime(); - var startTime = (0, _index.default)(interval.start).getTime(); - var endTime = (0, _index.default)(interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` - - if (!(startTime <= endTime)) { - throw new RangeError('Invalid interval'); - } - - return time >= startTime && time <= endTime; +function addMilliseconds(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var timestamp = (0, _index2.default)(dirtyDate).getTime(); + var amount = (0, _index.default)(dirtyAmount); + return new Date(timestamp + amount); } - module.exports = exports.default; /***/ }), -/* 243 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5268: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isMatch; +})); +exports["default"] = addMinutes; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(524)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_MINUTE = 60000; + +/** + * @name addMinutes + * @category Minute Helpers + * @summary Add the specified number of minutes to the given date. + * + * @description + * Add the specified number of minutes to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of minutes to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the minutes added + * @throws {TypeError} 2 arguments required + * + * @example + * // Add 30 minutes to 10 July 2014 12:00:00: + * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 12:30:00 + */ +function addMinutes(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, amount * MILLISECONDS_IN_MINUTE); +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(139)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(909)); +/***/ 2995: +/***/ ((module, exports, __nccwpck_require__) => { -var _index3 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = addMonths; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isMatch - * @category Common Helpers - * @summary validates the date string against given formats + * @name addMonths + * @category Month Helpers + * @summary Add the specified number of months to the given date. * * @description - * Return the true if given date is string correct against the given format else - * will return false. - * - * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. - * > See: https://git.io/fxCyr + * Add the specified number of months to the given date. * - * The characters in the format string wrapped between two single quotes characters (') are escaped. - * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. - * - * Format of the format string is based on Unicode Technical Standard #35: - * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * with a few additions (see note 5 below the table). - * - * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited - * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception: - * - * ```javascript - * isMatch('23 AM', 'HH a') - * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time - * ``` - * - * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true - * - * Accepted format string patterns: - * | Unit |Prior| Pattern | Result examples | Notes | - * |---------------------------------|-----|---------|-----------------------------------|-------| - * | Era | 140 | G..GGG | AD, BC | | - * | | | GGGG | Anno Domini, Before Christ | 2 | - * | | | GGGGG | A, B | | - * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | - * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | - * | | | yy | 44, 01, 00, 17 | 4 | - * | | | yyy | 044, 001, 123, 999 | 4 | - * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | - * | | | yyyyy | ... | 2,4 | - * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | - * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | - * | | | YY | 44, 01, 00, 17 | 4,6 | - * | | | YYY | 044, 001, 123, 999 | 4 | - * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | - * | | | YYYYY | ... | 2,4 | - * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | - * | | | RR | -43, 01, 00, 17 | 4,5 | - * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | - * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | - * | | | RRRRR | ... | 2,4,5 | - * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | - * | | | uu | -43, 01, 99, -99 | 4 | - * | | | uuu | -043, 001, 123, 999, -999 | 4 | - * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | - * | | | uuuuu | ... | 2,4 | - * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | - * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | - * | | | QQ | 01, 02, 03, 04 | | - * | | | QQQ | Q1, Q2, Q3, Q4 | | - * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | - * | | | QQQQQ | 1, 2, 3, 4 | 4 | - * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | - * | | | qo | 1st, 2nd, 3rd, 4th | 5 | - * | | | qq | 01, 02, 03, 04 | | - * | | | qqq | Q1, Q2, Q3, Q4 | | - * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | - * | | | qqqqq | 1, 2, 3, 4 | 3 | - * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | - * | | | Mo | 1st, 2nd, ..., 12th | 5 | - * | | | MM | 01, 02, ..., 12 | | - * | | | MMM | Jan, Feb, ..., Dec | | - * | | | MMMM | January, February, ..., December | 2 | - * | | | MMMMM | J, F, ..., D | | - * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | - * | | | Lo | 1st, 2nd, ..., 12th | 5 | - * | | | LL | 01, 02, ..., 12 | | - * | | | LLL | Jan, Feb, ..., Dec | | - * | | | LLLL | January, February, ..., December | 2 | - * | | | LLLLL | J, F, ..., D | | - * | Local week of year | 100 | w | 1, 2, ..., 53 | | - * | | | wo | 1st, 2nd, ..., 53th | 5 | - * | | | ww | 01, 02, ..., 53 | | - * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | - * | | | Io | 1st, 2nd, ..., 53th | 5 | - * | | | II | 01, 02, ..., 53 | 5 | - * | Day of month | 90 | d | 1, 2, ..., 31 | | - * | | | do | 1st, 2nd, ..., 31st | 5 | - * | | | dd | 01, 02, ..., 31 | | - * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 | - * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | - * | | | DD | 01, 02, ..., 365, 366 | 7 | - * | | | DDD | 001, 002, ..., 365, 366 | | - * | | | DDDD | ... | 2 | - * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | | - * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | - * | | | EEEEE | M, T, W, T, F, S, S | | - * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | | - * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | - * | | | io | 1st, 2nd, ..., 7th | 5 | - * | | | ii | 01, 02, ..., 07 | 5 | - * | | | iii | Mon, Tue, Wed, ..., Su | 5 | - * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | - * | | | iiiii | M, T, W, T, F, S, S | 5 | - * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 | - * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | - * | | | eo | 2nd, 3rd, ..., 1st | 5 | - * | | | ee | 02, 03, ..., 01 | | - * | | | eee | Mon, Tue, Wed, ..., Su | | - * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | - * | | | eeeee | M, T, W, T, F, S, S | | - * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | | - * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | - * | | | co | 2nd, 3rd, ..., 1st | 5 | - * | | | cc | 02, 03, ..., 01 | | - * | | | ccc | Mon, Tue, Wed, ..., Su | | - * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | - * | | | ccccc | M, T, W, T, F, S, S | | - * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | | - * | AM, PM | 80 | a..aaa | AM, PM | | - * | | | aaaa | a.m., p.m. | 2 | - * | | | aaaaa | a, p | | - * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | - * | | | bbbb | a.m., p.m., noon, midnight | 2 | - * | | | bbbbb | a, p, n, mi | | - * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | - * | | | BBBB | at night, in the morning, ... | 2 | - * | | | BBBBB | at night, in the morning, ... | | - * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | - * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | - * | | | hh | 01, 02, ..., 11, 12 | | - * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | - * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | - * | | | HH | 00, 01, 02, ..., 23 | | - * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | - * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | - * | | | KK | 01, 02, ..., 11, 00 | | - * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | - * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | - * | | | kk | 24, 01, 02, ..., 23 | | - * | Minute | 60 | m | 0, 1, ..., 59 | | - * | | | mo | 0th, 1st, ..., 59th | 5 | - * | | | mm | 00, 01, ..., 59 | | - * | Second | 50 | s | 0, 1, ..., 59 | | - * | | | so | 0th, 1st, ..., 59th | 5 | - * | | | ss | 00, 01, ..., 59 | | - * | Seconds timestamp | 40 | t | 512969520 | | - * | | | tt | ... | 2 | - * | Fraction of second | 30 | S | 0, 1, ..., 9 | | - * | | | SS | 00, 01, ..., 99 | | - * | | | SSS | 000, 0001, ..., 999 | | - * | | | SSSS | ... | 2 | - * | Milliseconds timestamp | 20 | T | 512969520900 | | - * | | | TT | ... | 2 | - * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | - * | | | XX | -0800, +0530, Z | | - * | | | XXX | -08:00, +05:30, Z | | - * | | | XXXX | -0800, +0530, Z, +123456 | 2 | - * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | - * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | - * | | | xx | -0800, +0530, +0000 | | - * | | | xxx | -08:00, +05:30, +00:00 | 2 | - * | | | xxxx | -0800, +0530, +0000, +123456 | | - * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | - * | Long localized date | NA | P | 05/29/1453 | 5,8 | - * | | | PP | May 29, 1453 | | - * | | | PPP | May 29th, 1453 | | - * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 | - * | Long localized time | NA | p | 12:00 AM | 5,8 | - * | | | pp | 12:00:00 AM | | - * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | | - * | | | PPpp | May 29, 1453, 12:00:00 AM | | - * | | | PPPpp | May 29th, 1453 at ... | | - * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 | - * Notes: - * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale - * are the same as "stand-alone" units, but are different in some languages. - * "Formatting" units are declined according to the rules of the language - * in the context of a date. "Stand-alone" units are always nominative singular. - * In `format` function, they will produce different result: - * - * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` - * - * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` - * - * `isMatch` will try to match both formatting and stand-alone units interchangably. - * - * 2. Any sequence of the identical letters is a pattern, unless it is escaped by - * the single quote characters (see below). - * If the sequence is longer than listed in table: - * - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number - * as wide as the sequence - * - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit. - * These variations are marked with "2" in the last column of the table. - * - * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. - * These tokens represent the shortest form of the quarter. - * - * 4. The main difference between `y` and `u` patterns are B.C. years: - * - * | Year | `y` | `u` | - * |------|-----|-----| - * | AC 1 | 1 | 1 | - * | BC 1 | 1 | 0 | - * | BC 2 | 2 | -1 | - * - * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`: - * - * `isMatch('50', 'yy') //=> true` - * - * `isMatch('75', 'yy') //=> true` - * - * while `uu` will use the year as is: - * - * `isMatch('50', 'uu') //=> true` - * - * `isMatch('75', 'uu') //=> true` - * - * The same difference is true for local and ISO week-numbering years (`Y` and `R`), - * except local week-numbering years are dependent on `options.weekStartsOn` - * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear} - * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}). - * - * 5. These patterns are not in the Unicode Technical Standard #35: - * - `i`: ISO day of week - * - `I`: ISO week of year - * - `R`: ISO week-numbering year - * - `o`: ordinal number modifier - * - `P`: long localized date - * - `p`: long localized time - * - * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. - * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr - * - * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month. - * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr - * - * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based - * on the given locale. - * - * using `en-US` locale: `P` => `MM/dd/yyyy` - * using `en-US` locale: `p` => `hh:mm a` - * using `pt-BR` locale: `P` => `dd/MM/yyyy` - * using `pt-BR` locale: `p` => `HH:mm` - * - * Values will be checked in the descending order of its unit's priority. - * Units of an equal priority overwrite each other in the order of appearance. - * - * If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year), - * the values will be taken from today's using `new Date()` date which works as a context of parsing. - * - * The result may vary by locale. - * - * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. - * - * - * - * @param {String} dateString - the date string to verify - * @param {String} formatString - the string of tokens - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year - * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`; - * see: https://git.io/fxCyr - * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`; - * see: https://git.io/fxCyr - * @returns {Boolean} - * @throws {TypeError} 2 arguments required - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 - * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 - * @throws {RangeError} `options.locale` must contain `match` property - * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr - * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr - * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr - * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr - * @throws {RangeError} format string contains an unescaped latin alphabet character - * - * @example - * // Match 11 February 2014 from middle-endian format: - * var result = isMatch('02/11/2014', 'MM/dd/yyyy') - * //=> true + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the months added + * @throws {TypeError} 2 arguments required * * @example - * // Match 28th of February in Esperanto locale in the context of 2010 year: - * import eo from 'date-fns/locale/eo' - * var result = isMatch('28-a de februaro', "do 'de' MMMM", { - * locale: eo - * }) - * //=> true + * // Add 5 months to 1 September 2014: + * const result = addMonths(new Date(2014, 8, 1), 5) + * //=> Sun Feb 01 2015 00:00:00 */ -function isMatch(dateString, formatString, dirtyOptions) { +function addMonths(dirtyDate, dirtyAmount) { (0, _index3.default)(2, arguments); - return (0, _index2.default)((0, _index.default)(dateString, formatString, new Date(), dirtyOptions)); -} + var date = (0, _index2.default)(dirtyDate); + var amount = (0, _index.default)(dirtyAmount); + if (isNaN(amount)) { + return new Date(NaN); + } + if (!amount) { + // 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 + // 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 + // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So + // 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(); + if (dayOfMonth >= daysInMonth) { + // If we're already at the end of the month, then this is the correct date + // and we're done. + return endOfDesiredMonth; + } else { + // Otherwise, we now know that setting the original day-of-month value won't + // cause an overflow, so set the desired day-of-month. Note that we can't + // just set the date of `endOfDesiredMonth` because that object may have had + // its time changed in the unusual case where where a DST transition was on + // the last day of the month and its local time was in the hour skipped or + // repeated next to a DST transition. So we use `date` instead which is + // guaranteed to still have the original time. + date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth); + return date; + } +} module.exports = exports.default; /***/ }), -/* 244 */, -/* 245 */, -/* 246 */, -/* 247 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const os = __webpack_require__(87); -const tty = __webpack_require__(868); -const hasFlag = __webpack_require__(721); - -const {env} = process; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = 1; -} - -if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - if (haveStream && !streamIsTTY && forceColor === undefined) { - return 0; - } - - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } - - if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } +/***/ 5149: +/***/ ((module, exports, __nccwpck_require__) => { - if ('COLORTERM' in env) { - return 1; - } +"use strict"; - return min; -} -function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = addQuarters; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2995)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name addQuarters + * @category Quarter Helpers + * @summary Add the specified number of year quarters to the given date. + * + * @description + * Add the specified number of year quarters to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of quarters to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the quarters added + * @throws {TypeError} 2 arguments required + * + * @example + * // Add 1 quarter to 1 September 2014: + * const result = addQuarters(new Date(2014, 8, 1), 1) + * //=> Mon Dec 01 2014 00:00:00 + */ +function addQuarters(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + var months = amount * 3; + return (0, _index2.default)(dirtyDate, months); } - -module.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) -}; - +module.exports = exports.default; /***/ }), -/* 248 */, -/* 249 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 4112: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isSameWeek; - -var _index = _interopRequireDefault(__webpack_require__(343)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = addSeconds; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(524)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isSameWeek - * @category Week Helpers - * @summary Are the given dates in the same week? + * @name addSeconds + * @category Second Helpers + * @summary Add the specified number of seconds to the given date. * * @description - * Are the given dates in the same week? - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Add the specified number of seconds to the given date. * - * @param {Date|Number} dateLeft - the first date to check - * @param {Date|Number} dateRight - the second date to check - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Boolean} the dates are in the same week + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the seconds added * @throws {TypeError} 2 arguments required - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example - * // Are 31 August 2014 and 4 September 2014 in the same week? - * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4)) - * //=> true - * - * @example - * // If week starts with Monday, - * // are 31 August 2014 and 4 September 2014 in the same week? - * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), { - * weekStartsOn: 1 - * }) - * //=> false + * // Add 30 seconds to 10 July 2014 12:45:00: + * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) + * //=> Thu Jul 10 2014 12:45:30 */ -function isSameWeek(dirtyDateLeft, dirtyDateRight, dirtyOptions) { - (0, _index2.default)(2, arguments); - var dateLeftStartOfWeek = (0, _index.default)(dirtyDateLeft, dirtyOptions); - var dateRightStartOfWeek = (0, _index.default)(dirtyDateRight, dirtyOptions); - return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime(); +function addSeconds(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, amount * 1000); } - module.exports = exports.default; /***/ }), -/* 250 */ -/***/ (function(module, exports) { + +/***/ 7195: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = buildLocalizeFn; - -function buildLocalizeFn(args) { - return function (dirtyIndex, dirtyOptions) { - var options = dirtyOptions || {}; - var context = options.context ? String(options.context) : 'standalone'; - var valuesArray; - - if (context === 'formatting' && args.formattingValues) { - var defaultWidth = args.defaultFormattingWidth || args.defaultWidth; - var width = options.width ? String(options.width) : defaultWidth; - valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; - } else { - var _defaultWidth = args.defaultWidth; - - var _width = options.width ? String(options.width) : args.defaultWidth; - - valuesArray = args.values[_width] || args.values[_defaultWidth]; - } - - var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; - return valuesArray[index]; - }; +})); +exports["default"] = addWeeks; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6227)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name addWeeks + * @category Week Helpers + * @summary Add the specified number of weeks to the given date. + * + * @description + * Add the specified number of week to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of weeks to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the weeks added + * @throws {TypeError} 2 arguments required + * + * @example + * // Add 4 weeks to 1 September 2014: + * const result = addWeeks(new Date(2014, 8, 1), 4) + * //=> Mon Sep 29 2014 00:00:00 + */ +function addWeeks(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + var days = amount * 7; + return (0, _index2.default)(dirtyDate, days); } - module.exports = exports.default; /***/ }), -/* 251 */, -/* 252 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3367: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = setISODay; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(773)); +})); +exports["default"] = addYears; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2995)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name addYears + * @category Year Helpers + * @summary Add the specified number of years to the given date. + * + * @description + * Add the specified number of years to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the years added + * @throws {TypeError} 2 arguments required + * + * @example + * // Add 5 years to 1 September 2014: + * const result = addYears(new Date(2014, 8, 1), 5) + * //=> Sun Sep 01 2019 00:00:00 + */ +function addYears(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, amount * 12); +} +module.exports = exports.default; -var _index3 = _interopRequireDefault(__webpack_require__(865)); +/***/ }), -var _index4 = _interopRequireDefault(__webpack_require__(0)); +/***/ 2282: +/***/ ((module, exports, __nccwpck_require__) => { -var _index5 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = areIntervalsOverlapping; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name setISODay - * @category Weekday Helpers - * @summary Set the day of the ISO week to the given date. + * @name areIntervalsOverlapping + * @category Interval Helpers + * @summary Is the given time interval overlapping with another time interval? * * @description - * Set the day of the ISO week to the given date. - * ISO week starts with Monday. - * 7 is the index of Sunday, 1 is the index of Monday etc. + * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping. * - * ### v2.0.0 breaking changes: + * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval} + * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval} + * @param {Object} [options] - the object with options + * @param {Boolean} [options.inclusive=false] - whether the comparison is inclusive or not + * @returns {Boolean} whether the time intervals are overlapping + * @throws {TypeError} 2 arguments required + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @example + * // For overlapping time intervals: + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } + * ) + * //=> true * - * @param {Date|Number} date - the date to be changed - * @param {Number} day - the day of the ISO week of the new date - * @returns {Date} the new date with the day of the ISO week set - * @throws {TypeError} 2 arguments required + * @example + * // For non-overlapping time intervals: + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } + * ) + * //=> false * * @example - * // Set Sunday to 1 September 2014: - * const result = setISODay(new Date(2014, 8, 1), 7) - * //=> Sun Sep 07 2014 00:00:00 + * // For adjacent time intervals: + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) } + * ) + * //=> false + * + * @example + * // Using the inclusive option: + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) } + * ) + * //=> false + * areIntervalsOverlapping( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }, + * { inclusive: true } + * ) + * //=> true */ -function setISODay(dirtyDate, dirtyDay) { - (0, _index5.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var day = (0, _index.default)(dirtyDay); - var currentDay = (0, _index4.default)(date); - var diff = day - currentDay; - return (0, _index3.default)(date, diff); +function areIntervalsOverlapping(intervalLeft, intervalRight, options) { + (0, _index2.default)(2, arguments); + var leftStartTime = (0, _index.default)(intervalLeft === null || intervalLeft === void 0 ? void 0 : intervalLeft.start).getTime(); + var leftEndTime = (0, _index.default)(intervalLeft === null || intervalLeft === void 0 ? void 0 : intervalLeft.end).getTime(); + var rightStartTime = (0, _index.default)(intervalRight === null || intervalRight === void 0 ? void 0 : intervalRight.start).getTime(); + var rightEndTime = (0, _index.default)(intervalRight === null || intervalRight === void 0 ? void 0 : intervalRight.end).getTime(); + + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) { + throw new RangeError('Invalid interval'); + } + if (options !== null && options !== void 0 && options.inclusive) { + return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime; + } + return leftStartTime < rightEndTime && rightStartTime < leftEndTime; } +module.exports = exports.default; + +/***/ }), + +/***/ 9660: +/***/ ((module, exports, __nccwpck_require__) => { +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = clamp; +var _index = _interopRequireDefault(__nccwpck_require__(5815)); +var _index2 = _interopRequireDefault(__nccwpck_require__(5310)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name clamp + * @category Interval Helpers + * @summary Return a date bounded by the start and the end of the given interval + * + * @description + * Clamps a date to the lower bound with the start of the interval and the upper + * bound with the end of the interval. + * + * - When the date is less than the start of the interval, the start is returned. + * - When the date is greater than the end of the interval, the end is returned. + * - Otherwise the date is returned. + * + * @example + * // What is Mar, 21, 2021 bounded to an interval starting at Mar, 22, 2021 and ending at Apr, 01, 2021 + * const result = clamp(new Date(2021, 2, 21), { + * start: new Date(2021, 2, 22), + * end: new Date(2021, 3, 1), + * }) + * //=> Mon Mar 22 2021 00:00:00 + * + * @param {Date | Number} date - the date to be bounded + * @param {Interval} interval - the interval to bound to + * @returns {Date} the date bounded by the start and the end of the interval + * @throws {TypeError} 2 arguments required + */ +function clamp(date, _ref) { + var start = _ref.start, + end = _ref.end; + (0, _index3.default)(2, arguments); + return (0, _index2.default)([(0, _index.default)([date, start]), end]); +} module.exports = exports.default; /***/ }), -/* 253 */ -/***/ (function(module) { + +/***/ 2264: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -const callsites = () => { - const _prepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = (_, stack) => stack; - const stack = new Error().stack.slice(1); - Error.prepareStackTrace = _prepareStackTrace; - return stack; -}; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = closestIndexTo; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name closestIndexTo + * @category Common Helpers + * @summary Return an index of the closest date from the array comparing to the given date. + * + * @description + * Return an index of the closest date from the array comparing to the given date. + * + * @param {Date | Number} dateToCompare - the date to compare with + * @param {Array | Array} datesArray - the array to search + * @returns {Number | undefined} an index of the date closest to the given date or undefined if no valid value is given + * @throws {TypeError} 2 arguments required + * + * @example + * // Which date is closer to 6 September 2015? + * const dateToCompare = new Date(2015, 8, 6) + * const datesArray = [ + * new Date(2015, 0, 1), + * new Date(2016, 0, 1), + * new Date(2017, 0, 1) + * ] + * const result = closestIndexTo(dateToCompare, datesArray) + * //=> 1 + */ +function closestIndexTo(dirtyDateToCompare, dirtyDatesArray) { + (0, _index2.default)(2, arguments); + var dateToCompare = (0, _index.default)(dirtyDateToCompare); + if (isNaN(Number(dateToCompare))) return NaN; + var timeToCompare = dateToCompare.getTime(); + var datesArray; + // `dirtyDatesArray` is undefined or null + if (dirtyDatesArray == null) { + datesArray = []; -module.exports = callsites; -// TODO: Remove this for the next major release -module.exports.default = callsites; + // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method + } else if (typeof dirtyDatesArray.forEach === 'function') { + datesArray = dirtyDatesArray; + // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array + } else { + datesArray = Array.prototype.slice.call(dirtyDatesArray); + } + var result; + var minDistance; + datesArray.forEach(function (dirtyDate, index) { + var currentDate = (0, _index.default)(dirtyDate); + if (isNaN(Number(currentDate))) { + result = NaN; + minDistance = NaN; + return; + } + var distance = Math.abs(timeToCompare - currentDate.getTime()); + if (result == null || distance < Number(minDistance)) { + result = index; + minDistance = distance; + } + }); + return result; +} +module.exports = exports.default; /***/ }), -/* 254 */, -/* 255 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2013: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getWeeksInMonth; +})); +exports["default"] = closestTo; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name closestTo + * @category Common Helpers + * @summary Return a date from the array closest to the given date. + * + * @description + * Return a date from the array closest to the given date. + * + * @param {Date | Number} dateToCompare - the date to compare with + * @param {Array | Array} datesArray - the array to search + * @returns {Date | undefined} the date from the array closest to the given date or undefined if no valid value is given + * @throws {TypeError} 2 arguments required + * + * @example + * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030? + * const dateToCompare = new Date(2015, 8, 6) + * const result = closestTo(dateToCompare, [ + * new Date(2000, 0, 1), + * new Date(2030, 0, 1) + * ]) + * //=> Tue Jan 01 2030 00:00:00 + */ +function closestTo(dirtyDateToCompare, dirtyDatesArray) { + (0, _index2.default)(2, arguments); + var dateToCompare = (0, _index.default)(dirtyDateToCompare); + if (isNaN(Number(dateToCompare))) return new Date(NaN); + var timeToCompare = dateToCompare.getTime(); + var datesArray; + // `dirtyDatesArray` is undefined or null + if (dirtyDatesArray == null) { + datesArray = []; -var _index = _interopRequireDefault(__webpack_require__(295)); + // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method + } else if (typeof dirtyDatesArray.forEach === 'function') { + datesArray = dirtyDatesArray; + + // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array + } else { + datesArray = Array.prototype.slice.call(dirtyDatesArray); + } + var result; + var minDistance; + datesArray.forEach(function (dirtyDate) { + var currentDate = (0, _index.default)(dirtyDate); + if (isNaN(Number(currentDate))) { + result = new Date(NaN); + minDistance = NaN; + return; + } + var distance = Math.abs(timeToCompare - currentDate.getTime()); + if (result == null || distance < Number(minDistance)) { + result = currentDate; + minDistance = distance; + } + }); + return result; +} +module.exports = exports.default; -var _index2 = _interopRequireDefault(__webpack_require__(18)); +/***/ }), -var _index3 = _interopRequireDefault(__webpack_require__(431)); +/***/ 9818: +/***/ ((module, exports, __nccwpck_require__) => { -var _index4 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = compareAsc; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name getWeeksInMonth - * @category Week Helpers - * @summary Get the number of calendar weeks a month spans. + * @name compareAsc + * @category Common Helpers + * @summary Compare the two dates and return -1, 0 or 1. * * @description - * Get the number of calendar weeks the month in the given date spans. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Compare the two dates and return 1 if the first date is after the second, + * -1 if the first date is before the second or 0 if dates are equal. * - * @param {Date|Number} date - the given date - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Number} the number of calendar weeks + * @param {Date|Number} dateLeft - the first date to compare + * @param {Date|Number} dateRight - the second date to compare + * @returns {Number} the result of the comparison * @throws {TypeError} 2 arguments required - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example - * // How many calendar weeks does February 2015 span? - * const result = getWeeksInMonth(new Date(2015, 1, 8)) - * //=> 4 + * // Compare 11 February 1987 and 10 July 1989: + * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10)) + * //=> -1 * * @example - * // If the week starts on Monday, - * // how many calendar weeks does July 2017 span? - * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 }) - * //=> 6 + * // Sort the array of dates: + * const result = [ + * new Date(1995, 6, 2), + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ].sort(compareAsc) + * //=> [ + * // Wed Feb 11 1987 00:00:00, + * // Mon Jul 10 1989 00:00:00, + * // Sun Jul 02 1995 00:00:00 + * // ] */ -function getWeeksInMonth(date, options) { - (0, _index4.default)(1, arguments); - return (0, _index.default)((0, _index2.default)(date), (0, _index3.default)(date), options) + 1; +function compareAsc(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + var diff = dateLeft.getTime() - dateRight.getTime(); + if (diff < 0) { + return -1; + } else if (diff > 0) { + return 1; + // Return 0 if diff is 0; return NaN if diff is NaN + } else { + return diff; + } } - module.exports = exports.default; /***/ }), -/* 256 */, -/* 257 */, -/* 258 */, -/* 259 */, -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7783: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = void 0; +})); +exports["default"] = compareDesc; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name compareDesc + * @category Common Helpers + * @summary Compare the two dates reverse chronologically and return -1, 0 or 1. + * + * @description + * Compare the two dates and return -1 if the first date is after the second, + * 1 if the first date is before the second or 0 if dates are equal. + * + * @param {Date|Number} dateLeft - the first date to compare + * @param {Date|Number} dateRight - the second date to compare + * @returns {Number} the result of the comparison + * @throws {TypeError} 2 arguments required + * + * @example + * // Compare 11 February 1987 and 10 July 1989 reverse chronologically: + * const result = compareDesc(new Date(1987, 1, 11), new Date(1989, 6, 10)) + * //=> 1 + * + * @example + * // Sort the array of dates in reverse chronological order: + * const result = [ + * new Date(1995, 6, 2), + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ].sort(compareDesc) + * //=> [ + * // Sun Jul 02 1995 00:00:00, + * // Mon Jul 10 1989 00:00:00, + * // Wed Feb 11 1987 00:00:00 + * // ] + */ +function compareDesc(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + var diff = dateLeft.getTime() - dateRight.getTime(); + if (diff > 0) { + return -1; + } else if (diff < 0) { + return 1; + // Return 0 if diff is 0; return NaN if diff is NaN + } else { + return diff; + } +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(682)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(893)); +/***/ 5756: +/***/ ((__unused_webpack_module, exports) => { -var _index3 = _interopRequireDefault(__webpack_require__(176)); +"use strict"; -var _index4 = _interopRequireDefault(__webpack_require__(163)); -var _index5 = _interopRequireDefault(__webpack_require__(102)); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.secondsInYear = exports.secondsInWeek = exports.secondsInQuarter = exports.secondsInMonth = exports.secondsInMinute = exports.secondsInHour = exports.secondsInDay = exports.quartersInYear = exports.monthsInYear = exports.monthsInQuarter = exports.minutesInHour = exports.minTime = exports.millisecondsInSecond = exports.millisecondsInMinute = exports.millisecondsInHour = exports.maxTime = exports.daysInYear = exports.daysInWeek = void 0; +/** + * Days in 1 week. + * + * @name daysInWeek + * @constant + * @type {number} + * @default + */ +var daysInWeek = 7; -var _index6 = _interopRequireDefault(__webpack_require__(229)); +/** + * Days in 1 year + * One years equals 365.2425 days according to the formula: + * + * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. + * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days + * + * @name daysInYear + * @constant + * @type {number} + * @default + */ +exports.daysInWeek = daysInWeek; +var daysInYear = 365.2425; -var _index7 = _interopRequireDefault(__webpack_require__(488)); +/** + * Maximum allowed time. + * + * @name maxTime + * @constant + * @type {number} + * @default + */ +exports.daysInYear = daysInYear; +var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** + * Milliseconds in 1 minute + * + * @name millisecondsInMinute + * @constant + * @type {number} + * @default + */ +exports.maxTime = maxTime; +var millisecondsInMinute = 60000; -var dayPeriodEnum = { - am: 'am', - pm: 'pm', - midnight: 'midnight', - noon: 'noon', - morning: 'morning', - afternoon: 'afternoon', - evening: 'evening', - night: 'night' - /* - * | | Unit | | Unit | - * |-----|--------------------------------|-----|--------------------------------| - * | a | AM, PM | A* | Milliseconds in day | - * | b | AM, PM, noon, midnight | B | Flexible day period | - * | c | Stand-alone local day of week | C* | Localized hour w/ day period | - * | d | Day of month | D | Day of year | - * | e | Local day of week | E | Day of week | - * | f | | F* | Day of week in month | - * | g* | Modified Julian day | G | Era | - * | h | Hour [1-12] | H | Hour [0-23] | - * | i! | ISO day of week | I! | ISO week of year | - * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | - * | k | Hour [1-24] | K | Hour [0-11] | - * | l* | (deprecated) | L | Stand-alone month | - * | m | Minute | M | Month | - * | n | | N | | - * | o! | Ordinal number modifier | O | Timezone (GMT) | - * | p! | Long localized time | P! | Long localized date | - * | q | Stand-alone quarter | Q | Quarter | - * | r* | Related Gregorian year | R! | ISO week-numbering year | - * | s | Second | S | Fraction of second | - * | t! | Seconds timestamp | T! | Milliseconds timestamp | - * | u | Extended year | U* | Cyclic year | - * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | - * | w | Local week of year | W* | Week of month | - * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | - * | y | Year (abs) | Y | Local week-numbering year | - * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) | - * - * Letters marked by * are not implemented but reserved by Unicode standard. - * - * Letters marked by ! are non-standard, but implemented by date-fns: - * - `o` modifies the previous token to turn it into an ordinal (see `format` docs) - * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, - * i.e. 7 for Sunday, 1 for Monday, etc. - * - `I` is ISO week of year, as opposed to `w` which is local week of year. - * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. - * `R` is supposed to be used in conjunction with `I` and `i` - * for universal ISO week-numbering date, whereas - * `Y` is supposed to be used in conjunction with `w` and `e` - * for week-numbering date specific to the locale. - * - `P` is long localized date format - * - `p` is long localized time format - */ +/** + * Milliseconds in 1 hour + * + * @name millisecondsInHour + * @constant + * @type {number} + * @default + */ +exports.millisecondsInMinute = millisecondsInMinute; +var millisecondsInHour = 3600000; -}; -var formatters = { - // Era - G: function (date, token, localize) { - var era = date.getUTCFullYear() > 0 ? 1 : 0; +/** + * Milliseconds in 1 second + * + * @name millisecondsInSecond + * @constant + * @type {number} + * @default + */ +exports.millisecondsInHour = millisecondsInHour; +var millisecondsInSecond = 1000; - switch (token) { - // AD, BC - case 'G': - case 'GG': - case 'GGG': - return localize.era(era, { - width: 'abbreviated' - }); - // A, B +/** + * Minimum allowed time. + * + * @name minTime + * @constant + * @type {number} + * @default + */ +exports.millisecondsInSecond = millisecondsInSecond; +var minTime = -maxTime; - case 'GGGGG': - return localize.era(era, { - width: 'narrow' - }); - // Anno Domini, Before Christ +/** + * Minutes in 1 hour + * + * @name minutesInHour + * @constant + * @type {number} + * @default + */ +exports.minTime = minTime; +var minutesInHour = 60; - case 'GGGG': - default: - return localize.era(era, { - width: 'wide' - }); - } - }, - // Year - y: function (date, token, localize) { - // Ordinal number - if (token === 'yo') { - var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript) +/** + * Months in 1 quarter + * + * @name monthsInQuarter + * @constant + * @type {number} + * @default + */ +exports.minutesInHour = minutesInHour; +var monthsInQuarter = 3; - var year = signedYear > 0 ? signedYear : 1 - signedYear; - return localize.ordinalNumber(year, { - unit: 'year' - }); - } +/** + * Months in 1 year + * + * @name monthsInYear + * @constant + * @type {number} + * @default + */ +exports.monthsInQuarter = monthsInQuarter; +var monthsInYear = 12; - return _index.default.y(date, token); - }, - // Local week-numbering year - Y: function (date, token, localize, options) { - var signedWeekYear = (0, _index6.default)(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript) +/** + * Quarters in 1 year + * + * @name quartersInYear + * @constant + * @type {number} + * @default + */ +exports.monthsInYear = monthsInYear; +var quartersInYear = 4; - var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year +/** + * Seconds in 1 hour + * + * @name secondsInHour + * @constant + * @type {number} + * @default + */ +exports.quartersInYear = quartersInYear; +var secondsInHour = 3600; - if (token === 'YY') { - var twoDigitYear = weekYear % 100; - return (0, _index7.default)(twoDigitYear, 2); - } // Ordinal number +/** + * Seconds in 1 minute + * + * @name secondsInMinute + * @constant + * @type {number} + * @default + */ +exports.secondsInHour = secondsInHour; +var secondsInMinute = 60; +/** + * Seconds in 1 day + * + * @name secondsInDay + * @constant + * @type {number} + * @default + */ +exports.secondsInMinute = secondsInMinute; +var secondsInDay = secondsInHour * 24; - if (token === 'Yo') { - return localize.ordinalNumber(weekYear, { - unit: 'year' - }); - } // Padding +/** + * Seconds in 1 week + * + * @name secondsInWeek + * @constant + * @type {number} + * @default + */ +exports.secondsInDay = secondsInDay; +var secondsInWeek = secondsInDay * 7; +/** + * Seconds in 1 year + * + * @name secondsInYear + * @constant + * @type {number} + * @default + */ +exports.secondsInWeek = secondsInWeek; +var secondsInYear = secondsInDay * daysInYear; - return (0, _index7.default)(weekYear, token.length); - }, - // ISO week-numbering year - R: function (date, token) { - var isoWeekYear = (0, _index4.default)(date); // Padding +/** + * Seconds in 1 month + * + * @name secondsInMonth + * @constant + * @type {number} + * @default + */ +exports.secondsInYear = secondsInYear; +var secondsInMonth = secondsInYear / 12; - return (0, _index7.default)(isoWeekYear, token.length); - }, - // Extended year. This is a single number designating the year of this calendar system. - // The main difference between `y` and `u` localizers are B.C. years: - // | Year | `y` | `u` | - // |------|-----|-----| - // | AC 1 | 1 | 1 | - // | BC 1 | 1 | 0 | - // | BC 2 | 2 | -1 | - // Also `yy` always returns the last two digits of a year, - // while `uu` pads single digit years to 2 characters and returns other years unchanged. - u: function (date, token) { - var year = date.getUTCFullYear(); - return (0, _index7.default)(year, token.length); - }, - // Quarter - Q: function (date, token, localize) { - var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); +/** + * Seconds in 1 quarter + * + * @name secondsInQuarter + * @constant + * @type {number} + * @default + */ +exports.secondsInMonth = secondsInMonth; +var secondsInQuarter = secondsInMonth * 3; +exports.secondsInQuarter = secondsInQuarter; - switch (token) { - // 1, 2, 3, 4 - case 'Q': - return String(quarter); - // 01, 02, 03, 04 +/***/ }), - case 'QQ': - return (0, _index7.default)(quarter, 2); - // 1st, 2nd, 3rd, 4th +/***/ 6237: +/***/ ((module, exports, __nccwpck_require__) => { - 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, { - width: 'wide', - context: 'formatting' - }); - } - }, - // Stand-alone quarter - q: function (date, token, localize) { - var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); +"use strict"; - switch (token) { - // 1, 2, 3, 4 - case 'q': - return String(quarter); - // 01, 02, 03, 04 - case 'qq': - return (0, _index7.default)(quarter, 2); - // 1st, 2nd, 3rd, 4th +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = daysToWeeks; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name daysToWeeks + * @category Conversion Helpers + * @summary Convert days to weeks. + * + * @description + * Convert a number of days to a full number of weeks. + * + * @param {number} days - number of days to be converted + * + * @returns {number} the number of days converted in weeks + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 14 days to weeks: + * const result = daysToWeeks(14) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = daysToWeeks(13) + * //=> 1 + */ +function daysToWeeks(days) { + (0, _index.default)(1, arguments); + var weeks = days / _index2.daysInWeek; + return Math.floor(weeks); +} +module.exports = exports.default; - 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) +/***/ 4734: +/***/ ((module, exports, __nccwpck_require__) => { - case 'qqqqq': - return localize.quarter(quarter, { - width: 'narrow', - context: 'standalone' - }); - // 1st quarter, 2nd quarter, ... +"use strict"; - case 'qqqq': - default: - return localize.quarter(quarter, { - width: 'wide', - context: 'standalone' - }); - } - }, - // Month - M: function (date, token, localize) { - var month = date.getUTCMonth(); - switch (token) { - case 'M': - case 'MM': - return _index.default.M(date, token); - // 1st, 2nd, ..., 12th +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInBusinessDays; +var _index = _interopRequireDefault(__nccwpck_require__(6227)); +var _index2 = _interopRequireDefault(__nccwpck_require__(3086)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2154)); +var _index4 = _interopRequireDefault(__nccwpck_require__(9920)); +var _index5 = _interopRequireDefault(__nccwpck_require__(403)); +var _index6 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index7 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index8 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name differenceInBusinessDays + * @category Day Helpers + * @summary Get the number of business days between the given dates. + * + * @description + * Get the number of business day periods between the given dates. + * Business days being days that arent in the weekend. + * Like `differenceInCalendarDays`, the function removes the times from + * the dates before calculating the difference. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of business days + * @throws {TypeError} 2 arguments required + * + * @example + * // How many business days are between + * // 10 January 2014 and 20 July 2014? + * const result = differenceInBusinessDays( + * new Date(2014, 6, 20), + * new Date(2014, 0, 10) + * ) + * //=> 136 + * + * // How many business days are between + * // 30 November 2021 and 1 November 2021? + * const result = differenceInBusinessDays( + * new Date(2021, 10, 30), + * new Date(2021, 10, 1) + * ) + * //=> 21 + * + * // How many business days are between + * // 1 November 2021 and 1 December 2021? + * const result = differenceInBusinessDays( + * new Date(2021, 10, 1), + * new Date(2021, 11, 1) + * ) + * //=> -22 + * + * // How many business days are between + * // 1 November 2021 and 1 November 2021 ? + * const result = differenceInBusinessDays( + * new Date(2021, 10, 1), + * new Date(2021, 10, 1) + * ) + * //=> 0 + */ +function differenceInBusinessDays(dirtyDateLeft, dirtyDateRight) { + (0, _index7.default)(2, arguments); + var dateLeft = (0, _index6.default)(dirtyDateLeft); + var dateRight = (0, _index6.default)(dirtyDateRight); + if (!(0, _index4.default)(dateLeft) || !(0, _index4.default)(dateRight)) return NaN; + var calendarDifference = (0, _index2.default)(dateLeft, dateRight); + var sign = calendarDifference < 0 ? -1 : 1; + var weeks = (0, _index8.default)(calendarDifference / 7); + var result = weeks * 5; + dateRight = (0, _index.default)(dateRight, weeks * 7); - case 'Mo': - return localize.ordinalNumber(month + 1, { - unit: 'month' - }); - // Jan, Feb, ..., Dec + // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week + while (!(0, _index3.default)(dateLeft, dateRight)) { + // sign is used to account for both negative and positive differences + result += (0, _index5.default)(dateRight) ? 0 : sign; + dateRight = (0, _index.default)(dateRight, sign); + } + return result === 0 ? 0 : result; +} +module.exports = exports.default; - 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 +/***/ 3086: +/***/ ((module, exports, __nccwpck_require__) => { - case 'MMMM': - default: - return localize.month(month, { - width: 'wide', - context: 'formatting' - }); - } - }, - // Stand-alone month - L: function (date, token, localize) { - var month = date.getUTCMonth(); +"use strict"; - switch (token) { - // 1, 2, ..., 12 - case 'L': - return String(month + 1); - // 01, 02, ..., 12 - case 'LL': - return (0, _index7.default)(month + 1, 2); - // 1st, 2nd, ..., 12th +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInCalendarDays; +var _index = _interopRequireDefault(__nccwpck_require__(7032)); +var _index2 = _interopRequireDefault(__nccwpck_require__(1868)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_DAY = 86400000; - case 'Lo': - return localize.ordinalNumber(month + 1, { - unit: 'month' - }); - // Jan, Feb, ..., Dec +/** + * @name differenceInCalendarDays + * @category Day Helpers + * @summary Get the number of calendar days between the given dates. + * + * @description + * Get the number of calendar days between the given dates. This means that the times are removed + * from the dates and then the difference in days is calculated. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar days + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar days are between + * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? + * const result = differenceInCalendarDays( + * new Date(2012, 6, 2, 0, 0), + * new Date(2011, 6, 2, 23, 0) + * ) + * //=> 366 + * // How many calendar days are between + * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? + * const result = differenceInCalendarDays( + * new Date(2011, 6, 3, 0, 1), + * new Date(2011, 6, 2, 23, 59) + * ) + * //=> 1 + */ +function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) { + (0, _index3.default)(2, arguments); + var startOfDayLeft = (0, _index2.default)(dirtyDateLeft); + var startOfDayRight = (0, _index2.default)(dirtyDateRight); + var timestampLeft = startOfDayLeft.getTime() - (0, _index.default)(startOfDayLeft); + var timestampRight = startOfDayRight.getTime() - (0, _index.default)(startOfDayRight); - case 'LLL': - return localize.month(month, { - width: 'abbreviated', - context: 'standalone' - }); - // J, F, ..., D + // 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); +} +module.exports = exports.default; - case 'LLLLL': - return localize.month(month, { - width: 'narrow', - context: 'standalone' - }); - // January, February, ..., December +/***/ }), - case 'LLLL': - default: - return localize.month(month, { - width: 'wide', - context: 'standalone' - }); - } - }, - // Local week of year - w: function (date, token, localize, options) { - var week = (0, _index5.default)(date, options); +/***/ 6778: +/***/ ((module, exports, __nccwpck_require__) => { - if (token === 'wo') { - return localize.ordinalNumber(week, { - unit: 'week' - }); - } +"use strict"; - return (0, _index7.default)(week, token.length); - }, - // ISO week of year - I: function (date, token, localize) { - var isoWeek = (0, _index3.default)(date); - if (token === 'Io') { - return localize.ordinalNumber(isoWeek, { - unit: 'week' - }); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInCalendarISOWeekYears; +var _index = _interopRequireDefault(__nccwpck_require__(6991)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name differenceInCalendarISOWeekYears + * @category ISO Week-Numbering Year Helpers + * @summary Get the number of calendar ISO week-numbering years between the given dates. + * + * @description + * Get the number of calendar ISO week-numbering years between the given dates. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar ISO week-numbering years + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012? + * const result = differenceInCalendarISOWeekYears( + * new Date(2012, 0, 1), + * new Date(2010, 0, 1) + * ) + * //=> 2 + */ +function differenceInCalendarISOWeekYears(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + return (0, _index.default)(dirtyDateLeft) - (0, _index.default)(dirtyDateRight); +} +module.exports = exports.default; - return (0, _index7.default)(isoWeek, token.length); - }, - // Day of the month - d: function (date, token, localize) { - if (token === 'do') { - return localize.ordinalNumber(date.getUTCDate(), { - unit: 'date' - }); - } +/***/ }), - return _index.default.d(date, token); - }, - // Day of year - D: function (date, token, localize) { - var dayOfYear = (0, _index2.default)(date); +/***/ 1656: +/***/ ((module, exports, __nccwpck_require__) => { - if (token === 'Do') { - return localize.ordinalNumber(dayOfYear, { - unit: 'dayOfYear' - }); - } +"use strict"; - return (0, _index7.default)(dayOfYear, token.length); - }, - // Day of week - E: function (date, token, localize) { - var dayOfWeek = date.getUTCDay(); - switch (token) { - // Tue - case 'E': - case 'EE': - case 'EEE': - return localize.day(dayOfWeek, { - width: 'abbreviated', - context: 'formatting' - }); - // T +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInCalendarISOWeeks; +var _index = _interopRequireDefault(__nccwpck_require__(7032)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6307)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_WEEK = 604800000; - case 'EEEEE': - return localize.day(dayOfWeek, { - width: 'narrow', - context: 'formatting' - }); - // Tu +/** + * @name differenceInCalendarISOWeeks + * @category ISO Week Helpers + * @summary Get the number of calendar ISO weeks between the given dates. + * + * @description + * Get the number of calendar ISO weeks between the given dates. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar ISO weeks + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014? + * const result = differenceInCalendarISOWeeks( + * new Date(2014, 6, 21), + * new Date(2014, 6, 6) + * ) + * //=> 3 + */ +function differenceInCalendarISOWeeks(dirtyDateLeft, dirtyDateRight) { + (0, _index3.default)(2, arguments); + var startOfISOWeekLeft = (0, _index2.default)(dirtyDateLeft); + var startOfISOWeekRight = (0, _index2.default)(dirtyDateRight); + var timestampLeft = startOfISOWeekLeft.getTime() - (0, _index.default)(startOfISOWeekLeft); + var timestampRight = startOfISOWeekRight.getTime() - (0, _index.default)(startOfISOWeekRight); - case 'EEEEEE': - return localize.day(dayOfWeek, { - width: 'short', - context: 'formatting' - }); - // Tuesday + // 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((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK); +} +module.exports = exports.default; - case 'EEEE': - default: - return localize.day(dayOfWeek, { - width: 'wide', - context: 'formatting' - }); - } - }, - // Local day of week - e: function (date, token, localize, options) { - var dayOfWeek = date.getUTCDay(); - var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; +/***/ }), - switch (token) { - // Numerical value (Nth day of week with current locale or weekStartsOn) - case 'e': - return String(localDayOfWeek); - // Padded numerical value +/***/ 5536: +/***/ ((module, exports, __nccwpck_require__) => { - case 'ee': - return (0, _index7.default)(localDayOfWeek, 2); - // 1st, 2nd, ..., 7th +"use strict"; - case 'eo': - return localize.ordinalNumber(localDayOfWeek, { - unit: 'day' - }); - case 'eee': - return localize.day(dayOfWeek, { - width: 'abbreviated', - context: 'formatting' - }); - // T +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInCalendarMonths; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name differenceInCalendarMonths + * @category Month Helpers + * @summary Get the number of calendar months between the given dates. + * + * @description + * Get the number of calendar months between the given dates. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar months + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar months are between 31 January 2014 and 1 September 2014? + * const result = differenceInCalendarMonths( + * new Date(2014, 8, 1), + * new Date(2014, 0, 31) + * ) + * //=> 8 + */ +function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear(); + var monthDiff = dateLeft.getMonth() - dateRight.getMonth(); + return yearDiff * 12 + monthDiff; +} +module.exports = exports.default; - case 'eeeee': - return localize.day(dayOfWeek, { - width: 'narrow', - context: 'formatting' - }); - // Tu +/***/ }), - case 'eeeeee': - return localize.day(dayOfWeek, { - width: 'short', - context: 'formatting' - }); - // Tuesday +/***/ 2342: +/***/ ((module, exports, __nccwpck_require__) => { - case 'eeee': - default: - return localize.day(dayOfWeek, { - width: 'wide', - context: 'formatting' - }); - } - }, - // Stand-alone local day of week - c: function (date, token, localize, options) { - var dayOfWeek = date.getUTCDay(); - var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; +"use strict"; - switch (token) { - // Numerical value (same as in `e`) - case 'c': - return String(localDayOfWeek); - // Padded numerical value - case 'cc': - return (0, _index7.default)(localDayOfWeek, token.length); - // 1st, 2nd, ..., 7th +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInCalendarQuarters; +var _index = _interopRequireDefault(__nccwpck_require__(4523)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name differenceInCalendarQuarters + * @category Quarter Helpers + * @summary Get the number of calendar quarters between the given dates. + * + * @description + * Get the number of calendar quarters between the given dates. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar quarters + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar quarters are between 31 December 2013 and 2 July 2014? + * const result = differenceInCalendarQuarters( + * new Date(2014, 6, 2), + * new Date(2013, 11, 31) + * ) + * //=> 3 + */ +function differenceInCalendarQuarters(dirtyDateLeft, dirtyDateRight) { + (0, _index3.default)(2, arguments); + var dateLeft = (0, _index2.default)(dirtyDateLeft); + var dateRight = (0, _index2.default)(dirtyDateRight); + var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear(); + var quarterDiff = (0, _index.default)(dateLeft) - (0, _index.default)(dateRight); + return yearDiff * 4 + quarterDiff; +} +module.exports = exports.default; - case 'co': - return localize.ordinalNumber(localDayOfWeek, { - unit: 'day' - }); +/***/ }), - case 'ccc': - return localize.day(dayOfWeek, { - width: 'abbreviated', - context: 'standalone' - }); - // T +/***/ 8620: +/***/ ((module, exports, __nccwpck_require__) => { - case 'ccccc': - return localize.day(dayOfWeek, { - width: 'narrow', - context: 'standalone' - }); - // Tu +"use strict"; - case 'cccccc': - return localize.day(dayOfWeek, { - width: 'short', - context: 'standalone' - }); - // Tuesday - case 'cccc': - default: - return localize.day(dayOfWeek, { - width: 'wide', - context: 'standalone' - }); - } - }, - // ISO day of week - i: function (date, token, localize) { - var dayOfWeek = date.getUTCDay(); - var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInCalendarWeeks; +var _index = _interopRequireDefault(__nccwpck_require__(9813)); +var _index2 = _interopRequireDefault(__nccwpck_require__(7032)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_WEEK = 604800000; - switch (token) { - // 2 - case 'i': - return String(isoDayOfWeek); - // 02 - - case 'ii': - return (0, _index7.default)(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, { - width: 'wide', - context: 'formatting' - }); - } - }, - // AM or PM - a: function (date, token, localize) { - var hours = date.getUTCHours(); - var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'; - - switch (token) { - case 'a': - case 'aa': - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'abbreviated', - context: 'formatting' - }); - - case 'aaa': - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'abbreviated', - context: 'formatting' - }).toLowerCase(); - - case 'aaaaa': - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'narrow', - context: 'formatting' - }); - - case 'aaaa': - default: - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'wide', - context: 'formatting' - }); - } - }, - // AM, PM, midnight, noon - b: function (date, token, localize) { - var hours = date.getUTCHours(); - var dayPeriodEnumValue; - - if (hours === 12) { - dayPeriodEnumValue = dayPeriodEnum.noon; - } else if (hours === 0) { - dayPeriodEnumValue = dayPeriodEnum.midnight; - } else { - dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'; - } - - switch (token) { - case 'b': - case 'bb': - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'abbreviated', - context: 'formatting' - }); - - case 'bbb': - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'abbreviated', - context: 'formatting' - }).toLowerCase(); - - case 'bbbbb': - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'narrow', - context: 'formatting' - }); - - case 'bbbb': - default: - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'wide', - context: 'formatting' - }); - } - }, - // in the morning, in the afternoon, in the evening, at night - B: function (date, token, localize) { - var hours = date.getUTCHours(); - var dayPeriodEnumValue; - - if (hours >= 17) { - dayPeriodEnumValue = dayPeriodEnum.evening; - } else if (hours >= 12) { - dayPeriodEnumValue = dayPeriodEnum.afternoon; - } else if (hours >= 4) { - dayPeriodEnumValue = dayPeriodEnum.morning; - } else { - dayPeriodEnumValue = dayPeriodEnum.night; - } - - switch (token) { - case 'B': - case 'BB': - case 'BBB': - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'abbreviated', - context: 'formatting' - }); - - case 'BBBBB': - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'narrow', - context: 'formatting' - }); - - case 'BBBB': - default: - return localize.dayPeriod(dayPeriodEnumValue, { - width: 'wide', - context: 'formatting' - }); - } - }, - // Hour [1-12] - h: function (date, token, localize) { - if (token === 'ho') { - var hours = date.getUTCHours() % 12; - if (hours === 0) hours = 12; - return localize.ordinalNumber(hours, { - unit: 'hour' - }); - } - - return _index.default.h(date, token); - }, - // Hour [0-23] - H: function (date, token, localize) { - if (token === 'Ho') { - return localize.ordinalNumber(date.getUTCHours(), { - unit: 'hour' - }); - } - - return _index.default.H(date, token); - }, - // Hour [0-11] - K: function (date, token, localize) { - var hours = date.getUTCHours() % 12; - - if (token === 'Ko') { - return localize.ordinalNumber(hours, { - unit: 'hour' - }); - } - - return (0, _index7.default)(hours, token.length); - }, - // Hour [1-24] - k: function (date, token, localize) { - var hours = date.getUTCHours(); - if (hours === 0) hours = 24; - - if (token === 'ko') { - return localize.ordinalNumber(hours, { - unit: 'hour' - }); - } - - return (0, _index7.default)(hours, token.length); - }, - // Minute - m: function (date, token, localize) { - if (token === 'mo') { - return localize.ordinalNumber(date.getUTCMinutes(), { - unit: 'minute' - }); - } - - return _index.default.m(date, token); - }, - // Second - s: function (date, token, localize) { - if (token === 'so') { - return localize.ordinalNumber(date.getUTCSeconds(), { - unit: 'second' - }); - } - - return _index.default.s(date, token); - }, - // Fraction of second - S: function (date, token) { - return _index.default.S(date, token); - }, - // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) - X: function (date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timezoneOffset = originalDate.getTimezoneOffset(); - - if (timezoneOffset === 0) { - return 'Z'; - } - - switch (token) { - // 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 +/** + * @name differenceInCalendarWeeks + * @category Week Helpers + * @summary Get the number of calendar weeks between the given dates. + * + * @description + * Get the number of calendar weeks between the given dates. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Number} the number of calendar weeks + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * + * @example + * // How many calendar weeks are between 5 July 2014 and 20 July 2014? + * const result = differenceInCalendarWeeks( + * new Date(2014, 6, 20), + * new Date(2014, 6, 5) + * ) + * //=> 3 + * + * @example + * // If the week starts on Monday, + * // how many calendar weeks are between 5 July 2014 and 20 July 2014? + * const result = differenceInCalendarWeeks( + * new Date(2014, 6, 20), + * new Date(2014, 6, 5), + * { weekStartsOn: 1 } + * ) + * //=> 2 + */ +function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, options) { + (0, _index3.default)(2, arguments); + var startOfWeekLeft = (0, _index.default)(dirtyDateLeft, options); + var startOfWeekRight = (0, _index.default)(dirtyDateRight, options); + var timestampLeft = startOfWeekLeft.getTime() - (0, _index2.default)(startOfWeekLeft); + var timestampRight = startOfWeekRight.getTime() - (0, _index2.default)(startOfWeekRight); - default: - return formatTimezone(timezoneOffset, ':'); - } - }, - // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) - x: function (date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timezoneOffset = originalDate.getTimezoneOffset(); + // 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((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK); +} +module.exports = exports.default; - switch (token) { - // 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` +/***/ 8164: +/***/ ((module, exports, __nccwpck_require__) => { - case 'xxxxx': - case 'xxx': // Hours and minutes with `:` delimiter +"use strict"; - default: - return formatTimezone(timezoneOffset, ':'); - } - }, - // Timezone (GMT) - O: function (date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timezoneOffset = originalDate.getTimezoneOffset(); - switch (token) { - // Short - case 'O': - case 'OO': - case 'OOO': - return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); - // Long +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInCalendarYears; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name differenceInCalendarYears + * @category Year Helpers + * @summary Get the number of calendar years between the given dates. + * + * @description + * Get the number of calendar years between the given dates. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of calendar years + * @throws {TypeError} 2 arguments required + * + * @example + * // How many calendar years are between 31 December 2013 and 11 February 2015? + * const result = differenceInCalendarYears( + * new Date(2015, 1, 11), + * new Date(2013, 11, 31) + * ) + * //=> 2 + */ +function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + return dateLeft.getFullYear() - dateRight.getFullYear(); +} +module.exports = exports.default; - case 'OOOO': - default: - return 'GMT' + formatTimezone(timezoneOffset, ':'); - } - }, - // Timezone (specific non-location) - z: function (date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timezoneOffset = originalDate.getTimezoneOffset(); +/***/ }), - switch (token) { - // Short - case 'z': - case 'zz': - case 'zzz': - return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); - // Long +/***/ 6311: +/***/ ((module, exports, __nccwpck_require__) => { - case 'zzzz': - default: - return 'GMT' + formatTimezone(timezoneOffset, ':'); - } - }, - // Seconds timestamp - t: function (date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timestamp = Math.floor(originalDate.getTime() / 1000); - return (0, _index7.default)(timestamp, token.length); - }, - // Milliseconds timestamp - T: function (date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timestamp = originalDate.getTime(); - return (0, _index7.default)(timestamp, token.length); - } -}; +"use strict"; -function formatTimezoneShort(offset, dirtyDelimiter) { - var sign = offset > 0 ? '-' : '+'; - var absOffset = Math.abs(offset); - var hours = Math.floor(absOffset / 60); - var minutes = absOffset % 60; - if (minutes === 0) { - return sign + String(hours); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInDays; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(3086)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +// Like `compareAsc` but uses local time not UTC, which is needed +// 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 + } else { + return diff; } - - var delimiter = dirtyDelimiter || ''; - return sign + String(hours) + delimiter + (0, _index7.default)(minutes, 2); } -function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) { - if (offset % 60 === 0) { - var sign = offset > 0 ? '-' : '+'; - return sign + (0, _index7.default)(Math.abs(offset) / 60, 2); - } - - return formatTimezone(offset, dirtyDelimiter); -} +/** + * @name differenceInDays + * @category Day Helpers + * @summary Get the number of full days between the given dates. + * + * @description + * Get the number of full day periods between two dates. Fractional days are + * truncated towards zero. + * + * One "full day" is the distance between a local time in one day to the same + * local time on the next or previous day. A full day can sometimes be less than + * or more than 24 hours if a daylight savings change happens between two dates. + * + * To ignore DST and only measure exact 24-hour periods, use this instead: + * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`. + * + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of full days according to the local timezone + * @throws {TypeError} 2 arguments required + * + * @example + * // How many full days are between + * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? + * const result = differenceInDays( + * new Date(2012, 6, 2, 0, 0), + * new Date(2011, 6, 2, 23, 0) + * ) + * //=> 365 + * // How many full days are between + * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? + * const result = differenceInDays( + * new Date(2011, 6, 3, 0, 1), + * new Date(2011, 6, 2, 23, 59) + * ) + * //=> 0 + * // How many full days are between + * // 1 March 2020 0:00 and 1 June 2020 0:00 ? + * // Note: because local time is used, the + * // result will always be 92 days, even in + * // time zones where DST starts and the + * // period has only 92*24-1 hours. + * const result = differenceInDays( + * new Date(2020, 5, 1), + * new Date(2020, 2, 1) + * ) +//=> 92 + */ +function differenceInDays(dirtyDateLeft, dirtyDateRight) { + (0, _index3.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + var sign = compareLocalAsc(dateLeft, dateRight); + var difference = Math.abs((0, _index2.default)(dateLeft, dateRight)); + dateLeft.setDate(dateLeft.getDate() - sign * difference); -function formatTimezone(offset, dirtyDelimiter) { - var delimiter = dirtyDelimiter || ''; - var sign = offset > 0 ? '-' : '+'; - var absOffset = Math.abs(offset); - var hours = (0, _index7.default)(Math.floor(absOffset / 60), 2); - var minutes = (0, _index7.default)(absOffset % 60, 2); - return sign + hours + delimiter + minutes; + // 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 + return result === 0 ? 0 : result; } - -var _default = formatters; -exports.default = _default; module.exports = exports.default; /***/ }), -/* 261 */, -/* 262 */, -/* 263 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8740: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = addMinutes; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(120)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var MILLISECONDS_IN_MINUTE = 60000; +})); +exports["default"] = differenceInHours; +var _index = __nccwpck_require__(5756); +var _index2 = _interopRequireDefault(__nccwpck_require__(2288)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index4 = __nccwpck_require__(8016); /** - * @name addMinutes - * @category Minute Helpers - * @summary Add the specified number of minutes to the given date. + * @name differenceInHours + * @category Hour Helpers + * @summary Get the number of hours between the given dates. * * @description - * Add the specified number of minutes to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Get the number of hours between the given dates. * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of minutes to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the minutes added + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @param {Object} [options] - an object with options. + * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`) + * @returns {Number} the number of hours * @throws {TypeError} 2 arguments required * * @example - * // Add 30 minutes to 10 July 2014 12:00:00: - * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) - * //=> Thu Jul 10 2014 12:30:00 + * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00? + * const result = differenceInHours( + * new Date(2014, 6, 2, 19, 0), + * new Date(2014, 6, 2, 6, 50) + * ) + * //=> 12 */ - -function addMinutes(dirtyDate, dirtyAmount) { +function differenceInHours(dateLeft, dateRight, options) { (0, _index3.default)(2, arguments); - var amount = (0, _index.default)(dirtyAmount); - return (0, _index2.default)(dirtyDate, amount * MILLISECONDS_IN_MINUTE); + var diff = (0, _index2.default)(dateLeft, dateRight) / _index.millisecondsInHour; + return (0, _index4.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff); } - module.exports = exports.default; /***/ }), -/* 264 */ -/***/ (function(module) { + +/***/ 8815: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); - -function unescape(c) { - if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } - - return ESCAPES.get(c) || c; -} - -function parseArguments(name, args) { - const results = []; - const chunks = args.trim().split(/\s*,\s*/g); - let matches; - - for (const chunk of chunks) { - if (!isNaN(chunk)) { - results.push(Number(chunk)); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } - - return results; -} - -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; - - const results = []; - let matches; - - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; - - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInISOWeekYears; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6778)); +var _index3 = _interopRequireDefault(__nccwpck_require__(9818)); +var _index4 = _interopRequireDefault(__nccwpck_require__(3925)); +var _index5 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name differenceInISOWeekYears + * @category ISO Week-Numbering Year Helpers + * @summary Get the number of full ISO week-numbering years between the given dates. + * + * @description + * Get the number of full ISO week-numbering years between the given dates. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of full ISO week-numbering years + * @throws {TypeError} 2 arguments required + * + * @example + * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012? + * const result = differenceInISOWeekYears( + * new Date(2012, 0, 1), + * new Date(2010, 0, 1) + * ) + * //=> 1 + */ +function differenceInISOWeekYears(dirtyDateLeft, dirtyDateRight) { + (0, _index5.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + var sign = (0, _index3.default)(dateLeft, dateRight); + var difference = Math.abs((0, _index2.default)(dateLeft, dateRight)); + dateLeft = (0, _index4.default)(dateLeft, sign * difference); - return results; + // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1 + // if last calendar ISO year is not full + // If so, result must be decreased by 1 in absolute value + var isLastISOWeekYearNotFull = Number((0, _index3.default)(dateLeft, dateRight) === -sign); + var result = sign * (difference - isLastISOWeekYearNotFull); + // Prevent negative zero + return result === 0 ? 0 : result; } +module.exports = exports.default; -function buildStyle(chalk, styles) { - const enabled = {}; +/***/ }), - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } +/***/ 2288: +/***/ ((module, exports, __nccwpck_require__) => { - let current = chalk; - for (const styleName of Object.keys(enabled)) { - if (Array.isArray(enabled[styleName])) { - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } +"use strict"; - if (enabled[styleName].length > 0) { - current = current[styleName].apply(current, enabled[styleName]); - } else { - current = current[styleName]; - } - } - } - return current; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = differenceInMilliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name differenceInMilliseconds + * @category Millisecond Helpers + * @summary Get the number of milliseconds between the given dates. + * + * @description + * Get the number of milliseconds between the given dates. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of milliseconds + * @throws {TypeError} 2 arguments required + * + * @example + * // How many milliseconds are between + * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700? + * const result = differenceInMilliseconds( + * new Date(2014, 6, 2, 12, 30, 21, 700), + * new Date(2014, 6, 2, 12, 30, 20, 600) + * ) + * //=> 1100 + */ +function differenceInMilliseconds(dateLeft, dateRight) { + (0, _index2.default)(2, arguments); + return (0, _index.default)(dateLeft).getTime() - (0, _index.default)(dateRight).getTime(); } - -module.exports = (chalk, tmp) => { - const styles = []; - const chunks = []; - let chunk = []; - - // eslint-disable-next-line max-params - tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { - if (escapeChar) { - chunk.push(unescape(escapeChar)); - } else if (style) { - const str = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } - - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(chr); - } - }); - - chunks.push(chunk.join('')); - - if (styles.length > 0) { - const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMsg); - } - - return chunks.join(''); -}; - +module.exports = exports.default; /***/ }), -/* 265 */, -/* 266 */, -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3842: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = nextSunday; - -var _index = _interopRequireDefault(__webpack_require__(217)); - -var _index2 = _interopRequireDefault(__webpack_require__(940)); - -var _index3 = _interopRequireDefault(__webpack_require__(773)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = differenceInMinutes; +var _index = __nccwpck_require__(5756); +var _index2 = _interopRequireDefault(__nccwpck_require__(2288)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index4 = __nccwpck_require__(8016); /** - * @name nextSunday - * @category Weekday Helpers - * @summary When is the next Sunday? + * @name differenceInMinutes + * @category Minute Helpers + * @summary Get the number of minutes between the given dates. * * @description - * When is the next Sunday? + * Get the signed number of full (rounded towards 0) minutes between the given dates. * - * @param {Date | number} date - the date to start counting from - * @returns {Date} the next Sunday - * @throws {TypeError} 1 argument required + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @param {Object} [options] - an object with options. + * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`) + * @returns {Number} the number of minutes + * @throws {TypeError} 2 arguments required * * @example - * // When is the next Sunday after Mar, 22, 2020? - * const result = nextSunday(new Date(2020, 2, 22)) - * //=> Sun Mar 29 2020 00:00:00 + * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00? + * const result = differenceInMinutes( + * new Date(2014, 6, 2, 12, 20, 0), + * new Date(2014, 6, 2, 12, 7, 59) + * ) + * //=> 12 + * + * @example + * // How many minutes are between 10:01:59 and 10:00:00 + * const result = differenceInMinutes( + * new Date(2000, 0, 1, 10, 0, 0), + * new Date(2000, 0, 1, 10, 1, 59) + * ) + * //=> -1 */ -function nextSunday(date) { - (0, _index.default)(1, arguments); - return (0, _index2.default)((0, _index3.default)(date), 0); +function differenceInMinutes(dateLeft, dateRight, options) { + (0, _index3.default)(2, arguments); + var diff = (0, _index2.default)(dateLeft, dateRight) / _index.millisecondsInMinute; + return (0, _index4.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff); } - module.exports = exports.default; /***/ }), -/* 268 */, -/* 269 */, -/* 270 */ -/***/ (function(__unusedmodule, exports) { + +/***/ 2713: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.cacheWrapper = cacheWrapper; -exports.cacheWrapperSync = cacheWrapperSync; - -async function cacheWrapper(cache, key, fn) { - const cached = cache.get(key); - - if (cached !== undefined) { - return cached; - } +})); +exports["default"] = differenceInMonths; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(5536)); +var _index3 = _interopRequireDefault(__nccwpck_require__(9818)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index5 = _interopRequireDefault(__nccwpck_require__(8506)); +/** + * @name differenceInMonths + * @category Month Helpers + * @summary Get the number of full months between the given dates. + * + * @description + * Get the number of full months between the given dates using trunc as a default rounding method. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of full months + * @throws {TypeError} 2 arguments required + * + * @example + * // How many full months are between 31 January 2014 and 1 September 2014? + * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31)) + * //=> 7 + */ +function differenceInMonths(dirtyDateLeft, dirtyDateRight) { + (0, _index4.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + var sign = (0, _index3.default)(dateLeft, dateRight); + var difference = Math.abs((0, _index2.default)(dateLeft, dateRight)); + var result; - const result = await fn(); - cache.set(key, result); - return result; -} + // Check for the difference of less than month + if (difference < 1) { + result = 0; + } else { + if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) { + // This will check if the date is end of Feb and assign a higher end of month date + // to compare it with Jan + dateLeft.setDate(30); + } + dateLeft.setMonth(dateLeft.getMonth() - sign * difference); -function cacheWrapperSync(cache, key, fn) { - const cached = cache.get(key); + // 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 = (0, _index3.default)(dateLeft, dateRight) === -sign; - if (cached !== undefined) { - return cached; + // Check for cases of one full calendar month + if ((0, _index5.default)((0, _index.default)(dirtyDateLeft)) && difference === 1 && (0, _index3.default)(dirtyDateLeft, dateRight) === 1) { + isLastMonthNotFull = false; + } + result = sign * (difference - Number(isLastMonthNotFull)); } - const result = fn(); - cache.set(key, result); - return result; + // Prevent negative zero + return result === 0 ? 0 : result; } -//# sourceMappingURL=cacheWrapper.js.map +module.exports = exports.default; /***/ }), -/* 271 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7074: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isLastDayOfMonth; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(956)); - -var _index3 = _interopRequireDefault(__webpack_require__(174)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = differenceInQuarters; +var _index = _interopRequireDefault(__nccwpck_require__(2713)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = __nccwpck_require__(8016); /** - * @name isLastDayOfMonth - * @category Month Helpers - * @summary Is the given date the last day of a month? + * @name differenceInQuarters + * @category Quarter Helpers + * @summary Get the number of quarters between the given dates. * * @description - * Is the given date the last day of a month? - * - * ### v2.0.0 breaking changes: + * Get the number of quarters between the given dates. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is the last day of a month - * @throws {TypeError} 1 argument required + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @param {Object} [options] - an object with options. + * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`) + * @returns {Number} the number of full quarters + * @throws {TypeError} 2 arguments required * * @example - * // Is 28 February 2014 the last day of a month? - * var result = isLastDayOfMonth(new Date(2014, 1, 28)) - * //=> true + * // How many full quarters are between 31 December 2013 and 2 July 2014? + * const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31)) + * //=> 2 */ -function isLastDayOfMonth(dirtyDate) { - (0, _index4.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - return (0, _index2.default)(date).getTime() === (0, _index3.default)(date).getTime(); +function differenceInQuarters(dateLeft, dateRight, options) { + (0, _index2.default)(2, arguments); + var diff = (0, _index.default)(dateLeft, dateRight) / 3; + return (0, _index3.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff); } - module.exports = exports.default; /***/ }), -/* 272 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 9448: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = nextMonday; - -var _index = _interopRequireDefault(__webpack_require__(217)); - -var _index2 = _interopRequireDefault(__webpack_require__(940)); - -var _index3 = _interopRequireDefault(__webpack_require__(773)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = differenceInSeconds; +var _index = _interopRequireDefault(__nccwpck_require__(2288)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = __nccwpck_require__(8016); /** - * @name nextMonday - * @category Weekday Helpers - * @summary When is the next Monday? + * @name differenceInSeconds + * @category Second Helpers + * @summary Get the number of seconds between the given dates. * * @description - * When is the next Monday? + * Get the number of seconds between the given dates. * - * @param {Date | number} date - the date to start counting from - * @returns {Date} the next Monday - * @throws {TypeError} 1 argument required + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @param {Object} [options] - an object with options. + * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`) + * @returns {Number} the number of seconds + * @throws {TypeError} 2 arguments required * * @example - * // When is the next Monday after Mar, 22, 2020? - * const result = nextMonday(new Date(2020, 2, 22)) - * //=> Mon Mar 23 2020 00:00:00 + * // How many seconds are between + * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000? + * const result = differenceInSeconds( + * new Date(2014, 6, 2, 12, 30, 20, 0), + * new Date(2014, 6, 2, 12, 30, 7, 999) + * ) + * //=> 12 */ -function nextMonday(date) { - (0, _index.default)(1, arguments); - return (0, _index2.default)((0, _index3.default)(date), 1); +function differenceInSeconds(dateLeft, dateRight, options) { + (0, _index2.default)(2, arguments); + var diff = (0, _index.default)(dateLeft, dateRight) / 1000; + return (0, _index3.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff); } - module.exports = exports.default; /***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2701: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isMonday; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = differenceInWeeks; +var _index = _interopRequireDefault(__nccwpck_require__(6311)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = __nccwpck_require__(8016); /** - * @name isMonday - * @category Weekday Helpers - * @summary Is the given date Monday? + * @name differenceInWeeks + * @category Week Helpers + * @summary Get the number of full weeks between the given dates. * * @description - * Is the given date Monday? + * Get the number of full weeks between two dates. Fractional weeks are + * truncated towards zero by default. + * + * One "full week" is the distance between a local time in one day to the same + * local time 7 days earlier or later. A full week can sometimes be less than + * or more than 7*24 hours if a daylight savings change happens between two dates. * - * ### v2.0.0 breaking changes: + * To ignore DST and only measure exact 7*24-hour periods, use this instead: + * `Math.floor(differenceInHours(dateLeft, dateRight)/(7*24))|0`. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is Monday - * @throws {TypeError} 1 argument required + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @param {Object} [options] - an object with options. + * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`) + * @returns {Number} the number of full weeks + * @throws {TypeError} 2 arguments required * * @example - * // Is 22 September 2014 Monday? - * var result = isMonday(new Date(2014, 8, 22)) - * //=> true + * // How many full weeks are between 5 July 2014 and 20 July 2014? + * const result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5)) + * //=> 2 + * + * // How many full weeks are between + * // 1 March 2020 0:00 and 6 June 2020 0:00 ? + * // Note: because local time is used, the + * // result will always be 8 weeks (54 days), + * // even if DST starts and the period has + * // only 54*24-1 hours. + * const result = differenceInWeeks( + * new Date(2020, 5, 1), + * new Date(2020, 2, 6) + * ) + * //=> 8 */ -function isMonday(date) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(date).getDay() === 1; +function differenceInWeeks(dateLeft, dateRight, options) { + (0, _index2.default)(2, arguments); + var diff = (0, _index.default)(dateLeft, dateRight) / 7; + return (0, _index3.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff); } - module.exports = exports.default; /***/ }), -/* 274 */, -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3959: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = void 0; - -var _index = _interopRequireDefault(__webpack_require__(122)); - -var _index2 = _interopRequireDefault(__webpack_require__(720)); - -var _index3 = _interopRequireDefault(__webpack_require__(634)); - -var _index4 = _interopRequireDefault(__webpack_require__(836)); - -var _index5 = _interopRequireDefault(__webpack_require__(30)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = differenceInYears; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8164)); +var _index3 = _interopRequireDefault(__nccwpck_require__(9818)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @type {Locale} - * @category Locales - * @summary English locale (United States). - * @language English - * @iso-639-2 eng - * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp} - * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss} + * @name differenceInYears + * @category Year Helpers + * @summary Get the number of full years between the given dates. + * + * @description + * Get the number of full years between the given dates. + * + * @param {Date|Number} dateLeft - the later date + * @param {Date|Number} dateRight - the earlier date + * @returns {Number} the number of full years + * @throws {TypeError} 2 arguments required + * + * @example + * // How many full years are between 31 December 2013 and 11 February 2015? + * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) + * //=> 1 */ -var locale = { - code: 'en-US', - formatDistance: _index.default, - formatLong: _index2.default, - formatRelative: _index3.default, - localize: _index4.default, - match: _index5.default, - options: { - weekStartsOn: 0 - /* Sunday */ - , - firstWeekContainsDate: 1 - } -}; -var _default = locale; -exports.default = _default; +function differenceInYears(dirtyDateLeft, dirtyDateRight) { + (0, _index4.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + var sign = (0, _index3.default)(dateLeft, dateRight); + var difference = Math.abs((0, _index2.default)(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 + var isLastYearNotFull = (0, _index3.default)(dateLeft, dateRight) === -sign; + var result = sign * (difference - Number(isLastYearNotFull)); + // Prevent negative zero + return result === 0 ? 0 : result; +} module.exports = exports.default; /***/ }), -/* 276 */, -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6545: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = lastDayOfDecade; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = eachDayOfInterval; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name lastDayOfDecade - * @category Decade Helpers - * @summary Return the last day of a decade for the given date. + * @name eachDayOfInterval + * @category Interval Helpers + * @summary Return the array of dates within the specified time interval. * * @description - * Return the last day of a decade for the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Return the array of dates within the specified time interval. * - * @param {Date|Number} date - the original date - * @returns {Date} the last day of a decade + * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} + * @param {Object} [options] - an object with options. + * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1. + * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.step` must be a number greater than 1 + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * // The last day of a decade for 21 December 2012 21:12:00: - * var result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00)) - * //=> Wed Dec 31 2019 00:00:00 + * // Each day between 6 October 2014 and 10 October 2014: + * const result = eachDayOfInterval({ + * start: new Date(2014, 9, 6), + * end: new Date(2014, 9, 10) + * }) + * //=> [ + * // Mon Oct 06 2014 00:00:00, + * // Tue Oct 07 2014 00:00:00, + * // Wed Oct 08 2014 00:00:00, + * // Thu Oct 09 2014 00:00:00, + * // Fri Oct 10 2014 00:00:00 + * // ] */ -function lastDayOfDecade(dirtyDate) { +function eachDayOfInterval(dirtyInterval, options) { + var _options$step; (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var year = date.getFullYear(); - var decade = 9 + Math.floor(year / 10) * 10; - date.setFullYear(decade + 1, 0, 0); - date.setHours(0, 0, 0, 0); - return date; -} - -module.exports = exports.default; + var interval = dirtyInterval || {}; + var startDate = (0, _index.default)(interval.start); + var endDate = (0, _index.default)(interval.end); + var endTime = endDate.getTime(); + + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(startDate.getTime() <= endTime)) { + throw new RangeError('Invalid interval'); + } + var dates = []; + var currentDate = startDate; + currentDate.setHours(0, 0, 0, 0); + var step = Number((_options$step = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step !== void 0 ? _options$step : 1); + if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1'); + while (currentDate.getTime() <= endTime) { + dates.push((0, _index.default)(currentDate)); + currentDate.setDate(currentDate.getDate() + step); + currentDate.setHours(0, 0, 0, 0); + } + return dates; +} +module.exports = exports.default; /***/ }), -/* 278 */, -/* 279 */, -/* 280 */, -/* 281 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6802: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = setUTCISODay; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(773)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// This function will be a part of public API when UTC function will be implemented. -// See issue: https://github.com/date-fns/date-fns/issues/376 -function setUTCISODay(dirtyDate, dirtyDay) { - (0, _index3.default)(2, arguments); - var day = (0, _index.default)(dirtyDay); +})); +exports["default"] = eachHourOfInterval; +var _index = _interopRequireDefault(__nccwpck_require__(9956)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name eachHourOfInterval + * @category Interval Helpers + * @summary Return the array of hours within the specified time interval. + * + * @description + * Return the array of hours within the specified time interval. + * + * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} + * @param {Object} [options] - an object with options. + * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1. + * @returns {Date[]} the array with starts of hours from the hour of the interval start to the hour of the interval end + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.step` must be a number greater than 1 + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` + * + * @example + * // Each hour between 6 October 2014, 12:00 and 6 October 2014, 15:00 + * const result = eachHourOfInterval({ + * start: new Date(2014, 9, 6, 12), + * end: new Date(2014, 9, 6, 15) + * }) + * //=> [ + * // Mon Oct 06 2014 12:00:00, + * // Mon Oct 06 2014 13:00:00, + * // Mon Oct 06 2014 14:00:00, + * // Mon Oct 06 2014 15:00:00 + * // ] + */ +function eachHourOfInterval(dirtyInterval, options) { + var _options$step; + (0, _index3.default)(1, arguments); + var interval = dirtyInterval || {}; + var startDate = (0, _index2.default)(interval.start); + var endDate = (0, _index2.default)(interval.end); + var startTime = startDate.getTime(); + var endTime = endDate.getTime(); - if (day % 7 === 0) { - day = day - 7; + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(startTime <= endTime)) { + throw new RangeError('Invalid interval'); } - - var weekStartsOn = 1; - var date = (0, _index2.default)(dirtyDate); - var currentDay = date.getUTCDay(); - var remainder = day % 7; - var dayIndex = (remainder + 7) % 7; - var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; - date.setUTCDate(date.getUTCDate() + diff); - return date; + var dates = []; + var currentDate = startDate; + currentDate.setMinutes(0, 0, 0); + var step = Number((_options$step = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step !== void 0 ? _options$step : 1); + if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1'); + while (currentDate.getTime() <= endTime) { + dates.push((0, _index2.default)(currentDate)); + currentDate = (0, _index.default)(currentDate, step); + } + return dates; } - module.exports = exports.default; /***/ }), -/* 282 */ -/***/ (function(module) { - -module.exports = require("module"); -/***/ }), -/* 283 */, -/* 284 */, -/* 285 */, -/* 286 */ -/***/ (function(__unusedmodule, exports) { +/***/ 2029: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.metrics = void 0; -exports.metrics = [ - "drift", - "pulse", - "releases", - "major", - "minor", - "patch", -]; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = eachMinuteOfInterval; +var _index = _interopRequireDefault(__nccwpck_require__(5268)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(8567)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name eachMinuteOfInterval + * @category Interval Helpers + * @summary Return the array of minutes within the specified time interval. + * + * @description + * Returns the array of minutes within the specified time interval. + * + * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} + * @param {Object} [options] - an object with options. + * @param {Number} [options.step=1] - the step to increment by. The step must be equal to or greater than 1 + * @throws {TypeError} 1 argument required + * @returns {Date[]} the array with starts of minutes from the minute of the interval start to the minute of the interval end + * @throws {RangeError} `options.step` must be a number equal to or greater than 1 + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` + * + * @example + * // Each minute between 14 October 2020, 13:00 and 14 October 2020, 13:03 + * const result = eachMinuteOfInterval({ + * start: new Date(2014, 9, 14, 13), + * end: new Date(2014, 9, 14, 13, 3) + * }) + * //=> [ + * // Wed Oct 14 2014 13:00:00, + * // Wed Oct 14 2014 13:01:00, + * // Wed Oct 14 2014 13:02:00, + * // Wed Oct 14 2014 13:03:00 + * // ] + */ +function eachMinuteOfInterval(interval, options) { + var _options$step; + (0, _index4.default)(1, arguments); + var startDate = (0, _index3.default)((0, _index2.default)(interval.start)); + var endDate = (0, _index2.default)(interval.end); + var startTime = startDate.getTime(); + var endTime = endDate.getTime(); + if (startTime >= endTime) { + throw new RangeError('Invalid interval'); + } + var dates = []; + var currentDate = startDate; + var step = Number((_options$step = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step !== void 0 ? _options$step : 1); + if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number equal to or greater than 1'); + while (currentDate.getTime() <= endTime) { + dates.push((0, _index2.default)(currentDate)); + currentDate = (0, _index.default)(currentDate, step); + } + return dates; +} +module.exports = exports.default; /***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5879: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = lightFormat; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(682)); - -var _index3 = _interopRequireDefault(__webpack_require__(151)); - -var _index4 = _interopRequireDefault(__webpack_require__(909)); - -var _index5 = _interopRequireDefault(__webpack_require__(564)); - -var _index6 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// This RegExp consists of three parts separated by `|`: -// - (\w)\1* matches any sequences of the same letter -// - '' matches two quote characters in a row -// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), -// except a single quote symbol, which ends the sequence. -// Two quote characters do not end the sequence. -// 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 = /(\w)\1*|''|'(''|[^'])+('|$)|./g; -var escapedStringRegExp = /^'([^]*?)'?$/; -var doubleQuoteRegExp = /''/g; -var unescapedLatinCharacterRegExp = /[a-zA-Z]/; +})); +exports["default"] = eachMonthOfInterval; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name lightFormat - * @category Common Helpers - * @summary Format the date. + * @name eachMonthOfInterval + * @category Interval Helpers + * @summary Return the array of months within the specified time interval. * * @description - * Return the formatted date string in the given format. Unlike `format`, - * `lightFormat` doesn't use locales and outputs date using the most popular tokens. - * - * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries. - * > See: https://git.io/fxCyr - * - * The characters wrapped between two single quotes characters (') are escaped. - * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. - * - * Format of the string is based on Unicode Technical Standard #35: - * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * - * Accepted patterns: - * | Unit | Pattern | Result examples | - * |---------------------------------|---------|-----------------------------------| - * | AM, PM | a..aaa | AM, PM | - * | | aaaa | a.m., p.m. | - * | | aaaaa | a, p | - * | Calendar year | y | 44, 1, 1900, 2017 | - * | | yy | 44, 01, 00, 17 | - * | | yyy | 044, 001, 000, 017 | - * | | yyyy | 0044, 0001, 1900, 2017 | - * | Month (formatting) | M | 1, 2, ..., 12 | - * | | MM | 01, 02, ..., 12 | - * | Day of month | d | 1, 2, ..., 31 | - * | | dd | 01, 02, ..., 31 | - * | Hour [1-12] | h | 1, 2, ..., 11, 12 | - * | | hh | 01, 02, ..., 11, 12 | - * | Hour [0-23] | H | 0, 1, 2, ..., 23 | - * | | HH | 00, 01, 02, ..., 23 | - * | Minute | m | 0, 1, ..., 59 | - * | | mm | 00, 01, ..., 59 | - * | Second | s | 0, 1, ..., 59 | - * | | ss | 00, 01, ..., 59 | - * | Fraction of second | S | 0, 1, ..., 9 | - * | | SS | 00, 01, ..., 99 | - * | | SSS | 000, 0001, ..., 999 | - * | | SSSS | ... | + * Return the array of months within the specified time interval. * - * @param {Date|Number} date - the original date - * @param {String} format - the string of tokens - * @returns {String} the formatted date string - * @throws {TypeError} 2 arguments required - * @throws {RangeError} format string contains an unescaped latin alphabet character + * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} + * @returns {Date[]} the array with starts of months from the month of the interval start to the month of the interval end + * @throws {TypeError} 1 argument required + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd') - * //=> '2014-02-11' + * // Each month between 6 February 2014 and 10 August 2014: + * const result = eachMonthOfInterval({ + * start: new Date(2014, 1, 6), + * end: new Date(2014, 7, 10) + * }) + * //=> [ + * // Sat Feb 01 2014 00:00:00, + * // Sat Mar 01 2014 00:00:00, + * // Tue Apr 01 2014 00:00:00, + * // Thu May 01 2014 00:00:00, + * // Sun Jun 01 2014 00:00:00, + * // Tue Jul 01 2014 00:00:00, + * // Fri Aug 01 2014 00:00:00 + * // ] */ +function eachMonthOfInterval(dirtyInterval) { + (0, _index2.default)(1, arguments); + var interval = dirtyInterval || {}; + var startDate = (0, _index.default)(interval.start); + var endDate = (0, _index.default)(interval.end); + var endTime = endDate.getTime(); + var dates = []; -function lightFormat(dirtyDate, formatStr) { - (0, _index6.default)(2, arguments); - var originalDate = (0, _index.default)(dirtyDate); - - if (!(0, _index4.default)(originalDate)) { - throw new RangeError('Invalid time value'); - } // 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 = (0, _index3.default)(originalDate); - var utcDate = (0, _index5.default)(originalDate, timezoneOffset); - var tokens = formatStr.match(formattingTokensRegExp); // The only case when formattingTokensRegExp doesn't match the string is when it's empty - - if (!tokens) return ''; - var result = tokens.map(function (substring) { - // Replace two single quote characters with one single quote character - if (substring === "''") { - return "'"; - } - - var firstCharacter = substring[0]; - - if (firstCharacter === "'") { - return cleanEscapedString(substring); - } - - var formatter = _index2.default[firstCharacter]; - - if (formatter) { - return formatter(utcDate, substring); - } - - if (firstCharacter.match(unescapedLatinCharacterRegExp)) { - throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); - } - - return substring; - }).join(''); - return result; -} - -function cleanEscapedString(input) { - var matches = input.match(escapedStringRegExp); - - if (!matches) { - return input; + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(startDate.getTime() <= endTime)) { + throw new RangeError('Invalid interval'); } - - return matches[1].replace(doubleQuoteRegExp, "'"); + var currentDate = startDate; + currentDate.setHours(0, 0, 0, 0); + currentDate.setDate(1); + while (currentDate.getTime() <= endTime) { + dates.push((0, _index.default)(currentDate)); + currentDate.setMonth(currentDate.getMonth() + 1); + } + return dates; } - module.exports = exports.default; /***/ }), -/* 288 */, -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6516: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = formatRFC7231; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(909)); - -var _index3 = _interopRequireDefault(__webpack_require__(488)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +})); +exports["default"] = eachQuarterOfInterval; +var _index = _interopRequireDefault(__nccwpck_require__(5149)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2932)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name formatRFC7231 - * @category Common Helpers - * @summary Format the date according to the RFC 7231 standard (https://tools.ietf.org/html/rfc7231#section-7.1.1.1). + * @name eachQuarterOfInterval + * @category Interval Helpers + * @summary Return the array of quarters within the specified time interval. * * @description - * Return the formatted date string in RFC 7231 format. - * The result will always be in UTC timezone. + * Return the array of quarters within the specified time interval. * - * @param {Date|Number} date - the original date - * @returns {String} the formatted date string + * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} + * @returns {Date[]} the array with starts of quarters from the quarter of the interval start to the quarter of the interval end * @throws {TypeError} 1 argument required - * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * // Represent 18 September 2019 in RFC 7231 format: - * const result = formatRFC7231(new Date(2019, 8, 18, 19, 0, 52)) - * //=> 'Wed, 18 Sep 2019 19:00:52 GMT' + * // Each quarter within interval 6 February 2014 - 10 August 2014: + * const result = eachQuarterOfInterval({ + * start: new Date(2014, 1, 6), + * end: new Date(2014, 7, 10) + * }) + * //=> [ + * // Wed Jan 01 2014 00:00:00, + * // Tue Apr 01 2014 00:00:00, + * // Tue Jul 01 2014 00:00:00, + * // ] */ +function eachQuarterOfInterval(dirtyInterval) { + (0, _index4.default)(1, arguments); + var interval = dirtyInterval || {}; + var startDate = (0, _index3.default)(interval.start); + var endDate = (0, _index3.default)(interval.end); + var endTime = endDate.getTime(); -function formatRFC7231(dirtyDate) { - if (arguments.length < 1) { - throw new TypeError("1 arguments required, but only ".concat(arguments.length, " present")); + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(startDate.getTime() <= endTime)) { + throw new RangeError('Invalid interval'); } - - var originalDate = (0, _index.default)(dirtyDate); - - if (!(0, _index2.default)(originalDate)) { - throw new RangeError('Invalid time value'); + var startDateQuarter = (0, _index2.default)(startDate); + var endDateQuarter = (0, _index2.default)(endDate); + endTime = endDateQuarter.getTime(); + var quarters = []; + var currentQuarter = startDateQuarter; + while (currentQuarter.getTime() <= endTime) { + quarters.push((0, _index3.default)(currentQuarter)); + currentQuarter = (0, _index.default)(currentQuarter, 1); } - - var dayName = days[originalDate.getUTCDay()]; - var dayOfMonth = (0, _index3.default)(originalDate.getUTCDate(), 2); - var monthName = months[originalDate.getUTCMonth()]; - var year = originalDate.getUTCFullYear(); - var hour = (0, _index3.default)(originalDate.getUTCHours(), 2); - var minute = (0, _index3.default)(originalDate.getUTCMinutes(), 2); - var second = (0, _index3.default)(originalDate.getUTCSeconds(), 2); // Result variables. - - return "".concat(dayName, ", ").concat(dayOfMonth, " ").concat(monthName, " ").concat(year, " ").concat(hour, ":").concat(minute, ":").concat(second, " GMT"); + return quarters; } - module.exports = exports.default; /***/ }), -/* 290 */, -/* 291 */, -/* 292 */ -/***/ (function(module) { - -module.exports = require("util"); - -/***/ }), -/* 293 */ -/***/ (function(module) { - -module.exports = require("buffer"); - -/***/ }), -/* 294 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.libyear = void 0; -const semver_1 = __webpack_require__(89); -const dates_1 = __webpack_require__(20); -const dependencies_1 = __webpack_require__(568); -const release_time_1 = __webpack_require__(524); -const versions_1 = __webpack_require__(982); -const libyear = async (packageManager, flags) => { - const awaitedDependencies = Array.from((await dependencies_1.getDependencies(packageManager, flags)).entries()).map(async ([dependency, currentVersion]) => { - var _a, _b; - const releaseTimeObj = (_a = (await release_time_1.getReleaseTime(packageManager, dependency))) !== null && _a !== void 0 ? _a : {}; - const releaseTimeMap = new Map(Object.entries(releaseTimeObj)); - const allVersionsMap = versions_1.getSanitisedReleases(releaseTimeMap); - const stableVersionsMap = versions_1.getStableReleases(allVersionsMap); - const allVersions = Array.from(allVersionsMap.keys()); - const stableVersions = Array.from(stableVersionsMap.keys()); - const latestAllVersion = semver_1.sort(allVersions).slice(-1)[0]; - const latestStableVersion = semver_1.sort(stableVersions).slice(-1)[0]; - const diffAllVersions = allVersions.slice(allVersions.findIndex((version) => version === currentVersion) + 1, allVersions.findIndex((version) => version === latestStableVersion) + 1); - const diffStableVersions = diffAllVersions.filter((version) => stableVersions.includes(version)); - const drift = dates_1.calculateDrift(allVersionsMap.get(currentVersion), allVersionsMap.get(latestStableVersion)); - const pulse = dates_1.calculatePulse(Array.from(allVersionsMap.values()).sort().slice(-1)[0]); - const releases = diffStableVersions.length; - const major = versions_1.getReleasesByType([currentVersion, ...diffStableVersions], "major").length; - const minor = versions_1.getReleasesByType([currentVersion, ...diffStableVersions], "minor").length; - const patch = versions_1.getReleasesByType([currentVersion, ...diffStableVersions], "patch").length; - const available = (_b = [latestStableVersion, latestAllVersion] - .filter((version) => semver_1.valid(version)) - .find((version) => semver_1.compare(currentVersion, version, { includePrerelease: true }) < 0)) !== null && _b !== void 0 ? _b : "N/A"; - return { - dependency, - drift, - pulse, - releases, - major, - minor, - patch, - available, - }; - }); - return Promise.all(awaitedDependencies); -}; -exports.libyear = libyear; - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 5994: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInCalendarWeeks; - -var _index = _interopRequireDefault(__webpack_require__(343)); - -var _index2 = _interopRequireDefault(__webpack_require__(151)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var MILLISECONDS_IN_WEEK = 604800000; +})); +exports["default"] = eachWeekOfInterval; +var _index = _interopRequireDefault(__nccwpck_require__(7195)); +var _index2 = _interopRequireDefault(__nccwpck_require__(9813)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name differenceInCalendarWeeks - * @category Week Helpers - * @summary Get the number of calendar weeks between the given dates. + * @name eachWeekOfInterval + * @category Interval Helpers + * @summary Return the array of weeks within the specified time interval. * * @description - * Get the number of calendar weeks between the given dates. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Return the array of weeks within the specified time interval. * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date + * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} * @param {Object} [options] - an object with options. * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Number} the number of calendar weeks - * @throws {TypeError} 2 arguments required - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 - * - * @example - * // How many calendar weeks are between 5 July 2014 and 20 July 2014? - * const result = differenceInCalendarWeeks( - * new Date(2014, 6, 20), - * new Date(2014, 6, 5) - * ) - * //=> 3 + * @returns {Date[]} the array with starts of weeks from the week of the interval start to the week of the interval end + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be 0, 1, ..., 6 + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * // If the week starts on Monday, - * // how many calendar weeks are between 5 July 2014 and 20 July 2014? - * const result = differenceInCalendarWeeks( - * new Date(2014, 6, 20), - * new Date(2014, 6, 5), - * { weekStartsOn: 1 } - * ) - * //=> 2 + * // Each week within interval 6 October 2014 - 23 November 2014: + * const result = eachWeekOfInterval({ + * start: new Date(2014, 9, 6), + * end: new Date(2014, 10, 23) + * }) + * //=> [ + * // Sun Oct 05 2014 00:00:00, + * // Sun Oct 12 2014 00:00:00, + * // Sun Oct 19 2014 00:00:00, + * // Sun Oct 26 2014 00:00:00, + * // Sun Nov 02 2014 00:00:00, + * // Sun Nov 09 2014 00:00:00, + * // Sun Nov 16 2014 00:00:00, + * // Sun Nov 23 2014 00:00:00 + * // ] */ +function eachWeekOfInterval(dirtyInterval, options) { + (0, _index4.default)(1, arguments); + var interval = dirtyInterval || {}; + var startDate = (0, _index3.default)(interval.start); + var endDate = (0, _index3.default)(interval.end); + var endTime = endDate.getTime(); -function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, dirtyOptions) { - (0, _index3.default)(2, arguments); - var startOfWeekLeft = (0, _index.default)(dirtyDateLeft, dirtyOptions); - var startOfWeekRight = (0, _index.default)(dirtyDateRight, dirtyOptions); - var timestampLeft = startOfWeekLeft.getTime() - (0, _index2.default)(startOfWeekLeft); - var timestampRight = startOfWeekRight.getTime() - (0, _index2.default)(startOfWeekRight); // 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) + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(startDate.getTime() <= endTime)) { + throw new RangeError('Invalid interval'); + } + var startDateWeek = (0, _index2.default)(startDate, options); + var endDateWeek = (0, _index2.default)(endDate, options); - return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK); + // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet + startDateWeek.setHours(15); + endDateWeek.setHours(15); + endTime = endDateWeek.getTime(); + var weeks = []; + var currentWeek = startDateWeek; + while (currentWeek.getTime() <= endTime) { + currentWeek.setHours(0); + weeks.push((0, _index3.default)(currentWeek)); + currentWeek = (0, _index.default)(currentWeek, 1); + currentWeek.setHours(15); + } + return weeks; } - module.exports = exports.default; /***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1944: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = formatRelative; - -var _index = _interopRequireDefault(__webpack_require__(580)); - -var _index2 = _interopRequireDefault(__webpack_require__(910)); - -var _index3 = _interopRequireDefault(__webpack_require__(275)); - -var _index4 = _interopRequireDefault(__webpack_require__(564)); - -var _index5 = _interopRequireDefault(__webpack_require__(773)); - -var _index6 = _interopRequireDefault(__webpack_require__(151)); - -var _index7 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = eachWeekendOfInterval; +var _index = _interopRequireDefault(__nccwpck_require__(6545)); +var _index2 = _interopRequireDefault(__nccwpck_require__(5852)); +var _index3 = _interopRequireDefault(__nccwpck_require__(403)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name formatRelative - * @category Common Helpers - * @summary Represent the date in words relative to the given base date. + * @name eachWeekendOfInterval + * @category Interval Helpers + * @summary List all the Saturdays and Sundays in the given date interval. * * @description - * Represent the date in words relative to the given base date. - * - * | Distance to the base date | Result | - * |---------------------------|---------------------------| - * | Previous 6 days | last Sunday at 04:30 AM | - * | Last day | yesterday at 04:30 AM | - * | Same day | today at 04:30 AM | - * | Next day | tomorrow at 04:30 AM | - * | Next 6 days | Sunday at 04:30 AM | - * | Other | 12/31/2017 | - * - * ### v2.0.0 breaking changes: + * Get all the Saturdays and Sundays in the given date interval. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @param {Interval} interval - the given interval. See [Interval]{@link https://date-fns.org/docs/Interval} + * @returns {Date[]} an array containing all the Saturdays and Sundays + * @throws {TypeError} 1 argument required + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` * - * @param {Date|Number} date - the date to format - * @param {Date|Number} baseDate - the date to compare with - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {String} the date in words - * @throws {TypeError} 2 arguments required - * @throws {RangeError} `date` must not be Invalid Date - * @throws {RangeError} `baseDate` must not be Invalid Date - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 - * @throws {RangeError} `options.locale` must contain `localize` property - * @throws {RangeError} `options.locale` must contain `formatLong` property - * @throws {RangeError} `options.locale` must contain `formatRelative` property + * @example + * // Lists all Saturdays and Sundays in the given date interval + * const result = eachWeekendOfInterval({ + * start: new Date(2018, 8, 17), + * end: new Date(2018, 8, 30) + * }) + * //=> [ + * // Sat Sep 22 2018 00:00:00, + * // Sun Sep 23 2018 00:00:00, + * // Sat Sep 29 2018 00:00:00, + * // Sun Sep 30 2018 00:00:00 + * // ] */ -function formatRelative(dirtyDate, dirtyBaseDate, dirtyOptions) { - (0, _index7.default)(2, arguments); - var date = (0, _index5.default)(dirtyDate); - var baseDate = (0, _index5.default)(dirtyBaseDate); - - var _ref = dirtyOptions || {}, - _ref$locale = _ref.locale, - locale = _ref$locale === void 0 ? _index3.default : _ref$locale, - _ref$weekStartsOn = _ref.weekStartsOn, - weekStartsOn = _ref$weekStartsOn === void 0 ? 0 : _ref$weekStartsOn; - - if (!locale.localize) { - throw new RangeError('locale must contain localize property'); - } - - if (!locale.formatLong) { - throw new RangeError('locale must contain formatLong property'); - } - - if (!locale.formatRelative) { - throw new RangeError('locale must contain formatRelative property'); +function eachWeekendOfInterval(interval) { + (0, _index4.default)(1, arguments); + var dateInterval = (0, _index.default)(interval); + var weekends = []; + var index = 0; + while (index < dateInterval.length) { + var date = dateInterval[index++]; + if ((0, _index3.default)(date)) { + weekends.push(date); + if ((0, _index2.default)(date)) index = index + 5; + } } + return weekends; +} +module.exports = exports.default; - var diff = (0, _index.default)(date, baseDate); +/***/ }), - if (isNaN(diff)) { - throw new RangeError('Invalid time value'); - } +/***/ 3973: +/***/ ((module, exports, __nccwpck_require__) => { - var token; +"use strict"; - if (diff < -6) { - token = 'other'; - } else if (diff < -1) { - token = 'lastWeek'; - } else if (diff < 0) { - token = 'yesterday'; - } else if (diff < 1) { - token = 'today'; - } else if (diff < 2) { - token = 'tomorrow'; - } else if (diff < 7) { - token = 'nextWeek'; - } else { - token = 'other'; - } - var utcDate = (0, _index4.default)(date, (0, _index6.default)(date)); - var utcBaseDate = (0, _index4.default)(baseDate, (0, _index6.default)(baseDate)); - var formatStr = locale.formatRelative(token, utcDate, utcBaseDate, { - locale: locale, - weekStartsOn: weekStartsOn - }); - return (0, _index2.default)(date, formatStr, { - locale: locale, - weekStartsOn: weekStartsOn +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = eachWeekendOfMonth; +var _index = _interopRequireDefault(__nccwpck_require__(1944)); +var _index2 = _interopRequireDefault(__nccwpck_require__(7182)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2621)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name eachWeekendOfMonth + * @category Month Helpers + * @summary List all the Saturdays and Sundays in the given month. + * + * @description + * Get all the Saturdays and Sundays in the given month. + * + * @param {Date|Number} date - the given month + * @returns {Date[]} an array containing all the Saturdays and Sundays + * @throws {TypeError} 1 argument required + * @throws {RangeError} The passed date is invalid + * + * @example + * // Lists all Saturdays and Sundays in the given month + * const result = eachWeekendOfMonth(new Date(2022, 1, 1)) + * //=> [ + * // Sat Feb 05 2022 00:00:00, + * // Sun Feb 06 2022 00:00:00, + * // Sat Feb 12 2022 00:00:00, + * // Sun Feb 13 2022 00:00:00, + * // Sat Feb 19 2022 00:00:00, + * // Sun Feb 20 2022 00:00:00, + * // Sat Feb 26 2022 00:00:00, + * // Sun Feb 27 2022 00:00:00 + * // ] + */ +function eachWeekendOfMonth(dirtyDate) { + (0, _index4.default)(1, arguments); + var startDate = (0, _index2.default)(dirtyDate); + if (isNaN(startDate.getTime())) throw new RangeError('The passed date is invalid'); + var endDate = (0, _index3.default)(dirtyDate); + return (0, _index.default)({ + start: startDate, + end: endDate }); } - module.exports = exports.default; /***/ }), -/* 297 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7961: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getHours; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = eachWeekendOfYear; +var _index = _interopRequireDefault(__nccwpck_require__(1944)); +var _index2 = _interopRequireDefault(__nccwpck_require__(7079)); +var _index3 = _interopRequireDefault(__nccwpck_require__(8225)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name getHours - * @category Hour Helpers - * @summary Get the hours of the given date. + * @name eachWeekendOfYear + * @category Year Helpers + * @summary List all the Saturdays and Sundays in the year. * * @description - * Get the hours of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Get all the Saturdays and Sundays in the year. * - * @param {Date|Number} date - the given date - * @returns {Number} the hours + * @param {Date|Number} date - the given year + * @returns {Date[]} an array containing all the Saturdays and Sundays * @throws {TypeError} 1 argument required + * @throws {RangeError} The passed date is invalid * * @example - * // Get the hours of 29 February 2012 11:45:00: - * const result = getHours(new Date(2012, 1, 29, 11, 45)) - * //=> 11 + * // Lists all Saturdays and Sundays in the year + * const result = eachWeekendOfYear(new Date(2020, 1, 1)) + * //=> [ + * // Sat Jan 03 2020 00:00:00, + * // Sun Jan 04 2020 00:00:00, + * // ... + * // Sun Dec 27 2020 00:00:00 + * // ] + * ] */ -function getHours(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var hours = date.getHours(); - return hours; +function eachWeekendOfYear(dirtyDate) { + (0, _index4.default)(1, arguments); + var startDate = (0, _index3.default)(dirtyDate); + var endDate = (0, _index2.default)(dirtyDate); + return (0, _index.default)({ + start: startDate, + end: endDate + }); } - module.exports = exports.default; /***/ }), -/* 298 */, -/* 299 */, -/* 300 */, -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6525: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isThisSecond; - -var _index = _interopRequireDefault(__webpack_require__(73)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = eachYearOfInterval; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isThisSecond - * @category Second Helpers - * @summary Is the given date in the same second as the current date? - * @pure false + * @name eachYearOfInterval + * @category Interval Helpers + * @summary Return the array of yearly timestamps within the specified time interval. * * @description - * Is the given date in the same second as the current date? - * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `Date.now()` internally hence impure and can't be safely curried. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Return the array of yearly timestamps within the specified time interval. * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is in this second + * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} + * @returns {Date[]} the array with starts of yearly timestamps from the month of the interval start to the month of the interval end * @throws {TypeError} 1 argument required + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:30:15.000 in this second? - * var result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15)) - * //=> true + * // Each year between 6 February 2014 and 10 August 2017: + * const result = eachYearOfInterval({ + * start: new Date(2014, 1, 6), + * end: new Date(2017, 7, 10) + * }) + * //=> [ + * // Wed Jan 01 2014 00:00:00, + * // Thu Jan 01 2015 00:00:00, + * // Fri Jan 01 2016 00:00:00, + * // Sun Jan 01 2017 00:00:00 + * // ] */ -function isThisSecond(dirtyDate) { +function eachYearOfInterval(dirtyInterval) { (0, _index2.default)(1, arguments); - return (0, _index.default)(Date.now(), dirtyDate); -} + var interval = dirtyInterval || {}; + var startDate = (0, _index.default)(interval.start); + var endDate = (0, _index.default)(interval.end); + var endTime = endDate.getTime(); + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(startDate.getTime() <= endTime)) { + throw new RangeError('Invalid interval'); + } + var dates = []; + var currentDate = startDate; + currentDate.setHours(0, 0, 0, 0); + currentDate.setMonth(0, 1); + while (currentDate.getTime() <= endTime) { + dates.push((0, _index.default)(currentDate)); + currentDate.setFullYear(currentDate.getFullYear() + 1); + } + return dates; +} module.exports = exports.default; /***/ }), -/* 302 */, -/* 303 */, -/* 304 */, -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8569: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = getUnixTime; - -var _index = _interopRequireDefault(__webpack_require__(697)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = endOfDay; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name getUnixTime - * @category Timestamp Helpers - * @summary Get the seconds timestamp of the given date. + * @name endOfDay + * @category Day Helpers + * @summary Return the end of a day for the given date. * * @description - * Get the seconds timestamp of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Return the end of a day for the given date. + * The result will be in the local timezone. * - * @param {Date|Number} date - the given date - * @returns {Number} the timestamp + * @param {Date|Number} date - the original date + * @returns {Date} the end of a day * @throws {TypeError} 1 argument required * * @example - * // Get the timestamp of 29 February 2012 11:45:05 CET: - * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5)) - * //=> 1330512305 + * // The end of a day for 2 September 2014 11:55:00: + * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 02 2014 23:59:59.999 */ -function getUnixTime(dirtyDate) { +function endOfDay(dirtyDate) { (0, _index2.default)(1, arguments); - return Math.floor((0, _index.default)(dirtyDate) / 1000); + var date = (0, _index.default)(dirtyDate); + date.setHours(23, 59, 59, 999); + return date; } - module.exports = exports.default; /***/ }), -/* 306 */ -/***/ (function(module) { -// This is not the set of all possible signals. -// -// It IS, however, the set of all signals that trigger -// an exit on either Linux or BSD systems. Linux is a -// superset of the signal names supported on BSD, and -// the unknown signals just fail to register, so we can -// catch that easily enough. -// -// Don't bother with SIGKILL. It's uncatchable, which -// means that we can't fire any callbacks anyway. -// -// If a user does happen to register a handler on a non- -// fatal signal like SIGWINCH or something, and then -// exit, it'll end up firing `process.emit('exit')`, so -// the handler will be fired anyway. -// -// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised -// artificially, inherently leave the process in a -// state from which it is not safe to try and enter JS -// listeners. -module.exports = [ - 'SIGABRT', - 'SIGALRM', - 'SIGHUP', - 'SIGINT', - 'SIGTERM' -] +/***/ 1517: +/***/ ((module, exports, __nccwpck_require__) => { -if (process.platform !== 'win32') { - module.exports.push( - 'SIGVTALRM', - 'SIGXCPU', - 'SIGXFSZ', - 'SIGUSR2', - 'SIGTRAP', - 'SIGSYS', - 'SIGQUIT', - 'SIGIOT' - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ) -} +"use strict"; -if (process.platform === 'linux') { - module.exports.push( - 'SIGIO', - 'SIGPOLL', - 'SIGPWR', - 'SIGSTKFLT', - 'SIGUNUSED' - ) -} +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfDecade; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name endOfDecade + * @category Decade Helpers + * @summary Return the end of a decade for the given date. + * + * @description + * Return the end of a decade for the given date. + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a decade + * @param {Object} [options] - an object with options. + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // The end of a decade for 12 May 1984 00:00:00: + * const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00)) + * //=> Dec 31 1989 23:59:59.999 + */ +function endOfDecade(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getFullYear(); + var decade = 9 + Math.floor(year / 10) * 10; + date.setFullYear(decade, 11, 31); + date.setHours(23, 59, 59, 999); + return date; +} +module.exports = exports.default; /***/ }), -/* 307 */, -/* 308 */, -/* 309 */, -/* 310 */, -/* 311 */, -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1894: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = addSeconds; +})); +exports["default"] = endOfHour; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name endOfHour + * @category Hour Helpers + * @summary Return the end of an hour for the given date. + * + * @description + * Return the end of an hour for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of an hour + * @throws {TypeError} 1 argument required + * + * @example + * // The end of an hour for 2 September 2014 11:55:00: + * const result = endOfHour(new Date(2014, 8, 2, 11, 55)) + * //=> Tue Sep 02 2014 11:59:59.999 + */ +function endOfHour(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + date.setMinutes(59, 59, 999); + return date; +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(841)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(120)); +/***/ 1920: +/***/ ((module, exports, __nccwpck_require__) => { -var _index3 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(5218)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name addSeconds - * @category Second Helpers - * @summary Add the specified number of seconds to the given date. + * @name endOfISOWeek + * @category ISO Week Helpers + * @summary Return the end of an ISO week for the given date. * * @description - * Add the specified number of seconds to the given date. - * - * ### v2.0.0 breaking changes: + * Return the end of an ISO week for the given date. + * The result will be in the local timezone. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the seconds added - * @throws {TypeError} 2 arguments required + * @param {Date|Number} date - the original date + * @returns {Date} the end of an ISO week + * @throws {TypeError} 1 argument required * * @example - * // Add 30 seconds to 10 July 2014 12:45:00: - * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) - * //=> Thu Jul 10 2014 12:45:30 + * // The end of an ISO week for 2 September 2014 11:55:00: + * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sun Sep 07 2014 23:59:59.999 */ -function addSeconds(dirtyDate, dirtyAmount) { - (0, _index3.default)(2, arguments); - var amount = (0, _index.default)(dirtyAmount); - return (0, _index2.default)(dirtyDate, amount * 1000); +function endOfISOWeek(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, { + weekStartsOn: 1 + }); } - module.exports = exports.default; /***/ }), -/* 313 */, -/* 314 */, -/* 315 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const SemVer = __webpack_require__(653) -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch - -/***/ }), -/* 316 */, -/* 317 */, -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 9731: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = roundToNearestMinutes; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(841)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = endOfISOWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(6991)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6307)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name roundToNearestMinutes - * @category Minute Helpers - * @summary Rounds the given date to the nearest minute + * @name endOfISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Return the end of an ISO week-numbering year for the given date. * * @description - * Rounds the given date to the nearest minute (or number of minutes). - * Rounds up when the given date is exactly between the nearest round minutes. - * - * ### v2.0.0 breaking changes: + * Return the end of an ISO week-numbering year, + * which always starts 3 days before the year's first Thursday. + * The result will be in the local timezone. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @param {Date|Number} date - the date to round - * @param {Object} [options] - an object with options. - * @param {Number} [options.nearestTo=1] - nearest number of minutes to round to. E.g. `15` to round to quarter hours. - * @returns {Date} the new date rounded to the closest minute + * @param {Date|Number} date - the original date + * @returns {Date} the end of an ISO week-numbering year * @throws {TypeError} 1 argument required - * @throws {RangeError} `options.nearestTo` must be between 1 and 30 - * - * @example - * // Round 10 July 2014 12:12:34 to nearest minute: - * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34)) - * //=> Thu Jul 10 2014 12:13:00 * * @example - * // Round 10 July 2014 12:07:30 to nearest quarter hour: - * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 }) - * // rounds up because given date is exactly between 12:00:00 and 12:15:00 - * //=> Thu Jul 10 2014 12:15:00 + * // The end of an ISO week-numbering year for 2 July 2005: + * const result = endOfISOWeekYear(new Date(2005, 6, 2)) + * //=> Sun Jan 01 2006 23:59:59.999 */ -function roundToNearestMinutes(dirtyDate, options) { - if (arguments.length < 1) { - throw new TypeError('1 argument required, but only none provided present'); - } - - var nearestTo = options && 'nearestTo' in options ? (0, _index2.default)(options.nearestTo) : 1; - - if (nearestTo < 1 || nearestTo > 30) { - throw new RangeError('`options.nearestTo` must be between 1 and 30'); - } - - var date = (0, _index.default)(dirtyDate); - var seconds = date.getSeconds(); // relevant if nearestTo is 1, which is the default case - - var minutes = date.getMinutes() + seconds / 60; - var roundedMinutes = Math.floor(minutes / nearestTo) * nearestTo; - var remainderMinutes = minutes % nearestTo; - var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo; - return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), roundedMinutes + addedMinutes); +function endOfISOWeekYear(dirtyDate) { + (0, _index3.default)(1, arguments); + var year = (0, _index.default)(dirtyDate); + var fourthOfJanuaryOfNextYear = new Date(0); + fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); + var date = (0, _index2.default)(fourthOfJanuaryOfNextYear); + date.setMilliseconds(date.getMilliseconds() - 1); + return date; } - module.exports = exports.default; /***/ }), -/* 319 */, -/* 320 */, -/* 321 */, -/* 322 */, -/* 323 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const compare = __webpack_require__(164) -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare - -/***/ }), -/* 324 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ 1389: +/***/ ((module, exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(653) -const Comparator = __webpack_require__(538) -const {ANY} = Comparator -const Range = __webpack_require__(57) -const satisfies = __webpack_require__(517) -const gt = __webpack_require__(827) -const lt = __webpack_require__(746) -const lte = __webpack_require__(817) -const gte = __webpack_require__(751) +"use strict"; -const outside = (version, range, hilo, options) => { - version = new SemVer(version, options) - range = new Range(range, options) - let gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfMinute; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name endOfMinute + * @category Minute Helpers + * @summary Return the end of a minute for the given date. + * + * @description + * Return the end of a minute for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a minute + * @throws {TypeError} 1 argument required + * + * @example + * // The end of a minute for 1 December 2014 22:15:45.400: + * const result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:59.999 + */ +function endOfMinute(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + date.setSeconds(59, 999); + return date; +} +module.exports = exports.default; - // If it satisfies the range it is not outside - if (satisfies(version, range, options)) { - return false - } +/***/ }), - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. +/***/ 2621: +/***/ ((module, exports, __nccwpck_require__) => { - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] +"use strict"; - let high = null - let low = null - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfMonth; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name endOfMonth + * @category Month Helpers + * @summary Return the end of a month for the given date. + * + * @description + * Return the end of a month for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a month + * @throws {TypeError} 1 argument required + * + * @example + * // The end of a month for 2 September 2014 11:55:00: + * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 23:59:59.999 + */ +function endOfMonth(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var month = date.getMonth(); + date.setFullYear(date.getFullYear(), month + 1, 0); + date.setHours(23, 59, 59, 999); + return date; +} +module.exports = exports.default; - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } +/***/ }), - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} +/***/ 5596: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; -module.exports = outside +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfQuarter; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name endOfQuarter + * @category Quarter Helpers + * @summary Return the end of a year quarter for the given date. + * + * @description + * Return the end of a year quarter for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a quarter + * @throws {TypeError} 1 argument required + * + * @example + * // The end of a quarter for 2 September 2014 11:55:00: + * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 23:59:59.999 + */ +function endOfQuarter(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var currentMonth = date.getMonth(); + var month = currentMonth - currentMonth % 3 + 3; + date.setMonth(month, 0); + date.setHours(23, 59, 59, 999); + return date; +} +module.exports = exports.default; /***/ }), -/* 325 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { + +/***/ 6121: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.cli = void 0; -const mri = __webpack_require__(373); -const libyear_1 = __webpack_require__(294); -const package_manager_1 = __webpack_require__(95); -const configuration_1 = __webpack_require__(972); -const print_1 = __webpack_require__(534); -const validateThreshold = (threshold) => isNaN(Number(threshold)) ? null : Number(threshold); -const cli = async () => { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; - // parse cli args - const argv = process.argv.slice(2); - const args = mri(argv, { boolean: ["all", "json"], string: ["config"] }); - // validate cli options - const packageManager = args["package-manager"]; - const all = args["all"]; - const json = args["json"]; - const { overrides, threshold } = await configuration_1.getConfiguration(args); - const driftCollective = validateThreshold((_a = threshold === null || threshold === void 0 ? void 0 : threshold.drift) === null || _a === void 0 ? void 0 : _a.collective); - const driftIndividual = validateThreshold((_b = threshold === null || threshold === void 0 ? void 0 : threshold.drift) === null || _b === void 0 ? void 0 : _b.individual); - const pulseCollective = validateThreshold((_c = threshold === null || threshold === void 0 ? void 0 : threshold.pulse) === null || _c === void 0 ? void 0 : _c.collective); - const pulseIndividual = validateThreshold((_d = threshold === null || threshold === void 0 ? void 0 : threshold.pulse) === null || _d === void 0 ? void 0 : _d.individual); - const releasesCollective = validateThreshold((_e = threshold === null || threshold === void 0 ? void 0 : threshold.releases) === null || _e === void 0 ? void 0 : _e.collective); - const releasesIndividual = validateThreshold((_f = threshold === null || threshold === void 0 ? void 0 : threshold.releases) === null || _f === void 0 ? void 0 : _f.individual); - const majorCollective = validateThreshold((_g = threshold === null || threshold === void 0 ? void 0 : threshold.major) === null || _g === void 0 ? void 0 : _g.collective); - const majorIndividual = validateThreshold((_h = threshold === null || threshold === void 0 ? void 0 : threshold.major) === null || _h === void 0 ? void 0 : _h.individual); - const minorCollective = validateThreshold((_j = threshold === null || threshold === void 0 ? void 0 : threshold.minor) === null || _j === void 0 ? void 0 : _j.collective); - const minorIndividual = validateThreshold((_k = threshold === null || threshold === void 0 ? void 0 : threshold.minor) === null || _k === void 0 ? void 0 : _k.individual); - const patchCollective = validateThreshold((_l = threshold === null || threshold === void 0 ? void 0 : threshold.patch) === null || _l === void 0 ? void 0 : _l.collective); - const patchIndividual = validateThreshold((_m = threshold === null || threshold === void 0 ? void 0 : threshold.patch) === null || _m === void 0 ? void 0 : _m.individual); - // run libyear - try { - const report = await libyear_1.libyear(package_manager_1.getParsedPackageManager(packageManager !== null && packageManager !== void 0 ? packageManager : (await package_manager_1.getInferredPackageManager())), { all }); - const threshold = { - driftCollective, - driftIndividual, - pulseCollective, - pulseIndividual, - releasesCollective, - releasesIndividual, - majorCollective, - majorIndividual, - minorCollective, - minorIndividual, - patchCollective, - patchIndividual, - }; - if (json) { - console.log(JSON.stringify(report)); - } - else { - print_1.print(report, threshold, overrides); - } - } - catch (error) { - if (json) { - console.log(JSON.stringify(error)); - } - else { - console.error(error.message); - } - } -}; -exports.cli = cli; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfSecond; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name endOfSecond + * @category Second Helpers + * @summary Return the end of a second for the given date. + * + * @description + * Return the end of a second for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a second + * @throws {TypeError} 1 argument required + * + * @example + * // The end of a second for 1 December 2014 22:15:45.400: + * const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:45.999 + */ +function endOfSecond(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + date.setMilliseconds(999); + return date; +} +module.exports = exports.default; /***/ }), -/* 326 */, -/* 327 */, -/* 328 */, -/* 329 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { -"use strict"; +/***/ 5700: +/***/ ((module, exports, __nccwpck_require__) => { +"use strict"; -var PlainValue = __webpack_require__(513); -function addCommentBefore(str, indent, comment) { - if (!comment) return str; - const cc = comment.replace(/[\s\S]^/gm, `$&${indent}#`); - return `#${cc}\n${indent}${str}`; -} -function addComment(str, indent, comment) { - return !comment ? str : comment.indexOf('\n') === -1 ? `${str} #${comment}` : `${str}\n` + comment.replace(/^/gm, `${indent || ''}#`); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfToday; +var _index = _interopRequireDefault(__nccwpck_require__(8569)); +/** + * @name endOfToday + * @category Day Helpers + * @summary Return the end of today. + * @pure false + * + * @description + * Return the end of today. + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @returns {Date} the end of today + * + * @example + * // If today is 6 October 2014: + * const result = endOfToday() + * //=> Mon Oct 6 2014 23:59:59.999 + */ +function endOfToday() { + return (0, _index.default)(Date.now()); } +module.exports = exports.default; -class Node {} +/***/ }), -function toJSON(value, arg, ctx) { - if (Array.isArray(value)) return value.map((v, i) => toJSON(v, String(i), ctx)); +/***/ 6935: +/***/ ((module, exports) => { - if (value && typeof value.toJSON === 'function') { - const anchor = ctx && ctx.anchors && ctx.anchors.get(value); - if (anchor) ctx.onCreate = res => { - anchor.res = res; - delete ctx.onCreate; - }; - const res = value.toJSON(arg, ctx); - if (anchor && ctx.onCreate) ctx.onCreate(res); - return res; - } +"use strict"; - if ((!ctx || !ctx.keep) && typeof value === 'bigint') return Number(value); - return value; -} -class Scalar extends Node { - constructor(value) { - super(); - this.value = value; - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfTomorrow; +/** + * @name endOfTomorrow + * @category Day Helpers + * @summary Return the end of tomorrow. + * @pure false + * + * @description + * Return the end of tomorrow. + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `new Date()` internally hence impure and can't be safely curried. + * + * @returns {Date} the end of tomorrow + * + * @example + * // If today is 6 October 2014: + * const result = endOfTomorrow() + * //=> Tue Oct 7 2014 23:59:59.999 + */ +function endOfTomorrow() { + var now = new Date(); + var year = now.getFullYear(); + var month = now.getMonth(); + var day = now.getDate(); + var date = new Date(0); + date.setFullYear(year, month, day + 1); + date.setHours(23, 59, 59, 999); + return date; +} +module.exports = exports.default; - toJSON(arg, ctx) { - return ctx && ctx.keep ? this.value : toJSON(this.value, arg, ctx); - } +/***/ }), - toString() { - return String(this.value); - } +/***/ 5218: +/***/ ((module, exports, __nccwpck_require__) => { -} +"use strict"; -function collectionFromPath(schema, path, value) { - let v = value; - for (let i = path.length - 1; i >= 0; --i) { - const k = path[i]; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfWeek; +var _index = __nccwpck_require__(9307); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name endOfWeek + * @category Week Helpers + * @summary Return the end of a week for the given date. + * + * @description + * Return the end of a week for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Date} the end of a week + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * + * @example + * // The end of a week for 2 September 2014 11:55:00: + * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sat Sep 06 2014 23:59:59.999 + * + * @example + * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00: + * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) + * //=> Sun Sep 07 2014 23:59:59.999 + */ +function endOfWeek(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index4.default)(1, arguments); + var defaultOptions = (0, _index.getDefaultOptions)(); + var weekStartsOn = (0, _index3.default)((_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); - if (Number.isInteger(k) && k >= 0) { - const a = []; - a[k] = v; - v = a; - } else { - const o = {}; - Object.defineProperty(o, k, { - value: v, - writable: true, - enumerable: true, - configurable: true - }); - v = o; - } + // 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'); } + var date = (0, _index2.default)(dirtyDate); + var day = date.getDay(); + var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); + date.setDate(date.getDate() + diff); + date.setHours(23, 59, 59, 999); + return date; +} +module.exports = exports.default; - return schema.createNode(v, false); -} // null, undefined, or an empty non-string iterable (e.g. []) - +/***/ }), -const isEmptyPath = path => path == null || typeof path === 'object' && path[Symbol.iterator]().next().done; -class Collection extends Node { - constructor(schema) { - super(); +/***/ 7079: +/***/ ((module, exports, __nccwpck_require__) => { - PlainValue._defineProperty(this, "items", []); +"use strict"; - this.schema = schema; - } - addIn(path, value) { - if (isEmptyPath(path)) this.add(value);else { - const [key, ...rest] = path; - const node = this.get(key, true); - if (node instanceof Collection) node.addIn(rest, value);else if (node === undefined && this.schema) this.set(key, collectionFromPath(this.schema, rest, value));else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name endOfYear + * @category Year Helpers + * @summary Return the end of a year for the given date. + * + * @description + * Return the end of a year for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a year + * @throws {TypeError} 1 argument required + * + * @example + * // The end of a year for 2 September 2014 11:55:00: + * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 00)) + * //=> Wed Dec 31 2014 23:59:59.999 + */ +function endOfYear(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getFullYear(); + date.setFullYear(year + 1, 0, 0); + date.setHours(23, 59, 59, 999); + return date; +} +module.exports = exports.default; - deleteIn([key, ...rest]) { - if (rest.length === 0) return this.delete(key); - const node = this.get(key, true); - if (node instanceof Collection) return node.deleteIn(rest);else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } +/***/ }), - getIn([key, ...rest], keepScalar) { - const node = this.get(key, true); - if (rest.length === 0) return !keepScalar && node instanceof Scalar ? node.value : node;else return node instanceof Collection ? node.getIn(rest, keepScalar) : undefined; - } +/***/ 66: +/***/ ((module, exports) => { - hasAllNullValues() { - return this.items.every(node => { - if (!node || node.type !== 'PAIR') return false; - const n = node.value; - return n == null || n instanceof Scalar && n.value == null && !n.commentBefore && !n.comment && !n.tag; - }); - } +"use strict"; - hasIn([key, ...rest]) { - if (rest.length === 0) return this.has(key); - const node = this.get(key, true); - return node instanceof Collection ? node.hasIn(rest) : false; - } - setIn([key, ...rest], value) { - if (rest.length === 0) { - this.set(key, value); - } else { - const node = this.get(key, true); - if (node instanceof Collection) node.setIn(rest, value);else if (node === undefined && this.schema) this.set(key, collectionFromPath(this.schema, rest, value));else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); - } - } // overridden in implementations +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = endOfYesterday; +/** + * @name endOfYesterday + * @category Day Helpers + * @summary Return the end of yesterday. + * @pure false + * + * @description + * Return the end of yesterday. + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `new Date()` internally hence impure and can't be safely curried. + * + * @returns {Date} the end of yesterday + * + * @example + * // If today is 6 October 2014: + * const result = endOfYesterday() + * //=> Sun Oct 5 2014 23:59:59.999 + */ +function endOfYesterday() { + var now = new Date(); + var year = now.getFullYear(); + var month = now.getMonth(); + var day = now.getDate(); + var date = new Date(0); + date.setFullYear(year, month, day - 1); + date.setHours(23, 59, 59, 999); + return date; +} +module.exports = exports.default; - /* istanbul ignore next */ +/***/ }), +/***/ 2168: +/***/ ((module, exports, __nccwpck_require__) => { - toJSON() { - return null; - } +"use strict"; - toString(ctx, { - blockItem, - flowChars, - isMap, - itemIndent - }, onComment, onChompKeep) { - const { - indent, - indentStep, - stringify - } = ctx; - const inFlow = this.type === PlainValue.Type.FLOW_MAP || this.type === PlainValue.Type.FLOW_SEQ || ctx.inFlow; - if (inFlow) itemIndent += indentStep; - const allNullValues = isMap && this.hasAllNullValues(); - ctx = Object.assign({}, ctx, { - allNullValues, - indent: itemIndent, - inFlow, - type: null - }); - let chompKeep = false; - let hasItemWithNewLine = false; - const nodes = this.items.reduce((nodes, item, i) => { - let comment; - if (item) { - if (!chompKeep && item.spaceBefore) nodes.push({ - type: 'comment', - str: '' - }); - if (item.commentBefore) item.commentBefore.match(/^.*$/gm).forEach(line => { - nodes.push({ - type: 'comment', - str: `#${line}` - }); - }); - if (item.comment) comment = item.comment; - if (inFlow && (!chompKeep && item.spaceBefore || item.commentBefore || item.comment || item.key && (item.key.commentBefore || item.key.comment) || item.value && (item.value.commentBefore || item.value.comment))) hasItemWithNewLine = true; - } - - chompKeep = false; - let str = stringify(item, ctx, () => comment = null, () => chompKeep = true); - if (inFlow && !hasItemWithNewLine && str.includes('\n')) hasItemWithNewLine = true; - if (inFlow && i < this.items.length - 1) str += ','; - str = addComment(str, itemIndent, comment); - if (chompKeep && (comment || inFlow)) chompKeep = false; - nodes.push({ - type: 'item', - str - }); - return nodes; - }, []); - let str; - - if (nodes.length === 0) { - str = flowChars.start + flowChars.end; - } else if (inFlow) { - const { - start, - end - } = flowChars; - const strings = nodes.map(n => n.str); - - if (hasItemWithNewLine || strings.reduce((sum, str) => sum + str.length + 2, 2) > Collection.maxFlowStringSingleLineLength) { - str = start; - - for (const s of strings) { - str += s ? `\n${indentStep}${indent}${s}` : '\n'; - } - - str += `\n${indent}${end}`; - } else { - str = `${start} ${strings.join(' ')} ${end}`; - } - } else { - const strings = nodes.map(blockItem); - str = strings.shift(); - - for (const s of strings) str += s ? `\n${indent}${s}` : '\n'; - } - - if (this.comment) { - str += '\n' + this.comment.replace(/^/gm, `${indent}#`); - if (onComment) onComment(); - } else if (chompKeep && onChompKeep) onChompKeep(); - - return str; - } - -} +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = format; +var _index = _interopRequireDefault(__nccwpck_require__(9920)); +var _index2 = _interopRequireDefault(__nccwpck_require__(7923)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index4 = _interopRequireDefault(__nccwpck_require__(9257)); +var _index5 = _interopRequireDefault(__nccwpck_require__(8387)); +var _index6 = _interopRequireDefault(__nccwpck_require__(7032)); +var _index7 = __nccwpck_require__(2509); +var _index8 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index9 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index10 = __nccwpck_require__(9307); +var _index11 = _interopRequireDefault(__nccwpck_require__(618)); +// This RegExp consists of three parts separated by `|`: +// - [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 +// - '' matches two quote characters in a row +// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), +// except a single quote symbol, which ends the sequence. +// Two quote characters do not end the sequence. +// 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; -PlainValue._defineProperty(Collection, "maxFlowStringSingleLineLength", 60); +// 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 unescapedLatinCharacterRegExp = /[a-zA-Z]/; -function asItemIndex(key) { - let idx = key instanceof Scalar ? key.value : key; - if (idx && typeof idx === 'string') idx = Number(idx); - return Number.isInteger(idx) && idx >= 0 ? idx : null; -} +/** + * @name format + * @category Common Helpers + * @summary Format the date. + * + * @description + * Return the formatted date string in the given format. The result may vary by locale. + * + * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. + * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * The characters wrapped between two single quotes characters (') are escaped. + * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. + * (see the last example) + * + * Format of the string is based on Unicode Technical Standard #35: + * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table + * with a few additions (see note 7 below the table). + * + * Accepted patterns: + * | Unit | Pattern | Result examples | Notes | + * |---------------------------------|---------|-----------------------------------|-------| + * | Era | G..GGG | AD, BC | | + * | | GGGG | Anno Domini, Before Christ | 2 | + * | | GGGGG | A, B | | + * | Calendar year | y | 44, 1, 1900, 2017 | 5 | + * | | yo | 44th, 1st, 0th, 17th | 5,7 | + * | | yy | 44, 01, 00, 17 | 5 | + * | | yyy | 044, 001, 1900, 2017 | 5 | + * | | yyyy | 0044, 0001, 1900, 2017 | 5 | + * | | yyyyy | ... | 3,5 | + * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 | + * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 | + * | | YY | 44, 01, 00, 17 | 5,8 | + * | | YYY | 044, 001, 1900, 2017 | 5 | + * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 | + * | | YYYYY | ... | 3,5 | + * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 | + * | | RR | -43, 00, 01, 1900, 2017 | 5,7 | + * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 | + * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 | + * | | RRRRR | ... | 3,5,7 | + * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 | + * | | uu | -43, 01, 1900, 2017 | 5 | + * | | uuu | -043, 001, 1900, 2017 | 5 | + * | | uuuu | -0043, 0001, 1900, 2017 | 5 | + * | | uuuuu | ... | 3,5 | + * | Quarter (formatting) | Q | 1, 2, 3, 4 | | + * | | Qo | 1st, 2nd, 3rd, 4th | 7 | + * | | QQ | 01, 02, 03, 04 | | + * | | QQQ | Q1, Q2, Q3, Q4 | | + * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | + * | | QQQQQ | 1, 2, 3, 4 | 4 | + * | Quarter (stand-alone) | q | 1, 2, 3, 4 | | + * | | qo | 1st, 2nd, 3rd, 4th | 7 | + * | | qq | 01, 02, 03, 04 | | + * | | qqq | Q1, Q2, Q3, Q4 | | + * | | qqqq | 1st quarter, 2nd quarter, ... | 2 | + * | | qqqqq | 1, 2, 3, 4 | 4 | + * | Month (formatting) | M | 1, 2, ..., 12 | | + * | | Mo | 1st, 2nd, ..., 12th | 7 | + * | | MM | 01, 02, ..., 12 | | + * | | MMM | Jan, Feb, ..., Dec | | + * | | MMMM | January, February, ..., December | 2 | + * | | MMMMM | J, F, ..., D | | + * | Month (stand-alone) | L | 1, 2, ..., 12 | | + * | | Lo | 1st, 2nd, ..., 12th | 7 | + * | | LL | 01, 02, ..., 12 | | + * | | LLL | Jan, Feb, ..., Dec | | + * | | LLLL | January, February, ..., December | 2 | + * | | LLLLL | J, F, ..., D | | + * | Local week of year | w | 1, 2, ..., 53 | | + * | | wo | 1st, 2nd, ..., 53th | 7 | + * | | ww | 01, 02, ..., 53 | | + * | ISO week of year | I | 1, 2, ..., 53 | 7 | + * | | Io | 1st, 2nd, ..., 53th | 7 | + * | | II | 01, 02, ..., 53 | 7 | + * | Day of month | d | 1, 2, ..., 31 | | + * | | do | 1st, 2nd, ..., 31st | 7 | + * | | dd | 01, 02, ..., 31 | | + * | Day of year | D | 1, 2, ..., 365, 366 | 9 | + * | | Do | 1st, 2nd, ..., 365th, 366th | 7 | + * | | DD | 01, 02, ..., 365, 366 | 9 | + * | | DDD | 001, 002, ..., 365, 366 | | + * | | DDDD | ... | 3 | + * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | | + * | | EEEE | Monday, Tuesday, ..., Sunday | 2 | + * | | EEEEE | M, T, W, T, F, S, S | | + * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | + * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 | + * | | io | 1st, 2nd, ..., 7th | 7 | + * | | ii | 01, 02, ..., 07 | 7 | + * | | iii | Mon, Tue, Wed, ..., Sun | 7 | + * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 | + * | | iiiii | M, T, W, T, F, S, S | 7 | + * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 | + * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | | + * | | eo | 2nd, 3rd, ..., 1st | 7 | + * | | ee | 02, 03, ..., 01 | | + * | | eee | Mon, Tue, Wed, ..., Sun | | + * | | eeee | Monday, Tuesday, ..., Sunday | 2 | + * | | eeeee | M, T, W, T, F, S, S | | + * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | + * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | | + * | | co | 2nd, 3rd, ..., 1st | 7 | + * | | cc | 02, 03, ..., 01 | | + * | | ccc | Mon, Tue, Wed, ..., Sun | | + * | | cccc | Monday, Tuesday, ..., Sunday | 2 | + * | | ccccc | M, T, W, T, F, S, S | | + * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | + * | AM, PM | a..aa | AM, PM | | + * | | aaa | am, pm | | + * | | aaaa | a.m., p.m. | 2 | + * | | aaaaa | a, p | | + * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | | + * | | bbb | am, pm, noon, midnight | | + * | | bbbb | a.m., p.m., noon, midnight | 2 | + * | | bbbbb | a, p, n, mi | | + * | Flexible day period | B..BBB | at night, in the morning, ... | | + * | | BBBB | at night, in the morning, ... | 2 | + * | | BBBBB | at night, in the morning, ... | | + * | Hour [1-12] | h | 1, 2, ..., 11, 12 | | + * | | ho | 1st, 2nd, ..., 11th, 12th | 7 | + * | | hh | 01, 02, ..., 11, 12 | | + * | Hour [0-23] | H | 0, 1, 2, ..., 23 | | + * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 | + * | | HH | 00, 01, 02, ..., 23 | | + * | Hour [0-11] | K | 1, 2, ..., 11, 0 | | + * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 | + * | | KK | 01, 02, ..., 11, 00 | | + * | Hour [1-24] | k | 24, 1, 2, ..., 23 | | + * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 | + * | | kk | 24, 01, 02, ..., 23 | | + * | Minute | m | 0, 1, ..., 59 | | + * | | mo | 0th, 1st, ..., 59th | 7 | + * | | mm | 00, 01, ..., 59 | | + * | Second | s | 0, 1, ..., 59 | | + * | | so | 0th, 1st, ..., 59th | 7 | + * | | ss | 00, 01, ..., 59 | | + * | Fraction of second | S | 0, 1, ..., 9 | | + * | | SS | 00, 01, ..., 99 | | + * | | SSS | 000, 001, ..., 999 | | + * | | SSSS | ... | 3 | + * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | | + * | | XX | -0800, +0530, Z | | + * | | XXX | -08:00, +05:30, Z | | + * | | XXXX | -0800, +0530, Z, +123456 | 2 | + * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | + * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | | + * | | xx | -0800, +0530, +0000 | | + * | | xxx | -08:00, +05:30, +00:00 | 2 | + * | | xxxx | -0800, +0530, +0000, +123456 | | + * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | + * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | | + * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 | + * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 | + * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 | + * | Seconds timestamp | t | 512969520 | 7 | + * | | tt | ... | 3,7 | + * | Milliseconds timestamp | T | 512969520900 | 7 | + * | | TT | ... | 3,7 | + * | Long localized date | P | 04/29/1453 | 7 | + * | | PP | Apr 29, 1453 | 7 | + * | | PPP | April 29th, 1453 | 7 | + * | | PPPP | Friday, April 29th, 1453 | 2,7 | + * | Long localized time | p | 12:00 AM | 7 | + * | | pp | 12:00:00 AM | 7 | + * | | ppp | 12:00:00 AM GMT+2 | 7 | + * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 | + * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 | + * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 | + * | | PPPppp | April 29th, 1453 at ... | 7 | + * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 | + * Notes: + * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale + * are the same as "stand-alone" units, but are different in some languages. + * "Formatting" units are declined according to the rules of the language + * in the context of a date. "Stand-alone" units are always nominative singular: + * + * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` + * + * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` + * + * 2. Any sequence of the identical letters is a pattern, unless it is escaped by + * the single quote characters (see below). + * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`) + * the output will be the same as default pattern for this unit, usually + * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units + * are marked with "2" in the last column of the table. + * + * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'` + * + * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'` + * + * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'` + * + * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'` + * + * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'` + * + * 3. Some patterns could be unlimited length (such as `yyyyyyyy`). + * The output will be padded with zeros to match the length of the pattern. + * + * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'` + * + * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. + * These tokens represent the shortest form of the quarter. + * + * 5. The main difference between `y` and `u` patterns are B.C. years: + * + * | Year | `y` | `u` | + * |------|-----|-----| + * | AC 1 | 1 | 1 | + * | BC 1 | 1 | 0 | + * | BC 2 | 2 | -1 | + * + * Also `yy` always returns the last two digits of a year, + * while `uu` pads single digit years to 2 characters and returns other years unchanged: + * + * | Year | `yy` | `uu` | + * |------|------|------| + * | 1 | 01 | 01 | + * | 14 | 14 | 14 | + * | 376 | 76 | 376 | + * | 1453 | 53 | 1453 | + * + * The same difference is true for local and ISO week-numbering years (`Y` and `R`), + * except local week-numbering years are dependent on `options.weekStartsOn` + * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear} + * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}). + * + * 6. Specific non-location timezones are currently unavailable in `date-fns`, + * so right now these tokens fall back to GMT timezones. + * + * 7. These patterns are not in the Unicode Technical Standard #35: + * - `i`: ISO day of week + * - `I`: ISO week of year + * - `R`: ISO week-numbering year + * - `t`: seconds timestamp + * - `T`: milliseconds timestamp + * - `o`: ordinal number modifier + * - `P`: long localized date + * - `p`: long localized time + * + * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. + * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month. + * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * @param {Date|Number} date - the original date + * @param {String} format - the string of tokens + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is + * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`; + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`; + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @returns {String} the formatted date string + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `options.locale` must contain `localize` property + * @throws {RangeError} `options.locale` must contain `formatLong` property + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 + * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} format string contains an unescaped latin alphabet character + * + * @example + * // Represent 11 February 2014 in middle-endian format: + * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy') + * //=> '02/11/2014' + * + * @example + * // Represent 2 July 2014 in Esperanto: + * import { eoLocale } from 'date-fns/locale/eo' + * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", { + * locale: eoLocale + * }) + * //=> '2-a de julio 2014' + * + * @example + * // Escape string by single quote characters: + * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'") + * //=> "3 o'clock" + */ -class YAMLSeq extends Collection { - add(value) { - this.items.push(value); - } +function format(dirtyDate, dirtyFormatStr, 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; + (0, _index9.default)(2, arguments); + var formatStr = String(dirtyFormatStr); + var defaultOptions = (0, _index10.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 : _index11.default; + var firstWeekContainsDate = (0, _index8.default)((_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); - delete(key) { - const idx = asItemIndex(key); - if (typeof idx !== 'number') return false; - const del = this.items.splice(idx, 1); - return del.length > 0; + // 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 = (0, _index8.default)((_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); - get(key, keepScalar) { - const idx = asItemIndex(key); - if (typeof idx !== 'number') return undefined; - const it = this.items[idx]; - return !keepScalar && it instanceof Scalar ? it.value : it; + // 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'); } - - has(key) { - const idx = asItemIndex(key); - return typeof idx === 'number' && idx < this.items.length; + if (!locale.localize) { + throw new RangeError('locale must contain localize property'); } - - set(key, value) { - const idx = asItemIndex(key); - if (typeof idx !== 'number') throw new Error(`Expected a valid index, not ${key}.`); - this.items[idx] = value; + if (!locale.formatLong) { + throw new RangeError('locale must contain formatLong property'); } - - toJSON(_, ctx) { - const seq = []; - if (ctx && ctx.onCreate) ctx.onCreate(seq); - let i = 0; - - for (const item of this.items) seq.push(toJSON(item, String(i++), ctx)); - - return seq; + var originalDate = (0, _index3.default)(dirtyDate); + if (!(0, _index.default)(originalDate)) { + throw new RangeError('Invalid time value'); } - toString(ctx, onComment, onChompKeep) { - if (!ctx) return JSON.stringify(this); - return super.toString(ctx, { - blockItem: n => n.type === 'comment' ? n.str : `- ${n.str}`, - flowChars: { - start: '[', - end: ']' - }, - isMap: false, - itemIndent: (ctx.indent || '') + ' ' - }, onComment, onChompKeep); + // 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 = (0, _index6.default)(originalDate); + var utcDate = (0, _index2.default)(originalDate, timezoneOffset); + var formatterOptions = { + firstWeekContainsDate: firstWeekContainsDate, + weekStartsOn: weekStartsOn, + locale: locale, + _originalDate: originalDate + }; + var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) { + var firstCharacter = substring[0]; + if (firstCharacter === 'p' || firstCharacter === 'P') { + var longFormatter = _index5.default[firstCharacter]; + return longFormatter(substring, locale.formatLong); + } + return substring; + }).join('').match(formattingTokensRegExp).map(function (substring) { + // Replace two single quote characters with one single quote character + if (substring === "''") { + return "'"; + } + var firstCharacter = substring[0]; + if (firstCharacter === "'") { + return cleanEscapedString(substring); + } + var formatter = _index4.default[firstCharacter]; + if (formatter) { + if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && (0, _index7.isProtectedWeekYearToken)(substring)) { + (0, _index7.throwProtectedError)(substring, dirtyFormatStr, String(dirtyDate)); + } + if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && (0, _index7.isProtectedDayOfYearToken)(substring)) { + (0, _index7.throwProtectedError)(substring, dirtyFormatStr, String(dirtyDate)); + } + return formatter(utcDate, substring, locale.localize, formatterOptions); + } + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { + throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); + } + return substring; + }).join(''); + return result; +} +function cleanEscapedString(input) { + var matched = input.match(escapedStringRegExp); + if (!matched) { + return input; } - + return matched[1].replace(doubleQuoteRegExp, "'"); } +module.exports = exports.default; -const stringifyKey = (key, jsKey, ctx) => { - if (jsKey === null) return ''; - if (typeof jsKey !== 'object') return String(jsKey); - if (key instanceof Node && ctx && ctx.doc) return key.toString({ - anchors: Object.create(null), - doc: ctx.doc, - indent: '', - indentStep: ctx.indentStep, - inFlow: true, - inStringifyKey: true, - stringify: ctx.stringify - }); - return JSON.stringify(jsKey); -}; - -class Pair extends Node { - constructor(key, value = null) { - super(); - this.key = key; - this.value = value; - this.type = Pair.Type.PAIR; - } +/***/ }), - get commentBefore() { - return this.key instanceof Node ? this.key.commentBefore : undefined; - } +/***/ 8149: +/***/ ((module, exports, __nccwpck_require__) => { - set commentBefore(cb) { - if (this.key == null) this.key = new Scalar(null); - if (this.key instanceof Node) this.key.commentBefore = cb;else { - const msg = 'Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.'; - throw new Error(msg); - } - } +"use strict"; - addToJSMap(ctx, map) { - const key = toJSON(this.key, '', ctx); - if (map instanceof Map) { - const value = toJSON(this.value, key, ctx); - map.set(key, value); - } else if (map instanceof Set) { - map.add(key); - } else { - const stringKey = stringifyKey(this.key, key, ctx); - const value = toJSON(this.value, stringKey, ctx); - if (stringKey in map) Object.defineProperty(map, stringKey, { - value, - writable: true, - enumerable: true, - configurable: true - });else map[stringKey] = value; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatDistance; +var _index = __nccwpck_require__(9307); +var _index2 = _interopRequireDefault(__nccwpck_require__(9818)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2713)); +var _index4 = _interopRequireDefault(__nccwpck_require__(9448)); +var _index5 = _interopRequireDefault(__nccwpck_require__(618)); +var _index6 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index7 = _interopRequireDefault(__nccwpck_require__(7934)); +var _index8 = _interopRequireDefault(__nccwpck_require__(2631)); +var _index9 = _interopRequireDefault(__nccwpck_require__(7032)); +var _index10 = _interopRequireDefault(__nccwpck_require__(2063)); +var MINUTES_IN_DAY = 1440; +var MINUTES_IN_ALMOST_TWO_DAYS = 2520; +var MINUTES_IN_MONTH = 43200; +var MINUTES_IN_TWO_MONTHS = 86400; - return map; - } +/** + * @name formatDistance + * @category Common Helpers + * @summary Return the distance between the given dates in words. + * + * @description + * Return the distance between the given dates in words. + * + * | Distance between dates | Result | + * |-------------------------------------------------------------------|---------------------| + * | 0 ... 30 secs | less than a minute | + * | 30 secs ... 1 min 30 secs | 1 minute | + * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | + * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | + * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | + * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | + * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | + * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | + * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | + * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | + * | 1 yr ... 1 yr 3 months | about 1 year | + * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | + * | 1 yr 9 months ... 2 yrs | almost 2 years | + * | N yrs ... N yrs 3 months | about N years | + * | N yrs 3 months ... N yrs 9 months | over N years | + * | N yrs 9 months ... N+1 yrs | almost N+1 years | + * + * With `options.includeSeconds == true`: + * | Distance between dates | Result | + * |------------------------|----------------------| + * | 0 secs ... 5 secs | less than 5 seconds | + * | 5 secs ... 10 secs | less than 10 seconds | + * | 10 secs ... 20 secs | less than 20 seconds | + * | 20 secs ... 40 secs | half a minute | + * | 40 secs ... 60 secs | less than a minute | + * | 60 secs ... 90 secs | 1 minute | + * + * @param {Date|Number} date - the date + * @param {Date|Number} baseDate - the date to compare with + * @param {Object} [options] - an object with options. + * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed + * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {String} the distance in words + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `baseDate` must not be Invalid Date + * @throws {RangeError} `options.locale` must contain `formatDistance` property + * + * @example + * // What is the distance between 2 July 2014 and 1 January 2015? + * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1)) + * //=> '6 months' + * + * @example + * // What is the distance between 1 January 2015 00:00:15 + * // and 1 January 2015 00:00:00, including seconds? + * const result = formatDistance( + * new Date(2015, 0, 1, 0, 0, 15), + * new Date(2015, 0, 1, 0, 0, 0), + * { includeSeconds: true } + * ) + * //=> 'less than 20 seconds' + * + * @example + * // What is the distance from 1 January 2016 + * // to 1 January 2015, with a suffix? + * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), { + * addSuffix: true + * }) + * //=> 'about 1 year ago' + * + * @example + * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? + * import { eoLocale } from 'date-fns/locale/eo' + * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), { + * locale: eoLocale + * }) + * //=> 'pli ol 1 jaro' + */ - toJSON(_, ctx) { - const pair = ctx && ctx.mapAsMap ? new Map() : {}; - return this.addToJSMap(ctx, pair); +function formatDistance(dirtyDate, dirtyBaseDate, options) { + var _ref, _options$locale; + (0, _index10.default)(2, arguments); + var defaultOptions = (0, _index.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 : _index5.default; + if (!locale.formatDistance) { + throw new RangeError('locale must contain formatDistance property'); } + var comparison = (0, _index2.default)(dirtyDate, dirtyBaseDate); + if (isNaN(comparison)) { + throw new RangeError('Invalid time value'); + } + var localizeOptions = (0, _index8.default)((0, _index7.default)(options), { + addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix), + comparison: comparison + }); + var dateLeft; + var dateRight; + if (comparison > 0) { + dateLeft = (0, _index6.default)(dirtyBaseDate); + dateRight = (0, _index6.default)(dirtyDate); + } else { + dateLeft = (0, _index6.default)(dirtyDate); + dateRight = (0, _index6.default)(dirtyBaseDate); + } + var seconds = (0, _index4.default)(dateRight, dateLeft); + var offsetInSeconds = ((0, _index9.default)(dateRight) - (0, _index9.default)(dateLeft)) / 1000; + var minutes = Math.round((seconds - offsetInSeconds) / 60); + var months; - toString(ctx, onComment, onChompKeep) { - if (!ctx || !ctx.doc) return JSON.stringify(this); - const { - indent: indentSize, - indentSeq, - simpleKeys - } = ctx.doc.options; - let { - key, - value - } = this; - let keyComment = key instanceof Node && key.comment; - - if (simpleKeys) { - if (keyComment) { - throw new Error('With simple keys, key nodes cannot have comments'); + // 0 up to 2 mins + if (minutes < 2) { + if (options !== null && options !== void 0 && options.includeSeconds) { + if (seconds < 5) { + return locale.formatDistance('lessThanXSeconds', 5, localizeOptions); + } else if (seconds < 10) { + return locale.formatDistance('lessThanXSeconds', 10, localizeOptions); + } else if (seconds < 20) { + return locale.formatDistance('lessThanXSeconds', 20, localizeOptions); + } else if (seconds < 40) { + return locale.formatDistance('halfAMinute', 0, localizeOptions); + } else if (seconds < 60) { + return locale.formatDistance('lessThanXMinutes', 1, localizeOptions); + } else { + return locale.formatDistance('xMinutes', 1, localizeOptions); } - - if (key instanceof Collection) { - const msg = 'With simple keys, collection cannot be used as a key value'; - throw new Error(msg); + } else { + if (minutes === 0) { + return locale.formatDistance('lessThanXMinutes', 1, localizeOptions); + } else { + return locale.formatDistance('xMinutes', minutes, localizeOptions); } } - let explicitKey = !simpleKeys && (!key || keyComment || (key instanceof Node ? key instanceof Collection || key.type === PlainValue.Type.BLOCK_FOLDED || key.type === PlainValue.Type.BLOCK_LITERAL : typeof key === 'object')); - const { - doc, - indent, - indentStep, - stringify - } = ctx; - ctx = Object.assign({}, ctx, { - implicitKey: !explicitKey, - indent: indent + indentStep - }); - let chompKeep = false; - let str = stringify(key, ctx, () => keyComment = null, () => chompKeep = true); - str = addComment(str, ctx.indent, keyComment); - - if (!explicitKey && str.length > 1024) { - if (simpleKeys) throw new Error('With simple keys, single line scalar must not span more than 1024 characters'); - explicitKey = true; - } + // 2 mins up to 0.75 hrs + } else if (minutes < 45) { + return locale.formatDistance('xMinutes', minutes, localizeOptions); - if (ctx.allNullValues && !simpleKeys) { - if (this.comment) { - str = addComment(str, ctx.indent, this.comment); - if (onComment) onComment(); - } else if (chompKeep && !keyComment && onChompKeep) onChompKeep(); + // 0.75 hrs up to 1.5 hrs + } else if (minutes < 90) { + return locale.formatDistance('aboutXHours', 1, localizeOptions); - return ctx.inFlow && !explicitKey ? str : `? ${str}`; - } + // 1.5 hrs up to 24 hrs + } else if (minutes < MINUTES_IN_DAY) { + var hours = Math.round(minutes / 60); + return locale.formatDistance('aboutXHours', hours, localizeOptions); - str = explicitKey ? `? ${str}\n${indent}:` : `${str}:`; + // 1 day up to 1.75 days + } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) { + return locale.formatDistance('xDays', 1, localizeOptions); - if (this.comment) { - // expected (but not strictly required) to be a single-line comment - str = addComment(str, ctx.indent, this.comment); - if (onComment) onComment(); - } + // 1.75 days up to 30 days + } else if (minutes < MINUTES_IN_MONTH) { + var days = Math.round(minutes / MINUTES_IN_DAY); + return locale.formatDistance('xDays', days, localizeOptions); - let vcb = ''; - let valueComment = null; + // 1 month up to 2 months + } else if (minutes < MINUTES_IN_TWO_MONTHS) { + months = Math.round(minutes / MINUTES_IN_MONTH); + return locale.formatDistance('aboutXMonths', months, localizeOptions); + } + months = (0, _index3.default)(dateRight, dateLeft); - if (value instanceof Node) { - if (value.spaceBefore) vcb = '\n'; + // 2 months up to 12 months + if (months < 12) { + var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH); + return locale.formatDistance('xMonths', nearestMonth, localizeOptions); - if (value.commentBefore) { - const cs = value.commentBefore.replace(/^/gm, `${ctx.indent}#`); - vcb += `\n${cs}`; - } + // 1 year up to max Date + } else { + var monthsSinceStartOfYear = months % 12; + var years = Math.floor(months / 12); - valueComment = value.comment; - } else if (value && typeof value === 'object') { - value = doc.schema.createNode(value, true); - } + // N years up to 1 years 3 months + if (monthsSinceStartOfYear < 3) { + return locale.formatDistance('aboutXYears', years, localizeOptions); - ctx.implicitKey = false; - if (!explicitKey && !this.comment && value instanceof Scalar) ctx.indentAtStart = str.length + 1; - chompKeep = false; + // N years 3 months up to N years 9 months + } else if (monthsSinceStartOfYear < 9) { + return locale.formatDistance('overXYears', years, localizeOptions); - if (!indentSeq && indentSize >= 2 && !ctx.inFlow && !explicitKey && value instanceof YAMLSeq && value.type !== PlainValue.Type.FLOW_SEQ && !value.tag && !doc.anchors.getName(value)) { - // If indentSeq === false, consider '- ' as part of indentation where possible - ctx.indent = ctx.indent.substr(2); + // N years 9 months up to N year 12 months + } else { + return locale.formatDistance('almostXYears', years + 1, localizeOptions); } - - const valueStr = stringify(value, ctx, () => valueComment = null, () => chompKeep = true); - let ws = ' '; - - if (vcb || this.comment) { - ws = `${vcb}\n${ctx.indent}`; - } else if (!explicitKey && value instanceof Collection) { - const flow = valueStr[0] === '[' || valueStr[0] === '{'; - if (!flow || valueStr.includes('\n')) ws = `\n${ctx.indent}`; - } else if (valueStr[0] === '\n') ws = ''; - - if (chompKeep && !valueComment && onChompKeep) onChompKeep(); - return addComment(str + ws + valueStr, ctx.indent, valueComment); } - } +module.exports = exports.default; -PlainValue._defineProperty(Pair, "Type", { - PAIR: 'PAIR', - MERGE_PAIR: 'MERGE_PAIR' -}); +/***/ }), -const getAliasCount = (node, anchors) => { - if (node instanceof Alias) { - const anchor = anchors.get(node.source); - return anchor.count * anchor.aliasCount; - } else if (node instanceof Collection) { - let count = 0; +/***/ 7128: +/***/ ((module, exports, __nccwpck_require__) => { - for (const item of node.items) { - const c = getAliasCount(item, anchors); - if (c > count) count = c; - } +"use strict"; - return count; - } else if (node instanceof Pair) { - const kc = getAliasCount(node.key, anchors); - const vc = getAliasCount(node.value, anchors); - return Math.max(kc, vc); - } - return 1; -}; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatDistanceStrict; +var _index = __nccwpck_require__(9307); +var _index2 = _interopRequireDefault(__nccwpck_require__(7032)); +var _index3 = _interopRequireDefault(__nccwpck_require__(9818)); +var _index4 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index5 = _interopRequireDefault(__nccwpck_require__(7934)); +var _index6 = _interopRequireDefault(__nccwpck_require__(2631)); +var _index7 = _interopRequireDefault(__nccwpck_require__(618)); +var _index8 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_MINUTE = 1000 * 60; +var MINUTES_IN_DAY = 60 * 24; +var MINUTES_IN_MONTH = MINUTES_IN_DAY * 30; +var MINUTES_IN_YEAR = MINUTES_IN_DAY * 365; -class Alias extends Node { - static stringify({ - range, - source - }, { - anchors, - doc, - implicitKey, - inStringifyKey - }) { - let anchor = Object.keys(anchors).find(a => anchors[a] === source); - if (!anchor && inStringifyKey) anchor = doc.anchors.getName(source) || doc.anchors.newName(); - if (anchor) return `*${anchor}${implicitKey ? ' ' : ''}`; - const msg = doc.anchors.getName(source) ? 'Alias node must be after source node' : 'Source node not found for alias node'; - throw new Error(`${msg} [${range}]`); - } +/** + * @name formatDistanceStrict + * @category Common Helpers + * @summary Return the distance between the given dates in words. + * + * @description + * Return the distance between the given dates in words, using strict units. + * This is like `formatDistance`, but does not use helpers like 'almost', 'over', + * 'less than' and the like. + * + * | Distance between dates | Result | + * |------------------------|---------------------| + * | 0 ... 59 secs | [0..59] seconds | + * | 1 ... 59 mins | [1..59] minutes | + * | 1 ... 23 hrs | [1..23] hours | + * | 1 ... 29 days | [1..29] days | + * | 1 ... 11 months | [1..11] months | + * | 1 ... N years | [1..N] years | + * + * @param {Date|Number} date - the date + * @param {Date|Number} baseDate - the date to compare with + * @param {Object} [options] - an object with options. + * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first + * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit + * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {String} the distance in words + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `baseDate` must not be Invalid Date + * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round' + * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year' + * @throws {RangeError} `options.locale` must contain `formatDistance` property + * + * @example + * // What is the distance between 2 July 2014 and 1 January 2015? + * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2)) + * //=> '6 months' + * + * @example + * // What is the distance between 1 January 2015 00:00:15 + * // and 1 January 2015 00:00:00? + * const result = formatDistanceStrict( + * new Date(2015, 0, 1, 0, 0, 15), + * new Date(2015, 0, 1, 0, 0, 0) + * ) + * //=> '15 seconds' + * + * @example + * // What is the distance from 1 January 2016 + * // to 1 January 2015, with a suffix? + * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), { + * addSuffix: true + * }) + * //=> '1 year ago' + * + * @example + * // What is the distance from 1 January 2016 + * // to 1 January 2015, in minutes? + * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), { + * unit: 'minute' + * }) + * //=> '525600 minutes' + * + * @example + * // What is the distance from 1 January 2015 + * // to 28 January 2015, in months, rounded up? + * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), { + * unit: 'month', + * roundingMethod: 'ceil' + * }) + * //=> '1 month' + * + * @example + * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? + * import { eoLocale } from 'date-fns/locale/eo' + * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), { + * locale: eoLocale + * }) + * //=> '1 jaro' + */ - constructor(source) { - super(); - this.source = source; - this.type = PlainValue.Type.ALIAS; +function formatDistanceStrict(dirtyDate, dirtyBaseDate, options) { + var _ref, _options$locale, _options$roundingMeth; + (0, _index8.default)(2, arguments); + var defaultOptions = (0, _index.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 : _index7.default; + if (!locale.formatDistance) { + throw new RangeError('locale must contain localize.formatDistance property'); } - - set tag(t) { - throw new Error('Alias nodes cannot have tags'); + var comparison = (0, _index3.default)(dirtyDate, dirtyBaseDate); + if (isNaN(comparison)) { + throw new RangeError('Invalid time value'); } - - toJSON(arg, ctx) { - if (!ctx) return toJSON(this.source, arg, ctx); - const { - anchors, - maxAliasCount - } = ctx; - const anchor = anchors.get(this.source); - /* istanbul ignore if */ - - if (!anchor || anchor.res === undefined) { - const msg = 'This should not happen: Alias anchor was not resolved?'; - if (this.cstNode) throw new PlainValue.YAMLReferenceError(this.cstNode, msg);else throw new ReferenceError(msg); - } - - if (maxAliasCount >= 0) { - anchor.count += 1; - if (anchor.aliasCount === 0) anchor.aliasCount = getAliasCount(this.source, anchors); - - if (anchor.count * anchor.aliasCount > maxAliasCount) { - const msg = 'Excessive alias count indicates a resource exhaustion attack'; - if (this.cstNode) throw new PlainValue.YAMLReferenceError(this.cstNode, msg);else throw new ReferenceError(msg); - } - } - - return anchor.res; - } // Only called when stringifying an alias mapping key while constructing - // Object output. - - - toString(ctx) { - return Alias.stringify(this, ctx); + var localizeOptions = (0, _index6.default)((0, _index5.default)(options), { + addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix), + comparison: comparison + }); + var dateLeft; + var dateRight; + if (comparison > 0) { + dateLeft = (0, _index4.default)(dirtyBaseDate); + dateRight = (0, _index4.default)(dirtyDate); + } else { + dateLeft = (0, _index4.default)(dirtyDate); + dateRight = (0, _index4.default)(dirtyBaseDate); } - -} - -PlainValue._defineProperty(Alias, "default", true); - -function findPair(items, key) { - const k = key instanceof Scalar ? key.value : key; - - for (const it of items) { - if (it instanceof Pair) { - if (it.key === key || it.key === k) return it; - if (it.key && it.key.value === k) return it; - } + var roundingMethod = String((_options$roundingMeth = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth !== void 0 ? _options$roundingMeth : 'round'); + var roundingMethodFn; + if (roundingMethod === 'floor') { + roundingMethodFn = Math.floor; + } else if (roundingMethod === 'ceil') { + roundingMethodFn = Math.ceil; + } else if (roundingMethod === 'round') { + roundingMethodFn = Math.round; + } else { + throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'"); } + var milliseconds = dateRight.getTime() - dateLeft.getTime(); + var minutes = milliseconds / MILLISECONDS_IN_MINUTE; + var timezoneOffset = (0, _index2.default)(dateRight) - (0, _index2.default)(dateLeft); - return undefined; -} -class YAMLMap extends Collection { - add(pair, overwrite) { - if (!pair) pair = new Pair(pair);else if (!(pair instanceof Pair)) pair = new Pair(pair.key || pair, pair.value); - const prev = findPair(this.items, pair.key); - const sortEntries = this.schema && this.schema.sortMapEntries; - - if (prev) { - if (overwrite) prev.value = pair.value;else throw new Error(`Key ${pair.key} already set`); - } else if (sortEntries) { - const i = this.items.findIndex(item => sortEntries(pair, item) < 0); - if (i === -1) this.items.push(pair);else this.items.splice(i, 0, pair); + // Use DST-normalized difference in minutes for years, months and days; + // use regular difference in minutes for hours, minutes and seconds. + var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE; + var defaultUnit = options === null || options === void 0 ? void 0 : options.unit; + var unit; + if (!defaultUnit) { + if (minutes < 1) { + unit = 'second'; + } else if (minutes < 60) { + unit = 'minute'; + } else if (minutes < MINUTES_IN_DAY) { + unit = 'hour'; + } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) { + unit = 'day'; + } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) { + unit = 'month'; } else { - this.items.push(pair); + unit = 'year'; } + } else { + unit = String(defaultUnit); } - delete(key) { - const it = findPair(this.items, key); - if (!it) return false; - const del = this.items.splice(this.items.indexOf(it), 1); - return del.length > 0; - } - - get(key, keepScalar) { - const it = findPair(this.items, key); - const node = it && it.value; - return !keepScalar && node instanceof Scalar ? node.value : node; - } - - has(key) { - return !!findPair(this.items, key); - } + // 0 up to 60 seconds + if (unit === 'second') { + var seconds = roundingMethodFn(milliseconds / 1000); + return locale.formatDistance('xSeconds', seconds, localizeOptions); - set(key, value) { - this.add(new Pair(key, value), true); - } - /** - * @param {*} arg ignored - * @param {*} ctx Conversion context, originally set in Document#toJSON() - * @param {Class} Type If set, forces the returned collection type - * @returns {*} Instance of Type, Map, or Object - */ + // 1 up to 60 mins + } else if (unit === 'minute') { + var roundedMinutes = roundingMethodFn(minutes); + return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions); + // 1 up to 24 hours + } else if (unit === 'hour') { + var hours = roundingMethodFn(minutes / 60); + return locale.formatDistance('xHours', hours, localizeOptions); - toJSON(_, ctx, Type) { - const map = Type ? new Type() : ctx && ctx.mapAsMap ? new Map() : {}; - if (ctx && ctx.onCreate) ctx.onCreate(map); + // 1 up to 30 days + } else if (unit === 'day') { + var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY); + return locale.formatDistance('xDays', days, localizeOptions); - for (const item of this.items) item.addToJSMap(ctx, map); + // 1 up to 12 months + } else if (unit === 'month') { + var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH); + return months === 12 && defaultUnit !== 'month' ? locale.formatDistance('xYears', 1, localizeOptions) : locale.formatDistance('xMonths', months, localizeOptions); - return map; + // 1 year up to max Date + } else if (unit === 'year') { + var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR); + return locale.formatDistance('xYears', years, localizeOptions); } + throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'"); +} +module.exports = exports.default; - toString(ctx, onComment, onChompKeep) { - if (!ctx) return JSON.stringify(this); +/***/ }), - for (const item of this.items) { - if (!(item instanceof Pair)) throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`); - } +/***/ 1163: +/***/ ((module, exports, __nccwpck_require__) => { - return super.toString(ctx, { - blockItem: n => n.str, - flowChars: { - start: '{', - end: '}' - }, - isMap: true, - itemIndent: ctx.indent || '' - }, onComment, onChompKeep); - } +"use strict"; -} -const MERGE_KEY = '<<'; -class Merge extends Pair { - constructor(pair) { - if (pair instanceof Pair) { - let seq = pair.value; - - if (!(seq instanceof YAMLSeq)) { - seq = new YAMLSeq(); - seq.items.push(pair.value); - seq.range = pair.value.range; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatDistanceToNow; +var _index = _interopRequireDefault(__nccwpck_require__(8149)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name formatDistanceToNow + * @category Common Helpers + * @summary Return the distance between the given date and now in words. + * @pure false + * + * @description + * Return the distance between the given date and now in words. + * + * | Distance to now | Result | + * |-------------------------------------------------------------------|---------------------| + * | 0 ... 30 secs | less than a minute | + * | 30 secs ... 1 min 30 secs | 1 minute | + * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | + * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | + * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | + * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | + * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | + * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | + * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | + * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | + * | 1 yr ... 1 yr 3 months | about 1 year | + * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | + * | 1 yr 9 months ... 2 yrs | almost 2 years | + * | N yrs ... N yrs 3 months | about N years | + * | N yrs 3 months ... N yrs 9 months | over N years | + * | N yrs 9 months ... N+1 yrs | almost N+1 years | + * + * With `options.includeSeconds == true`: + * | Distance to now | Result | + * |---------------------|----------------------| + * | 0 secs ... 5 secs | less than 5 seconds | + * | 5 secs ... 10 secs | less than 10 seconds | + * | 10 secs ... 20 secs | less than 20 seconds | + * | 20 secs ... 40 secs | half a minute | + * | 40 secs ... 60 secs | less than a minute | + * | 60 secs ... 90 secs | 1 minute | + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the given date + * @param {Object} [options] - the object with options + * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed + * @param {Boolean} [options.addSuffix=false] - result specifies if now is earlier or later than the passed date + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {String} the distance in words + * @throws {TypeError} 1 argument required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `options.locale` must contain `formatDistance` property + * + * @example + * // If today is 1 January 2015, what is the distance to 2 July 2014? + * const result = formatDistanceToNow( + * new Date(2014, 6, 2) + * ) + * //=> '6 months' + * + * @example + * // If now is 1 January 2015 00:00:00, + * // what is the distance to 1 January 2015 00:00:15, including seconds? + * const result = formatDistanceToNow( + * new Date(2015, 0, 1, 0, 0, 15), + * {includeSeconds: true} + * ) + * //=> 'less than 20 seconds' + * + * @example + * // If today is 1 January 2015, + * // what is the distance to 1 January 2016, with a suffix? + * const result = formatDistanceToNow( + * new Date(2016, 0, 1), + * {addSuffix: true} + * ) + * //=> 'in about 1 year' + * + * @example + * // If today is 1 January 2015, + * // what is the distance to 1 August 2016 in Esperanto? + * const eoLocale = require('date-fns/locale/eo') + * const result = formatDistanceToNow( + * new Date(2016, 7, 1), + * {locale: eoLocale} + * ) + * //=> 'pli ol 1 jaro' + */ +function formatDistanceToNow(dirtyDate, options) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, Date.now(), options); +} +module.exports = exports.default; - super(pair.key, seq); - this.range = pair.range; - } else { - super(new Scalar(MERGE_KEY), new YAMLSeq()); - } +/***/ }), - this.type = Pair.Type.MERGE_PAIR; - } // If the value associated with a merge key is a single mapping node, each of - // its key/value pairs is inserted into the current mapping, unless the key - // already exists in it. If the value associated with the merge key is a - // sequence, then this sequence is expected to contain mapping nodes and each - // of these nodes is merged in turn according to its order in the sequence. - // Keys in mapping nodes earlier in the sequence override keys specified in - // later mapping nodes. -- http://yaml.org/type/merge.html +/***/ 4741: +/***/ ((module, exports, __nccwpck_require__) => { +"use strict"; - addToJSMap(ctx, map) { - for (const { - source - } of this.value.items) { - if (!(source instanceof YAMLMap)) throw new Error('Merge sources must be maps'); - const srcMap = source.toJSON(null, ctx, Map); - for (const [key, value] of srcMap) { - if (map instanceof Map) { - if (!map.has(key)) map.set(key, value); - } else if (map instanceof Set) { - map.add(key); - } else if (!Object.prototype.hasOwnProperty.call(map, key)) { - Object.defineProperty(map, key, { - value, - writable: true, - enumerable: true, - configurable: true - }); - } - } - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatDistanceToNowStrict; +var _index = _interopRequireDefault(__nccwpck_require__(7128)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name formatDistanceToNowStrict + * @category Common Helpers + * @summary Return the distance between the given date and now in words. + * @pure false + * + * @description + * Return the distance between the given dates in words, using strict units. + * This is like `formatDistance`, but does not use helpers like 'almost', 'over', + * 'less than' and the like. + * + * | Distance between dates | Result | + * |------------------------|---------------------| + * | 0 ... 59 secs | [0..59] seconds | + * | 1 ... 59 mins | [1..59] minutes | + * | 1 ... 23 hrs | [1..23] hours | + * | 1 ... 29 days | [1..29] days | + * | 1 ... 11 months | [1..11] months | + * | 1 ... N years | [1..N] years | + * + * @param {Date|Number} date - the given date + * @param {Object} [options] - an object with options. + * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first + * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit + * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {String} the distance in words + * @throws {TypeError} 1 argument required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `options.locale` must contain `formatDistance` property + * + * @example + * // If today is 1 January 2015, what is the distance to 2 July 2014? + * const result = formatDistanceToNowStrict( + * new Date(2014, 6, 2) + * ) + * //=> '6 months' + * + * @example + * // If now is 1 January 2015 00:00:00, + * // what is the distance to 1 January 2015 00:00:15, including seconds? + * const result = formatDistanceToNowStrict( + * new Date(2015, 0, 1, 0, 0, 15) + * ) + * //=> '15 seconds' + * + * @example + * // If today is 1 January 2015, + * // what is the distance to 1 January 2016, with a suffix? + * const result = formatDistanceToNowStrict( + * new Date(2016, 0, 1), + * {addSuffix: true} + * ) + * //=> 'in 1 year' + * + * @example + * // If today is 28 January 2015, + * // what is the distance to 1 January 2015, in months, rounded up?? + * const result = formatDistanceToNowStrict(new Date(2015, 0, 1), { + * unit: 'month', + * roundingMethod: 'ceil' + * }) + * //=> '1 month' + * + * @example + * // If today is 1 January 2015, + * // what is the distance to 1 January 2016 in Esperanto? + * const eoLocale = require('date-fns/locale/eo') + * const result = formatDistanceToNowStrict( + * new Date(2016, 0, 1), + * {locale: eoLocale} + * ) + * //=> '1 jaro' + */ +function formatDistanceToNowStrict(dirtyDate, options) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, Date.now(), options); +} +module.exports = exports.default; - return map; - } +/***/ }), - toString(ctx, onComment) { - const seq = this.value; - if (seq.items.length > 1) return super.toString(ctx, onComment); - this.value = seq.items[0]; - const str = super.toString(ctx, onComment); - this.value = seq; - return str; - } +/***/ 8917: +/***/ ((module, exports, __nccwpck_require__) => { -} +"use strict"; -const binaryOptions = { - defaultType: PlainValue.Type.BLOCK_LITERAL, - lineWidth: 76 -}; -const boolOptions = { - trueStr: 'true', - falseStr: 'false' -}; -const intOptions = { - asBigInt: false -}; -const nullOptions = { - nullStr: 'null' -}; -const strOptions = { - defaultType: PlainValue.Type.PLAIN, - doubleQuoted: { - jsonEncoding: false, - minMultiLineLength: 40 - }, - fold: { - lineWidth: 80, - minContentWidth: 20 - } -}; -function resolveScalar(str, tags, scalarFallback) { - for (const { - format, - test, - resolve - } of tags) { - if (test) { - const match = str.match(test); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatDuration; +var _index = __nccwpck_require__(9307); +var _index2 = _interopRequireDefault(__nccwpck_require__(618)); +var defaultFormat = ['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']; - if (match) { - let res = resolve.apply(null, match); - if (!(res instanceof Scalar)) res = new Scalar(res); - if (format) res.format = format; - return res; - } - } +/** + * @name formatDuration + * @category Common Helpers + * @summary Formats a duration in human-readable format + * + * @description + * Return human-readable duration string i.e. "9 months 2 days" + * + * @param {Duration} duration - the duration to format + * @param {Object} [options] - an object with options. + * @param {string[]} [options.format=['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']] - the array of units to format + * @param {boolean} [options.zero=false] - should zeros be included in the output? + * @param {string} [options.delimiter=' '] - delimiter string + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {string} the formatted date string + * @throws {TypeError} 1 argument required + * + * @example + * // Format full duration + * formatDuration({ + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }) + * //=> '2 years 9 months 1 week 7 days 5 hours 9 minutes 30 seconds' + * + * @example + * // Format partial duration + * formatDuration({ months: 9, days: 2 }) + * //=> '9 months 2 days' + * + * @example + * // Customize the format + * formatDuration( + * { + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }, + * { format: ['months', 'weeks'] } + * ) === '9 months 1 week' + * + * @example + * // Customize the zeros presence + * formatDuration({ years: 0, months: 9 }) + * //=> '9 months' + * formatDuration({ years: 0, months: 9 }, { zero: true }) + * //=> '0 years 9 months' + * + * @example + * // Customize the delimiter + * formatDuration({ years: 2, months: 9, weeks: 3 }, { delimiter: ', ' }) + * //=> '2 years, 9 months, 3 weeks' + */ +function formatDuration(duration, options) { + var _ref, _options$locale, _options$format, _options$zero, _options$delimiter; + if (arguments.length < 1) { + throw new TypeError("1 argument required, but only ".concat(arguments.length, " present")); } - - if (scalarFallback) str = scalarFallback(str); - return new Scalar(str); + var defaultOptions = (0, _index.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 : _index2.default; + var format = (_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : defaultFormat; + var zero = (_options$zero = options === null || options === void 0 ? void 0 : options.zero) !== null && _options$zero !== void 0 ? _options$zero : false; + var delimiter = (_options$delimiter = options === null || options === void 0 ? void 0 : options.delimiter) !== null && _options$delimiter !== void 0 ? _options$delimiter : ' '; + if (!locale.formatDistance) { + return ''; + } + var result = format.reduce(function (acc, unit) { + var token = "x".concat(unit.replace(/(^.)/, function (m) { + return m.toUpperCase(); + })); + var value = duration[unit]; + if (typeof value === 'number' && (zero || duration[unit])) { + return acc.concat(locale.formatDistance(token, value)); + } + return acc; + }, []).join(delimiter); + return result; } +module.exports = exports.default; -const FOLD_FLOW = 'flow'; -const FOLD_BLOCK = 'block'; -const FOLD_QUOTED = 'quoted'; // presumes i+1 is at the start of a line -// returns index of last newline in more-indented block +/***/ }), -const consumeMoreIndentedLines = (text, i) => { - let ch = text[i + 1]; +/***/ 3385: +/***/ ((module, exports, __nccwpck_require__) => { - while (ch === ' ' || ch === '\t') { - do { - ch = text[i += 1]; - } while (ch && ch !== '\n'); +"use strict"; - ch = text[i + 1]; - } - return i; -}; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatISO; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8794)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * Tries to keep input at up to `lineWidth` characters, splitting only on spaces - * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are - * terminated with `\n` and started with `indent`. + * @name formatISO + * @category Common Helpers + * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm). * - * @param {string} text - * @param {string} indent - * @param {string} [mode='flow'] `'block'` prevents more-indented lines - * from being folded; `'quoted'` allows for `\` escapes, including escaped - * newlines - * @param {Object} options - * @param {number} [options.indentAtStart] Accounts for leading contents on - * the first line, defaulting to `indent.length` - * @param {number} [options.lineWidth=80] - * @param {number} [options.minContentWidth=20] Allow highly indented lines to - * stretch the line width or indent content from the start - * @param {function} options.onFold Called once if the text is folded - * @param {function} options.onFold Called once if any line of text exceeds - * lineWidth characters + * @description + * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date. + * + * @param {Date|Number} date - the original date + * @param {Object} [options] - an object with options. + * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values. + * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with local time zone, or both. + * @returns {String} the formatted date string (in local time zone) + * @throws {TypeError} 1 argument required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `options.format` must be 'extended' or 'basic' + * @throws {RangeError} `options.representation` must be 'date', 'time' or 'complete' + * + * @example + * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC): + * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52)) + * //=> '2019-09-18T19:00:52Z' + * + * @example + * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC): + * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' }) + * //=> '20190918T190052' + * + * @example + * // Represent 18 September 2019 in ISO 8601 format, date only: + * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' }) + * //=> '2019-09-18' + * + * @example + * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC): + * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) + * //=> '19:00:52Z' */ - - -function foldFlowLines(text, indent, mode, { - indentAtStart, - lineWidth = 80, - minContentWidth = 20, - onFold, - onOverflow -}) { - if (!lineWidth || lineWidth < 0) return text; - const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); - if (text.length <= endStep) return text; - const folds = []; - const escapedFolds = {}; - let end = lineWidth - indent.length; - - if (typeof indentAtStart === 'number') { - if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);else end = lineWidth - indentAtStart; +function formatISO(date, options) { + var _options$format, _options$representati; + (0, _index3.default)(1, arguments); + var originalDate = (0, _index.default)(date); + if (isNaN(originalDate.getTime())) { + throw new RangeError('Invalid time value'); } - - let split = undefined; - let prev = undefined; - let overflow = false; - let i = -1; - let escStart = -1; - let escEnd = -1; - - if (mode === FOLD_BLOCK) { - i = consumeMoreIndentedLines(text, i); - if (i !== -1) end = i + endStep; + var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : 'extended'); + var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : 'complete'); + if (format !== 'extended' && format !== 'basic') { + throw new RangeError("format must be 'extended' or 'basic'"); } + if (representation !== 'date' && representation !== 'time' && representation !== 'complete') { + throw new RangeError("representation must be 'date', 'time', or 'complete'"); + } + var result = ''; + var tzOffset = ''; + var dateDelimiter = format === 'extended' ? '-' : ''; + var timeDelimiter = format === 'extended' ? ':' : ''; - for (let ch; ch = text[i += 1];) { - if (mode === FOLD_QUOTED && ch === '\\') { - escStart = i; - - switch (text[i + 1]) { - case 'x': - i += 3; - break; - - case 'u': - i += 5; - break; - - case 'U': - i += 9; - break; + // Representation is either 'date' or 'complete' + if (representation !== 'time') { + var day = (0, _index2.default)(originalDate.getDate(), 2); + var month = (0, _index2.default)(originalDate.getMonth() + 1, 2); + var year = (0, _index2.default)(originalDate.getFullYear(), 4); - default: - i += 1; - } + // yyyyMMdd or yyyy-MM-dd. + result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day); + } - escEnd = i; + // Representation is either 'time' or 'complete' + if (representation !== 'date') { + // Add the timezone. + var offset = originalDate.getTimezoneOffset(); + if (offset !== 0) { + var absoluteOffset = Math.abs(offset); + var hourOffset = (0, _index2.default)(Math.floor(absoluteOffset / 60), 2); + var minuteOffset = (0, _index2.default)(absoluteOffset % 60, 2); + // If less than 0, the sign is +, because it is ahead of time. + var sign = offset < 0 ? '+' : '-'; + tzOffset = "".concat(sign).concat(hourOffset, ":").concat(minuteOffset); + } else { + tzOffset = 'Z'; } + var hour = (0, _index2.default)(originalDate.getHours(), 2); + var minute = (0, _index2.default)(originalDate.getMinutes(), 2); + var second = (0, _index2.default)(originalDate.getSeconds(), 2); - if (ch === '\n') { - if (mode === FOLD_BLOCK) i = consumeMoreIndentedLines(text, i); - end = i + endStep; - split = undefined; - } else { - if (ch === ' ' && prev && prev !== ' ' && prev !== '\n' && prev !== '\t') { - // space surrounded by non-space can be replaced with newline + indent - const next = text[i + 1]; - if (next && next !== ' ' && next !== '\n' && next !== '\t') split = i; - } + // If there's also date, separate it with time with 'T' + var separator = result === '' ? '' : 'T'; - if (i >= end) { - if (split) { - folds.push(split); - end = split + endStep; - split = undefined; - } else if (mode === FOLD_QUOTED) { - // white-space collected at end may stretch past lineWidth - while (prev === ' ' || prev === '\t') { - prev = ch; - ch = text[i += 1]; - overflow = true; - } // Account for newline escape, but don't break preceding escape + // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined. + var time = [hour, minute, second].join(timeDelimiter); + // HHmmss or HH:mm:ss. + result = "".concat(result).concat(separator).concat(time).concat(tzOffset); + } + return result; +} +module.exports = exports.default; - const j = i > escEnd + 1 ? i - 2 : escStart - 1; // Bail out if lineWidth & minContentWidth are shorter than an escape string +/***/ }), - if (escapedFolds[j]) return text; - folds.push(j); - escapedFolds[j] = true; - end = j + endStep; - split = undefined; - } else { - overflow = true; - } - } - } +/***/ 5296: +/***/ ((module, exports, __nccwpck_require__) => { - prev = ch; - } +"use strict"; - if (overflow && onOverflow) onOverflow(); - if (folds.length === 0) return text; - if (onFold) onFold(); - let res = text.slice(0, folds[0]); - for (let i = 0; i < folds.length; ++i) { - const fold = folds[i]; - const end = folds[i + 1] || text.length; - if (fold === 0) res = `\n${indent}${text.slice(0, end)}`;else { - if (mode === FOLD_QUOTED && escapedFolds[fold]) res += `${text[fold]}\\`; - res += `\n${indent}${text.slice(fold + 1, end)}`; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatISO9075; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(9920)); +var _index3 = _interopRequireDefault(__nccwpck_require__(8794)); +/** + * @name formatISO9075 + * @category Common Helpers + * @summary Format the date according to the ISO 9075 standard (https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_get-format). + * + * @description + * Return the formatted date string in ISO 9075 format. Options may be passed to control the parts and notations of the date. + * + * @param {Date|Number} date - the original date + * @param {Object} [options] - an object with options. + * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values. + * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time, or both. + * @returns {String} the formatted date string + * @throws {TypeError} 1 argument required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `options.format` must be 'extended' or 'basic' + * @throws {RangeError} `options.representation` must be 'date', 'time' or 'complete' + * + * @example + * // Represent 18 September 2019 in ISO 9075 format: + * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52)) + * //=> '2019-09-18 19:00:52' + * + * @example + * // Represent 18 September 2019 in ISO 9075, short format: + * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' }) + * //=> '20190918 190052' + * + * @example + * // Represent 18 September 2019 in ISO 9075 format, date only: + * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' }) + * //=> '2019-09-18' + * + * @example + * // Represent 18 September 2019 in ISO 9075 format, time only: + * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) + * //=> '19:00:52' + */ +function formatISO9075(dirtyDate, options) { + var _options$format, _options$representati; + if (arguments.length < 1) { + throw new TypeError("1 argument required, but only ".concat(arguments.length, " present")); } + var originalDate = (0, _index.default)(dirtyDate); + if (!(0, _index2.default)(originalDate)) { + throw new RangeError('Invalid time value'); + } + var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : 'extended'); + var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : 'complete'); + if (format !== 'extended' && format !== 'basic') { + throw new RangeError("format must be 'extended' or 'basic'"); + } + if (representation !== 'date' && representation !== 'time' && representation !== 'complete') { + throw new RangeError("representation must be 'date', 'time', or 'complete'"); + } + var result = ''; + var dateDelimiter = format === 'extended' ? '-' : ''; + var timeDelimiter = format === 'extended' ? ':' : ''; - return res; -} - -const getFoldOptions = ({ - indentAtStart -}) => indentAtStart ? Object.assign({ - indentAtStart -}, strOptions.fold) : strOptions.fold; // Also checks for lines starting with %, as parsing the output as YAML 1.1 will -// presume that's starting a new document. + // Representation is either 'date' or 'complete' + if (representation !== 'time') { + var day = (0, _index3.default)(originalDate.getDate(), 2); + var month = (0, _index3.default)(originalDate.getMonth() + 1, 2); + var year = (0, _index3.default)(originalDate.getFullYear(), 4); + // yyyyMMdd or yyyy-MM-dd. + result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day); + } -const containsDocumentMarker = str => /^(%|---|\.\.\.)/m.test(str); + // Representation is either 'time' or 'complete' + if (representation !== 'date') { + var hour = (0, _index3.default)(originalDate.getHours(), 2); + var minute = (0, _index3.default)(originalDate.getMinutes(), 2); + var second = (0, _index3.default)(originalDate.getSeconds(), 2); -function lineLengthOverLimit(str, lineWidth, indentLength) { - if (!lineWidth || lineWidth < 0) return false; - const limit = lineWidth - indentLength; - const strLen = str.length; - if (strLen <= limit) return false; + // If there's also date, separate it with time with a space + var separator = result === '' ? '' : ' '; - for (let i = 0, start = 0; i < strLen; ++i) { - if (str[i] === '\n') { - if (i - start > limit) return true; - start = i + 1; - if (strLen - start <= limit) return false; - } + // HHmmss or HH:mm:ss. + result = "".concat(result).concat(separator).concat(hour).concat(timeDelimiter).concat(minute).concat(timeDelimiter).concat(second); } - - return true; + return result; } +module.exports = exports.default; -function doubleQuotedString(value, ctx) { - const { - implicitKey - } = ctx; - const { - jsonEncoding, - minMultiLineLength - } = strOptions.doubleQuoted; - const json = JSON.stringify(value); - if (jsonEncoding) return json; - const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : ''); - let str = ''; - let start = 0; - - for (let i = 0, ch = json[i]; ch; ch = json[++i]) { - if (ch === ' ' && json[i + 1] === '\\' && json[i + 2] === 'n') { - // space before newline needs to be escaped to not be folded - str += json.slice(start, i) + '\\ '; - i += 1; - start = i; - ch = '\\'; - } - - if (ch === '\\') switch (json[i + 1]) { - case 'u': - { - str += json.slice(start, i); - const code = json.substr(i + 2, 4); +/***/ }), - switch (code) { - case '0000': - str += '\\0'; - break; +/***/ 2448: +/***/ ((module, exports, __nccwpck_require__) => { - case '0007': - str += '\\a'; - break; +"use strict"; - case '000b': - str += '\\v'; - break; - case '001b': - str += '\\e'; - break; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatISODuration; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name formatISODuration + * @category Common Helpers + * @summary Format a duration object according as ISO 8601 duration string + * + * @description + * Format a duration object according to the ISO 8601 duration standard (https://www.digi.com/resources/documentation/digidocs/90001437-13/reference/r_iso_8601_duration_format.htm) + * + * @param {Duration} duration - the duration to format + * + * @returns {String} The ISO 8601 duration string + * @throws {TypeError} Requires 1 argument + * @throws {Error} Argument must be an object + * + * @example + * // Format the given duration as ISO 8601 string + * const result = formatISODuration({ + * years: 39, + * months: 2, + * days: 20, + * hours: 7, + * minutes: 5, + * seconds: 0 + * }) + * //=> 'P39Y2M20DT0H0M0S' + */ +function formatISODuration(duration) { + (0, _index.default)(1, arguments); + if ((0, _typeof2.default)(duration) !== 'object') throw new Error('Duration must be an object'); + var _duration$years = duration.years, + years = _duration$years === void 0 ? 0 : _duration$years, + _duration$months = duration.months, + months = _duration$months === void 0 ? 0 : _duration$months, + _duration$days = duration.days, + days = _duration$days === void 0 ? 0 : _duration$days, + _duration$hours = duration.hours, + hours = _duration$hours === void 0 ? 0 : _duration$hours, + _duration$minutes = duration.minutes, + minutes = _duration$minutes === void 0 ? 0 : _duration$minutes, + _duration$seconds = duration.seconds, + seconds = _duration$seconds === void 0 ? 0 : _duration$seconds; + return "P".concat(years, "Y").concat(months, "M").concat(days, "DT").concat(hours, "H").concat(minutes, "M").concat(seconds, "S"); +} +module.exports = exports.default; - case '0085': - str += '\\N'; - break; +/***/ }), - case '00a0': - str += '\\_'; - break; +/***/ 4182: +/***/ ((module, exports, __nccwpck_require__) => { - case '2028': - str += '\\L'; - break; +"use strict"; - case '2029': - str += '\\P'; - break; - default: - if (code.substr(0, 2) === '00') str += '\\x' + code.substr(2);else str += json.substr(i, 6); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatRFC3339; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(9920)); +var _index3 = _interopRequireDefault(__nccwpck_require__(8794)); +var _index4 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name formatRFC3339 + * @category Common Helpers + * @summary Format the date according to the RFC 3339 standard (https://tools.ietf.org/html/rfc3339#section-5.6). + * + * @description + * Return the formatted date string in RFC 3339 format. Options may be passed to control the parts and notations of the date. + * + * @param {Date|Number} date - the original date + * @param {Object} [options] - an object with options. + * @param {0|1|2|3} [options.fractionDigits=0] - number of digits after the decimal point after seconds + * @returns {String} the formatted date string + * @throws {TypeError} 1 argument required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `options.fractionDigits` must be between 0 and 3 + * + * @example + * // Represent 18 September 2019 in RFC 3339 format: + * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52)) + * //=> '2019-09-18T19:00:52Z' + * + * @example + * // Represent 18 September 2019 in RFC 3339 format, 2 digits of second fraction: + * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { fractionDigits: 2 }) + * //=> '2019-09-18T19:00:52.23Z' + * + * @example + * // Represent 18 September 2019 in RFC 3339 format, 3 digits of second fraction + * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { fractionDigits: 3 }) + * //=> '2019-09-18T19:00:52.234Z' + */ +function formatRFC3339(dirtyDate, options) { + var _options$fractionDigi; + if (arguments.length < 1) { + throw new TypeError("1 arguments required, but only ".concat(arguments.length, " present")); + } + var originalDate = (0, _index.default)(dirtyDate); + if (!(0, _index2.default)(originalDate)) { + throw new RangeError('Invalid time value'); + } + var fractionDigits = Number((_options$fractionDigi = options === null || options === void 0 ? void 0 : options.fractionDigits) !== null && _options$fractionDigi !== void 0 ? _options$fractionDigi : 0); - i += 5; - start = i + 1; - } - break; + // Test if fractionDigits is between 0 and 3 _and_ is not NaN + if (!(fractionDigits >= 0 && fractionDigits <= 3)) { + throw new RangeError('fractionDigits must be between 0 and 3 inclusively'); + } + var day = (0, _index3.default)(originalDate.getDate(), 2); + var month = (0, _index3.default)(originalDate.getMonth() + 1, 2); + var year = originalDate.getFullYear(); + var hour = (0, _index3.default)(originalDate.getHours(), 2); + var minute = (0, _index3.default)(originalDate.getMinutes(), 2); + var second = (0, _index3.default)(originalDate.getSeconds(), 2); + var fractionalSecond = ''; + if (fractionDigits > 0) { + var milliseconds = originalDate.getMilliseconds(); + var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, fractionDigits - 3)); + fractionalSecond = '.' + (0, _index3.default)(fractionalSeconds, fractionDigits); + } + var offset = ''; + var tzOffset = originalDate.getTimezoneOffset(); + if (tzOffset !== 0) { + var absoluteOffset = Math.abs(tzOffset); + var hourOffset = (0, _index3.default)((0, _index4.default)(absoluteOffset / 60), 2); + var minuteOffset = (0, _index3.default)(absoluteOffset % 60, 2); + // If less than 0, the sign is +, because it is ahead of time. + var sign = tzOffset < 0 ? '+' : '-'; + offset = "".concat(sign).concat(hourOffset, ":").concat(minuteOffset); + } else { + offset = 'Z'; + } + return "".concat(year, "-").concat(month, "-").concat(day, "T").concat(hour, ":").concat(minute, ":").concat(second).concat(fractionalSecond).concat(offset); +} +module.exports = exports.default; - case 'n': - if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) { - i += 1; - } else { - // folding will eat first newline - str += json.slice(start, i) + '\n\n'; +/***/ }), - while (json[i + 2] === '\\' && json[i + 3] === 'n' && json[i + 4] !== '"') { - str += '\n'; - i += 2; - } +/***/ 1832: +/***/ ((module, exports, __nccwpck_require__) => { - str += indent; // space after newline needs to be escaped to not be folded +"use strict"; - if (json[i + 2] === ' ') str += '\\'; - i += 1; - start = i + 1; - } - break; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatRFC7231; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(9920)); +var _index3 = _interopRequireDefault(__nccwpck_require__(8794)); +var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - default: - i += 1; - } +/** + * @name formatRFC7231 + * @category Common Helpers + * @summary Format the date according to the RFC 7231 standard (https://tools.ietf.org/html/rfc7231#section-7.1.1.1). + * + * @description + * Return the formatted date string in RFC 7231 format. + * The result will always be in UTC timezone. + * + * @param {Date|Number} date - the original date + * @returns {String} the formatted date string + * @throws {TypeError} 1 argument required + * @throws {RangeError} `date` must not be Invalid Date + * + * @example + * // Represent 18 September 2019 in RFC 7231 format: + * const result = formatRFC7231(new Date(2019, 8, 18, 19, 0, 52)) + * //=> 'Wed, 18 Sep 2019 19:00:52 GMT' + */ +function formatRFC7231(dirtyDate) { + if (arguments.length < 1) { + throw new TypeError("1 arguments required, but only ".concat(arguments.length, " present")); } - - str = start ? str + json.slice(start) : json; - return implicitKey ? str : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx)); -} - -function singleQuotedString(value, ctx) { - if (ctx.implicitKey) { - if (/\n/.test(value)) return doubleQuotedString(value, ctx); - } else { - // single quoted string can't have leading or trailing whitespace around newline - if (/[ \t]\n|\n[ \t]/.test(value)) return doubleQuotedString(value, ctx); + var originalDate = (0, _index.default)(dirtyDate); + if (!(0, _index2.default)(originalDate)) { + throw new RangeError('Invalid time value'); } + var dayName = days[originalDate.getUTCDay()]; + var dayOfMonth = (0, _index3.default)(originalDate.getUTCDate(), 2); + var monthName = months[originalDate.getUTCMonth()]; + var year = originalDate.getUTCFullYear(); + var hour = (0, _index3.default)(originalDate.getUTCHours(), 2); + var minute = (0, _index3.default)(originalDate.getUTCMinutes(), 2); + var second = (0, _index3.default)(originalDate.getUTCSeconds(), 2); - const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : ''); - const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'"; - return ctx.implicitKey ? res : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx)); + // Result variables. + return "".concat(dayName, ", ").concat(dayOfMonth, " ").concat(monthName, " ").concat(year, " ").concat(hour, ":").concat(minute, ":").concat(second, " GMT"); } +module.exports = exports.default; -function blockString({ - comment, - type, - value -}, ctx, onComment, onChompKeep) { - // 1. Block can't end in whitespace unless the last line is non-empty. - // 2. Strings consisting of only whitespace are best rendered explicitly. - if (/\n[\t ]+$/.test(value) || /^\s*$/.test(value)) { - return doubleQuotedString(value, ctx); - } - - const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : ''); - const indentSize = indent ? '2' : '1'; // root is at -1 - - const literal = type === PlainValue.Type.BLOCK_FOLDED ? false : type === PlainValue.Type.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, strOptions.fold.lineWidth, indent.length); - let header = literal ? '|' : '>'; - if (!value) return header + '\n'; - let wsStart = ''; - let wsEnd = ''; - value = value.replace(/[\n\t ]*$/, ws => { - const n = ws.indexOf('\n'); +/***/ }), - if (n === -1) { - header += '-'; // strip - } else if (value === ws || n !== ws.length - 1) { - header += '+'; // keep +/***/ 675: +/***/ ((module, exports, __nccwpck_require__) => { - if (onChompKeep) onChompKeep(); - } +"use strict"; - wsEnd = ws.replace(/\n$/, ''); - return ''; - }).replace(/^[\n ]*/, ws => { - if (ws.indexOf(' ') !== -1) header += indentSize; - const m = ws.match(/ +$/); - if (m) { - wsStart = ws.slice(0, -m[0].length); - return m[0]; - } else { - wsStart = ws; - return ''; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = formatRelative; +var _index = __nccwpck_require__(9307); +var _index2 = _interopRequireDefault(__nccwpck_require__(3086)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2168)); +var _index4 = _interopRequireDefault(__nccwpck_require__(618)); +var _index5 = _interopRequireDefault(__nccwpck_require__(7923)); +var _index6 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index7 = _interopRequireDefault(__nccwpck_require__(7032)); +var _index8 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index9 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name formatRelative + * @category Common Helpers + * @summary Represent the date in words relative to the given base date. + * + * @description + * Represent the date in words relative to the given base date. + * + * | Distance to the base date | Result | + * |---------------------------|---------------------------| + * | Previous 6 days | last Sunday at 04:30 AM | + * | Last day | yesterday at 04:30 AM | + * | Same day | today at 04:30 AM | + * | Next day | tomorrow at 04:30 AM | + * | Next 6 days | Sunday at 04:30 AM | + * | Other | 12/31/2017 | + * + * @param {Date|Number} date - the date to format + * @param {Date|Number} baseDate - the date to compare with + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {String} the date in words + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `baseDate` must not be Invalid Date + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.locale` must contain `localize` property + * @throws {RangeError} `options.locale` must contain `formatLong` property + * @throws {RangeError} `options.locale` must contain `formatRelative` property + * + * @example + * // Represent the date of 6 days ago in words relative to the given base date. In this example, today is Wednesday + * const result = formatRelative(addDays(new Date(), -6), new Date()) + * //=> "last Thursday at 12:45 AM" + */ +function formatRelative(dirtyDate, dirtyBaseDate, options) { + var _ref, _options$locale, _ref2, _ref3, _ref4, _options$weekStartsOn, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2; + (0, _index8.default)(2, arguments); + var date = (0, _index6.default)(dirtyDate); + var baseDate = (0, _index6.default)(dirtyBaseDate); + var defaultOptions = (0, _index.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 : _index4.default; + var weekStartsOn = (0, _index9.default)((_ref2 = (_ref3 = (_ref4 = (_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$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.weekStartsOn) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.weekStartsOn) !== 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.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : 0); + if (!locale.localize) { + throw new RangeError('locale must contain localize property'); + } + if (!locale.formatLong) { + throw new RangeError('locale must contain formatLong property'); + } + if (!locale.formatRelative) { + throw new RangeError('locale must contain formatRelative property'); + } + var diff = (0, _index2.default)(date, baseDate); + if (isNaN(diff)) { + throw new RangeError('Invalid time value'); + } + var token; + if (diff < -6) { + token = 'other'; + } else if (diff < -1) { + token = 'lastWeek'; + } else if (diff < 0) { + token = 'yesterday'; + } else if (diff < 1) { + token = 'today'; + } else if (diff < 2) { + token = 'tomorrow'; + } else if (diff < 7) { + token = 'nextWeek'; + } else { + token = 'other'; + } + var utcDate = (0, _index5.default)(date, (0, _index7.default)(date)); + var utcBaseDate = (0, _index5.default)(baseDate, (0, _index7.default)(baseDate)); + var formatStr = locale.formatRelative(token, utcDate, utcBaseDate, { + locale: locale, + weekStartsOn: weekStartsOn }); - if (wsEnd) wsEnd = wsEnd.replace(/\n+(?!\n|$)/g, `$&${indent}`); - if (wsStart) wsStart = wsStart.replace(/\n+/g, `$&${indent}`); + return (0, _index3.default)(date, formatStr, { + locale: locale, + weekStartsOn: weekStartsOn + }); +} +module.exports = exports.default; - if (comment) { - header += ' #' + comment.replace(/ ?[\r\n]+/g, ' '); - if (onComment) onComment(); - } +/***/ }), - if (!value) return `${header}${indentSize}\n${indent}${wsEnd}`; +/***/ 4897: +/***/ ((module, exports, __nccwpck_require__) => { - if (literal) { - value = value.replace(/\n+/g, `$&${indent}`); - return `${header}\n${indent}${wsStart}${value}${wsEnd}`; - } +"use strict"; - value = value.replace(/\n+/g, '\n$&').replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded - // ^ ind.line ^ empty ^ capture next empty lines only at end of indent - .replace(/\n+/g, `$&${indent}`); - const body = foldFlowLines(`${wsStart}${value}${wsEnd}`, indent, FOLD_BLOCK, strOptions.fold); - return `${header}\n${indent}${body}`; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = fromUnixTime; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name fromUnixTime + * @category Timestamp Helpers + * @summary Create a date from a Unix timestamp. + * + * @description + * Create a date from a Unix timestamp (in seconds). Decimal values will be discarded. + * + * @param {Number} unixTime - the given Unix timestamp (in seconds) + * @returns {Date} the date + * @throws {TypeError} 1 argument required + * + * @example + * // Create the date 29 February 2012 11:45:05: + * const result = fromUnixTime(1330515905) + * //=> Wed Feb 29 2012 11:45:05 + */ +function fromUnixTime(dirtyUnixTime) { + (0, _index3.default)(1, arguments); + var unixTime = (0, _index2.default)(dirtyUnixTime); + return (0, _index.default)(unixTime * 1000); } +module.exports = exports.default; -function plainString(item, ctx, onComment, onChompKeep) { - const { - comment, - type, - value - } = item; - const { - actualString, - implicitKey, - indent, - inFlow - } = ctx; +/***/ }), - if (implicitKey && /[\n[\]{},]/.test(value) || inFlow && /[[\]{},]/.test(value)) { - return doubleQuotedString(value, ctx); - } +/***/ 7626: +/***/ ((module, exports, __nccwpck_require__) => { - if (!value || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) { - // not allowed: - // - empty string, '-' or '?' - // - start with an indicator character (except [?:-]) or /[?-] / - // - '\n ', ': ' or ' \n' anywhere - // - '#' not preceded by a non-space char - // - end with ' ' or ':' - return implicitKey || inFlow || value.indexOf('\n') === -1 ? value.indexOf('"') !== -1 && value.indexOf("'") === -1 ? singleQuotedString(value, ctx) : doubleQuotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep); - } +"use strict"; - if (!implicitKey && !inFlow && type !== PlainValue.Type.PLAIN && value.indexOf('\n') !== -1) { - // Where allowed & type not set explicitly, prefer block style for multiline strings - return blockString(item, ctx, onComment, onChompKeep); - } - if (indent === '' && containsDocumentMarker(value)) { - ctx.forceBlockIndent = true; - return blockString(item, ctx, onComment, onChompKeep); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getDate; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getDate + * @category Day Helpers + * @summary Get the day of the month of the given date. + * + * @description + * Get the day of the month of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the day of month + * @throws {TypeError} 1 argument required + * + * @example + * // Which day of the month is 29 February 2012? + * const result = getDate(new Date(2012, 1, 29)) + * //=> 29 + */ +function getDate(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var dayOfMonth = date.getDate(); + return dayOfMonth; +} +module.exports = exports.default; - const str = value.replace(/\n+/g, `$&\n${indent}`); // Verify that output will be parsed as a string, as e.g. plain numbers and - // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'), - // and others in v1.1. +/***/ }), - if (actualString) { - const { - tags - } = ctx.doc.schema; - const resolved = resolveScalar(str, tags, tags.scalarFallback).value; - if (typeof resolved !== 'string') return doubleQuotedString(value, ctx); - } +/***/ 9361: +/***/ ((module, exports, __nccwpck_require__) => { - const body = implicitKey ? str : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx)); +"use strict"; - if (comment && !inFlow && (body.indexOf('\n') !== -1 || comment.indexOf('\n') !== -1)) { - if (onComment) onComment(); - return addCommentBefore(body, indent, comment); - } - return body; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getDay; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getDay + * @category Weekday Helpers + * @summary Get the day of the week of the given date. + * + * @description + * Get the day of the week of the given date. + * + * @param {Date|Number} date - the given date + * @returns {0|1|2|3|4|5|6} the day of week, 0 represents Sunday + * @throws {TypeError} 1 argument required + * + * @example + * // Which day of the week is 29 February 2012? + * const result = getDay(new Date(2012, 1, 29)) + * //=> 3 + */ +function getDay(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var day = date.getDay(); + return day; } +module.exports = exports.default; -function stringifyString(item, ctx, onComment, onChompKeep) { - const { - defaultType - } = strOptions; - const { - implicitKey, - inFlow - } = ctx; - let { - type, - value - } = item; - - if (typeof value !== 'string') { - value = String(value); - item = Object.assign({}, item, { - value - }); - } +/***/ }), - const _stringify = _type => { - switch (_type) { - case PlainValue.Type.BLOCK_FOLDED: - case PlainValue.Type.BLOCK_LITERAL: - return blockString(item, ctx, onComment, onChompKeep); +/***/ 7468: +/***/ ((module, exports, __nccwpck_require__) => { - case PlainValue.Type.QUOTE_DOUBLE: - return doubleQuotedString(value, ctx); +"use strict"; - case PlainValue.Type.QUOTE_SINGLE: - return singleQuotedString(value, ctx); - case PlainValue.Type.PLAIN: - return plainString(item, ctx, onComment, onChompKeep); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getDayOfYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8225)); +var _index3 = _interopRequireDefault(__nccwpck_require__(3086)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getDayOfYear + * @category Day Helpers + * @summary Get the day of the year of the given date. + * + * @description + * Get the day of the year of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the day of year + * @throws {TypeError} 1 argument required + * + * @example + * // Which day of the year is 2 July 2014? + * const result = getDayOfYear(new Date(2014, 6, 2)) + * //=> 183 + */ +function getDayOfYear(dirtyDate) { + (0, _index4.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var diff = (0, _index3.default)(date, (0, _index2.default)(date)); + var dayOfYear = diff + 1; + return dayOfYear; +} +module.exports = exports.default; - default: - return null; - } - }; +/***/ }), - if (type !== PlainValue.Type.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(value)) { - // force double quotes on control characters - type = PlainValue.Type.QUOTE_DOUBLE; - } else if ((implicitKey || inFlow) && (type === PlainValue.Type.BLOCK_FOLDED || type === PlainValue.Type.BLOCK_LITERAL)) { - // should not happen; blocks are not valid inside flow containers - type = PlainValue.Type.QUOTE_DOUBLE; - } +/***/ 7573: +/***/ ((module, exports, __nccwpck_require__) => { - let res = _stringify(type); +"use strict"; - if (res === null) { - res = _stringify(defaultType); - if (res === null) throw new Error(`Unsupported default string type ${defaultType}`); - } - return res; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getDaysInMonth; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getDaysInMonth + * @category Month Helpers + * @summary Get the number of days in a month of the given date. + * + * @description + * Get the number of days in a month of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the number of days in a month + * @throws {TypeError} 1 argument required + * + * @example + * // How many days are in February 2000? + * const result = getDaysInMonth(new Date(2000, 1)) + * //=> 29 + */ +function getDaysInMonth(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getFullYear(); + var monthIndex = date.getMonth(); + var lastDayOfMonth = new Date(0); + lastDayOfMonth.setFullYear(year, monthIndex + 1, 0); + lastDayOfMonth.setHours(0, 0, 0, 0); + return lastDayOfMonth.getDate(); } +module.exports = exports.default; -function stringifyNumber({ - format, - minFractionDigits, - tag, - value -}) { - if (typeof value === 'bigint') return String(value); - if (!isFinite(value)) return isNaN(value) ? '.nan' : value < 0 ? '-.inf' : '.inf'; - let n = JSON.stringify(value); +/***/ }), - if (!format && minFractionDigits && (!tag || tag === 'tag:yaml.org,2002:float') && /^\d/.test(n)) { - let i = n.indexOf('.'); +/***/ 2784: +/***/ ((module, exports, __nccwpck_require__) => { - if (i < 0) { - i = n.length; - n += '.'; - } +"use strict"; - let d = minFractionDigits - (n.length - i - 1); - while (d-- > 0) n += '0'; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getDaysInYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(74)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getDaysInYear + * @category Year Helpers + * @summary Get the number of days in a year of the given date. + * + * @description + * Get the number of days in a year of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the number of days in a year + * @throws {TypeError} 1 argument required + * + * @example + * // How many days are in 2012? + * const result = getDaysInYear(new Date(2012, 0, 1)) + * //=> 366 + */ +function getDaysInYear(dirtyDate) { + (0, _index3.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + if (String(new Date(date)) === 'Invalid Date') { + return NaN; } - - return n; + return (0, _index2.default)(date) ? 366 : 365; } +module.exports = exports.default; -function checkFlowCollectionEnd(errors, cst) { - let char, name; +/***/ }), - switch (cst.type) { - case PlainValue.Type.FLOW_MAP: - char = '}'; - name = 'flow map'; - break; +/***/ 9322: +/***/ ((module, exports, __nccwpck_require__) => { - case PlainValue.Type.FLOW_SEQ: - char = ']'; - name = 'flow sequence'; - break; +"use strict"; - default: - errors.push(new PlainValue.YAMLSemanticError(cst, 'Not a flow collection!?')); - return; - } - let lastItem; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getDecade; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getDecade + * @category Decade Helpers + * @summary Get the decade of the given date. + * + * @description + * Get the decade of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the year of decade + * @throws {TypeError} 1 argument required + * + * @example + * // Which decade belongs 27 November 1942? + * const result = getDecade(new Date(1942, 10, 27)) + * //=> 1940 + */ +function getDecade(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getFullYear(); + var decade = Math.floor(year / 10) * 10; + return decade; +} +module.exports = exports.default; - for (let i = cst.items.length - 1; i >= 0; --i) { - const item = cst.items[i]; +/***/ }), - if (!item || item.type !== PlainValue.Type.COMMENT) { - lastItem = item; - break; - } - } +/***/ 5795: +/***/ ((module, exports, __nccwpck_require__) => { - if (lastItem && lastItem.char !== char) { - const msg = `Expected ${name} to end with ${char}`; - let err; +"use strict"; - if (typeof lastItem.offset === 'number') { - err = new PlainValue.YAMLSemanticError(cst, msg); - err.offset = lastItem.offset + 1; - } else { - err = new PlainValue.YAMLSemanticError(lastItem, msg); - if (lastItem.range && lastItem.range.end) err.offset = lastItem.range.end - lastItem.range.start; - } - errors.push(err); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getDefaultOptions; +var _index = __nccwpck_require__(9307); +var _index2 = _interopRequireDefault(__nccwpck_require__(2631)); +/** + * @name getDefaultOptions + * @category Common Helpers + * @summary Get default options. + * @pure false + * + * @description + * Returns an object that contains defaults for + * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate` + * arguments for all functions. + * + * You can change these with [setDefaultOptions]{@link https://date-fns.org/docs/setDefaultOptions}. + * + * @returns {Object} default options + * + * @example + * const result = getDefaultOptions() + * //=> {} + * + * @example + * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 }) + * const result = getDefaultOptions() + * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 } + */ +function getDefaultOptions() { + return (0, _index2.default)({}, (0, _index.getDefaultOptions)()); } -function checkFlowCommentSpace(errors, comment) { - const prev = comment.context.src[comment.range.start - 1]; +module.exports = exports.default; - if (prev !== '\n' && prev !== '\t' && prev !== ' ') { - const msg = 'Comments must be separated from other tokens by white space characters'; - errors.push(new PlainValue.YAMLSemanticError(comment, msg)); - } -} -function getLongKeyError(source, key) { - const sk = String(key); - const k = sk.substr(0, 8) + '...' + sk.substr(-8); - return new PlainValue.YAMLSemanticError(source, `The "${k}" key is too long`); -} -function resolveComments(collection, comments) { - for (const { - afterKey, - before, - comment - } of comments) { - let item = collection.items[before]; +/***/ }), - if (!item) { - if (comment !== undefined) { - if (collection.comment) collection.comment += '\n' + comment;else collection.comment = comment; - } - } else { - if (afterKey && item.value) item = item.value; +/***/ 7941: +/***/ ((module, exports, __nccwpck_require__) => { - if (comment === undefined) { - if (afterKey || !item.commentBefore) item.spaceBefore = true; - } else { - if (item.commentBefore) item.commentBefore += '\n' + comment;else item.commentBefore = comment; - } - } - } -} +"use strict"; -// on error, will return { str: string, errors: Error[] } -function resolveString(doc, node) { - const res = node.strValue; - if (!res) return ''; - if (typeof res === 'string') return res; - res.errors.forEach(error => { - if (!error.source) error.source = node; - doc.errors.push(error); - }); - return res.str; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getHours; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getHours + * @category Hour Helpers + * @summary Get the hours of the given date. + * + * @description + * Get the hours of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the hours + * @throws {TypeError} 1 argument required + * + * @example + * // Get the hours of 29 February 2012 11:45:00: + * const result = getHours(new Date(2012, 1, 29, 11, 45)) + * //=> 11 + */ +function getHours(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var hours = date.getHours(); + return hours; } +module.exports = exports.default; -function resolveTagHandle(doc, node) { - const { - handle, - suffix - } = node.tag; - let prefix = doc.tagPrefixes.find(p => p.handle === handle); +/***/ }), - if (!prefix) { - const dtp = doc.getDefaults().tagPrefixes; - if (dtp) prefix = dtp.find(p => p.handle === handle); - if (!prefix) throw new PlainValue.YAMLSemanticError(node, `The ${handle} tag handle is non-default and was not declared.`); - } +/***/ 8313: +/***/ ((module, exports, __nccwpck_require__) => { - if (!suffix) throw new PlainValue.YAMLSemanticError(node, `The ${handle} tag has no suffix.`); +"use strict"; - if (handle === '!' && (doc.version || doc.options.version) === '1.0') { - if (suffix[0] === '^') { - doc.warnings.push(new PlainValue.YAMLWarning(node, 'YAML 1.0 ^ tag expansion is not supported')); - return suffix; - } - if (/[:/]/.test(suffix)) { - // word/foo -> tag:word.yaml.org,2002:foo - const vocab = suffix.match(/^([a-z0-9-]+)\/(.*)/i); - return vocab ? `tag:${vocab[1]}.yaml.org,2002:${vocab[2]}` : `tag:${suffix}`; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getISODay; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getISODay + * @category Weekday Helpers + * @summary Get the day of the ISO week of the given date. + * + * @description + * Get the day of the ISO week of the given date, + * which is 7 for Sunday, 1 for Monday etc. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the given date + * @returns {Number} the day of ISO week + * @throws {TypeError} 1 argument required + * + * @example + * // Which day of the ISO week is 26 February 2012? + * const result = getISODay(new Date(2012, 1, 26)) + * //=> 7 + */ +function getISODay(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var day = date.getDay(); + if (day === 0) { + day = 7; } - - return prefix.prefix + decodeURIComponent(suffix); + return day; } +module.exports = exports.default; -function resolveTagName(doc, node) { - const { - tag, - type - } = node; - let nonSpecific = false; - - if (tag) { - const { - handle, - suffix, - verbatim - } = tag; +/***/ }), - if (verbatim) { - if (verbatim !== '!' && verbatim !== '!!') return verbatim; - const msg = `Verbatim tags aren't resolved, so ${verbatim} is invalid.`; - doc.errors.push(new PlainValue.YAMLSemanticError(node, msg)); - } else if (handle === '!' && !suffix) { - nonSpecific = true; - } else { - try { - return resolveTagHandle(doc, node); - } catch (error) { - doc.errors.push(error); - } - } - } +/***/ 9894: +/***/ ((module, exports, __nccwpck_require__) => { - switch (type) { - case PlainValue.Type.BLOCK_FOLDED: - case PlainValue.Type.BLOCK_LITERAL: - case PlainValue.Type.QUOTE_DOUBLE: - case PlainValue.Type.QUOTE_SINGLE: - return PlainValue.defaultTags.STR; +"use strict"; - case PlainValue.Type.FLOW_MAP: - case PlainValue.Type.MAP: - return PlainValue.defaultTags.MAP; - case PlainValue.Type.FLOW_SEQ: - case PlainValue.Type.SEQ: - return PlainValue.defaultTags.SEQ; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6307)); +var _index3 = _interopRequireDefault(__nccwpck_require__(776)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_WEEK = 604800000; - case PlainValue.Type.PLAIN: - return nonSpecific ? PlainValue.defaultTags.STR : null; +/** + * @name getISOWeek + * @category ISO Week Helpers + * @summary Get the ISO week of the given date. + * + * @description + * Get the ISO week of the given date. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the given date + * @returns {Number} the ISO week + * @throws {TypeError} 1 argument required + * + * @example + * // Which week of the ISO-week numbering year is 2 January 2005? + * const result = getISOWeek(new Date(2005, 0, 2)) + * //=> 53 + */ +function getISOWeek(dirtyDate) { + (0, _index4.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(date).getTime(); - default: - return null; - } + // 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; } +module.exports = exports.default; -function resolveByTagName(doc, node, tagName) { - const { - tags - } = doc.schema; - const matchWithTest = []; +/***/ }), - for (const tag of tags) { - if (tag.tag === tagName) { - if (tag.test) matchWithTest.push(tag);else { - const res = tag.resolve(doc, node); - return res instanceof Collection ? res : new Scalar(res); - } - } - } +/***/ 6991: +/***/ ((module, exports, __nccwpck_require__) => { - const str = resolveString(doc, node); - if (typeof str === 'string' && matchWithTest.length > 0) return resolveScalar(str, matchWithTest, tags.scalarFallback); - return null; -} - -function getFallbackTagName({ - type -}) { - switch (type) { - case PlainValue.Type.FLOW_MAP: - case PlainValue.Type.MAP: - return PlainValue.defaultTags.MAP; +"use strict"; - case PlainValue.Type.FLOW_SEQ: - case PlainValue.Type.SEQ: - return PlainValue.defaultTags.SEQ; - default: - return PlainValue.defaultTags.STR; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getISOWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6307)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Get the ISO week-numbering year of the given date. + * + * @description + * Get the ISO week-numbering year of the given date, + * which always starts 3 days before the year's first Thursday. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the given date + * @returns {Number} the ISO week-numbering year + * @throws {TypeError} 1 argument required + * + * @example + * // Which ISO-week numbering year is 2 January 2005? + * const result = getISOWeekYear(new Date(2005, 0, 2)) + * //=> 2004 + */ +function getISOWeekYear(dirtyDate) { + (0, _index3.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getFullYear(); + var fourthOfJanuaryOfNextYear = new Date(0); + fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); + var startOfNextYear = (0, _index2.default)(fourthOfJanuaryOfNextYear); + var fourthOfJanuaryOfThisYear = new Date(0); + fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); + fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); + var startOfThisYear = (0, _index2.default)(fourthOfJanuaryOfThisYear); + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1; + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year; + } else { + return year - 1; } } +module.exports = exports.default; -function resolveTag(doc, node, tagName) { - try { - const res = resolveByTagName(doc, node, tagName); - - if (res) { - if (tagName && node.tag) res.tag = tagName; - return res; - } - } catch (error) { - /* istanbul ignore if */ - if (!error.source) error.source = node; - doc.errors.push(error); - return null; - } +/***/ }), - try { - const fallback = getFallbackTagName(node); - if (!fallback) throw new Error(`The tag ${tagName} is unavailable`); - const msg = `The tag ${tagName} is unavailable, falling back to ${fallback}`; - doc.warnings.push(new PlainValue.YAMLWarning(node, msg)); - const res = resolveByTagName(doc, node, fallback); - res.tag = tagName; - return res; - } catch (error) { - const refError = new PlainValue.YAMLReferenceError(node, error.message); - refError.stack = error.stack; - doc.errors.push(refError); - return null; - } -} +/***/ 5438: +/***/ ((module, exports, __nccwpck_require__) => { -const isCollectionItem = node => { - if (!node) return false; - const { - type - } = node; - return type === PlainValue.Type.MAP_KEY || type === PlainValue.Type.MAP_VALUE || type === PlainValue.Type.SEQ_ITEM; -}; +"use strict"; -function resolveNodeProps(errors, node) { - const comments = { - before: [], - after: [] - }; - let hasAnchor = false; - let hasTag = false; - const props = isCollectionItem(node.context.parent) ? node.context.parent.props.concat(node.props) : node.props; - for (const { - start, - end - } of props) { - switch (node.context.src[start]) { - case PlainValue.Char.COMMENT: - { - if (!node.commentHasRequiredWhitespace(start)) { - const msg = 'Comments must be separated from other tokens by white space characters'; - errors.push(new PlainValue.YAMLSemanticError(node, msg)); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getISOWeeksInYear; +var _index = _interopRequireDefault(__nccwpck_require__(776)); +var _index2 = _interopRequireDefault(__nccwpck_require__(7195)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_WEEK = 604800000; - const { - header, - valueRange - } = node; - const cc = valueRange && (start > valueRange.start || header && start > header.start) ? comments.after : comments.before; - cc.push(node.context.src.slice(start + 1, end)); - break; - } - // Actual anchor & tag resolution is handled by schema, here we just complain +/** + * @name getISOWeeksInYear + * @category ISO Week-Numbering Year Helpers + * @summary Get the number of weeks in an ISO week-numbering year of the given date. + * + * @description + * Get the number of weeks in an ISO week-numbering year of the given date. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the given date + * @returns {Number} the number of ISO weeks in a year + * @throws {TypeError} 1 argument required + * + * @example + * // How many weeks are in ISO week-numbering year 2015? + * const result = getISOWeeksInYear(new Date(2015, 1, 11)) + * //=> 53 + */ +function getISOWeeksInYear(dirtyDate) { + (0, _index3.default)(1, arguments); + var thisYear = (0, _index.default)(dirtyDate); + var nextYear = (0, _index.default)((0, _index2.default)(thisYear, 60)); + var diff = nextYear.valueOf() - thisYear.valueOf(); + // Round the number of weeks 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); +} +module.exports = exports.default; - case PlainValue.Char.ANCHOR: - if (hasAnchor) { - const msg = 'A node can have at most one anchor'; - errors.push(new PlainValue.YAMLSemanticError(node, msg)); - } +/***/ }), - hasAnchor = true; - break; +/***/ 7560: +/***/ ((module, exports, __nccwpck_require__) => { - case PlainValue.Char.TAG: - if (hasTag) { - const msg = 'A node can have at most one tag'; - errors.push(new PlainValue.YAMLSemanticError(node, msg)); - } +"use strict"; - hasTag = true; - break; - } - } - return { - comments, - hasAnchor, - hasTag - }; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getMilliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getMilliseconds + * @category Millisecond Helpers + * @summary Get the milliseconds of the given date. + * + * @description + * Get the milliseconds of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the milliseconds + * @throws {TypeError} 1 argument required + * + * @example + * // Get the milliseconds of 29 February 2012 11:45:05.123: + * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123)) + * //=> 123 + */ +function getMilliseconds(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var milliseconds = date.getMilliseconds(); + return milliseconds; } +module.exports = exports.default; -function resolveNodeValue(doc, node) { - const { - anchors, - errors, - schema - } = doc; - - if (node.type === PlainValue.Type.ALIAS) { - const name = node.rawValue; - const src = anchors.getNode(name); - - if (!src) { - const msg = `Aliased anchor not found: ${name}`; - errors.push(new PlainValue.YAMLReferenceError(node, msg)); - return null; - } // Lazy resolution for circular references +/***/ }), +/***/ 7030: +/***/ ((module, exports, __nccwpck_require__) => { - const res = new Alias(src); +"use strict"; - anchors._cstAliases.push(res); - return res; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getMinutes; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getMinutes + * @category Minute Helpers + * @summary Get the minutes of the given date. + * + * @description + * Get the minutes of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the minutes + * @throws {TypeError} 1 argument required + * + * @example + * // Get the minutes of 29 February 2012 11:45:05: + * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5)) + * //=> 45 + */ +function getMinutes(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var minutes = date.getMinutes(); + return minutes; +} +module.exports = exports.default; - const tagName = resolveTagName(doc, node); - if (tagName) return resolveTag(doc, node, tagName); +/***/ }), - if (node.type !== PlainValue.Type.PLAIN) { - const msg = `Failed to resolve ${node.type} node here`; - errors.push(new PlainValue.YAMLSyntaxError(node, msg)); - return null; - } +/***/ 2194: +/***/ ((module, exports, __nccwpck_require__) => { - try { - const str = resolveString(doc, node); - return resolveScalar(str, schema.tags, schema.tags.scalarFallback); - } catch (error) { - if (!error.source) error.source = node; - errors.push(error); - return null; - } -} // sets node.resolved on success +"use strict"; -function resolveNode(doc, node) { - if (!node) return null; - if (node.error) doc.errors.push(node.error); - const { - comments, - hasAnchor, - hasTag - } = resolveNodeProps(doc.errors, node); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getMonth; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getMonth + * @category Month Helpers + * @summary Get the month of the given date. + * + * @description + * Get the month of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the month + * @throws {TypeError} 1 argument required + * + * @example + * // Which month is 29 February 2012? + * const result = getMonth(new Date(2012, 1, 29)) + * //=> 1 + */ +function getMonth(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var month = date.getMonth(); + return month; +} +module.exports = exports.default; - if (hasAnchor) { - const { - anchors - } = doc; - const name = node.anchor; - const prev = anchors.getNode(name); // At this point, aliases for any preceding node with the same anchor - // name have already been resolved, so it may safely be renamed. +/***/ }), - if (prev) anchors.map[anchors.newName(name)] = prev; // During parsing, we need to store the CST node in anchors.map as - // anchors need to be available during resolution to allow for - // circular references. +/***/ 7647: +/***/ ((module, exports, __nccwpck_require__) => { - anchors.map[name] = node; - } +"use strict"; - if (node.type === PlainValue.Type.ALIAS && (hasAnchor || hasTag)) { - const msg = 'An alias node must not specify any properties'; - doc.errors.push(new PlainValue.YAMLSemanticError(node, msg)); - } - const res = resolveNodeValue(doc, node); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getOverlappingDaysInIntervals; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000; - if (res) { - res.range = [node.range.start, node.range.end]; - if (doc.options.keepCstNodes) res.cstNode = node; - if (doc.options.keepNodeTypes) res.type = node.type; - const cb = comments.before.join('\n'); +/** + * @name getOverlappingDaysInIntervals + * @category Interval Helpers + * @summary Get the number of days that overlap in two time intervals + * + * @description + * Get the number of days that overlap in two time intervals + * + * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/Interval} + * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/Interval} + * @returns {Number} the number of days that overlap in two time intervals + * @throws {TypeError} 2 arguments required + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` + * + * @example + * // For overlapping time intervals adds 1 for each started overlapping day: + * getOverlappingDaysInIntervals( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } + * ) + * //=> 3 + * + * @example + * // For non-overlapping time intervals returns 0: + * getOverlappingDaysInIntervals( + * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, + * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } + * ) + * //=> 0 + */ - if (cb) { - res.commentBefore = res.commentBefore ? `${res.commentBefore}\n${cb}` : cb; - } +function getOverlappingDaysInIntervals(dirtyIntervalLeft, dirtyIntervalRight) { + (0, _index2.default)(2, arguments); + var intervalLeft = dirtyIntervalLeft || {}; + var intervalRight = dirtyIntervalRight || {}; + var leftStartTime = (0, _index.default)(intervalLeft.start).getTime(); + var leftEndTime = (0, _index.default)(intervalLeft.end).getTime(); + var rightStartTime = (0, _index.default)(intervalRight.start).getTime(); + var rightEndTime = (0, _index.default)(intervalRight.end).getTime(); - const ca = comments.after.join('\n'); - if (ca) res.comment = res.comment ? `${res.comment}\n${ca}` : ca; + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) { + throw new RangeError('Invalid interval'); } - - return node.resolved = res; + var isOverlapping = leftStartTime < rightEndTime && rightStartTime < leftEndTime; + if (!isOverlapping) { + return 0; + } + var overlapStartDate = rightStartTime < leftStartTime ? leftStartTime : rightStartTime; + var overlapEndDate = rightEndTime > leftEndTime ? leftEndTime : rightEndTime; + var differenceInMs = overlapEndDate - overlapStartDate; + return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY); } +module.exports = exports.default; -function resolveMap(doc, cst) { - if (cst.type !== PlainValue.Type.MAP && cst.type !== PlainValue.Type.FLOW_MAP) { - const msg = `A ${cst.type} node cannot be resolved as a mapping`; - doc.errors.push(new PlainValue.YAMLSyntaxError(cst, msg)); - return null; - } +/***/ }), - const { - comments, - items - } = cst.type === PlainValue.Type.FLOW_MAP ? resolveFlowMapItems(doc, cst) : resolveBlockMapItems(doc, cst); - const map = new YAMLMap(); - map.items = items; - resolveComments(map, comments); - let hasCollectionKey = false; +/***/ 4523: +/***/ ((module, exports, __nccwpck_require__) => { - for (let i = 0; i < items.length; ++i) { - const { - key: iKey - } = items[i]; - if (iKey instanceof Collection) hasCollectionKey = true; +"use strict"; - if (doc.schema.merge && iKey && iKey.value === MERGE_KEY) { - items[i] = new Merge(items[i]); - const sources = items[i].value.items; - let error = null; - sources.some(node => { - if (node instanceof Alias) { - // During parsing, alias sources are CST nodes; to account for - // circular references their resolved values can't be used here. - const { - type - } = node.source; - if (type === PlainValue.Type.MAP || type === PlainValue.Type.FLOW_MAP) return false; - return error = 'Merge nodes aliases can only point to maps'; - } - return error = 'Merge nodes can only have Alias nodes as values'; - }); - if (error) doc.errors.push(new PlainValue.YAMLSemanticError(cst, error)); - } else { - for (let j = i + 1; j < items.length; ++j) { - const { - key: jKey - } = items[j]; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getQuarter; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getQuarter + * @category Quarter Helpers + * @summary Get the year quarter of the given date. + * + * @description + * Get the year quarter of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the quarter + * @throws {TypeError} 1 argument required + * + * @example + * // Which quarter is 2 July 2014? + * const result = getQuarter(new Date(2014, 6, 2)) + * //=> 3 + */ +function getQuarter(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var quarter = Math.floor(date.getMonth() / 3) + 1; + return quarter; +} +module.exports = exports.default; - if (iKey === jKey || iKey && jKey && Object.prototype.hasOwnProperty.call(iKey, 'value') && iKey.value === jKey.value) { - const msg = `Map keys must be unique; "${iKey}" is repeated`; - doc.errors.push(new PlainValue.YAMLSemanticError(cst, msg)); - break; - } - } - } - } +/***/ }), - if (hasCollectionKey && !doc.options.mapAsMap) { - const warn = 'Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.'; - doc.warnings.push(new PlainValue.YAMLWarning(cst, warn)); - } +/***/ 8755: +/***/ ((module, exports, __nccwpck_require__) => { - cst.resolved = map; - return map; +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getSeconds; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getSeconds + * @category Second Helpers + * @summary Get the seconds of the given date. + * + * @description + * Get the seconds of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the seconds + * @throws {TypeError} 1 argument required + * + * @example + * // Get the seconds of 29 February 2012 11:45:05.123: + * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123)) + * //=> 5 + */ +function getSeconds(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var seconds = date.getSeconds(); + return seconds; } +module.exports = exports.default; -const valueHasPairComment = ({ - context: { - lineStart, - node, - src - }, - props -}) => { - if (props.length === 0) return false; - const { - start - } = props[0]; - if (node && start > node.valueRange.start) return false; - if (src[start] !== PlainValue.Char.COMMENT) return false; +/***/ }), - for (let i = lineStart; i < start; ++i) if (src[i] === '\n') return false; +/***/ 5052: +/***/ ((module, exports, __nccwpck_require__) => { - return true; -}; +"use strict"; -function resolvePairComment(item, pair) { - if (!valueHasPairComment(item)) return; - const comment = item.getPropValue(0, PlainValue.Char.COMMENT, true); - let found = false; - const cb = pair.value.commentBefore; - - if (cb && cb.startsWith(comment)) { - pair.value.commentBefore = cb.substr(comment.length + 1); - found = true; - } else { - const cc = pair.value.comment; - - if (!item.node && cc && cc.startsWith(comment)) { - pair.value.comment = cc.substr(comment.length + 1); - found = true; - } - } - if (found) pair.comment = comment; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getTime; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getTime + * @category Timestamp Helpers + * @summary Get the milliseconds timestamp of the given date. + * + * @description + * Get the milliseconds timestamp of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the timestamp + * @throws {TypeError} 1 argument required + * + * @example + * // Get the timestamp of 29 February 2012 11:45:05.123: + * const result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123)) + * //=> 1330515905123 + */ +function getTime(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var timestamp = date.getTime(); + return timestamp; } +module.exports = exports.default; -function resolveBlockMapItems(doc, cst) { - const comments = []; - const items = []; - let key = undefined; - let keyStart = null; - - for (let i = 0; i < cst.items.length; ++i) { - const item = cst.items[i]; - - switch (item.type) { - case PlainValue.Type.BLANK_LINE: - comments.push({ - afterKey: !!key, - before: items.length - }); - break; +/***/ }), - case PlainValue.Type.COMMENT: - comments.push({ - afterKey: !!key, - before: items.length, - comment: item.comment - }); - break; +/***/ 6476: +/***/ ((module, exports, __nccwpck_require__) => { - case PlainValue.Type.MAP_KEY: - if (key !== undefined) items.push(new Pair(key)); - if (item.error) doc.errors.push(item.error); - key = resolveNode(doc, item.node); - keyStart = null; - break; +"use strict"; - case PlainValue.Type.MAP_VALUE: - { - if (key === undefined) key = null; - if (item.error) doc.errors.push(item.error); - if (!item.context.atLineStart && item.node && item.node.type === PlainValue.Type.MAP && !item.node.context.atLineStart) { - const msg = 'Nested mappings are not allowed in compact mappings'; - doc.errors.push(new PlainValue.YAMLSemanticError(item.node, msg)); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getUnixTime; +var _index = _interopRequireDefault(__nccwpck_require__(5052)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getUnixTime + * @category Timestamp Helpers + * @summary Get the seconds timestamp of the given date. + * + * @description + * Get the seconds timestamp of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the timestamp + * @throws {TypeError} 1 argument required + * + * @example + * // Get the timestamp of 29 February 2012 11:45:05 CET: + * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5)) + * //=> 1330512305 + */ +function getUnixTime(dirtyDate) { + (0, _index2.default)(1, arguments); + return Math.floor((0, _index.default)(dirtyDate) / 1000); +} +module.exports = exports.default; - let valueNode = item.node; +/***/ }), - if (!valueNode && item.props.length > 0) { - // Comments on an empty mapping value need to be preserved, so we - // need to construct a minimal empty node here to use instead of the - // missing `item.node`. -- eemeli/yaml#19 - valueNode = new PlainValue.PlainValue(PlainValue.Type.PLAIN, []); - valueNode.context = { - parent: item, - src: item.context.src - }; - const pos = item.range.start + 1; - valueNode.range = { - start: pos, - end: pos - }; - valueNode.valueRange = { - start: pos, - end: pos - }; +/***/ 81: +/***/ ((module, exports, __nccwpck_require__) => { - if (typeof item.range.origStart === 'number') { - const origPos = item.range.origStart + 1; - valueNode.range.origStart = valueNode.range.origEnd = origPos; - valueNode.valueRange.origStart = valueNode.valueRange.origEnd = origPos; - } - } +"use strict"; - const pair = new Pair(key, resolveNode(doc, valueNode)); - resolvePairComment(item, pair); - items.push(pair); - if (key && typeof keyStart === 'number') { - if (item.range.start > keyStart + 1024) doc.errors.push(getLongKeyError(cst, key)); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getWeek; +var _index = _interopRequireDefault(__nccwpck_require__(9813)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8014)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var MILLISECONDS_IN_WEEK = 604800000; - key = undefined; - keyStart = null; - } - break; +/** + * @name getWeek + * @category Week Helpers + * @summary Get the local week index of the given date. + * + * @description + * Get the local week index of the given date. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering + * + * @param {Date|Number} date - the given date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year + * @returns {Number} the week + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 + * + * @example + * // Which week of the local week numbering year is 2 January 2005 with default options? + * const result = getWeek(new Date(2005, 0, 2)) + * //=> 2 + * + * // Which week of the local week numbering year is 2 January 2005, + * // if Monday is the first day of the week, + * // and the first week of the year always contains 4 January? + * const result = getWeek(new Date(2005, 0, 2), { + * weekStartsOn: 1, + * firstWeekContainsDate: 4 + * }) + * //=> 53 + */ - default: - if (key !== undefined) items.push(new Pair(key)); - key = resolveNode(doc, item); - keyStart = item.range.start; - if (item.error) doc.errors.push(item.error); +function getWeek(dirtyDate, options) { + (0, _index4.default)(1, arguments); + var date = (0, _index3.default)(dirtyDate); + var diff = (0, _index.default)(date, options).getTime() - (0, _index2.default)(date, options).getTime(); - next: for (let j = i + 1;; ++j) { - const nextItem = cst.items[j]; + // 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; +} +module.exports = exports.default; - switch (nextItem && nextItem.type) { - case PlainValue.Type.BLANK_LINE: - case PlainValue.Type.COMMENT: - continue next; +/***/ }), - case PlainValue.Type.MAP_VALUE: - break next; +/***/ 9229: +/***/ ((module, exports, __nccwpck_require__) => { - default: - { - const msg = 'Implicit map keys need to be followed by map values'; - doc.errors.push(new PlainValue.YAMLSemanticError(item, msg)); - break next; - } - } - } +"use strict"; - if (item.valueRangeContainsNewline) { - const msg = 'Implicit map keys need to be on a single line'; - doc.errors.push(new PlainValue.YAMLSemanticError(item, msg)); - } - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getWeekOfMonth; +var _index = __nccwpck_require__(9307); +var _index2 = _interopRequireDefault(__nccwpck_require__(7626)); +var _index3 = _interopRequireDefault(__nccwpck_require__(9361)); +var _index4 = _interopRequireDefault(__nccwpck_require__(7182)); +var _index5 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index6 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name getWeekOfMonth + * @category Week Helpers + * @summary Get the week of the month of the given date. + * + * @description + * Get the week of the month of the given date. + * + * @param {Date|Number} date - the given date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Number} the week of month + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 inclusively + * + * @example + * // Which week of the month is 9 November 2017? + * const result = getWeekOfMonth(new Date(2017, 10, 9)) + * //=> 2 + */ +function getWeekOfMonth(date, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index5.default)(1, arguments); + var defaultOptions = (0, _index.getDefaultOptions)(); + var weekStartsOn = (0, _index6.default)((_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); + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } - - if (key !== undefined) items.push(new Pair(key)); - return { - comments, - items - }; + var currentDayOfMonth = (0, _index2.default)(date); + if (isNaN(currentDayOfMonth)) return NaN; + var startWeekDay = (0, _index3.default)((0, _index4.default)(date)); + var lastDayOfFirstWeek = weekStartsOn - startWeekDay; + if (lastDayOfFirstWeek <= 0) lastDayOfFirstWeek += 7; + var remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek; + return Math.ceil(remainingDaysAfterFirstWeek / 7) + 1; } +module.exports = exports.default; -function resolveFlowMapItems(doc, cst) { - const comments = []; - const items = []; - let key = undefined; - let explicitKey = false; - let next = '{'; +/***/ }), - for (let i = 0; i < cst.items.length; ++i) { - const item = cst.items[i]; +/***/ 3494: +/***/ ((module, exports, __nccwpck_require__) => { - if (typeof item.char === 'string') { - const { - char, - offset - } = item; +"use strict"; - if (char === '?' && key === undefined && !explicitKey) { - explicitKey = true; - next = ':'; - continue; - } - if (char === ':') { - if (key === undefined) key = null; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(9813)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index5 = __nccwpck_require__(9307); +/** + * @name getWeekYear + * @category Week-Numbering Year Helpers + * @summary Get the local week-numbering year of the given date. + * + * @description + * Get the local week-numbering year of the given date. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering + * + * @param {Date|Number} date - the given date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year + * @returns {Number} the local week-numbering year + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 + * + * @example + * // Which week numbering year is 26 December 2004 with the default settings? + * const result = getWeekYear(new Date(2004, 11, 26)) + * //=> 2005 + * + * @example + * // Which week numbering year is 26 December 2004 if week starts on Saturday? + * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 }) + * //=> 2004 + * + * @example + * // Which week numbering year is 26 December 2004 if the first week contains 4 January? + * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 }) + * //=> 2004 + */ +function getWeekYear(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index4.default)(1, arguments); + var date = (0, _index2.default)(dirtyDate); + var year = date.getFullYear(); + var defaultOptions = (0, _index5.getDefaultOptions)(); + var firstWeekContainsDate = (0, _index3.default)((_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); - if (next === ':') { - next = ','; - continue; - } - } else { - if (explicitKey) { - if (key === undefined && char !== ',') key = null; - explicitKey = false; - } + // 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 firstWeekOfNextYear = new Date(0); + firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); + firstWeekOfNextYear.setHours(0, 0, 0, 0); + var startOfNextYear = (0, _index.default)(firstWeekOfNextYear, options); + var firstWeekOfThisYear = new Date(0); + firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); + firstWeekOfThisYear.setHours(0, 0, 0, 0); + var startOfThisYear = (0, _index.default)(firstWeekOfThisYear, options); + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1; + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year; + } else { + return year - 1; + } +} +module.exports = exports.default; - if (key !== undefined) { - items.push(new Pair(key)); - key = undefined; +/***/ }), - if (char === ',') { - next = ':'; - continue; - } - } - } +/***/ 9482: +/***/ ((module, exports, __nccwpck_require__) => { - if (char === '}') { - if (i === cst.items.length - 1) continue; - } else if (char === next) { - next = ':'; - continue; - } +"use strict"; - const msg = `Flow map contains an unexpected ${char}`; - const err = new PlainValue.YAMLSyntaxError(cst, msg); - err.offset = offset; - doc.errors.push(err); - } else if (item.type === PlainValue.Type.BLANK_LINE) { - comments.push({ - afterKey: !!key, - before: items.length - }); - } else if (item.type === PlainValue.Type.COMMENT) { - checkFlowCommentSpace(doc.errors, item); - comments.push({ - afterKey: !!key, - before: items.length, - comment: item.comment - }); - } else if (key === undefined) { - if (next === ',') doc.errors.push(new PlainValue.YAMLSemanticError(item, 'Separator , missing in flow map')); - key = resolveNode(doc, item); - } else { - if (next !== ',') doc.errors.push(new PlainValue.YAMLSemanticError(item, 'Indicator : missing in flow map entry')); - items.push(new Pair(key, resolveNode(doc, item))); - key = undefined; - explicitKey = false; - } - } - checkFlowCollectionEnd(doc.errors, cst); - if (key !== undefined) items.push(new Pair(key)); - return { - comments, - items - }; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getWeeksInMonth; +var _index = _interopRequireDefault(__nccwpck_require__(8620)); +var _index2 = _interopRequireDefault(__nccwpck_require__(3346)); +var _index3 = _interopRequireDefault(__nccwpck_require__(7182)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getWeeksInMonth + * @category Week Helpers + * @summary Get the number of calendar weeks a month spans. + * + * @description + * Get the number of calendar weeks the month in the given date spans. + * + * @param {Date|Number} date - the given date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Number} the number of calendar weeks + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * + * @example + * // How many calendar weeks does February 2015 span? + * const result = getWeeksInMonth(new Date(2015, 1, 8)) + * //=> 4 + * + * @example + * // If the week starts on Monday, + * // how many calendar weeks does July 2017 span? + * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 }) + * //=> 6 + */ +function getWeeksInMonth(date, options) { + (0, _index4.default)(1, arguments); + return (0, _index.default)((0, _index2.default)(date), (0, _index3.default)(date), options) + 1; } +module.exports = exports.default; -function resolveSeq(doc, cst) { - if (cst.type !== PlainValue.Type.SEQ && cst.type !== PlainValue.Type.FLOW_SEQ) { - const msg = `A ${cst.type} node cannot be resolved as a sequence`; - doc.errors.push(new PlainValue.YAMLSyntaxError(cst, msg)); - return null; - } +/***/ }), - const { - comments, - items - } = cst.type === PlainValue.Type.FLOW_SEQ ? resolveFlowSeqItems(doc, cst) : resolveBlockSeqItems(doc, cst); - const seq = new YAMLSeq(); - seq.items = items; - resolveComments(seq, comments); +/***/ 5714: +/***/ ((module, exports, __nccwpck_require__) => { - if (!doc.options.mapAsMap && items.some(it => it instanceof Pair && it.key instanceof Collection)) { - const warn = 'Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.'; - doc.warnings.push(new PlainValue.YAMLWarning(cst, warn)); - } +"use strict"; - cst.resolved = seq; - return seq; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name getYear + * @category Year Helpers + * @summary Get the year of the given date. + * + * @description + * Get the year of the given date. + * + * @param {Date|Number} date - the given date + * @returns {Number} the year + * @throws {TypeError} 1 argument required + * + * @example + * // Which year is 2 July 2014? + * const result = getYear(new Date(2014, 6, 2)) + * //=> 2014 + */ +function getYear(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate).getFullYear(); } +module.exports = exports.default; -function resolveBlockSeqItems(doc, cst) { - const comments = []; - const items = []; +/***/ }), - for (let i = 0; i < cst.items.length; ++i) { - const item = cst.items[i]; +/***/ 3895: +/***/ ((module, exports, __nccwpck_require__) => { - switch (item.type) { - case PlainValue.Type.BLANK_LINE: - comments.push({ - before: items.length - }); - break; +"use strict"; - case PlainValue.Type.COMMENT: - comments.push({ - comment: item.comment, - before: items.length - }); - break; - case PlainValue.Type.SEQ_ITEM: - if (item.error) doc.errors.push(item.error); - items.push(resolveNode(doc, item.node)); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = hoursToMilliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name hoursToMilliseconds + * @category Conversion Helpers + * @summary Convert hours to milliseconds. + * + * @description + * Convert a number of hours to a full number of milliseconds. + * + * @param {number} hours - number of hours to be converted + * + * @returns {number} the number of hours converted to milliseconds + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 2 hours to milliseconds: + * const result = hoursToMilliseconds(2) + * //=> 7200000 + */ +function hoursToMilliseconds(hours) { + (0, _index.default)(1, arguments); + return Math.floor(hours * _index2.millisecondsInHour); +} +module.exports = exports.default; - if (item.hasProps) { - const msg = 'Sequence items cannot have tags or anchors before the - indicator'; - doc.errors.push(new PlainValue.YAMLSemanticError(item, msg)); - } +/***/ }), - break; +/***/ 2449: +/***/ ((module, exports, __nccwpck_require__) => { - default: - if (item.error) doc.errors.push(item.error); - doc.errors.push(new PlainValue.YAMLSyntaxError(item, `Unexpected ${item.type} node in sequence`)); - } - } - - return { - comments, - items - }; -} - -function resolveFlowSeqItems(doc, cst) { - const comments = []; - const items = []; - let explicitKey = false; - let key = undefined; - let keyStart = null; - let next = '['; - let prevItem = null; - - for (let i = 0; i < cst.items.length; ++i) { - const item = cst.items[i]; - - if (typeof item.char === 'string') { - const { - char, - offset - } = item; - - if (char !== ':' && (explicitKey || key !== undefined)) { - if (explicitKey && key === undefined) key = next ? items.pop() : null; - items.push(new Pair(key)); - explicitKey = false; - key = undefined; - keyStart = null; - } - - if (char === next) { - next = null; - } else if (!next && char === '?') { - explicitKey = true; - } else if (next !== '[' && char === ':' && key === undefined) { - if (next === ',') { - key = items.pop(); - - if (key instanceof Pair) { - const msg = 'Chaining flow sequence pairs is invalid'; - const err = new PlainValue.YAMLSemanticError(cst, msg); - err.offset = offset; - doc.errors.push(err); - } - - if (!explicitKey && typeof keyStart === 'number') { - const keyEnd = item.range ? item.range.start : item.offset; - if (keyEnd > keyStart + 1024) doc.errors.push(getLongKeyError(cst, key)); - const { - src - } = prevItem.context; - - for (let i = keyStart; i < keyEnd; ++i) if (src[i] === '\n') { - const msg = 'Implicit keys of flow sequence pairs need to be on a single line'; - doc.errors.push(new PlainValue.YAMLSemanticError(prevItem, msg)); - break; - } - } - } else { - key = null; - } - - keyStart = null; - explicitKey = false; - next = null; - } else if (next === '[' || char !== ']' || i < cst.items.length - 1) { - const msg = `Flow sequence contains an unexpected ${char}`; - const err = new PlainValue.YAMLSyntaxError(cst, msg); - err.offset = offset; - doc.errors.push(err); - } - } else if (item.type === PlainValue.Type.BLANK_LINE) { - comments.push({ - before: items.length - }); - } else if (item.type === PlainValue.Type.COMMENT) { - checkFlowCommentSpace(doc.errors, item); - comments.push({ - comment: item.comment, - before: items.length - }); - } else { - if (next) { - const msg = `Expected a ${next} in flow sequence`; - doc.errors.push(new PlainValue.YAMLSemanticError(item, msg)); - } - - const value = resolveNode(doc, item); - - if (key === undefined) { - items.push(value); - prevItem = item; - } else { - items.push(new Pair(key, value)); - key = undefined; - } - - keyStart = item.range.start; - next = ','; - } - } - - checkFlowCollectionEnd(doc.errors, cst); - if (key !== undefined) items.push(new Pair(key)); - return { - comments, - items - }; -} - -exports.Alias = Alias; -exports.Collection = Collection; -exports.Merge = Merge; -exports.Node = Node; -exports.Pair = Pair; -exports.Scalar = Scalar; -exports.YAMLMap = YAMLMap; -exports.YAMLSeq = YAMLSeq; -exports.addComment = addComment; -exports.binaryOptions = binaryOptions; -exports.boolOptions = boolOptions; -exports.findPair = findPair; -exports.intOptions = intOptions; -exports.isEmptyPath = isEmptyPath; -exports.nullOptions = nullOptions; -exports.resolveMap = resolveMap; -exports.resolveNode = resolveNode; -exports.resolveSeq = resolveSeq; -exports.resolveString = resolveString; -exports.strOptions = strOptions; -exports.stringifyNumber = stringifyNumber; -exports.stringifyString = stringifyString; -exports.toJSON = toJSON; - - -/***/ }), -/* 330 */, -/* 331 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const compareBuild = __webpack_require__(126) -const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) -module.exports = sort - - -/***/ }), -/* 332 */, -/* 333 */, -/* 334 */, -/* 335 */, -/* 336 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; +"use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = endOfISOWeek; - -var _index = _interopRequireDefault(__webpack_require__(623)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = hoursToMinutes; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); /** - * @name endOfISOWeek - * @category ISO Week Helpers - * @summary Return the end of an ISO week for the given date. + * @name hoursToMinutes + * @category Conversion Helpers + * @summary Convert hours to minutes. * * @description - * Return the end of an ISO week for the given date. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * ### v2.0.0 breaking changes: + * Convert a number of hours to a full number of minutes. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @param {number} hours - number of hours to be converted * - * @param {Date|Number} date - the original date - * @returns {Date} the end of an ISO week + * @returns {number} the number of hours converted in minutes * @throws {TypeError} 1 argument required * * @example - * // The end of an ISO week for 2 September 2014 11:55:00: - * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sun Sep 07 2014 23:59:59.999 + * // Convert 2 hours to minutes: + * const result = hoursToMinutes(2) + * //=> 120 */ -function endOfISOWeek(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate, { - weekStartsOn: 1 - }); +function hoursToMinutes(hours) { + (0, _index.default)(1, arguments); + return Math.floor(hours * _index2.minutesInHour); } - module.exports = exports.default; /***/ }), -/* 337 */, -/* 338 */, -/* 339 */ -/***/ (function(__unusedmodule, exports) { - -"use strict"; -Object.defineProperty(exports,"__esModule",{value:true});exports.SIGRTMAX=exports.getRealtimeSignals=void 0; -const getRealtimeSignals=function(){ -const length=SIGRTMAX-SIGRTMIN+1; -return Array.from({length},getRealtimeSignal); -};exports.getRealtimeSignals=getRealtimeSignals; - -const getRealtimeSignal=function(value,index){ -return{ -name:`SIGRT${index+1}`, -number:SIGRTMIN+index, -action:"terminate", -description:"Application-specific signal (realtime)", -standard:"posix"}; - -}; - -const SIGRTMIN=34; -const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; -//# sourceMappingURL=realtime.js.map -/***/ }), -/* 340 */, -/* 341 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 775: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isFriday; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = hoursToSeconds; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); /** - * @name isFriday - * @category Weekday Helpers - * @summary Is the given date Friday? + * @name hoursToSeconds + * @category Conversion Helpers + * @summary Convert hours to seconds. * * @description - * Is the given date Friday? + * Convert a number of hours to a full number of seconds. * - * ### v2.0.0 breaking changes: + * @param {number} hours - number of hours to be converted * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is Friday + * @returns {number} the number of hours converted in seconds * @throws {TypeError} 1 argument required * * @example - * // Is 26 September 2014 Friday? - * var result = isFriday(new Date(2014, 8, 26)) - * //=> true + * // Convert 2 hours to seconds: + * const result = hoursToSeconds(2) + * //=> 7200 */ -function isFriday(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate).getDay() === 5; +function hoursToSeconds(hours) { + (0, _index.default)(1, arguments); + return Math.floor(hours * _index2.secondsInHour); } - module.exports = exports.default; /***/ }), -/* 342 */, -/* 343 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3314: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = startOfWeek; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(841)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name startOfWeek - * @category Week Helpers - * @summary Return the start of a week for the given date. - * - * @description - * Return the start of a week for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the original date - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Date} the start of a week - * @throws {TypeError} 1 argument required - * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 - * - * @example - * // The start of a week for 2 September 2014 11:55:00: - * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sun Aug 31 2014 00:00:00 - * - * @example - * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00: - * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) - * //=> Mon Sep 01 2014 00:00:00 - */ -function startOfWeek(dirtyDate, dirtyOptions) { - (0, _index3.default)(1, arguments); - var options = dirtyOptions || {}; - var locale = options.locale; - var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; - var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index2.default)(localeWeekStartsOn); - var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index2.default)(options.weekStartsOn); // 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'); +})); +var _exportNames = { + add: true, + addBusinessDays: true, + addDays: true, + addHours: true, + addISOWeekYears: true, + addMilliseconds: true, + addMinutes: true, + addMonths: true, + addQuarters: true, + addSeconds: true, + addWeeks: true, + addYears: true, + areIntervalsOverlapping: true, + clamp: true, + closestIndexTo: true, + closestTo: true, + compareAsc: true, + compareDesc: true, + daysToWeeks: true, + differenceInBusinessDays: true, + differenceInCalendarDays: true, + differenceInCalendarISOWeekYears: true, + differenceInCalendarISOWeeks: true, + differenceInCalendarMonths: true, + differenceInCalendarQuarters: true, + differenceInCalendarWeeks: true, + differenceInCalendarYears: true, + differenceInDays: true, + differenceInHours: true, + differenceInISOWeekYears: true, + differenceInMilliseconds: true, + differenceInMinutes: true, + differenceInMonths: true, + differenceInQuarters: true, + differenceInSeconds: true, + differenceInWeeks: true, + differenceInYears: true, + eachDayOfInterval: true, + eachHourOfInterval: true, + eachMinuteOfInterval: true, + eachMonthOfInterval: true, + eachQuarterOfInterval: true, + eachWeekOfInterval: true, + eachWeekendOfInterval: true, + eachWeekendOfMonth: true, + eachWeekendOfYear: true, + eachYearOfInterval: true, + endOfDay: true, + endOfDecade: true, + endOfHour: true, + endOfISOWeek: true, + endOfISOWeekYear: true, + endOfMinute: true, + endOfMonth: true, + endOfQuarter: true, + endOfSecond: true, + endOfToday: true, + endOfTomorrow: true, + endOfWeek: true, + endOfYear: true, + endOfYesterday: true, + format: true, + formatDistance: true, + formatDistanceStrict: true, + formatDistanceToNow: true, + formatDistanceToNowStrict: true, + formatDuration: true, + formatISO: true, + formatISO9075: true, + formatISODuration: true, + formatRFC3339: true, + formatRFC7231: true, + formatRelative: true, + fromUnixTime: true, + getDate: true, + getDay: true, + getDayOfYear: true, + getDaysInMonth: true, + getDaysInYear: true, + getDecade: true, + getDefaultOptions: true, + getHours: true, + getISODay: true, + getISOWeek: true, + getISOWeekYear: true, + getISOWeeksInYear: true, + getMilliseconds: true, + getMinutes: true, + getMonth: true, + getOverlappingDaysInIntervals: true, + getQuarter: true, + getSeconds: true, + getTime: true, + getUnixTime: true, + getWeek: true, + getWeekOfMonth: true, + getWeekYear: true, + getWeeksInMonth: true, + getYear: true, + hoursToMilliseconds: true, + hoursToMinutes: true, + hoursToSeconds: true, + intervalToDuration: true, + intlFormat: true, + intlFormatDistance: true, + isAfter: true, + isBefore: true, + isDate: true, + isEqual: true, + isExists: true, + isFirstDayOfMonth: true, + isFriday: true, + isFuture: true, + isLastDayOfMonth: true, + isLeapYear: true, + isMatch: true, + isMonday: true, + isPast: true, + isSameDay: true, + isSameHour: true, + isSameISOWeek: true, + isSameISOWeekYear: true, + isSameMinute: true, + isSameMonth: true, + isSameQuarter: true, + isSameSecond: true, + isSameWeek: true, + isSameYear: true, + isSaturday: true, + isSunday: true, + isThisHour: true, + isThisISOWeek: true, + isThisMinute: true, + isThisMonth: true, + isThisQuarter: true, + isThisSecond: true, + isThisWeek: true, + isThisYear: true, + isThursday: true, + isToday: true, + isTomorrow: true, + isTuesday: true, + isValid: true, + isWednesday: true, + isWeekend: true, + isWithinInterval: true, + isYesterday: true, + lastDayOfDecade: true, + lastDayOfISOWeek: true, + lastDayOfISOWeekYear: true, + lastDayOfMonth: true, + lastDayOfQuarter: true, + lastDayOfWeek: true, + lastDayOfYear: true, + lightFormat: true, + max: true, + milliseconds: true, + millisecondsToHours: true, + millisecondsToMinutes: true, + millisecondsToSeconds: true, + min: true, + minutesToHours: true, + minutesToMilliseconds: true, + minutesToSeconds: true, + monthsToQuarters: true, + monthsToYears: true, + nextDay: true, + nextFriday: true, + nextMonday: true, + nextSaturday: true, + nextSunday: true, + nextThursday: true, + nextTuesday: true, + nextWednesday: true, + parse: true, + parseISO: true, + parseJSON: true, + previousDay: true, + previousFriday: true, + previousMonday: true, + previousSaturday: true, + previousSunday: true, + previousThursday: true, + previousTuesday: true, + previousWednesday: true, + quartersToMonths: true, + quartersToYears: true, + roundToNearestMinutes: true, + secondsToHours: true, + secondsToMilliseconds: true, + secondsToMinutes: true, + set: true, + setDate: true, + setDay: true, + setDayOfYear: true, + setDefaultOptions: true, + setHours: true, + setISODay: true, + setISOWeek: true, + setISOWeekYear: true, + setMilliseconds: true, + setMinutes: true, + setMonth: true, + setQuarter: true, + setSeconds: true, + setWeek: true, + setWeekYear: true, + setYear: true, + startOfDay: true, + startOfDecade: true, + startOfHour: true, + startOfISOWeek: true, + startOfISOWeekYear: true, + startOfMinute: true, + startOfMonth: true, + startOfQuarter: true, + startOfSecond: true, + startOfToday: true, + startOfTomorrow: true, + startOfWeek: true, + startOfWeekYear: true, + startOfYear: true, + startOfYesterday: true, + sub: true, + subBusinessDays: true, + subDays: true, + subHours: true, + subISOWeekYears: true, + subMilliseconds: true, + subMinutes: true, + subMonths: true, + subQuarters: true, + subSeconds: true, + subWeeks: true, + subYears: true, + toDate: true, + weeksToDays: true, + yearsToMonths: true, + yearsToQuarters: true +}; +Object.defineProperty(exports, "add", ({ + enumerable: true, + get: function get() { + return _index.default; } - - var date = (0, _index.default)(dirtyDate); - var day = date.getDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - date.setDate(date.getDate() - diff); - date.setHours(0, 0, 0, 0); - return date; -} - -module.exports = exports.default; - -/***/ }), -/* 344 */, -/* 345 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const {constants: BufferConstants} = __webpack_require__(293); -const stream = __webpack_require__(413); -const {promisify} = __webpack_require__(292); -const bufferStream = __webpack_require__(478); - -const streamPipelinePromisified = promisify(stream.pipeline); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -async function getStream(inputStream, options) { - if (!inputStream) { - throw new Error('Expected a stream'); - } - - options = { - maxBuffer: Infinity, - ...options - }; - - const {maxBuffer} = options; - const stream = bufferStream(options); - - await new Promise((resolve, reject) => { - const rejectPromise = error => { - // Don't retrieve an oversized buffer. - if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { - error.bufferedData = stream.getBufferedValue(); - } - - reject(error); - }; - - (async () => { - try { - await streamPipelinePromisified(inputStream, stream); - resolve(); - } catch (error) { - rejectPromise(error); - } - })(); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - - return stream.getBufferedValue(); -} - -module.exports = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; - - -/***/ }), -/* 346 */, -/* 347 */, -/* 348 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - - -var PlainValue = __webpack_require__(513); - -class BlankLine extends PlainValue.Node { - constructor() { - super(PlainValue.Type.BLANK_LINE); - } - /* istanbul ignore next */ - - - get includesTrailingLines() { - // This is never called from anywhere, but if it were, - // this is the value it should return. - return true; +})); +Object.defineProperty(exports, "addBusinessDays", ({ + enumerable: true, + get: function get() { + return _index2.default; } - /** - * Parses a blank line from the source - * - * @param {ParseContext} context - * @param {number} start - Index of first \n character - * @returns {number} - Index of the character after this - */ - - - parse(context, start) { - this.context = context; - this.range = new PlainValue.Range(start, start + 1); - return start + 1; +})); +Object.defineProperty(exports, "addDays", ({ + enumerable: true, + get: function get() { + return _index3.default; } - -} - -class CollectionItem extends PlainValue.Node { - constructor(type, props) { - super(type, props); - this.node = null; +})); +Object.defineProperty(exports, "addHours", ({ + enumerable: true, + get: function get() { + return _index4.default; } - - get includesTrailingLines() { - return !!this.node && this.node.includesTrailingLines; +})); +Object.defineProperty(exports, "addISOWeekYears", ({ + enumerable: true, + get: function get() { + return _index5.default; } - /** - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this - */ - - - parse(context, start) { - this.context = context; - const { - parseNode, - src - } = context; - let { - atLineStart, - lineStart - } = context; - if (!atLineStart && this.type === PlainValue.Type.SEQ_ITEM) this.error = new PlainValue.YAMLSemanticError(this, 'Sequence items must not have preceding content on the same line'); - const indent = atLineStart ? start - lineStart : context.indent; - let offset = PlainValue.Node.endOfWhiteSpace(src, start + 1); - let ch = src[offset]; - const inlineComment = ch === '#'; - const comments = []; - let blankLine = null; - - while (ch === '\n' || ch === '#') { - if (ch === '#') { - const end = PlainValue.Node.endOfLine(src, offset + 1); - comments.push(new PlainValue.Range(offset, end)); - offset = end; - } else { - atLineStart = true; - lineStart = offset + 1; - const wsEnd = PlainValue.Node.endOfWhiteSpace(src, lineStart); - - if (src[wsEnd] === '\n' && comments.length === 0) { - blankLine = new BlankLine(); - lineStart = blankLine.parse({ - src - }, lineStart); - } - - offset = PlainValue.Node.endOfIndent(src, lineStart); - } - - ch = src[offset]; - } - - if (PlainValue.Node.nextNodeIsIndented(ch, offset - (lineStart + indent), this.type !== PlainValue.Type.SEQ_ITEM)) { - this.node = parseNode({ - atLineStart, - inCollection: false, - indent, - lineStart, - parent: this - }, offset); - } else if (ch && lineStart > start + 1) { - offset = lineStart - 1; - } - - if (this.node) { - if (blankLine) { - // Only blank lines preceding non-empty nodes are captured. Note that - // this means that collection item range start indices do not always - // increase monotonically. -- eemeli/yaml#126 - const items = context.parent.items || context.parent.contents; - if (items) items.push(blankLine); - } - - if (comments.length) Array.prototype.push.apply(this.props, comments); - offset = this.node.range.end; - } else { - if (inlineComment) { - const c = comments[0]; - this.props.push(c); - offset = c.end; - } else { - offset = PlainValue.Node.endOfLine(src, start + 1); - } - } - - const end = this.node ? this.node.valueRange.end : offset; - this.valueRange = new PlainValue.Range(start, end); - return offset; +})); +Object.defineProperty(exports, "addMilliseconds", ({ + enumerable: true, + get: function get() { + return _index6.default; } - - setOrigRanges(cr, offset) { - offset = super.setOrigRanges(cr, offset); - return this.node ? this.node.setOrigRanges(cr, offset) : offset; +})); +Object.defineProperty(exports, "addMinutes", ({ + enumerable: true, + get: function get() { + return _index7.default; } - - toString() { - const { - context: { - src - }, - node, - range, - value - } = this; - if (value != null) return value; - const str = node ? src.slice(range.start, node.range.start) + String(node) : src.slice(range.start, range.end); - return PlainValue.Node.addStringTerminator(src, range.end, str); +})); +Object.defineProperty(exports, "addMonths", ({ + enumerable: true, + get: function get() { + return _index8.default; } - -} - -class Comment extends PlainValue.Node { - constructor() { - super(PlainValue.Type.COMMENT); +})); +Object.defineProperty(exports, "addQuarters", ({ + enumerable: true, + get: function get() { + return _index9.default; } - /** - * Parses a comment line from the source - * - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this scalar - */ - - - parse(context, start) { - this.context = context; - const offset = this.parseComment(start); - this.range = new PlainValue.Range(start, offset); - return offset; +})); +Object.defineProperty(exports, "addSeconds", ({ + enumerable: true, + get: function get() { + return _index10.default; } - -} - -function grabCollectionEndComments(node) { - let cnode = node; - - while (cnode instanceof CollectionItem) cnode = cnode.node; - - if (!(cnode instanceof Collection)) return null; - const len = cnode.items.length; - let ci = -1; - - for (let i = len - 1; i >= 0; --i) { - const n = cnode.items[i]; - - if (n.type === PlainValue.Type.COMMENT) { - // Keep sufficiently indented comments with preceding node - const { - indent, - lineStart - } = n.context; - if (indent > 0 && n.range.start >= lineStart + indent) break; - ci = i; - } else if (n.type === PlainValue.Type.BLANK_LINE) ci = i;else break; +})); +Object.defineProperty(exports, "addWeeks", ({ + enumerable: true, + get: function get() { + return _index11.default; } - - if (ci === -1) return null; - const ca = cnode.items.splice(ci, len - ci); - const prevEnd = ca[0].range.start; - - while (true) { - cnode.range.end = prevEnd; - if (cnode.valueRange && cnode.valueRange.end > prevEnd) cnode.valueRange.end = prevEnd; - if (cnode === node) break; - cnode = cnode.context.parent; +})); +Object.defineProperty(exports, "addYears", ({ + enumerable: true, + get: function get() { + return _index12.default; } - - return ca; -} -class Collection extends PlainValue.Node { - static nextContentHasIndent(src, offset, indent) { - const lineStart = PlainValue.Node.endOfLine(src, offset) + 1; - offset = PlainValue.Node.endOfWhiteSpace(src, lineStart); - const ch = src[offset]; - if (!ch) return false; - if (offset >= lineStart + indent) return true; - if (ch !== '#' && ch !== '\n') return false; - return Collection.nextContentHasIndent(src, offset, indent); +})); +Object.defineProperty(exports, "areIntervalsOverlapping", ({ + enumerable: true, + get: function get() { + return _index13.default; } - - constructor(firstItem) { - super(firstItem.type === PlainValue.Type.SEQ_ITEM ? PlainValue.Type.SEQ : PlainValue.Type.MAP); - - for (let i = firstItem.props.length - 1; i >= 0; --i) { - if (firstItem.props[i].start < firstItem.context.lineStart) { - // props on previous line are assumed by the collection - this.props = firstItem.props.slice(0, i + 1); - firstItem.props = firstItem.props.slice(i + 1); - const itemRange = firstItem.props[0] || firstItem.valueRange; - firstItem.range.start = itemRange.start; - break; - } - } - - this.items = [firstItem]; - const ec = grabCollectionEndComments(firstItem); - if (ec) Array.prototype.push.apply(this.items, ec); +})); +Object.defineProperty(exports, "clamp", ({ + enumerable: true, + get: function get() { + return _index14.default; } - - get includesTrailingLines() { - return this.items.length > 0; +})); +Object.defineProperty(exports, "closestIndexTo", ({ + enumerable: true, + get: function get() { + return _index15.default; } - /** - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this - */ - - - parse(context, start) { - this.context = context; - const { - parseNode, - src - } = context; // It's easier to recalculate lineStart here rather than tracking down the - // last context from which to read it -- eemeli/yaml#2 - - let lineStart = PlainValue.Node.startOfLine(src, start); - const firstItem = this.items[0]; // First-item context needs to be correct for later comment handling - // -- eemeli/yaml#17 - - firstItem.context.parent = this; - this.valueRange = PlainValue.Range.copy(firstItem.valueRange); - const indent = firstItem.range.start - firstItem.context.lineStart; - let offset = start; - offset = PlainValue.Node.normalizeOffset(src, offset); - let ch = src[offset]; - let atLineStart = PlainValue.Node.endOfWhiteSpace(src, lineStart) === offset; - let prevIncludesTrailingLines = false; - - while (ch) { - while (ch === '\n' || ch === '#') { - if (atLineStart && ch === '\n' && !prevIncludesTrailingLines) { - const blankLine = new BlankLine(); - offset = blankLine.parse({ - src - }, offset); - this.valueRange.end = offset; - - if (offset >= src.length) { - ch = null; - break; - } - - this.items.push(blankLine); - offset -= 1; // blankLine.parse() consumes terminal newline - } else if (ch === '#') { - if (offset < lineStart + indent && !Collection.nextContentHasIndent(src, offset, indent)) { - return offset; - } - - const comment = new Comment(); - offset = comment.parse({ - indent, - lineStart, - src - }, offset); - this.items.push(comment); - this.valueRange.end = offset; - - if (offset >= src.length) { - ch = null; - break; - } - } - - lineStart = offset + 1; - offset = PlainValue.Node.endOfIndent(src, lineStart); - - if (PlainValue.Node.atBlank(src, offset)) { - const wsEnd = PlainValue.Node.endOfWhiteSpace(src, offset); - const next = src[wsEnd]; - - if (!next || next === '\n' || next === '#') { - offset = wsEnd; - } - } - - ch = src[offset]; - atLineStart = true; - } - - if (!ch) { - break; - } - - if (offset !== lineStart + indent && (atLineStart || ch !== ':')) { - if (offset < lineStart + indent) { - if (lineStart > start) offset = lineStart; - break; - } else if (!this.error) { - const msg = 'All collection items must start at the same column'; - this.error = new PlainValue.YAMLSyntaxError(this, msg); - } - } - - if (firstItem.type === PlainValue.Type.SEQ_ITEM) { - if (ch !== '-') { - if (lineStart > start) offset = lineStart; - break; - } - } else if (ch === '-' && !this.error) { - // map key may start with -, as long as it's followed by a non-whitespace char - const next = src[offset + 1]; - - if (!next || next === '\n' || next === '\t' || next === ' ') { - const msg = 'A collection cannot be both a mapping and a sequence'; - this.error = new PlainValue.YAMLSyntaxError(this, msg); - } - } - - const node = parseNode({ - atLineStart, - inCollection: true, - indent, - lineStart, - parent: this - }, offset); - if (!node) return offset; // at next document start - - this.items.push(node); - this.valueRange.end = node.valueRange.end; - offset = PlainValue.Node.normalizeOffset(src, node.range.end); - ch = src[offset]; - atLineStart = false; - prevIncludesTrailingLines = node.includesTrailingLines; // Need to reset lineStart and atLineStart here if preceding node's range - // has advanced to check the current line's indentation level - // -- eemeli/yaml#10 & eemeli/yaml#38 - - if (ch) { - let ls = offset - 1; - let prev = src[ls]; - - while (prev === ' ' || prev === '\t') prev = src[--ls]; - - if (prev === '\n') { - lineStart = ls + 1; - atLineStart = true; - } - } - - const ec = grabCollectionEndComments(node); - if (ec) Array.prototype.push.apply(this.items, ec); - } - - return offset; +})); +Object.defineProperty(exports, "closestTo", ({ + enumerable: true, + get: function get() { + return _index16.default; } - - setOrigRanges(cr, offset) { - offset = super.setOrigRanges(cr, offset); - this.items.forEach(node => { - offset = node.setOrigRanges(cr, offset); - }); - return offset; +})); +Object.defineProperty(exports, "compareAsc", ({ + enumerable: true, + get: function get() { + return _index17.default; } - - toString() { - const { - context: { - src - }, - items, - range, - value - } = this; - if (value != null) return value; - let str = src.slice(range.start, items[0].range.start) + String(items[0]); - - for (let i = 1; i < items.length; ++i) { - const item = items[i]; - const { - atLineStart, - indent - } = item.context; - if (atLineStart) for (let i = 0; i < indent; ++i) str += ' '; - str += String(item); - } - - return PlainValue.Node.addStringTerminator(src, range.end, str); +})); +Object.defineProperty(exports, "compareDesc", ({ + enumerable: true, + get: function get() { + return _index18.default; } - -} - -class Directive extends PlainValue.Node { - constructor() { - super(PlainValue.Type.DIRECTIVE); - this.name = null; +})); +Object.defineProperty(exports, "daysToWeeks", ({ + enumerable: true, + get: function get() { + return _index19.default; } - - get parameters() { - const raw = this.rawValue; - return raw ? raw.trim().split(/[ \t]+/) : []; +})); +Object.defineProperty(exports, "differenceInBusinessDays", ({ + enumerable: true, + get: function get() { + return _index20.default; } - - parseName(start) { - const { - src - } = this.context; - let offset = start; - let ch = src[offset]; - - while (ch && ch !== '\n' && ch !== '\t' && ch !== ' ') ch = src[offset += 1]; - - this.name = src.slice(start, offset); - return offset; +})); +Object.defineProperty(exports, "differenceInCalendarDays", ({ + enumerable: true, + get: function get() { + return _index21.default; } - - parseParameters(start) { - const { - src - } = this.context; - let offset = start; - let ch = src[offset]; - - while (ch && ch !== '\n' && ch !== '#') ch = src[offset += 1]; - - this.valueRange = new PlainValue.Range(start, offset); - return offset; +})); +Object.defineProperty(exports, "differenceInCalendarISOWeekYears", ({ + enumerable: true, + get: function get() { + return _index22.default; } - - parse(context, start) { - this.context = context; - let offset = this.parseName(start + 1); - offset = this.parseParameters(offset); - offset = this.parseComment(offset); - this.range = new PlainValue.Range(start, offset); - return offset; +})); +Object.defineProperty(exports, "differenceInCalendarISOWeeks", ({ + enumerable: true, + get: function get() { + return _index23.default; } - -} - -class Document extends PlainValue.Node { - static startCommentOrEndBlankLine(src, start) { - const offset = PlainValue.Node.endOfWhiteSpace(src, start); - const ch = src[offset]; - return ch === '#' || ch === '\n' ? offset : start; +})); +Object.defineProperty(exports, "differenceInCalendarMonths", ({ + enumerable: true, + get: function get() { + return _index24.default; } - - constructor() { - super(PlainValue.Type.DOCUMENT); - this.directives = null; - this.contents = null; - this.directivesEndMarker = null; - this.documentEndMarker = null; +})); +Object.defineProperty(exports, "differenceInCalendarQuarters", ({ + enumerable: true, + get: function get() { + return _index25.default; } - - parseDirectives(start) { - const { - src - } = this.context; - this.directives = []; - let atLineStart = true; - let hasDirectives = false; - let offset = start; - - while (!PlainValue.Node.atDocumentBoundary(src, offset, PlainValue.Char.DIRECTIVES_END)) { - offset = Document.startCommentOrEndBlankLine(src, offset); - - switch (src[offset]) { - case '\n': - if (atLineStart) { - const blankLine = new BlankLine(); - offset = blankLine.parse({ - src - }, offset); - - if (offset < src.length) { - this.directives.push(blankLine); - } - } else { - offset += 1; - atLineStart = true; - } - - break; - - case '#': - { - const comment = new Comment(); - offset = comment.parse({ - src - }, offset); - this.directives.push(comment); - atLineStart = false; - } - break; - - case '%': - { - const directive = new Directive(); - offset = directive.parse({ - parent: this, - src - }, offset); - this.directives.push(directive); - hasDirectives = true; - atLineStart = false; - } - break; - - default: - if (hasDirectives) { - this.error = new PlainValue.YAMLSemanticError(this, 'Missing directives-end indicator line'); - } else if (this.directives.length > 0) { - this.contents = this.directives; - this.directives = []; - } - - return offset; - } - } - - if (src[offset]) { - this.directivesEndMarker = new PlainValue.Range(offset, offset + 3); - return offset + 3; - } - - if (hasDirectives) { - this.error = new PlainValue.YAMLSemanticError(this, 'Missing directives-end indicator line'); - } else if (this.directives.length > 0) { - this.contents = this.directives; - this.directives = []; - } - - return offset; +})); +Object.defineProperty(exports, "differenceInCalendarWeeks", ({ + enumerable: true, + get: function get() { + return _index26.default; } - - parseContents(start) { - const { - parseNode, - src - } = this.context; - if (!this.contents) this.contents = []; - let lineStart = start; - - while (src[lineStart - 1] === '-') lineStart -= 1; - - let offset = PlainValue.Node.endOfWhiteSpace(src, start); - let atLineStart = lineStart === start; - this.valueRange = new PlainValue.Range(offset); - - while (!PlainValue.Node.atDocumentBoundary(src, offset, PlainValue.Char.DOCUMENT_END)) { - switch (src[offset]) { - case '\n': - if (atLineStart) { - const blankLine = new BlankLine(); - offset = blankLine.parse({ - src - }, offset); - - if (offset < src.length) { - this.contents.push(blankLine); - } - } else { - offset += 1; - atLineStart = true; - } - - lineStart = offset; - break; - - case '#': - { - const comment = new Comment(); - offset = comment.parse({ - src - }, offset); - this.contents.push(comment); - atLineStart = false; - } - break; - - default: - { - const iEnd = PlainValue.Node.endOfIndent(src, offset); - const context = { - atLineStart, - indent: -1, - inFlow: false, - inCollection: false, - lineStart, - parent: this - }; - const node = parseNode(context, iEnd); - if (!node) return this.valueRange.end = iEnd; // at next document start - - this.contents.push(node); - offset = node.range.end; - atLineStart = false; - const ec = grabCollectionEndComments(node); - if (ec) Array.prototype.push.apply(this.contents, ec); - } - } - - offset = Document.startCommentOrEndBlankLine(src, offset); - } - - this.valueRange.end = offset; - - if (src[offset]) { - this.documentEndMarker = new PlainValue.Range(offset, offset + 3); - offset += 3; - - if (src[offset]) { - offset = PlainValue.Node.endOfWhiteSpace(src, offset); - - if (src[offset] === '#') { - const comment = new Comment(); - offset = comment.parse({ - src - }, offset); - this.contents.push(comment); - } - - switch (src[offset]) { - case '\n': - offset += 1; - break; - - case undefined: - break; - - default: - this.error = new PlainValue.YAMLSyntaxError(this, 'Document end marker line cannot have a non-comment suffix'); - } - } - } - - return offset; +})); +Object.defineProperty(exports, "differenceInCalendarYears", ({ + enumerable: true, + get: function get() { + return _index27.default; } - /** - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this - */ - - - parse(context, start) { - context.root = this; - this.context = context; - const { - src - } = context; - let offset = src.charCodeAt(start) === 0xfeff ? start + 1 : start; // skip BOM - - offset = this.parseDirectives(offset); - offset = this.parseContents(offset); - return offset; +})); +Object.defineProperty(exports, "differenceInDays", ({ + enumerable: true, + get: function get() { + return _index28.default; } - - setOrigRanges(cr, offset) { - offset = super.setOrigRanges(cr, offset); - this.directives.forEach(node => { - offset = node.setOrigRanges(cr, offset); - }); - if (this.directivesEndMarker) offset = this.directivesEndMarker.setOrigRange(cr, offset); - this.contents.forEach(node => { - offset = node.setOrigRanges(cr, offset); - }); - if (this.documentEndMarker) offset = this.documentEndMarker.setOrigRange(cr, offset); - return offset; +})); +Object.defineProperty(exports, "differenceInHours", ({ + enumerable: true, + get: function get() { + return _index29.default; } - - toString() { - const { - contents, - directives, - value - } = this; - if (value != null) return value; - let str = directives.join(''); - - if (contents.length > 0) { - if (directives.length > 0 || contents[0].type === PlainValue.Type.COMMENT) str += '---\n'; - str += contents.join(''); - } - - if (str[str.length - 1] !== '\n') str += '\n'; - return str; +})); +Object.defineProperty(exports, "differenceInISOWeekYears", ({ + enumerable: true, + get: function get() { + return _index30.default; } - -} - -class Alias extends PlainValue.Node { - /** - * Parses an *alias from the source - * - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this scalar - */ - parse(context, start) { - this.context = context; - const { - src - } = context; - let offset = PlainValue.Node.endOfIdentifier(src, start + 1); - this.valueRange = new PlainValue.Range(start + 1, offset); - offset = PlainValue.Node.endOfWhiteSpace(src, offset); - offset = this.parseComment(offset); - return offset; +})); +Object.defineProperty(exports, "differenceInMilliseconds", ({ + enumerable: true, + get: function get() { + return _index31.default; } - -} - -const Chomp = { - CLIP: 'CLIP', - KEEP: 'KEEP', - STRIP: 'STRIP' -}; -class BlockValue extends PlainValue.Node { - constructor(type, props) { - super(type, props); - this.blockIndent = null; - this.chomping = Chomp.CLIP; - this.header = null; +})); +Object.defineProperty(exports, "differenceInMinutes", ({ + enumerable: true, + get: function get() { + return _index32.default; } - - get includesTrailingLines() { - return this.chomping === Chomp.KEEP; +})); +Object.defineProperty(exports, "differenceInMonths", ({ + enumerable: true, + get: function get() { + return _index33.default; } - - get strValue() { - if (!this.valueRange || !this.context) return null; - let { - start, - end - } = this.valueRange; - const { - indent, - src - } = this.context; - if (this.valueRange.isEmpty()) return ''; - let lastNewLine = null; - let ch = src[end - 1]; - - while (ch === '\n' || ch === '\t' || ch === ' ') { - end -= 1; - - if (end <= start) { - if (this.chomping === Chomp.KEEP) break;else return ''; // probably never happens - } - - if (ch === '\n') lastNewLine = end; - ch = src[end - 1]; - } - - let keepStart = end + 1; - - if (lastNewLine) { - if (this.chomping === Chomp.KEEP) { - keepStart = lastNewLine; - end = this.valueRange.end; - } else { - end = lastNewLine; - } - } - - const bi = indent + this.blockIndent; - const folded = this.type === PlainValue.Type.BLOCK_FOLDED; - let atStart = true; - let str = ''; - let sep = ''; - let prevMoreIndented = false; - - for (let i = start; i < end; ++i) { - for (let j = 0; j < bi; ++j) { - if (src[i] !== ' ') break; - i += 1; - } - - const ch = src[i]; - - if (ch === '\n') { - if (sep === '\n') str += '\n';else sep = '\n'; - } else { - const lineEnd = PlainValue.Node.endOfLine(src, i); - const line = src.slice(i, lineEnd); - i = lineEnd; - - if (folded && (ch === ' ' || ch === '\t') && i < keepStart) { - if (sep === ' ') sep = '\n';else if (!prevMoreIndented && !atStart && sep === '\n') sep = '\n\n'; - str += sep + line; //+ ((lineEnd < end && src[lineEnd]) || '') - - sep = lineEnd < end && src[lineEnd] || ''; - prevMoreIndented = true; - } else { - str += sep + line; - sep = folded && i < keepStart ? ' ' : '\n'; - prevMoreIndented = false; - } - - if (atStart && line !== '') atStart = false; - } - } - - return this.chomping === Chomp.STRIP ? str : str + '\n'; +})); +Object.defineProperty(exports, "differenceInQuarters", ({ + enumerable: true, + get: function get() { + return _index34.default; } - - parseBlockHeader(start) { - const { - src - } = this.context; - let offset = start + 1; - let bi = ''; - - while (true) { - const ch = src[offset]; - - switch (ch) { - case '-': - this.chomping = Chomp.STRIP; - break; - - case '+': - this.chomping = Chomp.KEEP; - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - bi += ch; - break; - - default: - this.blockIndent = Number(bi) || null; - this.header = new PlainValue.Range(start, offset); - return offset; - } - - offset += 1; - } +})); +Object.defineProperty(exports, "differenceInSeconds", ({ + enumerable: true, + get: function get() { + return _index35.default; } - - parseBlockValue(start) { - const { - indent, - src - } = this.context; - const explicit = !!this.blockIndent; - let offset = start; - let valueEnd = start; - let minBlockIndent = 1; - - for (let ch = src[offset]; ch === '\n'; ch = src[offset]) { - offset += 1; - if (PlainValue.Node.atDocumentBoundary(src, offset)) break; - const end = PlainValue.Node.endOfBlockIndent(src, indent, offset); // should not include tab? - - if (end === null) break; - const ch = src[end]; - const lineIndent = end - (offset + indent); - - if (!this.blockIndent) { - // no explicit block indent, none yet detected - if (src[end] !== '\n') { - // first line with non-whitespace content - if (lineIndent < minBlockIndent) { - const msg = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator'; - this.error = new PlainValue.YAMLSemanticError(this, msg); - } - - this.blockIndent = lineIndent; - } else if (lineIndent > minBlockIndent) { - // empty line with more whitespace - minBlockIndent = lineIndent; - } - } else if (ch && ch !== '\n' && lineIndent < this.blockIndent) { - if (src[end] === '#') break; - - if (!this.error) { - const src = explicit ? 'explicit indentation indicator' : 'first line'; - const msg = `Block scalars must not be less indented than their ${src}`; - this.error = new PlainValue.YAMLSemanticError(this, msg); - } - } - - if (src[end] === '\n') { - offset = end; - } else { - offset = valueEnd = PlainValue.Node.endOfLine(src, end); - } - } - - if (this.chomping !== Chomp.KEEP) { - offset = src[valueEnd] ? valueEnd + 1 : valueEnd; - } - - this.valueRange = new PlainValue.Range(start + 1, offset); - return offset; +})); +Object.defineProperty(exports, "differenceInWeeks", ({ + enumerable: true, + get: function get() { + return _index36.default; } - /** - * Parses a block value from the source - * - * Accepted forms are: - * ``` - * BS - * block - * lines - * - * BS #comment - * block - * lines - * ``` - * where the block style BS matches the regexp `[|>][-+1-9]*` and block lines - * are empty or have an indent level greater than `indent`. - * - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this block - */ - - - parse(context, start) { - this.context = context; - const { - src - } = context; - let offset = this.parseBlockHeader(start); - offset = PlainValue.Node.endOfWhiteSpace(src, offset); - offset = this.parseComment(offset); - offset = this.parseBlockValue(offset); - return offset; +})); +Object.defineProperty(exports, "differenceInYears", ({ + enumerable: true, + get: function get() { + return _index37.default; } - - setOrigRanges(cr, offset) { - offset = super.setOrigRanges(cr, offset); - return this.header ? this.header.setOrigRange(cr, offset) : offset; +})); +Object.defineProperty(exports, "eachDayOfInterval", ({ + enumerable: true, + get: function get() { + return _index38.default; } - -} - -class FlowCollection extends PlainValue.Node { - constructor(type, props) { - super(type, props); - this.items = null; +})); +Object.defineProperty(exports, "eachHourOfInterval", ({ + enumerable: true, + get: function get() { + return _index39.default; } - - prevNodeIsJsonLike(idx = this.items.length) { - const node = this.items[idx - 1]; - return !!node && (node.jsonLike || node.type === PlainValue.Type.COMMENT && this.prevNodeIsJsonLike(idx - 1)); +})); +Object.defineProperty(exports, "eachMinuteOfInterval", ({ + enumerable: true, + get: function get() { + return _index40.default; } - /** - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this - */ - - - parse(context, start) { - this.context = context; - const { - parseNode, - src - } = context; - let { - indent, - lineStart - } = context; - let char = src[start]; // { or [ - - this.items = [{ - char, - offset: start - }]; - let offset = PlainValue.Node.endOfWhiteSpace(src, start + 1); - char = src[offset]; - - while (char && char !== ']' && char !== '}') { - switch (char) { - case '\n': - { - lineStart = offset + 1; - const wsEnd = PlainValue.Node.endOfWhiteSpace(src, lineStart); - - if (src[wsEnd] === '\n') { - const blankLine = new BlankLine(); - lineStart = blankLine.parse({ - src - }, lineStart); - this.items.push(blankLine); - } - - offset = PlainValue.Node.endOfIndent(src, lineStart); - - if (offset <= lineStart + indent) { - char = src[offset]; - - if (offset < lineStart + indent || char !== ']' && char !== '}') { - const msg = 'Insufficient indentation in flow collection'; - this.error = new PlainValue.YAMLSemanticError(this, msg); - } - } - } - break; - - case ',': - { - this.items.push({ - char, - offset - }); - offset += 1; - } - break; - - case '#': - { - const comment = new Comment(); - offset = comment.parse({ - src - }, offset); - this.items.push(comment); - } - break; - - case '?': - case ':': - { - const next = src[offset + 1]; - - if (next === '\n' || next === '\t' || next === ' ' || next === ',' || // in-flow : after JSON-like key does not need to be followed by whitespace - char === ':' && this.prevNodeIsJsonLike()) { - this.items.push({ - char, - offset - }); - offset += 1; - break; - } - } - // fallthrough - - default: - { - const node = parseNode({ - atLineStart: false, - inCollection: false, - inFlow: true, - indent: -1, - lineStart, - parent: this - }, offset); - - if (!node) { - // at next document start - this.valueRange = new PlainValue.Range(start, offset); - return offset; - } - - this.items.push(node); - offset = PlainValue.Node.normalizeOffset(src, node.range.end); - } - } - - offset = PlainValue.Node.endOfWhiteSpace(src, offset); - char = src[offset]; - } - - this.valueRange = new PlainValue.Range(start, offset + 1); - - if (char) { - this.items.push({ - char, - offset - }); - offset = PlainValue.Node.endOfWhiteSpace(src, offset + 1); - offset = this.parseComment(offset); - } - - return offset; +})); +Object.defineProperty(exports, "eachMonthOfInterval", ({ + enumerable: true, + get: function get() { + return _index41.default; } - - setOrigRanges(cr, offset) { - offset = super.setOrigRanges(cr, offset); - this.items.forEach(node => { - if (node instanceof PlainValue.Node) { - offset = node.setOrigRanges(cr, offset); - } else if (cr.length === 0) { - node.origOffset = node.offset; - } else { - let i = offset; - - while (i < cr.length) { - if (cr[i] > node.offset) break;else ++i; - } - - node.origOffset = node.offset + i; - offset = i; - } - }); - return offset; +})); +Object.defineProperty(exports, "eachQuarterOfInterval", ({ + enumerable: true, + get: function get() { + return _index42.default; } - - toString() { - const { - context: { - src - }, - items, - range, - value - } = this; - if (value != null) return value; - const nodes = items.filter(item => item instanceof PlainValue.Node); - let str = ''; - let prevEnd = range.start; - nodes.forEach(node => { - const prefix = src.slice(prevEnd, node.range.start); - prevEnd = node.range.end; - str += prefix + String(node); - - if (str[str.length - 1] === '\n' && src[prevEnd - 1] !== '\n' && src[prevEnd] === '\n') { - // Comment range does not include the terminal newline, but its - // stringified value does. Without this fix, newlines at comment ends - // get duplicated. - prevEnd += 1; - } - }); - str += src.slice(prevEnd, range.end); - return PlainValue.Node.addStringTerminator(src, range.end, str); +})); +Object.defineProperty(exports, "eachWeekOfInterval", ({ + enumerable: true, + get: function get() { + return _index43.default; } - -} - -class QuoteDouble extends PlainValue.Node { - static endOfQuote(src, offset) { - let ch = src[offset]; - - while (ch && ch !== '"') { - offset += ch === '\\' ? 2 : 1; - ch = src[offset]; - } - - return offset + 1; +})); +Object.defineProperty(exports, "eachWeekendOfInterval", ({ + enumerable: true, + get: function get() { + return _index44.default; } - /** - * @returns {string | { str: string, errors: YAMLSyntaxError[] }} - */ - - - get strValue() { - if (!this.valueRange || !this.context) return null; - const errors = []; - const { - start, - end - } = this.valueRange; - const { - indent, - src - } = this.context; - if (src[end - 1] !== '"') errors.push(new PlainValue.YAMLSyntaxError(this, 'Missing closing "quote')); // Using String#replace is too painful with escaped newlines preceded by - // escaped backslashes; also, this should be faster. - - let str = ''; - - for (let i = start + 1; i < end - 1; ++i) { - const ch = src[i]; - - if (ch === '\n') { - if (PlainValue.Node.atDocumentBoundary(src, i + 1)) errors.push(new PlainValue.YAMLSemanticError(this, 'Document boundary indicators are not allowed within string values')); - const { - fold, - offset, - error - } = PlainValue.Node.foldNewline(src, i, indent); - str += fold; - i = offset; - if (error) errors.push(new PlainValue.YAMLSemanticError(this, 'Multi-line double-quoted string needs to be sufficiently indented')); - } else if (ch === '\\') { - i += 1; - - switch (src[i]) { - case '0': - str += '\0'; - break; - // null character - - case 'a': - str += '\x07'; - break; - // bell character - - case 'b': - str += '\b'; - break; - // backspace - - case 'e': - str += '\x1b'; - break; - // escape character - - case 'f': - str += '\f'; - break; - // form feed - - case 'n': - str += '\n'; - break; - // line feed - - case 'r': - str += '\r'; - break; - // carriage return - - case 't': - str += '\t'; - break; - // horizontal tab - - case 'v': - str += '\v'; - break; - // vertical tab - - case 'N': - str += '\u0085'; - break; - // Unicode next line - - case '_': - str += '\u00a0'; - break; - // Unicode non-breaking space - - case 'L': - str += '\u2028'; - break; - // Unicode line separator - - case 'P': - str += '\u2029'; - break; - // Unicode paragraph separator - - case ' ': - str += ' '; - break; - - case '"': - str += '"'; - break; - - case '/': - str += '/'; - break; - - case '\\': - str += '\\'; - break; - - case '\t': - str += '\t'; - break; - - case 'x': - str += this.parseCharCode(i + 1, 2, errors); - i += 2; - break; - - case 'u': - str += this.parseCharCode(i + 1, 4, errors); - i += 4; - break; - - case 'U': - str += this.parseCharCode(i + 1, 8, errors); - i += 8; - break; - - case '\n': - // skip escaped newlines, but still trim the following line - while (src[i + 1] === ' ' || src[i + 1] === '\t') i += 1; - - break; - - default: - errors.push(new PlainValue.YAMLSyntaxError(this, `Invalid escape sequence ${src.substr(i - 1, 2)}`)); - str += '\\' + src[i]; - } - } else if (ch === ' ' || ch === '\t') { - // trim trailing whitespace - const wsStart = i; - let next = src[i + 1]; - - while (next === ' ' || next === '\t') { - i += 1; - next = src[i + 1]; - } - - if (next !== '\n') str += i > wsStart ? src.slice(wsStart, i + 1) : ch; - } else { - str += ch; - } - } - - return errors.length > 0 ? { - errors, - str - } : str; +})); +Object.defineProperty(exports, "eachWeekendOfMonth", ({ + enumerable: true, + get: function get() { + return _index45.default; } - - parseCharCode(offset, length, errors) { - const { - src - } = this.context; - const cc = src.substr(offset, length); - const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc); - const code = ok ? parseInt(cc, 16) : NaN; - - if (isNaN(code)) { - errors.push(new PlainValue.YAMLSyntaxError(this, `Invalid escape sequence ${src.substr(offset - 2, length + 2)}`)); - return src.substr(offset - 2, length + 2); - } - - return String.fromCodePoint(code); +})); +Object.defineProperty(exports, "eachWeekendOfYear", ({ + enumerable: true, + get: function get() { + return _index46.default; } - /** - * Parses a "double quoted" value from the source - * - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this scalar - */ - - - parse(context, start) { - this.context = context; - const { - src - } = context; - let offset = QuoteDouble.endOfQuote(src, start + 1); - this.valueRange = new PlainValue.Range(start, offset); - offset = PlainValue.Node.endOfWhiteSpace(src, offset); - offset = this.parseComment(offset); - return offset; +})); +Object.defineProperty(exports, "eachYearOfInterval", ({ + enumerable: true, + get: function get() { + return _index47.default; } - -} - -class QuoteSingle extends PlainValue.Node { - static endOfQuote(src, offset) { - let ch = src[offset]; - - while (ch) { - if (ch === "'") { - if (src[offset + 1] !== "'") break; - ch = src[offset += 2]; - } else { - ch = src[offset += 1]; - } - } - - return offset + 1; +})); +Object.defineProperty(exports, "endOfDay", ({ + enumerable: true, + get: function get() { + return _index48.default; } - /** - * @returns {string | { str: string, errors: YAMLSyntaxError[] }} - */ - - - get strValue() { - if (!this.valueRange || !this.context) return null; - const errors = []; - const { - start, - end - } = this.valueRange; - const { - indent, - src - } = this.context; - if (src[end - 1] !== "'") errors.push(new PlainValue.YAMLSyntaxError(this, "Missing closing 'quote")); - let str = ''; - - for (let i = start + 1; i < end - 1; ++i) { - const ch = src[i]; - - if (ch === '\n') { - if (PlainValue.Node.atDocumentBoundary(src, i + 1)) errors.push(new PlainValue.YAMLSemanticError(this, 'Document boundary indicators are not allowed within string values')); - const { - fold, - offset, - error - } = PlainValue.Node.foldNewline(src, i, indent); - str += fold; - i = offset; - if (error) errors.push(new PlainValue.YAMLSemanticError(this, 'Multi-line single-quoted string needs to be sufficiently indented')); - } else if (ch === "'") { - str += ch; - i += 1; - if (src[i] !== "'") errors.push(new PlainValue.YAMLSyntaxError(this, 'Unescaped single quote? This should not happen.')); - } else if (ch === ' ' || ch === '\t') { - // trim trailing whitespace - const wsStart = i; - let next = src[i + 1]; - - while (next === ' ' || next === '\t') { - i += 1; - next = src[i + 1]; - } - - if (next !== '\n') str += i > wsStart ? src.slice(wsStart, i + 1) : ch; - } else { - str += ch; - } - } - - return errors.length > 0 ? { - errors, - str - } : str; +})); +Object.defineProperty(exports, "endOfDecade", ({ + enumerable: true, + get: function get() { + return _index49.default; } - /** - * Parses a 'single quoted' value from the source - * - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this scalar - */ - - - parse(context, start) { - this.context = context; - const { - src - } = context; - let offset = QuoteSingle.endOfQuote(src, start + 1); - this.valueRange = new PlainValue.Range(start, offset); - offset = PlainValue.Node.endOfWhiteSpace(src, offset); - offset = this.parseComment(offset); - return offset; +})); +Object.defineProperty(exports, "endOfHour", ({ + enumerable: true, + get: function get() { + return _index50.default; } - -} - -function createNewNode(type, props) { - switch (type) { - case PlainValue.Type.ALIAS: - return new Alias(type, props); - - case PlainValue.Type.BLOCK_FOLDED: - case PlainValue.Type.BLOCK_LITERAL: - return new BlockValue(type, props); - - case PlainValue.Type.FLOW_MAP: - case PlainValue.Type.FLOW_SEQ: - return new FlowCollection(type, props); - - case PlainValue.Type.MAP_KEY: - case PlainValue.Type.MAP_VALUE: - case PlainValue.Type.SEQ_ITEM: - return new CollectionItem(type, props); - - case PlainValue.Type.COMMENT: - case PlainValue.Type.PLAIN: - return new PlainValue.PlainValue(type, props); - - case PlainValue.Type.QUOTE_DOUBLE: - return new QuoteDouble(type, props); - - case PlainValue.Type.QUOTE_SINGLE: - return new QuoteSingle(type, props); - - /* istanbul ignore next */ - - default: - return null; - // should never happen +})); +Object.defineProperty(exports, "endOfISOWeek", ({ + enumerable: true, + get: function get() { + return _index51.default; } -} -/** - * @param {boolean} atLineStart - Node starts at beginning of line - * @param {boolean} inFlow - true if currently in a flow context - * @param {boolean} inCollection - true if currently in a collection context - * @param {number} indent - Current level of indentation - * @param {number} lineStart - Start of the current line - * @param {Node} parent - The parent of the node - * @param {string} src - Source of the YAML document - */ - - -class ParseContext { - static parseType(src, offset, inFlow) { - switch (src[offset]) { - case '*': - return PlainValue.Type.ALIAS; - - case '>': - return PlainValue.Type.BLOCK_FOLDED; - - case '|': - return PlainValue.Type.BLOCK_LITERAL; - - case '{': - return PlainValue.Type.FLOW_MAP; - - case '[': - return PlainValue.Type.FLOW_SEQ; - - case '?': - return !inFlow && PlainValue.Node.atBlank(src, offset + 1, true) ? PlainValue.Type.MAP_KEY : PlainValue.Type.PLAIN; - - case ':': - return !inFlow && PlainValue.Node.atBlank(src, offset + 1, true) ? PlainValue.Type.MAP_VALUE : PlainValue.Type.PLAIN; - - case '-': - return !inFlow && PlainValue.Node.atBlank(src, offset + 1, true) ? PlainValue.Type.SEQ_ITEM : PlainValue.Type.PLAIN; - - case '"': - return PlainValue.Type.QUOTE_DOUBLE; - - case "'": - return PlainValue.Type.QUOTE_SINGLE; - - default: - return PlainValue.Type.PLAIN; - } +})); +Object.defineProperty(exports, "endOfISOWeekYear", ({ + enumerable: true, + get: function get() { + return _index52.default; } - - constructor(orig = {}, { - atLineStart, - inCollection, - inFlow, - indent, - lineStart, - parent - } = {}) { - PlainValue._defineProperty(this, "parseNode", (overlay, start) => { - if (PlainValue.Node.atDocumentBoundary(this.src, start)) return null; - const context = new ParseContext(this, overlay); - const { - props, - type, - valueStart - } = context.parseProps(start); - const node = createNewNode(type, props); - let offset = node.parse(context, valueStart); - node.range = new PlainValue.Range(start, offset); - /* istanbul ignore if */ - - if (offset <= start) { - // This should never happen, but if it does, let's make sure to at least - // step one character forward to avoid a busy loop. - node.error = new Error(`Node#parse consumed no characters`); - node.error.parseEnd = offset; - node.error.source = node; - node.range.end = start + 1; - } - - if (context.nodeStartsCollection(node)) { - if (!node.error && !context.atLineStart && context.parent.type === PlainValue.Type.DOCUMENT) { - node.error = new PlainValue.YAMLSyntaxError(node, 'Block collection must not have preceding content here (e.g. directives-end indicator)'); - } - - const collection = new Collection(node); - offset = collection.parse(new ParseContext(context), offset); - collection.range = new PlainValue.Range(start, offset); - return collection; - } - - return node; - }); - - this.atLineStart = atLineStart != null ? atLineStart : orig.atLineStart || false; - this.inCollection = inCollection != null ? inCollection : orig.inCollection || false; - this.inFlow = inFlow != null ? inFlow : orig.inFlow || false; - this.indent = indent != null ? indent : orig.indent; - this.lineStart = lineStart != null ? lineStart : orig.lineStart; - this.parent = parent != null ? parent : orig.parent || {}; - this.root = orig.root; - this.src = orig.src; +})); +Object.defineProperty(exports, "endOfMinute", ({ + enumerable: true, + get: function get() { + return _index53.default; } - - nodeStartsCollection(node) { - const { - inCollection, - inFlow, - src - } = this; - if (inCollection || inFlow) return false; - if (node instanceof CollectionItem) return true; // check for implicit key - - let offset = node.range.end; - if (src[offset] === '\n' || src[offset - 1] === '\n') return false; - offset = PlainValue.Node.endOfWhiteSpace(src, offset); - return src[offset] === ':'; - } // Anchor and tag are before type, which determines the node implementation - // class; hence this intermediate step. - - - parseProps(offset) { - const { - inFlow, - parent, - src - } = this; - const props = []; - let lineHasProps = false; - offset = this.atLineStart ? PlainValue.Node.endOfIndent(src, offset) : PlainValue.Node.endOfWhiteSpace(src, offset); - let ch = src[offset]; - - while (ch === PlainValue.Char.ANCHOR || ch === PlainValue.Char.COMMENT || ch === PlainValue.Char.TAG || ch === '\n') { - if (ch === '\n') { - let inEnd = offset; - let lineStart; - - do { - lineStart = inEnd + 1; - inEnd = PlainValue.Node.endOfIndent(src, lineStart); - } while (src[inEnd] === '\n'); - - const indentDiff = inEnd - (lineStart + this.indent); - const noIndicatorAsIndent = parent.type === PlainValue.Type.SEQ_ITEM && parent.context.atLineStart; - if (src[inEnd] !== '#' && !PlainValue.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break; - this.atLineStart = true; - this.lineStart = lineStart; - lineHasProps = false; - offset = inEnd; - } else if (ch === PlainValue.Char.COMMENT) { - const end = PlainValue.Node.endOfLine(src, offset + 1); - props.push(new PlainValue.Range(offset, end)); - offset = end; - } else { - let end = PlainValue.Node.endOfIdentifier(src, offset + 1); - - if (ch === PlainValue.Char.TAG && src[end] === ',' && /^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(src.slice(offset + 1, end + 13))) { - // Let's presume we're dealing with a YAML 1.0 domain tag here, rather - // than an empty but 'foo.bar' private-tagged node in a flow collection - // followed without whitespace by a plain string starting with a year - // or date divided by something. - end = PlainValue.Node.endOfIdentifier(src, end + 5); - } - - props.push(new PlainValue.Range(offset, end)); - lineHasProps = true; - offset = PlainValue.Node.endOfWhiteSpace(src, end); - } - - ch = src[offset]; - } // '- &a : b' has an anchor on an empty node - - - if (lineHasProps && ch === ':' && PlainValue.Node.atBlank(src, offset + 1, true)) offset -= 1; - const type = ParseContext.parseType(src, offset, inFlow); - return { - props, - type, - valueStart: offset - }; +})); +Object.defineProperty(exports, "endOfMonth", ({ + enumerable: true, + get: function get() { + return _index54.default; } - /** - * Parses a node from the source - * @param {ParseContext} overlay - * @param {number} start - Index of first non-whitespace character for the node - * @returns {?Node} - null if at a document boundary - */ - - -} - -// Published as 'yaml/parse-cst' -function parse(src) { - const cr = []; - - if (src.indexOf('\r') !== -1) { - src = src.replace(/\r\n?/g, (match, offset) => { - if (match.length > 1) cr.push(offset); - return '\n'; - }); +})); +Object.defineProperty(exports, "endOfQuarter", ({ + enumerable: true, + get: function get() { + return _index55.default; } - - const documents = []; - let offset = 0; - - do { - const doc = new Document(); - const context = new ParseContext({ - src - }); - offset = doc.parse(context, offset); - documents.push(doc); - } while (offset < src.length); - - documents.setOrigRanges = () => { - if (cr.length === 0) return false; - - for (let i = 1; i < cr.length; ++i) cr[i] -= i; - - let crOffset = 0; - - for (let i = 0; i < documents.length; ++i) { - crOffset = documents[i].setOrigRanges(cr, crOffset); - } - - cr.splice(0, cr.length); - return true; - }; - - documents.toString = () => documents.join('...\n'); - - return documents; -} - -exports.parse = parse; - - -/***/ }), -/* 349 */, -/* 350 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = startOfSecond; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name startOfSecond - * @category Second Helpers - * @summary Return the start of a second for the given date. - * - * @description - * Return the start of a second for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the original date - * @returns {Date} the start of a second - * @throws {TypeError} 1 argument required - * - * @example - * // The start of a second for 1 December 2014 22:15:45.400: - * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:45.000 - */ -function startOfSecond(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - date.setMilliseconds(0); - return date; -} - -module.exports = exports.default; - -/***/ }), -/* 351 */, -/* 352 */, -/* 353 */, -/* 354 */, -/* 355 */, -/* 356 */, -/* 357 */ -/***/ (function(module) { - -module.exports = require("assert"); - -/***/ }), -/* 358 */, -/* 359 */, -/* 360 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = nextWednesday; - -var _index = _interopRequireDefault(__webpack_require__(217)); - -var _index2 = _interopRequireDefault(__webpack_require__(940)); - -var _index3 = _interopRequireDefault(__webpack_require__(773)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name nextWednesday - * @category Weekday Helpers - * @summary When is the next Wednesday? - * - * @description - * When is the next Wednesday? - * - * @param {Date | number} date - the date to start counting from - * @returns {Date} the next Wednesday - * @throws {TypeError} 1 argument required - * - * @example - * // When is the next Wednesday after Mar, 22, 2020? - * const result = nextWednesday(new Date(2020, 2, 22)) - * //=> Wed Mar 25 2020 00:00:00 - */ -function nextWednesday(date) { - (0, _index.default)(1, arguments); - return (0, _index2.default)((0, _index3.default)(date), 3); -} - -module.exports = exports.default; - -/***/ }), -/* 361 */, -/* 362 */, -/* 363 */ -/***/ (function(__unusedmodule, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isIdentifierStart = isIdentifierStart; -exports.isIdentifierChar = isIdentifierChar; -exports.isIdentifierName = isIdentifierName; -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; +})); +Object.defineProperty(exports, "endOfSecond", ({ + enumerable: true, + get: function get() { + return _index56.default; } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); +})); +Object.defineProperty(exports, "endOfToday", ({ + enumerable: true, + get: function get() { + return _index57.default; } - - return isInAstralSet(code, astralIdentifierStartCodes); -} - -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); +})); +Object.defineProperty(exports, "endOfTomorrow", ({ + enumerable: true, + get: function get() { + return _index58.default; } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -function isIdentifierName(name) { - let isFirst = true; - - for (let i = 0; i < name.length; i++) { - let cp = name.charCodeAt(i); - - if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { - const trail = name.charCodeAt(++i); - - if ((trail & 0xfc00) === 0xdc00) { - cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); - } - } - - if (isFirst) { - isFirst = false; - - if (!isIdentifierStart(cp)) { - return false; - } - } else if (!isIdentifierChar(cp)) { - return false; - } +})); +Object.defineProperty(exports, "endOfWeek", ({ + enumerable: true, + get: function get() { + return _index59.default; } - - return !isFirst; -} - -/***/ }), -/* 364 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isSameHour; - -var _index = _interopRequireDefault(__webpack_require__(663)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name isSameHour - * @category Hour Helpers - * @summary Are the given dates in the same hour? - * - * @description - * Are the given dates in the same hour? - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} dateLeft - the first date to check - * @param {Date|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same hour - * @throws {TypeError} 2 arguments required - * - * @example - * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour? - * var result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30)) - * //=> true - */ -function isSameHour(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - var dateLeftStartOfHour = (0, _index.default)(dirtyDateLeft); - var dateRightStartOfHour = (0, _index.default)(dirtyDateRight); - return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime(); -} - -module.exports = exports.default; - -/***/ }), -/* 365 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const compareBuild = __webpack_require__(126) -const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) -module.exports = rsort - - -/***/ }), -/* 366 */, -/* 367 */, -/* 368 */, -/* 369 */, -/* 370 */, -/* 371 */, -/* 372 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; -Object.defineProperty(exports,"__esModule",{value:true});exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(87); - -var _signals=__webpack_require__(992); -var _realtime=__webpack_require__(339); - - - -const getSignalsByName=function(){ -const signals=(0,_signals.getSignals)(); -return signals.reduce(getSignalByName,{}); -}; - -const getSignalByName=function( -signalByNameMemo, -{name,number,description,supported,action,forced,standard}) -{ -return{ -...signalByNameMemo, -[name]:{name,number,description,supported,action,forced,standard}}; - -}; - -const signalsByName=getSignalsByName();exports.signalsByName=signalsByName; - - - - -const getSignalsByNumber=function(){ -const signals=(0,_signals.getSignals)(); -const length=_realtime.SIGRTMAX+1; -const signalsA=Array.from({length},(value,number)=> -getSignalByNumber(number,signals)); - -return Object.assign({},...signalsA); -}; - -const getSignalByNumber=function(number,signals){ -const signal=findSignalByNumber(number,signals); - -if(signal===undefined){ -return{}; -} - -const{name,description,supported,action,forced,standard}=signal; -return{ -[number]:{ -name, -number, -description, -supported, -action, -forced, -standard}}; - - -}; - - - -const findSignalByNumber=function(number,signals){ -const signal=signals.find(({name})=>_os.constants.signals[name]===number); - -if(signal!==undefined){ -return signal; -} - -return signals.find(signalA=>signalA.number===number); -}; - -const signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumber; -//# sourceMappingURL=main.js.map - -/***/ }), -/* 373 */ -/***/ (function(module) { - -function toArr(any) { - return any == null ? [] : Array.isArray(any) ? any : [any]; -} - -function toVal(out, key, val, opts) { - var x, old=out[key], nxt=( - !!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val)) - : typeof val === 'boolean' ? val - : !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val)) - : (x = +val,x * 0 === 0) ? x : val - ); - out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]); -} - -module.exports = function (args, opts) { - args = args || []; - opts = opts || {}; - - var k, arr, arg, name, val, out={ _:[] }; - var i=0, j=0, idx=0, len=args.length; - - const alibi = opts.alias !== void 0; - const strict = opts.unknown !== void 0; - const defaults = opts.default !== void 0; - - opts.alias = opts.alias || {}; - opts.string = toArr(opts.string); - opts.boolean = toArr(opts.boolean); - - if (alibi) { - for (k in opts.alias) { - arr = opts.alias[k] = toArr(opts.alias[k]); - for (i=0; i < arr.length; i++) { - (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1); - } - } - } - - for (i=opts.boolean.length; i-- > 0;) { - arr = opts.alias[opts.boolean[i]] || []; - for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]); - } - - for (i=opts.string.length; i-- > 0;) { - arr = opts.alias[opts.string[i]] || []; - for (j=arr.length; j-- > 0;) opts.string.push(arr[j]); - } - - if (defaults) { - for (k in opts.default) { - name = typeof opts.default[k]; - arr = opts.alias[k] = opts.alias[k] || []; - if (opts[name] !== void 0) { - opts[name].push(k); - for (i=0; i < arr.length; i++) { - opts[name].push(arr[i]); - } - } - } - } - - const keys = strict ? Object.keys(opts.alias) : []; - - for (i=0; i < len; i++) { - arg = args[i]; - - if (arg === '--') { - out._ = out._.concat(args.slice(++i)); - break; - } - - for (j=0; j < arg.length; j++) { - if (arg.charCodeAt(j) !== 45) break; // "-" - } - - if (j === 0) { - out._.push(arg); - } else if (arg.substring(j, j + 3) === 'no-') { - name = arg.substring(j + 3); - if (strict && !~keys.indexOf(name)) { - return opts.unknown(arg); - } - out[name] = false; - } else { - for (idx=j+1; idx < arg.length; idx++) { - if (arg.charCodeAt(idx) === 61) break; // "=" - } - - name = arg.substring(j, idx); - val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]); - arr = (j === 2 ? [name] : name); - - for (idx=0; idx < arr.length; idx++) { - name = arr[idx]; - if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name); - toVal(out, name, (idx + 1 < arr.length) || val, opts); - } - } - } - - if (defaults) { - for (k in opts.default) { - if (out[k] === void 0) { - out[k] = opts.default[k]; - } - } - } - - if (alibi) { - for (k in out) { - arr = opts.alias[k] || []; - while (arr.length > 0) { - out[arr.shift()] = out[k]; - } - } - } - - return out; -} - - -/***/ }), -/* 374 */, -/* 375 */, -/* 376 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getQuarter; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name getQuarter - * @category Quarter Helpers - * @summary Get the year quarter of the given date. - * - * @description - * Get the year quarter of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @returns {Number} the quarter - * @throws {TypeError} 1 argument required - * - * @example - * // Which quarter is 2 July 2014? - * const result = getQuarter(new Date(2014, 6, 2)) - * //=> 3 - */ -function getQuarter(dirtyDate) { - (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var quarter = Math.floor(date.getMonth() / 3) + 1; - return quarter; -} - -module.exports = exports.default; - -/***/ }), -/* 377 */, -/* 378 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getDayOfYear; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(405)); - -var _index3 = _interopRequireDefault(__webpack_require__(580)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name getDayOfYear - * @category Day Helpers - * @summary Get the day of the year of the given date. - * - * @description - * Get the day of the year of the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the given date - * @returns {Number} the day of year - * @throws {TypeError} 1 argument required - * - * @example - * // Which day of the year is 2 July 2014? - * const result = getDayOfYear(new Date(2014, 6, 2)) - * //=> 183 - */ -function getDayOfYear(dirtyDate) { - (0, _index4.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var diff = (0, _index3.default)(date, (0, _index2.default)(date)); - var dayOfYear = diff + 1; - return dayOfYear; -} - -module.exports = exports.default; - -/***/ }), -/* 379 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = formatDistanceStrict; - -var _index = _interopRequireDefault(__webpack_require__(151)); - -var _index2 = _interopRequireDefault(__webpack_require__(432)); - -var _index3 = _interopRequireDefault(__webpack_require__(773)); - -var _index4 = _interopRequireDefault(__webpack_require__(846)); - -var _index5 = _interopRequireDefault(__webpack_require__(275)); - -var _index6 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var MILLISECONDS_IN_MINUTE = 1000 * 60; -var MINUTES_IN_DAY = 60 * 24; -var MINUTES_IN_MONTH = MINUTES_IN_DAY * 30; -var MINUTES_IN_YEAR = MINUTES_IN_DAY * 365; -/** - * @name formatDistanceStrict - * @category Common Helpers - * @summary Return the distance between the given dates in words. - * - * @description - * Return the distance between the given dates in words, using strict units. - * This is like `formatDistance`, but does not use helpers like 'almost', 'over', - * 'less than' and the like. - * - * | Distance between dates | Result | - * |------------------------|---------------------| - * | 0 ... 59 secs | [0..59] seconds | - * | 1 ... 59 mins | [1..59] minutes | - * | 1 ... 23 hrs | [1..23] hours | - * | 1 ... 29 days | [1..29] days | - * | 1 ... 11 months | [1..11] months | - * | 1 ... N years | [1..N] years | - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * - The function was renamed from `distanceInWordsStrict` to `formatDistanceStrict` - * to make its name consistent with `format` and `formatRelative`. - * - * - The order of arguments is swapped to make the function - * consistent with `differenceIn...` functions. - * - * ```javascript - * // Before v2.0.0 - * - * distanceInWordsStrict( - * new Date(2015, 0, 2), - * new Date(2014, 6, 2) - * ) //=> '6 months' - * - * // v2.0.0 onward - * - * formatDistanceStrict( - * new Date(2014, 6, 2), - * new Date(2015, 0, 2) - * ) //=> '6 months' - * ``` - * - * - `partialMethod` option is renamed to `roundingMethod`. - * - * ```javascript - * // Before v2.0.0 - * - * distanceInWordsStrict( - * new Date(1986, 3, 4, 10, 32, 0), - * new Date(1986, 3, 4, 10, 33, 1), - * { partialMethod: 'ceil' } - * ) //=> '2 minutes' - * - * // v2.0.0 onward - * - * formatDistanceStrict( - * new Date(1986, 3, 4, 10, 33, 1), - * new Date(1986, 3, 4, 10, 32, 0), - * { roundingMethod: 'ceil' } - * ) //=> '2 minutes' - * ``` - * - * - If `roundingMethod` is not specified, it now defaults to `round` instead of `floor`. - * - * - `unit` option now accepts one of the strings: - * 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y' - * - * ```javascript - * // Before v2.0.0 - * - * distanceInWordsStrict( - * new Date(1986, 3, 4, 10, 32, 0), - * new Date(1986, 3, 4, 10, 33, 1), - * { unit: 'm' } - * ) - * - * // v2.0.0 onward - * - * formatDistanceStrict( - * new Date(1986, 3, 4, 10, 33, 1), - * new Date(1986, 3, 4, 10, 32, 0), - * { unit: 'minute' } - * ) - * ``` - * - * @param {Date|Number} date - the date - * @param {Date|Number} baseDate - the date to compare with - * @param {Object} [options] - an object with options. - * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first - * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit - * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @returns {String} the distance in words - * @throws {TypeError} 2 arguments required - * @throws {RangeError} `date` must not be Invalid Date - * @throws {RangeError} `baseDate` must not be Invalid Date - * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round' - * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year' - * @throws {RangeError} `options.locale` must contain `formatDistance` property - * - * @example - * // What is the distance between 2 July 2014 and 1 January 2015? - * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2)) - * //=> '6 months' - * - * @example - * // What is the distance between 1 January 2015 00:00:15 - * // and 1 January 2015 00:00:00? - * const result = formatDistanceStrict( - * new Date(2015, 0, 1, 0, 0, 15), - * new Date(2015, 0, 1, 0, 0, 0) - * ) - * //=> '15 seconds' - * - * @example - * // What is the distance from 1 January 2016 - * // to 1 January 2015, with a suffix? - * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), { - * addSuffix: true - * }) - * //=> '1 year ago' - * - * @example - * // What is the distance from 1 January 2016 - * // to 1 January 2015, in minutes? - * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), { - * unit: 'minute' - * }) - * //=> '525600 minutes' - * - * @example - * // What is the distance from 1 January 2015 - * // to 28 January 2015, in months, rounded up? - * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), { - * unit: 'month', - * roundingMethod: 'ceil' - * }) - * //=> '1 month' - * - * @example - * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? - * import { eoLocale } from 'date-fns/locale/eo' - * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), { - * locale: eoLocale - * }) - * //=> '1 jaro' - */ - -function formatDistanceStrict(dirtyDate, dirtyBaseDate) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - (0, _index6.default)(2, arguments); - var locale = options.locale || _index5.default; - - if (!locale.formatDistance) { - throw new RangeError('locale must contain localize.formatDistance property'); +})); +Object.defineProperty(exports, "endOfYear", ({ + enumerable: true, + get: function get() { + return _index60.default; } - - var comparison = (0, _index2.default)(dirtyDate, dirtyBaseDate); - - if (isNaN(comparison)) { - throw new RangeError('Invalid time value'); +})); +Object.defineProperty(exports, "endOfYesterday", ({ + enumerable: true, + get: function get() { + return _index61.default; } - - var localizeOptions = (0, _index4.default)(options); - localizeOptions.addSuffix = Boolean(options.addSuffix); - localizeOptions.comparison = comparison; - var dateLeft; - var dateRight; - - if (comparison > 0) { - dateLeft = (0, _index3.default)(dirtyBaseDate); - dateRight = (0, _index3.default)(dirtyDate); - } else { - dateLeft = (0, _index3.default)(dirtyDate); - dateRight = (0, _index3.default)(dirtyBaseDate); +})); +Object.defineProperty(exports, "format", ({ + enumerable: true, + get: function get() { + return _index62.default; } - - var roundingMethod = options.roundingMethod == null ? 'round' : String(options.roundingMethod); - var roundingMethodFn; - - if (roundingMethod === 'floor') { - roundingMethodFn = Math.floor; - } else if (roundingMethod === 'ceil') { - roundingMethodFn = Math.ceil; - } else if (roundingMethod === 'round') { - roundingMethodFn = Math.round; - } else { - throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'"); +})); +Object.defineProperty(exports, "formatDistance", ({ + enumerable: true, + get: function get() { + return _index63.default; } - - var milliseconds = dateRight.getTime() - dateLeft.getTime(); - var minutes = milliseconds / MILLISECONDS_IN_MINUTE; - var timezoneOffset = (0, _index.default)(dateRight) - (0, _index.default)(dateLeft); // Use DST-normalized difference in minutes for years, months and days; - // use regular difference in minutes for hours, minutes and seconds. - - var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE; - var unit; - - if (options.unit == null) { - if (minutes < 1) { - unit = 'second'; - } else if (minutes < 60) { - unit = 'minute'; - } else if (minutes < MINUTES_IN_DAY) { - unit = 'hour'; - } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) { - unit = 'day'; - } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) { - unit = 'month'; - } else { - unit = 'year'; - } - } else { - unit = String(options.unit); - } // 0 up to 60 seconds - - - if (unit === 'second') { - var seconds = roundingMethodFn(milliseconds / 1000); - return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins - } else if (unit === 'minute') { - var roundedMinutes = roundingMethodFn(minutes); - return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours - } else if (unit === 'hour') { - var hours = roundingMethodFn(minutes / 60); - return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days - } else if (unit === 'day') { - var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY); - return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months - } else if (unit === 'month') { - var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH); - return months === 12 && options.unit !== 'month' ? locale.formatDistance('xYears', 1, localizeOptions) : locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date - } else if (unit === 'year') { - var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR); - return locale.formatDistance('xYears', years, localizeOptions); +})); +Object.defineProperty(exports, "formatDistanceStrict", ({ + enumerable: true, + get: function get() { + return _index64.default; } +})); +Object.defineProperty(exports, "formatDistanceToNow", ({ + enumerable: true, + get: function get() { + return _index65.default; + } +})); +Object.defineProperty(exports, "formatDistanceToNowStrict", ({ + enumerable: true, + get: function get() { + return _index66.default; + } +})); +Object.defineProperty(exports, "formatDuration", ({ + enumerable: true, + get: function get() { + return _index67.default; + } +})); +Object.defineProperty(exports, "formatISO", ({ + enumerable: true, + get: function get() { + return _index68.default; + } +})); +Object.defineProperty(exports, "formatISO9075", ({ + enumerable: true, + get: function get() { + return _index69.default; + } +})); +Object.defineProperty(exports, "formatISODuration", ({ + enumerable: true, + get: function get() { + return _index70.default; + } +})); +Object.defineProperty(exports, "formatRFC3339", ({ + enumerable: true, + get: function get() { + return _index71.default; + } +})); +Object.defineProperty(exports, "formatRFC7231", ({ + enumerable: true, + get: function get() { + return _index72.default; + } +})); +Object.defineProperty(exports, "formatRelative", ({ + enumerable: true, + get: function get() { + return _index73.default; + } +})); +Object.defineProperty(exports, "fromUnixTime", ({ + enumerable: true, + get: function get() { + return _index74.default; + } +})); +Object.defineProperty(exports, "getDate", ({ + enumerable: true, + get: function get() { + return _index75.default; + } +})); +Object.defineProperty(exports, "getDay", ({ + enumerable: true, + get: function get() { + return _index76.default; + } +})); +Object.defineProperty(exports, "getDayOfYear", ({ + enumerable: true, + get: function get() { + return _index77.default; + } +})); +Object.defineProperty(exports, "getDaysInMonth", ({ + enumerable: true, + get: function get() { + return _index78.default; + } +})); +Object.defineProperty(exports, "getDaysInYear", ({ + enumerable: true, + get: function get() { + return _index79.default; + } +})); +Object.defineProperty(exports, "getDecade", ({ + enumerable: true, + get: function get() { + return _index80.default; + } +})); +Object.defineProperty(exports, "getDefaultOptions", ({ + enumerable: true, + get: function get() { + return _index81.default; + } +})); +Object.defineProperty(exports, "getHours", ({ + enumerable: true, + get: function get() { + return _index82.default; + } +})); +Object.defineProperty(exports, "getISODay", ({ + enumerable: true, + get: function get() { + return _index83.default; + } +})); +Object.defineProperty(exports, "getISOWeek", ({ + enumerable: true, + get: function get() { + return _index84.default; + } +})); +Object.defineProperty(exports, "getISOWeekYear", ({ + enumerable: true, + get: function get() { + return _index85.default; + } +})); +Object.defineProperty(exports, "getISOWeeksInYear", ({ + enumerable: true, + get: function get() { + return _index86.default; + } +})); +Object.defineProperty(exports, "getMilliseconds", ({ + enumerable: true, + get: function get() { + return _index87.default; + } +})); +Object.defineProperty(exports, "getMinutes", ({ + enumerable: true, + get: function get() { + return _index88.default; + } +})); +Object.defineProperty(exports, "getMonth", ({ + enumerable: true, + get: function get() { + return _index89.default; + } +})); +Object.defineProperty(exports, "getOverlappingDaysInIntervals", ({ + enumerable: true, + get: function get() { + return _index90.default; + } +})); +Object.defineProperty(exports, "getQuarter", ({ + enumerable: true, + get: function get() { + return _index91.default; + } +})); +Object.defineProperty(exports, "getSeconds", ({ + enumerable: true, + get: function get() { + return _index92.default; + } +})); +Object.defineProperty(exports, "getTime", ({ + enumerable: true, + get: function get() { + return _index93.default; + } +})); +Object.defineProperty(exports, "getUnixTime", ({ + enumerable: true, + get: function get() { + return _index94.default; + } +})); +Object.defineProperty(exports, "getWeek", ({ + enumerable: true, + get: function get() { + return _index95.default; + } +})); +Object.defineProperty(exports, "getWeekOfMonth", ({ + enumerable: true, + get: function get() { + return _index96.default; + } +})); +Object.defineProperty(exports, "getWeekYear", ({ + enumerable: true, + get: function get() { + return _index97.default; + } +})); +Object.defineProperty(exports, "getWeeksInMonth", ({ + enumerable: true, + get: function get() { + return _index98.default; + } +})); +Object.defineProperty(exports, "getYear", ({ + enumerable: true, + get: function get() { + return _index99.default; + } +})); +Object.defineProperty(exports, "hoursToMilliseconds", ({ + enumerable: true, + get: function get() { + return _index100.default; + } +})); +Object.defineProperty(exports, "hoursToMinutes", ({ + enumerable: true, + get: function get() { + return _index101.default; + } +})); +Object.defineProperty(exports, "hoursToSeconds", ({ + enumerable: true, + get: function get() { + return _index102.default; + } +})); +Object.defineProperty(exports, "intervalToDuration", ({ + enumerable: true, + get: function get() { + return _index103.default; + } +})); +Object.defineProperty(exports, "intlFormat", ({ + enumerable: true, + get: function get() { + return _index104.default; + } +})); +Object.defineProperty(exports, "intlFormatDistance", ({ + enumerable: true, + get: function get() { + return _index105.default; + } +})); +Object.defineProperty(exports, "isAfter", ({ + enumerable: true, + get: function get() { + return _index106.default; + } +})); +Object.defineProperty(exports, "isBefore", ({ + enumerable: true, + get: function get() { + return _index107.default; + } +})); +Object.defineProperty(exports, "isDate", ({ + enumerable: true, + get: function get() { + return _index108.default; + } +})); +Object.defineProperty(exports, "isEqual", ({ + enumerable: true, + get: function get() { + return _index109.default; + } +})); +Object.defineProperty(exports, "isExists", ({ + enumerable: true, + get: function get() { + return _index110.default; + } +})); +Object.defineProperty(exports, "isFirstDayOfMonth", ({ + enumerable: true, + get: function get() { + return _index111.default; + } +})); +Object.defineProperty(exports, "isFriday", ({ + enumerable: true, + get: function get() { + return _index112.default; + } +})); +Object.defineProperty(exports, "isFuture", ({ + enumerable: true, + get: function get() { + return _index113.default; + } +})); +Object.defineProperty(exports, "isLastDayOfMonth", ({ + enumerable: true, + get: function get() { + return _index114.default; + } +})); +Object.defineProperty(exports, "isLeapYear", ({ + enumerable: true, + get: function get() { + return _index115.default; + } +})); +Object.defineProperty(exports, "isMatch", ({ + enumerable: true, + get: function get() { + return _index116.default; + } +})); +Object.defineProperty(exports, "isMonday", ({ + enumerable: true, + get: function get() { + return _index117.default; + } +})); +Object.defineProperty(exports, "isPast", ({ + enumerable: true, + get: function get() { + return _index118.default; + } +})); +Object.defineProperty(exports, "isSameDay", ({ + enumerable: true, + get: function get() { + return _index119.default; + } +})); +Object.defineProperty(exports, "isSameHour", ({ + enumerable: true, + get: function get() { + return _index120.default; + } +})); +Object.defineProperty(exports, "isSameISOWeek", ({ + enumerable: true, + get: function get() { + return _index121.default; + } +})); +Object.defineProperty(exports, "isSameISOWeekYear", ({ + enumerable: true, + get: function get() { + return _index122.default; + } +})); +Object.defineProperty(exports, "isSameMinute", ({ + enumerable: true, + get: function get() { + return _index123.default; + } +})); +Object.defineProperty(exports, "isSameMonth", ({ + enumerable: true, + get: function get() { + return _index124.default; + } +})); +Object.defineProperty(exports, "isSameQuarter", ({ + enumerable: true, + get: function get() { + return _index125.default; + } +})); +Object.defineProperty(exports, "isSameSecond", ({ + enumerable: true, + get: function get() { + return _index126.default; + } +})); +Object.defineProperty(exports, "isSameWeek", ({ + enumerable: true, + get: function get() { + return _index127.default; + } +})); +Object.defineProperty(exports, "isSameYear", ({ + enumerable: true, + get: function get() { + return _index128.default; + } +})); +Object.defineProperty(exports, "isSaturday", ({ + enumerable: true, + get: function get() { + return _index129.default; + } +})); +Object.defineProperty(exports, "isSunday", ({ + enumerable: true, + get: function get() { + return _index130.default; + } +})); +Object.defineProperty(exports, "isThisHour", ({ + enumerable: true, + get: function get() { + return _index131.default; + } +})); +Object.defineProperty(exports, "isThisISOWeek", ({ + enumerable: true, + get: function get() { + return _index132.default; + } +})); +Object.defineProperty(exports, "isThisMinute", ({ + enumerable: true, + get: function get() { + return _index133.default; + } +})); +Object.defineProperty(exports, "isThisMonth", ({ + enumerable: true, + get: function get() { + return _index134.default; + } +})); +Object.defineProperty(exports, "isThisQuarter", ({ + enumerable: true, + get: function get() { + return _index135.default; + } +})); +Object.defineProperty(exports, "isThisSecond", ({ + enumerable: true, + get: function get() { + return _index136.default; + } +})); +Object.defineProperty(exports, "isThisWeek", ({ + enumerable: true, + get: function get() { + return _index137.default; + } +})); +Object.defineProperty(exports, "isThisYear", ({ + enumerable: true, + get: function get() { + return _index138.default; + } +})); +Object.defineProperty(exports, "isThursday", ({ + enumerable: true, + get: function get() { + return _index139.default; + } +})); +Object.defineProperty(exports, "isToday", ({ + enumerable: true, + get: function get() { + return _index140.default; + } +})); +Object.defineProperty(exports, "isTomorrow", ({ + enumerable: true, + get: function get() { + return _index141.default; + } +})); +Object.defineProperty(exports, "isTuesday", ({ + enumerable: true, + get: function get() { + return _index142.default; + } +})); +Object.defineProperty(exports, "isValid", ({ + enumerable: true, + get: function get() { + return _index143.default; + } +})); +Object.defineProperty(exports, "isWednesday", ({ + enumerable: true, + get: function get() { + return _index144.default; + } +})); +Object.defineProperty(exports, "isWeekend", ({ + enumerable: true, + get: function get() { + return _index145.default; + } +})); +Object.defineProperty(exports, "isWithinInterval", ({ + enumerable: true, + get: function get() { + return _index146.default; + } +})); +Object.defineProperty(exports, "isYesterday", ({ + enumerable: true, + get: function get() { + return _index147.default; + } +})); +Object.defineProperty(exports, "lastDayOfDecade", ({ + enumerable: true, + get: function get() { + return _index148.default; + } +})); +Object.defineProperty(exports, "lastDayOfISOWeek", ({ + enumerable: true, + get: function get() { + return _index149.default; + } +})); +Object.defineProperty(exports, "lastDayOfISOWeekYear", ({ + enumerable: true, + get: function get() { + return _index150.default; + } +})); +Object.defineProperty(exports, "lastDayOfMonth", ({ + enumerable: true, + get: function get() { + return _index151.default; + } +})); +Object.defineProperty(exports, "lastDayOfQuarter", ({ + enumerable: true, + get: function get() { + return _index152.default; + } +})); +Object.defineProperty(exports, "lastDayOfWeek", ({ + enumerable: true, + get: function get() { + return _index153.default; + } +})); +Object.defineProperty(exports, "lastDayOfYear", ({ + enumerable: true, + get: function get() { + return _index154.default; + } +})); +Object.defineProperty(exports, "lightFormat", ({ + enumerable: true, + get: function get() { + return _index155.default; + } +})); +Object.defineProperty(exports, "max", ({ + enumerable: true, + get: function get() { + return _index156.default; + } +})); +Object.defineProperty(exports, "milliseconds", ({ + enumerable: true, + get: function get() { + return _index157.default; + } +})); +Object.defineProperty(exports, "millisecondsToHours", ({ + enumerable: true, + get: function get() { + return _index158.default; + } +})); +Object.defineProperty(exports, "millisecondsToMinutes", ({ + enumerable: true, + get: function get() { + return _index159.default; + } +})); +Object.defineProperty(exports, "millisecondsToSeconds", ({ + enumerable: true, + get: function get() { + return _index160.default; + } +})); +Object.defineProperty(exports, "min", ({ + enumerable: true, + get: function get() { + return _index161.default; + } +})); +Object.defineProperty(exports, "minutesToHours", ({ + enumerable: true, + get: function get() { + return _index162.default; + } +})); +Object.defineProperty(exports, "minutesToMilliseconds", ({ + enumerable: true, + get: function get() { + return _index163.default; + } +})); +Object.defineProperty(exports, "minutesToSeconds", ({ + enumerable: true, + get: function get() { + return _index164.default; + } +})); +Object.defineProperty(exports, "monthsToQuarters", ({ + enumerable: true, + get: function get() { + return _index165.default; + } +})); +Object.defineProperty(exports, "monthsToYears", ({ + enumerable: true, + get: function get() { + return _index166.default; + } +})); +Object.defineProperty(exports, "nextDay", ({ + enumerable: true, + get: function get() { + return _index167.default; + } +})); +Object.defineProperty(exports, "nextFriday", ({ + enumerable: true, + get: function get() { + return _index168.default; + } +})); +Object.defineProperty(exports, "nextMonday", ({ + enumerable: true, + get: function get() { + return _index169.default; + } +})); +Object.defineProperty(exports, "nextSaturday", ({ + enumerable: true, + get: function get() { + return _index170.default; + } +})); +Object.defineProperty(exports, "nextSunday", ({ + enumerable: true, + get: function get() { + return _index171.default; + } +})); +Object.defineProperty(exports, "nextThursday", ({ + enumerable: true, + get: function get() { + return _index172.default; + } +})); +Object.defineProperty(exports, "nextTuesday", ({ + enumerable: true, + get: function get() { + return _index173.default; + } +})); +Object.defineProperty(exports, "nextWednesday", ({ + enumerable: true, + get: function get() { + return _index174.default; + } +})); +Object.defineProperty(exports, "parse", ({ + enumerable: true, + get: function get() { + return _index175.default; + } +})); +Object.defineProperty(exports, "parseISO", ({ + enumerable: true, + get: function get() { + return _index176.default; + } +})); +Object.defineProperty(exports, "parseJSON", ({ + enumerable: true, + get: function get() { + return _index177.default; + } +})); +Object.defineProperty(exports, "previousDay", ({ + enumerable: true, + get: function get() { + return _index178.default; + } +})); +Object.defineProperty(exports, "previousFriday", ({ + enumerable: true, + get: function get() { + return _index179.default; + } +})); +Object.defineProperty(exports, "previousMonday", ({ + enumerable: true, + get: function get() { + return _index180.default; + } +})); +Object.defineProperty(exports, "previousSaturday", ({ + enumerable: true, + get: function get() { + return _index181.default; + } +})); +Object.defineProperty(exports, "previousSunday", ({ + enumerable: true, + get: function get() { + return _index182.default; + } +})); +Object.defineProperty(exports, "previousThursday", ({ + enumerable: true, + get: function get() { + return _index183.default; + } +})); +Object.defineProperty(exports, "previousTuesday", ({ + enumerable: true, + get: function get() { + return _index184.default; + } +})); +Object.defineProperty(exports, "previousWednesday", ({ + enumerable: true, + get: function get() { + return _index185.default; + } +})); +Object.defineProperty(exports, "quartersToMonths", ({ + enumerable: true, + get: function get() { + return _index186.default; + } +})); +Object.defineProperty(exports, "quartersToYears", ({ + enumerable: true, + get: function get() { + return _index187.default; + } +})); +Object.defineProperty(exports, "roundToNearestMinutes", ({ + enumerable: true, + get: function get() { + return _index188.default; + } +})); +Object.defineProperty(exports, "secondsToHours", ({ + enumerable: true, + get: function get() { + return _index189.default; + } +})); +Object.defineProperty(exports, "secondsToMilliseconds", ({ + enumerable: true, + get: function get() { + return _index190.default; + } +})); +Object.defineProperty(exports, "secondsToMinutes", ({ + enumerable: true, + get: function get() { + return _index191.default; + } +})); +Object.defineProperty(exports, "set", ({ + enumerable: true, + get: function get() { + return _index192.default; + } +})); +Object.defineProperty(exports, "setDate", ({ + enumerable: true, + get: function get() { + return _index193.default; + } +})); +Object.defineProperty(exports, "setDay", ({ + enumerable: true, + get: function get() { + return _index194.default; + } +})); +Object.defineProperty(exports, "setDayOfYear", ({ + enumerable: true, + get: function get() { + return _index195.default; + } +})); +Object.defineProperty(exports, "setDefaultOptions", ({ + enumerable: true, + get: function get() { + return _index196.default; + } +})); +Object.defineProperty(exports, "setHours", ({ + enumerable: true, + get: function get() { + return _index197.default; + } +})); +Object.defineProperty(exports, "setISODay", ({ + enumerable: true, + get: function get() { + return _index198.default; + } +})); +Object.defineProperty(exports, "setISOWeek", ({ + enumerable: true, + get: function get() { + return _index199.default; + } +})); +Object.defineProperty(exports, "setISOWeekYear", ({ + enumerable: true, + get: function get() { + return _index200.default; + } +})); +Object.defineProperty(exports, "setMilliseconds", ({ + enumerable: true, + get: function get() { + return _index201.default; + } +})); +Object.defineProperty(exports, "setMinutes", ({ + enumerable: true, + get: function get() { + return _index202.default; + } +})); +Object.defineProperty(exports, "setMonth", ({ + enumerable: true, + get: function get() { + return _index203.default; + } +})); +Object.defineProperty(exports, "setQuarter", ({ + enumerable: true, + get: function get() { + return _index204.default; + } +})); +Object.defineProperty(exports, "setSeconds", ({ + enumerable: true, + get: function get() { + return _index205.default; + } +})); +Object.defineProperty(exports, "setWeek", ({ + enumerable: true, + get: function get() { + return _index206.default; + } +})); +Object.defineProperty(exports, "setWeekYear", ({ + enumerable: true, + get: function get() { + return _index207.default; + } +})); +Object.defineProperty(exports, "setYear", ({ + enumerable: true, + get: function get() { + return _index208.default; + } +})); +Object.defineProperty(exports, "startOfDay", ({ + enumerable: true, + get: function get() { + return _index209.default; + } +})); +Object.defineProperty(exports, "startOfDecade", ({ + enumerable: true, + get: function get() { + return _index210.default; + } +})); +Object.defineProperty(exports, "startOfHour", ({ + enumerable: true, + get: function get() { + return _index211.default; + } +})); +Object.defineProperty(exports, "startOfISOWeek", ({ + enumerable: true, + get: function get() { + return _index212.default; + } +})); +Object.defineProperty(exports, "startOfISOWeekYear", ({ + enumerable: true, + get: function get() { + return _index213.default; + } +})); +Object.defineProperty(exports, "startOfMinute", ({ + enumerable: true, + get: function get() { + return _index214.default; + } +})); +Object.defineProperty(exports, "startOfMonth", ({ + enumerable: true, + get: function get() { + return _index215.default; + } +})); +Object.defineProperty(exports, "startOfQuarter", ({ + enumerable: true, + get: function get() { + return _index216.default; + } +})); +Object.defineProperty(exports, "startOfSecond", ({ + enumerable: true, + get: function get() { + return _index217.default; + } +})); +Object.defineProperty(exports, "startOfToday", ({ + enumerable: true, + get: function get() { + return _index218.default; + } +})); +Object.defineProperty(exports, "startOfTomorrow", ({ + enumerable: true, + get: function get() { + return _index219.default; + } +})); +Object.defineProperty(exports, "startOfWeek", ({ + enumerable: true, + get: function get() { + return _index220.default; + } +})); +Object.defineProperty(exports, "startOfWeekYear", ({ + enumerable: true, + get: function get() { + return _index221.default; + } +})); +Object.defineProperty(exports, "startOfYear", ({ + enumerable: true, + get: function get() { + return _index222.default; + } +})); +Object.defineProperty(exports, "startOfYesterday", ({ + enumerable: true, + get: function get() { + return _index223.default; + } +})); +Object.defineProperty(exports, "sub", ({ + enumerable: true, + get: function get() { + return _index224.default; + } +})); +Object.defineProperty(exports, "subBusinessDays", ({ + enumerable: true, + get: function get() { + return _index225.default; + } +})); +Object.defineProperty(exports, "subDays", ({ + enumerable: true, + get: function get() { + return _index226.default; + } +})); +Object.defineProperty(exports, "subHours", ({ + enumerable: true, + get: function get() { + return _index227.default; + } +})); +Object.defineProperty(exports, "subISOWeekYears", ({ + enumerable: true, + get: function get() { + return _index228.default; + } +})); +Object.defineProperty(exports, "subMilliseconds", ({ + enumerable: true, + get: function get() { + return _index229.default; + } +})); +Object.defineProperty(exports, "subMinutes", ({ + enumerable: true, + get: function get() { + return _index230.default; + } +})); +Object.defineProperty(exports, "subMonths", ({ + enumerable: true, + get: function get() { + return _index231.default; + } +})); +Object.defineProperty(exports, "subQuarters", ({ + enumerable: true, + get: function get() { + return _index232.default; + } +})); +Object.defineProperty(exports, "subSeconds", ({ + enumerable: true, + get: function get() { + return _index233.default; + } +})); +Object.defineProperty(exports, "subWeeks", ({ + enumerable: true, + get: function get() { + return _index234.default; + } +})); +Object.defineProperty(exports, "subYears", ({ + enumerable: true, + get: function get() { + return _index235.default; + } +})); +Object.defineProperty(exports, "toDate", ({ + enumerable: true, + get: function get() { + return _index236.default; + } +})); +Object.defineProperty(exports, "weeksToDays", ({ + enumerable: true, + get: function get() { + return _index237.default; + } +})); +Object.defineProperty(exports, "yearsToMonths", ({ + enumerable: true, + get: function get() { + return _index238.default; + } +})); +Object.defineProperty(exports, "yearsToQuarters", ({ + enumerable: true, + get: function get() { + return _index239.default; + } +})); +var _index = _interopRequireDefault(__nccwpck_require__(6211)); +var _index2 = _interopRequireDefault(__nccwpck_require__(1727)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6227)); +var _index4 = _interopRequireDefault(__nccwpck_require__(9956)); +var _index5 = _interopRequireDefault(__nccwpck_require__(5318)); +var _index6 = _interopRequireDefault(__nccwpck_require__(524)); +var _index7 = _interopRequireDefault(__nccwpck_require__(5268)); +var _index8 = _interopRequireDefault(__nccwpck_require__(2995)); +var _index9 = _interopRequireDefault(__nccwpck_require__(5149)); +var _index10 = _interopRequireDefault(__nccwpck_require__(4112)); +var _index11 = _interopRequireDefault(__nccwpck_require__(7195)); +var _index12 = _interopRequireDefault(__nccwpck_require__(3367)); +var _index13 = _interopRequireDefault(__nccwpck_require__(2282)); +var _index14 = _interopRequireDefault(__nccwpck_require__(9660)); +var _index15 = _interopRequireDefault(__nccwpck_require__(2264)); +var _index16 = _interopRequireDefault(__nccwpck_require__(2013)); +var _index17 = _interopRequireDefault(__nccwpck_require__(9818)); +var _index18 = _interopRequireDefault(__nccwpck_require__(7783)); +var _index19 = _interopRequireDefault(__nccwpck_require__(6237)); +var _index20 = _interopRequireDefault(__nccwpck_require__(4734)); +var _index21 = _interopRequireDefault(__nccwpck_require__(3086)); +var _index22 = _interopRequireDefault(__nccwpck_require__(6778)); +var _index23 = _interopRequireDefault(__nccwpck_require__(1656)); +var _index24 = _interopRequireDefault(__nccwpck_require__(5536)); +var _index25 = _interopRequireDefault(__nccwpck_require__(2342)); +var _index26 = _interopRequireDefault(__nccwpck_require__(8620)); +var _index27 = _interopRequireDefault(__nccwpck_require__(8164)); +var _index28 = _interopRequireDefault(__nccwpck_require__(6311)); +var _index29 = _interopRequireDefault(__nccwpck_require__(8740)); +var _index30 = _interopRequireDefault(__nccwpck_require__(8815)); +var _index31 = _interopRequireDefault(__nccwpck_require__(2288)); +var _index32 = _interopRequireDefault(__nccwpck_require__(3842)); +var _index33 = _interopRequireDefault(__nccwpck_require__(2713)); +var _index34 = _interopRequireDefault(__nccwpck_require__(7074)); +var _index35 = _interopRequireDefault(__nccwpck_require__(9448)); +var _index36 = _interopRequireDefault(__nccwpck_require__(2701)); +var _index37 = _interopRequireDefault(__nccwpck_require__(3959)); +var _index38 = _interopRequireDefault(__nccwpck_require__(6545)); +var _index39 = _interopRequireDefault(__nccwpck_require__(6802)); +var _index40 = _interopRequireDefault(__nccwpck_require__(2029)); +var _index41 = _interopRequireDefault(__nccwpck_require__(5879)); +var _index42 = _interopRequireDefault(__nccwpck_require__(6516)); +var _index43 = _interopRequireDefault(__nccwpck_require__(5994)); +var _index44 = _interopRequireDefault(__nccwpck_require__(1944)); +var _index45 = _interopRequireDefault(__nccwpck_require__(3973)); +var _index46 = _interopRequireDefault(__nccwpck_require__(7961)); +var _index47 = _interopRequireDefault(__nccwpck_require__(6525)); +var _index48 = _interopRequireDefault(__nccwpck_require__(8569)); +var _index49 = _interopRequireDefault(__nccwpck_require__(1517)); +var _index50 = _interopRequireDefault(__nccwpck_require__(1894)); +var _index51 = _interopRequireDefault(__nccwpck_require__(1920)); +var _index52 = _interopRequireDefault(__nccwpck_require__(9731)); +var _index53 = _interopRequireDefault(__nccwpck_require__(1389)); +var _index54 = _interopRequireDefault(__nccwpck_require__(2621)); +var _index55 = _interopRequireDefault(__nccwpck_require__(5596)); +var _index56 = _interopRequireDefault(__nccwpck_require__(6121)); +var _index57 = _interopRequireDefault(__nccwpck_require__(5700)); +var _index58 = _interopRequireDefault(__nccwpck_require__(6935)); +var _index59 = _interopRequireDefault(__nccwpck_require__(5218)); +var _index60 = _interopRequireDefault(__nccwpck_require__(7079)); +var _index61 = _interopRequireDefault(__nccwpck_require__(66)); +var _index62 = _interopRequireDefault(__nccwpck_require__(2168)); +var _index63 = _interopRequireDefault(__nccwpck_require__(8149)); +var _index64 = _interopRequireDefault(__nccwpck_require__(7128)); +var _index65 = _interopRequireDefault(__nccwpck_require__(1163)); +var _index66 = _interopRequireDefault(__nccwpck_require__(4741)); +var _index67 = _interopRequireDefault(__nccwpck_require__(8917)); +var _index68 = _interopRequireDefault(__nccwpck_require__(3385)); +var _index69 = _interopRequireDefault(__nccwpck_require__(5296)); +var _index70 = _interopRequireDefault(__nccwpck_require__(2448)); +var _index71 = _interopRequireDefault(__nccwpck_require__(4182)); +var _index72 = _interopRequireDefault(__nccwpck_require__(1832)); +var _index73 = _interopRequireDefault(__nccwpck_require__(675)); +var _index74 = _interopRequireDefault(__nccwpck_require__(4897)); +var _index75 = _interopRequireDefault(__nccwpck_require__(7626)); +var _index76 = _interopRequireDefault(__nccwpck_require__(9361)); +var _index77 = _interopRequireDefault(__nccwpck_require__(7468)); +var _index78 = _interopRequireDefault(__nccwpck_require__(7573)); +var _index79 = _interopRequireDefault(__nccwpck_require__(2784)); +var _index80 = _interopRequireDefault(__nccwpck_require__(9322)); +var _index81 = _interopRequireDefault(__nccwpck_require__(5795)); +var _index82 = _interopRequireDefault(__nccwpck_require__(7941)); +var _index83 = _interopRequireDefault(__nccwpck_require__(8313)); +var _index84 = _interopRequireDefault(__nccwpck_require__(9894)); +var _index85 = _interopRequireDefault(__nccwpck_require__(6991)); +var _index86 = _interopRequireDefault(__nccwpck_require__(5438)); +var _index87 = _interopRequireDefault(__nccwpck_require__(7560)); +var _index88 = _interopRequireDefault(__nccwpck_require__(7030)); +var _index89 = _interopRequireDefault(__nccwpck_require__(2194)); +var _index90 = _interopRequireDefault(__nccwpck_require__(7647)); +var _index91 = _interopRequireDefault(__nccwpck_require__(4523)); +var _index92 = _interopRequireDefault(__nccwpck_require__(8755)); +var _index93 = _interopRequireDefault(__nccwpck_require__(5052)); +var _index94 = _interopRequireDefault(__nccwpck_require__(6476)); +var _index95 = _interopRequireDefault(__nccwpck_require__(81)); +var _index96 = _interopRequireDefault(__nccwpck_require__(9229)); +var _index97 = _interopRequireDefault(__nccwpck_require__(3494)); +var _index98 = _interopRequireDefault(__nccwpck_require__(9482)); +var _index99 = _interopRequireDefault(__nccwpck_require__(5714)); +var _index100 = _interopRequireDefault(__nccwpck_require__(3895)); +var _index101 = _interopRequireDefault(__nccwpck_require__(2449)); +var _index102 = _interopRequireDefault(__nccwpck_require__(775)); +var _index103 = _interopRequireDefault(__nccwpck_require__(2079)); +var _index104 = _interopRequireDefault(__nccwpck_require__(1982)); +var _index105 = _interopRequireDefault(__nccwpck_require__(3858)); +var _index106 = _interopRequireDefault(__nccwpck_require__(2755)); +var _index107 = _interopRequireDefault(__nccwpck_require__(9369)); +var _index108 = _interopRequireDefault(__nccwpck_require__(6801)); +var _index109 = _interopRequireDefault(__nccwpck_require__(4669)); +var _index110 = _interopRequireDefault(__nccwpck_require__(7352)); +var _index111 = _interopRequireDefault(__nccwpck_require__(5387)); +var _index112 = _interopRequireDefault(__nccwpck_require__(1758)); +var _index113 = _interopRequireDefault(__nccwpck_require__(6803)); +var _index114 = _interopRequireDefault(__nccwpck_require__(8506)); +var _index115 = _interopRequireDefault(__nccwpck_require__(74)); +var _index116 = _interopRequireDefault(__nccwpck_require__(525)); +var _index117 = _interopRequireDefault(__nccwpck_require__(6030)); +var _index118 = _interopRequireDefault(__nccwpck_require__(9543)); +var _index119 = _interopRequireDefault(__nccwpck_require__(2154)); +var _index120 = _interopRequireDefault(__nccwpck_require__(2489)); +var _index121 = _interopRequireDefault(__nccwpck_require__(9852)); +var _index122 = _interopRequireDefault(__nccwpck_require__(3944)); +var _index123 = _interopRequireDefault(__nccwpck_require__(3197)); +var _index124 = _interopRequireDefault(__nccwpck_require__(5421)); +var _index125 = _interopRequireDefault(__nccwpck_require__(938)); +var _index126 = _interopRequireDefault(__nccwpck_require__(1988)); +var _index127 = _interopRequireDefault(__nccwpck_require__(7013)); +var _index128 = _interopRequireDefault(__nccwpck_require__(9821)); +var _index129 = _interopRequireDefault(__nccwpck_require__(6308)); +var _index130 = _interopRequireDefault(__nccwpck_require__(5852)); +var _index131 = _interopRequireDefault(__nccwpck_require__(4078)); +var _index132 = _interopRequireDefault(__nccwpck_require__(6065)); +var _index133 = _interopRequireDefault(__nccwpck_require__(3413)); +var _index134 = _interopRequireDefault(__nccwpck_require__(1157)); +var _index135 = _interopRequireDefault(__nccwpck_require__(5122)); +var _index136 = _interopRequireDefault(__nccwpck_require__(4641)); +var _index137 = _interopRequireDefault(__nccwpck_require__(2373)); +var _index138 = _interopRequireDefault(__nccwpck_require__(856)); +var _index139 = _interopRequireDefault(__nccwpck_require__(4350)); +var _index140 = _interopRequireDefault(__nccwpck_require__(7185)); +var _index141 = _interopRequireDefault(__nccwpck_require__(3014)); +var _index142 = _interopRequireDefault(__nccwpck_require__(8235)); +var _index143 = _interopRequireDefault(__nccwpck_require__(9920)); +var _index144 = _interopRequireDefault(__nccwpck_require__(9218)); +var _index145 = _interopRequireDefault(__nccwpck_require__(403)); +var _index146 = _interopRequireDefault(__nccwpck_require__(4419)); +var _index147 = _interopRequireDefault(__nccwpck_require__(9583)); +var _index148 = _interopRequireDefault(__nccwpck_require__(4864)); +var _index149 = _interopRequireDefault(__nccwpck_require__(7692)); +var _index150 = _interopRequireDefault(__nccwpck_require__(217)); +var _index151 = _interopRequireDefault(__nccwpck_require__(3346)); +var _index152 = _interopRequireDefault(__nccwpck_require__(8635)); +var _index153 = _interopRequireDefault(__nccwpck_require__(666)); +var _index154 = _interopRequireDefault(__nccwpck_require__(9771)); +var _index155 = _interopRequireDefault(__nccwpck_require__(4018)); +var _index156 = _interopRequireDefault(__nccwpck_require__(5815)); +var _index157 = _interopRequireDefault(__nccwpck_require__(6133)); +var _index158 = _interopRequireDefault(__nccwpck_require__(9571)); +var _index159 = _interopRequireDefault(__nccwpck_require__(5419)); +var _index160 = _interopRequireDefault(__nccwpck_require__(2294)); +var _index161 = _interopRequireDefault(__nccwpck_require__(5310)); +var _index162 = _interopRequireDefault(__nccwpck_require__(2516)); +var _index163 = _interopRequireDefault(__nccwpck_require__(1886)); +var _index164 = _interopRequireDefault(__nccwpck_require__(8192)); +var _index165 = _interopRequireDefault(__nccwpck_require__(1142)); +var _index166 = _interopRequireDefault(__nccwpck_require__(3757)); +var _index167 = _interopRequireDefault(__nccwpck_require__(6771)); +var _index168 = _interopRequireDefault(__nccwpck_require__(1491)); +var _index169 = _interopRequireDefault(__nccwpck_require__(5947)); +var _index170 = _interopRequireDefault(__nccwpck_require__(363)); +var _index171 = _interopRequireDefault(__nccwpck_require__(7266)); +var _index172 = _interopRequireDefault(__nccwpck_require__(9457)); +var _index173 = _interopRequireDefault(__nccwpck_require__(7894)); +var _index174 = _interopRequireDefault(__nccwpck_require__(29)); +var _index175 = _interopRequireDefault(__nccwpck_require__(1287)); +var _index176 = _interopRequireDefault(__nccwpck_require__(3390)); +var _index177 = _interopRequireDefault(__nccwpck_require__(8159)); +var _index178 = _interopRequireDefault(__nccwpck_require__(8756)); +var _index179 = _interopRequireDefault(__nccwpck_require__(9558)); +var _index180 = _interopRequireDefault(__nccwpck_require__(8386)); +var _index181 = _interopRequireDefault(__nccwpck_require__(4834)); +var _index182 = _interopRequireDefault(__nccwpck_require__(264)); +var _index183 = _interopRequireDefault(__nccwpck_require__(19)); +var _index184 = _interopRequireDefault(__nccwpck_require__(3294)); +var _index185 = _interopRequireDefault(__nccwpck_require__(8630)); +var _index186 = _interopRequireDefault(__nccwpck_require__(8995)); +var _index187 = _interopRequireDefault(__nccwpck_require__(883)); +var _index188 = _interopRequireDefault(__nccwpck_require__(5515)); +var _index189 = _interopRequireDefault(__nccwpck_require__(594)); +var _index190 = _interopRequireDefault(__nccwpck_require__(6779)); +var _index191 = _interopRequireDefault(__nccwpck_require__(8438)); +var _index192 = _interopRequireDefault(__nccwpck_require__(2031)); +var _index193 = _interopRequireDefault(__nccwpck_require__(8760)); +var _index194 = _interopRequireDefault(__nccwpck_require__(9540)); +var _index195 = _interopRequireDefault(__nccwpck_require__(4002)); +var _index196 = _interopRequireDefault(__nccwpck_require__(54)); +var _index197 = _interopRequireDefault(__nccwpck_require__(6355)); +var _index198 = _interopRequireDefault(__nccwpck_require__(3705)); +var _index199 = _interopRequireDefault(__nccwpck_require__(3035)); +var _index200 = _interopRequireDefault(__nccwpck_require__(822)); +var _index201 = _interopRequireDefault(__nccwpck_require__(9105)); +var _index202 = _interopRequireDefault(__nccwpck_require__(9207)); +var _index203 = _interopRequireDefault(__nccwpck_require__(847)); +var _index204 = _interopRequireDefault(__nccwpck_require__(621)); +var _index205 = _interopRequireDefault(__nccwpck_require__(1346)); +var _index206 = _interopRequireDefault(__nccwpck_require__(2664)); +var _index207 = _interopRequireDefault(__nccwpck_require__(3438)); +var _index208 = _interopRequireDefault(__nccwpck_require__(6212)); +var _index209 = _interopRequireDefault(__nccwpck_require__(1868)); +var _index210 = _interopRequireDefault(__nccwpck_require__(2025)); +var _index211 = _interopRequireDefault(__nccwpck_require__(6277)); +var _index212 = _interopRequireDefault(__nccwpck_require__(6307)); +var _index213 = _interopRequireDefault(__nccwpck_require__(776)); +var _index214 = _interopRequireDefault(__nccwpck_require__(8567)); +var _index215 = _interopRequireDefault(__nccwpck_require__(7182)); +var _index216 = _interopRequireDefault(__nccwpck_require__(2932)); +var _index217 = _interopRequireDefault(__nccwpck_require__(6738)); +var _index218 = _interopRequireDefault(__nccwpck_require__(5516)); +var _index219 = _interopRequireDefault(__nccwpck_require__(2442)); +var _index220 = _interopRequireDefault(__nccwpck_require__(9813)); +var _index221 = _interopRequireDefault(__nccwpck_require__(8014)); +var _index222 = _interopRequireDefault(__nccwpck_require__(8225)); +var _index223 = _interopRequireDefault(__nccwpck_require__(1672)); +var _index224 = _interopRequireDefault(__nccwpck_require__(3875)); +var _index225 = _interopRequireDefault(__nccwpck_require__(1952)); +var _index226 = _interopRequireDefault(__nccwpck_require__(970)); +var _index227 = _interopRequireDefault(__nccwpck_require__(2481)); +var _index228 = _interopRequireDefault(__nccwpck_require__(3925)); +var _index229 = _interopRequireDefault(__nccwpck_require__(7923)); +var _index230 = _interopRequireDefault(__nccwpck_require__(7535)); +var _index231 = _interopRequireDefault(__nccwpck_require__(6752)); +var _index232 = _interopRequireDefault(__nccwpck_require__(3139)); +var _index233 = _interopRequireDefault(__nccwpck_require__(138)); +var _index234 = _interopRequireDefault(__nccwpck_require__(5504)); +var _index235 = _interopRequireDefault(__nccwpck_require__(843)); +var _index236 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index237 = _interopRequireDefault(__nccwpck_require__(6812)); +var _index238 = _interopRequireDefault(__nccwpck_require__(4616)); +var _index239 = _interopRequireDefault(__nccwpck_require__(7440)); +var _index240 = __nccwpck_require__(5756); +Object.keys(_index240).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _index240[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _index240[key]; + } + }); +}); - throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'"); -} - -module.exports = exports.default; - -/***/ }), -/* 380 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = differenceInYears; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(996)); - -var _index3 = _interopRequireDefault(__webpack_require__(432)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name differenceInYears - * @category Year Helpers - * @summary Get the number of full years between the given dates. - * - * @description - * Get the number of full years between the given dates. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of full years - * @throws {TypeError} 2 arguments required - * - * @example - * // How many full years are between 31 December 2013 and 11 February 2015? - * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) - * //=> 1 - */ -function differenceInYears(dirtyDateLeft, dirtyDateRight) { - (0, _index4.default)(2, arguments); - var dateLeft = (0, _index.default)(dirtyDateLeft); - var dateRight = (0, _index.default)(dirtyDateRight); - var sign = (0, _index3.default)(dateLeft, dateRight); - var difference = Math.abs((0, _index2.default)(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 +/***/ }), - var isLastYearNotFull = (0, _index3.default)(dateLeft, dateRight) === -sign; - var result = sign * (difference - Number(isLastYearNotFull)); // Prevent negative zero +/***/ 2079: +/***/ ((module, exports, __nccwpck_require__) => { - return result === 0 ? 0 : result; -} +"use strict"; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = intervalToDuration; +var _index = _interopRequireDefault(__nccwpck_require__(9818)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6211)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6311)); +var _index4 = _interopRequireDefault(__nccwpck_require__(8740)); +var _index5 = _interopRequireDefault(__nccwpck_require__(3842)); +var _index6 = _interopRequireDefault(__nccwpck_require__(2713)); +var _index7 = _interopRequireDefault(__nccwpck_require__(9448)); +var _index8 = _interopRequireDefault(__nccwpck_require__(3959)); +var _index9 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index10 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name intervalToDuration + * @category Common Helpers + * @summary Convert interval to duration + * + * @description + * Convert a interval object to a duration object. + * + * @param {Interval} interval - the interval to convert to duration + * + * @returns {Duration} The duration Object + * @throws {TypeError} Requires 2 arguments + * @throws {RangeError} `start` must not be Invalid Date + * @throws {RangeError} `end` must not be Invalid Date + * + * @example + * // Get the duration between January 15, 1929 and April 4, 1968. + * intervalToDuration({ + * start: new Date(1929, 0, 15, 12, 0, 0), + * end: new Date(1968, 3, 4, 19, 5, 0) + * }) + * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 } + */ +function intervalToDuration(interval) { + (0, _index10.default)(1, arguments); + var start = (0, _index9.default)(interval.start); + var end = (0, _index9.default)(interval.end); + if (isNaN(start.getTime())) throw new RangeError('Start Date is invalid'); + if (isNaN(end.getTime())) throw new RangeError('End Date is invalid'); + var duration = {}; + duration.years = Math.abs((0, _index8.default)(end, start)); + var sign = (0, _index.default)(end, start); + var remainingMonths = (0, _index2.default)(start, { + years: sign * duration.years + }); + duration.months = Math.abs((0, _index6.default)(end, remainingMonths)); + var remainingDays = (0, _index2.default)(remainingMonths, { + months: sign * duration.months + }); + duration.days = Math.abs((0, _index3.default)(end, remainingDays)); + var remainingHours = (0, _index2.default)(remainingDays, { + days: sign * duration.days + }); + duration.hours = Math.abs((0, _index4.default)(end, remainingHours)); + var remainingMinutes = (0, _index2.default)(remainingHours, { + hours: sign * duration.hours + }); + duration.minutes = Math.abs((0, _index5.default)(end, remainingMinutes)); + var remainingSeconds = (0, _index2.default)(remainingMinutes, { + minutes: sign * duration.minutes + }); + duration.seconds = Math.abs((0, _index7.default)(end, remainingSeconds)); + return duration; +} module.exports = exports.default; /***/ }), -/* 381 */, -/* 382 */, -/* 383 */, -/* 384 */, -/* 385 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1982: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isPast; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = intlFormat; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isPast + * @name intlFormat * @category Common Helpers - * @summary Is the given date in the past? - * @pure false + * @summary Format the date with Intl.DateTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat). * * @description - * Is the given date in the past? + * Return the formatted date string in the given format. + * The method uses [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) inside. + * formatOptions are the same as [`Intl.DateTimeFormat` options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options) * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `Date.now()` internally hence impure and can't be safely curried. + * > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default. + * + * @param {Date|Number} argument - the original date. + * @param {Object} [formatOptions] - an object with options. + * @param {'lookup'|'best fit'} [formatOptions.localeMatcher='best fit'] - locale selection algorithm. + * @param {'narrow'|'short'|'long'} [formatOptions.weekday] - representation the days of the week. + * @param {'narrow'|'short'|'long'} [formatOptions.era] - representation of eras. + * @param {'numeric'|'2-digit'} [formatOptions.year] - representation of years. + * @param {'numeric'|'2-digit'|'narrow'|'short'|'long'} [formatOptions.month='numeric'] - representation of month. + * @param {'numeric'|'2-digit'} [formatOptions.day='numeric'] - representation of day. + * @param {'numeric'|'2-digit'} [formatOptions.hour='numeric'] - representation of hours. + * @param {'numeric'|'2-digit'} [formatOptions.minute] - representation of minutes. + * @param {'numeric'|'2-digit'} [formatOptions.second] - representation of seconds. + * @param {'short'|'long'} [formatOptions.timeZoneName] - representation of names of time zones. + * @param {'basic'|'best fit'} [formatOptions.formatMatcher='best fit'] - format selection algorithm. + * @param {Boolean} [formatOptions.hour12] - determines whether to use 12-hour time format. + * @param {String} [formatOptions.timeZone] - the time zone to use. + * @param {Object} [localeOptions] - an object with locale. + * @param {String|String[]} [localeOptions.locale] - the locale code + * @returns {String} the formatted date string. + * @throws {TypeError} 1 argument required. + * @throws {RangeError} `date` must not be Invalid Date * - * ### v2.0.0 breaking changes: + * @example + * // Represent 10 October 2019 in German. + * // Convert the date with format's options and locale's options. + * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), { + * weekday: 'long', + * year: 'numeric', + * month: 'long', + * day: 'numeric', + * }, { + * locale: 'de-DE', + * }) + * //=> Freitag, 4. Oktober 2019 * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @example + * // Represent 10 October 2019. + * // Convert the date with format's options. + * const result = intlFormat.default(new Date(2019, 9, 4, 12, 30, 13, 456), { + * year: 'numeric', + * month: 'numeric', + * day: 'numeric', + * hour: 'numeric', + * }) + * //=> 10/4/2019, 12 PM * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is in the past - * @throws {TypeError} 1 argument required + * @example + * // Represent 10 October 2019 in Korean. + * // Convert the date with locale's options. + * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), { + * locale: 'ko-KR', + * }) + * //=> 2019. 10. 4. * * @example - * // If today is 6 October 2014, is 2 July 2014 in the past? - * var result = isPast(new Date(2014, 6, 2)) - * //=> true + * // Represent 10 October 2019 in middle-endian format: + * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456)) + * //=> 10/4/2019 */ -function isPast(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate).getTime() < Date.now(); +function intlFormat(date, formatOrLocale, localeOptions) { + var _localeOptions; + (0, _index.default)(1, arguments); + var formatOptions; + if (isFormatOptions(formatOrLocale)) { + formatOptions = formatOrLocale; + } else { + localeOptions = formatOrLocale; + } + return new Intl.DateTimeFormat((_localeOptions = localeOptions) === null || _localeOptions === void 0 ? void 0 : _localeOptions.locale, formatOptions).format(date); +} +function isFormatOptions(opts) { + return opts !== undefined && !('locale' in opts); } - module.exports = exports.default; /***/ }), -/* 386 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3858: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInCalendarISOWeeks; - -var _index = _interopRequireDefault(__webpack_require__(151)); - -var _index2 = _interopRequireDefault(__webpack_require__(408)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var MILLISECONDS_IN_WEEK = 604800000; +})); +exports["default"] = intlFormatDistance; +var _index = __nccwpck_require__(5756); +var _index2 = _interopRequireDefault(__nccwpck_require__(3086)); +var _index3 = _interopRequireDefault(__nccwpck_require__(5536)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2342)); +var _index5 = _interopRequireDefault(__nccwpck_require__(8620)); +var _index6 = _interopRequireDefault(__nccwpck_require__(8164)); +var _index7 = _interopRequireDefault(__nccwpck_require__(8740)); +var _index8 = _interopRequireDefault(__nccwpck_require__(3842)); +var _index9 = _interopRequireDefault(__nccwpck_require__(9448)); +var _index10 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index11 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name differenceInCalendarISOWeeks - * @category ISO Week Helpers - * @summary Get the number of calendar ISO weeks between the given dates. - * + * @name intlFormatDistance + * @category Common Helpers + * @summary Formats distance between two dates in a human-readable format * @description - * Get the number of calendar ISO weeks between the given dates. + * The function calculates the difference between two dates and formats it as a human-readable string. + * + * The function will pick the most appropriate unit depending on the distance between dates. For example, if the distance is a few hours, it might return `x hours`. If the distance is a few months, it might return `x months`. + * + * You can also specify a unit to force using it regardless of the distance to get a result like `123456 hours`. + * + * See the table below for the unit picking logic: + * + * | Distance between dates | Result (past) | Result (future) | + * | ---------------------- | -------------- | --------------- | + * | 0 seconds | now | now | + * | 1-59 seconds | X seconds ago | in X seconds | + * | 1-59 minutes | X minutes ago | in X minutes | + * | 1-23 hours | X hours ago | in X hours | + * | 1 day | yesterday | tomorrow | + * | 2-6 days | X days ago | in X days | + * | 7 days | last week | next week | + * | 8 days-1 month | X weeks ago | in X weeks | + * | 1 month | last month | next month | + * | 2-3 months | X months ago | in X months | + * | 1 quarter | last quarter | next quarter | + * | 2-3 quarters | X quarters ago | in X quarters | + * | 1 year | last year | next year | + * | 2+ years | X years ago | in X years | * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * @param {Date|Number} date - the date + * @param {Date|Number} baseDate - the date to compare with. + * @param {Object} [options] - an object with options. + * @param {String} [options.unit] - formats the distance with the given unit ('year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second'). + * @param {String|String[]} [options.locale] - the locale to use. + * @param {String} [options.localeMatcher='best fit'] - the locale matching algorithm to use. Other value: 'lookup'. + * See MDN for details [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) + * @param {String} [options.numeric='auto'] - the output message format. The values are 'auto' (e.g. `yesterday`), 'always'(e.g. `1 day ago`). + * @param {String} [options.style='long'] - the length of the result. The values are: 'long' (e.g. `1 month`), 'short' (e.g. 'in 1 mo.'), 'narrow' (e.g. 'in 1 mo.'). + * The narrow one could be similar to the short one for some locales. + * @returns {String} the distance in words according to language-sensitive relative time formatting. + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `date` must not be Invalid Date + * @throws {RangeError} `baseDate` must not be Invalid Date + * @throws {RangeError} `options.unit` must not be invalid Unit + * @throws {RangeError} `options.locale` must not be invalid locale + * @throws {RangeError} `options.localeMatcher` must not be invalid localeMatcher + * @throws {RangeError} `options.numeric` must not be invalid numeric + * @throws {RangeError} `options.style` must not be invalid style * - * ### v2.0.0 breaking changes: + * @example + * // What is the distance between the dates when the fist date is after the second? + * intlFormatDistance( + * new Date(1986, 3, 4, 11, 30, 0), + * new Date(1986, 3, 4, 10, 30, 0) + * ) + * //=> 'in 1 hour' * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * // What is the distance between the dates when the fist date is before the second? + * intlFormatDistance( + * new Date(1986, 3, 4, 10, 30, 0), + * new Date(1986, 3, 4, 11, 30, 0) + * ) + * //=> '1 hour ago' * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of calendar ISO weeks - * @throws {TypeError} 2 arguments required + * @example + * // Use the unit option to force the function to output the result in quarters. Without setting it, the example would return "next year" + * intlFormatDistance( + * new Date(1987, 6, 4, 10, 30, 0), + * new Date(1986, 3, 4, 10, 30, 0), + * { unit: 'quarter' } + * ) + * //=> 'in 5 quarters' * * @example - * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014? - * const result = differenceInCalendarISOWeeks( - * new Date(2014, 6, 21), - * new Date(2014, 6, 6) + * // Use the locale option to get the result in Spanish. Without setting it, the example would return "in 1 hour". + * intlFormatDistance( + * new Date(1986, 3, 4, 11, 30, 0), + * new Date(1986, 3, 4, 10, 30, 0), + * { locale: 'es' } * ) - * //=> 3 + * //=> 'dentro de 1 hora' + * + * @example + * // Use the numeric option to force the function to use numeric values. Without setting it, the example would return "tomorrow". + * intlFormatDistance( + * new Date(1986, 3, 5, 11, 30, 0), + * new Date(1986, 3, 4, 11, 30, 0), + * { numeric: 'always' } + * ) + * //=> 'in 1 day' + * + * @example + * // Use the style option to force the function to use short values. Without setting it, the example would return "in 2 years". + * intlFormatDistance( + * new Date(1988, 3, 4, 11, 30, 0), + * new Date(1986, 3, 4, 11, 30, 0), + * { style: 'short' } + * ) + * //=> 'in 2 yr' */ - -function differenceInCalendarISOWeeks(dirtyDateLeft, dirtyDateRight) { - (0, _index3.default)(2, arguments); - var startOfISOWeekLeft = (0, _index2.default)(dirtyDateLeft); - var startOfISOWeekRight = (0, _index2.default)(dirtyDateRight); - var timestampLeft = startOfISOWeekLeft.getTime() - (0, _index.default)(startOfISOWeekLeft); - var timestampRight = startOfISOWeekRight.getTime() - (0, _index.default)(startOfISOWeekRight); // 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((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK); +function intlFormatDistance(date, baseDate, options) { + (0, _index11.default)(2, arguments); + var value = 0; + var unit; + var dateLeft = (0, _index10.default)(date); + var dateRight = (0, _index10.default)(baseDate); + if (!(options !== null && options !== void 0 && options.unit)) { + // Get the unit based on diffInSeconds calculations if no unit is specified + var diffInSeconds = (0, _index9.default)(dateLeft, dateRight); // The smallest unit + + if (Math.abs(diffInSeconds) < _index.secondsInMinute) { + value = (0, _index9.default)(dateLeft, dateRight); + unit = 'second'; + } else if (Math.abs(diffInSeconds) < _index.secondsInHour) { + value = (0, _index8.default)(dateLeft, dateRight); + unit = 'minute'; + } else if (Math.abs(diffInSeconds) < _index.secondsInDay && Math.abs((0, _index2.default)(dateLeft, dateRight)) < 1) { + value = (0, _index7.default)(dateLeft, dateRight); + unit = 'hour'; + } else if (Math.abs(diffInSeconds) < _index.secondsInWeek && (value = (0, _index2.default)(dateLeft, dateRight)) && Math.abs(value) < 7) { + unit = 'day'; + } else if (Math.abs(diffInSeconds) < _index.secondsInMonth) { + value = (0, _index5.default)(dateLeft, dateRight); + unit = 'week'; + } else if (Math.abs(diffInSeconds) < _index.secondsInQuarter) { + value = (0, _index3.default)(dateLeft, dateRight); + unit = 'month'; + } else if (Math.abs(diffInSeconds) < _index.secondsInYear) { + if ((0, _index4.default)(dateLeft, dateRight) < 4) { + // To filter out cases that are less than a year but match 4 quarters + value = (0, _index4.default)(dateLeft, dateRight); + unit = 'quarter'; + } else { + value = (0, _index6.default)(dateLeft, dateRight); + unit = 'year'; + } + } else { + value = (0, _index6.default)(dateLeft, dateRight); + unit = 'year'; + } + } else { + // Get the value if unit is specified + unit = options === null || options === void 0 ? void 0 : options.unit; + if (unit === 'second') { + value = (0, _index9.default)(dateLeft, dateRight); + } else if (unit === 'minute') { + value = (0, _index8.default)(dateLeft, dateRight); + } else if (unit === 'hour') { + value = (0, _index7.default)(dateLeft, dateRight); + } else if (unit === 'day') { + value = (0, _index2.default)(dateLeft, dateRight); + } else if (unit === 'week') { + value = (0, _index5.default)(dateLeft, dateRight); + } else if (unit === 'month') { + value = (0, _index3.default)(dateLeft, dateRight); + } else if (unit === 'quarter') { + value = (0, _index4.default)(dateLeft, dateRight); + } else if (unit === 'year') { + value = (0, _index6.default)(dateLeft, dateRight); + } + } + var rtf = new Intl.RelativeTimeFormat(options === null || options === void 0 ? void 0 : options.locale, { + localeMatcher: options === null || options === void 0 ? void 0 : options.localeMatcher, + numeric: (options === null || options === void 0 ? void 0 : options.numeric) || 'auto', + style: options === null || options === void 0 ? void 0 : options.style + }); + return rtf.format(value, unit); } - module.exports = exports.default; /***/ }), -/* 387 */, -/* 388 */, -/* 389 */, -/* 390 */, -/* 391 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 2755: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = setISOWeek; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(773)); - -var _index3 = _interopRequireDefault(__webpack_require__(629)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isAfter; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name setISOWeek - * @category ISO Week Helpers - * @summary Set the ISO week to the given date. + * @name isAfter + * @category Common Helpers + * @summary Is the first date after the second one? * * @description - * Set the ISO week to the given date, saving the weekday number. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Is the first date after the second one? * - * @param {Date|Number} date - the date to be changed - * @param {Number} isoWeek - the ISO week of the new date - * @returns {Date} the new date with the ISO week set + * @param {Date|Number} date - the date that should be after the other one to return true + * @param {Date|Number} dateToCompare - the date to compare with + * @returns {Boolean} the first date is after the second date * @throws {TypeError} 2 arguments required * * @example - * // Set the 53rd ISO week to 7 August 2004: - * const result = setISOWeek(new Date(2004, 7, 7), 53) - * //=> Sat Jan 01 2005 00:00:00 + * // Is 10 July 1989 after 11 February 1987? + * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) + * //=> true */ -function setISOWeek(dirtyDate, dirtyISOWeek) { - (0, _index4.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var isoWeek = (0, _index.default)(dirtyISOWeek); - var diff = (0, _index3.default)(date) - isoWeek; - date.setDate(date.getDate() - diff * 7); - return date; +function isAfter(dirtyDate, dirtyDateToCompare) { + (0, _index2.default)(2, arguments); + var date = (0, _index.default)(dirtyDate); + var dateToCompare = (0, _index.default)(dirtyDateToCompare); + return date.getTime() > dateToCompare.getTime(); } - module.exports = exports.default; /***/ }), -/* 392 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const conversions = __webpack_require__(600); - -/* - This function routes a model to all other models. - - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). - - conversions that are not possible simply are not included. -*/ - -function buildGraph() { - const graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); - - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - - return graph; -} - -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop - - graph[fromModel].distance = 0; - - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - - return graph; -} -function link(from, to) { - return function (args) { - return to(from(args)); - }; -} +/***/ 9369: +/***/ ((module, exports, __nccwpck_require__) => { -function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; +"use strict"; - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - fn.conversion = path; - return fn; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isBefore; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isBefore + * @category Common Helpers + * @summary Is the first date before the second one? + * + * @description + * Is the first date before the second one? + * + * @param {Date|Number} date - the date that should be before the other one to return true + * @param {Date|Number} dateToCompare - the date to compare with + * @returns {Boolean} the first date is before the second date + * @throws {TypeError} 2 arguments required + * + * @example + * // Is 10 July 1989 before 11 February 1987? + * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11)) + * //=> false + */ +function isBefore(dirtyDate, dirtyDateToCompare) { + (0, _index2.default)(2, arguments); + var date = (0, _index.default)(dirtyDate); + var dateToCompare = (0, _index.default)(dirtyDateToCompare); + return date.getTime() < dateToCompare.getTime(); } - -module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; - - if (node.parent === null) { - // No possible conversion, or this node is the source model. - continue; - } - - conversion[toModel] = wrapConversion(toModel, graph); - } - - return conversion; -}; - - +module.exports = exports.default; /***/ }), -/* 393 */, -/* 394 */, -/* 395 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6801: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = eachWeekOfInterval; - -var _index = _interopRequireDefault(__webpack_require__(433)); - -var _index2 = _interopRequireDefault(__webpack_require__(343)); - -var _index3 = _interopRequireDefault(__webpack_require__(773)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isDate; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _index = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name eachWeekOfInterval - * @category Interval Helpers - * @summary Return the array of weeks within the specified time interval. + * @name isDate + * @category Common Helpers + * @summary Is the given value a date? * * @description - * Return the array of weeks within the specified time interval. + * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes. * - * ### v2.0.0 breaking changes: + * @param {*} value - the value to check + * @returns {boolean} true if the given value is a date + * @throws {TypeError} 1 arguments required * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @example + * // For a valid date: + * const result = isDate(new Date()) + * //=> true * - * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} - * @param {Object} [options] - an object with options. - * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} - * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Date[]} the array with starts of weeks from the week of the interval start to the week of the interval end - * @throws {TypeError} 1 argument required - * @throws {RangeError} `options.weekStartsOn` must be 0, 1, ..., 6 - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` + * @example + * // For an invalid date: + * const result = isDate(new Date(NaN)) + * //=> true * * @example - * // Each week within interval 6 October 2014 - 23 November 2014: - * var result = eachWeekOfInterval({ - * start: new Date(2014, 9, 6), - * end: new Date(2014, 10, 23) - * }) - * //=> [ - * // Sun Oct 05 2014 00:00:00, - * // Sun Oct 12 2014 00:00:00, - * // Sun Oct 19 2014 00:00:00, - * // Sun Oct 26 2014 00:00:00, - * // Sun Nov 02 2014 00:00:00, - * // Sun Nov 09 2014 00:00:00, - * // Sun Nov 16 2014 00:00:00, - * // Sun Nov 23 2014 00:00:00 - * // ] + * // For some value: + * const result = isDate('2014-02-31') + * //=> false + * + * @example + * // For an object: + * const result = isDate({}) + * //=> false */ -function eachWeekOfInterval(dirtyInterval, options) { - (0, _index4.default)(1, arguments); - var interval = dirtyInterval || {}; - var startDate = (0, _index3.default)(interval.start); - var endDate = (0, _index3.default)(interval.end); - var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` - - if (!(startDate.getTime() <= endTime)) { - throw new RangeError('Invalid interval'); - } - - var startDateWeek = (0, _index2.default)(startDate, options); - var endDateWeek = (0, _index2.default)(endDate, options); // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet - - startDateWeek.setHours(15); - endDateWeek.setHours(15); - endTime = endDateWeek.getTime(); - var weeks = []; - var currentWeek = startDateWeek; - - while (currentWeek.getTime() <= endTime) { - currentWeek.setHours(0); - weeks.push((0, _index3.default)(currentWeek)); - currentWeek = (0, _index.default)(currentWeek, 1); - currentWeek.setHours(15); - } - - return weeks; +function isDate(value) { + (0, _index.default)(1, arguments); + return value instanceof Date || (0, _typeof2.default)(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]'; } - module.exports = exports.default; /***/ }), -/* 396 */ -/***/ (function(module) { - -"use strict"; - -module.exports = function (Yallist) { - Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value - } - } -} - -/***/ }), -/* 397 */, -/* 398 */, -/* 399 */, -/* 400 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 4669: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInQuarters; - -var _index = _interopRequireDefault(__webpack_require__(549)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isEqual; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name differenceInQuarters - * @category Quarter Helpers - * @summary Get the number of full quarters between the given dates. + * @name isEqual + * @category Common Helpers + * @summary Are the given dates equal? * * @description - * Get the number of full quarters between the given dates. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Are the given dates equal? * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of full quarters + * @param {Date|Number} dateLeft - the first date to compare + * @param {Date|Number} dateRight - the second date to compare + * @returns {Boolean} the dates are equal * @throws {TypeError} 2 arguments required * * @example - * // How many full quarters are between 31 December 2013 and 2 July 2014? - * var result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31)) - * //=> 2 + * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal? + * const result = isEqual( + * new Date(2014, 6, 2, 6, 30, 45, 0), + * new Date(2014, 6, 2, 6, 30, 45, 500) + * ) + * //=> false */ -function differenceInQuarters(dirtyDateLeft, dirtyDateRight) { +function isEqual(dirtyLeftDate, dirtyRightDate) { (0, _index2.default)(2, arguments); - var diff = (0, _index.default)(dirtyDateLeft, dirtyDateRight) / 3; - return diff > 0 ? Math.floor(diff) : Math.ceil(diff); + var dateLeft = (0, _index.default)(dirtyLeftDate); + var dateRight = (0, _index.default)(dirtyRightDate); + return dateLeft.getTime() === dateRight.getTime(); } - module.exports = exports.default; /***/ }), -/* 401 */, -/* 402 */, -/* 403 */, -/* 404 */ -/***/ (function(module) { - -"use strict"; - -const aliases = ['stdin', 'stdout', 'stderr']; - -const hasAlias = options => aliases.some(alias => options[alias] !== undefined); - -const normalizeStdio = options => { - if (!options) { - return; - } - const {stdio} = options; +/***/ 7352: +/***/ ((module, exports) => { - if (stdio === undefined) { - return aliases.map(alias => options[alias]); - } +"use strict"; - if (hasAlias(options)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); - } - if (typeof stdio === 'string') { - return stdio; - } - - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } - - const length = Math.max(stdio.length, aliases.length); - return Array.from({length}, (value, index) => stdio[index]); -}; - -module.exports = normalizeStdio; - -// `ipc` is pushed unless it is already present -module.exports.node = options => { - const stdio = normalizeStdio(options); - - if (stdio === 'ipc') { - return 'ipc'; - } - - if (stdio === undefined || typeof stdio === 'string') { - return [stdio, stdio, stdio, 'ipc']; - } - - if (stdio.includes('ipc')) { - return stdio; - } - - return [...stdio, 'ipc']; -}; - - -/***/ }), -/* 405 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = startOfYear; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isExists; /** - * @name startOfYear - * @category Year Helpers - * @summary Return the start of a year for the given date. + * @name isExists + * @category Common Helpers + * @summary Is the given date exists? * * @description - * Return the start of a year for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: + * Checks if the given arguments convert to an existing date. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @param {Number} year of the date to check + * @param {Number} month of the date to check + * @param {Number} day of the date to check + * @returns {Boolean} the date exists + * @throws {TypeError} 3 arguments required * - * @param {Date|Number} date - the original date - * @returns {Date} the start of a year - * @throws {TypeError} 1 argument required + * @example + * // For the valid date: + * const result = isExists(2018, 0, 31) + * //=> true * * @example - * // The start of a year for 2 September 2014 11:55:00: - * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) - * //=> Wed Jan 01 2014 00:00:00 + * // For the invalid date: + * const result = isExists(2018, 1, 31) + * //=> false */ -function startOfYear(dirtyDate) { - (0, _index2.default)(1, arguments); - var cleanDate = (0, _index.default)(dirtyDate); - var date = new Date(0); - date.setFullYear(cleanDate.getFullYear(), 0, 1); - date.setHours(0, 0, 0, 0); - return date; +function isExists(year, month, day) { + if (arguments.length < 3) { + throw new TypeError('3 argument required, but only ' + arguments.length + ' present'); + } + var date = new Date(year, month, day); + return date.getFullYear() === year && date.getMonth() === month && date.getDate() === day; } - module.exports = exports.default; /***/ }), -/* 406 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; - -const escapeStringRegexp = __webpack_require__(138); -const ansiStyles = __webpack_require__(714); -const stdoutColor = __webpack_require__(577).stdout; - -const template = __webpack_require__(264); - -const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); - -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; - -// `color-convert` models to exclude from the Chalk API due to conflicts and such -const skipModels = new Set(['gray']); - -const styles = Object.create(null); - -function applyOptions(obj, options) { - options = options || {}; - - // Detect level if not set manually - const scLevel = stdoutColor ? stdoutColor.level : 0; - obj.level = options.level === undefined ? scLevel : options.level; - obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; -} - -function Chalk(options) { - // We check for this.template here since calling `chalk.constructor()` - // by itself will have a `this` of a previously constructed chalk object - if (!this || !(this instanceof Chalk) || this.template) { - const chalk = {}; - applyOptions(chalk, options); - - chalk.template = function () { - const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk.template].concat(args)); - }; - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - - chalk.template.constructor = Chalk; - - return chalk.template; - } - - applyOptions(this, options); -} - -// Use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001B[94m'; -} - -for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - - styles[key] = { - get() { - const codes = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); - } - }; -} - -styles.visible = { - get() { - return build.call(this, this._styles || [], true, 'visible'); - } -}; - -ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); -for (const model of Object.keys(ansiStyles.color.ansi)) { - if (skipModels.has(model)) { - continue; - } - - styles[model] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); -for (const model of Object.keys(ansiStyles.bgColor.ansi)) { - if (skipModels.has(model)) { - continue; - } - - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -const proto = Object.defineProperties(() => {}, styles); - -function build(_styles, _empty, key) { - const builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - builder._empty = _empty; - - const self = this; - - Object.defineProperty(builder, 'level', { - enumerable: true, - get() { - return self.level; - }, - set(level) { - self.level = level; - } - }); - - Object.defineProperty(builder, 'enabled', { - enumerable: true, - get() { - return self.enabled; - }, - set(enabled) { - self.enabled = enabled; - } - }); - - // See below for fix regarding invisible grey/dim combination on Windows - builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; - - // `__proto__` is used because we must return a function, but there is - // no way to create a function with a different prototype - builder.__proto__ = proto; // eslint-disable-line no-proto - - return builder; -} - -function applyStyle() { - // Support varags, but simply cast to string in case there's only one arg - const args = arguments; - const argsLen = args.length; - let str = String(arguments[0]); - - if (argsLen === 0) { - return ''; - } - - if (argsLen > 1) { - // Don't slice `arguments`, it prevents V8 optimizations - for (let a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || this.level <= 0 || !str) { - return this._empty ? '' : str; - } - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - const originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ''; - } - - for (const code of this._styles.slice().reverse()) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - - // Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS - // https://github.com/chalk/chalk/pull/92 - str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); - } - - // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue - ansiStyles.dim.open = originalDim; - - return str; -} - -function chalkTag(chalk, strings) { - if (!Array.isArray(strings)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return [].slice.call(arguments, 1).join(' '); - } - - const args = [].slice.call(arguments, 2); - const parts = [strings.raw[0]]; - - for (let i = 1; i < strings.length; i++) { - parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); - parts.push(String(strings.raw[i])); - } - - return template(chalk, parts.join('')); -} - -Object.defineProperties(Chalk.prototype, styles); - -module.exports = Chalk(); // eslint-disable-line new-cap -module.exports.supportsColor = stdoutColor; -module.exports.default = module.exports; // For TypeScript - -/***/ }), -/* 407 */, -/* 408 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 5387: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = startOfISOWeek; - -var _index = _interopRequireDefault(__webpack_require__(343)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isFirstDayOfMonth; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name startOfISOWeek - * @category ISO Week Helpers - * @summary Return the start of an ISO week for the given date. + * @name isFirstDayOfMonth + * @category Month Helpers + * @summary Is the given date the first day of a month? * * @description - * Return the start of an ISO week for the given date. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Is the given date the first day of a month? * - * @param {Date|Number} date - the original date - * @returns {Date} the start of an ISO week + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is the first day of a month * @throws {TypeError} 1 argument required * * @example - * // The start of an ISO week for 2 September 2014 11:55:00: - * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Mon Sep 01 2014 00:00:00 + * // Is 1 September 2014 the first day of a month? + * const result = isFirstDayOfMonth(new Date(2014, 8, 1)) + * //=> true */ -function startOfISOWeek(dirtyDate) { +function isFirstDayOfMonth(dirtyDate) { (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate, { - weekStartsOn: 1 - }); + return (0, _index.default)(dirtyDate).getDate() === 1; } - module.exports = exports.default; /***/ }), -/* 409 */, -/* 410 */, -/* 411 */, -/* 412 */, -/* 413 */ -/***/ (function(module) { -module.exports = require("stream"); - -/***/ }), -/* 414 */, -/* 415 */, -/* 416 */, -/* 417 */, -/* 418 */, -/* 419 */, -/* 420 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/***/ 1758: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -Object.defineProperty(exports, "isIdentifierName", { - enumerable: true, - get: function () { - return _identifier.isIdentifierName; - } -}); -Object.defineProperty(exports, "isIdentifierChar", { - enumerable: true, - get: function () { - return _identifier.isIdentifierChar; - } -}); -Object.defineProperty(exports, "isIdentifierStart", { - enumerable: true, - get: function () { - return _identifier.isIdentifierStart; - } -}); -Object.defineProperty(exports, "isReservedWord", { - enumerable: true, - get: function () { - return _keyword.isReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindOnlyReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindReservedWord; - } -}); -Object.defineProperty(exports, "isStrictReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictReservedWord; - } -}); -Object.defineProperty(exports, "isKeyword", { - enumerable: true, - get: function () { - return _keyword.isKeyword; - } -}); - -var _identifier = __webpack_require__(363); - -var _keyword = __webpack_require__(974); +})); +exports["default"] = isFriday; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isFriday + * @category Weekday Helpers + * @summary Is the given date Friday? + * + * @description + * Is the given date Friday? + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is Friday + * @throws {TypeError} 1 argument required + * + * @example + * // Is 26 September 2014 Friday? + * const result = isFriday(new Date(2014, 8, 26)) + * //=> true + */ +function isFriday(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate).getDay() === 5; +} +module.exports = exports.default; /***/ }), -/* 421 */, -/* 422 */, -/* 423 */, -/* 424 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6803: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isThisISOWeek; - -var _index = _interopRequireDefault(__webpack_require__(142)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isFuture; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isThisISOWeek - * @category ISO Week Helpers - * @summary Is the given date in the same ISO week as the current date? + * @name isFuture + * @category Common Helpers + * @summary Is the given date in the future? * @pure false * * @description - * Is the given date in the same ISO week as the current date? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * Is the given date in the future? * * > ⚠️ Please note that this function is not present in the FP submodule as * > it uses `Date.now()` internally hence impure and can't be safely curried. * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is in this ISO week + * @returns {Boolean} the date is in the future * @throws {TypeError} 1 argument required * * @example - * // If today is 25 September 2014, is 22 September 2014 in this ISO week? - * var result = isThisISOWeek(new Date(2014, 8, 22)) + * // If today is 6 October 2014, is 31 December 2014 in the future? + * const result = isFuture(new Date(2014, 11, 31)) * //=> true */ -function isThisISOWeek(dirtyDate) { +function isFuture(dirtyDate) { (0, _index2.default)(1, arguments); - return (0, _index.default)(dirtyDate, Date.now()); + return (0, _index.default)(dirtyDate).getTime() > Date.now(); } - module.exports = exports.default; /***/ }), -/* 425 */, -/* 426 */, -/* 427 */, -/* 428 */, -/* 429 */, -/* 430 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8506: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = lastDayOfYear; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isLastDayOfMonth; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8569)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2621)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name lastDayOfYear - * @category Year Helpers - * @summary Return the last day of a year for the given date. + * @name isLastDayOfMonth + * @category Month Helpers + * @summary Is the given date the last day of a month? * * @description - * Return the last day of a year for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Is the given date the last day of a month? * - * @param {Date|Number} date - the original date - * @returns {Date} the last day of a year + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is the last day of a month * @throws {TypeError} 1 argument required * * @example - * // The last day of a year for 2 September 2014 11:55:00: - * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00)) - * //=> Wed Dec 31 2014 00:00:00 + * // Is 28 February 2014 the last day of a month? + * const result = isLastDayOfMonth(new Date(2014, 1, 28)) + * //=> true */ -function lastDayOfYear(dirtyDate) { - (0, _index2.default)(1, arguments); +function isLastDayOfMonth(dirtyDate) { + (0, _index4.default)(1, arguments); var date = (0, _index.default)(dirtyDate); - var year = date.getFullYear(); - date.setFullYear(year + 1, 0, 0); - date.setHours(0, 0, 0, 0); - return date; + return (0, _index2.default)(date).getTime() === (0, _index3.default)(date).getTime(); } - module.exports = exports.default; /***/ }), -/* 431 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 74: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = startOfMonth; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isLeapYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name startOfMonth - * @category Month Helpers - * @summary Return the start of a month for the given date. + * @name isLeapYear + * @category Year Helpers + * @summary Is the given date in the leap year? * * @description - * Return the start of a month for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Is the given date in the leap year? * - * @param {Date|Number} date - the original date - * @returns {Date} the start of a month + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in the leap year * @throws {TypeError} 1 argument required * * @example - * // The start of a month for 2 September 2014 11:55:00: - * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Mon Sep 01 2014 00:00:00 + * // Is 1 September 2012 in the leap year? + * const result = isLeapYear(new Date(2012, 8, 1)) + * //=> true */ -function startOfMonth(dirtyDate) { +function isLeapYear(dirtyDate) { (0, _index2.default)(1, arguments); var date = (0, _index.default)(dirtyDate); - date.setDate(1); - date.setHours(0, 0, 0, 0); - return date; + var year = date.getFullYear(); + return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; } - module.exports = exports.default; /***/ }), -/* 432 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 525: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = compareAsc; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isMatch; +var _index = _interopRequireDefault(__nccwpck_require__(1287)); +var _index2 = _interopRequireDefault(__nccwpck_require__(9920)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name compareAsc + * @name isMatch * @category Common Helpers - * @summary Compare the two dates and return -1, 0 or 1. + * @summary validates the date string against given formats * * @description - * Compare the two dates and return 1 if the first date is after the second, - * -1 if the first date is before the second or 0 if dates are equal. + * Return the true if given date is string correct against the given format else + * will return false. + * + * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. + * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * The characters in the format string wrapped between two single quotes characters (') are escaped. + * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. * - * ### v2.0.0 breaking changes: + * Format of the format string is based on Unicode Technical Standard #35: + * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table + * with a few additions (see note 5 below the table). * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited + * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception: * - * @param {Date|Number} dateLeft - the first date to compare - * @param {Date|Number} dateRight - the second date to compare - * @returns {Number} the result of the comparison + * ```javascript + * isMatch('23 AM', 'HH a') + * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time + * ``` + * + * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true + * + * Accepted format string patterns: + * | Unit |Prior| Pattern | Result examples | Notes | + * |---------------------------------|-----|---------|-----------------------------------|-------| + * | Era | 140 | G..GGG | AD, BC | | + * | | | GGGG | Anno Domini, Before Christ | 2 | + * | | | GGGGG | A, B | | + * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | + * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | + * | | | yy | 44, 01, 00, 17 | 4 | + * | | | yyy | 044, 001, 123, 999 | 4 | + * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | + * | | | yyyyy | ... | 2,4 | + * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | + * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | + * | | | YY | 44, 01, 00, 17 | 4,6 | + * | | | YYY | 044, 001, 123, 999 | 4 | + * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | + * | | | YYYYY | ... | 2,4 | + * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | + * | | | RR | -43, 01, 00, 17 | 4,5 | + * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | + * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | + * | | | RRRRR | ... | 2,4,5 | + * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | + * | | | uu | -43, 01, 99, -99 | 4 | + * | | | uuu | -043, 001, 123, 999, -999 | 4 | + * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | + * | | | uuuuu | ... | 2,4 | + * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | + * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | + * | | | QQ | 01, 02, 03, 04 | | + * | | | QQQ | Q1, Q2, Q3, Q4 | | + * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | + * | | | QQQQQ | 1, 2, 3, 4 | 4 | + * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | + * | | | qo | 1st, 2nd, 3rd, 4th | 5 | + * | | | qq | 01, 02, 03, 04 | | + * | | | qqq | Q1, Q2, Q3, Q4 | | + * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | + * | | | qqqqq | 1, 2, 3, 4 | 3 | + * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | + * | | | Mo | 1st, 2nd, ..., 12th | 5 | + * | | | MM | 01, 02, ..., 12 | | + * | | | MMM | Jan, Feb, ..., Dec | | + * | | | MMMM | January, February, ..., December | 2 | + * | | | MMMMM | J, F, ..., D | | + * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | + * | | | Lo | 1st, 2nd, ..., 12th | 5 | + * | | | LL | 01, 02, ..., 12 | | + * | | | LLL | Jan, Feb, ..., Dec | | + * | | | LLLL | January, February, ..., December | 2 | + * | | | LLLLL | J, F, ..., D | | + * | Local week of year | 100 | w | 1, 2, ..., 53 | | + * | | | wo | 1st, 2nd, ..., 53th | 5 | + * | | | ww | 01, 02, ..., 53 | | + * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | + * | | | Io | 1st, 2nd, ..., 53th | 5 | + * | | | II | 01, 02, ..., 53 | 5 | + * | Day of month | 90 | d | 1, 2, ..., 31 | | + * | | | do | 1st, 2nd, ..., 31st | 5 | + * | | | dd | 01, 02, ..., 31 | | + * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 | + * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | + * | | | DD | 01, 02, ..., 365, 366 | 7 | + * | | | DDD | 001, 002, ..., 365, 366 | | + * | | | DDDD | ... | 2 | + * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | | + * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | + * | | | EEEEE | M, T, W, T, F, S, S | | + * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | + * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | + * | | | io | 1st, 2nd, ..., 7th | 5 | + * | | | ii | 01, 02, ..., 07 | 5 | + * | | | iii | Mon, Tue, Wed, ..., Su | 5 | + * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | + * | | | iiiii | M, T, W, T, F, S, S | 5 | + * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 | + * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | + * | | | eo | 2nd, 3rd, ..., 1st | 5 | + * | | | ee | 02, 03, ..., 01 | | + * | | | eee | Mon, Tue, Wed, ..., Su | | + * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | + * | | | eeeee | M, T, W, T, F, S, S | | + * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | + * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | + * | | | co | 2nd, 3rd, ..., 1st | 5 | + * | | | cc | 02, 03, ..., 01 | | + * | | | ccc | Mon, Tue, Wed, ..., Su | | + * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | + * | | | ccccc | M, T, W, T, F, S, S | | + * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | + * | AM, PM | 80 | a..aaa | AM, PM | | + * | | | aaaa | a.m., p.m. | 2 | + * | | | aaaaa | a, p | | + * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | + * | | | bbbb | a.m., p.m., noon, midnight | 2 | + * | | | bbbbb | a, p, n, mi | | + * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | + * | | | BBBB | at night, in the morning, ... | 2 | + * | | | BBBBB | at night, in the morning, ... | | + * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | + * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | + * | | | hh | 01, 02, ..., 11, 12 | | + * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | + * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | + * | | | HH | 00, 01, 02, ..., 23 | | + * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | + * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | + * | | | KK | 01, 02, ..., 11, 00 | | + * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | + * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | + * | | | kk | 24, 01, 02, ..., 23 | | + * | Minute | 60 | m | 0, 1, ..., 59 | | + * | | | mo | 0th, 1st, ..., 59th | 5 | + * | | | mm | 00, 01, ..., 59 | | + * | Second | 50 | s | 0, 1, ..., 59 | | + * | | | so | 0th, 1st, ..., 59th | 5 | + * | | | ss | 00, 01, ..., 59 | | + * | Seconds timestamp | 40 | t | 512969520 | | + * | | | tt | ... | 2 | + * | Fraction of second | 30 | S | 0, 1, ..., 9 | | + * | | | SS | 00, 01, ..., 99 | | + * | | | SSS | 000, 001, ..., 999 | | + * | | | SSSS | ... | 2 | + * | Milliseconds timestamp | 20 | T | 512969520900 | | + * | | | TT | ... | 2 | + * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | + * | | | XX | -0800, +0530, Z | | + * | | | XXX | -08:00, +05:30, Z | | + * | | | XXXX | -0800, +0530, Z, +123456 | 2 | + * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | + * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | + * | | | xx | -0800, +0530, +0000 | | + * | | | xxx | -08:00, +05:30, +00:00 | 2 | + * | | | xxxx | -0800, +0530, +0000, +123456 | | + * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | + * | Long localized date | NA | P | 05/29/1453 | 5,8 | + * | | | PP | May 29, 1453 | | + * | | | PPP | May 29th, 1453 | | + * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 | + * | Long localized time | NA | p | 12:00 AM | 5,8 | + * | | | pp | 12:00:00 AM | | + * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | | + * | | | PPpp | May 29, 1453, 12:00:00 AM | | + * | | | PPPpp | May 29th, 1453 at ... | | + * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 | + * Notes: + * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale + * are the same as "stand-alone" units, but are different in some languages. + * "Formatting" units are declined according to the rules of the language + * in the context of a date. "Stand-alone" units are always nominative singular. + * In `format` function, they will produce different result: + * + * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` + * + * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` + * + * `isMatch` will try to match both formatting and stand-alone units interchangably. + * + * 2. Any sequence of the identical letters is a pattern, unless it is escaped by + * the single quote characters (see below). + * If the sequence is longer than listed in table: + * - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number + * as wide as the sequence + * - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit. + * These variations are marked with "2" in the last column of the table. + * + * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. + * These tokens represent the shortest form of the quarter. + * + * 4. The main difference between `y` and `u` patterns are B.C. years: + * + * | Year | `y` | `u` | + * |------|-----|-----| + * | AC 1 | 1 | 1 | + * | BC 1 | 1 | 0 | + * | BC 2 | 2 | -1 | + * + * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`: + * + * `isMatch('50', 'yy') //=> true` + * + * `isMatch('75', 'yy') //=> true` + * + * while `uu` will use the year as is: + * + * `isMatch('50', 'uu') //=> true` + * + * `isMatch('75', 'uu') //=> true` + * + * The same difference is true for local and ISO week-numbering years (`Y` and `R`), + * except local week-numbering years are dependent on `options.weekStartsOn` + * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear} + * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}). + * + * 5. These patterns are not in the Unicode Technical Standard #35: + * - `i`: ISO day of week + * - `I`: ISO week of year + * - `R`: ISO week-numbering year + * - `o`: ordinal number modifier + * - `P`: long localized date + * - `p`: long localized time + * + * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. + * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month. + * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based + * on the given locale. + * + * using `en-US` locale: `P` => `MM/dd/yyyy` + * using `en-US` locale: `p` => `hh:mm a` + * using `pt-BR` locale: `P` => `dd/MM/yyyy` + * using `pt-BR` locale: `p` => `HH:mm` + * + * Values will be checked in the descending order of its unit's priority. + * Units of an equal priority overwrite each other in the order of appearance. + * + * If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year), + * the values will be taken from today's using `new Date()` date which works as a context of parsing. + * + * The result may vary by locale. + * + * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. + * + * + * + * @param {String} dateString - the date string to verify + * @param {String} formatString - the string of tokens + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year + * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`; + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`; + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @returns {Boolean} * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 + * @throws {RangeError} `options.locale` must contain `match` property + * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} format string contains an unescaped latin alphabet character * * @example - * // Compare 11 February 1987 and 10 July 1989: - * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10)) - * //=> -1 + * // Match 11 February 2014 from middle-endian format: + * const result = isMatch('02/11/2014', 'MM/dd/yyyy') + * //=> true * * @example - * // Sort the array of dates: - * const result = [ - * new Date(1995, 6, 2), - * new Date(1987, 1, 11), - * new Date(1989, 6, 10) - * ].sort(compareAsc) - * //=> [ - * // Wed Feb 11 1987 00:00:00, - * // Mon Jul 10 1989 00:00:00, - * // Sun Jul 02 1995 00:00:00 - * // ] + * // Match 28th of February in Esperanto locale in the context of 2010 year: + * import eo from 'date-fns/locale/eo' + * const result = isMatch('28-a de februaro', "do 'de' MMMM", { + * locale: eo + * }) + * //=> true */ -function compareAsc(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - var dateLeft = (0, _index.default)(dirtyDateLeft); - var dateRight = (0, _index.default)(dirtyDateRight); - var diff = dateLeft.getTime() - dateRight.getTime(); - - if (diff < 0) { - return -1; - } else if (diff > 0) { - return 1; // Return 0 if diff is 0; return NaN if diff is NaN - } else { - return diff; - } +function isMatch(dateString, formatString, options) { + (0, _index3.default)(2, arguments); + return (0, _index2.default)((0, _index.default)(dateString, formatString, new Date(), options)); } - module.exports = exports.default; /***/ }), -/* 433 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6030: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = addWeeks; +})); +exports["default"] = isMonday; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isMonday + * @category Weekday Helpers + * @summary Is the given date Monday? + * + * @description + * Is the given date Monday? + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is Monday + * @throws {TypeError} 1 argument required + * + * @example + * // Is 22 September 2014 Monday? + * const result = isMonday(new Date(2014, 8, 22)) + * //=> true + */ +function isMonday(date) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(date).getDay() === 1; +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(841)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(865)); +/***/ 9543: +/***/ ((module, exports, __nccwpck_require__) => { -var _index3 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isPast; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name addWeeks - * @category Week Helpers - * @summary Add the specified number of weeks to the given date. + * @name isPast + * @category Common Helpers + * @summary Is the given date in the past? + * @pure false * * @description - * Add the specified number of week to the given date. - * - * ### v2.0.0 breaking changes: + * Is the given date in the past? * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of weeks to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the weeks added - * @throws {TypeError} 2 arguments required + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in the past + * @throws {TypeError} 1 argument required * * @example - * // Add 4 weeks to 1 September 2014: - * const result = addWeeks(new Date(2014, 8, 1), 4) - * //=> Mon Sep 29 2014 00:00:00 + * // If today is 6 October 2014, is 2 July 2014 in the past? + * const result = isPast(new Date(2014, 6, 2)) + * //=> true */ -function addWeeks(dirtyDate, dirtyAmount) { - (0, _index3.default)(2, arguments); - var amount = (0, _index.default)(dirtyAmount); - var days = amount * 7; - return (0, _index2.default)(dirtyDate, days); +function isPast(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate).getTime() < Date.now(); } - module.exports = exports.default; /***/ }), -/* 434 */, -/* 435 */, -/* 436 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + +/***/ 2154: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -const ansiStyles = __webpack_require__(820); -const {stdout: stdoutColor, stderr: stderrColor} = __webpack_require__(247); -const { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -} = __webpack_require__(833); -const {isArray} = Array; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSameDay; +var _index = _interopRequireDefault(__nccwpck_require__(1868)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameDay + * @category Day Helpers + * @summary Are the given dates in the same day (and year and month)? + * + * @description + * Are the given dates in the same day (and year and month)? + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same day (and year and month) + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day? + * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0)) + * //=> true + * + * @example + * // Are 4 September and 4 October in the same day? + * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4)) + * //=> false + * + * @example + * // Are 4 September, 2014 and 4 September, 2015 in the same day? + * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4)) + * //=> false + */ +function isSameDay(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeftStartOfDay = (0, _index.default)(dirtyDateLeft); + var dateRightStartOfDay = (0, _index.default)(dirtyDateRight); + return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime(); +} +module.exports = exports.default; -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = [ - 'ansi', - 'ansi', - 'ansi256', - 'ansi16m' -]; +/***/ }), -const styles = Object.create(null); +/***/ 2489: +/***/ ((module, exports, __nccwpck_require__) => { -const applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error('The `level` option should be an integer from 0 to 3'); - } +"use strict"; - // Detect level if not set manually - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === undefined ? colorLevel : options.level; -}; -class ChalkClass { - constructor(options) { - // eslint-disable-next-line no-constructor-return - return chalkFactory(options); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSameHour; +var _index = _interopRequireDefault(__nccwpck_require__(6277)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameHour + * @category Hour Helpers + * @summary Are the given dates in the same hour (and same day)? + * + * @description + * Are the given dates in the same hour (and same day)? + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same hour (and same day) + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour? + * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30)) + * //=> true + * + * @example + * // Are 4 September 2014 06:00:00 and 5 September 06:00:00 in the same hour? + * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 5, 6, 0)) + * //=> false + */ +function isSameHour(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeftStartOfHour = (0, _index.default)(dirtyDateLeft); + var dateRightStartOfHour = (0, _index.default)(dirtyDateRight); + return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime(); } +module.exports = exports.default; -const chalkFactory = options => { - const chalk = {}; - applyOptions(chalk, options); - - chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); +/***/ }), - chalk.template.constructor = () => { - throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); - }; +/***/ 9852: +/***/ ((module, exports, __nccwpck_require__) => { - chalk.template.Instance = ChalkClass; +"use strict"; - return chalk.template; -}; -function Chalk(options) { - return chalkFactory(options); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSameISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(7013)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameISOWeek + * @category ISO Week Helpers + * @summary Are the given dates in the same ISO week (and year)? + * + * @description + * Are the given dates in the same ISO week (and year)? + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same ISO week (and year) + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 1 September 2014 and 7 September 2014 in the same ISO week? + * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7)) + * //=> true + * + * @example + * // Are 1 September 2014 and 1 September 2015 in the same ISO week? + * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2015, 8, 1)) + * //=> false + */ +function isSameISOWeek(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + return (0, _index.default)(dirtyDateLeft, dirtyDateRight, { + weekStartsOn: 1 + }); } +module.exports = exports.default; -for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, {value: builder}); - return builder; - } - }; -} +/***/ }), -styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, 'visible', {value: builder}); - return builder; - } -}; +/***/ 3944: +/***/ ((module, exports, __nccwpck_require__) => { -const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; +"use strict"; -for (const model of usedModels) { - styles[model] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} -for (const model of usedModels) { - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSameISOWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(776)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Are the given dates in the same ISO week-numbering year? + * + * @description + * Are the given dates in the same ISO week-numbering year? + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same ISO week-numbering year + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year? + * const result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2)) + * //=> true + */ +function isSameISOWeekYear(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeftStartOfYear = (0, _index.default)(dirtyDateLeft); + var dateRightStartOfYear = (0, _index.default)(dirtyDateRight); + return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime(); } +module.exports = exports.default; -const proto = Object.defineProperties(() => {}, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; - } - } -}); - -const createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === undefined) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } - - return { - open, - close, - openAll, - closeAll, - parent - }; -}; - -const createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { - // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` - return applyStyle(builder, chalkTag(builder, ...arguments_)); - } - - // Single argument is hot path, implicit coercion is faster than anything - // eslint-disable-next-line no-implicit-coercion - return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); - }; - - // We alter the prototype because we must return a function, but there is - // no way to create a function with a different prototype - Object.setPrototypeOf(builder, proto); +/***/ }), - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; +/***/ 3197: +/***/ ((module, exports, __nccwpck_require__) => { - return builder; -}; +"use strict"; -const applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? '' : string; - } - let styler = self._styler; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSameMinute; +var _index = _interopRequireDefault(__nccwpck_require__(8567)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameMinute + * @category Minute Helpers + * @summary Are the given dates in the same minute (and hour and day)? + * + * @description + * Are the given dates in the same minute (and hour and day)? + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same minute (and hour and day) + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15 in the same minute? + * const result = isSameMinute( + * new Date(2014, 8, 4, 6, 30), + * new Date(2014, 8, 4, 6, 30, 15) + * ) + * //=> true + * + * @example + * // Are 4 September 2014 06:30:00 and 5 September 2014 06:30:00 in the same minute? + * const result = isSameMinute( + * new Date(2014, 8, 4, 6, 30), + * new Date(2014, 8, 5, 6, 30) + * ) + * //=> false + */ +function isSameMinute(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeftStartOfMinute = (0, _index.default)(dirtyDateLeft); + var dateRightStartOfMinute = (0, _index.default)(dirtyDateRight); + return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime(); +} +module.exports = exports.default; - if (styler === undefined) { - return string; - } +/***/ }), - const {openAll, closeAll} = styler; - if (string.indexOf('\u001B') !== -1) { - while (styler !== undefined) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - string = stringReplaceAll(string, styler.close, styler.open); +/***/ 5421: +/***/ ((module, exports, __nccwpck_require__) => { - styler = styler.parent; - } - } +"use strict"; - // We can move both next actions out of loop, because remaining actions in loop won't have - // any/visible effect on parts we add here. Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 - const lfIndex = string.indexOf('\n'); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } - return openAll + string + closeAll; -}; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSameMonth; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameMonth + * @category Month Helpers + * @summary Are the given dates in the same month (and year)? + * + * @description + * Are the given dates in the same month (and year)? + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same month (and year) + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 2 September 2014 and 25 September 2014 in the same month? + * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25)) + * //=> true + * + * @example + * // Are 2 September 2014 and 25 September 2015 in the same month? + * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25)) + * //=> false + */ +function isSameMonth(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth(); +} +module.exports = exports.default; -let template; -const chalkTag = (chalk, ...strings) => { - const [firstString] = strings; +/***/ }), - if (!isArray(firstString) || !isArray(firstString.raw)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return strings.join(' '); - } +/***/ 938: +/***/ ((module, exports, __nccwpck_require__) => { - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; +"use strict"; - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), - String(firstString.raw[i]) - ); - } - if (template === undefined) { - template = __webpack_require__(58); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSameQuarter; +var _index = _interopRequireDefault(__nccwpck_require__(2932)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameQuarter + * @category Quarter Helpers + * @summary Are the given dates in the same quarter (and year)? + * + * @description + * Are the given dates in the same quarter (and year)? + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same quarter (and year) + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 1 January 2014 and 8 March 2014 in the same quarter? + * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8)) + * //=> true + * + * @example + * // Are 1 January 2014 and 1 January 2015 in the same quarter? + * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1)) + * //=> false + */ +function isSameQuarter(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeftStartOfQuarter = (0, _index.default)(dirtyDateLeft); + var dateRightStartOfQuarter = (0, _index.default)(dirtyDateRight); + return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime(); +} +module.exports = exports.default; - return template(chalk, parts.join('')); -}; +/***/ }), -Object.defineProperties(Chalk.prototype, styles); +/***/ 1988: +/***/ ((module, exports, __nccwpck_require__) => { -const chalk = Chalk(); // eslint-disable-line new-cap -chalk.supportsColor = stdoutColor; -chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap -chalk.stderr.supportsColor = stderrColor; +"use strict"; -module.exports = chalk; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSameSecond; +var _index = _interopRequireDefault(__nccwpck_require__(6738)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameSecond + * @category Second Helpers + * @summary Are the given dates in the same second (and hour and day)? + * + * @description + * Are the given dates in the same second (and hour and day)? + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same second (and hour and day) + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 in the same second? + * const result = isSameSecond( + * new Date(2014, 8, 4, 6, 30, 15), + * new Date(2014, 8, 4, 6, 30, 15, 500) + * ) + * //=> true + * + * @example + * // Are 4 September 2014 06:00:15.000 and 4 September 2014 06:01.15.000 in the same second? + * const result = isSameSecond( + * new Date(2014, 8, 4, 6, 0, 15), + * new Date(2014, 8, 4, 6, 1, 15) + * ) + * //=> false + * + * @example + * // Are 4 September 2014 06:00:15.000 and 5 September 2014 06:00.15.000 in the same second? + * const result = isSameSecond( + * new Date(2014, 8, 4, 6, 0, 15), + * new Date(2014, 8, 5, 6, 0, 15) + * ) + * //=> false + */ +function isSameSecond(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeftStartOfSecond = (0, _index.default)(dirtyDateLeft); + var dateRightStartOfSecond = (0, _index.default)(dirtyDateRight); + return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime(); +} +module.exports = exports.default; /***/ }), -/* 437 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7013: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInSeconds; - -var _index = _interopRequireDefault(__webpack_require__(647)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isSameWeek; +var _index = _interopRequireDefault(__nccwpck_require__(9813)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name differenceInSeconds - * @category Second Helpers - * @summary Get the number of seconds between the given dates. + * @name isSameWeek + * @category Week Helpers + * @summary Are the given dates in the same week (and month and year)? * * @description - * Get the number of seconds between the given dates. + * Are the given dates in the same week (and month and year)? * - * ### v2.0.0 breaking changes: + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Boolean} the dates are in the same week (and month and year) + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @example + * // Are 31 August 2014 and 4 September 2014 in the same week? + * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4)) + * //=> true * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of seconds - * @throws {TypeError} 2 arguments required + * @example + * // If week starts with Monday, + * // are 31 August 2014 and 4 September 2014 in the same week? + * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), { + * weekStartsOn: 1 + * }) + * //=> false * * @example - * // How many seconds are between - * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000? - * const result = differenceInSeconds( - * new Date(2014, 6, 2, 12, 30, 20, 0), - * new Date(2014, 6, 2, 12, 30, 7, 999) - * ) - * //=> 12 + * // Are 1 January 2014 and 1 January 2015 in the same week? + * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1)) + * //=> false */ -function differenceInSeconds(dirtyDateLeft, dirtyDateRight) { +function isSameWeek(dirtyDateLeft, dirtyDateRight, options) { (0, _index2.default)(2, arguments); - var diff = (0, _index.default)(dirtyDateLeft, dirtyDateRight) / 1000; - return diff > 0 ? Math.floor(diff) : Math.ceil(diff); + var dateLeftStartOfWeek = (0, _index.default)(dirtyDateLeft, options); + var dateRightStartOfWeek = (0, _index.default)(dirtyDateRight, options); + return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime(); } - module.exports = exports.default; /***/ }), -/* 438 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 9821: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = eachHourOfInterval; +})); +exports["default"] = isSameYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSameYear + * @category Year Helpers + * @summary Are the given dates in the same year? + * + * @description + * Are the given dates in the same year? + * + * @param {Date|Number} dateLeft - the first date to check + * @param {Date|Number} dateRight - the second date to check + * @returns {Boolean} the dates are in the same year + * @throws {TypeError} 2 arguments required + * + * @example + * // Are 2 September 2014 and 25 September 2014 in the same year? + * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25)) + * //=> true + */ +function isSameYear(dirtyDateLeft, dirtyDateRight) { + (0, _index2.default)(2, arguments); + var dateLeft = (0, _index.default)(dirtyDateLeft); + var dateRight = (0, _index.default)(dirtyDateRight); + return dateLeft.getFullYear() === dateRight.getFullYear(); +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(39)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(773)); +/***/ 6308: +/***/ ((module, exports, __nccwpck_require__) => { -var _index3 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSaturday; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name eachHourOfInterval - * @category Interval Helpers - * @summary Return the array of hours within the specified time interval. + * @name isSaturday + * @category Weekday Helpers + * @summary Is the given date Saturday? * * @description - * Return the array of hours within the specified time interval. + * Is the given date Saturday? * - * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} - * @param {Object} [options] - an object with options. - * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1. - * @returns {Date[]} the array with starts of hours from the hour of the interval start to the hour of the interval end + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is Saturday * @throws {TypeError} 1 argument required - * @throws {RangeError} `options.step` must be a number greater than 1 - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * // Each hour between 6 October 2014, 12:00 and 6 October 2014, 15:00 - * var result = eachHourOfInterval({ - * start: new Date(2014, 9, 6, 12), - * end: new Date(2014, 9, 6, 15) - * }) - * //=> [ - * // Mon Oct 06 2014 12:00:00, - * // Mon Oct 06 2014 13:00:00, - * // Mon Oct 06 2014 14:00:00, - * // Mon Oct 06 2014 15:00:00 - * // ] + * // Is 27 September 2014 Saturday? + * const result = isSaturday(new Date(2014, 8, 27)) + * //=> true */ -function eachHourOfInterval(dirtyInterval, options) { - (0, _index3.default)(1, arguments); - var interval = dirtyInterval || {}; - var startDate = (0, _index2.default)(interval.start); - var endDate = (0, _index2.default)(interval.end); - var startTime = startDate.getTime(); - var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` +function isSaturday(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate).getDay() === 6; +} +module.exports = exports.default; - if (!(startTime <= endTime)) { - throw new RangeError('Invalid interval'); - } +/***/ }), - var dates = []; - var currentDate = startDate; - currentDate.setMinutes(0, 0, 0); - var step = options && 'step' in options ? Number(options.step) : 1; - if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1'); +/***/ 5852: +/***/ ((module, exports, __nccwpck_require__) => { - while (currentDate.getTime() <= endTime) { - dates.push((0, _index2.default)(currentDate)); - currentDate = (0, _index.default)(currentDate, step); - } +"use strict"; - return dates; -} +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isSunday; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isSunday + * @category Weekday Helpers + * @summary Is the given date Sunday? + * + * @description + * Is the given date Sunday? + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is Sunday + * @throws {TypeError} 1 argument required + * + * @example + * // Is 21 September 2014 Sunday? + * const result = isSunday(new Date(2014, 8, 21)) + * //=> true + */ +function isSunday(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate).getDay() === 0; +} module.exports = exports.default; /***/ }), -/* 439 */, -/* 440 */, -/* 441 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { + +/***/ 4078: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.shouldHighlight = shouldHighlight; -exports.getChalk = getChalk; -exports.default = highlight; +})); +exports["default"] = isThisHour; +var _index = _interopRequireDefault(__nccwpck_require__(2489)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isThisHour + * @category Hour Helpers + * @summary Is the given date in the same hour as the current date? + * @pure false + * + * @description + * Is the given date in the same hour as the current date? + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in this hour + * @throws {TypeError} 1 argument required + * + * @example + * // If now is 25 September 2014 18:30:15.500, + * // is 25 September 2014 18:00:00 in this hour? + * const result = isThisHour(new Date(2014, 8, 25, 18)) + * //=> true + */ +function isThisHour(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(Date.now(), dirtyDate); +} +module.exports = exports.default; + +/***/ }), -var _helperValidatorIdentifier = __webpack_require__(420); +/***/ 6065: +/***/ ((module, exports, __nccwpck_require__) => { -const jsTokens = __webpack_require__(735); +"use strict"; -const Chalk = __webpack_require__(406); -const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isThisISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(9852)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isThisISOWeek + * @category ISO Week Helpers + * @summary Is the given date in the same ISO week as the current date? + * @pure false + * + * @description + * Is the given date in the same ISO week as the current date? + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in this ISO week + * @throws {TypeError} 1 argument required + * + * @example + * // If today is 25 September 2014, is 22 September 2014 in this ISO week? + * const result = isThisISOWeek(new Date(2014, 8, 22)) + * //=> true + */ -function getDefs(chalk) { - return { - keyword: chalk.cyan, - capitalized: chalk.yellow, - jsxIdentifier: chalk.yellow, - punctuator: chalk.yellow, - number: chalk.magenta, - string: chalk.green, - regex: chalk.magenta, - comment: chalk.grey, - invalid: chalk.white.bgRed.bold - }; +function isThisISOWeek(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, Date.now()); } +module.exports = exports.default; -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -const BRACKET = /^[()[\]{}]$/; -let tokenize; -{ - const JSX_TAG = /^[a-z][\w-]*$/i; - - const getTokenType = function (token, offset, text) { - if (token.type === "name") { - if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) { - return "keyword"; - } +/***/ }), - if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " { - if (token.value[0] !== token.value[0].toLowerCase()) { - return "capitalized"; - } - } +"use strict"; - if (token.type === "punctuator" && BRACKET.test(token.value)) { - return "bracket"; - } - if (token.type === "invalid" && (token.value === "@" || token.value === "#")) { - return "punctuator"; - } - - return token.type; - }; - - tokenize = function* (text) { - let match; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isThisMinute; +var _index = _interopRequireDefault(__nccwpck_require__(3197)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isThisMinute + * @category Minute Helpers + * @summary Is the given date in the same minute as the current date? + * @pure false + * + * @description + * Is the given date in the same minute as the current date? + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in this minute + * @throws {TypeError} 1 argument required + * + * @example + * // If now is 25 September 2014 18:30:15.500, + * // is 25 September 2014 18:30:00 in this minute? + * const result = isThisMinute(new Date(2014, 8, 25, 18, 30)) + * //=> true + */ - while (match = jsTokens.default.exec(text)) { - const token = jsTokens.matchToToken(match); - yield { - type: getTokenType(token, match.index, text), - value: token.value - }; - } - }; +function isThisMinute(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(Date.now(), dirtyDate); } +module.exports = exports.default; -function highlightTokens(defs, text) { - let highlighted = ""; - - for (const { - type, - value - } of tokenize(text)) { - const colorize = defs[type]; +/***/ }), - if (colorize) { - highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n"); - } else { - highlighted += value; - } - } +/***/ 1157: +/***/ ((module, exports, __nccwpck_require__) => { - return highlighted; -} +"use strict"; -function shouldHighlight(options) { - return !!Chalk.supportsColor || options.forceColor; -} -function getChalk(options) { - return options.forceColor ? new Chalk.constructor({ - enabled: true, - level: 1 - }) : Chalk; -} +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isThisMonth; +var _index = _interopRequireDefault(__nccwpck_require__(5421)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isThisMonth + * @category Month Helpers + * @summary Is the given date in the same month as the current date? + * @pure false + * + * @description + * Is the given date in the same month as the current date? + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in this month + * @throws {TypeError} 1 argument required + * + * @example + * // If today is 25 September 2014, is 15 September 2014 in this month? + * const result = isThisMonth(new Date(2014, 8, 15)) + * //=> true + */ -function highlight(code, options = {}) { - if (shouldHighlight(options)) { - const chalk = getChalk(options); - const defs = getDefs(chalk); - return highlightTokens(defs, code); - } else { - return code; - } +function isThisMonth(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(Date.now(), dirtyDate); } +module.exports = exports.default; /***/ }), -/* 442 */, -/* 443 */, -/* 444 */, -/* 445 */, -/* 446 */, -/* 447 */, -/* 448 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5122: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = eachDayOfInterval; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isThisQuarter; +var _index = _interopRequireDefault(__nccwpck_require__(938)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name eachDayOfInterval - * @category Interval Helpers - * @summary Return the array of dates within the specified time interval. + * @name isThisQuarter + * @category Quarter Helpers + * @summary Is the given date in the same quarter as the current date? + * @pure false * * @description - * Return the array of dates within the specified time interval. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * - The function was renamed from `eachDay` to `eachDayOfInterval`. - * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology: - * - * ``` - * 2.1.3 - * time interval - * part of the time axis limited by two instants - * ``` - * - * Also, this function now accepts an object with `start` and `end` properties - * instead of two arguments as an interval. - * This function now throws `RangeError` if the start of the interval is after its end - * or if any date in the interval is `Invalid Date`. - * - * ```javascript - * // Before v2.0.0 - * - * eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20)) - * - * // v2.0.0 onward + * Is the given date in the same quarter as the current date? * - * eachDayOfInterval( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) } - * ) - * ``` + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. * - * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} - * @param {Object} [options] - an object with options. - * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1. - * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in this quarter * @throws {TypeError} 1 argument required - * @throws {RangeError} `options.step` must be a number greater than 1 - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * // Each day between 6 October 2014 and 10 October 2014: - * const result = eachDayOfInterval({ - * start: new Date(2014, 9, 6), - * end: new Date(2014, 9, 10) - * }) - * //=> [ - * // Mon Oct 06 2014 00:00:00, - * // Tue Oct 07 2014 00:00:00, - * // Wed Oct 08 2014 00:00:00, - * // Thu Oct 09 2014 00:00:00, - * // Fri Oct 10 2014 00:00:00 - * // ] + * // If today is 25 September 2014, is 2 July 2014 in this quarter? + * const result = isThisQuarter(new Date(2014, 6, 2)) + * //=> true */ -function eachDayOfInterval(dirtyInterval, options) { +function isThisQuarter(dirtyDate) { (0, _index2.default)(1, arguments); - var interval = dirtyInterval || {}; - var startDate = (0, _index.default)(interval.start); - var endDate = (0, _index.default)(interval.end); - var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` - - if (!(startDate.getTime() <= endTime)) { - throw new RangeError('Invalid interval'); - } - - var dates = []; - var currentDate = startDate; - currentDate.setHours(0, 0, 0, 0); - var step = options && 'step' in options ? Number(options.step) : 1; - if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1'); - - while (currentDate.getTime() <= endTime) { - dates.push((0, _index.default)(currentDate)); - currentDate.setDate(currentDate.getDate() + step); - currentDate.setHours(0, 0, 0, 0); - } - - return dates; + return (0, _index.default)(Date.now(), dirtyDate); } - module.exports = exports.default; /***/ }), -/* 449 */, -/* 450 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -const compare = __webpack_require__(164) -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq - - -/***/ }), -/* 451 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 4641: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = startOfQuarter; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = isThisSecond; +var _index = _interopRequireDefault(__nccwpck_require__(1988)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name startOfQuarter - * @category Quarter Helpers - * @summary Return the start of a year quarter for the given date. + * @name isThisSecond + * @category Second Helpers + * @summary Is the given date in the same second as the current date? + * @pure false * * @description - * Return the start of a year quarter for the given date. - * The result will be in the local timezone. - * - * ### v2.0.0 breaking changes: + * Is the given date in the same second as the current date? * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. * - * @param {Date|Number} date - the original date - * @returns {Date} the start of a quarter + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in this second * @throws {TypeError} 1 argument required * * @example - * // The start of a quarter for 2 September 2014 11:55:00: - * const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Jul 01 2014 00:00:00 + * // If now is 25 September 2014 18:30:15.500, + * // is 25 September 2014 18:30:15.000 in this second? + * const result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15)) + * //=> true */ -function startOfQuarter(dirtyDate) { +function isThisSecond(dirtyDate) { (0, _index2.default)(1, arguments); - var date = (0, _index.default)(dirtyDate); - var currentMonth = date.getMonth(); - var month = currentMonth - currentMonth % 3; - date.setMonth(month, 1); - date.setHours(0, 0, 0, 0); - return date; + return (0, _index.default)(Date.now(), dirtyDate); } - module.exports = exports.default; /***/ }), -/* 452 */, -/* 453 */, -/* 454 */, -/* 455 */, -/* 456 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + +/***/ 2373: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -const cp = __webpack_require__(129); -const parse = __webpack_require__(211); -const enoent = __webpack_require__(235); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isThisWeek; +var _index = _interopRequireDefault(__nccwpck_require__(7013)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isThisWeek + * @category Week Helpers + * @summary Is the given date in the same week as the current date? + * @pure false + * + * @description + * Is the given date in the same week as the current date? + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the date to check + * @param {Object} [options] - the object with options + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Boolean} the date is in this week + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * + * @example + * // If today is 25 September 2014, is 21 September 2014 in this week? + * const result = isThisWeek(new Date(2014, 8, 21)) + * //=> true + * + * @example + * // If today is 25 September 2014 and week starts with Monday + * // is 21 September 2014 in this week? + * const result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 }) + * //=> false + */ -function spawn(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); +function isThisWeek(dirtyDate, options) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, Date.now(), options); +} +module.exports = exports.default; - // Spawn the child process - const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); +/***/ }), - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); +/***/ 856: +/***/ ((module, exports, __nccwpck_require__) => { - return spawned; -} +"use strict"; -function spawnSync(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); - // Spawn the child process - const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isThisYear; +var _index = _interopRequireDefault(__nccwpck_require__(9821)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isThisYear + * @category Year Helpers + * @summary Is the given date in the same year as the current date? + * @pure false + * + * @description + * Is the given date in the same year as the current date? + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is in this year + * @throws {TypeError} 1 argument required + * + * @example + * // If today is 25 September 2014, is 2 July 2014 in this year? + * const result = isThisYear(new Date(2014, 6, 2)) + * //=> true + */ +function isThisYear(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, Date.now()); +} +module.exports = exports.default; - // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); +/***/ }), - return result; -} +/***/ 4350: +/***/ ((module, exports, __nccwpck_require__) => { -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; +"use strict"; -module.exports._parse = parse; -module.exports._enoent = enoent; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isThursday; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isThursday + * @category Weekday Helpers + * @summary Is the given date Thursday? + * + * @description + * Is the given date Thursday? + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is Thursday + * @throws {TypeError} 1 argument required + * + * @example + * // Is 25 September 2014 Thursday? + * const result = isThursday(new Date(2014, 8, 25)) + * //=> true + */ +function isThursday(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate).getDay() === 4; +} +module.exports = exports.default; /***/ }), -/* 457 */, -/* 458 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7185: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInHours; +})); +exports["default"] = isToday; +var _index = _interopRequireDefault(__nccwpck_require__(2154)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isToday + * @category Day Helpers + * @summary Is the given date today? + * @pure false + * + * @description + * Is the given date today? + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is today + * @throws {TypeError} 1 argument required + * + * @example + * // If today is 6 October 2014, is 6 October 14:00:00 today? + * const result = isToday(new Date(2014, 9, 6, 14, 0)) + * //=> true + */ +function isToday(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, Date.now()); +} +module.exports = exports.default; + +/***/ }), -var _index = _interopRequireDefault(__webpack_require__(647)); +/***/ 3014: +/***/ ((module, exports, __nccwpck_require__) => { -var _index2 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var MILLISECONDS_IN_HOUR = 3600000; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isTomorrow; +var _index = _interopRequireDefault(__nccwpck_require__(6227)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2154)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name differenceInHours - * @category Hour Helpers - * @summary Get the number of hours between the given dates. + * @name isTomorrow + * @category Day Helpers + * @summary Is the given date tomorrow? + * @pure false * * @description - * Get the number of hours between the given dates. - * - * ### v2.0.0 breaking changes: + * Is the given date tomorrow? * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of hours - * @throws {TypeError} 2 arguments required + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is tomorrow + * @throws {TypeError} 1 argument required * * @example - * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00? - * var result = differenceInHours( - * new Date(2014, 6, 2, 19, 0), - * new Date(2014, 6, 2, 6, 50) - * ) - * //=> 12 + * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow? + * const result = isTomorrow(new Date(2014, 9, 7, 14, 0)) + * //=> true */ - -function differenceInHours(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - var diff = (0, _index.default)(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_HOUR; - return diff > 0 ? Math.floor(diff) : Math.ceil(diff); +function isTomorrow(dirtyDate) { + (0, _index3.default)(1, arguments); + return (0, _index2.default)(dirtyDate, (0, _index.default)(Date.now(), 1)); } - module.exports = exports.default; /***/ }), -/* 459 */, -/* 460 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -const SemVer = __webpack_require__(653) +/***/ 8235: +/***/ ((module, exports, __nccwpck_require__) => { -const inc = (version, release, options, identifier) => { - if (typeof (options) === 'string') { - identifier = options - options = undefined - } +"use strict"; - try { - return new SemVer(version, options).inc(release, identifier).version - } catch (er) { - return null - } -} -module.exports = inc +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isTuesday; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isTuesday + * @category Weekday Helpers + * @summary Is the given date Tuesday? + * + * @description + * Is the given date Tuesday? + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is Tuesday + * @throws {TypeError} 1 argument required + * + * @example + * // Is 23 September 2014 Tuesday? + * const result = isTuesday(new Date(2014, 8, 23)) + * //=> true + */ +function isTuesday(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate).getDay() === 2; +} +module.exports = exports.default; /***/ }), -/* 461 */, -/* 462 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 9920: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = void 0; +})); +exports["default"] = isValid; +var _index = _interopRequireDefault(__nccwpck_require__(6801)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isValid + * @category Common Helpers + * @summary Is the given date valid? + * + * @description + * Returns false if argument is Invalid Date and true otherwise. + * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * Invalid Date is a Date, whose time value is NaN. + * + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param {*} date - the date to check + * @returns {Boolean} the date is valid + * @throws {TypeError} 1 argument required + * + * @example + * // For the valid date: + * const result = isValid(new Date(2014, 1, 31)) + * //=> true + * + * @example + * // For the value, convertable into a date: + * const result = isValid(1393804800000) + * //=> true + * + * @example + * // For the invalid date: + * const result = isValid(new Date('')) + * //=> false + */ +function isValid(dirtyDate) { + (0, _index3.default)(1, arguments); + if (!(0, _index.default)(dirtyDate) && typeof dirtyDate !== 'number') { + return false; + } + var date = (0, _index2.default)(dirtyDate); + return !isNaN(Number(date)); +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(229)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(664)); +/***/ 9218: +/***/ ((module, exports, __nccwpck_require__) => { -var _index3 = _interopRequireDefault(__webpack_require__(281)); +"use strict"; -var _index4 = _interopRequireDefault(__webpack_require__(230)); -var _index5 = _interopRequireDefault(__webpack_require__(1)); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isWednesday; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isWednesday + * @category Weekday Helpers + * @summary Is the given date Wednesday? + * + * @description + * Is the given date Wednesday? + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is Wednesday + * @throws {TypeError} 1 argument required + * + * @example + * // Is 24 September 2014 Wednesday? + * const result = isWednesday(new Date(2014, 8, 24)) + * //=> true + */ +function isWednesday(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate).getDay() === 3; +} +module.exports = exports.default; -var _index6 = _interopRequireDefault(__webpack_require__(63)); +/***/ }), -var _index7 = _interopRequireDefault(__webpack_require__(35)); +/***/ 403: +/***/ ((module, exports, __nccwpck_require__) => { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; -var MILLISECONDS_IN_HOUR = 3600000; -var MILLISECONDS_IN_MINUTE = 60000; -var MILLISECONDS_IN_SECOND = 1000; -var numericPatterns = { - month: /^(1[0-2]|0?\d)/, - // 0 to 12 - date: /^(3[0-1]|[0-2]?\d)/, - // 0 to 31 - dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, - // 0 to 366 - week: /^(5[0-3]|[0-4]?\d)/, - // 0 to 53 - hour23h: /^(2[0-3]|[0-1]?\d)/, - // 0 to 23 - hour24h: /^(2[0-4]|[0-1]?\d)/, - // 0 to 24 - hour11h: /^(1[0-1]|0?\d)/, - // 0 to 11 - hour12h: /^(1[0-2]|0?\d)/, - // 0 to 12 - minute: /^[0-5]?\d/, - // 0 to 59 - second: /^[0-5]?\d/, - // 0 to 59 - singleDigit: /^\d/, - // 0 to 9 - twoDigits: /^\d{1,2}/, - // 0 to 99 - threeDigits: /^\d{1,3}/, - // 0 to 999 - fourDigits: /^\d{1,4}/, - // 0 to 9999 - anyDigitsSigned: /^-?\d+/, - singleDigitSigned: /^-?\d/, - // 0 to 9, -0 to -9 - twoDigitsSigned: /^-?\d{1,2}/, - // 0 to 99, -0 to -99 - threeDigitsSigned: /^-?\d{1,3}/, - // 0 to 999, -0 to -999 - fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999 - -}; -var timezonePatterns = { - basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, - basic: /^([+-])(\d{2})(\d{2})|Z/, - basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, - extended: /^([+-])(\d{2}):(\d{2})|Z/, - extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/ -}; - -function parseNumericPattern(pattern, string, valueCallback) { - var matchResult = string.match(pattern); - if (!matchResult) { - return null; - } - - var value = parseInt(matchResult[0], 10); - return { - value: valueCallback ? valueCallback(value) : value, - rest: string.slice(matchResult[0].length) - }; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isWeekend; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isWeekend + * @category Weekday Helpers + * @summary Does the given date fall on a weekend? + * + * @description + * Does the given date fall on a weekend? + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date falls on a weekend + * @throws {TypeError} 1 argument required + * + * @example + * // Does 5 October 2014 fall on a weekend? + * const result = isWeekend(new Date(2014, 9, 5)) + * //=> true + */ +function isWeekend(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var day = date.getDay(); + return day === 0 || day === 6; } +module.exports = exports.default; -function parseTimezonePattern(pattern, string) { - var matchResult = string.match(pattern); +/***/ }), - if (!matchResult) { - return null; - } // Input is 'Z' +/***/ 4419: +/***/ ((module, exports, __nccwpck_require__) => { +"use strict"; - if (matchResult[0] === 'Z') { - return { - value: 0, - rest: string.slice(1) - }; - } - var sign = matchResult[1] === '+' ? 1 : -1; - var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0; - var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0; - var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0; - return { - value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND), - rest: string.slice(matchResult[0].length) - }; -} +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isWithinInterval; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isWithinInterval + * @category Interval Helpers + * @summary Is the given date within the interval? + * + * @description + * Is the given date within the interval? (Including start and end.) + * + * @param {Date|Number} date - the date to check + * @param {Interval} interval - the interval to check + * @returns {Boolean} the date is within the interval + * @throws {TypeError} 2 arguments required + * @throws {RangeError} The start of an interval cannot be after its end + * @throws {RangeError} Date in interval cannot be `Invalid Date` + * + * @example + * // For the date within the interval: + * isWithinInterval(new Date(2014, 0, 3), { + * start: new Date(2014, 0, 1), + * end: new Date(2014, 0, 7) + * }) + * //=> true + * + * @example + * // For the date outside of the interval: + * isWithinInterval(new Date(2014, 0, 10), { + * start: new Date(2014, 0, 1), + * end: new Date(2014, 0, 7) + * }) + * //=> false + * + * @example + * // For date equal to interval start: + * isWithinInterval(date, { start, end: date }) // => true + * + * @example + * // For date equal to interval end: + * isWithinInterval(date, { start: date, end }) // => true + */ +function isWithinInterval(dirtyDate, interval) { + (0, _index2.default)(2, arguments); + var time = (0, _index.default)(dirtyDate).getTime(); + var startTime = (0, _index.default)(interval.start).getTime(); + var endTime = (0, _index.default)(interval.end).getTime(); -function parseAnyDigitsSigned(string, valueCallback) { - return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback); + // Throw an exception if start date is after end date or if any date is `Invalid Date` + if (!(startTime <= endTime)) { + throw new RangeError('Invalid interval'); + } + return time >= startTime && time <= endTime; } +module.exports = exports.default; -function parseNDigits(n, string, valueCallback) { - switch (n) { - case 1: - return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback); +/***/ }), - case 2: - return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback); +/***/ 9583: +/***/ ((module, exports, __nccwpck_require__) => { - case 3: - return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback); +"use strict"; - case 4: - return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback); - default: - return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), string, valueCallback); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = isYesterday; +var _index = _interopRequireDefault(__nccwpck_require__(2154)); +var _index2 = _interopRequireDefault(__nccwpck_require__(970)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name isYesterday + * @category Day Helpers + * @summary Is the given date yesterday? + * @pure false + * + * @description + * Is the given date yesterday? + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @param {Date|Number} date - the date to check + * @returns {Boolean} the date is yesterday + * @throws {TypeError} 1 argument required + * + * @example + * // If today is 6 October 2014, is 5 October 14:00:00 yesterday? + * const result = isYesterday(new Date(2014, 9, 5, 14, 0)) + * //=> true + */ +function isYesterday(dirtyDate) { + (0, _index3.default)(1, arguments); + return (0, _index.default)(dirtyDate, (0, _index2.default)(Date.now(), 1)); } +module.exports = exports.default; -function parseNDigitsSigned(n, string, valueCallback) { - switch (n) { - case 1: - return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback); +/***/ }), - case 2: - return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback); +/***/ 4864: +/***/ ((module, exports, __nccwpck_require__) => { - case 3: - return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback); +"use strict"; - case 4: - return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback); - default: - return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), string, valueCallback); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = lastDayOfDecade; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name lastDayOfDecade + * @category Decade Helpers + * @summary Return the last day of a decade for the given date. + * + * @description + * Return the last day of a decade for the given date. + * + * @param {Date|Number} date - the original date + * @returns {Date} the last day of a decade + * @throws {TypeError} 1 argument required + * + * @example + * // The last day of a decade for 21 December 2012 21:12:00: + * const result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00)) + * //=> Wed Dec 31 2019 00:00:00 + */ +function lastDayOfDecade(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getFullYear(); + var decade = 9 + Math.floor(year / 10) * 10; + date.setFullYear(decade + 1, 0, 0); + date.setHours(0, 0, 0, 0); + return date; } +module.exports = exports.default; -function dayPeriodEnumToHours(enumValue) { - switch (enumValue) { - case 'morning': - return 4; +/***/ }), - case 'evening': - return 17; +/***/ 7692: +/***/ ((module, exports, __nccwpck_require__) => { - case 'pm': - case 'noon': - case 'afternoon': - return 12; +"use strict"; - case 'am': - case 'midnight': - case 'night': - default: - return 0; - } -} -function normalizeTwoDigitYear(twoDigitYear, currentYear) { - var isCommonEra = currentYear > 0; // Absolute number of the current year: - // 1 -> 1 AC - // 0 -> 1 BC - // -1 -> 2 BC +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = lastDayOfISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(666)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name lastDayOfISOWeek + * @category ISO Week Helpers + * @summary Return the last day of an ISO week for the given date. + * + * @description + * Return the last day of an ISO week for the given date. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the original date + * @returns {Date} the last day of an ISO week + * @throws {TypeError} 1 argument required + * + * @example + * // The last day of an ISO week for 2 September 2014 11:55:00: + * const result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sun Sep 07 2014 00:00:00 + */ +function lastDayOfISOWeek(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, { + weekStartsOn: 1 + }); +} +module.exports = exports.default; - var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear; - var result; +/***/ }), - if (absCurrentYear <= 50) { - result = twoDigitYear || 100; - } else { - var rangeEnd = absCurrentYear + 50; - var rangeEndCentury = Math.floor(rangeEnd / 100) * 100; - var isPreviousCentury = twoDigitYear >= rangeEnd % 100; - result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0); - } +/***/ 217: +/***/ ((module, exports, __nccwpck_require__) => { - return isCommonEra ? result : 1 - result; -} +"use strict"; -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]; // User for validation -function isLeapYearIndex(year) { - return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; -} -/* - * | | Unit | | Unit | - * |-----|--------------------------------|-----|--------------------------------| - * | a | AM, PM | A* | Milliseconds in day | - * | b | AM, PM, noon, midnight | B | Flexible day period | - * | c | Stand-alone local day of week | C* | Localized hour w/ day period | - * | d | Day of month | D | Day of year | - * | e | Local day of week | E | Day of week | - * | f | | F* | Day of week in month | - * | g* | Modified Julian day | G | Era | - * | h | Hour [1-12] | H | Hour [0-23] | - * | i! | ISO day of week | I! | ISO week of year | - * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | - * | k | Hour [1-24] | K | Hour [0-11] | - * | l* | (deprecated) | L | Stand-alone month | - * | m | Minute | M | Month | - * | n | | N | | - * | o! | Ordinal number modifier | O* | Timezone (GMT) | - * | p | | P | | - * | q | Stand-alone quarter | Q | Quarter | - * | r* | Related Gregorian year | R! | ISO week-numbering year | - * | s | Second | S | Fraction of second | - * | t! | Seconds timestamp | T! | Milliseconds timestamp | - * | u | Extended year | U* | Cyclic year | - * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | - * | w | Local week of year | W* | Week of month | - * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | - * | y | Year (abs) | Y | Local week-numbering year | - * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) | +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = lastDayOfISOWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(6991)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6307)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name lastDayOfISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Return the last day of an ISO week-numbering year for the given date. * - * Letters marked by * are not implemented but reserved by Unicode standard. + * @description + * Return the last day of an ISO week-numbering year, + * which always starts 3 days before the year's first Thursday. + * The result will be in the local timezone. * - * Letters marked by ! are non-standard, but implemented by date-fns: - * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs) - * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, - * i.e. 7 for Sunday, 1 for Monday, etc. - * - `I` is ISO week of year, as opposed to `w` which is local week of year. - * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. - * `R` is supposed to be used in conjunction with `I` and `i` - * for universal ISO week-numbering date, whereas - * `Y` is supposed to be used in conjunction with `w` and `e` - * for week-numbering date specific to the locale. + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of an ISO week-numbering year + * @throws {TypeError} 1 argument required + * + * @example + * // The last day of an ISO week-numbering year for 2 July 2005: + * const result = lastDayOfISOWeekYear(new Date(2005, 6, 2)) + * //=> Sun Jan 01 2006 00:00:00 */ +function lastDayOfISOWeekYear(dirtyDate) { + (0, _index3.default)(1, arguments); + var year = (0, _index.default)(dirtyDate); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setFullYear(year + 1, 0, 4); + fourthOfJanuary.setHours(0, 0, 0, 0); + var date = (0, _index2.default)(fourthOfJanuary); + date.setDate(date.getDate() - 1); + return date; +} +module.exports = exports.default; +/***/ }), -var parsers = { - // Era - G: { - priority: 140, - parse: function (string, token, match, _options) { - switch (token) { - // AD, BC - case 'G': - case 'GG': - case 'GGG': - return match.era(string, { - width: 'abbreviated' - }) || match.era(string, { - width: 'narrow' - }); - // A, B - - case 'GGGGG': - return match.era(string, { - width: 'narrow' - }); - // Anno Domini, Before Christ - - case 'GGGG': - default: - return match.era(string, { - width: 'wide' - }) || match.era(string, { - width: 'abbreviated' - }) || match.era(string, { - width: 'narrow' - }); - } - }, - set: function (date, flags, value, _options) { - flags.era = value; - date.setUTCFullYear(value, 0, 1); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['R', 'u', 't', 'T'] - }, - // Year - y: { - // 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 | - priority: 130, - parse: function (string, token, match, _options) { - var valueCallback = function (year) { - return { - year: year, - isTwoDigitYear: token === 'yy' - }; - }; +/***/ 3346: +/***/ ((module, exports, __nccwpck_require__) => { - switch (token) { - case 'y': - return parseNDigits(4, string, valueCallback); +"use strict"; - case 'yo': - return match.ordinalNumber(string, { - unit: 'year', - valueCallback: valueCallback - }); - default: - return parseNDigits(token.length, string, valueCallback); - } - }, - validate: function (_date, value, _options) { - return value.isTwoDigitYear || value.year > 0; - }, - set: function (date, flags, value, _options) { - var currentYear = date.getUTCFullYear(); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = lastDayOfMonth; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name lastDayOfMonth + * @category Month Helpers + * @summary Return the last day of a month for the given date. + * + * @description + * Return the last day of a month for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the last day of a month + * @throws {TypeError} 1 argument required + * + * @example + * // The last day of a month for 2 September 2014 11:55:00: + * const result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 00:00:00 + */ +function lastDayOfMonth(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var month = date.getMonth(); + date.setFullYear(date.getFullYear(), month + 1, 0); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - if (value.isTwoDigitYear) { - var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear); - date.setUTCFullYear(normalizedTwoDigitYear, 0, 1); - date.setUTCHours(0, 0, 0, 0); - return date; - } +/***/ }), - var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year; - date.setUTCFullYear(year, 0, 1); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T'] - }, - // Local week-numbering year - Y: { - priority: 130, - parse: function (string, token, match, _options) { - var valueCallback = function (year) { - return { - year: year, - isTwoDigitYear: token === 'YY' - }; - }; +/***/ 8635: +/***/ ((module, exports, __nccwpck_require__) => { - switch (token) { - case 'Y': - return parseNDigits(4, string, valueCallback); +"use strict"; - case 'Yo': - return match.ordinalNumber(string, { - unit: 'year', - valueCallback: valueCallback - }); - default: - return parseNDigits(token.length, string, valueCallback); - } - }, - validate: function (_date, value, _options) { - return value.isTwoDigitYear || value.year > 0; - }, - set: function (date, flags, value, options) { - var currentYear = (0, _index.default)(date, options); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = lastDayOfQuarter; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name lastDayOfQuarter + * @category Quarter Helpers + * @summary Return the last day of a year quarter for the given date. + * + * @description + * Return the last day of a year quarter for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @param {Object} [options] - an object with options. + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the last day of a quarter + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // The last day of a quarter for 2 September 2014 11:55:00: + * const result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 30 2014 00:00:00 + */ +function lastDayOfQuarter(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var currentMonth = date.getMonth(); + var month = currentMonth - currentMonth % 3 + 3; + date.setMonth(month, 0); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - if (value.isTwoDigitYear) { - var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear); - date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate); - date.setUTCHours(0, 0, 0, 0); - return (0, _index7.default)(date, options); - } +/***/ }), - var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year; - date.setUTCFullYear(year, 0, options.firstWeekContainsDate); - date.setUTCHours(0, 0, 0, 0); - return (0, _index7.default)(date, options); - }, - incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'] - }, - // ISO week-numbering year - R: { - priority: 130, - parse: function (string, token, _match, _options) { - if (token === 'R') { - return parseNDigitsSigned(4, string); - } +/***/ 666: +/***/ ((module, exports, __nccwpck_require__) => { - return parseNDigitsSigned(token.length, string); - }, - set: function (_date, _flags, value, _options) { - var firstWeekOfYear = new Date(0); - firstWeekOfYear.setUTCFullYear(value, 0, 4); - firstWeekOfYear.setUTCHours(0, 0, 0, 0); - return (0, _index6.default)(firstWeekOfYear); - }, - incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'] - }, - // Extended year - u: { - priority: 130, - parse: function (string, token, _match, _options) { - if (token === 'u') { - return parseNDigitsSigned(4, string); - } +"use strict"; - return parseNDigitsSigned(token.length, string); - }, - set: function (date, _flags, value, _options) { - date.setUTCFullYear(value, 0, 1); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T'] - }, - // Quarter - Q: { - priority: 120, - parse: function (string, token, match, _options) { - switch (token) { - // 1, 2, 3, 4 - case 'Q': - case 'QQ': - // 01, 02, 03, 04 - return parseNDigits(token.length, string); - // 1st, 2nd, 3rd, 4th - case 'Qo': - return match.ordinalNumber(string, { - unit: 'quarter' - }); - // Q1, Q2, Q3, Q4 +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = lastDayOfWeek; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index4 = __nccwpck_require__(9307); +/** + * @name lastDayOfWeek + * @category Week Helpers + * @summary Return the last day of a week for the given date. + * + * @description + * Return the last day of a week for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Date} the last day of a week + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * + * @example + * // The last day of a week for 2 September 2014 11:55:00: + * const result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sat Sep 06 2014 00:00:00 + * + * @example + * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00: + * const result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) + * //=> Sun Sep 07 2014 00:00:00 + */ +function lastDayOfWeek(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index3.default)(1, arguments); + var defaultOptions = (0, _index4.getDefaultOptions)(); + var weekStartsOn = (0, _index2.default)((_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); - case 'QQQ': - return match.quarter(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.quarter(string, { - width: 'narrow', - context: 'formatting' - }); - // 1, 2, 3, 4 (narrow quarter; could be not numerical) + // 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'); + } + var date = (0, _index.default)(dirtyDate); + var day = date.getDay(); + var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); + date.setHours(0, 0, 0, 0); + date.setDate(date.getDate() + diff); + return date; +} +module.exports = exports.default; - case 'QQQQQ': - return match.quarter(string, { - width: 'narrow', - context: 'formatting' - }); - // 1st quarter, 2nd quarter, ... +/***/ }), - case 'QQQQ': - default: - return match.quarter(string, { - width: 'wide', - context: 'formatting' - }) || match.quarter(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.quarter(string, { - width: 'narrow', - context: 'formatting' - }); - } - }, - validate: function (_date, value, _options) { - return value >= 1 && value <= 4; - }, - set: function (date, _flags, value, _options) { - date.setUTCMonth((value - 1) * 3, 1); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'] - }, - // Stand-alone quarter - q: { - priority: 120, - parse: function (string, token, match, _options) { - switch (token) { - // 1, 2, 3, 4 - case 'q': - case 'qq': - // 01, 02, 03, 04 - return parseNDigits(token.length, string); - // 1st, 2nd, 3rd, 4th +/***/ 9771: +/***/ ((module, exports, __nccwpck_require__) => { - case 'qo': - return match.ordinalNumber(string, { - unit: 'quarter' - }); - // Q1, Q2, Q3, Q4 +"use strict"; - case 'qqq': - return match.quarter(string, { - width: 'abbreviated', - context: 'standalone' - }) || match.quarter(string, { - width: 'narrow', - context: 'standalone' - }); - // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case 'qqqqq': - return match.quarter(string, { - width: 'narrow', - context: 'standalone' - }); - // 1st quarter, 2nd quarter, ... +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = lastDayOfYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name lastDayOfYear + * @category Year Helpers + * @summary Return the last day of a year for the given date. + * + * @description + * Return the last day of a year for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the last day of a year + * @throws {TypeError} 1 argument required + * + * @example + * // The last day of a year for 2 September 2014 11:55:00: + * const result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00)) + * //=> Wed Dec 31 2014 00:00:00 + */ +function lastDayOfYear(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getFullYear(); + date.setFullYear(year + 1, 0, 0); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - case 'qqqq': - default: - return match.quarter(string, { - width: 'wide', - context: 'standalone' - }) || match.quarter(string, { - width: 'abbreviated', - context: 'standalone' - }) || match.quarter(string, { - width: 'narrow', - context: 'standalone' - }); - } - }, - validate: function (_date, value, _options) { - return value >= 1 && value <= 4; - }, - set: function (date, _flags, value, _options) { - date.setUTCMonth((value - 1) * 3, 1); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T'] - }, - // Month - M: { - priority: 110, - parse: function (string, token, match, _options) { - var valueCallback = function (value) { - return value - 1; - }; +/***/ }), - switch (token) { - // 1, 2, ..., 12 - case 'M': - return parseNumericPattern(numericPatterns.month, string, valueCallback); - // 01, 02, ..., 12 +/***/ 4018: +/***/ ((module, exports, __nccwpck_require__) => { - case 'MM': - return parseNDigits(2, string, valueCallback); - // 1st, 2nd, ..., 12th +"use strict"; - case 'Mo': - return match.ordinalNumber(string, { - unit: 'month', - valueCallback: valueCallback - }); - // Jan, Feb, ..., Dec - case 'MMM': - return match.month(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.month(string, { - width: 'narrow', - context: 'formatting' - }); - // J, F, ..., D +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = lightFormat; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(289)); +var _index3 = _interopRequireDefault(__nccwpck_require__(7032)); +var _index4 = _interopRequireDefault(__nccwpck_require__(9920)); +var _index5 = _interopRequireDefault(__nccwpck_require__(7923)); +var _index6 = _interopRequireDefault(__nccwpck_require__(2063)); +// This RegExp consists of three parts separated by `|`: +// - (\w)\1* matches any sequences of the same letter +// - '' matches two quote characters in a row +// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), +// except a single quote symbol, which ends the sequence. +// Two quote characters do not end the sequence. +// 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 = /(\w)\1*|''|'(''|[^'])+('|$)|./g; +var escapedStringRegExp = /^'([^]*?)'?$/; +var doubleQuoteRegExp = /''/g; +var unescapedLatinCharacterRegExp = /[a-zA-Z]/; - case 'MMMMM': - return match.month(string, { - width: 'narrow', - context: 'formatting' - }); - // January, February, ..., December +/** + * @name lightFormat + * @category Common Helpers + * @summary Format the date. + * + * @description + * Return the formatted date string in the given format. Unlike `format`, + * `lightFormat` doesn't use locales and outputs date using the most popular tokens. + * + * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries. + * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * The characters wrapped between two single quotes characters (') are escaped. + * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. + * + * Format of the string is based on Unicode Technical Standard #35: + * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table + * + * Accepted patterns: + * | Unit | Pattern | Result examples | + * |---------------------------------|---------|-----------------------------------| + * | AM, PM | a..aaa | AM, PM | + * | | aaaa | a.m., p.m. | + * | | aaaaa | a, p | + * | Calendar year | y | 44, 1, 1900, 2017 | + * | | yy | 44, 01, 00, 17 | + * | | yyy | 044, 001, 000, 017 | + * | | yyyy | 0044, 0001, 1900, 2017 | + * | Month (formatting) | M | 1, 2, ..., 12 | + * | | MM | 01, 02, ..., 12 | + * | Day of month | d | 1, 2, ..., 31 | + * | | dd | 01, 02, ..., 31 | + * | Hour [1-12] | h | 1, 2, ..., 11, 12 | + * | | hh | 01, 02, ..., 11, 12 | + * | Hour [0-23] | H | 0, 1, 2, ..., 23 | + * | | HH | 00, 01, 02, ..., 23 | + * | Minute | m | 0, 1, ..., 59 | + * | | mm | 00, 01, ..., 59 | + * | Second | s | 0, 1, ..., 59 | + * | | ss | 00, 01, ..., 59 | + * | Fraction of second | S | 0, 1, ..., 9 | + * | | SS | 00, 01, ..., 99 | + * | | SSS | 000, 001, ..., 999 | + * | | SSSS | ... | + * + * @param {Date|Number} date - the original date + * @param {String} format - the string of tokens + * @returns {String} the formatted date string + * @throws {TypeError} 2 arguments required + * @throws {RangeError} format string contains an unescaped latin alphabet character + * + * @example + * const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd') + * //=> '2014-02-11' + */ - case 'MMMM': - default: - return match.month(string, { - width: 'wide', - context: 'formatting' - }) || match.month(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.month(string, { - width: 'narrow', - context: 'formatting' - }); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 11; - }, - set: function (date, _flags, value, _options) { - date.setUTCMonth(value, 1); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'] - }, - // Stand-alone month - L: { - priority: 110, - parse: function (string, token, match, _options) { - var valueCallback = function (value) { - return value - 1; - }; +function lightFormat(dirtyDate, formatStr) { + (0, _index6.default)(2, arguments); + var originalDate = (0, _index.default)(dirtyDate); + if (!(0, _index4.default)(originalDate)) { + throw new RangeError('Invalid time value'); + } - switch (token) { - // 1, 2, ..., 12 - case 'L': - return parseNumericPattern(numericPatterns.month, string, valueCallback); - // 01, 02, ..., 12 + // 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 = (0, _index3.default)(originalDate); + var utcDate = (0, _index5.default)(originalDate, timezoneOffset); + var tokens = formatStr.match(formattingTokensRegExp); - case 'LL': - return parseNDigits(2, string, valueCallback); - // 1st, 2nd, ..., 12th + // The only case when formattingTokensRegExp doesn't match the string is when it's empty + if (!tokens) return ''; + var result = tokens.map(function (substring) { + // Replace two single quote characters with one single quote character + if (substring === "''") { + return "'"; + } + var firstCharacter = substring[0]; + if (firstCharacter === "'") { + return cleanEscapedString(substring); + } + var formatter = _index2.default[firstCharacter]; + if (formatter) { + return formatter(utcDate, substring); + } + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { + throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); + } + return substring; + }).join(''); + return result; +} +function cleanEscapedString(input) { + var matches = input.match(escapedStringRegExp); + if (!matches) { + return input; + } + return matches[1].replace(doubleQuoteRegExp, "'"); +} +module.exports = exports.default; - case 'Lo': - return match.ordinalNumber(string, { - unit: 'month', - valueCallback: valueCallback - }); - // Jan, Feb, ..., Dec +/***/ }), - case 'LLL': - return match.month(string, { - width: 'abbreviated', - context: 'standalone' - }) || match.month(string, { - width: 'narrow', - context: 'standalone' - }); - // J, F, ..., D +/***/ 1244: +/***/ ((module, exports) => { - case 'LLLLL': - return match.month(string, { - width: 'narrow', - context: 'standalone' - }); - // January, February, ..., December +"use strict"; - case 'LLLL': - default: - return match.month(string, { - width: 'wide', - context: 'standalone' - }) || match.month(string, { - width: 'abbreviated', - context: 'standalone' - }) || match.month(string, { - width: 'narrow', - context: 'standalone' - }); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 11; - }, - set: function (date, _flags, value, _options) { - date.setUTCMonth(value, 1); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'] - }, - // Local week of year - w: { - priority: 100, - parse: function (string, token, match, _options) { - switch (token) { - case 'w': - return parseNumericPattern(numericPatterns.week, string); - case 'wo': - return match.ordinalNumber(string, { - unit: 'week' - }); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = buildFormatLongFn; +function buildFormatLongFn(args) { + return function () { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + // TODO: Remove String() + var width = options.width ? String(options.width) : args.defaultWidth; + var format = args.formats[width] || args.formats[args.defaultWidth]; + return format; + }; +} +module.exports = exports.default; - default: - return parseNDigits(token.length, string); - } - }, - validate: function (_date, value, _options) { - return value >= 1 && value <= 53; - }, - set: function (date, _flags, value, options) { - return (0, _index7.default)((0, _index5.default)(date, value, options), options); - }, - incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T'] - }, - // ISO week of year - I: { - priority: 100, - parse: function (string, token, match, _options) { - switch (token) { - case 'I': - return parseNumericPattern(numericPatterns.week, string); +/***/ }), - case 'Io': - return match.ordinalNumber(string, { - unit: 'week' - }); +/***/ 3647: +/***/ ((module, exports) => { - default: - return parseNDigits(token.length, string); - } - }, - validate: function (_date, value, _options) { - return value >= 1 && value <= 53; - }, - set: function (date, _flags, value, options) { - return (0, _index6.default)((0, _index4.default)(date, value, options), options); - }, - incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T'] - }, - // Day of the month - d: { - priority: 90, - subPriority: 1, - parse: function (string, token, match, _options) { - switch (token) { - case 'd': - return parseNumericPattern(numericPatterns.date, string); +"use strict"; - case 'do': - return match.ordinalNumber(string, { - unit: 'date' - }); - default: - return parseNDigits(token.length, string); - } - }, - validate: function (date, value, _options) { - var year = date.getUTCFullYear(); - var isLeapYear = isLeapYearIndex(year); - var month = date.getUTCMonth(); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = buildLocalizeFn; +function buildLocalizeFn(args) { + return function (dirtyIndex, options) { + var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone'; + var valuesArray; + if (context === 'formatting' && args.formattingValues) { + var defaultWidth = args.defaultFormattingWidth || args.defaultWidth; + var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth; + valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; + } else { + var _defaultWidth = args.defaultWidth; + 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! + return valuesArray[index]; + }; +} +module.exports = exports.default; - if (isLeapYear) { - return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]; - } else { - return value >= 1 && value <= DAYS_IN_MONTH[month]; - } - }, - set: function (date, _flags, value, _options) { - date.setUTCDate(value); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T'] - }, - // Day of year - D: { - priority: 90, - subPriority: 1, - parse: function (string, token, match, _options) { - switch (token) { - case 'D': - case 'DD': - return parseNumericPattern(numericPatterns.dayOfYear, string); +/***/ }), - case 'Do': - return match.ordinalNumber(string, { - unit: 'date' - }); +/***/ 4029: +/***/ ((module, exports) => { - default: - return parseNDigits(token.length, string); - } - }, - validate: function (date, value, _options) { - var year = date.getUTCFullYear(); - var isLeapYear = isLeapYearIndex(year); +"use strict"; - if (isLeapYear) { - return value >= 1 && value <= 366; - } else { - return value >= 1 && value <= 365; - } - }, - set: function (date, _flags, value, _options) { - date.setUTCMonth(0, value); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T'] - }, - // Day of week - E: { - priority: 90, - parse: function (string, token, match, _options) { - switch (token) { - // Tue - case 'E': - case 'EE': - case 'EEE': - return match.day(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.day(string, { - width: 'short', - context: 'formatting' - }) || match.day(string, { - width: 'narrow', - context: 'formatting' - }); - // T - case 'EEEEE': - return match.day(string, { - width: 'narrow', - context: 'formatting' - }); - // Tu +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = buildMatchFn; +function buildMatchFn(args) { + return function (string) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var width = options.width; + var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; + var matchResult = string.match(matchPattern); + if (!matchResult) { + return null; + } + var matchedString = matchResult[0]; + var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; + var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) { + return pattern.test(matchedString); + }) : findKey(parsePatterns, function (pattern) { + return pattern.test(matchedString); + }); + var value; + value = args.valueCallback ? args.valueCallback(key) : key; + value = options.valueCallback ? options.valueCallback(value) : value; + var rest = string.slice(matchedString.length); + return { + value: value, + rest: rest + }; + }; +} +function findKey(object, predicate) { + for (var key in object) { + if (object.hasOwnProperty(key) && predicate(object[key])) { + return key; + } + } + return undefined; +} +function findIndex(array, predicate) { + for (var key = 0; key < array.length; key++) { + if (predicate(array[key])) { + return key; + } + } + return undefined; +} +module.exports = exports.default; - case 'EEEEEE': - return match.day(string, { - width: 'short', - context: 'formatting' - }) || match.day(string, { - width: 'narrow', - context: 'formatting' - }); - // Tuesday +/***/ }), - case 'EEEE': - default: - return match.day(string, { - width: 'wide', - context: 'formatting' - }) || match.day(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.day(string, { - width: 'short', - context: 'formatting' - }) || match.day(string, { - width: 'narrow', - context: 'formatting' - }); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 6; - }, - set: function (date, _flags, value, options) { - date = (0, _index2.default)(date, value, options); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T'] - }, - // Local day of week - e: { - priority: 90, - parse: function (string, token, match, options) { - var valueCallback = function (value) { - var wholeWeekDays = Math.floor((value - 1) / 7) * 7; - return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; - }; - - switch (token) { - // 3 - case 'e': - case 'ee': - // 03 - return parseNDigits(token.length, string, valueCallback); - // 3rd - - case 'eo': - return match.ordinalNumber(string, { - unit: 'day', - valueCallback: valueCallback - }); - // Tue - - case 'eee': - return match.day(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.day(string, { - width: 'short', - context: 'formatting' - }) || match.day(string, { - width: 'narrow', - context: 'formatting' - }); - // T - - case 'eeeee': - return match.day(string, { - width: 'narrow', - context: 'formatting' - }); - // Tu - - case 'eeeeee': - return match.day(string, { - width: 'short', - context: 'formatting' - }) || match.day(string, { - width: 'narrow', - context: 'formatting' - }); - // Tuesday - - case 'eeee': - default: - return match.day(string, { - width: 'wide', - context: 'formatting' - }) || match.day(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.day(string, { - width: 'short', - context: 'formatting' - }) || match.day(string, { - width: 'narrow', - context: 'formatting' - }); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 6; - }, - set: function (date, _flags, value, options) { - date = (0, _index2.default)(date, value, options); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T'] - }, - // Stand-alone local day of week - c: { - priority: 90, - parse: function (string, token, match, options) { - var valueCallback = function (value) { - var wholeWeekDays = Math.floor((value - 1) / 7) * 7; - return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; - }; - - switch (token) { - // 3 - case 'c': - case 'cc': - // 03 - return parseNDigits(token.length, string, valueCallback); - // 3rd - - case 'co': - return match.ordinalNumber(string, { - unit: 'day', - valueCallback: valueCallback - }); - // Tue - - case 'ccc': - return match.day(string, { - width: 'abbreviated', - context: 'standalone' - }) || match.day(string, { - width: 'short', - context: 'standalone' - }) || match.day(string, { - width: 'narrow', - context: 'standalone' - }); - // T - - case 'ccccc': - return match.day(string, { - width: 'narrow', - context: 'standalone' - }); - // Tu - - case 'cccccc': - return match.day(string, { - width: 'short', - context: 'standalone' - }) || match.day(string, { - width: 'narrow', - context: 'standalone' - }); - // Tuesday +/***/ 3364: +/***/ ((module, exports) => { - case 'cccc': - default: - return match.day(string, { - width: 'wide', - context: 'standalone' - }) || match.day(string, { - width: 'abbreviated', - context: 'standalone' - }) || match.day(string, { - width: 'short', - context: 'standalone' - }) || match.day(string, { - width: 'narrow', - context: 'standalone' - }); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 6; - }, - set: function (date, _flags, value, options) { - date = (0, _index2.default)(date, value, options); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T'] - }, - // ISO day of week - i: { - priority: 90, - parse: function (string, token, match, _options) { - var valueCallback = function (value) { - if (value === 0) { - return 7; - } +"use strict"; - return value; - }; - switch (token) { - // 2 - case 'i': - case 'ii': - // 02 - return parseNDigits(token.length, string); - // 2nd +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = buildMatchPatternFn; +function buildMatchPatternFn(args) { + return function (string) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var matchResult = string.match(args.matchPattern); + if (!matchResult) return null; + var matchedString = matchResult[0]; + var parseResult = string.match(args.parsePattern); + if (!parseResult) return null; + var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; + value = options.valueCallback ? options.valueCallback(value) : value; + var rest = string.slice(matchedString.length); + return { + value: value, + rest: rest + }; + }; +} +module.exports = exports.default; - case 'io': - return match.ordinalNumber(string, { - unit: 'day' - }); - // Tue +/***/ }), - case 'iii': - return match.day(string, { - width: 'abbreviated', - context: 'formatting', - valueCallback: valueCallback - }) || match.day(string, { - width: 'short', - context: 'formatting', - valueCallback: valueCallback - }) || match.day(string, { - width: 'narrow', - context: 'formatting', - valueCallback: valueCallback - }); - // T +/***/ 4846: +/***/ ((module, exports) => { - case 'iiiii': - return match.day(string, { - width: 'narrow', - context: 'formatting', - valueCallback: valueCallback - }); - // Tu +"use strict"; - case 'iiiiii': - return match.day(string, { - width: 'short', - context: 'formatting', - valueCallback: valueCallback - }) || match.day(string, { - width: 'narrow', - context: 'formatting', - valueCallback: valueCallback - }); - // Tuesday - case 'iiii': - default: - return match.day(string, { - width: 'wide', - context: 'formatting', - valueCallback: valueCallback - }) || match.day(string, { - width: 'abbreviated', - context: 'formatting', - valueCallback: valueCallback - }) || match.day(string, { - width: 'short', - context: 'formatting', - valueCallback: valueCallback - }) || match.day(string, { - width: 'narrow', - context: 'formatting', - valueCallback: valueCallback - }); - } - }, - validate: function (_date, value, _options) { - return value >= 1 && value <= 7; - }, - set: function (date, _flags, value, options) { - date = (0, _index3.default)(date, value, options); - date.setUTCHours(0, 0, 0, 0); - return date; - }, - incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T'] +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var formatDistanceLocale = { + lessThanXSeconds: { + one: 'less than a second', + other: 'less than {{count}} seconds' }, - // AM or PM - a: { - priority: 80, - parse: function (string, token, match, _options) { - switch (token) { - case 'a': - case 'aa': - case 'aaa': - return match.dayPeriod(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - - case 'aaaaa': - return match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - - case 'aaaa': - default: - return match.dayPeriod(string, { - width: 'wide', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - } - }, - set: function (date, _flags, value, _options) { - date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); - return date; - }, - incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T'] + xSeconds: { + one: '1 second', + other: '{{count}} seconds' }, - // AM, PM, midnight - b: { - priority: 80, - parse: function (string, token, match, _options) { - switch (token) { - case 'b': - case 'bb': - case 'bbb': - return match.dayPeriod(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - - case 'bbbbb': - return match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - - case 'bbbb': - default: - return match.dayPeriod(string, { - width: 'wide', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - } - }, - set: function (date, _flags, value, _options) { - date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); - return date; - }, - incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T'] + halfAMinute: 'half a minute', + lessThanXMinutes: { + one: 'less than a minute', + other: 'less than {{count}} minutes' }, - // in the morning, in the afternoon, in the evening, at night - B: { - priority: 80, - parse: function (string, token, match, _options) { - switch (token) { - case 'B': - case 'BB': - case 'BBB': - return match.dayPeriod(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - - case 'BBBBB': - return match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - - case 'BBBB': - default: - return match.dayPeriod(string, { - width: 'wide', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'abbreviated', - context: 'formatting' - }) || match.dayPeriod(string, { - width: 'narrow', - context: 'formatting' - }); - } - }, - set: function (date, _flags, value, _options) { - date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); - return date; - }, - incompatibleTokens: ['a', 'b', 't', 'T'] + xMinutes: { + one: '1 minute', + other: '{{count}} minutes' }, - // Hour [1-12] - h: { - priority: 70, - parse: function (string, token, match, _options) { - switch (token) { - case 'h': - return parseNumericPattern(numericPatterns.hour12h, string); - - case 'ho': - return match.ordinalNumber(string, { - unit: 'hour' - }); - - default: - return parseNDigits(token.length, string); - } - }, - validate: function (_date, value, _options) { - return value >= 1 && value <= 12; - }, - set: function (date, _flags, value, _options) { - var isPM = date.getUTCHours() >= 12; - - if (isPM && value < 12) { - date.setUTCHours(value + 12, 0, 0, 0); - } else if (!isPM && value === 12) { - date.setUTCHours(0, 0, 0, 0); - } else { - date.setUTCHours(value, 0, 0, 0); - } - - return date; - }, - incompatibleTokens: ['H', 'K', 'k', 't', 'T'] + aboutXHours: { + one: 'about 1 hour', + other: 'about {{count}} hours' }, - // Hour [0-23] - H: { - priority: 70, - parse: function (string, token, match, _options) { - switch (token) { - case 'H': - return parseNumericPattern(numericPatterns.hour23h, string); - - case 'Ho': - return match.ordinalNumber(string, { - unit: 'hour' - }); - - default: - return parseNDigits(token.length, string); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 23; - }, - set: function (date, _flags, value, _options) { - date.setUTCHours(value, 0, 0, 0); - return date; - }, - incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T'] + xHours: { + one: '1 hour', + other: '{{count}} hours' }, - // Hour [0-11] - K: { - priority: 70, - parse: function (string, token, match, _options) { - switch (token) { - case 'K': - return parseNumericPattern(numericPatterns.hour11h, string); - - case 'Ko': - return match.ordinalNumber(string, { - unit: 'hour' - }); - - default: - return parseNDigits(token.length, string); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 11; - }, - set: function (date, _flags, value, _options) { - var isPM = date.getUTCHours() >= 12; - - if (isPM && value < 12) { - date.setUTCHours(value + 12, 0, 0, 0); - } else { - date.setUTCHours(value, 0, 0, 0); - } - - return date; - }, - incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T'] + xDays: { + one: '1 day', + other: '{{count}} days' }, - // Hour [1-24] - k: { - priority: 70, - parse: function (string, token, match, _options) { - switch (token) { - case 'k': - return parseNumericPattern(numericPatterns.hour24h, string); - - case 'ko': - return match.ordinalNumber(string, { - unit: 'hour' - }); - - default: - return parseNDigits(token.length, string); - } - }, - validate: function (_date, value, _options) { - return value >= 1 && value <= 24; - }, - set: function (date, _flags, value, _options) { - var hours = value <= 24 ? value % 24 : value; - date.setUTCHours(hours, 0, 0, 0); - return date; - }, - incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T'] + aboutXWeeks: { + one: 'about 1 week', + other: 'about {{count}} weeks' }, - // Minute - m: { - priority: 60, - parse: function (string, token, match, _options) { - switch (token) { - case 'm': - return parseNumericPattern(numericPatterns.minute, string); - - case 'mo': - return match.ordinalNumber(string, { - unit: 'minute' - }); - - default: - return parseNDigits(token.length, string); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 59; - }, - set: function (date, _flags, value, _options) { - date.setUTCMinutes(value, 0, 0); - return date; - }, - incompatibleTokens: ['t', 'T'] + xWeeks: { + one: '1 week', + other: '{{count}} weeks' }, - // Second - s: { - priority: 50, - parse: function (string, token, match, _options) { - switch (token) { - case 's': - return parseNumericPattern(numericPatterns.second, string); - - case 'so': - return match.ordinalNumber(string, { - unit: 'second' - }); - - default: - return parseNDigits(token.length, string); - } - }, - validate: function (_date, value, _options) { - return value >= 0 && value <= 59; - }, - set: function (date, _flags, value, _options) { - date.setUTCSeconds(value, 0); - return date; - }, - incompatibleTokens: ['t', 'T'] + aboutXMonths: { + one: 'about 1 month', + other: 'about {{count}} months' }, - // Fraction of second - S: { - priority: 30, - parse: function (string, token, _match, _options) { - var valueCallback = function (value) { - return Math.floor(value * Math.pow(10, -token.length + 3)); - }; - - return parseNDigits(token.length, string, valueCallback); - }, - set: function (date, _flags, value, _options) { - date.setUTCMilliseconds(value); - return date; - }, - incompatibleTokens: ['t', 'T'] + xMonths: { + one: '1 month', + other: '{{count}} months' }, - // Timezone (ISO-8601. +00:00 is `'Z'`) - X: { - priority: 10, - parse: function (string, token, _match, _options) { - switch (token) { - case 'X': - return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string); - - case 'XX': - return parseTimezonePattern(timezonePatterns.basic, string); - - case 'XXXX': - return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string); - - case 'XXXXX': - return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string); - - case 'XXX': - default: - return parseTimezonePattern(timezonePatterns.extended, string); - } - }, - set: function (date, flags, value, _options) { - if (flags.timestampIsSet) { - return date; - } - - return new Date(date.getTime() - value); - }, - incompatibleTokens: ['t', 'T', 'x'] + aboutXYears: { + one: 'about 1 year', + other: 'about {{count}} years' }, - // Timezone (ISO-8601) - x: { - priority: 10, - parse: function (string, token, _match, _options) { - switch (token) { - case 'x': - return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string); - - case 'xx': - return parseTimezonePattern(timezonePatterns.basic, string); - - case 'xxxx': - return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string); - - case 'xxxxx': - return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string); - - case 'xxx': - default: - return parseTimezonePattern(timezonePatterns.extended, string); - } - }, - set: function (date, flags, value, _options) { - if (flags.timestampIsSet) { - return date; - } - - return new Date(date.getTime() - value); - }, - incompatibleTokens: ['t', 'T', 'X'] + xYears: { + one: '1 year', + other: '{{count}} years' }, - // Seconds timestamp - t: { - priority: 40, - parse: function (string, _token, _match, _options) { - return parseAnyDigitsSigned(string); - }, - set: function (_date, _flags, value, _options) { - return [new Date(value * 1000), { - timestampIsSet: true - }]; - }, - incompatibleTokens: '*' + overXYears: { + one: 'over 1 year', + other: 'over {{count}} years' }, - // Milliseconds timestamp - T: { - priority: 20, - parse: function (string, _token, _match, _options) { - return parseAnyDigitsSigned(string); - }, - set: function (_date, _flags, value, _options) { - return [new Date(value), { - timestampIsSet: true - }]; - }, - incompatibleTokens: '*' + almostXYears: { + one: 'almost 1 year', + other: 'almost {{count}} years' + } +}; +var formatDistance = function formatDistance(token, count, options) { + var result; + var tokenValue = formatDistanceLocale[token]; + if (typeof tokenValue === 'string') { + result = tokenValue; + } else if (count === 1) { + result = tokenValue.one; + } else { + result = tokenValue.other.replace('{{count}}', count.toString()); + } + if (options !== null && options !== void 0 && options.addSuffix) { + if (options.comparison && options.comparison > 0) { + return 'in ' + result; + } else { + return result + ' ago'; + } } + return result; }; -var _default = parsers; -exports.default = _default; +var _default = formatDistance; +exports["default"] = _default; module.exports = exports.default; /***/ }), -/* 463 */, -/* 464 */, -/* 465 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 368: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = addYears; - -var _index = _interopRequireDefault(__webpack_require__(841)); - -var _index2 = _interopRequireDefault(__webpack_require__(875)); - -var _index3 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @name addYears - * @category Year Helpers - * @summary Add the specified number of years to the given date. - * - * @description - * Add the specified number of years to the given date. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * - * @param {Date|Number} date - the date to be changed - * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. - * @returns {Date} the new date with the years added - * @throws {TypeError} 2 arguments required - * - * @example - * // Add 5 years to 1 September 2014: - * const result = addYears(new Date(2014, 8, 1), 5) - * //=> Sun Sep 01 2019 00:00:00 - */ -function addYears(dirtyDate, dirtyAmount) { - (0, _index3.default)(2, arguments); - var amount = (0, _index.default)(dirtyAmount); - return (0, _index2.default)(dirtyDate, amount * 12); -} - +})); +exports["default"] = void 0; +var _index = _interopRequireDefault(__nccwpck_require__(1244)); +var dateFormats = { + full: 'EEEE, MMMM do, y', + long: 'MMMM do, y', + medium: 'MMM d, y', + short: 'MM/dd/yyyy' +}; +var timeFormats = { + full: 'h:mm:ss a zzzz', + long: 'h:mm:ss a z', + medium: 'h:mm:ss a', + short: 'h:mm a' +}; +var dateTimeFormats = { + full: "{{date}} 'at' {{time}}", + long: "{{date}} 'at' {{time}}", + medium: '{{date}}, {{time}}', + short: '{{date}}, {{time}}' +}; +var formatLong = { + date: (0, _index.default)({ + formats: dateFormats, + defaultWidth: 'full' + }), + time: (0, _index.default)({ + formats: timeFormats, + defaultWidth: 'full' + }), + dateTime: (0, _index.default)({ + formats: dateTimeFormats, + defaultWidth: 'full' + }) +}; +var _default = formatLong; +exports["default"] = _default; module.exports = exports.default; /***/ }), -/* 466 */, -/* 467 */, -/* 468 */, -/* 469 */, -/* 470 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const SemVer = __webpack_require__(653) -const Range = __webpack_require__(57) -const minSatisfying = (versions, range, options) => { - let min = null - let minSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} -module.exports = minSatisfying - -/***/ }), -/* 471 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { +/***/ 2430: +/***/ ((module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.cosmiconfig = cosmiconfig; -exports.cosmiconfigSync = cosmiconfigSync; -exports.defaultLoaders = void 0; +})); +exports["default"] = void 0; +var formatRelativeLocale = { + lastWeek: "'last' eeee 'at' p", + yesterday: "'yesterday at' p", + today: "'today at' p", + tomorrow: "'tomorrow at' p", + nextWeek: "eeee 'at' p", + other: 'P' +}; +var formatRelative = function formatRelative(token, _date, _baseDate, _options) { + return formatRelativeLocale[token]; +}; +var _default = formatRelative; +exports["default"] = _default; +module.exports = exports.default; -var _os = _interopRequireDefault(__webpack_require__(87)); +/***/ }), -var _Explorer = __webpack_require__(674); +/***/ 5474: +/***/ ((module, exports, __nccwpck_require__) => { -var _ExplorerSync = __webpack_require__(40); +"use strict"; -var _loaders = __webpack_require__(690); -var _types = __webpack_require__(981); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _index = _interopRequireDefault(__nccwpck_require__(3647)); +var eraValues = { + narrow: ['B', 'A'], + abbreviated: ['BC', 'AD'], + wide: ['Before Christ', 'Anno Domini'] +}; +var quarterValues = { + narrow: ['1', '2', '3', '4'], + abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'], + wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +// 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'], + wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] +}; +var dayValues = { + narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], + short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] +}; +var dayPeriodValues = { + narrow: { + am: 'a', + pm: 'p', + midnight: 'mi', + noon: 'n', + morning: 'morning', + afternoon: 'afternoon', + evening: 'evening', + night: 'night' + }, + abbreviated: { + am: 'AM', + pm: 'PM', + midnight: 'midnight', + noon: 'noon', + morning: 'morning', + afternoon: 'afternoon', + evening: 'evening', + night: 'night' + }, + wide: { + am: 'a.m.', + pm: 'p.m.', + midnight: 'midnight', + noon: 'noon', + morning: 'morning', + afternoon: 'afternoon', + evening: 'evening', + night: 'night' + } +}; +var formattingDayPeriodValues = { + narrow: { + am: 'a', + pm: 'p', + midnight: 'mi', + noon: 'n', + morning: 'in the morning', + afternoon: 'in the afternoon', + evening: 'in the evening', + night: 'at night' + }, + abbreviated: { + am: 'AM', + pm: 'PM', + midnight: 'midnight', + noon: 'noon', + morning: 'in the morning', + afternoon: 'in the afternoon', + evening: 'in the evening', + night: 'at night' + }, + wide: { + am: 'a.m.', + pm: 'p.m.', + midnight: 'midnight', + noon: 'noon', + morning: 'in the morning', + afternoon: 'in the afternoon', + evening: 'in the evening', + night: 'at night' + } +}; +var ordinalNumber = function ordinalNumber(dirtyNumber, _options) { + var number = Number(dirtyNumber); -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -function cosmiconfig(moduleName, options = {}) { - const normalizedOptions = normalizeOptions(moduleName, options); - const explorer = new _Explorer.Explorer(normalizedOptions); - return { - search: explorer.search.bind(explorer), - load: explorer.load.bind(explorer), - clearLoadCache: explorer.clearLoadCache.bind(explorer), - clearSearchCache: explorer.clearSearchCache.bind(explorer), - clearCaches: explorer.clearCaches.bind(explorer) - }; -} // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + // If ordinal numbers depend on context, for example, + // if they are different for different grammatical genders, + // use `options.unit`. + // + // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear', + // 'day', 'hour', 'minute', 'second'. + var rem100 = number % 100; + if (rem100 > 20 || rem100 < 10) { + switch (rem100 % 10) { + case 1: + return number + 'st'; + case 2: + return number + 'nd'; + case 3: + return number + 'rd'; + } + } + return number + 'th'; +}; +var localize = { + ordinalNumber: ordinalNumber, + era: (0, _index.default)({ + values: eraValues, + defaultWidth: 'wide' + }), + quarter: (0, _index.default)({ + values: quarterValues, + defaultWidth: 'wide', + argumentCallback: function argumentCallback(quarter) { + return quarter - 1; + } + }), + month: (0, _index.default)({ + values: monthValues, + defaultWidth: 'wide' + }), + day: (0, _index.default)({ + values: dayValues, + defaultWidth: 'wide' + }), + dayPeriod: (0, _index.default)({ + values: dayPeriodValues, + defaultWidth: 'wide', + formattingValues: formattingDayPeriodValues, + defaultFormattingWidth: 'wide' + }) +}; +var _default = localize; +exports["default"] = _default; +module.exports = exports.default; -function cosmiconfigSync(moduleName, options = {}) { - const normalizedOptions = normalizeOptions(moduleName, options); - const explorerSync = new _ExplorerSync.ExplorerSync(normalizedOptions); - return { - search: explorerSync.searchSync.bind(explorerSync), - load: explorerSync.loadSync.bind(explorerSync), - clearLoadCache: explorerSync.clearLoadCache.bind(explorerSync), - clearSearchCache: explorerSync.clearSearchCache.bind(explorerSync), - clearCaches: explorerSync.clearCaches.bind(explorerSync) - }; -} // do not allow mutation of default loaders. Make sure it is set inside options +/***/ }), +/***/ 1338: +/***/ ((module, exports, __nccwpck_require__) => { -const defaultLoaders = Object.freeze({ - '.cjs': _loaders.loaders.loadJs, - '.js': _loaders.loaders.loadJs, - '.json': _loaders.loaders.loadJson, - '.yaml': _loaders.loaders.loadYaml, - '.yml': _loaders.loaders.loadYaml, - noExt: _loaders.loaders.loadYaml -}); -exports.defaultLoaders = defaultLoaders; +"use strict"; -const identity = function identity(x) { - return x; -}; -function normalizeOptions(moduleName, options) { - const defaults = { - packageProp: moduleName, - searchPlaces: ['package.json', `.${moduleName}rc`, `.${moduleName}rc.json`, `.${moduleName}rc.yaml`, `.${moduleName}rc.yml`, `.${moduleName}rc.js`, `.${moduleName}rc.cjs`, `${moduleName}.config.js`, `${moduleName}.config.cjs`], - ignoreEmptySearchPlaces: true, - stopDir: _os.default.homedir(), - cache: true, - transform: identity, - loaders: defaultLoaders - }; - const normalizedOptions = { ...defaults, - ...options, - loaders: { ...defaults.loaders, - ...options.loaders +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _index = _interopRequireDefault(__nccwpck_require__(4029)); +var _index2 = _interopRequireDefault(__nccwpck_require__(3364)); +var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; +var parseOrdinalNumberPattern = /\d+/i; +var matchEraPatterns = { + narrow: /^(b|a)/i, + abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, + wide: /^(before christ|before common era|anno domini|common era)/i +}; +var parseEraPatterns = { + any: [/^b/i, /^(a|c)/i] +}; +var matchQuarterPatterns = { + narrow: /^[1234]/i, + abbreviated: /^q[1234]/i, + wide: /^[1234](th|st|nd|rd)? quarter/i +}; +var parseQuarterPatterns = { + any: [/1/i, /2/i, /3/i, /4/i] +}; +var matchMonthPatterns = { + narrow: /^[jfmasond]/i, + abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, + wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i +}; +var parseMonthPatterns = { + narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i], + any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] +}; +var matchDayPatterns = { + narrow: /^[smtwf]/i, + short: /^(su|mo|tu|we|th|fr|sa)/i, + abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, + wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i +}; +var parseDayPatterns = { + narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], + any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] +}; +var matchDayPeriodPatterns = { + narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, + any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i +}; +var parseDayPeriodPatterns = { + any: { + am: /^a/i, + pm: /^p/i, + midnight: /^mi/i, + noon: /^no/i, + morning: /morning/i, + afternoon: /afternoon/i, + evening: /evening/i, + night: /night/i + } +}; +var match = { + ordinalNumber: (0, _index2.default)({ + matchPattern: matchOrdinalNumberPattern, + parsePattern: parseOrdinalNumberPattern, + valueCallback: function valueCallback(value) { + return parseInt(value, 10); } - }; - return normalizedOptions; -} -//# sourceMappingURL=index.js.map + }), + era: (0, _index.default)({ + matchPatterns: matchEraPatterns, + defaultMatchWidth: 'wide', + parsePatterns: parseEraPatterns, + defaultParseWidth: 'any' + }), + quarter: (0, _index.default)({ + matchPatterns: matchQuarterPatterns, + defaultMatchWidth: 'wide', + parsePatterns: parseQuarterPatterns, + defaultParseWidth: 'any', + valueCallback: function valueCallback(index) { + return index + 1; + } + }), + month: (0, _index.default)({ + matchPatterns: matchMonthPatterns, + defaultMatchWidth: 'wide', + parsePatterns: parseMonthPatterns, + defaultParseWidth: 'any' + }), + day: (0, _index.default)({ + matchPatterns: matchDayPatterns, + defaultMatchWidth: 'wide', + parsePatterns: parseDayPatterns, + defaultParseWidth: 'any' + }), + dayPeriod: (0, _index.default)({ + matchPatterns: matchDayPeriodPatterns, + defaultMatchWidth: 'any', + parsePatterns: parseDayPeriodPatterns, + defaultParseWidth: 'any' + }) +}; +var _default = match; +exports["default"] = _default; +module.exports = exports.default; /***/ }), -/* 472 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 1773: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isEqual; +})); +exports["default"] = void 0; +var _index = _interopRequireDefault(__nccwpck_require__(4846)); +var _index2 = _interopRequireDefault(__nccwpck_require__(368)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2430)); +var _index4 = _interopRequireDefault(__nccwpck_require__(5474)); +var _index5 = _interopRequireDefault(__nccwpck_require__(1338)); +/** + * @type {Locale} + * @category Locales + * @summary English locale (United States). + * @language English + * @iso-639-2 eng + * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp} + * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss} + */ +var locale = { + code: 'en-US', + formatDistance: _index.default, + formatLong: _index2.default, + formatRelative: _index3.default, + localize: _index4.default, + match: _index5.default, + options: { + weekStartsOn: 0 /* Sunday */, + firstWeekContainsDate: 1 + } +}; +var _default = locale; +exports["default"] = _default; +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(773)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(217)); +/***/ 5815: +/***/ ((module, exports, __nccwpck_require__) => { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = max; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isEqual + * @name max * @category Common Helpers - * @summary Are the given dates equal? + * @summary Return the latest of the given dates. * * @description - * Are the given dates equal? - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Return the latest of the given dates. * - * @param {Date|Number} dateLeft - the first date to compare - * @param {Date|Number} dateRight - the second date to compare - * @returns {Boolean} the dates are equal - * @throws {TypeError} 2 arguments required + * @param {Date[]|Number[]} datesArray - the dates to compare + * @returns {Date} the latest of the dates + * @throws {TypeError} 1 argument required * * @example - * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal? - * var result = isEqual( - * new Date(2014, 6, 2, 6, 30, 45, 0), - * new Date(2014, 6, 2, 6, 30, 45, 500) - * ) - * //=> false + * // Which of these dates is the latest? + * const result = max([ + * new Date(1989, 6, 10), + * new Date(1987, 1, 11), + * new Date(1995, 6, 2), + * new Date(1990, 0, 1) + * ]) + * //=> Sun Jul 02 1995 00:00:00 */ -function isEqual(dirtyLeftDate, dirtyRightDate) { - (0, _index2.default)(2, arguments); - var dateLeft = (0, _index.default)(dirtyLeftDate); - var dateRight = (0, _index.default)(dirtyRightDate); - return dateLeft.getTime() === dateRight.getTime(); -} +function max(dirtyDatesArray) { + (0, _index2.default)(1, arguments); + var datesArray; + // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method + if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') { + datesArray = dirtyDatesArray; + // If `dirtyDatesArray` is Array-like Object, convert to Array. + } else if ((0, _typeof2.default)(dirtyDatesArray) === 'object' && dirtyDatesArray !== null) { + datesArray = Array.prototype.slice.call(dirtyDatesArray); + } else { + // `dirtyDatesArray` is non-iterable, return Invalid Date + return new Date(NaN); + } + var result; + datesArray.forEach(function (dirtyDate) { + var currentDate = (0, _index.default)(dirtyDate); + if (result === undefined || result < currentDate || isNaN(Number(currentDate))) { + result = currentDate; + } + }); + return result || new Date(NaN); +} module.exports = exports.default; /***/ }), -/* 473 */, -/* 474 */, -/* 475 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 6133: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isThisHour; - -var _index = _interopRequireDefault(__webpack_require__(364)); - -var _index2 = _interopRequireDefault(__webpack_require__(217)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +})); +exports["default"] = milliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +// Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. +// 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days +var daysInYear = 365.2425; /** - * @name isThisHour - * @category Hour Helpers - * @summary Is the given date in the same hour as the current date? - * @pure false + * @name milliseconds + * @category Millisecond Helpers + * @summary + * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. * * @description - * Is the given date in the same hour as the current date? + * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `Date.now()` internally hence impure and can't be safely curried. + * One years equals 365.2425 days according to the formula: * - * ### v2.0.0 breaking changes: + * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. + * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * One month is a year divided by 12. * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is in this hour + * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {number} the milliseconds * @throws {TypeError} 1 argument required * * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:00:00 in this hour? - * var result = isThisHour(new Date(2014, 8, 25, 18)) - * //=> true + * // 1 year in milliseconds + * milliseconds({ years: 1 }) + * //=> 31556952000 + * + * // 3 months in milliseconds + * milliseconds({ months: 3 }) + * //=> 7889238000 */ -function isThisHour(dirtyDate) { - (0, _index2.default)(1, arguments); - return (0, _index.default)(Date.now(), dirtyDate); +function milliseconds(_ref) { + var years = _ref.years, + months = _ref.months, + weeks = _ref.weeks, + days = _ref.days, + hours = _ref.hours, + minutes = _ref.minutes, + seconds = _ref.seconds; + (0, _index.default)(1, arguments); + var totalDays = 0; + if (years) totalDays += years * daysInYear; + if (months) totalDays += months * (daysInYear / 12); + if (weeks) totalDays += weeks * 7; + if (days) totalDays += days; + var totalSeconds = totalDays * 24 * 60 * 60; + if (hours) totalSeconds += hours * 60 * 60; + if (minutes) totalSeconds += minutes * 60; + if (seconds) totalSeconds += seconds; + return Math.round(totalSeconds * 1000); } - module.exports = exports.default; /***/ }), -/* 476 */, -/* 477 */, -/* 478 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -"use strict"; -const {PassThrough: PassThroughStream} = __webpack_require__(413); +/***/ 9571: +/***/ ((module, exports, __nccwpck_require__) => { -module.exports = options => { - options = {...options}; +"use strict"; - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } - - if (isBuffer) { - encoding = null; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = millisecondsToHours; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name millisecondsToHours + * @category Conversion Helpers + * @summary Convert milliseconds to hours. + * + * @description + * Convert a number of milliseconds to a full number of hours. + * + * @param {number} milliseconds - number of milliseconds to be converted + * + * @returns {number} the number of milliseconds converted in hours + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 7200000 milliseconds to hours: + * const result = millisecondsToHours(7200000) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = millisecondsToHours(7199999) + * //=> 1 + */ +function millisecondsToHours(milliseconds) { + (0, _index.default)(1, arguments); + var hours = milliseconds / _index2.millisecondsInHour; + return Math.floor(hours); +} +module.exports = exports.default; - const stream = new PassThroughStream({objectMode}); +/***/ }), - if (encoding) { - stream.setEncoding(encoding); - } +/***/ 5419: +/***/ ((module, exports, __nccwpck_require__) => { - let length = 0; - const chunks = []; +"use strict"; - stream.on('data', chunk => { - chunks.push(chunk); - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = millisecondsToMinutes; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name millisecondsToMinutes + * @category Conversion Helpers + * @summary Convert milliseconds to minutes. + * + * @description + * Convert a number of milliseconds to a full number of minutes. + * + * @param {number} milliseconds - number of milliseconds to be converted. + * + * @returns {number} the number of milliseconds converted in minutes + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 60000 milliseconds to minutes: + * const result = millisecondsToMinutes(60000) + * //=> 1 + * + * @example + * // It uses floor rounding: + * const result = millisecondsToMinutes(119999) + * //=> 1 + */ +function millisecondsToMinutes(milliseconds) { + (0, _index.default)(1, arguments); + var minutes = milliseconds / _index2.millisecondsInMinute; + return Math.floor(minutes); +} +module.exports = exports.default; - stream.getBufferedValue = () => { - if (array) { - return chunks; - } +/***/ }), - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; +/***/ 2294: +/***/ ((module, exports, __nccwpck_require__) => { - stream.getBufferedLength = () => length; +"use strict"; - return stream; -}; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = millisecondsToSeconds; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name millisecondsToSeconds + * @category Conversion Helpers + * @summary Convert milliseconds to seconds. + * + * @description + * Convert a number of milliseconds to a full number of seconds. + * + * @param {number} milliseconds - number of milliseconds to be converted + * + * @returns {number} the number of milliseconds converted in seconds + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 1000 miliseconds to seconds: + * const result = millisecondsToSeconds(1000) + * //=> 1 + * + * @example + * // It uses floor rounding: + * const result = millisecondsToSeconds(1999) + * //=> 1 + */ +function millisecondsToSeconds(milliseconds) { + (0, _index.default)(1, arguments); + var seconds = milliseconds / _index2.millisecondsInSecond; + return Math.floor(seconds); +} +module.exports = exports.default; /***/ }), -/* 479 */, -/* 480 */, -/* 481 */, -/* 482 */, -/* 483 */, -/* 484 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 5310: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isSameMonth; +})); +exports["default"] = min; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name min + * @category Common Helpers + * @summary Returns the earliest of the given dates. + * + * @description + * Returns the earliest of the given dates. + * + * @param {Date[]|Number[]} datesArray - the dates to compare + * @returns {Date} - the earliest of the dates + * @throws {TypeError} 1 argument required + * + * @example + * // Which of these dates is the earliest? + * const result = min([ + * new Date(1989, 6, 10), + * new Date(1987, 1, 11), + * new Date(1995, 6, 2), + * new Date(1990, 0, 1) + * ]) + * //=> Wed Feb 11 1987 00:00:00 + */ +function min(dirtyDatesArray) { + (0, _index2.default)(1, arguments); + var datesArray; + // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method + if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') { + datesArray = dirtyDatesArray; + // If `dirtyDatesArray` is Array-like Object, convert to Array. + } else if ((0, _typeof2.default)(dirtyDatesArray) === 'object' && dirtyDatesArray !== null) { + datesArray = Array.prototype.slice.call(dirtyDatesArray); + } else { + // `dirtyDatesArray` is non-iterable, return Invalid Date + return new Date(NaN); + } + var result; + datesArray.forEach(function (dirtyDate) { + var currentDate = (0, _index.default)(dirtyDate); + if (result === undefined || result > currentDate || isNaN(currentDate.getDate())) { + result = currentDate; + } + }); + return result || new Date(NaN); +} +module.exports = exports.default; + +/***/ }), -var _index = _interopRequireDefault(__webpack_require__(773)); +/***/ 2516: +/***/ ((module, exports, __nccwpck_require__) => { -var _index2 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = minutesToHours; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); /** - * @name isSameMonth - * @category Month Helpers - * @summary Are the given dates in the same month? + * @name minutesToHours + * @category Conversion Helpers + * @summary Convert minutes to hours. * * @description - * Are the given dates in the same month? + * Convert a number of minutes to a full number of hours. * - * ### v2.0.0 breaking changes: + * @param {number} minutes - number of minutes to be converted * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @returns {number} the number of minutes converted in hours + * @throws {TypeError} 1 argument required * - * @param {Date|Number} dateLeft - the first date to check - * @param {Date|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same month - * @throws {TypeError} 2 arguments required + * @example + * // Convert 140 minutes to hours: + * const result = minutesToHours(120) + * //=> 2 * * @example - * // Are 2 September 2014 and 25 September 2014 in the same month? - * var result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25)) - * //=> true + * // It uses floor rounding: + * const result = minutesToHours(179) + * //=> 2 */ -function isSameMonth(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - var dateLeft = (0, _index.default)(dirtyDateLeft); - var dateRight = (0, _index.default)(dirtyDateRight); - return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth(); +function minutesToHours(minutes) { + (0, _index.default)(1, arguments); + var hours = minutes / _index2.minutesInHour; + return Math.floor(hours); } - module.exports = exports.default; /***/ }), -/* 485 */, -/* 486 */, -/* 487 */, -/* 488 */ -/***/ (function(module, exports) { + +/***/ 1886: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = addLeadingZeros; - -function addLeadingZeros(number, targetLength) { - var sign = number < 0 ? '-' : ''; - var output = Math.abs(number).toString(); - - while (output.length < targetLength) { - output = '0' + output; - } - - return sign + output; +})); +exports["default"] = minutesToMilliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name minutesToMilliseconds + * @category Conversion Helpers + * @summary Convert minutes to milliseconds. + * + * @description + * Convert a number of minutes to a full number of milliseconds. + * + * @param {number} minutes - number of minutes to be converted + * + * @returns {number} the number of minutes converted in milliseconds + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 2 minutes to milliseconds + * const result = minutesToMilliseconds(2) + * //=> 120000 + */ +function minutesToMilliseconds(minutes) { + (0, _index.default)(1, arguments); + return Math.floor(minutes * _index2.millisecondsInMinute); } - module.exports = exports.default; /***/ }), -/* 489 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const Range = __webpack_require__(57) -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} -module.exports = intersects - -/***/ }), -/* 490 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 8192: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = setYear; +})); +exports["default"] = minutesToSeconds; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name minutesToSeconds + * @category Conversion Helpers + * @summary Convert minutes to seconds. + * + * @description + * Convert a number of minutes to a full number of seconds. + * + * @param { number } minutes - number of minutes to be converted + * + * @returns {number} the number of minutes converted in seconds + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 2 minutes to seconds + * const result = minutesToSeconds(2) + * //=> 120 + */ +function minutesToSeconds(minutes) { + (0, _index.default)(1, arguments); + return Math.floor(minutes * _index2.secondsInMinute); +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(841)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(773)); +/***/ 1142: +/***/ ((module, exports, __nccwpck_require__) => { -var _index3 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = monthsToQuarters; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); /** - * @name setYear - * @category Year Helpers - * @summary Set the year to the given date. + * @name monthsToQuarters + * @category Conversion Helpers + * @summary Convert number of months to quarters. * * @description - * Set the year to the given date. + * Convert a number of months to a full number of quarters. * - * ### v2.0.0 breaking changes: + * @param {number} months - number of months to be converted. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @returns {number} the number of months converted in quarters + * @throws {TypeError} 1 argument required * - * @param {Date|Number} date - the date to be changed - * @param {Number} year - the year of the new date - * @returns {Date} the new date with the year set - * @throws {TypeError} 2 arguments required + * @example + * // Convert 6 months to quarters: + * const result = monthsToQuarters(6) + * //=> 2 * * @example - * // Set year 2013 to 1 September 2014: - * const result = setYear(new Date(2014, 8, 1), 2013) - * //=> Sun Sep 01 2013 00:00:00 + * // It uses floor rounding: + * const result = monthsToQuarters(7) + * //=> 2 */ -function setYear(dirtyDate, dirtyYear) { - (0, _index3.default)(2, arguments); - var date = (0, _index2.default)(dirtyDate); - var year = (0, _index.default)(dirtyYear); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date - - if (isNaN(date.getTime())) { - return new Date(NaN); - } - - date.setFullYear(year); - return date; +function monthsToQuarters(months) { + (0, _index.default)(1, arguments); + var quarters = months / _index2.monthsInQuarter; + return Math.floor(quarters); } - module.exports = exports.default; /***/ }), -/* 491 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 3757: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isSameDay; +})); +exports["default"] = monthsToYears; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name monthsToYears + * @category Conversion Helpers + * @summary Convert number of months to years. + * + * @description + * Convert a number of months to a full number of years. + * + * @param {number} months - number of months to be converted + * + * @returns {number} the number of months converted in years + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 36 months to years: + * const result = monthsToYears(36) + * //=> 3 + * + * // It uses floor rounding: + * const result = monthsToYears(40) + * //=> 3 + */ +function monthsToYears(months) { + (0, _index.default)(1, arguments); + var years = months / _index2.monthsInYear; + return Math.floor(years); +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(576)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(217)); +/***/ 6771: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = nextDay; +var _index = _interopRequireDefault(__nccwpck_require__(6227)); +var _index2 = _interopRequireDefault(__nccwpck_require__(9361)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isSameDay - * @category Day Helpers - * @summary Are the given dates in the same day? + * @name nextDay + * @category Weekday Helpers + * @summary When is the next day of the week? * * @description - * Are the given dates in the same day? - * - * ### v2.0.0 breaking changes: + * When is the next day of the week? 0-6 the day of the week, 0 represents Sunday. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @param {Date | number} date - the date to check + * @param {Day} day - day of the week + * @returns {Date} - the date is the next day of week + * @throws {TypeError} - 2 arguments required * - * @param {Date|Number} dateLeft - the first date to check - * @param {Date|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same day - * @throws {TypeError} 2 arguments required + * @example + * // When is the next Monday after Mar, 20, 2020? + * const result = nextDay(new Date(2020, 2, 20), 1) + * //=> Mon Mar 23 2020 00:00:00 * * @example - * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day? - * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0)) - * //=> true + * // When is the next Tuesday after Mar, 21, 2020? + * const result = nextDay(new Date(2020, 2, 21), 2) + * //=> Tue Mar 24 2020 00:00:00 */ -function isSameDay(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - var dateLeftStartOfDay = (0, _index.default)(dirtyDateLeft); - var dateRightStartOfDay = (0, _index.default)(dirtyDateRight); - return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime(); +function nextDay(date, day) { + (0, _index3.default)(2, arguments); + var delta = day - (0, _index2.default)(date); + if (delta <= 0) delta += 7; + return (0, _index.default)(date, delta); } - module.exports = exports.default; /***/ }), -/* 492 */ -/***/ (function(module) { - -module.exports = require("path"); -/***/ }), -/* 493 */, -/* 494 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 1491: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isThisQuarter; +})); +exports["default"] = nextFriday; +var _index = _interopRequireDefault(__nccwpck_require__(6771)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name nextFriday + * @category Weekday Helpers + * @summary When is the next Friday? + * + * @description + * When is the next Friday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the next Friday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the next Friday after Mar, 22, 2020? + * const result = nextFriday(new Date(2020, 2, 22)) + * //=> Fri Mar 27 2020 00:00:00 + */ +function nextFriday(date) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(date, 5); +} +module.exports = exports.default; + +/***/ }), -var _index = _interopRequireDefault(__webpack_require__(625)); +/***/ 5947: +/***/ ((module, exports, __nccwpck_require__) => { -var _index2 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = nextMonday; +var _index = _interopRequireDefault(__nccwpck_require__(6771)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isThisQuarter - * @category Quarter Helpers - * @summary Is the given date in the same quarter as the current date? - * @pure false + * @name nextMonday + * @category Weekday Helpers + * @summary When is the next Monday? * * @description - * Is the given date in the same quarter as the current date? - * - * > ⚠️ Please note that this function is not present in the FP submodule as - * > it uses `Date.now()` internally hence impure and can't be safely curried. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * When is the next Monday? * - * @param {Date|Number} date - the date to check - * @returns {Boolean} the date is in this quarter + * @param {Date | number} date - the date to start counting from + * @returns {Date} the next Monday * @throws {TypeError} 1 argument required * * @example - * // If today is 25 September 2014, is 2 July 2014 in this quarter? - * var result = isThisQuarter(new Date(2014, 6, 2)) - * //=> true + * // When is the next Monday after Mar, 22, 2020? + * const result = nextMonday(new Date(2020, 2, 22)) + * //=> Mon Mar 23 2020 00:00:00 */ -function isThisQuarter(dirtyDate) { +function nextMonday(date) { (0, _index2.default)(1, arguments); - return (0, _index.default)(Date.now(), dirtyDate); + return (0, _index.default)(date, 1); } - module.exports = exports.default; /***/ }), -/* 495 */, -/* 496 */, -/* 497 */ -/***/ (function(module, exports) { + +/***/ 363: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = buildFormatLongFn; - -function buildFormatLongFn(args) { - return function (dirtyOptions) { - var options = dirtyOptions || {}; - var width = options.width ? String(options.width) : args.defaultWidth; - var format = args.formats[width] || args.formats[args.defaultWidth]; - return format; - }; +})); +exports["default"] = nextSaturday; +var _index = _interopRequireDefault(__nccwpck_require__(6771)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name nextSaturday + * @category Weekday Helpers + * @summary When is the next Saturday? + * + * @description + * When is the next Saturday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the next Saturday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the next Saturday after Mar, 22, 2020? + * const result = nextSaturday(new Date(2020, 2, 22)) + * //=> Sat Mar 28 2020 00:00:00 + */ +function nextSaturday(date) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(date, 6); } - module.exports = exports.default; /***/ }), -/* 498 */, -/* 499 */, -/* 500 */, -/* 501 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; -const {promisify} = __webpack_require__(292); -const fs = __webpack_require__(826); +/***/ 7266: +/***/ ((module, exports, __nccwpck_require__) => { -async function isType(fsStatType, statsMethodName, filePath) { - if (typeof filePath !== 'string') { - throw new TypeError(`Expected a string, got ${typeof filePath}`); - } +"use strict"; - try { - const stats = await promisify(fs[fsStatType])(filePath); - return stats[statsMethodName](); - } catch (error) { - if (error.code === 'ENOENT') { - return false; - } - throw error; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = nextSunday; +var _index = _interopRequireDefault(__nccwpck_require__(6771)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name nextSunday + * @category Weekday Helpers + * @summary When is the next Sunday? + * + * @description + * When is the next Sunday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the next Sunday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the next Sunday after Mar, 22, 2020? + * const result = nextSunday(new Date(2020, 2, 22)) + * //=> Sun Mar 29 2020 00:00:00 + */ +function nextSunday(date) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(date, 0); } +module.exports = exports.default; -function isTypeSync(fsStatType, statsMethodName, filePath) { - if (typeof filePath !== 'string') { - throw new TypeError(`Expected a string, got ${typeof filePath}`); - } +/***/ }), - try { - return fs[fsStatType](filePath)[statsMethodName](); - } catch (error) { - if (error.code === 'ENOENT') { - return false; - } +/***/ 9457: +/***/ ((module, exports, __nccwpck_require__) => { - throw error; - } -} +"use strict"; -exports.isFile = isType.bind(null, 'stat', 'isFile'); -exports.isDirectory = isType.bind(null, 'stat', 'isDirectory'); -exports.isSymlink = isType.bind(null, 'lstat', 'isSymbolicLink'); -exports.isFileSync = isTypeSync.bind(null, 'statSync', 'isFile'); -exports.isDirectorySync = isTypeSync.bind(null, 'statSync', 'isDirectory'); -exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink'); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = nextThursday; +var _index = _interopRequireDefault(__nccwpck_require__(6771)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name nextThursday + * @category Weekday Helpers + * @summary When is the next Thursday? + * + * @description + * When is the next Thursday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the next Thursday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the next Thursday after Mar, 22, 2020? + * const result = nextThursday(new Date(2020, 2, 22)) + * //=> Thur Mar 26 2020 00:00:00 + */ +function nextThursday(date) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(date, 4); +} +module.exports = exports.default; /***/ }), -/* 502 */, -/* 503 */, -/* 504 */, -/* 505 */, -/* 506 */, -/* 507 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 7894: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = isBefore; +})); +exports["default"] = nextTuesday; +var _index = _interopRequireDefault(__nccwpck_require__(6771)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name nextTuesday + * @category Weekday Helpers + * @summary When is the next Tuesday? + * + * @description + * When is the next Tuesday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the next Tuesday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the next Tuesday after Mar, 22, 2020? + * const result = nextTuesday(new Date(2020, 2, 22)) + * //=> Tue Mar 24 2020 00:00:00 + */ +function nextTuesday(date) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(date, 2); +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(773)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(217)); +/***/ 29: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = nextWednesday; +var _index = _interopRequireDefault(__nccwpck_require__(6771)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name isBefore - * @category Common Helpers - * @summary Is the first date before the second one? + * @name nextWednesday + * @category Weekday Helpers + * @summary When is the next Wednesday? * * @description - * Is the first date before the second one? - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * When is the next Wednesday? * - * @param {Date|Number} date - the date that should be before the other one to return true - * @param {Date|Number} dateToCompare - the date to compare with - * @returns {Boolean} the first date is before the second date - * @throws {TypeError} 2 arguments required + * @param {Date | number} date - the date to start counting from + * @returns {Date} the next Wednesday + * @throws {TypeError} 1 argument required * * @example - * // Is 10 July 1989 before 11 February 1987? - * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11)) - * //=> false + * // When is the next Wednesday after Mar, 22, 2020? + * const result = nextWednesday(new Date(2020, 2, 22)) + * //=> Wed Mar 25 2020 00:00:00 */ -function isBefore(dirtyDate, dirtyDateToCompare) { - (0, _index2.default)(2, arguments); - var date = (0, _index.default)(dirtyDate); - var dateToCompare = (0, _index.default)(dirtyDateToCompare); - return date.getTime() < dateToCompare.getTime(); +function nextWednesday(date) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(date, 3); } - module.exports = exports.default; /***/ }), -/* 508 */, -/* 509 */, -/* 510 */, -/* 511 */, -/* 512 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -var conversions = __webpack_require__(626); -/* - this function routes a model to all other models. +/***/ 5619: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). +"use strict"; - conversions that are not possible simply are not included. -*/ -function buildGraph() { - var graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - var models = Object.keys(conversions); - - for (var len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - - return graph; -} - -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - var graph = buildGraph(); - var queue = [fromModel]; // unshift -> queue -> pop - - graph[fromModel].distance = 0; - - while (queue.length) { - var current = queue.pop(); - var adjacents = Object.keys(conversions[current]); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Parser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Setter = __nccwpck_require__(5665); +var Parser = /*#__PURE__*/function () { + function Parser() { + (0, _classCallCheck2.default)(this, Parser); + (0, _defineProperty2.default)(this, "incompatibleTokens", void 0); + (0, _defineProperty2.default)(this, "priority", void 0); + (0, _defineProperty2.default)(this, "subPriority", void 0); + } + (0, _createClass2.default)(Parser, [{ + key: "run", + value: function run(dateString, token, match, options) { + var result = this.parse(dateString, token, match, options); + if (!result) { + return null; + } + return { + setter: new _Setter.ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority), + rest: result.rest + }; + } + }, { + key: "validate", + value: function validate(_utcDate, _value, _options) { + return true; + } + }]); + return Parser; +}(); +exports.Parser = Parser; - for (var len = adjacents.length, i = 0; i < len; i++) { - var adjacent = adjacents[i]; - var node = graph[adjacent]; +/***/ }), - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } +/***/ 5665: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return graph; -} +"use strict"; -function link(from, to) { - return function (args) { - return to(from(args)); - }; -} -function wrapConversion(toModel, graph) { - var path = [graph[toModel].parent, toModel]; - var fn = conversions[graph[toModel].parent][toModel]; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ValueSetter = exports.Setter = exports.DateToSystemTimezoneSetter = void 0; +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var TIMEZONE_UNIT_PRIORITY = 10; +var Setter = /*#__PURE__*/function () { + function Setter() { + (0, _classCallCheck2.default)(this, Setter); + (0, _defineProperty2.default)(this, "priority", void 0); + (0, _defineProperty2.default)(this, "subPriority", 0); + } + (0, _createClass2.default)(Setter, [{ + key: "validate", + value: function validate(_utcDate, _options) { + return true; + } + }]); + return Setter; +}(); +exports.Setter = Setter; +var ValueSetter = /*#__PURE__*/function (_Setter) { + (0, _inherits2.default)(ValueSetter, _Setter); + var _super = (0, _createSuper2.default)(ValueSetter); + function ValueSetter(value, validateValue, setValue, priority, subPriority) { + var _this; + (0, _classCallCheck2.default)(this, ValueSetter); + _this = _super.call(this); + _this.value = value; + _this.validateValue = validateValue; + _this.setValue = setValue; + _this.priority = priority; + if (subPriority) { + _this.subPriority = subPriority; + } + return _this; + } + (0, _createClass2.default)(ValueSetter, [{ + key: "validate", + value: function validate(utcDate, options) { + return this.validateValue(utcDate, this.value, options); + } + }, { + key: "set", + value: function set(utcDate, flags, options) { + return this.setValue(utcDate, flags, this.value, options); + } + }]); + return ValueSetter; +}(Setter); +exports.ValueSetter = ValueSetter; +var DateToSystemTimezoneSetter = /*#__PURE__*/function (_Setter2) { + (0, _inherits2.default)(DateToSystemTimezoneSetter, _Setter2); + var _super2 = (0, _createSuper2.default)(DateToSystemTimezoneSetter); + function DateToSystemTimezoneSetter() { + var _this2; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this2), "priority", TIMEZONE_UNIT_PRIORITY); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this2), "subPriority", -1); + return _this2; + } + (0, _createClass2.default)(DateToSystemTimezoneSetter, [{ + key: "set", + value: function set(date, flags) { + if (flags.timestampIsSet) { + return date; + } + var convertedDate = new Date(0); + convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()); + convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds()); + return convertedDate; + } + }]); + return DateToSystemTimezoneSetter; +}(Setter); +exports.DateToSystemTimezoneSetter = DateToSystemTimezoneSetter; - var cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } +/***/ }), - fn.conversion = path; - return fn; -} +/***/ 463: +/***/ ((__unused_webpack_module, exports) => { -module.exports = function (fromModel) { - var graph = deriveBFS(fromModel); - var conversion = {}; +"use strict"; - var models = Object.keys(graph); - for (var len = models.length, i = 0; i < len; i++) { - var toModel = models[i]; - var node = graph[toModel]; - if (node.parent === null) { - // no possible conversion, or this node is the source model. - continue; - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.timezonePatterns = exports.numericPatterns = void 0; +var numericPatterns = { + month: /^(1[0-2]|0?\d)/, + // 0 to 12 + date: /^(3[0-1]|[0-2]?\d)/, + // 0 to 31 + dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, + // 0 to 366 + week: /^(5[0-3]|[0-4]?\d)/, + // 0 to 53 + hour23h: /^(2[0-3]|[0-1]?\d)/, + // 0 to 23 + hour24h: /^(2[0-4]|[0-1]?\d)/, + // 0 to 24 + hour11h: /^(1[0-1]|0?\d)/, + // 0 to 11 + hour12h: /^(1[0-2]|0?\d)/, + // 0 to 12 + minute: /^[0-5]?\d/, + // 0 to 59 + second: /^[0-5]?\d/, + // 0 to 59 - conversion[toModel] = wrapConversion(toModel, graph); - } + singleDigit: /^\d/, + // 0 to 9 + twoDigits: /^\d{1,2}/, + // 0 to 99 + threeDigits: /^\d{1,3}/, + // 0 to 999 + fourDigits: /^\d{1,4}/, + // 0 to 9999 - return conversion; + anyDigitsSigned: /^-?\d+/, + singleDigitSigned: /^-?\d/, + // 0 to 9, -0 to -9 + twoDigitsSigned: /^-?\d{1,2}/, + // 0 to 99, -0 to -99 + threeDigitsSigned: /^-?\d{1,3}/, + // 0 to 999, -0 to -999 + fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999 }; - - +exports.numericPatterns = numericPatterns; +var timezonePatterns = { + basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, + basic: /^([+-])(\d{2})(\d{2})|Z/, + basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, + extended: /^([+-])(\d{2}):(\d{2})|Z/, + extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/ +}; +exports.timezonePatterns = timezonePatterns; /***/ }), -/* 513 */ -/***/ (function(__unusedmodule, exports) { - -"use strict"; +/***/ 9187: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const Char = { - ANCHOR: '&', - COMMENT: '#', - TAG: '!', - DIRECTIVES_END: '-', - DOCUMENT_END: '.' -}; -const Type = { - ALIAS: 'ALIAS', - BLANK_LINE: 'BLANK_LINE', - BLOCK_FOLDED: 'BLOCK_FOLDED', - BLOCK_LITERAL: 'BLOCK_LITERAL', - COMMENT: 'COMMENT', - DIRECTIVE: 'DIRECTIVE', - DOCUMENT: 'DOCUMENT', - FLOW_MAP: 'FLOW_MAP', - FLOW_SEQ: 'FLOW_SEQ', - MAP: 'MAP', - MAP_KEY: 'MAP_KEY', - MAP_VALUE: 'MAP_VALUE', - PLAIN: 'PLAIN', - QUOTE_DOUBLE: 'QUOTE_DOUBLE', - QUOTE_SINGLE: 'QUOTE_SINGLE', - SEQ: 'SEQ', - SEQ_ITEM: 'SEQ_ITEM' -}; -const defaultTagPrefix = 'tag:yaml.org,2002:'; -const defaultTags = { - MAP: 'tag:yaml.org,2002:map', - SEQ: 'tag:yaml.org,2002:seq', - STR: 'tag:yaml.org,2002:str' -}; +"use strict"; -function findLineStarts(src) { - const ls = [0]; - let offset = src.indexOf('\n'); - while (offset !== -1) { - offset += 1; - ls.push(offset); - offset = src.indexOf('\n', offset); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.AMPMMidnightParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var AMPMMidnightParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(AMPMMidnightParser, _Parser); + var _super = (0, _createSuper2.default)(AMPMMidnightParser); + function AMPMMidnightParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 80); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']); + return _this; } + (0, _createClass2.default)(AMPMMidnightParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'b': + case 'bb': + case 'bbb': + return match.dayPeriod(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + case 'bbbbb': + return match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + case 'bbbb': + default: + return match.dayPeriod(dateString, { + width: 'wide', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + } + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); + return date; + } + }]); + return AMPMMidnightParser; +}(_Parser2.Parser); +exports.AMPMMidnightParser = AMPMMidnightParser; - return ls; -} +/***/ }), -function getSrcInfo(cst) { - let lineStarts, src; +/***/ 8678: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (typeof cst === 'string') { - lineStarts = findLineStarts(cst); - src = cst; - } else { - if (Array.isArray(cst)) cst = cst[0]; +"use strict"; - if (cst && cst.context) { - if (!cst.lineStarts) cst.lineStarts = findLineStarts(cst.context.src); - lineStarts = cst.lineStarts; - src = cst.context.src; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.AMPMParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var AMPMParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(AMPMParser, _Parser); + var _super = (0, _createSuper2.default)(AMPMParser); + function AMPMParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 80); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['b', 'B', 'H', 'k', 't', 'T']); + return _this; } + (0, _createClass2.default)(AMPMParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'a': + case 'aa': + case 'aaa': + return match.dayPeriod(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + case 'aaaaa': + return match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + case 'aaaa': + default: + return match.dayPeriod(dateString, { + width: 'wide', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + } + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); + return date; + } + }]); + return AMPMParser; +}(_Parser2.Parser); +exports.AMPMParser = AMPMParser; - return { - lineStarts, - src - }; -} -/** - * @typedef {Object} LinePos - One-indexed position in the source - * @property {number} line - * @property {number} col - */ - -/** - * Determine the line/col position matching a character offset. - * - * Accepts a source string or a CST document as the second parameter. With - * the latter, starting indices for lines are cached in the document as - * `lineStarts: number[]`. - * - * Returns a one-indexed `{ line, col }` location if found, or - * `undefined` otherwise. - * - * @param {number} offset - * @param {string|Document|Document[]} cst - * @returns {?LinePos} - */ +/***/ }), +/***/ 4757: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function getLinePos(offset, cst) { - if (typeof offset !== 'number' || offset < 0) return null; - const { - lineStarts, - src - } = getSrcInfo(cst); - if (!lineStarts || !src || offset > src.length) return null; +"use strict"; - for (let i = 0; i < lineStarts.length; ++i) { - const start = lineStarts[i]; - if (offset < start) { - return { - line: i, - col: offset - lineStarts[i - 1] + 1 - }; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.DateParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _utils = __nccwpck_require__(9042); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +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 DateParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(DateParser, _Parser); + var _super = (0, _createSuper2.default)(DateParser); + function DateParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 90); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "subPriority", 1); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); + return _this; + } + (0, _createClass2.default)(DateParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'd': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.date, dateString); + case 'do': + return match.ordinalNumber(dateString, { + unit: 'date' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } } + }, { + key: "validate", + value: function validate(date, value) { + var year = date.getUTCFullYear(); + var isLeapYear = (0, _utils.isLeapYearIndex)(year); + var month = date.getUTCMonth(); + if (isLeapYear) { + return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]; + } else { + return value >= 1 && value <= DAYS_IN_MONTH[month]; + } + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCDate(value); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return DateParser; +}(_Parser2.Parser); +exports.DateParser = DateParser; - if (offset === start) return { - line: i + 1, - col: 1 - }; - } - - const line = lineStarts.length; - return { - line, - col: offset - lineStarts[line - 1] + 1 - }; -} -/** - * Get a specified line from the source. - * - * Accepts a source string or a CST document as the second parameter. With - * the latter, starting indices for lines are cached in the document as - * `lineStarts: number[]`. - * - * Returns the line as a string if found, or `null` otherwise. - * - * @param {number} line One-indexed line number - * @param {string|Document|Document[]} cst - * @returns {?string} - */ - -function getLine(line, cst) { - const { - lineStarts, - src - } = getSrcInfo(cst); - if (!lineStarts || !(line >= 1) || line > lineStarts.length) return null; - const start = lineStarts[line - 1]; - let end = lineStarts[line]; // undefined for last line; that's ok for slice() +/***/ }), - while (end && end > start && src[end - 1] === '\n') --end; +/***/ 7001: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return src.slice(start, end); -} -/** - * Pretty-print the starting line from the source indicated by the range `pos` - * - * Trims output to `maxWidth` chars while keeping the starting column visible, - * using `…` at either end to indicate dropped characters. - * - * Returns a two-line string (or `null`) with `\n` as separator; the second line - * will hold appropriately indented `^` marks indicating the column range. - * - * @param {Object} pos - * @param {LinePos} pos.start - * @param {LinePos} [pos.end] - * @param {string|Document|Document[]*} cst - * @param {number} [maxWidth=80] - * @returns {?string} - */ +"use strict"; -function getPrettyContext({ - start, - end -}, cst, maxWidth = 80) { - let src = getLine(start.line, cst); - if (!src) return null; - let { - col - } = start; - if (src.length > maxWidth) { - if (col <= maxWidth - 10) { - src = src.substr(0, maxWidth - 1) + '…'; - } else { - const halfWidth = Math.round(maxWidth / 2); - if (src.length > col + halfWidth) src = src.substr(0, col + halfWidth - 1) + '…'; - col -= src.length - maxWidth; - src = '…' + src.substr(1 - maxWidth); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.DayOfYearParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var DayOfYearParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(DayOfYearParser, _Parser); + var _super = (0, _createSuper2.default)(DayOfYearParser); + function DayOfYearParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 90); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "subpriority", 1); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']); + return _this; } - - let errLen = 1; - let errEnd = ''; - - if (end) { - if (end.line === start.line && col + (end.col - start.col) <= maxWidth + 1) { - errLen = end.col - start.col; - } else { - errLen = Math.min(src.length + 1, maxWidth) - col; - errEnd = '…'; + (0, _createClass2.default)(DayOfYearParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'D': + case 'DD': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.dayOfYear, dateString); + case 'Do': + return match.ordinalNumber(dateString, { + unit: 'date' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } } - } + }, { + key: "validate", + value: function validate(date, value) { + var year = date.getUTCFullYear(); + var isLeapYear = (0, _utils.isLeapYearIndex)(year); + if (isLeapYear) { + return value >= 1 && value <= 366; + } else { + return value >= 1 && value <= 365; + } + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCMonth(0, value); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return DayOfYearParser; +}(_Parser2.Parser); +exports.DayOfYearParser = DayOfYearParser; - const offset = col > 1 ? ' '.repeat(col - 1) : ''; - const err = '^'.repeat(errLen); - return `${src}\n${offset}${err}${errEnd}`; -} +/***/ }), -class Range { - static copy(orig) { - return new Range(orig.start, orig.end); - } +/***/ 2280: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - constructor(start, end) { - this.start = start; - this.end = end || start; - } +"use strict"; - isEmpty() { - return typeof this.start !== 'number' || !this.end || this.end <= this.start; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.DayParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _index = _interopRequireDefault(__nccwpck_require__(2694)); +// Day of week +var DayParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(DayParser, _Parser); + var _super = (0, _createSuper2.default)(DayParser); + function DayParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 90); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['D', 'i', 'e', 'c', 't', 'T']); + return _this; } - /** - * Set `origStart` and `origEnd` to point to the original source range for - * this node, which may differ due to dropped CR characters. - * - * @param {number[]} cr - Positions of dropped CR characters - * @param {number} offset - Starting index of `cr` from the last call - * @returns {number} - The next offset, matching the one found for `origStart` - */ + (0, _createClass2.default)(DayParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + // Tue + case 'E': + case 'EE': + case 'EEE': + return match.day(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }); + // T + case 'EEEEE': + return match.day(dateString, { + width: 'narrow', + context: 'formatting' + }); + // Tu + case 'EEEEEE': + return match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }); + // Tuesday + case 'EEEE': + default: + return match.day(dateString, { + width: 'wide', + context: 'formatting' + }) || match.day(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 6; + } + }, { + key: "set", + value: function set(date, _flags, value, options) { + date = (0, _index.default)(date, value, options); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return DayParser; +}(_Parser2.Parser); +exports.DayParser = DayParser; +/***/ }), - setOrigRange(cr, offset) { - const { - start, - end - } = this; +/***/ 9273: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (cr.length === 0 || end <= cr[0]) { - this.origStart = start; - this.origEnd = end; - return offset; - } +"use strict"; - let i = offset; - while (i < cr.length) { - if (cr[i] > start) break;else ++i; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.DayPeriodParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +// in the morning, in the afternoon, in the evening, at night +var DayPeriodParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(DayPeriodParser, _Parser); + var _super = (0, _createSuper2.default)(DayPeriodParser); + function DayPeriodParser() { + var _this; + (0, _classCallCheck2.default)(this, DayPeriodParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - - this.origStart = start + i; - const nextOffset = i; - - while (i < cr.length) { - // if end was at \n, it should now be at \r - if (cr[i] >= end) break;else ++i; - } - - this.origEnd = end + i; - return nextOffset; + _this = _super.call.apply(_super, [this].concat(args)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 80); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['a', 'b', 't', 'T']); + return _this; } + (0, _createClass2.default)(DayPeriodParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'B': + case 'BB': + case 'BBB': + return match.dayPeriod(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + case 'BBBBB': + return match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + case 'BBBB': + default: + return match.dayPeriod(dateString, { + width: 'wide', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.dayPeriod(dateString, { + width: 'narrow', + context: 'formatting' + }); + } + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0); + return date; + } + }]); + return DayPeriodParser; +}(_Parser2.Parser); +exports.DayPeriodParser = DayPeriodParser; -} - -/** Root class of all nodes */ +/***/ }), -class Node { - static addStringTerminator(src, offset, str) { - if (str[str.length - 1] === '\n') return str; - const next = Node.endOfWhiteSpace(src, offset); - return next >= src.length || src[next] === '\n' ? str + '\n' : str; - } // ^(---|...) +/***/ 6309: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +"use strict"; - static atDocumentBoundary(src, offset, sep) { - const ch0 = src[offset]; - if (!ch0) return true; - const prev = src[offset - 1]; - if (prev && prev !== '\n') return false; - if (sep) { - if (ch0 !== sep) return false; - } else { - if (ch0 !== Char.DIRECTIVES_END && ch0 !== Char.DOCUMENT_END) return false; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.EraParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var EraParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(EraParser, _Parser); + var _super = (0, _createSuper2.default)(EraParser); + function EraParser() { + var _this; + (0, _classCallCheck2.default)(this, EraParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - - const ch1 = src[offset + 1]; - const ch2 = src[offset + 2]; - if (ch1 !== ch0 || ch2 !== ch0) return false; - const ch3 = src[offset + 3]; - return !ch3 || ch3 === '\n' || ch3 === '\t' || ch3 === ' '; + _this = _super.call.apply(_super, [this].concat(args)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 140); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['R', 'u', 't', 'T']); + return _this; } + (0, _createClass2.default)(EraParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + // AD, BC + case 'G': + case 'GG': + case 'GGG': + return match.era(dateString, { + width: 'abbreviated' + }) || match.era(dateString, { + width: 'narrow' + }); + // A, B + case 'GGGGG': + return match.era(dateString, { + width: 'narrow' + }); + // Anno Domini, Before Christ + case 'GGGG': + default: + return match.era(dateString, { + width: 'wide' + }) || match.era(dateString, { + width: 'abbreviated' + }) || match.era(dateString, { + width: 'narrow' + }); + } + } + }, { + key: "set", + value: function set(date, flags, value) { + flags.era = value; + date.setUTCFullYear(value, 0, 1); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return EraParser; +}(_Parser2.Parser); +exports.EraParser = EraParser; - static endOfIdentifier(src, offset) { - let ch = src[offset]; - const isVerbatim = ch === '<'; - const notOk = isVerbatim ? ['\n', '\t', ' ', '>'] : ['\n', '\t', ' ', '[', ']', '{', '}', ',']; - - while (ch && notOk.indexOf(ch) === -1) ch = src[offset += 1]; +/***/ }), - if (isVerbatim && ch === '>') offset += 1; - return offset; - } +/***/ 4754: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - static endOfIndent(src, offset) { - let ch = src[offset]; +"use strict"; - while (ch === ' ') ch = src[offset += 1]; - return offset; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ExtendedYearParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var ExtendedYearParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(ExtendedYearParser, _Parser); + var _super = (0, _createSuper2.default)(ExtendedYearParser); + function ExtendedYearParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 130); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']); + return _this; } + (0, _createClass2.default)(ExtendedYearParser, [{ + key: "parse", + value: function parse(dateString, token) { + if (token === 'u') { + return (0, _utils.parseNDigitsSigned)(4, dateString); + } + return (0, _utils.parseNDigitsSigned)(token.length, dateString); + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCFullYear(value, 0, 1); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return ExtendedYearParser; +}(_Parser2.Parser); +exports.ExtendedYearParser = ExtendedYearParser; - static endOfLine(src, offset) { - let ch = src[offset]; - - while (ch && ch !== '\n') ch = src[offset += 1]; +/***/ }), - return offset; - } +/***/ 5194: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - static endOfWhiteSpace(src, offset) { - let ch = src[offset]; +"use strict"; - while (ch === '\t' || ch === ' ') ch = src[offset += 1]; - return offset; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.FractionOfSecondParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var FractionOfSecondParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(FractionOfSecondParser, _Parser); + var _super = (0, _createSuper2.default)(FractionOfSecondParser); + function FractionOfSecondParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 30); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['t', 'T']); + return _this; } + (0, _createClass2.default)(FractionOfSecondParser, [{ + key: "parse", + value: function parse(dateString, token) { + var valueCallback = function valueCallback(value) { + return Math.floor(value * Math.pow(10, -token.length + 3)); + }; + return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback); + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCMilliseconds(value); + return date; + } + }]); + return FractionOfSecondParser; +}(_Parser2.Parser); +exports.FractionOfSecondParser = FractionOfSecondParser; - static startOfLine(src, offset) { - let ch = src[offset - 1]; - if (ch === '\n') return offset; - - while (ch && ch !== '\n') ch = src[offset -= 1]; +/***/ }), - return offset + 1; - } - /** - * End of indentation, or null if the line's indent level is not more - * than `indent` - * - * @param {string} src - * @param {number} indent - * @param {number} lineStart - * @returns {?number} - */ +/***/ 323: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +"use strict"; - static endOfBlockIndent(src, indent, lineStart) { - const inEnd = Node.endOfIndent(src, lineStart); - if (inEnd > lineStart + indent) { - return inEnd; - } else { - const wsEnd = Node.endOfWhiteSpace(src, inEnd); - const ch = src[wsEnd]; - if (!ch || ch === '\n') return wsEnd; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Hour0To11Parser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var Hour0To11Parser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(Hour0To11Parser, _Parser); + var _super = (0, _createSuper2.default)(Hour0To11Parser); + function Hour0To11Parser() { + var _this; + (0, _classCallCheck2.default)(this, Hour0To11Parser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - - return null; + _this = _super.call.apply(_super, [this].concat(args)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 70); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['h', 'H', 'k', 't', 'T']); + return _this; } + (0, _createClass2.default)(Hour0To11Parser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'K': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.hour11h, dateString); + case 'Ko': + return match.ordinalNumber(dateString, { + unit: 'hour' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 11; + } + }, { + key: "set", + value: function set(date, _flags, value) { + var isPM = date.getUTCHours() >= 12; + if (isPM && value < 12) { + date.setUTCHours(value + 12, 0, 0, 0); + } else { + date.setUTCHours(value, 0, 0, 0); + } + return date; + } + }]); + return Hour0To11Parser; +}(_Parser2.Parser); +exports.Hour0To11Parser = Hour0To11Parser; - static atBlank(src, offset, endAsBlank) { - const ch = src[offset]; - return ch === '\n' || ch === '\t' || ch === ' ' || endAsBlank && !ch; - } +/***/ }), - static nextNodeIsIndented(ch, indentDiff, indicatorAsIndent) { - if (!ch || indentDiff < 0) return false; - if (indentDiff > 0) return true; - return indicatorAsIndent && ch === '-'; - } // should be at line or string end, or at next non-whitespace char +/***/ 2610: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +"use strict"; - static normalizeOffset(src, offset) { - const ch = src[offset]; - return !ch ? offset : ch !== '\n' && src[offset - 1] === '\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset); - } // fold single newline into space, multiple newlines to N - 1 newlines - // presumes src[offset] === '\n' +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Hour0to23Parser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var Hour0to23Parser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(Hour0to23Parser, _Parser); + var _super = (0, _createSuper2.default)(Hour0to23Parser); + function Hour0to23Parser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 70); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['a', 'b', 'h', 'K', 'k', 't', 'T']); + return _this; + } + (0, _createClass2.default)(Hour0to23Parser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'H': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.hour23h, dateString); + case 'Ho': + return match.ordinalNumber(dateString, { + unit: 'hour' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 23; + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCHours(value, 0, 0, 0); + return date; + } + }]); + return Hour0to23Parser; +}(_Parser2.Parser); +exports.Hour0to23Parser = Hour0to23Parser; - static foldNewline(src, offset, indent) { - let inCount = 0; - let error = false; - let fold = ''; - let ch = src[offset + 1]; +/***/ }), - while (ch === ' ' || ch === '\t' || ch === '\n') { - switch (ch) { - case '\n': - inCount = 0; - offset += 1; - fold += '\n'; - break; +/***/ 5980: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - case '\t': - if (inCount <= indent) error = true; - offset = Node.endOfWhiteSpace(src, offset + 2) - 1; - break; +"use strict"; - case ' ': - inCount += 1; - offset += 1; - break; - } - ch = src[offset + 1]; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Hour1To24Parser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var Hour1To24Parser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(Hour1To24Parser, _Parser); + var _super = (0, _createSuper2.default)(Hour1To24Parser); + function Hour1To24Parser() { + var _this; + (0, _classCallCheck2.default)(this, Hour1To24Parser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - - if (!fold) fold = ' '; - if (ch && inCount <= indent) error = true; - return { - fold, - offset, - error - }; - } - - constructor(type, props, context) { - Object.defineProperty(this, 'context', { - value: context || null, - writable: true - }); - this.error = null; - this.range = null; - this.valueRange = null; - this.props = props || []; - this.type = type; - this.value = null; - } - - getPropValue(idx, key, skipKey) { - if (!this.context) return null; - const { - src - } = this.context; - const prop = this.props[idx]; - return prop && src[prop.start] === key ? src.slice(prop.start + (skipKey ? 1 : 0), prop.end) : null; + _this = _super.call.apply(_super, [this].concat(args)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 70); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['a', 'b', 'h', 'H', 'K', 't', 'T']); + return _this; } - - get anchor() { - for (let i = 0; i < this.props.length; ++i) { - const anchor = this.getPropValue(i, Char.ANCHOR, true); - if (anchor != null) return anchor; + (0, _createClass2.default)(Hour1To24Parser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'k': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.hour24h, dateString); + case 'ko': + return match.ordinalNumber(dateString, { + unit: 'hour' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 1 && value <= 24; + } + }, { + key: "set", + value: function set(date, _flags, value) { + var hours = value <= 24 ? value % 24 : value; + date.setUTCHours(hours, 0, 0, 0); + return date; + } + }]); + return Hour1To24Parser; +}(_Parser2.Parser); +exports.Hour1To24Parser = Hour1To24Parser; - return null; - } +/***/ }), - get comment() { - const comments = []; +/***/ 7929: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - for (let i = 0; i < this.props.length; ++i) { - const comment = this.getPropValue(i, Char.COMMENT, true); - if (comment != null) comments.push(comment); - } +"use strict"; - return comments.length > 0 ? comments.join('\n') : null; - } - commentHasRequiredWhitespace(start) { - const { - src - } = this.context; - if (this.header && start === this.header.end) return false; - if (!this.valueRange) return false; - const { - end - } = this.valueRange; - return start !== end || Node.atBlank(src, end - 1); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Hour1to12Parser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var Hour1to12Parser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(Hour1to12Parser, _Parser); + var _super = (0, _createSuper2.default)(Hour1to12Parser); + function Hour1to12Parser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 70); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['H', 'K', 'k', 't', 'T']); + return _this; } - - get hasComment() { - if (this.context) { - const { - src - } = this.context; - - for (let i = 0; i < this.props.length; ++i) { - if (src[this.props[i].start] === Char.COMMENT) return true; + (0, _createClass2.default)(Hour1to12Parser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'h': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.hour12h, dateString); + case 'ho': + return match.ordinalNumber(dateString, { + unit: 'hour' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); } } - - return false; - } - - get hasProps() { - if (this.context) { - const { - src - } = this.context; - - for (let i = 0; i < this.props.length; ++i) { - if (src[this.props[i].start] !== Char.COMMENT) return true; + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 1 && value <= 12; + } + }, { + key: "set", + value: function set(date, _flags, value) { + var isPM = date.getUTCHours() >= 12; + if (isPM && value < 12) { + date.setUTCHours(value + 12, 0, 0, 0); + } else if (!isPM && value === 12) { + date.setUTCHours(0, 0, 0, 0); + } else { + date.setUTCHours(value, 0, 0, 0); } + return date; } + }]); + return Hour1to12Parser; +}(_Parser2.Parser); +exports.Hour1to12Parser = Hour1to12Parser; - return false; - } +/***/ }), - get includesTrailingLines() { - return false; - } +/***/ 6376: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - get jsonLike() { - const jsonLikeTypes = [Type.FLOW_MAP, Type.FLOW_SEQ, Type.QUOTE_DOUBLE, Type.QUOTE_SINGLE]; - return jsonLikeTypes.indexOf(this.type) !== -1; - } +"use strict"; - get rangeAsLinePos() { - if (!this.range || !this.context) return undefined; - const start = getLinePos(this.range.start, this.context.root); - if (!start) return undefined; - const end = getLinePos(this.range.end, this.context.root); - return { - start, - end - }; - } - get rawValue() { - if (!this.valueRange || !this.context) return null; - const { - start, - end - } = this.valueRange; - return this.context.src.slice(start, end); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ISODayParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var _index = _interopRequireDefault(__nccwpck_require__(7985)); +// ISO day of week +var ISODayParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(ISODayParser, _Parser); + var _super = (0, _createSuper2.default)(ISODayParser); + function ISODayParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 90); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']); + return _this; } - - get tag() { - for (let i = 0; i < this.props.length; ++i) { - const tag = this.getPropValue(i, Char.TAG, false); - - if (tag != null) { - if (tag[1] === '<') { - return { - verbatim: tag.slice(2, -1) - }; - } else { - // eslint-disable-next-line no-unused-vars - const [_, handle, suffix] = tag.match(/^(.*!)([^!]*)$/); - return { - handle, - suffix - }; + (0, _createClass2.default)(ISODayParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + var valueCallback = function valueCallback(value) { + if (value === 0) { + return 7; } + return value; + }; + switch (token) { + // 2 + case 'i': + case 'ii': + // 02 + return (0, _utils.parseNDigits)(token.length, dateString); + // 2nd + case 'io': + return match.ordinalNumber(dateString, { + unit: 'day' + }); + // Tue + case 'iii': + return (0, _utils.mapValue)(match.day(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }), valueCallback); + // T + case 'iiiii': + return (0, _utils.mapValue)(match.day(dateString, { + width: 'narrow', + context: 'formatting' + }), valueCallback); + // Tu + case 'iiiiii': + return (0, _utils.mapValue)(match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }), valueCallback); + // Tuesday + case 'iiii': + default: + return (0, _utils.mapValue)(match.day(dateString, { + width: 'wide', + context: 'formatting' + }) || match.day(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }), valueCallback); } } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 1 && value <= 7; + } + }, { + key: "set", + value: function set(date, _flags, value) { + date = (0, _index.default)(date, value); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return ISODayParser; +}(_Parser2.Parser); +exports.ISODayParser = ISODayParser; - return null; - } +/***/ }), - get valueRangeContainsNewline() { - if (!this.valueRange || !this.context) return false; - const { - start, - end - } = this.valueRange; - const { - src - } = this.context; +/***/ 9874: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - for (let i = start; i < end; ++i) { - if (src[i] === '\n') return true; - } +"use strict"; - return false; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ISOTimezoneParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +// Timezone (ISO-8601) +var ISOTimezoneParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(ISOTimezoneParser, _Parser); + var _super = (0, _createSuper2.default)(ISOTimezoneParser); + function ISOTimezoneParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 10); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['t', 'T', 'X']); + return _this; } + (0, _createClass2.default)(ISOTimezoneParser, [{ + key: "parse", + value: function parse(dateString, token) { + switch (token) { + case 'x': + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalMinutes, dateString); + case 'xx': + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basic, dateString); + case 'xxxx': + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalSeconds, dateString); + case 'xxxxx': + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.extendedOptionalSeconds, dateString); + case 'xxx': + default: + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.extended, dateString); + } + } + }, { + key: "set", + value: function set(date, flags, value) { + if (flags.timestampIsSet) { + return date; + } + return new Date(date.getTime() - value); + } + }]); + return ISOTimezoneParser; +}(_Parser2.Parser); +exports.ISOTimezoneParser = ISOTimezoneParser; - parseComment(start) { - const { - src - } = this.context; +/***/ }), - if (src[start] === Char.COMMENT) { - const end = Node.endOfLine(src, start + 1); - const commentRange = new Range(start, end); - this.props.push(commentRange); - return end; - } +/***/ 9822: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return start; - } - /** - * Populates the `origStart` and `origEnd` values of all ranges for this - * node. Extended by child classes to handle descendant nodes. - * - * @param {number[]} cr - Positions of dropped CR characters - * @param {number} offset - Starting index of `cr` from the last call - * @returns {number} - The next offset, matching the one found for `origStart` - */ +"use strict"; - setOrigRanges(cr, offset) { - if (this.range) offset = this.range.setOrigRange(cr, offset); - if (this.valueRange) this.valueRange.setOrigRange(cr, offset); - this.props.forEach(prop => prop.setOrigRange(cr, offset)); - return offset; - } - - toString() { - const { - context: { - src - }, - range, - value - } = this; - if (value != null) return value; - const str = src.slice(range.start, range.end); - return Node.addStringTerminator(src, range.end, str); - } - -} - -class YAMLError extends Error { - constructor(name, source, message) { - if (!message || !(source instanceof Node)) throw new Error(`Invalid arguments for new ${name}`); - super(); - this.name = name; - this.message = message; - this.source = source; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ISOTimezoneWithZParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +// Timezone (ISO-8601. +00:00 is `'Z'`) +var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(ISOTimezoneWithZParser, _Parser); + var _super = (0, _createSuper2.default)(ISOTimezoneWithZParser); + function ISOTimezoneWithZParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 10); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['t', 'T', 'x']); + return _this; } - - makePretty() { - if (!this.source) return; - this.nodeType = this.source.type; - const cst = this.source.context && this.source.context.root; - - if (typeof this.offset === 'number') { - this.range = new Range(this.offset, this.offset + 1); - const start = cst && getLinePos(this.offset, cst); - - if (start) { - const end = { - line: start.line, - col: start.col + 1 - }; - this.linePos = { - start, - end + (0, _createClass2.default)(ISOTimezoneWithZParser, [{ + key: "parse", + value: function parse(dateString, token) { + switch (token) { + case 'X': + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalMinutes, dateString); + case 'XX': + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basic, dateString); + case 'XXXX': + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalSeconds, dateString); + case 'XXXXX': + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.extendedOptionalSeconds, dateString); + case 'XXX': + default: + return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.extended, dateString); + } + } + }, { + key: "set", + value: function set(date, flags, value) { + if (flags.timestampIsSet) { + return date; + } + return new Date(date.getTime() - value); + } + }]); + return ISOTimezoneWithZParser; +}(_Parser2.Parser); +exports.ISOTimezoneWithZParser = ISOTimezoneWithZParser; + +/***/ }), + +/***/ 2127: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ISOWeekParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var _index = _interopRequireDefault(__nccwpck_require__(8921)); +var _index2 = _interopRequireDefault(__nccwpck_require__(3061)); +// ISO week of year +var ISOWeekParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(ISOWeekParser, _Parser); + var _super = (0, _createSuper2.default)(ISOWeekParser); + function ISOWeekParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 100); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']); + return _this; + } + (0, _createClass2.default)(ISOWeekParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'I': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.week, dateString); + case 'Io': + return match.ordinalNumber(dateString, { + unit: 'week' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 1 && value <= 53; + } + }, { + key: "set", + value: function set(date, _flags, value) { + return (0, _index2.default)((0, _index.default)(date, value)); + } + }]); + return ISOWeekParser; +}(_Parser2.Parser); +exports.ISOWeekParser = ISOWeekParser; + +/***/ }), + +/***/ 519: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ISOWeekYearParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var _index = _interopRequireDefault(__nccwpck_require__(3061)); +// ISO week-numbering year +var ISOWeekYearParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(ISOWeekYearParser, _Parser); + var _super = (0, _createSuper2.default)(ISOWeekYearParser); + function ISOWeekYearParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 130); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']); + return _this; + } + (0, _createClass2.default)(ISOWeekYearParser, [{ + key: "parse", + value: function parse(dateString, token) { + if (token === 'R') { + return (0, _utils.parseNDigitsSigned)(4, dateString); + } + return (0, _utils.parseNDigitsSigned)(token.length, dateString); + } + }, { + key: "set", + value: function set(_date, _flags, value) { + var firstWeekOfYear = new Date(0); + firstWeekOfYear.setUTCFullYear(value, 0, 4); + firstWeekOfYear.setUTCHours(0, 0, 0, 0); + return (0, _index.default)(firstWeekOfYear); + } + }]); + return ISOWeekYearParser; +}(_Parser2.Parser); +exports.ISOWeekYearParser = ISOWeekYearParser; + +/***/ }), + +/***/ 1190: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.LocalDayParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var _index = _interopRequireDefault(__nccwpck_require__(2694)); +// Local day of week +var LocalDayParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(LocalDayParser, _Parser); + var _super = (0, _createSuper2.default)(LocalDayParser); + function LocalDayParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 90); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']); + return _this; + } + (0, _createClass2.default)(LocalDayParser, [{ + key: "parse", + value: function parse(dateString, token, match, options) { + var valueCallback = function valueCallback(value) { + var wholeWeekDays = Math.floor((value - 1) / 7) * 7; + return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; + }; + switch (token) { + // 3 + case 'e': + case 'ee': + // 03 + return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback); + // 3rd + case 'eo': + return (0, _utils.mapValue)(match.ordinalNumber(dateString, { + unit: 'day' + }), valueCallback); + // Tue + case 'eee': + return match.day(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }); + // T + case 'eeeee': + return match.day(dateString, { + width: 'narrow', + context: 'formatting' + }); + // Tu + case 'eeeeee': + return match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }); + // Tuesday + case 'eeee': + default: + return match.day(dateString, { + width: 'wide', + context: 'formatting' + }) || match.day(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.day(dateString, { + width: 'short', + context: 'formatting' + }) || match.day(dateString, { + width: 'narrow', + context: 'formatting' + }); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 6; + } + }, { + key: "set", + value: function set(date, _flags, value, options) { + date = (0, _index.default)(date, value, options); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return LocalDayParser; +}(_Parser2.Parser); +exports.LocalDayParser = LocalDayParser; + +/***/ }), + +/***/ 6125: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.LocalWeekParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var _index = _interopRequireDefault(__nccwpck_require__(3285)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2258)); +// Local week of year +var LocalWeekParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(LocalWeekParser, _Parser); + var _super = (0, _createSuper2.default)(LocalWeekParser); + function LocalWeekParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 100); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']); + return _this; + } + (0, _createClass2.default)(LocalWeekParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'w': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.week, dateString); + case 'wo': + return match.ordinalNumber(dateString, { + unit: 'week' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 1 && value <= 53; + } + }, { + key: "set", + value: function set(date, _flags, value, options) { + return (0, _index2.default)((0, _index.default)(date, value, options), options); + } + }]); + return LocalWeekParser; +}(_Parser2.Parser); +exports.LocalWeekParser = LocalWeekParser; + +/***/ }), + +/***/ 85: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.LocalWeekYearParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var _index = _interopRequireDefault(__nccwpck_require__(8050)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2258)); +// Local week-numbering year +var LocalWeekYearParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(LocalWeekYearParser, _Parser); + var _super = (0, _createSuper2.default)(LocalWeekYearParser); + function LocalWeekYearParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 130); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']); + return _this; + } + (0, _createClass2.default)(LocalWeekYearParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + var valueCallback = function valueCallback(year) { + return { + year: year, + isTwoDigitYear: token === 'YY' }; + }; + switch (token) { + case 'Y': + return (0, _utils.mapValue)((0, _utils.parseNDigits)(4, dateString), valueCallback); + case 'Yo': + return (0, _utils.mapValue)(match.ordinalNumber(dateString, { + unit: 'year' + }), valueCallback); + default: + return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback); } - - delete this.offset; - } else { - this.range = this.source.range; - this.linePos = this.source.rangeAsLinePos; } - - if (this.linePos) { - const { - line, - col - } = this.linePos.start; - this.message += ` at line ${line}, column ${col}`; - const ctx = cst && getPrettyContext(this.linePos, cst); - if (ctx) this.message += `:\n\n${ctx}\n`; + }, { + key: "validate", + value: function validate(_date, value) { + return value.isTwoDigitYear || value.year > 0; + } + }, { + key: "set", + value: function set(date, flags, value, options) { + var currentYear = (0, _index.default)(date, options); + if (value.isTwoDigitYear) { + var normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(value.year, currentYear); + date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate); + date.setUTCHours(0, 0, 0, 0); + return (0, _index2.default)(date, options); + } + var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year; + date.setUTCFullYear(year, 0, options.firstWeekContainsDate); + date.setUTCHours(0, 0, 0, 0); + return (0, _index2.default)(date, options); } + }]); + return LocalWeekYearParser; +}(_Parser2.Parser); +exports.LocalWeekYearParser = LocalWeekYearParser; - delete this.source; - } +/***/ }), -} -class YAMLReferenceError extends YAMLError { - constructor(source, message) { - super('YAMLReferenceError', source, message); - } +/***/ 4254: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -} -class YAMLSemanticError extends YAMLError { - constructor(source, message) { - super('YAMLSemanticError', source, message); - } +"use strict"; -} -class YAMLSyntaxError extends YAMLError { - constructor(source, message) { - super('YAMLSyntaxError', source, message); - } -} -class YAMLWarning extends YAMLError { - constructor(source, message) { - super('YAMLWarning', source, message); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.MinuteParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var MinuteParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(MinuteParser, _Parser); + var _super = (0, _createSuper2.default)(MinuteParser); + function MinuteParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 60); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['t', 'T']); + return _this; } + (0, _createClass2.default)(MinuteParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 'm': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.minute, dateString); + case 'mo': + return match.ordinalNumber(dateString, { + unit: 'minute' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 59; + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCMinutes(value, 0, 0); + return date; + } + }]); + return MinuteParser; +}(_Parser2.Parser); +exports.MinuteParser = MinuteParser; -} +/***/ }), -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; - } +/***/ 9581: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return obj; -} +"use strict"; -class PlainValue extends Node { - static endOfLine(src, start, inFlow) { - let ch = src[start]; - let offset = start; - while (ch && ch !== '\n') { - if (inFlow && (ch === '[' || ch === ']' || ch === '{' || ch === '}' || ch === ',')) break; - const next = src[offset + 1]; - if (ch === ':' && (!next || next === '\n' || next === '\t' || next === ' ' || inFlow && next === ',')) break; - if ((ch === ' ' || ch === '\t') && next === '#') break; - offset += 1; - ch = next; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.MonthParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _utils = __nccwpck_require__(9042); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var MonthParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(MonthParser, _Parser); + var _super = (0, _createSuper2.default)(MonthParser); + function MonthParser() { + var _this; + (0, _classCallCheck2.default)(this, MonthParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - - return offset; + _this = _super.call.apply(_super, [this].concat(args)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 110); + return _this; } - - get strValue() { - if (!this.valueRange || !this.context) return null; - let { - start, - end - } = this.valueRange; - const { - src - } = this.context; - let ch = src[end - 1]; - - while (start < end && (ch === '\n' || ch === '\t' || ch === ' ')) ch = src[--end - 1]; - - let str = ''; - - for (let i = start; i < end; ++i) { - const ch = src[i]; - - if (ch === '\n') { - const { - fold, - offset - } = Node.foldNewline(src, i, -1); - str += fold; - i = offset; - } else if (ch === ' ' || ch === '\t') { - // trim trailing whitespace - const wsStart = i; - let next = src[i + 1]; - - while (i < end && (next === ' ' || next === '\t')) { - i += 1; - next = src[i + 1]; - } - - if (next !== '\n') str += i > wsStart ? src.slice(wsStart, i + 1) : ch; - } else { - str += ch; + (0, _createClass2.default)(MonthParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + var valueCallback = function valueCallback(value) { + return value - 1; + }; + switch (token) { + // 1, 2, ..., 12 + case 'M': + return (0, _utils.mapValue)((0, _utils.parseNumericPattern)(_constants.numericPatterns.month, dateString), valueCallback); + // 01, 02, ..., 12 + case 'MM': + return (0, _utils.mapValue)((0, _utils.parseNDigits)(2, dateString), valueCallback); + // 1st, 2nd, ..., 12th + case 'Mo': + return (0, _utils.mapValue)(match.ordinalNumber(dateString, { + unit: 'month' + }), valueCallback); + // Jan, Feb, ..., Dec + case 'MMM': + return match.month(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.month(dateString, { + width: 'narrow', + 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, { + width: 'wide', + context: 'formatting' + }) || match.month(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.month(dateString, { + width: 'narrow', + context: 'formatting' + }); } } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 11; + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCMonth(value, 1); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return MonthParser; +}(_Parser2.Parser); +exports.MonthParser = MonthParser; - const ch0 = src[start]; +/***/ }), - switch (ch0) { - case '\t': - { - const msg = 'Plain value cannot start with a tab character'; - const errors = [new YAMLSemanticError(this, msg)]; - return { - errors, - str - }; - } +/***/ 5667: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - case '@': - case '`': - { - const msg = `Plain value cannot start with reserved character ${ch0}`; - const errors = [new YAMLSemanticError(this, msg)]; - return { - errors, - str - }; - } +"use strict"; - default: - return str; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.QuarterParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var QuarterParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(QuarterParser, _Parser); + var _super = (0, _createSuper2.default)(QuarterParser); + function QuarterParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 120); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']); + return _this; } - - parseBlockValue(start) { - const { - indent, - inFlow, - src - } = this.context; - let offset = start; - let valueEnd = start; - - for (let ch = src[offset]; ch === '\n'; ch = src[offset]) { - if (Node.atDocumentBoundary(src, offset + 1)) break; - const end = Node.endOfBlockIndent(src, indent, offset + 1); - if (end === null || src[end] === '#') break; - - if (src[end] === '\n') { - offset = end; - } else { - valueEnd = PlainValue.endOfLine(src, end, inFlow); - offset = valueEnd; + (0, _createClass2.default)(QuarterParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + // 1, 2, 3, 4 + case 'Q': + case 'QQ': + // 01, 02, 03, 04 + return (0, _utils.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', + context: 'formatting' + }) || match.quarter(dateString, { + width: 'narrow', + 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, { + width: 'wide', + context: 'formatting' + }) || match.quarter(dateString, { + width: 'abbreviated', + context: 'formatting' + }) || match.quarter(dateString, { + width: 'narrow', + context: 'formatting' + }); } } - - if (this.valueRange.isEmpty()) this.valueRange.start = start; - this.valueRange.end = valueEnd; - return valueEnd; - } - /** - * Parses a plain value from the source - * - * Accepted forms are: - * ``` - * #comment - * - * first line - * - * first line #comment - * - * first line - * block - * lines - * - * #comment - * block - * lines - * ``` - * where block lines are empty or have an indent level greater than `indent`. - * - * @param {ParseContext} context - * @param {number} start - Index of first character - * @returns {number} - Index of the character after this scalar, may be `\n` - */ - - - parse(context, start) { - this.context = context; - const { - inFlow, - src - } = context; - let offset = start; - const ch = src[offset]; - - if (ch && ch !== '#' && ch !== '\n') { - offset = PlainValue.endOfLine(src, start, inFlow); + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 1 && value <= 4; } - - this.valueRange = new Range(start, offset); - offset = Node.endOfWhiteSpace(src, offset); - offset = this.parseComment(offset); - - if (!this.hasComment || this.valueRange.isEmpty()) { - offset = this.parseBlockValue(offset); + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCMonth((value - 1) * 3, 1); + date.setUTCHours(0, 0, 0, 0); + return date; } + }]); + return QuarterParser; +}(_Parser2.Parser); +exports.QuarterParser = QuarterParser; - return offset; - } - -} +/***/ }), -exports.Char = Char; -exports.Node = Node; -exports.PlainValue = PlainValue; -exports.Range = Range; -exports.Type = Type; -exports.YAMLError = YAMLError; -exports.YAMLReferenceError = YAMLReferenceError; -exports.YAMLSemanticError = YAMLSemanticError; -exports.YAMLSyntaxError = YAMLSyntaxError; -exports.YAMLWarning = YAMLWarning; -exports._defineProperty = _defineProperty; -exports.defaultTagPrefix = defaultTagPrefix; -exports.defaultTags = defaultTags; +/***/ 3478: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +"use strict"; -/***/ }), -/* 514 */, -/* 515 */, -/* 516 */, -/* 517 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -const Range = __webpack_require__(57) -const satisfies = (version, range, options) => { - try { - range = new Range(range, options) - } catch (er) { - return false +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.SecondParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var SecondParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(SecondParser, _Parser); + var _super = (0, _createSuper2.default)(SecondParser); + function SecondParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 50); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['t', 'T']); + return _this; } - return range.test(version) -} -module.exports = satisfies - + (0, _createClass2.default)(SecondParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + case 's': + return (0, _utils.parseNumericPattern)(_constants.numericPatterns.second, dateString); + case 'so': + return match.ordinalNumber(dateString, { + unit: 'second' + }); + default: + return (0, _utils.parseNDigits)(token.length, dateString); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 59; + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCSeconds(value, 0); + return date; + } + }]); + return SecondParser; +}(_Parser2.Parser); +exports.SecondParser = SecondParser; /***/ }), -/* 518 */ -/***/ (function(module, __unusedexports, __webpack_require__) { -"use strict"; +/***/ 1556: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +"use strict"; -var util = __webpack_require__(292); -var isArrayish = __webpack_require__(156); -var errorEx = function errorEx(name, properties) { - if (!name || name.constructor !== String) { - properties = name || {}; - name = Error.name; - } - - var errorExError = function ErrorEXError(message) { - if (!this) { - return new ErrorEXError(message); - } - - message = message instanceof Error - ? message.message - : (message || this.message); - - Error.call(this, message); - Error.captureStackTrace(this, errorExError); - - this.name = name; - - Object.defineProperty(this, 'message', { - configurable: true, - enumerable: false, - get: function () { - var newMessage = message.split(/\r?\n/g); - - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - - var modifier = properties[key]; - - if ('message' in modifier) { - newMessage = modifier.message(this[key], newMessage) || newMessage; - if (!isArrayish(newMessage)) { - newMessage = [newMessage]; - } - } - } - - return newMessage.join('\n'); - }, - set: function (v) { - message = v; - } - }); - - var overwrittenStack = null; - - var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); - var stackGetter = stackDescriptor.get; - var stackValue = stackDescriptor.value; - delete stackDescriptor.value; - delete stackDescriptor.writable; - - stackDescriptor.set = function (newstack) { - overwrittenStack = newstack; - }; - - stackDescriptor.get = function () { - var stack = (overwrittenStack || ((stackGetter) - ? stackGetter.call(this) - : stackValue)).split(/\r?\n+/g); - - // starting in Node 7, the stack builder caches the message. - // just replace it. - if (!overwrittenStack) { - stack[0] = this.name + ': ' + this.message; - } - - var lineCount = 1; - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - - var modifier = properties[key]; - - if ('line' in modifier) { - var line = modifier.line(this[key]); - if (line) { - stack.splice(lineCount++, 0, ' ' + line); - } - } - - if ('stack' in modifier) { - modifier.stack(this[key], stack); - } - } - - return stack.join('\n'); - }; - - Object.defineProperty(this, 'stack', stackDescriptor); - }; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.StandAloneLocalDayParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var _index = _interopRequireDefault(__nccwpck_require__(2694)); +// Stand-alone local day of week +var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(StandAloneLocalDayParser, _Parser); + var _super = (0, _createSuper2.default)(StandAloneLocalDayParser); + function StandAloneLocalDayParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 90); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']); + return _this; + } + (0, _createClass2.default)(StandAloneLocalDayParser, [{ + key: "parse", + value: function parse(dateString, token, match, options) { + var valueCallback = function valueCallback(value) { + var wholeWeekDays = Math.floor((value - 1) / 7) * 7; + return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; + }; + switch (token) { + // 3 + case 'c': + case 'cc': + // 03 + return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback); + // 3rd + case 'co': + return (0, _utils.mapValue)(match.ordinalNumber(dateString, { + unit: 'day' + }), valueCallback); + // Tue + case 'ccc': + return match.day(dateString, { + width: 'abbreviated', + context: 'standalone' + }) || match.day(dateString, { + width: 'short', + context: 'standalone' + }) || match.day(dateString, { + width: 'narrow', + context: 'standalone' + }); + // T + case 'ccccc': + return match.day(dateString, { + width: 'narrow', + context: 'standalone' + }); + // Tu + case 'cccccc': + return match.day(dateString, { + width: 'short', + context: 'standalone' + }) || match.day(dateString, { + width: 'narrow', + context: 'standalone' + }); + // Tuesday + case 'cccc': + default: + return match.day(dateString, { + width: 'wide', + context: 'standalone' + }) || match.day(dateString, { + width: 'abbreviated', + context: 'standalone' + }) || match.day(dateString, { + width: 'short', + context: 'standalone' + }) || match.day(dateString, { + width: 'narrow', + context: 'standalone' + }); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 6; + } + }, { + key: "set", + value: function set(date, _flags, value, options) { + date = (0, _index.default)(date, value, options); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return StandAloneLocalDayParser; +}(_Parser2.Parser); +exports.StandAloneLocalDayParser = StandAloneLocalDayParser; - if (Object.setPrototypeOf) { - Object.setPrototypeOf(errorExError.prototype, Error.prototype); - Object.setPrototypeOf(errorExError, Error); - } else { - util.inherits(errorExError, Error); - } +/***/ }), - return errorExError; -}; +/***/ 9915: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -errorEx.append = function (str, def) { - return { - message: function (v, message) { - v = v || def; +"use strict"; - if (v) { - message[0] += ' ' + str.replace('%s', v.toString()); - } - return message; - } - }; -}; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.StandAloneMonthParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _constants = __nccwpck_require__(463); +var _utils = __nccwpck_require__(9042); +var StandAloneMonthParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(StandAloneMonthParser, _Parser); + var _super = (0, _createSuper2.default)(StandAloneMonthParser); + function StandAloneMonthParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 110); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']); + return _this; + } + (0, _createClass2.default)(StandAloneMonthParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + var valueCallback = function valueCallback(value) { + return value - 1; + }; + switch (token) { + // 1, 2, ..., 12 + case 'L': + return (0, _utils.mapValue)((0, _utils.parseNumericPattern)(_constants.numericPatterns.month, dateString), valueCallback); + // 01, 02, ..., 12 + case 'LL': + return (0, _utils.mapValue)((0, _utils.parseNDigits)(2, dateString), valueCallback); + // 1st, 2nd, ..., 12th + case 'Lo': + return (0, _utils.mapValue)(match.ordinalNumber(dateString, { + unit: 'month' + }), valueCallback); + // Jan, Feb, ..., Dec + case 'LLL': + return match.month(dateString, { + width: 'abbreviated', + context: 'standalone' + }) || match.month(dateString, { + width: 'narrow', + 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, { + width: 'wide', + context: 'standalone' + }) || match.month(dateString, { + width: 'abbreviated', + context: 'standalone' + }) || match.month(dateString, { + width: 'narrow', + context: 'standalone' + }); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 0 && value <= 11; + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCMonth(value, 1); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return StandAloneMonthParser; +}(_Parser2.Parser); +exports.StandAloneMonthParser = StandAloneMonthParser; -errorEx.line = function (str, def) { - return { - line: function (v) { - v = v || def; +/***/ }), - if (v) { - return str.replace('%s', v.toString()); - } +/***/ 2898: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return null; - } - }; -}; +"use strict"; -module.exports = errorEx; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.StandAloneQuarterParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var StandAloneQuarterParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(StandAloneQuarterParser, _Parser); + var _super = (0, _createSuper2.default)(StandAloneQuarterParser); + function StandAloneQuarterParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 120); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']); + return _this; + } + (0, _createClass2.default)(StandAloneQuarterParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + switch (token) { + // 1, 2, 3, 4 + case 'q': + case 'qq': + // 01, 02, 03, 04 + return (0, _utils.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', + context: 'standalone' + }) || match.quarter(dateString, { + width: 'narrow', + 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, { + width: 'wide', + context: 'standalone' + }) || match.quarter(dateString, { + width: 'abbreviated', + context: 'standalone' + }) || match.quarter(dateString, { + width: 'narrow', + context: 'standalone' + }); + } + } + }, { + key: "validate", + value: function validate(_date, value) { + return value >= 1 && value <= 4; + } + }, { + key: "set", + value: function set(date, _flags, value) { + date.setUTCMonth((value - 1) * 3, 1); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return StandAloneQuarterParser; +}(_Parser2.Parser); +exports.StandAloneQuarterParser = StandAloneQuarterParser; /***/ }), -/* 519 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const SemVer = __webpack_require__(653) -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor +/***/ 3726: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/***/ }), -/* 520 */, -/* 521 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +"use strict"; -module.exports = __webpack_require__(792).YAML +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.TimestampMillisecondsParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(TimestampMillisecondsParser, _Parser); + var _super = (0, _createSuper2.default)(TimestampMillisecondsParser); + function TimestampMillisecondsParser() { + var _this; + (0, _classCallCheck2.default)(this, TimestampMillisecondsParser); + 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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 20); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", '*'); + return _this; + } + (0, _createClass2.default)(TimestampMillisecondsParser, [{ + key: "parse", + value: function parse(dateString) { + return (0, _utils.parseAnyDigitsSigned)(dateString); + } + }, { + key: "set", + value: function set(_date, _flags, value) { + return [new Date(value), { + timestampIsSet: true + }]; + } + }]); + return TimestampMillisecondsParser; +}(_Parser2.Parser); +exports.TimestampMillisecondsParser = TimestampMillisecondsParser; /***/ }), -/* 522 */, -/* 523 */, -/* 524 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { + +/***/ 771: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getReleaseTime = void 0; -const execute_1 = __webpack_require__(561); -const getReleaseTime = async (packageManager, packageName) => { - const cmd = { - berry: `yarn npm info ${packageName} --fields time --json`, - npm: `npm view ${packageName} time --json`, - pnpm: `npm view ${packageName} time --json`, - yarn: `yarn info ${packageName} time --json`, - }[packageManager]; - const stdout = await execute_1.execute(cmd); - if (!stdout) { - return {}; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.TimestampSecondsParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +var TimestampSecondsParser = /*#__PURE__*/function (_Parser) { + (0, _inherits2.default)(TimestampSecondsParser, _Parser); + var _super = (0, _createSuper2.default)(TimestampSecondsParser); + function TimestampSecondsParser() { + var _this; + (0, _classCallCheck2.default)(this, TimestampSecondsParser); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - const json = JSON.parse(stdout); - switch (packageManager) { - case "berry": - return json.time; - case "yarn": - return json.data; - case "npm": + _this = _super.call.apply(_super, [this].concat(args)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 40); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", '*'); + return _this; + } + (0, _createClass2.default)(TimestampSecondsParser, [{ + key: "parse", + value: function parse(dateString) { + return (0, _utils.parseAnyDigitsSigned)(dateString); + } + }, { + key: "set", + value: function set(_date, _flags, value) { + return [new Date(value * 1000), { + timestampIsSet: true + }]; + } + }]); + return TimestampSecondsParser; +}(_Parser2.Parser); +exports.TimestampSecondsParser = TimestampSecondsParser; + +/***/ }), + +/***/ 2493: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.YearParser = void 0; +var _classCallCheck2 = _interopRequireDefault(__nccwpck_require__(6383)); +var _createClass2 = _interopRequireDefault(__nccwpck_require__(1957)); +var _assertThisInitialized2 = _interopRequireDefault(__nccwpck_require__(5492)); +var _inherits2 = _interopRequireDefault(__nccwpck_require__(2946)); +var _createSuper2 = _interopRequireDefault(__nccwpck_require__(2588)); +var _defineProperty2 = _interopRequireDefault(__nccwpck_require__(1814)); +var _Parser2 = __nccwpck_require__(5619); +var _utils = __nccwpck_require__(9042); +// 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) { + (0, _inherits2.default)(YearParser, _Parser); + var _super = (0, _createSuper2.default)(YearParser); + function YearParser() { + var _this; + (0, _classCallCheck2.default)(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)); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "priority", 130); + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "incompatibleTokens", ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']); + return _this; + } + (0, _createClass2.default)(YearParser, [{ + key: "parse", + value: function parse(dateString, token, match) { + var valueCallback = function valueCallback(year) { + return { + year: year, + isTwoDigitYear: token === 'yy' + }; + }; + switch (token) { + case 'y': + return (0, _utils.mapValue)((0, _utils.parseNDigits)(4, dateString), valueCallback); + case 'yo': + return (0, _utils.mapValue)(match.ordinalNumber(dateString, { + unit: 'year' + }), valueCallback); default: - return json; + return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback); + } } -}; -exports.getReleaseTime = getReleaseTime; + }, { + key: "validate", + value: function validate(_date, value) { + return value.isTwoDigitYear || value.year > 0; + } + }, { + key: "set", + value: function set(date, flags, value) { + var currentYear = date.getUTCFullYear(); + if (value.isTwoDigitYear) { + var normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(value.year, currentYear); + date.setUTCFullYear(normalizedTwoDigitYear, 0, 1); + date.setUTCHours(0, 0, 0, 0); + return date; + } + var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year; + date.setUTCFullYear(year, 0, 1); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }]); + return YearParser; +}(_Parser2.Parser); +exports.YearParser = YearParser; + +/***/ }), + +/***/ 5193: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.parsers = void 0; +var _EraParser = __nccwpck_require__(6309); +var _YearParser = __nccwpck_require__(2493); +var _LocalWeekYearParser = __nccwpck_require__(85); +var _ISOWeekYearParser = __nccwpck_require__(519); +var _ExtendedYearParser = __nccwpck_require__(4754); +var _QuarterParser = __nccwpck_require__(5667); +var _StandAloneQuarterParser = __nccwpck_require__(2898); +var _MonthParser = __nccwpck_require__(9581); +var _StandAloneMonthParser = __nccwpck_require__(9915); +var _LocalWeekParser = __nccwpck_require__(6125); +var _ISOWeekParser = __nccwpck_require__(2127); +var _DateParser = __nccwpck_require__(4757); +var _DayOfYearParser = __nccwpck_require__(7001); +var _DayParser = __nccwpck_require__(2280); +var _LocalDayParser = __nccwpck_require__(1190); +var _StandAloneLocalDayParser = __nccwpck_require__(1556); +var _ISODayParser = __nccwpck_require__(6376); +var _AMPMParser = __nccwpck_require__(8678); +var _AMPMMidnightParser = __nccwpck_require__(9187); +var _DayPeriodParser = __nccwpck_require__(9273); +var _Hour1to12Parser = __nccwpck_require__(7929); +var _Hour0to23Parser = __nccwpck_require__(2610); +var _Hour0To11Parser = __nccwpck_require__(323); +var _Hour1To24Parser = __nccwpck_require__(5980); +var _MinuteParser = __nccwpck_require__(4254); +var _SecondParser = __nccwpck_require__(3478); +var _FractionOfSecondParser = __nccwpck_require__(5194); +var _ISOTimezoneWithZParser = __nccwpck_require__(9822); +var _ISOTimezoneParser = __nccwpck_require__(9874); +var _TimestampSecondsParser = __nccwpck_require__(771); +var _TimestampMillisecondsParser = __nccwpck_require__(3726); +/* + * | | Unit | | Unit | + * |-----|--------------------------------|-----|--------------------------------| + * | a | AM, PM | A* | Milliseconds in day | + * | b | AM, PM, noon, midnight | B | Flexible day period | + * | c | Stand-alone local day of week | C* | Localized hour w/ day period | + * | d | Day of month | D | Day of year | + * | e | Local day of week | E | Day of week | + * | f | | F* | Day of week in month | + * | g* | Modified Julian day | G | Era | + * | h | Hour [1-12] | H | Hour [0-23] | + * | i! | ISO day of week | I! | ISO week of year | + * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | + * | k | Hour [1-24] | K | Hour [0-11] | + * | l* | (deprecated) | L | Stand-alone month | + * | m | Minute | M | Month | + * | n | | N | | + * | o! | Ordinal number modifier | O* | Timezone (GMT) | + * | p | | P | | + * | q | Stand-alone quarter | Q | Quarter | + * | r* | Related Gregorian year | R! | ISO week-numbering year | + * | s | Second | S | Fraction of second | + * | t! | Seconds timestamp | T! | Milliseconds timestamp | + * | u | Extended year | U* | Cyclic year | + * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | + * | w | Local week of year | W* | Week of month | + * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | + * | y | Year (abs) | Y | Local week-numbering year | + * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) | + * + * Letters marked by * are not implemented but reserved by Unicode standard. + * + * Letters marked by ! are non-standard, but implemented by date-fns: + * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs) + * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, + * i.e. 7 for Sunday, 1 for Monday, etc. + * - `I` is ISO week of year, as opposed to `w` which is local week of year. + * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. + * `R` is supposed to be used in conjunction with `I` and `i` + * for universal ISO week-numbering date, whereas + * `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.EraParser(), + y: new _YearParser.YearParser(), + Y: new _LocalWeekYearParser.LocalWeekYearParser(), + R: new _ISOWeekYearParser.ISOWeekYearParser(), + u: new _ExtendedYearParser.ExtendedYearParser(), + Q: new _QuarterParser.QuarterParser(), + q: new _StandAloneQuarterParser.StandAloneQuarterParser(), + M: new _MonthParser.MonthParser(), + L: new _StandAloneMonthParser.StandAloneMonthParser(), + w: new _LocalWeekParser.LocalWeekParser(), + I: new _ISOWeekParser.ISOWeekParser(), + d: new _DateParser.DateParser(), + D: new _DayOfYearParser.DayOfYearParser(), + E: new _DayParser.DayParser(), + e: new _LocalDayParser.LocalDayParser(), + c: new _StandAloneLocalDayParser.StandAloneLocalDayParser(), + i: new _ISODayParser.ISODayParser(), + a: new _AMPMParser.AMPMParser(), + b: new _AMPMMidnightParser.AMPMMidnightParser(), + B: new _DayPeriodParser.DayPeriodParser(), + h: new _Hour1to12Parser.Hour1to12Parser(), + H: new _Hour0to23Parser.Hour0to23Parser(), + K: new _Hour0To11Parser.Hour0To11Parser(), + k: new _Hour1To24Parser.Hour1To24Parser(), + m: new _MinuteParser.MinuteParser(), + s: new _SecondParser.SecondParser(), + S: new _FractionOfSecondParser.FractionOfSecondParser(), + X: new _ISOTimezoneWithZParser.ISOTimezoneWithZParser(), + x: new _ISOTimezoneParser.ISOTimezoneParser(), + t: new _TimestampSecondsParser.TimestampSecondsParser(), + T: new _TimestampMillisecondsParser.TimestampMillisecondsParser() +}; +exports.parsers = parsers; + +/***/ }), + +/***/ 9042: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.dayPeriodEnumToHours = dayPeriodEnumToHours; +exports.isLeapYearIndex = isLeapYearIndex; +exports.mapValue = mapValue; +exports.normalizeTwoDigitYear = normalizeTwoDigitYear; +exports.parseAnyDigitsSigned = parseAnyDigitsSigned; +exports.parseNDigits = parseNDigits; +exports.parseNDigitsSigned = parseNDigitsSigned; +exports.parseNumericPattern = parseNumericPattern; +exports.parseTimezonePattern = parseTimezonePattern; +var _index = __nccwpck_require__(5756); +var _constants = __nccwpck_require__(463); +function mapValue(parseFnResult, mapFn) { + if (!parseFnResult) { + return parseFnResult; + } + return { + value: mapFn(parseFnResult.value), + rest: parseFnResult.rest + }; +} +function parseNumericPattern(pattern, dateString) { + var matchResult = dateString.match(pattern); + if (!matchResult) { + return null; + } + return { + value: parseInt(matchResult[0], 10), + rest: dateString.slice(matchResult[0].length) + }; +} +function parseTimezonePattern(pattern, dateString) { + var matchResult = dateString.match(pattern); + if (!matchResult) { + return null; + } + // Input is 'Z' + if (matchResult[0] === 'Z') { + return { + value: 0, + rest: dateString.slice(1) + }; + } + var sign = matchResult[1] === '+' ? 1 : -1; + var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0; + var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0; + var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0; + return { + value: sign * (hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute + seconds * _index.millisecondsInSecond), + rest: dateString.slice(matchResult[0].length) + }; +} +function parseAnyDigitsSigned(dateString) { + return parseNumericPattern(_constants.numericPatterns.anyDigitsSigned, dateString); +} +function parseNDigits(n, dateString) { + switch (n) { + case 1: + return parseNumericPattern(_constants.numericPatterns.singleDigit, dateString); + case 2: + return parseNumericPattern(_constants.numericPatterns.twoDigits, dateString); + case 3: + return parseNumericPattern(_constants.numericPatterns.threeDigits, dateString); + case 4: + return parseNumericPattern(_constants.numericPatterns.fourDigits, dateString); + default: + return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), dateString); + } +} +function parseNDigitsSigned(n, dateString) { + switch (n) { + case 1: + return parseNumericPattern(_constants.numericPatterns.singleDigitSigned, dateString); + case 2: + return parseNumericPattern(_constants.numericPatterns.twoDigitsSigned, dateString); + case 3: + return parseNumericPattern(_constants.numericPatterns.threeDigitsSigned, dateString); + case 4: + return parseNumericPattern(_constants.numericPatterns.fourDigitsSigned, dateString); + default: + return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), dateString); + } +} +function dayPeriodEnumToHours(dayPeriod) { + switch (dayPeriod) { + case 'morning': + return 4; + case 'evening': + return 17; + case 'pm': + case 'noon': + case 'afternoon': + return 12; + case 'am': + case 'midnight': + case 'night': + default: + return 0; + } +} +function normalizeTwoDigitYear(twoDigitYear, currentYear) { + 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) { + result = twoDigitYear || 100; + } else { + var rangeEnd = absCurrentYear + 50; + var rangeEndCentury = Math.floor(rangeEnd / 100) * 100; + var isPreviousCentury = twoDigitYear >= rangeEnd % 100; + result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0); + } + return isCommonEra ? result : 1 - result; +} +function isLeapYearIndex(year) { + return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; +} /***/ }), -/* 525 */, -/* 526 */, -/* 527 */, -/* 528 */ -/***/ (function(__unusedmodule, exports) { -"use strict"; -Object.defineProperty(exports,"__esModule",{value:true});exports.SIGNALS=void 0; +/***/ 1287: +/***/ ((module, exports, __nccwpck_require__) => { -const SIGNALS=[ -{ -name:"SIGHUP", -number:1, -action:"terminate", -description:"Terminal closed", -standard:"posix"}, +"use strict"; -{ -name:"SIGINT", -number:2, -action:"terminate", -description:"User interruption with CTRL-C", -standard:"ansi"}, -{ -name:"SIGQUIT", -number:3, -action:"core", -description:"User interruption with CTRL-\\", -standard:"posix"}, +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = parse; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _createForOfIteratorHelper2 = _interopRequireDefault(__nccwpck_require__(8425)); +var _index = _interopRequireDefault(__nccwpck_require__(618)); +var _index2 = _interopRequireDefault(__nccwpck_require__(7923)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2631)); +var _index5 = _interopRequireDefault(__nccwpck_require__(8387)); +var _index6 = _interopRequireDefault(__nccwpck_require__(7032)); +var _index7 = __nccwpck_require__(2509); +var _index8 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index9 = _interopRequireDefault(__nccwpck_require__(2063)); +var _Setter = __nccwpck_require__(5665); +var _index10 = __nccwpck_require__(5193); +var _index11 = __nccwpck_require__(9307); +// This RegExp consists of three parts separated by `|`: +// - [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 +// - '' matches two quote characters in a row +// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), +// except a single quote symbol, which ends the sequence. +// Two quote characters do not end the sequence. +// 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; -{ -name:"SIGILL", -number:4, -action:"core", -description:"Invalid machine instruction", -standard:"ansi"}, +// 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:"SIGTRAP", -number:5, -action:"core", -description:"Debugger breakpoint", -standard:"posix"}, - -{ -name:"SIGABRT", -number:6, -action:"core", -description:"Aborted", -standard:"ansi"}, - -{ -name:"SIGIOT", -number:6, -action:"core", -description:"Aborted", -standard:"bsd"}, - -{ -name:"SIGBUS", -number:7, -action:"core", -description: -"Bus error due to misaligned, non-existing address or paging error", -standard:"bsd"}, - -{ -name:"SIGEMT", -number:7, -action:"terminate", -description:"Command should be emulated but is not implemented", -standard:"other"}, - -{ -name:"SIGFPE", -number:8, -action:"core", -description:"Floating point arithmetic error", -standard:"ansi"}, - -{ -name:"SIGKILL", -number:9, -action:"terminate", -description:"Forced termination", -standard:"posix", -forced:true}, - -{ -name:"SIGUSR1", -number:10, -action:"terminate", -description:"Application-specific signal", -standard:"posix"}, - -{ -name:"SIGSEGV", -number:11, -action:"core", -description:"Segmentation fault", -standard:"ansi"}, - -{ -name:"SIGUSR2", -number:12, -action:"terminate", -description:"Application-specific signal", -standard:"posix"}, +/** + * @name parse + * @category Common Helpers + * @summary Parse the date. + * + * @description + * Return the date parsed from string using the given format string. + * + * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. + * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * The characters in the format string wrapped between two single quotes characters (') are escaped. + * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. + * + * Format of the format string is based on Unicode Technical Standard #35: + * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table + * with a few additions (see note 5 below the table). + * + * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited + * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception: + * + * ```javascript + * parse('23 AM', 'HH a', new Date()) + * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time + * ``` + * + * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true + * + * Accepted format string patterns: + * | Unit |Prior| Pattern | Result examples | Notes | + * |---------------------------------|-----|---------|-----------------------------------|-------| + * | Era | 140 | G..GGG | AD, BC | | + * | | | GGGG | Anno Domini, Before Christ | 2 | + * | | | GGGGG | A, B | | + * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | + * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | + * | | | yy | 44, 01, 00, 17 | 4 | + * | | | yyy | 044, 001, 123, 999 | 4 | + * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | + * | | | yyyyy | ... | 2,4 | + * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | + * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | + * | | | YY | 44, 01, 00, 17 | 4,6 | + * | | | YYY | 044, 001, 123, 999 | 4 | + * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | + * | | | YYYYY | ... | 2,4 | + * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | + * | | | RR | -43, 01, 00, 17 | 4,5 | + * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | + * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | + * | | | RRRRR | ... | 2,4,5 | + * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | + * | | | uu | -43, 01, 99, -99 | 4 | + * | | | uuu | -043, 001, 123, 999, -999 | 4 | + * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | + * | | | uuuuu | ... | 2,4 | + * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | + * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | + * | | | QQ | 01, 02, 03, 04 | | + * | | | QQQ | Q1, Q2, Q3, Q4 | | + * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | + * | | | QQQQQ | 1, 2, 3, 4 | 4 | + * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | + * | | | qo | 1st, 2nd, 3rd, 4th | 5 | + * | | | qq | 01, 02, 03, 04 | | + * | | | qqq | Q1, Q2, Q3, Q4 | | + * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | + * | | | qqqqq | 1, 2, 3, 4 | 3 | + * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | + * | | | Mo | 1st, 2nd, ..., 12th | 5 | + * | | | MM | 01, 02, ..., 12 | | + * | | | MMM | Jan, Feb, ..., Dec | | + * | | | MMMM | January, February, ..., December | 2 | + * | | | MMMMM | J, F, ..., D | | + * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | + * | | | Lo | 1st, 2nd, ..., 12th | 5 | + * | | | LL | 01, 02, ..., 12 | | + * | | | LLL | Jan, Feb, ..., Dec | | + * | | | LLLL | January, February, ..., December | 2 | + * | | | LLLLL | J, F, ..., D | | + * | Local week of year | 100 | w | 1, 2, ..., 53 | | + * | | | wo | 1st, 2nd, ..., 53th | 5 | + * | | | ww | 01, 02, ..., 53 | | + * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | + * | | | Io | 1st, 2nd, ..., 53th | 5 | + * | | | II | 01, 02, ..., 53 | 5 | + * | Day of month | 90 | d | 1, 2, ..., 31 | | + * | | | do | 1st, 2nd, ..., 31st | 5 | + * | | | dd | 01, 02, ..., 31 | | + * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 | + * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | + * | | | DD | 01, 02, ..., 365, 366 | 7 | + * | | | DDD | 001, 002, ..., 365, 366 | | + * | | | DDDD | ... | 2 | + * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | | + * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | + * | | | EEEEE | M, T, W, T, F, S, S | | + * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | | + * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | + * | | | io | 1st, 2nd, ..., 7th | 5 | + * | | | ii | 01, 02, ..., 07 | 5 | + * | | | iii | Mon, Tue, Wed, ..., Sun | 5 | + * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | + * | | | iiiii | M, T, W, T, F, S, S | 5 | + * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 | + * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | + * | | | eo | 2nd, 3rd, ..., 1st | 5 | + * | | | ee | 02, 03, ..., 01 | | + * | | | eee | Mon, Tue, Wed, ..., Sun | | + * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | + * | | | eeeee | M, T, W, T, F, S, S | | + * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | | + * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | + * | | | co | 2nd, 3rd, ..., 1st | 5 | + * | | | cc | 02, 03, ..., 01 | | + * | | | ccc | Mon, Tue, Wed, ..., Sun | | + * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | + * | | | ccccc | M, T, W, T, F, S, S | | + * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | | + * | AM, PM | 80 | a..aaa | AM, PM | | + * | | | aaaa | a.m., p.m. | 2 | + * | | | aaaaa | a, p | | + * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | + * | | | bbbb | a.m., p.m., noon, midnight | 2 | + * | | | bbbbb | a, p, n, mi | | + * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | + * | | | BBBB | at night, in the morning, ... | 2 | + * | | | BBBBB | at night, in the morning, ... | | + * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | + * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | + * | | | hh | 01, 02, ..., 11, 12 | | + * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | + * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | + * | | | HH | 00, 01, 02, ..., 23 | | + * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | + * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | + * | | | KK | 01, 02, ..., 11, 00 | | + * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | + * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | + * | | | kk | 24, 01, 02, ..., 23 | | + * | Minute | 60 | m | 0, 1, ..., 59 | | + * | | | mo | 0th, 1st, ..., 59th | 5 | + * | | | mm | 00, 01, ..., 59 | | + * | Second | 50 | s | 0, 1, ..., 59 | | + * | | | so | 0th, 1st, ..., 59th | 5 | + * | | | ss | 00, 01, ..., 59 | | + * | Seconds timestamp | 40 | t | 512969520 | | + * | | | tt | ... | 2 | + * | Fraction of second | 30 | S | 0, 1, ..., 9 | | + * | | | SS | 00, 01, ..., 99 | | + * | | | SSS | 000, 001, ..., 999 | | + * | | | SSSS | ... | 2 | + * | Milliseconds timestamp | 20 | T | 512969520900 | | + * | | | TT | ... | 2 | + * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | + * | | | XX | -0800, +0530, Z | | + * | | | XXX | -08:00, +05:30, Z | | + * | | | XXXX | -0800, +0530, Z, +123456 | 2 | + * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | + * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | + * | | | xx | -0800, +0530, +0000 | | + * | | | xxx | -08:00, +05:30, +00:00 | 2 | + * | | | xxxx | -0800, +0530, +0000, +123456 | | + * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | + * | Long localized date | NA | P | 05/29/1453 | 5,8 | + * | | | PP | May 29, 1453 | | + * | | | PPP | May 29th, 1453 | | + * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 | + * | Long localized time | NA | p | 12:00 AM | 5,8 | + * | | | pp | 12:00:00 AM | | + * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | | + * | | | PPpp | May 29, 1453, 12:00:00 AM | | + * | | | PPPpp | May 29th, 1453 at ... | | + * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 | + * Notes: + * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale + * are the same as "stand-alone" units, but are different in some languages. + * "Formatting" units are declined according to the rules of the language + * in the context of a date. "Stand-alone" units are always nominative singular. + * In `format` function, they will produce different result: + * + * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` + * + * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` + * + * `parse` will try to match both formatting and stand-alone units interchangably. + * + * 2. Any sequence of the identical letters is a pattern, unless it is escaped by + * the single quote characters (see below). + * If the sequence is longer than listed in table: + * - for numerical units (`yyyyyyyy`) `parse` will try to match a number + * as wide as the sequence + * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit. + * These variations are marked with "2" in the last column of the table. + * + * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. + * These tokens represent the shortest form of the quarter. + * + * 4. The main difference between `y` and `u` patterns are B.C. years: + * + * | Year | `y` | `u` | + * |------|-----|-----| + * | AC 1 | 1 | 1 | + * | BC 1 | 1 | 0 | + * | BC 2 | 2 | -1 | + * + * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`: + * + * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00` + * + * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00` + * + * while `uu` will just assign the year as is: + * + * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00` + * + * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00` + * + * The same difference is true for local and ISO week-numbering years (`Y` and `R`), + * except local week-numbering years are dependent on `options.weekStartsOn` + * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear} + * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}). + * + * 5. These patterns are not in the Unicode Technical Standard #35: + * - `i`: ISO day of week + * - `I`: ISO week of year + * - `R`: ISO week-numbering year + * - `o`: ordinal number modifier + * - `P`: long localized date + * - `p`: long localized time + * + * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. + * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month. + * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * + * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based + * on the given locale. + * + * using `en-US` locale: `P` => `MM/dd/yyyy` + * using `en-US` locale: `p` => `hh:mm a` + * using `pt-BR` locale: `P` => `dd/MM/yyyy` + * using `pt-BR` locale: `p` => `HH:mm` + * + * Values will be assigned to the date in the descending order of its unit's priority. + * Units of an equal priority overwrite each other in the order of appearance. + * + * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), + * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing. + * + * `referenceDate` must be passed for correct work of the function. + * If you're not sure which `referenceDate` to supply, create a new instance of Date: + * `parse('02/11/2014', 'MM/dd/yyyy', new Date())` + * In this case parsing will be done in the context of the current date. + * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`, + * then `Invalid Date` will be returned. + * + * The result may vary by locale. + * + * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. + * + * If parsing failed, `Invalid Date` will be returned. + * Invalid Date is a Date, whose time value is NaN. + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param {String} dateString - the string to parse + * @param {String} formatString - the string of tokens + * @param {Date|Number} referenceDate - defines values missing from the parsed dateString + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year + * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`; + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`; + * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @returns {Date} the parsed date + * @throws {TypeError} 3 arguments required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 + * @throws {RangeError} `options.locale` must contain `match` property + * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md + * @throws {RangeError} format string contains an unescaped latin alphabet character + * + * @example + * // Parse 11 February 2014 from middle-endian format: + * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date()) + * //=> Tue Feb 11 2014 00:00:00 + * + * @example + * // Parse 28th of February in Esperanto locale in the context of 2010 year: + * import eo from 'date-fns/locale/eo' + * var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), { + * locale: eo + * }) + * //=> 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; + (0, _index9.default)(3, arguments); + var dateString = String(dirtyDateString); + var formatString = String(dirtyFormatString); + var defaultOptions = (0, _index11.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 : _index.default; + if (!locale.match) { + throw new RangeError('locale must contain match property'); + } + var firstWeekContainsDate = (0, _index8.default)((_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); -{ -name:"SIGPIPE", -number:13, -action:"terminate", -description:"Broken pipe or socket", -standard:"posix"}, + // 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 = (0, _index8.default)((_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); -{ -name:"SIGALRM", -number:14, -action:"terminate", -description:"Timeout or timer", -standard:"posix"}, + // 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'); + } + if (formatString === '') { + if (dateString === '') { + return (0, _index3.default)(dirtyReferenceDate); + } else { + return new Date(NaN); + } + } + var subFnOptions = { + firstWeekContainsDate: firstWeekContainsDate, + weekStartsOn: weekStartsOn, + locale: locale + }; -{ -name:"SIGTERM", -number:15, -action:"terminate", -description:"Termination", -standard:"ansi"}, + // If timezone isn't specified, it will be set to the system timezone + var setters = [new _Setter.DateToSystemTimezoneSetter()]; + var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) { + var firstCharacter = substring[0]; + if (firstCharacter in _index5.default) { + var longFormatter = _index5.default[firstCharacter]; + return longFormatter(substring, locale.formatLong); + } + return substring; + }).join('').match(formattingTokensRegExp); + var usedTokens = []; + var _iterator = (0, _createForOfIteratorHelper2.default)(tokens), + _step; + try { + var _loop = function _loop() { + var token = _step.value; + if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && (0, _index7.isProtectedWeekYearToken)(token)) { + (0, _index7.throwProtectedError)(token, formatString, dirtyDateString); + } + if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && (0, _index7.isProtectedDayOfYearToken)(token)) { + (0, _index7.throwProtectedError)(token, formatString, dirtyDateString); + } + var firstCharacter = token[0]; + var parser = _index10.parsers[firstCharacter]; + if (parser) { + var incompatibleTokens = parser.incompatibleTokens; + if (Array.isArray(incompatibleTokens)) { + var incompatibleToken = usedTokens.find(function (usedToken) { + return incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter; + }); + if (incompatibleToken) { + throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time")); + } + } else if (parser.incompatibleTokens === '*' && usedTokens.length > 0) { + throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time")); + } + usedTokens.push({ + token: firstCharacter, + fullToken: token + }); + var parseResult = parser.run(dateString, token, locale.match, subFnOptions); + if (!parseResult) { + return { + v: new Date(NaN) + }; + } + setters.push(parseResult.setter); + dateString = parseResult.rest; + } else { + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { + throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); + } -{ -name:"SIGSTKFLT", -number:16, -action:"terminate", -description:"Stack is empty or overflowed", -standard:"other"}, + // Replace two single quote characters with one single quote character + if (token === "''") { + token = "'"; + } else if (firstCharacter === "'") { + token = cleanEscapedString(token); + } -{ -name:"SIGCHLD", -number:17, -action:"ignore", -description:"Child process terminated, paused or unpaused", -standard:"posix"}, + // 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 { + return { + v: new Date(NaN) + }; + } + } + }; + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var _ret = _loop(); + if ((0, _typeof2.default)(_ret) === "object") return _ret.v; + } -{ -name:"SIGCLD", -number:17, -action:"ignore", -description:"Child process terminated, paused or unpaused", -standard:"other"}, + // Check if the remaining input contains something other than whitespace + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) { + return new Date(NaN); + } + var uniquePrioritySetters = setters.map(function (setter) { + return setter.priority; + }).sort(function (a, b) { + return b - a; + }).filter(function (priority, index, array) { + return array.indexOf(priority) === index; + }).map(function (priority) { + return setters.filter(function (setter) { + return setter.priority === priority; + }).sort(function (a, b) { + return b.subPriority - a.subPriority; + }); + }).map(function (setterArray) { + return setterArray[0]; + }); + var date = (0, _index3.default)(dirtyReferenceDate); + if (isNaN(date.getTime())) { + return new Date(NaN); + } -{ -name:"SIGCONT", -number:18, -action:"unpause", -description:"Unpaused", -standard:"posix", -forced:true}, + // Convert the date in system timezone to the same date in UTC+00:00 timezone. + var utcDate = (0, _index2.default)(date, (0, _index6.default)(date)); + var flags = {}; + var _iterator2 = (0, _createForOfIteratorHelper2.default)(uniquePrioritySetters), + _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var setter = _step2.value; + if (!setter.validate(utcDate, subFnOptions)) { + return new Date(NaN); + } + var result = setter.set(utcDate, flags, subFnOptions); + // Result is tuple (date, flags) + if (Array.isArray(result)) { + utcDate = result[0]; + (0, _index4.default)(flags, result[1]); + // Result is date + } else { + utcDate = result; + } + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + return utcDate; +} +function cleanEscapedString(input) { + return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'"); +} +module.exports = exports.default; -{ -name:"SIGSTOP", -number:19, -action:"pause", -description:"Paused", -standard:"posix", -forced:true}, +/***/ }), -{ -name:"SIGTSTP", -number:20, -action:"pause", -description:"Paused using CTRL-Z or \"suspend\"", -standard:"posix"}, +/***/ 3390: +/***/ ((module, exports, __nccwpck_require__) => { -{ -name:"SIGTTIN", -number:21, -action:"pause", -description:"Background process cannot read terminal input", -standard:"posix"}, +"use strict"; -{ -name:"SIGBREAK", -number:21, -action:"terminate", -description:"User interruption with CTRL-BREAK", -standard:"other"}, -{ -name:"SIGTTOU", -number:22, -action:"pause", -description:"Background process cannot write to terminal output", -standard:"posix"}, - -{ -name:"SIGURG", -number:23, -action:"ignore", -description:"Socket received out-of-band data", -standard:"bsd"}, - -{ -name:"SIGXCPU", -number:24, -action:"core", -description:"Process timed out", -standard:"bsd"}, +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = parseISO; +var _index = __nccwpck_require__(5756); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name parseISO + * @category Common Helpers + * @summary Parse ISO string + * + * @description + * Parse the given string in ISO 8601 format and return an instance of Date. + * + * Function accepts complete ISO 8601 formats as well as partial implementations. + * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 + * + * If the argument isn't a string, the function cannot parse the string or + * the values are invalid, it returns Invalid Date. + * + * @param {String} argument - the value to convert + * @param {Object} [options] - an object with options. + * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format + * @returns {Date} the parsed date in the local time zone + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Convert string '2014-02-11T11:30:30' to date: + * const result = parseISO('2014-02-11T11:30:30') + * //=> Tue Feb 11 2014 11:30:30 + * + * @example + * // Convert string '+02014101' to date, + * // if the additional number of digits in the extended year format is 1: + * const result = parseISO('+02014101', { additionalDigits: 1 }) + * //=> Fri Apr 11 2014 00:00:00 + */ +function parseISO(argument, options) { + var _options$additionalDi; + (0, _index2.default)(1, arguments); + var additionalDigits = (0, _index3.default)((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2); + if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) { + throw new RangeError('additionalDigits must be 0, 1 or 2'); + } + if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) { + return new Date(NaN); + } + var dateStrings = splitDateString(argument); + var date; + if (dateStrings.date) { + var parseYearResult = parseYear(dateStrings.date, additionalDigits); + date = parseDate(parseYearResult.restDateString, parseYearResult.year); + } + if (!date || isNaN(date.getTime())) { + return new Date(NaN); + } + var timestamp = date.getTime(); + var time = 0; + var offset; + if (dateStrings.time) { + time = parseTime(dateStrings.time); + if (isNaN(time)) { + return new Date(NaN); + } + } + if (dateStrings.timezone) { + offset = parseTimezone(dateStrings.timezone); + if (isNaN(offset)) { + return new Date(NaN); + } + } else { + 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()); + return result; + } + return new Date(timestamp + time + offset); +} +var patterns = { + dateTimeDelimiter: /[T ]/, + timeZoneDelimiter: /[Z ]/i, + timezone: /([Z+-].*)$/ +}; +var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/; +var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/; +var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/; +function splitDateString(dateString) { + var dateStrings = {}; + var array = dateString.split(patterns.dateTimeDelimiter); + var timeString; -{ -name:"SIGXFSZ", -number:25, -action:"core", -description:"File too big", -standard:"bsd"}, + // The regex match should only return at maximum two array elements. + // [date], [time], or [date, time]. + if (array.length > 2) { + return dateStrings; + } + if (/:/.test(array[0])) { + timeString = array[0]; + } else { + dateStrings.date = array[0]; + timeString = array[1]; + if (patterns.timeZoneDelimiter.test(dateStrings.date)) { + dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]; + timeString = dateString.substr(dateStrings.date.length, dateString.length); + } + } + if (timeString) { + var token = patterns.timezone.exec(timeString); + if (token) { + dateStrings.time = timeString.replace(token[1], ''); + dateStrings.timezone = token[1]; + } else { + dateStrings.time = timeString; + } + } + return dateStrings; +} +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 + if (!captures) return { + year: NaN, + restDateString: '' + }; + var year = captures[1] ? parseInt(captures[1]) : null; + var century = captures[2] ? parseInt(captures[2]) : null; -{ -name:"SIGVTALRM", -number:26, -action:"terminate", -description:"Timeout or timer", -standard:"bsd"}, + // either year or century is null, not both + return { + year: century === null ? year : century * 100, + restDateString: dateString.slice((captures[1] || captures[2]).length) + }; +} +function parseDate(dateString, year) { + // Invalid ISO-formatted year + if (year === null) return new Date(NaN); + var captures = dateString.match(dateRegex); + // Invalid ISO-formatted string + if (!captures) return new Date(NaN); + var isWeekDate = !!captures[4]; + var dayOfYear = parseDateUnit(captures[1]); + var month = parseDateUnit(captures[2]) - 1; + var day = parseDateUnit(captures[3]); + var week = parseDateUnit(captures[4]); + var dayOfWeek = parseDateUnit(captures[5]) - 1; + if (isWeekDate) { + if (!validateWeekDate(year, week, dayOfWeek)) { + return new Date(NaN); + } + return dayOfISOWeekYear(year, week, dayOfWeek); + } else { + var date = new Date(0); + if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) { + return new Date(NaN); + } + date.setUTCFullYear(year, month, Math.max(dayOfYear, day)); + return date; + } +} +function parseDateUnit(value) { + return value ? parseInt(value) : 1; +} +function parseTime(timeString) { + var captures = timeString.match(timeRegex); + if (!captures) return NaN; // Invalid ISO-formatted time -{ -name:"SIGPROF", -number:27, -action:"terminate", -description:"Timeout or timer", -standard:"bsd"}, + var hours = parseTimeUnit(captures[1]); + var minutes = parseTimeUnit(captures[2]); + var seconds = parseTimeUnit(captures[3]); + if (!validateTime(hours, minutes, seconds)) { + return NaN; + } + return hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute + seconds * 1000; +} +function parseTimeUnit(value) { + return value && parseFloat(value.replace(',', '.')) || 0; +} +function parseTimezone(timezoneString) { + if (timezoneString === 'Z') return 0; + var captures = timezoneString.match(timezoneRegex); + if (!captures) return 0; + var sign = captures[1] === '+' ? -1 : 1; + var hours = parseInt(captures[2]); + var minutes = captures[3] && parseInt(captures[3]) || 0; + if (!validateTimezone(hours, minutes)) { + return NaN; + } + return sign * (hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute); +} +function dayOfISOWeekYear(isoWeekYear, week, day) { + var date = new Date(0); + date.setUTCFullYear(isoWeekYear, 0, 4); + var fourthOfJanuaryDay = date.getUTCDay() || 7; + var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay; + date.setUTCDate(date.getUTCDate() + diff); + return date; +} -{ -name:"SIGWINCH", -number:28, -action:"ignore", -description:"Terminal window size changed", -standard:"bsd"}, +// Validation functions -{ -name:"SIGIO", -number:29, -action:"terminate", -description:"I/O is available", -standard:"other"}, +// 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; +} +function validateDate(year, month, date) { + return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28)); +} +function validateDayOfYearDate(year, dayOfYear) { + return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365); +} +function validateWeekDate(_year, week, day) { + return week >= 1 && week <= 53 && day >= 0 && day <= 6; +} +function validateTime(hours, minutes, seconds) { + if (hours === 24) { + return minutes === 0 && seconds === 0; + } + return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25; +} +function validateTimezone(_hours, minutes) { + return minutes >= 0 && minutes <= 59; +} +module.exports = exports.default; -{ -name:"SIGPOLL", -number:29, -action:"terminate", -description:"Watched event", -standard:"other"}, +/***/ }), -{ -name:"SIGINFO", -number:29, -action:"ignore", -description:"Request for process information", -standard:"other"}, +/***/ 8159: +/***/ ((module, exports, __nccwpck_require__) => { -{ -name:"SIGPWR", -number:30, -action:"terminate", -description:"Device running out of power", -standard:"systemv"}, +"use strict"; -{ -name:"SIGSYS", -number:31, -action:"core", -description:"Invalid system call", -standard:"other"}, -{ -name:"SIGUNUSED", -number:31, -action:"terminate", -description:"Invalid system call", -standard:"other"}];exports.SIGNALS=SIGNALS; -//# sourceMappingURL=core.js.map +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = parseJSON; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name parseJSON + * @category Common Helpers + * @summary Parse a JSON date string + * + * @description + * Converts a complete ISO date string in UTC time, the typical format for transmitting + * a date in JSON, to a JavaScript `Date` instance. + * + * This is a minimal implementation for converting dates retrieved from a JSON API to + * a `Date` instance which can be used with other functions in the `date-fns` library. + * The following formats are supported: + * + * - `2000-03-15T05:20:10.123Z`: The output of `.toISOString()` and `JSON.stringify(new Date())` + * - `2000-03-15T05:20:10Z`: Without milliseconds + * - `2000-03-15T05:20:10+00:00`: With a zero offset, the default JSON encoded format in some other languages + * - `2000-03-15T05:20:10+05:45`: With a positive or negative offset, the default JSON encoded format in some other languages + * - `2000-03-15T05:20:10+0000`: With a zero offset without a colon + * - `2000-03-15T05:20:10`: Without a trailing 'Z' symbol + * - `2000-03-15T05:20:10.1234567`: Up to 7 digits in milliseconds field. Only first 3 are taken into account since JS does not allow fractional milliseconds + * - `2000-03-15 05:20:10`: With a space instead of a 'T' separator for APIs returning a SQL date without reformatting + * + * For convenience and ease of use these other input types are also supported + * via [toDate]{@link https://date-fns.org/docs/toDate}: + * + * - A `Date` instance will be cloned + * - A `number` will be treated as a timestamp + * + * Any other input type or invalid date strings will return an `Invalid Date`. + * + * @param {String|Number|Date} argument A fully formed ISO8601 date string to convert + * @returns {Date} the parsed date in the local time zone + * @throws {TypeError} 1 argument required + */ +function parseJSON(argument) { + (0, _index2.default)(1, arguments); + if (typeof argument === 'string') { + var parts = argument.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/); + if (parts) { + // Group 8 matches the sign + return new Date(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4] - (+parts[9] || 0) * (parts[8] == '-' ? -1 : 1), +parts[5] - (+parts[10] || 0) * (parts[8] == '-' ? -1 : 1), +parts[6], +((parts[7] || '0') + '00').substring(0, 3))); + } + return new Date(NaN); + } + return (0, _index.default)(argument); +} +module.exports = exports.default; /***/ }), -/* 529 */, -/* 530 */, -/* 531 */, -/* 532 */, -/* 533 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8756: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = eachQuarterOfInterval; - -var _index = _interopRequireDefault(__webpack_require__(648)); +})); +exports["default"] = previousDay; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = _interopRequireDefault(__nccwpck_require__(9361)); +var _index3 = _interopRequireDefault(__nccwpck_require__(970)); +/** + * @name previousDay + * @category Weekday Helpers + * @summary When is the previous day of the week? + * + * @description + * When is the previous day of the week? 0-6 the day of the week, 0 represents Sunday. + * + * @param {Date | number} date - the date to check + * @param {number} day - day of the week + * @returns {Date} - the date is the previous day of week + * @throws {TypeError} - 2 arguments required + * + * @example + * // When is the previous Monday before Mar, 20, 2020? + * const result = previousDay(new Date(2020, 2, 20), 1) + * //=> Mon Mar 16 2020 00:00:00 + * + * @example + * // When is the previous Tuesday before Mar, 21, 2020? + * const result = previousDay(new Date(2020, 2, 21), 2) + * //=> Tue Mar 17 2020 00:00:00 + */ +function previousDay(date, day) { + (0, _index.default)(2, arguments); + var delta = (0, _index2.default)(date) - day; + if (delta <= 0) delta += 7; + return (0, _index3.default)(date, delta); +} +module.exports = exports.default; -var _index2 = _interopRequireDefault(__webpack_require__(451)); +/***/ }), -var _index3 = _interopRequireDefault(__webpack_require__(773)); +/***/ 9558: +/***/ ((module, exports, __nccwpck_require__) => { -var _index4 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = previousFriday; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8756)); /** - * @name eachQuarterOfInterval - * @category Interval Helpers - * @summary Return the array of quarters within the specified time interval. + * @name previousFriday + * @category Weekday Helpers + * @summary When is the previous Friday? * * @description - * Return the array of quarters within the specified time interval. + * When is the previous Friday? * - * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval} - * @returns {Date[]} the array with starts of quarters from the quarter of the interval start to the quarter of the interval end + * @param {Date | number} date - the date to start counting from + * @returns {Date} the previous Friday * @throws {TypeError} 1 argument required - * @throws {RangeError} The start of an interval cannot be after its end - * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example - * // Each quarter within interval 6 February 2014 - 10 August 2014: - * var result = eachQuarterOfInterval({ - * start: new Date(2014, 1, 6), - * end: new Date(2014, 7, 10) - * }) - * //=> [ - * // Wed Jan 01 2014 00:00:00, - * // Tue Apr 01 2014 00:00:00, - * // Tue Jul 01 2014 00:00:00, - * // ] + * // When is the previous Friday before Jun, 19, 2021? + * const result = previousFriday(new Date(2021, 5, 19)) + * //=> Fri June 18 2021 00:00:00 */ -function eachQuarterOfInterval(dirtyInterval) { - (0, _index4.default)(1, arguments); - var interval = dirtyInterval || {}; - var startDate = (0, _index3.default)(interval.start); - var endDate = (0, _index3.default)(interval.end); - var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` +function previousFriday(date) { + (0, _index.default)(1, arguments); + return (0, _index2.default)(date, 5); +} +module.exports = exports.default; - if (!(startDate.getTime() <= endTime)) { - throw new RangeError('Invalid interval'); - } +/***/ }), - var startDateQuarter = (0, _index2.default)(startDate); - var endDateQuarter = (0, _index2.default)(endDate); - endTime = endDateQuarter.getTime(); - var quarters = []; - var currentQuarter = startDateQuarter; +/***/ 8386: +/***/ ((module, exports, __nccwpck_require__) => { - while (currentQuarter.getTime() <= endTime) { - quarters.push((0, _index3.default)(currentQuarter)); - currentQuarter = (0, _index.default)(currentQuarter, 1); - } +"use strict"; - return quarters; -} +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = previousMonday; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8756)); +/** + * @name previousMonday + * @category Weekday Helpers + * @summary When is the previous Monday? + * + * @description + * When is the previous Monday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the previous Monday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the previous Monday before Jun, 18, 2021? + * const result = previousMonday(new Date(2021, 5, 18)) + * //=> Mon June 14 2021 00:00:00 + */ +function previousMonday(date) { + (0, _index.default)(1, arguments); + return (0, _index2.default)(date, 1); +} module.exports = exports.default; /***/ }), -/* 534 */ -/***/ (function(__unusedmodule, exports, __webpack_require__) { + +/***/ 4834: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.print = void 0; -const chalk = __webpack_require__(436); -const constants_1 = __webpack_require__(286); -const numbers_1 = __webpack_require__(602); -const validate_1 = __webpack_require__(203); -const ntext = (text, plural, count) => Math.abs(count) === 1 ? text : plural; -const getMetricUnit = (metric, count) => { - switch (metric) { - case "releases": - case "major": - case "minor": - case "patch": - return ntext("release", "releases", count); - case "drift": - case "pulse": - default: - return ntext("libyear", "libyears", count); - } -}; -const printIndividual = (violations) => { - violations.forEach((dependencies, metric) => { - dependencies.forEach(({ threshold, value }, dependency) => { - console.error(`${chalk.magenta(metric)}: ${chalk.cyan(dependency)} is ${chalk.red(`${numbers_1.printFloat(value)} ${getMetricUnit(metric, value)}`)} behind; threshold is ${chalk.yellow(numbers_1.printFloat(threshold))}.`); - }); - }); -}; -const printCollective = (totals, violations, threshold) => { - const isBreach = (metric) => violations.has(metric); - const logger = (metric) => isBreach(metric) ? console.error : console.log; - const message = (metric, value, limit) => { - const valueStyler = isBreach(metric) ? chalk.red : chalk.greenBright; - const valueMessage = `${chalk.magenta(metric)}: ${{ - drift: "package is", - pulse: "dependencies are", - releases: "dependencies are", - major: "dependencies are", - minor: "dependencies are", - patch: "dependencies are", - }[metric]} ${valueStyler(`${numbers_1.printFloat(value)} ${getMetricUnit(metric, value)}`)} behind`; - const limitMessage = `threshold is ${chalk.yellow(numbers_1.printFloat(limit))}`; - return isBreach(metric) - ? `${valueMessage}; ${limitMessage}.` - : `${valueMessage}.`; - }; - constants_1.metrics.forEach((metric) => { - logger(metric)(message(metric, totals.get(metric), threshold === null || threshold === void 0 ? void 0 : threshold[`${metric}Collective`])); - }); -}; -const print = (dependencies, threshold, overrides) => { - console.table(dependencies.map(({ dependency, drift, pulse, releases, major, minor, patch, available, }) => ({ - dependency, - drift: numbers_1.printFloat(drift), - pulse: numbers_1.printFloat(pulse), - releases, - major, - minor, - patch, - available, - }))); - console.log(); - const totals = validate_1.getTotals(dependencies); - const violations = validate_1.getViolations(dependencies, totals, threshold, overrides); - const hasIndividualViolations = Array.from(violations.individual.values()).reduce((acc, cur) => acc + cur.size, 0) > 0; - const hasCollectiveViolations = violations.collective.size > 0; - if (hasIndividualViolations) { - console.log(chalk.bold("# Individual")); - printIndividual(violations.individual); - console.log(); - } - console.log(chalk.bold("# Collective")); - printCollective(totals, violations.collective, threshold); - console.log(); - if (hasIndividualViolations || hasCollectiveViolations) { - process.exit(1); - } -}; -exports.print = print; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = previousSaturday; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8756)); +/** + * @name previousSaturday + * @category Weekday Helpers + * @summary When is the previous Saturday? + * + * @description + * When is the previous Saturday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the previous Saturday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the previous Saturday before Jun, 20, 2021? + * const result = previousSaturday(new Date(2021, 5, 20)) + * //=> Sat June 19 2021 00:00:00 + */ +function previousSaturday(date) { + (0, _index.default)(1, arguments); + return (0, _index2.default)(date, 6); +} +module.exports = exports.default; /***/ }), -/* 535 */, -/* 536 */, -/* 537 */, -/* 538 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const ANY = Symbol('SemVer ANY') -// hoisted class for cyclic dependency -class Comparator { - static get ANY () { - return ANY - } - constructor (comp, options) { - options = parseOptions(options) - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) +/***/ 264: +/***/ ((module, exports, __nccwpck_require__) => { - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } +"use strict"; - debug('comp', this) - } - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) - - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = previousSunday; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8756)); +/** + * @name previousSunday + * @category Weekday Helpers + * @summary When is the previous Sunday? + * + * @description + * When is the previous Sunday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the previous Sunday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the previous Sunday before Jun, 21, 2021? + * const result = previousSunday(new Date(2021, 5, 21)) + * //=> Sun June 20 2021 00:00:00 + */ +function previousSunday(date) { + (0, _index.default)(1, arguments); + return (0, _index2.default)(date, 0); +} +module.exports = exports.default; - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } +/***/ }), - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } - } +/***/ 19: +/***/ ((module, exports, __nccwpck_require__) => { - toString () { - return this.value - } +"use strict"; - test (version) { - debug('Comparator.test', version, this.options.loose) - if (this.semver === ANY || version === ANY) { - return true - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = previousThursday; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8756)); +/** + * @name previousThursday + * @category Weekday Helpers + * @summary When is the previous Thursday? + * + * @description + * When is the previous Thursday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the previous Thursday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the previous Thursday before Jun, 18, 2021? + * const result = previousThursday(new Date(2021, 5, 18)) + * //=> Thu June 17 2021 00:00:00 + */ +function previousThursday(date) { + (0, _index.default)(1, arguments); + return (0, _index2.default)(date, 4); +} +module.exports = exports.default; - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } +/***/ }), - return cmp(version, this.operator, this.semver, this.options) - } +/***/ 3294: +/***/ ((module, exports, __nccwpck_require__) => { - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } +"use strict"; - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = previousTuesday; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8756)); +/** + * @name previousTuesday + * @category Weekday Helpers + * @summary When is the previous Tuesday? + * + * @description + * When is the previous Tuesday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the previous Tuesday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the previous Tuesday before Jun, 18, 2021? + * const result = previousTuesday(new Date(2021, 5, 18)) + * //=> Tue June 15 2021 00:00:00 + */ +function previousTuesday(date) { + (0, _index.default)(1, arguments); + return (0, _index2.default)(date, 2); +} +module.exports = exports.default; - const sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - const sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - const sameSemVer = this.semver.version === comp.semver.version - const differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - const oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<') - const oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>') +/***/ }), - return ( - sameDirectionIncreasing || - sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || - oppositeDirectionsGreaterThan - ) - } -} +/***/ 8630: +/***/ ((module, exports, __nccwpck_require__) => { -module.exports = Comparator +"use strict"; -const parseOptions = __webpack_require__(834) -const {re, t} = __webpack_require__(947) -const cmp = __webpack_require__(548) -const debug = __webpack_require__(894) -const SemVer = __webpack_require__(653) -const Range = __webpack_require__(57) +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = previousWednesday; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8756)); +/** + * @name previousWednesday + * @category Weekday Helpers + * @summary When is the previous Wednesday? + * + * @description + * When is the previous Wednesday? + * + * @param {Date | number} date - the date to start counting from + * @returns {Date} the previous Wednesday + * @throws {TypeError} 1 argument required + * + * @example + * // When is the previous Wednesday before Jun, 18, 2021? + * const result = previousWednesday(new Date(2021, 5, 18)) + * //=> Wed June 16 2021 00:00:00 + */ +function previousWednesday(date) { + (0, _index.default)(1, arguments); + return (0, _index2.default)(date, 3); +} +module.exports = exports.default; /***/ }), -/* 539 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + +/***/ 8995: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -const isStream = __webpack_require__(649); -const getStream = __webpack_require__(345); -const mergeStream = __webpack_require__(778); -// `input` option -const handleInput = (spawned, input) => { - // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 - // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 - if (input === undefined || spawned.stdin === undefined) { - return; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = quartersToMonths; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name quartersToMonths + * @category Conversion Helpers + * @summary Convert number of quarters to months. + * + * @description + * Convert a number of quarters to a full number of months. + * + * @param {number} quarters - number of quarters to be converted + * + * @returns {number} the number of quarters converted in months + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 2 quarters to months + * const result = quartersToMonths(2) + * //=> 6 + */ +function quartersToMonths(quarters) { + (0, _index.default)(1, arguments); + return Math.floor(quarters * _index2.monthsInQuarter); +} +module.exports = exports.default; - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -}; +/***/ }), -// `all` interleaves `stdout` and `stderr` -const makeAllStream = (spawned, {all}) => { - if (!all || (!spawned.stdout && !spawned.stderr)) { - return; - } +/***/ 883: +/***/ ((module, exports, __nccwpck_require__) => { - const mixed = mergeStream(); +"use strict"; - if (spawned.stdout) { - mixed.add(spawned.stdout); - } - if (spawned.stderr) { - mixed.add(spawned.stderr); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = quartersToYears; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name quartersToYears + * @category Conversion Helpers + * @summary Convert number of quarters to years. + * + * @description + * Convert a number of quarters to a full number of years. + * + * @param {number} quarters - number of quarters to be converted + * + * @returns {number} the number of quarters converted in years + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 8 quarters to years + * const result = quartersToYears(8) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = quartersToYears(11) + * //=> 2 + */ +function quartersToYears(quarters) { + (0, _index.default)(1, arguments); + var years = quarters / _index2.quartersInYear; + return Math.floor(years); +} +module.exports = exports.default; - return mixed; -}; +/***/ }), -// On failure, `result.stdout|stderr|all` should contain the currently buffered stream -const getBufferedData = async (stream, streamPromise) => { - if (!stream) { - return; - } +/***/ 5515: +/***/ ((module, exports, __nccwpck_require__) => { - stream.destroy(); +"use strict"; - try { - return await streamPromise; - } catch (error) { - return error.bufferedData; - } -}; -const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { - if (!stream || !buffer) { - return; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = roundToNearestMinutes; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = __nccwpck_require__(8016); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name roundToNearestMinutes + * @category Minute Helpers + * @summary Rounds the given date to the nearest minute + * + * @description + * Rounds the given date to the nearest minute (or number of minutes). + * Rounds up when the given date is exactly between the nearest round minutes. + * + * @param {Date|Number} date - the date to round + * @param {Object} [options] - an object with options. + * @param {Number} [options.nearestTo=1] - nearest number of minutes to round to. E.g. `15` to round to quarter hours. + * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`) + * @returns {Date} the new date rounded to the closest minute + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.nearestTo` must be between 1 and 30 + * + * @example + * // Round 10 July 2014 12:12:34 to nearest minute: + * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34)) + * //=> Thu Jul 10 2014 12:13:00 + * + * @example + * // Round 10 July 2014 12:07:30 to nearest quarter hour: + * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 }) + * // rounds up because given date is exactly between 12:00:00 and 12:15:00 + * //=> Thu Jul 10 2014 12:15:00 + */ +function roundToNearestMinutes(dirtyDate, options) { + var _options$nearestTo; + if (arguments.length < 1) { + throw new TypeError('1 argument required, but only none provided present'); + } + var nearestTo = (0, _index3.default)((_options$nearestTo = options === null || options === void 0 ? void 0 : options.nearestTo) !== null && _options$nearestTo !== void 0 ? _options$nearestTo : 1); + if (nearestTo < 1 || nearestTo > 30) { + throw new RangeError('`options.nearestTo` must be between 1 and 30'); + } + var date = (0, _index.default)(dirtyDate); + var seconds = date.getSeconds(); // relevant if nearestTo is 1, which is the default case + var minutes = date.getMinutes() + seconds / 60; + var roundingMethod = (0, _index2.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod); + var roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo; + var remainderMinutes = minutes % nearestTo; + var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo; + return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), roundedMinutes + addedMinutes); +} +module.exports = exports.default; - if (encoding) { - return getStream(stream, {encoding, maxBuffer}); - } +/***/ }), - return getStream.buffer(stream, {maxBuffer}); -}; +/***/ 594: +/***/ ((module, exports, __nccwpck_require__) => { -// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) -const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { - const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); - const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); - const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); +"use strict"; - try { - return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); - } catch (error) { - return Promise.all([ - {error, signal: error.signal, timedOut: error.timedOut}, - getBufferedData(stdout, stdoutPromise), - getBufferedData(stderr, stderrPromise), - getBufferedData(all, allPromise) - ]); - } -}; -const validateInputSync = ({input}) => { - if (isStream(input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } -}; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = secondsToHours; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name secondsToHours + * @category Conversion Helpers + * @summary Convert seconds to hours. + * + * @description + * Convert a number of seconds to a full number of hours. + * + * @param {number} seconds - number of seconds to be converted + * + * @returns {number} the number of seconds converted in hours + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 7200 seconds into hours + * const result = secondsToHours(7200) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = secondsToHours(7199) + * //=> 1 + */ +function secondsToHours(seconds) { + (0, _index.default)(1, arguments); + var hours = seconds / _index2.secondsInHour; + return Math.floor(hours); +} +module.exports = exports.default; -module.exports = { - handleInput, - makeAllStream, - getSpawnedResult, - validateInputSync -}; +/***/ }), + +/***/ 6779: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = secondsToMilliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name secondsToMilliseconds + * @category Conversion Helpers + * @summary Convert seconds to milliseconds. + * + * @description + * Convert a number of seconds to a full number of milliseconds. + * + * @param {number} seconds - number of seconds to be converted + * + * @returns {number} the number of seconds converted in milliseconds + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 2 seconds into milliseconds + * const result = secondsToMilliseconds(2) + * //=> 2000 + */ +function secondsToMilliseconds(seconds) { + (0, _index.default)(1, arguments); + return seconds * _index2.millisecondsInSecond; +} +module.exports = exports.default; /***/ }), -/* 540 */, -/* 541 */ -/***/ (function(module, __unusedexports, __webpack_require__) { + +/***/ 8438: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -const shebangRegex = __webpack_require__(959); -module.exports = (string = '') => { - const match = string.match(shebangRegex); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = secondsToMinutes; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name secondsToMinutes + * @category Conversion Helpers + * @summary Convert seconds to minutes. + * + * @description + * Convert a number of seconds to a full number of minutes. + * + * @param {number} seconds - number of seconds to be converted + * + * @returns {number} the number of seconds converted in minutes + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 120 seconds into minutes + * const result = secondsToMinutes(120) + * //=> 2 + * + * @example + * // It uses floor rounding: + * const result = secondsToMinutes(119) + * //=> 1 + */ +function secondsToMinutes(seconds) { + (0, _index.default)(1, arguments); + var minutes = seconds / _index2.secondsInMinute; + return Math.floor(minutes); +} +module.exports = exports.default; - if (!match) { - return null; - } +/***/ }), - const [path, argument] = match[0].replace(/#! ?/, '').split(' '); - const binary = path.split('/').pop(); +/***/ 2031: +/***/ ((module, exports, __nccwpck_require__) => { - if (binary === 'env') { - return argument; - } +"use strict"; - return argument ? `${binary} ${argument}` : binary; -}; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = set; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(847)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name set + * @category Common Helpers + * @summary Set date values to a given date. + * + * @description + * Set date values to a given date. + * + * Sets time values to date from object `values`. + * A value is not set if it is undefined or null or doesn't exist in `values`. + * + * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts + * to use native `Date#setX` methods. If you use this function, you may not want to include the + * other `setX` functions that date-fns provides if you are concerned about the bundle size. + * + * @param {Date|Number} date - the date to be changed + * @param {Object} values - an object with options + * @param {Number} [values.year] - the number of years to be set + * @param {Number} [values.month] - the number of months to be set + * @param {Number} [values.date] - the number of days to be set + * @param {Number} [values.hours] - the number of hours to be set + * @param {Number} [values.minutes] - the number of minutes to be set + * @param {Number} [values.seconds] - the number of seconds to be set + * @param {Number} [values.milliseconds] - the number of milliseconds to be set + * @returns {Date} the new date with options set + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `values` must be an object + * + * @example + * // Transform 1 September 2014 into 20 October 2015 in a single line: + * const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 }) + * //=> Tue Oct 20 2015 00:00:00 + * + * @example + * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00: + * const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 }) + * //=> Mon Sep 01 2014 12:23:45 + */ +function set(dirtyDate, values) { + (0, _index4.default)(2, arguments); + if ((0, _typeof2.default)(values) !== 'object' || values === null) { + throw new RangeError('values parameter must be an object'); + } + var date = (0, _index.default)(dirtyDate); + + // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date + if (isNaN(date.getTime())) { + return new Date(NaN); + } + if (values.year != null) { + date.setFullYear(values.year); + } + if (values.month != null) { + date = (0, _index2.default)(date, values.month); + } + if (values.date != null) { + date.setDate((0, _index3.default)(values.date)); + } + if (values.hours != null) { + date.setHours((0, _index3.default)(values.hours)); + } + if (values.minutes != null) { + date.setMinutes((0, _index3.default)(values.minutes)); + } + if (values.seconds != null) { + date.setSeconds((0, _index3.default)(values.seconds)); + } + if (values.milliseconds != null) { + date.setMilliseconds((0, _index3.default)(values.milliseconds)); + } + return date; +} +module.exports = exports.default; /***/ }), -/* 542 */, -/* 543 */, -/* 544 */, -/* 545 */, -/* 546 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 8760: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = setDay; - -var _index = _interopRequireDefault(__webpack_require__(865)); +})); +exports["default"] = setDate; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setDate + * @category Day Helpers + * @summary Set the day of the month to the given date. + * + * @description + * Set the day of the month to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} dayOfMonth - the day of the month of the new date + * @returns {Date} the new date with the day of the month set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set the 30th day of the month to 1 September 2014: + * const result = setDate(new Date(2014, 8, 1), 30) + * //=> Tue Sep 30 2014 00:00:00 + */ +function setDate(dirtyDate, dirtyDayOfMonth) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var dayOfMonth = (0, _index.default)(dirtyDayOfMonth); + date.setDate(dayOfMonth); + return date; +} +module.exports = exports.default; -var _index2 = _interopRequireDefault(__webpack_require__(773)); +/***/ }), -var _index3 = _interopRequireDefault(__webpack_require__(841)); +/***/ 9540: +/***/ ((module, exports, __nccwpck_require__) => { -var _index4 = _interopRequireDefault(__webpack_require__(217)); +"use strict"; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setDay; +var _index = _interopRequireDefault(__nccwpck_require__(6227)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index5 = __nccwpck_require__(9307); /** * @name setDay * @category Weekday Helpers @@ -22192,10 +23737,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @description * Set the day of the week to the given date. * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). - * * @param {Date|Number} date - the date to be changed * @param {Number} day - the day of the week of the new date * @param {Object} [options] - an object with options. @@ -22207,34826 +23748,34270 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * * @example * // Set week day to Sunday, with the default weekStartsOn of Sunday: - * var result = setDay(new Date(2014, 8, 1), 0) + * const result = setDay(new Date(2014, 8, 1), 0) * //=> Sun Aug 31 2014 00:00:00 * * @example * // Set week day to Sunday, with a weekStartsOn of Monday: - * var result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 }) + * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 }) * //=> Sun Sep 07 2014 00:00:00 */ -function setDay(dirtyDate, dirtyDay, dirtyOptions) { +function setDay(dirtyDate, dirtyDay, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; (0, _index4.default)(2, arguments); - var options = dirtyOptions || {}; - var locale = options.locale; - var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; - var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index3.default)(localeWeekStartsOn); - var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index3.default)(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var defaultOptions = (0, _index5.getDefaultOptions)(); + var weekStartsOn = (0, _index3.default)((_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'); } - - var date = (0, _index2.default)(dirtyDate, options); + var date = (0, _index2.default)(dirtyDate); var day = (0, _index3.default)(dirtyDay); var currentDay = date.getDay(); var remainder = day % 7; var dayIndex = (remainder + 7) % 7; var delta = 7 - weekStartsOn; var diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7; - return (0, _index.default)(date, diff, options); + return (0, _index.default)(date, diff); } - module.exports = exports.default; /***/ }), -/* 547 */, -/* 548 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -const eq = __webpack_require__(450) -const neq = __webpack_require__(917) -const gt = __webpack_require__(827) -const gte = __webpack_require__(751) -const lt = __webpack_require__(746) -const lte = __webpack_require__(817) - -const cmp = (a, op, b, loose) => { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b - - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError(`Invalid operator: ${op}`) - } -} -module.exports = cmp - -/***/ }), -/* 549 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 4002: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInMonths; - -var _index = _interopRequireDefault(__webpack_require__(773)); - -var _index2 = _interopRequireDefault(__webpack_require__(776)); - -var _index3 = _interopRequireDefault(__webpack_require__(432)); - -var _index4 = _interopRequireDefault(__webpack_require__(217)); - -var _index5 = _interopRequireDefault(__webpack_require__(271)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +})); +exports["default"] = setDayOfYear; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name differenceInMonths - * @category Month Helpers - * @summary Get the number of full months between the given dates. + * @name setDayOfYear + * @category Day Helpers + * @summary Set the day of the year to the given date. * * @description - * Get the number of full months between the given dates. - * - * ### v2.0.0 breaking changes: - * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * Set the day of the year to the given date. * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of full months + * @param {Date|Number} date - the date to be changed + * @param {Number} dayOfYear - the day of the year of the new date + * @returns {Date} the new date with the day of the year set * @throws {TypeError} 2 arguments required * * @example - * // How many full months are between 31 January 2014 and 1 September 2014? - * var result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31)) - * //=> 7 - */ -function differenceInMonths(dirtyDateLeft, dirtyDateRight) { - (0, _index4.default)(2, arguments); - var dateLeft = (0, _index.default)(dirtyDateLeft); - var dateRight = (0, _index.default)(dirtyDateRight); - var sign = (0, _index3.default)(dateLeft, dateRight); - var difference = Math.abs((0, _index2.default)(dateLeft, dateRight)); - var result; // Check for the difference of less than month - - if (difference < 1) { - result = 0; - } else { - if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) { - // This will check if the date is end of Feb and assign a higher end of month date - // 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 + * // Set the 2nd day of the year to 2 July 2014: + * const result = setDayOfYear(new Date(2014, 6, 2), 2) + * //=> Thu Jan 02 2014 00:00:00 + */ +function setDayOfYear(dirtyDate, dirtyDayOfYear) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var dayOfYear = (0, _index.default)(dirtyDayOfYear); + date.setMonth(0); + date.setDate(dayOfYear); + return date; +} +module.exports = exports.default; - var isLastMonthNotFull = (0, _index3.default)(dateLeft, dateRight) === -sign; // Check for cases of one full calendar month +/***/ }), - if ((0, _index5.default)((0, _index.default)(dirtyDateLeft)) && difference === 1 && (0, _index3.default)(dirtyDateLeft, dateRight) === 1) { - isLastMonthNotFull = false; - } +/***/ 54: +/***/ ((module, exports, __nccwpck_require__) => { - result = sign * (difference - Number(isLastMonthNotFull)); - } // Prevent negative zero +"use strict"; - return result === 0 ? 0 : result; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setDefaultOptions; +var _index = __nccwpck_require__(9307); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setDefaultOptions + * @category Common Helpers + * @summary Set default options including locale. + * @pure false + * + * @description + * Sets the defaults for + * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate` + * arguments for all functions. + * + * @param {Object} newOptions - an object with options. + * @param {Locale} [newOptions.locale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [newOptions.weekStartsOn] - the index of the first day of the week (0 - Sunday) + * @param {1|2|3|4|5|6|7} [newOptions.firstWeekContainsDate] - the day of January, which is always in the first week of the year + * @throws {TypeError} 1 argument required + * + * @example + * // Set global locale: + * import { es } from 'date-fns/locale' + * setDefaultOptions({ locale: es }) + * const result = format(new Date(2014, 8, 2), 'PPPP') + * //=> 'martes, 2 de septiembre de 2014' + * + * @example + * // Start of the week for 2 September 2014: + * const result = startOfWeek(new Date(2014, 8, 2)) + * //=> Sun Aug 31 2014 00:00:00 + * + * @example + * // Start of the week for 2 September 2014, + * // when we set that week starts on Monday by default: + * setDefaultOptions({ weekStartsOn: 1 }) + * const result = startOfWeek(new Date(2014, 8, 2)) + * //=> Mon Sep 01 2014 00:00:00 + * + * @example + * // Manually set options take priority over default options: + * setDefaultOptions({ weekStartsOn: 1 }) + * const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 }) + * //=> Sun Aug 31 2014 00:00:00 + * + * @example + * // Remove the option by setting it to `undefined`: + * setDefaultOptions({ weekStartsOn: 1 }) + * setDefaultOptions({ weekStartsOn: undefined }) + * const result = startOfWeek(new Date(2014, 8, 2)) + * //=> Sun Aug 31 2014 00:00:00 + */ +function setDefaultOptions(newOptions) { + (0, _index2.default)(1, arguments); + var result = {}; + var defaultOptions = (0, _index.getDefaultOptions)(); + for (var property in defaultOptions) { + if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) { + ; + result[property] = defaultOptions[property]; + } + } + for (var _property in newOptions) { + if (Object.prototype.hasOwnProperty.call(newOptions, _property)) { + if (newOptions[_property] === undefined) { + delete result[_property]; + } else { + ; + result[_property] = newOptions[_property]; + } + } + } + (0, _index.setDefaultOptions)(result); } - module.exports = exports.default; /***/ }), -/* 550 */, -/* 551 */, -/* 552 */ -/***/ (function(__unusedmodule, exports) { + +/***/ 6355: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -var LF = '\n'; -var CR = '\r'; -var LinesAndColumns = (function () { - function LinesAndColumns(string) { - this.string = string; - var offsets = [0]; - for (var offset = 0; offset < string.length;) { - switch (string[offset]) { - case LF: - offset += LF.length; - offsets.push(offset); - break; - case CR: - offset += CR.length; - if (string[offset] === LF) { - offset += LF.length; - } - offsets.push(offset); - break; - default: - offset++; - break; - } - } - this.offsets = offsets; - } - LinesAndColumns.prototype.locationForIndex = function (index) { - if (index < 0 || index > this.string.length) { - return null; - } - var line = 0; - var offsets = this.offsets; - while (offsets[line + 1] <= index) { - line++; - } - var column = index - offsets[line]; - return { line: line, column: column }; - }; - LinesAndColumns.prototype.indexForLocation = function (location) { - var line = location.line, column = location.column; - if (line < 0 || line >= this.offsets.length) { - return null; - } - if (column < 0 || column > this.lengthOfLine(line)) { - return null; - } - return this.offsets[line] + column; - }; - LinesAndColumns.prototype.lengthOfLine = function (line) { - var offset = this.offsets[line]; - var nextOffset = line === this.offsets.length - 1 ? this.string.length : this.offsets[line + 1]; - return nextOffset - offset; - }; - return LinesAndColumns; -}()); -exports.__esModule = true; -exports["default"] = LinesAndColumns; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setHours; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setHours + * @category Hour Helpers + * @summary Set the hours to the given date. + * + * @description + * Set the hours to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} hours - the hours of the new date + * @returns {Date} the new date with the hours set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set 4 hours to 1 September 2014 11:30:00: + * const result = setHours(new Date(2014, 8, 1, 11, 30), 4) + * //=> Mon Sep 01 2014 04:30:00 + */ +function setHours(dirtyDate, dirtyHours) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var hours = (0, _index.default)(dirtyHours); + date.setHours(hours); + return date; +} +module.exports = exports.default; /***/ }), -/* 553 */, -/* 554 */ -/***/ (function(module, exports) { + +/***/ 3705: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = buildMatchPatternFn; +})); +exports["default"] = setISODay; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6227)); +var _index4 = _interopRequireDefault(__nccwpck_require__(8313)); +var _index5 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setISODay + * @category Weekday Helpers + * @summary Set the day of the ISO week to the given date. + * + * @description + * Set the day of the ISO week to the given date. + * ISO week starts with Monday. + * 7 is the index of Sunday, 1 is the index of Monday etc. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} day - the day of the ISO week of the new date + * @returns {Date} the new date with the day of the ISO week set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set Sunday to 1 September 2014: + * const result = setISODay(new Date(2014, 8, 1), 7) + * //=> Sun Sep 07 2014 00:00:00 + */ +function setISODay(dirtyDate, dirtyDay) { + (0, _index5.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var day = (0, _index.default)(dirtyDay); + var currentDay = (0, _index4.default)(date); + var diff = day - currentDay; + return (0, _index3.default)(date, diff); +} +module.exports = exports.default; -function buildMatchPatternFn(args) { - return function (dirtyString, dirtyOptions) { - var string = String(dirtyString); - var options = dirtyOptions || {}; - var matchResult = string.match(args.matchPattern); +/***/ }), - if (!matchResult) { - return null; - } +/***/ 3035: +/***/ ((module, exports, __nccwpck_require__) => { - var matchedString = matchResult[0]; - var parseResult = string.match(args.parsePattern); +"use strict"; - if (!parseResult) { - return null; - } - var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; - value = options.valueCallback ? options.valueCallback(value) : value; - return { - value: value, - rest: string.slice(matchedString.length) - }; - }; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(9894)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setISOWeek + * @category ISO Week Helpers + * @summary Set the ISO week to the given date. + * + * @description + * Set the ISO week to the given date, saving the weekday number. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the date to be changed + * @param {Number} isoWeek - the ISO week of the new date + * @returns {Date} the new date with the ISO week set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set the 53rd ISO week to 7 August 2004: + * const result = setISOWeek(new Date(2004, 7, 7), 53) + * //=> Sat Jan 01 2005 00:00:00 + */ +function setISOWeek(dirtyDate, dirtyISOWeek) { + (0, _index4.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var isoWeek = (0, _index.default)(dirtyISOWeek); + var diff = (0, _index3.default)(date) - isoWeek; + date.setDate(date.getDate() - diff * 7); + return date; } - module.exports = exports.default; /***/ }), -/* 555 */ -/***/ (function(module, exports, __webpack_require__) { + +/***/ 822: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", { +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ value: true -}); -exports.default = differenceInWeeks; +})); +exports["default"] = setISOWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(776)); +var _index4 = _interopRequireDefault(__nccwpck_require__(3086)); +var _index5 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Set the ISO week-numbering year to the given date. + * + * @description + * Set the ISO week-numbering year to the given date, + * saving the week number and the weekday number. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the date to be changed + * @param {Number} isoWeekYear - the ISO week-numbering year of the new date + * @returns {Date} the new date with the ISO week-numbering year set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set ISO week-numbering year 2007 to 29 December 2008: + * const result = setISOWeekYear(new Date(2008, 11, 29), 2007) + * //=> Mon Jan 01 2007 00:00:00 + */ +function setISOWeekYear(dirtyDate, dirtyISOWeekYear) { + (0, _index5.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var isoWeekYear = (0, _index.default)(dirtyISOWeekYear); + var diff = (0, _index4.default)(date, (0, _index3.default)(date)); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setFullYear(isoWeekYear, 0, 4); + fourthOfJanuary.setHours(0, 0, 0, 0); + date = (0, _index3.default)(fourthOfJanuary); + date.setDate(date.getDate() + diff); + return date; +} +module.exports = exports.default; -var _index = _interopRequireDefault(__webpack_require__(936)); +/***/ }), -var _index2 = _interopRequireDefault(__webpack_require__(217)); +/***/ 9105: +/***/ ((module, exports, __nccwpck_require__) => { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setMilliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @name differenceInWeeks - * @category Week Helpers - * @summary Get the number of full weeks between the given dates. + * @name setMilliseconds + * @category Millisecond Helpers + * @summary Set the milliseconds to the given date. * * @description - * Get the number of full weeks between two dates. Fractional weeks are - * truncated towards zero. - * - * One "full week" is the distance between a local time in one day to the same - * local time 7 days earlier or later. A full week can sometimes be less than - * or more than 7*24 hours if a daylight savings change happens between two dates. - * - * To ignore DST and only measure exact 7*24-hour periods, use this instead: - * `Math.floor(differenceInHours(dateLeft, dateRight)/(7*24))|0`. + * Set the milliseconds to the given date. * + * @param {Date|Number} date - the date to be changed + * @param {Number} milliseconds - the milliseconds of the new date + * @returns {Date} the new date with the milliseconds set + * @throws {TypeError} 2 arguments required * - * ### v2.0.0 breaking changes: + * @example + * // Set 300 milliseconds to 1 September 2014 11:30:40.500: + * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300) + * //=> Mon Sep 01 2014 11:30:40.300 + */ +function setMilliseconds(dirtyDate, dirtyMilliseconds) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var milliseconds = (0, _index.default)(dirtyMilliseconds); + date.setMilliseconds(milliseconds); + return date; +} +module.exports = exports.default; + +/***/ }), + +/***/ 9207: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setMinutes; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setMinutes + * @category Minute Helpers + * @summary Set the minutes to the given date. * - * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). + * @description + * Set the minutes to the given date. * - * @param {Date|Number} dateLeft - the later date - * @param {Date|Number} dateRight - the earlier date - * @returns {Number} the number of full weeks + * @param {Date|Number} date - the date to be changed + * @param {Number} minutes - the minutes of the new date + * @returns {Date} the new date with the minutes set * @throws {TypeError} 2 arguments required * * @example - * // How many full weeks are between 5 July 2014 and 20 July 2014? - * const result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5)) - * //=> 2 - * - * // How many full weeks are between - * // 1 March 2020 0:00 and 6 June 2020 0:00 ? - * // Note: because local time is used, the - * // result will always be 8 weeks (54 days), - * // even if DST starts and the period has - * // only 54*24-1 hours. - * const result = differenceInWeeks( - * new Date(2020, 5, 1), - * new Date(2020, 2, 6) - * ) - * //=> 8 + * // Set 45 minutes to 1 September 2014 11:30:40: + * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45) + * //=> Mon Sep 01 2014 11:45:40 */ -function differenceInWeeks(dirtyDateLeft, dirtyDateRight) { - (0, _index2.default)(2, arguments); - var diff = (0, _index.default)(dirtyDateLeft, dirtyDateRight) / 7; - return diff > 0 ? Math.floor(diff) : Math.ceil(diff); +function setMinutes(dirtyDate, dirtyMinutes) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var minutes = (0, _index.default)(dirtyMinutes); + date.setMinutes(minutes); + return date; } - module.exports = exports.default; /***/ }), -/* 556 */, -/* 557 */ -/***/ (function(module, exports, __webpack_require__) { -/* module decorator */ module = __webpack_require__.nmd(module); +/***/ 847: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setMonth; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(7573)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); /** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * @name setMonth + * @category Month Helpers + * @summary Set the month to the given date. + * + * @description + * Set the month to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} month - the month of the new date + * @returns {Date} the new date with the month set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set February to 1 September 2014: + * const result = setMonth(new Date(2014, 8, 1), 1) + * //=> Sat Feb 01 2014 00:00:00 */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; +function setMonth(dirtyDate, dirtyMonth) { + (0, _index4.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var month = (0, _index.default)(dirtyMonth); + var year = date.getFullYear(); + var day = date.getDate(); + var dateWithDesiredMonth = new Date(0); + dateWithDesiredMonth.setFullYear(year, month, 15); + dateWithDesiredMonth.setHours(0, 0, 0, 0); + var daysInMonth = (0, _index3.default)(dateWithDesiredMonth); + // Set the last day of the new month + // if the original date was the last day of the longer month + date.setMonth(month, Math.min(day, daysInMonth)); + return date; +} +module.exports = exports.default; - /** Used as the semantic version number. */ - var VERSION = '4.17.21'; +/***/ }), - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; +/***/ 621: +/***/ ((module, exports, __nccwpck_require__) => { - /** Error message constants. */ - var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function', - INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; +"use strict"; - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setQuarter; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(847)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setQuarter + * @category Quarter Helpers + * @summary Set the year quarter to the given date. + * + * @description + * Set the year quarter to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} quarter - the quarter of the new date + * @returns {Date} the new date with the quarter set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set the 2nd quarter to 2 July 2014: + * const result = setQuarter(new Date(2014, 6, 2), 2) + * //=> Wed Apr 02 2014 00:00:00 + */ +function setQuarter(dirtyDate, dirtyQuarter) { + (0, _index4.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var quarter = (0, _index.default)(dirtyQuarter); + var oldQuarter = Math.floor(date.getMonth() / 3) + 1; + var diff = quarter - oldQuarter; + return (0, _index3.default)(date, date.getMonth() + diff * 3); +} +module.exports = exports.default; - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; +/***/ }), - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; +/***/ 1346: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; +"use strict"; - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setSeconds; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setSeconds + * @category Second Helpers + * @summary Set the seconds to the given date. + * + * @description + * Set the seconds to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} seconds - the seconds of the new date + * @returns {Date} the new date with the seconds set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set 45 seconds to 1 September 2014 11:30:40: + * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45) + * //=> Mon Sep 01 2014 11:30:45 + */ +function setSeconds(dirtyDate, dirtySeconds) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var seconds = (0, _index.default)(dirtySeconds); + date.setSeconds(seconds); + return date; +} +module.exports = exports.default; - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; +/***/ }), - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; +/***/ 2664: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; +"use strict"; - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - /** Used to associate wrap methods with their bit flags. */ - var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] - ]; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setWeek; +var _index = _interopRequireDefault(__nccwpck_require__(81)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index4 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name setWeek + * @category Week Helpers + * @summary Set the local week to the given date. + * + * @description + * Set the local week to the given date, saving the weekday number. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering + * + * @param {Date|Number} date - the date to be changed + * @param {Number} week - the week of the new date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year + * @returns {Date} the new date with the local week set + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 + * + * @example + * // Set the 1st week to 2 January 2005 with default options: + * const result = setWeek(new Date(2005, 0, 2), 1) + * //=> Sun Dec 26 2004 00:00:00 + * + * @example + * // Set the 1st week to 2 January 2005, + * // if Monday is the first day of the week, + * // and the first week of the year always contains 4 January: + * const result = setWeek(new Date(2005, 0, 2), 1, { + * weekStartsOn: 1, + * firstWeekContainsDate: 4 + * }) + * //=> Sun Jan 4 2004 00:00:00 + */ +function setWeek(dirtyDate, dirtyWeek, options) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var week = (0, _index4.default)(dirtyWeek); + var diff = (0, _index.default)(date, options) - week; + date.setDate(date.getDate() - diff * 7); + return date; +} +module.exports = exports.default; - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - domExcTag = '[object DOMException]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]', - weakSetTag = '[object WeakSet]'; +/***/ }), - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +/***/ 3438: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; +"use strict"; - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, - reUnescapedHtml = /[&<>"']/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(3086)); +var _index2 = _interopRequireDefault(__nccwpck_require__(8014)); +var _index3 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index4 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index5 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index6 = __nccwpck_require__(9307); +/** + * @name setWeekYear + * @category Week-Numbering Year Helpers + * @summary Set the local week-numbering year to the given date. + * + * @description + * Set the local week-numbering year to the given date, + * saving the week number and the weekday number. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering + * + * @param {Date|Number} date - the date to be changed + * @param {Number} weekYear - the local week-numbering year of the new date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year + * @returns {Date} the new date with the local week-numbering year set + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 + * + * @example + * // Set the local week-numbering year 2004 to 2 January 2010 with default options: + * const result = setWeekYear(new Date(2010, 0, 2), 2004) + * //=> Sat Jan 03 2004 00:00:00 + * + * @example + * // Set the local week-numbering year 2004 to 2 January 2010, + * // if Monday is the first day of week + * // and 4 January is always in the first week of the year: + * const result = setWeekYear(new Date(2010, 0, 2), 2004, { + * weekStartsOn: 1, + * firstWeekContainsDate: 4 + * }) + * //=> Sat Jan 01 2005 00:00:00 + */ +function setWeekYear(dirtyDate, dirtyWeekYear, options) { + var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index5.default)(2, arguments); + var defaultOptions = (0, _index6.getDefaultOptions)(); + var firstWeekContainsDate = (0, _index4.default)((_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); + var date = (0, _index3.default)(dirtyDate); + var weekYear = (0, _index4.default)(dirtyWeekYear); + var diff = (0, _index.default)(date, (0, _index2.default)(date, options)); + var firstWeek = new Date(0); + firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate); + firstWeek.setHours(0, 0, 0, 0); + date = (0, _index2.default)(firstWeek, options); + date.setDate(date.getDate() + diff); + return date; +} +module.exports = exports.default; - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; +/***/ }), - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); +/***/ 6212: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to match leading whitespace. */ - var reTrimStart = /^\s+/; +"use strict"; - /** Used to match a single whitespace character. */ - var reWhitespace = /\s/; - /** Used to match wrap detail comments. */ - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = setYear; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6477)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name setYear + * @category Year Helpers + * @summary Set the year to the given date. + * + * @description + * Set the year to the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} year - the year of the new date + * @returns {Date} the new date with the year set + * @throws {TypeError} 2 arguments required + * + * @example + * // Set year 2013 to 1 September 2014: + * const result = setYear(new Date(2014, 8, 1), 2013) + * //=> Sun Sep 01 2013 00:00:00 + */ +function setYear(dirtyDate, dirtyYear) { + (0, _index3.default)(2, arguments); + var date = (0, _index2.default)(dirtyDate); + var year = (0, _index.default)(dirtyYear); - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date + if (isNaN(date.getTime())) { + return new Date(NaN); + } + date.setFullYear(year); + return date; +} +module.exports = exports.default; - /** - * Used to validate the `validate` option in `_.template` variable. - * - * Forbids characters which could potentially change the meaning of the function argument definition: - * - "()," (modification of function parameters) - * - "=" (default value) - * - "[]{}" (destructuring of function parameters) - * - "/" (beginning of a comment) - * - whitespace - */ - var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; +/***/ }), - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; +/***/ 1868: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; +"use strict"; - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfDay; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfDay + * @category Day Helpers + * @summary Return the start of a day for the given date. + * + * @description + * Return the start of a day for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of a day + * @throws {TypeError} 1 argument required + * + * @example + * // The start of a day for 2 September 2014 11:55:00: + * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Sep 02 2014 00:00:00 + */ +function startOfDay(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; +/***/ }), - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; +/***/ 2025: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; +"use strict"; - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfDecade; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfDecade + * @category Decade Helpers + * @summary Return the start of a decade for the given date. + * + * @description + * Return the start of a decade for the given date. + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of a decade + * @throws {TypeError} 1 argument required + * + * @example + * // The start of a decade for 21 October 2015 00:00:00: + * const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00)) + * //=> Jan 01 2010 00:00:00 + */ +function startOfDecade(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var year = date.getFullYear(); + var decade = Math.floor(year / 10) * 10; + date.setFullYear(decade, 0, 1); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; +/***/ }), - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; +/***/ 6277: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; +"use strict"; - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfHour; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfHour + * @category Hour Helpers + * @summary Return the start of an hour for the given date. + * + * @description + * Return the start of an hour for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of an hour + * @throws {TypeError} 1 argument required + * + * @example + * // The start of an hour for 2 September 2014 11:55:00: + * const result = startOfHour(new Date(2014, 8, 2, 11, 55)) + * //=> Tue Sep 02 2014 11:00:00 + */ +function startOfHour(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + date.setMinutes(0, 0, 0); + return date; +} +module.exports = exports.default; - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); +/***/ }), - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); +/***/ 6307: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); +"use strict"; - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfISOWeek; +var _index = _interopRequireDefault(__nccwpck_require__(9813)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfISOWeek + * @category ISO Week Helpers + * @summary Return the start of an ISO week for the given date. + * + * @description + * Return the start of an ISO week for the given date. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of an ISO week + * @throws {TypeError} 1 argument required + * + * @example + * // The start of an ISO week for 2 September 2014 11:55:00: + * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Mon Sep 01 2014 00:00:00 + */ +function startOfISOWeek(dirtyDate) { + (0, _index2.default)(1, arguments); + return (0, _index.default)(dirtyDate, { + weekStartsOn: 1 + }); +} +module.exports = exports.default; - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; +/***/ }), - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' - ]; +/***/ 776: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; +"use strict"; - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfISOWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(6991)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6307)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Return the start of an ISO week-numbering year for the given date. + * + * @description + * Return the start of an ISO week-numbering year, + * which always starts 3 days before the year's first Thursday. + * The result will be in the local timezone. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of an ISO week-numbering year + * @throws {TypeError} 1 argument required + * + * @example + * // The start of an ISO week-numbering year for 2 July 2005: + * const result = startOfISOWeekYear(new Date(2005, 6, 2)) + * //=> Mon Jan 03 2005 00:00:00 + */ +function startOfISOWeekYear(dirtyDate) { + (0, _index3.default)(1, arguments); + var year = (0, _index.default)(dirtyDate); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setFullYear(year, 0, 4); + fourthOfJanuary.setHours(0, 0, 0, 0); + var date = (0, _index2.default)(fourthOfJanuary); + return date; +} +module.exports = exports.default; - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; +/***/ }), - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; +/***/ 8567: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; +"use strict"; - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfMinute; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfMinute + * @category Minute Helpers + * @summary Return the start of a minute for the given date. + * + * @description + * Return the start of a minute for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of a minute + * @throws {TypeError} 1 argument required + * + * @example + * // The start of a minute for 1 December 2014 22:15:45.400: + * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:00 + */ +function startOfMinute(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + date.setSeconds(0, 0); + return date; +} +module.exports = exports.default; - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +/***/ }), - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +/***/ 7182: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); +"use strict"; - /** Detect free variable `exports`. */ - var freeExports = true && exports && !exports.nodeType && exports; - /** Detect free variable `module`. */ - var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfMonth; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfMonth + * @category Month Helpers + * @summary Return the start of a month for the given date. + * + * @description + * Return the start of a month for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of a month + * @throws {TypeError} 1 argument required + * + * @example + * // The start of a month for 2 September 2014 11:55:00: + * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Mon Sep 01 2014 00:00:00 + */ +function startOfMonth(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + date.setDate(1); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; +/***/ }), - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; +/***/ 2932: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; +"use strict"; - if (types) { - return types; - } - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfQuarter; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfQuarter + * @category Quarter Helpers + * @summary Return the start of a year quarter for the given date. + * + * @description + * Return the start of a year quarter for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of a quarter + * @throws {TypeError} 1 argument required + * + * @example + * // The start of a quarter for 2 September 2014 11:55:00: + * const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Tue Jul 01 2014 00:00:00 + */ +function startOfQuarter(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + var currentMonth = date.getMonth(); + var month = currentMonth - currentMonth % 3; + date.setMonth(month, 1); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - /* Node.js helper references. */ - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, - nodeIsDate = nodeUtil && nodeUtil.isDate, - nodeIsMap = nodeUtil && nodeUtil.isMap, - nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, - nodeIsSet = nodeUtil && nodeUtil.isSet, - nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; +/***/ }), - /*--------------------------------------------------------------------------*/ +/***/ 6738: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } +"use strict"; - /** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfSecond; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfSecond + * @category Second Helpers + * @summary Return the start of a second for the given date. + * + * @description + * Return the start of a second for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of a second + * @throws {TypeError} 1 argument required + * + * @example + * // The start of a second for 1 December 2014 22:15:45.400: + * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:45.000 + */ +function startOfSecond(dirtyDate) { + (0, _index2.default)(1, arguments); + var date = (0, _index.default)(dirtyDate); + date.setMilliseconds(0); + return date; +} +module.exports = exports.default; - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; +/***/ }), - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } +/***/ 5516: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; +"use strict"; - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - /** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfToday; +var _index = _interopRequireDefault(__nccwpck_require__(1868)); +/** + * @name startOfToday + * @category Day Helpers + * @summary Return the start of today. + * @pure false + * + * @description + * Return the start of today. + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `Date.now()` internally hence impure and can't be safely curried. + * + * @returns {Date} the start of today + * + * @example + * // If today is 6 October 2014: + * const result = startOfToday() + * //=> Mon Oct 6 2014 00:00:00 + */ +function startOfToday() { + return (0, _index.default)(Date.now()); +} +module.exports = exports.default; - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } +/***/ }), - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; +/***/ 2442: +/***/ ((module, exports) => { - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; - } +"use strict"; - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } - /** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfTomorrow; +/** + * @name startOfTomorrow + * @category Day Helpers + * @summary Return the start of tomorrow. + * @pure false + * + * @description + * Return the start of tomorrow. + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `new Date()` internally hence impure and can't be safely curried. + * + * @returns {Date} the start of tomorrow + * + * @example + * // If today is 6 October 2014: + * const result = startOfTomorrow() + * //=> Tue Oct 7 2014 00:00:00 + */ +function startOfTomorrow() { + var now = new Date(); + var year = now.getFullYear(); + var month = now.getMonth(); + var day = now.getDate(); + var date = new Date(0); + date.setFullYear(year, month, day + 1); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } +/***/ }), - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); +/***/ 9813: +/***/ ((module, exports, __nccwpck_require__) => { - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } +"use strict"; - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - while (++index < length) { - array[offset + index] = values[index]; - } - return array; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfWeek; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index4 = __nccwpck_require__(9307); +/** + * @name startOfWeek + * @category Week Helpers + * @summary Return the start of a week for the given date. + * + * @description + * Return the start of a week for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Date} the start of a week + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * + * @example + * // The start of a week for 2 September 2014 11:55:00: + * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Sun Aug 31 2014 00:00:00 + * + * @example + * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00: + * 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; + (0, _index3.default)(1, arguments); + var defaultOptions = (0, _index4.getDefaultOptions)(); + var weekStartsOn = (0, _index2.default)((_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'); } + var date = (0, _index.default)(dirtyDate); + var day = date.getDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + date.setDate(date.getDate() - diff); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; +/***/ }), - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } +/***/ 8014: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } +"use strict"; - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfWeekYear; +var _index = _interopRequireDefault(__nccwpck_require__(3494)); +var _index2 = _interopRequireDefault(__nccwpck_require__(9813)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +var _index4 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index5 = __nccwpck_require__(9307); +/** + * @name startOfWeekYear + * @category Week-Numbering Year Helpers + * @summary Return the start of a local week-numbering year for the given date. + * + * @description + * Return the start of a local week-numbering year. + * The exact calculation depends on the values of + * `options.weekStartsOn` (which is the index of the first day of the week) + * and `options.firstWeekContainsDate` (which is the day of January, which is always in + * the first week of the week-numbering year) + * + * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering + * + * @param {Date|Number} date - the original date + * @param {Object} [options] - an object with options. + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year + * @returns {Date} the start of a week-numbering year + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 + * + * @example + * // The start of an a week-numbering year for 2 July 2005 with default settings: + * const result = startOfWeekYear(new Date(2005, 6, 2)) + * //=> Sun Dec 26 2004 00:00:00 + * + * @example + * // The start of a week-numbering year for 2 July 2005 + * // if Monday is the first day of week + * // and 4 January is always in the first week of the year: + * const result = startOfWeekYear(new Date(2005, 6, 2), { + * weekStartsOn: 1, + * firstWeekContainsDate: 4 + * }) + * //=> Mon Jan 03 2005 00:00:00 + */ +function startOfWeekYear(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + (0, _index4.default)(1, arguments); + var defaultOptions = (0, _index5.getDefaultOptions)(); + var firstWeekContainsDate = (0, _index3.default)((_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); + var year = (0, _index.default)(dirtyDate, options); + var firstWeek = new Date(0); + firstWeek.setFullYear(year, 0, firstWeekContainsDate); + firstWeek.setHours(0, 0, 0, 0); + var date = (0, _index2.default)(firstWeek, options); + return date; +} +module.exports = exports.default; - /** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - var asciiSize = baseProperty('length'); +/***/ }), - /** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function asciiToArray(string) { - return string.split(''); - } +/***/ 8225: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } +"use strict"; - /** - * The base implementation of methods like `_.findKey` and `_.findLastKey`, - * without support for iteratee shorthands, which iterates over `collection` - * using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = key; - return false; - } - }); - return result; - } - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfYear; +var _index = _interopRequireDefault(__nccwpck_require__(6477)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name startOfYear + * @category Year Helpers + * @summary Return the start of a year for the given date. + * + * @description + * Return the start of a year for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the start of a year + * @throws {TypeError} 1 argument required + * + * @example + * // The start of a year for 2 September 2014 11:55:00: + * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) + * //=> Wed Jan 01 2014 00:00:00 + */ +function startOfYear(dirtyDate) { + (0, _index2.default)(1, arguments); + var cleanDate = (0, _index.default)(dirtyDate); + var date = new Date(0); + date.setFullYear(cleanDate.getFullYear(), 0, 1); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } +/***/ }), - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); - } +/***/ 1672: +/***/ ((module, exports) => { - /** - * This function is like `baseIndexOf` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @param {Function} comparator The comparator invoked per element. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, - length = array.length; +"use strict"; - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } - } - return -1; - } - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = startOfYesterday; +/** + * @name startOfYesterday + * @category Day Helpers + * @summary Return the start of yesterday. + * @pure false + * + * @description + * Return the start of yesterday. + * + * > ⚠️ Please note that this function is not present in the FP submodule as + * > it uses `new Date()` internally hence impure and can't be safely curried. + * + * @returns {Date} the start of yesterday + * + * @example + * // If today is 6 October 2014: + * const result = startOfYesterday() + * //=> Sun Oct 5 2014 00:00:00 + */ +function startOfYesterday() { + var now = new Date(); + var year = now.getFullYear(); + var month = now.getMonth(); + var day = now.getDate(); + var date = new Date(0); + date.setFullYear(year, month, day - 1); + date.setHours(0, 0, 0, 0); + return date; +} +module.exports = exports.default; - /** - * The base implementation of `_.mean` and `_.meanBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the mean. - */ - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; - } +/***/ }), - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } +/***/ 3875: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } +"use strict"; - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - /** - * The base implementation of `_.sortBy` which uses `comparer` to define the - * sort order of `array` and replaces criteria objects with their corresponding - * values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = sub; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _index = _interopRequireDefault(__nccwpck_require__(970)); +var _index2 = _interopRequireDefault(__nccwpck_require__(6752)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index4 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name sub + * @category Common Helpers + * @summary Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. + * + * @description + * Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be subtracted + * + * | Key | Description | + * |---------|------------------------------------| + * | years | Amount of years to be subtracted | + * | months | Amount of months to be subtracted | + * | weeks | Amount of weeks to be subtracted | + * | days | Amount of days to be subtracted | + * | hours | Amount of hours to be subtracted | + * | minutes | Amount of minutes to be subtracted | + * | seconds | Amount of seconds to be subtracted | + * + * All values default to 0 + * + * @returns {Date} the new date with the seconds subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract the following duration from 15 June 2017 15:29:20 + * const result = sub(new Date(2017, 5, 15, 15, 29, 20), { + * years: 2, + * months: 9, + * weeks: 1, + * days: 7, + * hours: 5, + * minutes: 9, + * seconds: 30 + * }) + * //=> Mon Sep 1 2014 10:19:50 + */ +function sub(date, duration) { + (0, _index3.default)(2, arguments); + if (!duration || (0, _typeof2.default)(duration) !== 'object') return new Date(NaN); + var years = duration.years ? (0, _index4.default)(duration.years) : 0; + var months = duration.months ? (0, _index4.default)(duration.months) : 0; + var weeks = duration.weeks ? (0, _index4.default)(duration.weeks) : 0; + var days = duration.days ? (0, _index4.default)(duration.days) : 0; + var hours = duration.hours ? (0, _index4.default)(duration.hours) : 0; + var minutes = duration.minutes ? (0, _index4.default)(duration.minutes) : 0; + var seconds = duration.seconds ? (0, _index4.default)(duration.seconds) : 0; + + // Subtract years and months + var dateWithoutMonths = (0, _index2.default)(date, months + years * 12); + + // Subtract weeks and days + var dateWithoutDays = (0, _index.default)(dateWithoutMonths, days + weeks * 7); + + // Subtract hours, minutes and seconds + var minutestoSub = minutes + hours * 60; + var secondstoSub = seconds + minutestoSub * 60; + var mstoSub = secondstoSub * 1000; + var finalDate = new Date(dateWithoutDays.getTime() - mstoSub); + return finalDate; +} +module.exports = exports.default; - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } +/***/ }), - /** - * The base implementation of `_.sum` and `_.sumBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; +/***/ 1952: +/***/ ((module, exports, __nccwpck_require__) => { - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; - } +"use strict"; - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subBusinessDays; +var _index = _interopRequireDefault(__nccwpck_require__(1727)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name subBusinessDays + * @category Day Helpers + * @summary Substract the specified number of business days (mon - fri) to the given date. + * + * @description + * Substract the specified number of business days (mon - fri) to the given date, ignoring weekends. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of business days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the business days subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Substract 10 business days from 1 September 2014: + * const result = subBusinessDays(new Date(2014, 8, 1), 10) + * //=> Mon Aug 18 2014 00:00:00 (skipped weekend days) + */ +function subBusinessDays(dirtyDate, dirtyAmount) { + (0, _index2.default)(2, arguments); + var amount = (0, _index3.default)(dirtyAmount); + return (0, _index.default)(dirtyDate, -amount); +} +module.exports = exports.default; - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } +/***/ }), - /** - * The base implementation of `_.trim`. - * - * @private - * @param {string} string The string to trim. - * @returns {string} Returns the trimmed string. - */ - function baseTrim(string) { - return string - ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') - : string; - } +/***/ 970: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } +"use strict"; - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } - /** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subDays; +var _index = _interopRequireDefault(__nccwpck_require__(6227)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name subDays + * @category Day Helpers + * @summary Subtract the specified number of days from the given date. + * + * @description + * Subtract the specified number of days from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the days subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 10 days from 1 September 2014: + * const result = subDays(new Date(2014, 8, 1), 10) + * //=> Fri Aug 22 2014 00:00:00 + */ +function subDays(dirtyDate, dirtyAmount) { + (0, _index2.default)(2, arguments); + var amount = (0, _index3.default)(dirtyAmount); + return (0, _index.default)(dirtyDate, -amount); +} +module.exports = exports.default; - /** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; +/***/ }), - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } +/***/ 2481: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; +"use strict"; - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - /** - * Gets the number of `placeholder` occurrences in `array`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} placeholder The placeholder to search for. - * @returns {number} Returns the placeholder count. - */ - function countHolders(array, placeholder) { - var length = array.length, - result = 0; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subHours; +var _index = _interopRequireDefault(__nccwpck_require__(9956)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name subHours + * @category Hour Helpers + * @summary Subtract the specified number of hours from the given date. + * + * @description + * Subtract the specified number of hours from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of hours to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the hours subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 2 hours from 11 July 2014 01:00:00: + * const result = subHours(new Date(2014, 6, 11, 1, 0), 2) + * //=> Thu Jul 10 2014 23:00:00 + */ +function subHours(dirtyDate, dirtyAmount) { + (0, _index2.default)(2, arguments); + var amount = (0, _index3.default)(dirtyAmount); + return (0, _index.default)(dirtyDate, -amount); +} +module.exports = exports.default; - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; - } +/***/ }), - /** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); +/***/ 3925: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); +"use strict"; - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subISOWeekYears; +var _index = _interopRequireDefault(__nccwpck_require__(5318)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name subISOWeekYears + * @category ISO Week-Numbering Year Helpers + * @summary Subtract the specified number of ISO week-numbering years from the given date. + * + * @description + * Subtract the specified number of ISO week-numbering years from the given date. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of ISO week-numbering years to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the ISO week-numbering years subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 5 ISO week-numbering years from 1 September 2014: + * const result = subISOWeekYears(new Date(2014, 8, 1), 5) + * //=> Mon Aug 31 2009 00:00:00 + */ +function subISOWeekYears(dirtyDate, dirtyAmount) { + (0, _index2.default)(2, arguments); + var amount = (0, _index3.default)(dirtyAmount); + return (0, _index.default)(dirtyDate, -amount); +} +module.exports = exports.default; - /** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } +/***/ }), - /** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } +/***/ 7923: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; +"use strict"; - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subMilliseconds; +var _index = _interopRequireDefault(__nccwpck_require__(524)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name subMilliseconds + * @category Millisecond Helpers + * @summary Subtract the specified number of milliseconds from the given date. + * + * @description + * Subtract the specified number of milliseconds from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the milliseconds subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000: + * 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) { + (0, _index2.default)(2, arguments); + var amount = (0, _index3.default)(dirtyAmount); + return (0, _index.default)(dirtyDate, -amount); +} +module.exports = exports.default; - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } +/***/ }), - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } +/***/ 7535: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; +"use strict"; - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; - } - } - return result; - } - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subMinutes; +var _index = _interopRequireDefault(__nccwpck_require__(5268)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2063)); +var _index3 = _interopRequireDefault(__nccwpck_require__(1985)); +/** + * @name subMinutes + * @category Minute Helpers + * @summary Subtract the specified number of minutes from the given date. + * + * @description + * Subtract the specified number of minutes from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of minutes to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the minutes subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 30 minutes from 10 July 2014 12:00:00: + * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 11:30:00 + */ +function subMinutes(dirtyDate, dirtyAmount) { + (0, _index2.default)(2, arguments); + var amount = (0, _index3.default)(dirtyAmount); + return (0, _index.default)(dirtyDate, -amount); +} +module.exports = exports.default; - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } +/***/ }), - /** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ - function setToPairs(set) { - var index = -1, - result = Array(set.size); +/***/ 6752: +/***/ ((module, exports, __nccwpck_require__) => { - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; - } +"use strict"; - /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subMonths; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(2995)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name subMonths + * @category Month Helpers + * @summary Subtract the specified number of months from the given date. + * + * @description + * Subtract the specified number of months from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the months subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 5 months from 1 February 2015: + * const result = subMonths(new Date(2015, 1, 1), 5) + * //=> Mon Sep 01 2014 00:00:00 + */ +function subMonths(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, -amount); +} +module.exports = exports.default; - /** - * A specialized version of `_.lastIndexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; - } - } - return index; - } +/***/ }), - /** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ - function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); - } +/***/ 3139: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); - } +"use strict"; - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedEndIndex(string) { - var index = string.length; - while (index-- && reWhitespace.test(string.charAt(index))) {} - return index; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subQuarters; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(5149)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name subQuarters + * @category Quarter Helpers + * @summary Subtract the specified number of year quarters from the given date. + * + * @description + * Subtract the specified number of year quarters from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of quarters to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the quarters subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 3 quarters from 1 September 2014: + * const result = subQuarters(new Date(2014, 8, 1), 3) + * //=> Sun Dec 01 2013 00:00:00 + */ +function subQuarters(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, -amount); +} +module.exports = exports.default; - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - var unescapeHtmlChar = basePropertyOf(htmlUnescapes); +/***/ }), - /** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; - } +/***/ 138: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } +"use strict"; - /** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } - /*--------------------------------------------------------------------------*/ +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subSeconds; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(4112)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name subSeconds + * @category Second Helpers + * @summary Subtract the specified number of seconds from the given date. + * + * @description + * Subtract the specified number of seconds from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of seconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the seconds subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 30 seconds from 10 July 2014 12:45:00: + * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) + * //=> Thu Jul 10 2014 12:44:30 + */ +function subSeconds(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, -amount); +} +module.exports = exports.default; - /** - * Create a new pristine `lodash` function using the `context` object. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Util - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // Create a suped-up `defer` in Node.js. - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - var runInContext = (function runInContext(context) { - context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); +/***/ }), - /** Built-in constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; +/***/ 5504: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; +"use strict"; - /** Used to detect overreaching core-js shims. */ - var coreJsData = context['__core-js_shared__']; - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subWeeks; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(7195)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name subWeeks + * @category Week Helpers + * @summary Subtract the specified number of weeks from the given date. + * + * @description + * Subtract the specified number of weeks from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of weeks to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the weeks subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 4 weeks from 1 September 2014: + * const result = subWeeks(new Date(2014, 8, 1), 4) + * //=> Mon Aug 04 2014 00:00:00 + */ +function subWeeks(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, -amount); +} +module.exports = exports.default; - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; +/***/ }), - /** Used to generate unique IDs. */ - var idCounter = 0; +/***/ 843: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); +"use strict"; - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = subYears; +var _index = _interopRequireDefault(__nccwpck_require__(1985)); +var _index2 = _interopRequireDefault(__nccwpck_require__(3367)); +var _index3 = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name subYears + * @category Year Helpers + * @summary Subtract the specified number of years from the given date. + * + * @description + * Subtract the specified number of years from the given date. + * + * @param {Date|Number} date - the date to be changed + * @param {Number} amount - the amount of years to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. + * @returns {Date} the new date with the years subtracted + * @throws {TypeError} 2 arguments required + * + * @example + * // Subtract 5 years from 1 September 2014: + * const result = subYears(new Date(2014, 8, 1), 5) + * //=> Tue Sep 01 2009 00:00:00 + */ +function subYears(dirtyDate, dirtyAmount) { + (0, _index3.default)(2, arguments); + var amount = (0, _index.default)(dirtyAmount); + return (0, _index2.default)(dirtyDate, -amount); +} +module.exports = exports.default; - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; +/***/ }), - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); +/***/ 6477: +/***/ ((module, exports, __nccwpck_require__) => { - /** Built-in value references. */ - var Buffer = moduleExports ? context.Buffer : undefined, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, - symIterator = Symbol ? Symbol.iterator : undefined, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; +"use strict"; - var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} - }()); - /** Mocked built-ins. */ - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, - ctxNow = Date && Date.now !== root.Date.now && Date.now, - ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = toDate; +var _typeof2 = _interopRequireDefault(__nccwpck_require__(5605)); +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +/** + * @name toDate + * @category Common Helpers + * @summary Convert the given argument to an instance of Date. + * + * @description + * Convert the given argument to an instance of Date. + * + * If the argument is an instance of Date, the function returns its clone. + * + * If the argument is a number, it is treated as a timestamp. + * + * If the argument is none of the above, the function returns Invalid Date. + * + * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. + * + * @param {Date|Number} argument - the value to convert + * @returns {Date} the parsed date in the local time zone + * @throws {TypeError} 1 argument required + * + * @example + * // Clone the date: + * const result = toDate(new Date(2014, 1, 11, 11, 30, 30)) + * //=> Tue Feb 11 2014 11:30:30 + * + * @example + * // Convert the timestamp to date: + * const result = toDate(1392098430000) + * //=> Tue Feb 11 2014 11:30:30 + */ +function toDate(argument) { + (0, _index.default)(1, arguments); + var argStr = Object.prototype.toString.call(argument); - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = Date.now, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; + // Clone the date + if (argument instanceof Date || (0, _typeof2.default)(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]') { + return new Date(argument); + } 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(new Error().stack); + } + return new Date(NaN); + } +} +module.exports = exports.default; - /* Built-in method references that are verified to be native. */ - var DataView = getNative(context, 'DataView'), - Map = getNative(context, 'Map'), - Promise = getNative(context, 'Promise'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); +/***/ }), - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; +/***/ 6812: +/***/ ((module, exports, __nccwpck_require__) => { - /** Used to lookup unminified function names. */ - var realNames = {}; +"use strict"; - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = weeksToDays; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name weeksToDays + * @category Conversion Helpers + * @summary Convert weeks to days. + * + * @description + * Convert a number of weeks to a full number of days. + * + * @param {number} weeks - number of weeks to be converted + * + * @returns {number} the number of weeks converted in days + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 2 weeks into days + * const result = weeksToDays(2) + * //=> 14 + */ +function weeksToDays(weeks) { + (0, _index.default)(1, arguments); + return Math.floor(weeks * _index2.daysInWeek); +} +module.exports = exports.default; - /*------------------------------------------------------------------------*/ +/***/ }), - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } +/***/ 4616: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); +"use strict"; - /** - * The function whose prototype chain sequence wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; - } +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = yearsToMonths; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name yearsToMonths + * @category Conversion Helpers + * @summary Convert years to months. + * + * @description + * Convert a number of years to a full number of months. + * + * @param {number} years - number of years to be converted + * + * @returns {number} the number of years converted in months + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 2 years into months + * const result = yearsToMonths(2) + * //=> 24 + */ +function yearsToMonths(years) { + (0, _index.default)(1, arguments); + return Math.floor(years * _index2.monthsInYear); +} +module.exports = exports.default; - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB) as well as ES2015 template strings. Change the - * following template settings to use alternative delimiters. - * - * @static - * @memberOf _ - * @type {Object} - */ - lodash.templateSettings = { +/***/ }), - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'escape': reEscape, +/***/ 7440: +/***/ ((module, exports, __nccwpck_require__) => { - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'evaluate': reEvaluate, +"use strict"; - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'interpolate': reInterpolate, - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type {string} - */ - 'variable': '', +var _interopRequireDefault = (__nccwpck_require__(3286)["default"]); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = yearsToQuarters; +var _index = _interopRequireDefault(__nccwpck_require__(2063)); +var _index2 = __nccwpck_require__(5756); +/** + * @name yearsToQuarters + * @category Conversion Helpers + * @summary Convert years to quarters. + * + * @description + * Convert a number of years to a full number of quarters. + * + * @param {number} years - number of years to be converted + * + * @returns {number} the number of years converted in quarters + * @throws {TypeError} 1 argument required + * + * @example + * // Convert 2 years to quarters + * const result = yearsToQuarters(2) + * //=> 8 + */ +function yearsToQuarters(years) { + (0, _index.default)(1, arguments); + return Math.floor(years * _index2.quartersInYear); +} +module.exports = exports.default; - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type {Object} - */ - 'imports': { +/***/ }), - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type {Function} - */ - '_': lodash - } - }; +/***/ 3505: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; +"use strict"; - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - /*------------------------------------------------------------------------*/ +var util = __nccwpck_require__(3837); +var isArrayish = __nccwpck_require__(7604); - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @constructor - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } +var errorEx = function errorEx(name, properties) { + if (!name || name.constructor !== String) { + properties = name || {}; + name = Error.name; + } - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; - } + var errorExError = function ErrorEXError(message) { + if (!this) { + return new ErrorEXError(message); + } - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } + message = message instanceof Error + ? message.message + : (message || this.message); - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); + Error.call(this, message); + Error.captureStackTrace(this, errorExError); - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; + this.name = name; - outer: - while (length-- && resIndex < takeCount) { - index += dir; + Object.defineProperty(this, 'message', { + configurable: true, + enumerable: false, + get: function () { + var newMessage = message.split(/\r?\n/g); - var iterIndex = -1, - value = array[index]; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); + var modifier = properties[key]; - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } + if ('message' in modifier) { + newMessage = modifier.message(this[key], newMessage) || newMessage; + if (!isArrayish(newMessage)) { + newMessage = [newMessage]; + } + } + } - // Ensure `LazyWrapper` is an instance of `baseLodash`. - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; + return newMessage.join('\n'); + }, + set: function (v) { + message = v; + } + }); - /*------------------------------------------------------------------------*/ + var overwrittenStack = null; - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); + var stackGetter = stackDescriptor.get; + var stackValue = stackDescriptor.value; + delete stackDescriptor.value; + delete stackDescriptor.writable; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } + stackDescriptor.set = function (newstack) { + overwrittenStack = newstack; + }; - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } + stackDescriptor.get = function () { + var stack = (overwrittenStack || ((stackGetter) + ? stackGetter.call(this) + : stackValue)).split(/\r?\n+/g); - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } + // starting in Node 7, the stack builder caches the message. + // just replace it. + if (!overwrittenStack) { + stack[0] = this.name + ': ' + this.message; + } - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } + var lineCount = 1; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); - } + var modifier = properties[key]; - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } + if ('line' in modifier) { + var line = modifier.line(this[key]); + if (line) { + stack.splice(lineCount++, 0, ' ' + line); + } + } - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; + if ('stack' in modifier) { + modifier.stack(this[key], stack); + } + } - /*------------------------------------------------------------------------*/ + return stack.join('\n'); + }; - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + Object.defineProperty(this, 'stack', stackDescriptor); + }; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } + if (Object.setPrototypeOf) { + Object.setPrototypeOf(errorExError.prototype, Error.prototype); + Object.setPrototypeOf(errorExError, Error); + } else { + util.inherits(errorExError, Error); + } - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } + return errorExError; +}; - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); +errorEx.append = function (str, def) { + return { + message: function (v, message) { + v = v || def; - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } + if (v) { + message[0] += ' ' + str.replace('%s', v.toString()); + } - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); + return message; + } + }; +}; - return index < 0 ? undefined : data[index][1]; - } +errorEx.line = function (str, def) { + return { + line: function (v) { + v = v || def; - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } + if (v) { + return str.replace('%s', v.toString()); + } - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); + return null; + } + }; +}; - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } +module.exports = errorEx; - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - /*------------------------------------------------------------------------*/ +/***/ }), - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; +/***/ 8691: +/***/ ((module) => { - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } +"use strict"; - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; - } +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } + return str.replace(matchOperatorsRe, '\\$&'); +}; - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } +/***/ }), - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; +/***/ 1621: +/***/ ((module) => { - /*------------------------------------------------------------------------*/ +"use strict"; - /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } - } +module.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +}; - /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - /** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); - } +/***/ }), - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; +/***/ 2714: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /*------------------------------------------------------------------------*/ +"use strict"; - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } +const path = __nccwpck_require__(1017); +const resolveFrom = __nccwpck_require__(2053); +const parentModule = __nccwpck_require__(9069); - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; - } +module.exports = moduleId => { + if (typeof moduleId !== 'string') { + throw new TypeError('Expected a string'); + } - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); + const parentPath = parentModule(__filename); - this.size = data.size; - return result; - } + const cwd = parentPath ? path.dirname(parentPath) : __dirname; + const filePath = resolveFrom(cwd, moduleId); - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } + const oldModule = require.cache[filePath]; + // Delete itself from module parent + if (oldModule && oldModule.parent) { + let i = oldModule.parent.children.length; - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } + while (i--) { + if (oldModule.parent.children[i].id === filePath) { + oldModule.parent.children.splice(i, 1); + } + } + } - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; - } + delete require.cache[filePath]; // Delete module from cache - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; + const parent = require.cache[parentPath]; // If `filePath` and `parentPath` are the same, cache will already be deleted so we won't get a memory leak in next step - /*------------------------------------------------------------------------*/ + return parent === undefined ? require(filePath) : parent.require(filePath); // In case cache doesn't have parent, fall back to normal require +}; - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; - } +/***/ }), - /** - * A specialized version of `_.sample` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @returns {*} Returns the random element. - */ - function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; - } +/***/ 2053: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * A specialized version of `_.sampleSize` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); - } +"use strict"; - /** - * A specialized version of `_.shuffle` for arrays. - * - * @private - * @param {Array} array The array to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); - } +const path = __nccwpck_require__(1017); +const Module = __nccwpck_require__(8188); +const fs = __nccwpck_require__(7147); - /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } +const resolveFrom = (fromDir, moduleId, silent) => { + if (typeof fromDir !== 'string') { + throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``); + } - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } + if (typeof moduleId !== 'string') { + throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); + } + + try { + fromDir = fs.realpathSync(fromDir); + } catch (err) { + if (err.code === 'ENOENT') { + fromDir = path.resolve(fromDir); + } else if (silent) { + return null; + } else { + throw err; + } + } + + const fromFile = path.join(fromDir, 'noop.js'); + + const resolveFileName = () => Module._resolveFilename(moduleId, { + id: fromFile, + filename: fromFile, + paths: Module._nodeModulePaths(fromDir) + }); + + if (silent) { + try { + return resolveFileName(); + } catch (err) { + return null; + } + } + + return resolveFileName(); +}; + +module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId); +module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true); + + +/***/ }), + +/***/ 7604: +/***/ ((module) => { + +"use strict"; + + +module.exports = function isArrayish(obj) { + if (!obj) { + return false; + } + + return obj instanceof Array || Array.isArray(obj) || + (obj.length >= 0 && obj.splice instanceof Function); +}; + + +/***/ }), + +/***/ 7126: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(7147) +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = __nccwpck_require__(2001) +} else { + core = __nccwpck_require__(9728) +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') } - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) } + }) + }) + } + + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false } - return -1; } + cb(er, is) + }) +} - /** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er } + } +} - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } - /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } +/***/ }), - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } - } +/***/ 9728: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths to pick. - * @returns {Array} Returns the picked elements. - */ - function baseAt(object, paths) { - var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; +module.exports = isexe +isexe.sync = sync - while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); - } - return result; - } - - /** - * The base implementation of `_.clamp` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; - } +var fs = __nccwpck_require__(7147) - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, options)) + }) +} - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; +function sync (path, options) { + return checkStat(fs.statSync(path), options) +} - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); +function checkStat (stat, options) { + return stat.isFile() && checkMode(stat, options) +} - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g - /** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. - */ - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; - } + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 - /** - * The base implementation of `_.conformsTo` which accepts `props` to check. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - */ - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; + return ret +} - if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; - } - } - return true; - } - /** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } +/***/ }), - /** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; +/***/ 2001: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); +module.exports = isexe +isexe.sync = sync - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } +var fs = __nccwpck_require__(7147) - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT - /** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); + if (!pathext) { + return true + } - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true } + } + return false +} - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} - while (++index < length) { - var value = array[index], - current = iteratee(value); +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} - if (current != null && (computed === undefined - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) +} - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; - } +/***/ }), - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } +/***/ 1531: +/***/ ((__unused_webpack_module, exports) => { - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell +// License: MIT. (See LICENSE.) - predicate || (predicate = isFlattenable); - result || (result = []); +Object.defineProperty(exports, "__esModule", ({ + value: true +})) - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports["default"] = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g - /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0], closed: undefined} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token +} - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } +/***/ }), - /** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); - } +/***/ 9062: +/***/ ((module) => { - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. - */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } +"use strict"; - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = castPath(path, object); - var index = 0, - length = path.length; +const hexify = char => { + const h = char.charCodeAt(0).toString(16).toUpperCase() + return '0x' + (h.length % 2 ? '0' : '') + h +} - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; +const parseError = (e, txt, context) => { + if (!txt) { + return { + message: e.message + ' while parsing empty string', + position: 0, } + } + const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i) + const errIdx = badToken ? +badToken[2] + : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 + : null - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); - } + const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${ + JSON.stringify(badToken[1]) + } (${hexify(badToken[1])})`) + : e.message - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); - } + if (errIdx !== null && errIdx !== undefined) { + const start = errIdx <= context ? 0 + : errIdx - context - /** - * The base implementation of `_.gt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - */ - function baseGt(value, other) { - return value > other; - } + const end = errIdx + context >= txt.length ? txt.length + : errIdx + context - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); - } + const slice = (start === 0 ? '' : '...') + + txt.slice(start, end) + + (end === txt.length ? '' : '...') - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } + const near = txt === slice ? '' : 'near ' - /** - * The base implementation of `_.inRange` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); + return { + message: msg + ` while parsing ${near}${JSON.stringify(slice)}`, + position: errIdx, } + } else { + return { + message: msg + ` while parsing '${txt.slice(0, context * 2)}'`, + position: 0, + } + } +} - /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ - function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - seen = caches[0]; +class JSONParseError extends SyntaxError { + constructor (er, txt, context, caller) { + context = context || 20 + const metadata = parseError(er, txt, context) + super(metadata.message) + Object.assign(this, metadata) + this.code = 'EJSONPARSE' + this.systemError = er + Error.captureStackTrace(this, caller || this.constructor) + } + get name () { return this.constructor.name } + set name (n) {} + get [Symbol.toStringTag] () { return this.constructor.name } +} - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; +const kIndent = Symbol.for('indent') +const kNewline = Symbol.for('newline') +// only respect indentation if we got a line break, otherwise squash it +// things other than objects and arrays aren't indented, so ignore those +// Important: in both of these regexps, the $1 capture group is the newline +// or undefined, and the $2 capture group is the indent, or undefined. +const formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/ +const emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/ - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } +const parseJson = (txt, reviver, context) => { + const parseText = stripBOM(txt) + context = context || 20 + try { + // get the indentation so that we can save it back nicely + // if the file starts with {" then we have an indent of '', ie, none + // otherwise, pick the indentation of the next line after the first \n + // If the pattern doesn't match, then it means no indentation. + // JSON.stringify ignores symbols, so this is reasonably safe. + // if the string is '{}' or '[]', then use the default 2-space indent. + const [, newline = '\n', indent = ' '] = parseText.match(emptyRE) || + parseText.match(formatRE) || + [, '', ''] - /** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ - function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; + const result = JSON.parse(parseText, reviver) + if (result && typeof result === 'object') { + result[kNewline] = newline + result[kIndent] = indent } - - /** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); + return result + } catch (e) { + if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) { + const isEmptyArray = Array.isArray(txt) && txt.length === 0 + throw Object.assign(new TypeError( + `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}` + ), { + code: 'EJSONPARSE', + systemError: e, + }) } - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } + throw new JSONParseError(e, parseText, context, parseJson) + } +} - /** - * The base implementation of `_.isArrayBuffer` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - */ - function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; - } +// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) +// because the buffer-to-string conversion in `fs.readFileSync()` +// translates it to FEFF, the UTF-16 BOM. +const stripBOM = txt => String(txt).replace(/^\uFEFF/, '') - /** - * The base implementation of `_.isDate` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - */ - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; - } +module.exports = parseJson +parseJson.JSONParseError = JSONParseError - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } +parseJson.noExceptions = (txt, reviver) => { + try { + return JSON.parse(stripBOM(txt), reviver) + } catch (e) {} +} - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; +/***/ }), - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; +/***/ 4847: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); +"use strict"; - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; +const ansiStyles = __nccwpck_require__(2068); +const {stdout: stdoutColor, stderr: stderrColor} = __nccwpck_require__(9318); +const { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex +} = __nccwpck_require__(4930); - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); - } +const {isArray} = Array; - /** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ - function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = [ + 'ansi', + 'ansi', + 'ansi256', + 'ansi16m' +]; - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; +const styles = Object.create(null); - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; +const applyOptions = (object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error('The `level` option should be an integer from 0 to 3'); + } - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; - } + // Detect level if not set manually + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === undefined ? colorLevel : options.level; +}; - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } +class ChalkClass { + constructor(options) { + // eslint-disable-next-line no-constructor-return + return chalkFactory(options); + } +} - /** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } +const chalkFactory = options => { + const chalk = {}; + applyOptions(chalk, options); - /** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ - function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } + chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } + chalk.template.constructor = () => { + throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); + }; - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } + chalk.template.Instance = ChalkClass; - /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; + return chalk.template; +}; - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } +function Chalk(options) { + return chalkFactory(options); +} - /** - * The base implementation of `_.lt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - */ - function baseLt(value, other) { - return value < other; - } +for (const [styleName, style] of Object.entries(ansiStyles)) { + styles[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); + Object.defineProperty(this, styleName, {value: builder}); + return builder; + } + }; +} - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; +styles.visible = { + get() { + const builder = createBuilder(this, this._styler, true); + Object.defineProperty(this, 'visible', {value: builder}); + return builder; + } +}; - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } +const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } +for (const model of usedModels) { + styles[model] = { + get() { + const {level} = this; + return function (...arguments_) { + const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; +} - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; - } +for (const model of usedModels) { + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const {level} = this; + return function (...arguments_) { + const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; +} - /** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; +const proto = Object.defineProperties(() => {}, { + ...styles, + level: { + enumerable: true, + get() { + return this._generator.level; + }, + set(level) { + this._generator.level = level; + } + } +}); - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); - } +const createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === undefined) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); + return { + open, + close, + openAll, + closeAll, + parent + }; +}; - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; +const createBuilder = (self, _styler, _isEmpty) => { + const builder = (...arguments_) => { + if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { + // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` + return applyStyle(builder, chalkTag(builder, ...arguments_)); + } - var isCommon = newValue === undefined; + // Single argument is hot path, implicit coercion is faster than anything + // eslint-disable-next-line no-implicit-coercion + return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); + }; - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); + // We alter the prototype because we must return a function, but there is + // no way to create a function with a different prototype + Object.setPrototypeOf(builder, proto); - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); - } + builder._generator = self; + builder._styler = _styler; + builder._isEmpty = _isEmpty; - /** - * The base implementation of `_.nth` which doesn't coerce arguments. - * - * @private - * @param {Array} array The array to query. - * @param {number} n The index of the element to return. - * @returns {*} Returns the nth element of `array`. - */ - function baseNth(array, n) { - var length = array.length; - if (!length) { - return; - } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; - } + return builder; +}; - /** - * The base implementation of `_.orderBy` without param guards. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee) { - if (isArray(iteratee)) { - return function(value) { - return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - } - } - return iteratee; - }); - } else { - iteratees = [identity]; - } +const applyStyle = (self, string) => { + if (self.level <= 0 || !string) { + return self._isEmpty ? '' : string; + } - var index = -1; - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + let styler = self._styler; - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); + if (styler === undefined) { + return string; + } - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } + const {openAll, closeAll} = styler; + if (string.indexOf('\u001B') !== -1) { + while (styler !== undefined) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + string = stringReplaceAll(string, styler.close, styler.open); - /** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); - } + styler = styler.parent; + } + } - /** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ - function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; + // We can move both next actions out of loop, because remaining actions in loop won't have + // any/visible effect on parts we add here. Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 + const lfIndex = string.indexOf('\n'); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); + return openAll + string + closeAll; +}; - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } - } - return result; - } +let template; +const chalkTag = (chalk, ...strings) => { + const [firstString] = strings; - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } + if (!isArray(firstString) || !isArray(firstString.raw)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return strings.join(' '); + } - /** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - */ - function basePullAll(array, values, iteratee, comparator) { - var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; + const arguments_ = strings.slice(1); + const parts = [firstString.raw[0]]; - if (array === values) { - values = copyArray(values); - } - if (iteratee) { - seen = arrayMap(array, baseUnary(iteratee)); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; + for (let i = 1; i < firstString.length; i++) { + parts.push( + String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), + String(firstString.raw[i]) + ); + } - while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; - } + if (template === undefined) { + template = __nccwpck_require__(782); + } - /** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; + return template(chalk, parts.join('')); +}; - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; - } +Object.defineProperties(Chalk.prototype, styles); - /** - * The base implementation of `_.random` without support for returning - * floating-point numbers. - * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. - */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } +const chalk = Chalk(); // eslint-disable-line new-cap +chalk.supportsColor = stdoutColor; +chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap +chalk.stderr.supportsColor = stderrColor; - /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); +module.exports = chalk; - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - /** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ - function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); +/***/ }), - return result; - } +/***/ 782: +/***/ ((module) => { - /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); - } +"use strict"; - /** - * The base implementation of `_.sample`. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - */ - function baseSample(collection) { - return arraySample(values(collection)); - } +const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; +const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; +const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; +const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; - /** - * The base implementation of `_.sampleSize` without param guards. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); - } +const ESCAPES = new Map([ + ['n', '\n'], + ['r', '\r'], + ['t', '\t'], + ['b', '\b'], + ['f', '\f'], + ['v', '\v'], + ['0', '\0'], + ['\\', '\\'], + ['e', '\u001B'], + ['a', '\u0007'] +]); - /** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = castPath(path, object); +function unescape(c) { + const u = c[0] === 'u'; + const bracket = c[1] === '{'; - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; + if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { + return String.fromCharCode(parseInt(c.slice(1), 16)); + } - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; + if (u && bracket) { + return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); + } - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return object; - } + return ESCAPES.get(c) || c; +} - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; - } +function parseArguments(name, arguments_) { + const results = []; + const chunks = arguments_.trim().split(/\s*,\s*/g); + let matches; - /** - * The base implementation of `setData` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; + for (const chunk of chunks) { + const number = Number(chunk); + if (!Number.isNaN(number)) { + results.push(number); + } else if ((matches = chunk.match(STRING_REGEX))) { + results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); + } + } - /** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); - }; + return results; +} - /** - * The base implementation of `_.shuffle`. - * - * @private - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function baseShuffle(collection) { - return shuffleSelf(values(collection)); - } +function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; + const results = []; + let matches; - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } + if (matches[2]) { + const args = parseArguments(name, matches[2]); + results.push([name].concat(args)); + } else { + results.push([name]); + } + } - /** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; + return results; +} - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } +function buildStyle(chalk, styles) { + const enabled = {}; - /** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array == null ? low : array.length; + for (const layer of styles) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } + } - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; + let current = chalk; + for (const [styleName, styles] of Object.entries(enabled)) { + if (!Array.isArray(styles)) { + continue; + } - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); - } + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } - /** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndexBy(array, value, iteratee, retHighest) { - var low = 0, - high = array == null ? 0 : array.length; - if (high === 0) { - return 0; - } + current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; + } - value = iteratee(value); - var valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined; + return current; +} - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); +module.exports = (chalk, temporary) => { + const styles = []; + const chunks = []; + let chunk = []; - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } + // eslint-disable-next-line max-params + temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { + if (escapeCharacter) { + chunk.push(unescape(escapeCharacter)); + } else if (style) { + const string = chunk.join(''); + chunk = []; + chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); + styles.push({inverse, styles: parseStyle(style)}); + } else if (close) { + if (styles.length === 0) { + throw new Error('Found extraneous } in Chalk template literal'); + } - /** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseSortedUniq(array, iteratee) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; + chunks.push(buildStyle(chalk, styles)(chunk.join(''))); + chunk = []; + styles.pop(); + } else { + chunk.push(character); + } + }); - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; + chunks.push(chunk.join('')); - if (!index || !eq(computed, seen)) { - var seen = computed; - result[resIndex++] = value === 0 ? 0 : value; - } - } - return result; - } + if (styles.length > 0) { + const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; + throw new Error(errMessage); + } - /** - * The base implementation of `_.toNumber` which doesn't ensure correct - * conversions of binary, hexadecimal, or octal string values. - * - * @private - * @param {*} value The value to process. - * @returns {number} Returns the number. - */ - function baseToNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - return +value; - } + return chunks.join(''); +}; - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; +/***/ }), - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; +/***/ 4930: +/***/ ((module) => { - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } +"use strict"; - /** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; - } - /** - * The base implementation of `_.update`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to update. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); - } +const stringReplaceAll = (string, substring, replacer) => { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } - /** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ''; + do { + returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} + returnValue += string.substr(endIndex); + return returnValue; +}; - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } +const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { + let endIndex = 0; + let returnValue = ''; + do { + const gotCR = string[index - 1] === '\r'; + returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; + endIndex = index + 1; + index = string.indexOf('\n', endIndex); + } while (index !== -1); - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); - } + returnValue += string.substr(endIndex); + return returnValue; +}; - /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - */ - function baseXor(arrays, iteratee, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; - } - var index = -1, - result = Array(length); +module.exports = { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex +}; - while (++index < length) { - var array = arrays[index], - othIndex = -1; - while (++othIndex < length) { - if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); - } - } - } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); - } +/***/ }), - /** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. - * - * @private - * @param {Array} props The property identifiers. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. - */ - function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; +/***/ 9716: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - while (++index < length) { - var value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); - } - return result; - } +"use strict"; - /** - * Casts `value` to an empty array if it's not an array like object. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. - */ - function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; - } - /** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. - */ - function castFunction(value) { - return typeof value == 'function' ? value : identity; - } +const cp = __nccwpck_require__(2081); +const parse = __nccwpck_require__(5162); +const enoent = __nccwpck_require__(4619); - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); - } +function spawn(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); - /** - * A `baseRest` alias which can be replaced with `identity` by module - * replacement plugins. - * - * @private - * @type {Function} - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - var castRest = baseRest; + // Spawn the child process + const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); - /** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ - function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); - } + // Hook into child process "exit" event to emit an error if the command + // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + enoent.hookChildProcess(spawned, parsed); - /** - * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). - * - * @private - * @param {number|Object} id The timer id or timeout object of the timer to clear. - */ - var clearTimeout = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; + return spawned; +} - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); +function spawnSync(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); - buffer.copy(result); - return result; - } + // Spawn the child process + const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } + // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); - /** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } + return result; +} - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } +module.exports._parse = parse; +module.exports._enoent = enoent; - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); +/***/ }), - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); +/***/ 4619: +/***/ ((module) => { - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; +"use strict"; + + +const isWin = process.platform === 'win32'; + +function notFoundError(original, syscall) { + return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { + code: 'ENOENT', + errno: 'ENOENT', + syscall: `${syscall} ${original.command}`, + path: original.command, + spawnargs: original.args, + }); +} + +function hookChildProcess(cp, parsed) { + if (!isWin) { + return; } - /** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; + const originalEmit = cp.emit; - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); + cp.emit = function (name, arg1) { + // If emitting "exit" event and exit code is 1, we need to check if + // the command exists and emit an "error" instead + // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 + if (name === 'exit') { + const err = verifyENOENT(arg1, parsed, 'spawn'); + + if (err) { + return originalEmit.call(cp, 'error', err); + } } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; + + return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params + }; +} + +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); } - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; + return null; +} - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); } - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; + return null; +} - while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - } - return result; - } +module.exports = { + hookChildProcess, + verifyENOENT, + verifyENOENTSync, + notFoundError, +}; - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } +/***/ }), - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); +/***/ 5162: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var index = -1, - length = props.length; +"use strict"; - while (++index < length) { - var key = props[index]; - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; +const path = __nccwpck_require__(1017); +const resolveCommand = __nccwpck_require__(5205); +const escape = __nccwpck_require__(9676); +const readShebang = __nccwpck_require__(7322); - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } +const isWin = process.platform === 'win32'; +const isExecutableRegExp = /\.(?:com|exe)$/i; +const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; - /** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } +function detectShebang(parsed) { + parsed.file = resolveCommand(parsed); - /** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); + const shebang = parsed.file && readShebang(parsed.file); + + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; + + return resolveCommand(parsed); } - /** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; + return parsed.file; +} - return func(collection, setter, getIteratee(iteratee, 2), accumulator); - }; +function parseNonShell(parsed) { + if (!isWin) { + return parsed; } - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; + // Detect & add support for shebangs + const commandFile = detectShebang(parsed); - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; + // We don't need a shell if the command filename is an executable + const needsShell = !isExecutableRegExp.test(commandFile); - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } + // If a shell is required, use cmd.exe and take care of escaping everything correctly + // Note that `forceShell` is an hidden option used only in tests + if (parsed.options.forceShell || needsShell) { + // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` + // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument + // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, + // we need to double escape them + const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); + // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) + // This is necessary otherwise it will always fail with ENOENT in those cases + parsed.command = path.normalize(parsed.command); - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } + // Escape command & arguments + parsed.command = escape.command(parsed.command); + parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); - /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; + const shellCommand = [parsed.command].concat(parsed.args).join(' '); - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; + parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; + parsed.command = process.env.comspec || 'cmd.exe'; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped } - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); + return parsed; +} - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; +function parse(command, args, options) { + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; } - /** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = Object.assign({}, options); // Clone object to avoid changing the original - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; + // Build our parsed object + const parsed = { + command, + args, + options, + file: undefined, + original: { + command, + args, + }, + }; - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); + // Delegate further parsing to shell or non-shell + return options.shell ? parsed : parseNonShell(parsed); +} - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); +module.exports = parse; - return chr[methodName]() + trailing; - }; - } - /** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; - } +/***/ }), - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); +/***/ 9676: +/***/ ((module) => { - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } +"use strict"; - /** - * Creates a function that wraps `func` to enable currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); +// See http://www.robvanderwoude.com/escapechars.php +const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); +function escapeCommand(arg) { + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); - length -= holders.length; - if (length < arity) { - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, undefined, - args, holders, undefined, undefined, arity - length); - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return apply(fn, this, args); - } - return wrapper; - } + return arg; +} - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. - */ - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = getIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; - } +function escapeArgument(arg, doubleEscapeMetaChars) { + // Convert to string + arg = `${arg}`; - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; + // Algorithm below is based on https://qntm.org/cmd - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; + // Sequence of backslashes followed by a double quote: + // double up all the backslashes and escape the double quote + arg = arg.replace(/(\\*)"/g, '$1$1\\"'); - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; + // Sequence of backslashes followed by the end of the string + // (which will become a double quote later): + // double up all the backslashes + arg = arg.replace(/(\\*)$/, '$1$1'); - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; + // All other backslashes occur literally - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; + // Quote the whole thing: + arg = `"${arg}"`; - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); + + // Double escape meta chars if necessary + if (doubleEscapeMetaChars) { + arg = arg.replace(metaCharsRegExp, '^$1'); } - /** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided - * to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, - isBind = bitmask & WRAP_BIND_FLAG, - isBindKey = bitmask & WRAP_BIND_KEY_FLAG, - isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), - isFlip = bitmask & WRAP_FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtor(func); + return arg; +} - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length; +module.exports.command = escapeCommand; +module.exports.argument = escapeArgument; - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, thisArg, - args, newHolders, argPos, ary, arity - length - ); - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } +/***/ }), - /** - * Creates a function like `_.invertBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. - */ - function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; - } +/***/ 7322: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Creates a function that performs a mathematical operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @param {number} [defaultValue] The value used for `undefined` arguments. - * @returns {Function} Returns the new mathematical operation function. - */ - function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result; - if (value === undefined && other === undefined) { - return defaultValue; - } - if (value !== undefined) { - result = value; - } - if (other !== undefined) { - if (result === undefined) { - return other; - } - if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result = operator(value, other); - } - return result; - }; - } +"use strict"; - /** - * Creates a function like `_.over`. - * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new over function. - */ - function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); - } - /** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ - function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); +const fs = __nccwpck_require__(7147); +const shebangCommand = __nccwpck_require__(8668); - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); - } +function readShebang(command) { + // Read the first 150 bytes from the file + const size = 150; + const buffer = Buffer.alloc(size); - /** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. - */ - function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); + let fd; - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, size, 0); + fs.closeSync(fd); + } catch (e) { /* Empty */ } - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; - } + // Attempt to extract shebang (null is returned if not a shebang) + return shebangCommand(buffer.toString()); +} - /** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; - } +module.exports = readShebang; - /** - * Creates a function that performs a relational operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @returns {Function} Returns the new relational operation function. - */ - function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; - } - /** - * Creates a function that wraps `func` to continue currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder value. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; +/***/ }), - bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); +/***/ 5205: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); - } - var newData = [ - func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, - newHoldersRight, argPos, ary, arity - ]; +"use strict"; - var result = wrapFunc.apply(undefined, newData); - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return setWrapToString(result, func, bitmask); - } - /** - * Creates a function like `_.round`. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision && nativeIsFinite(number)) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); +const path = __nccwpck_require__(1017); +const which = __nccwpck_require__(6054); +const getPathKey = __nccwpck_require__(5235); - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); +function resolveCommandAttempt(parsed, withoutPathExt) { + const env = parsed.options.env || process.env; + const cwd = process.cwd(); + const hasCustomCwd = parsed.options.cwd != null; + // Worker threads do not have process.chdir() + const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; + + // If a custom `cwd` was specified, we need to change the process cwd + // because `which` will do stat calls but does not support a custom cwd + if (shouldSwitchCwd) { + try { + process.chdir(parsed.options.cwd); + } catch (err) { + /* Empty */ } - return func(number); - }; } - /** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); - }; + let resolved; - /** - * Creates a `_.toPairs` or `_.toPairsIn` function. - * - * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. - */ - function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); + try { + resolved = which.sync(parsed.command, { + path: env[getPathKey({ env })], + pathExt: withoutPathExt ? path.delimiter : undefined, + }); + } catch (e) { + /* Empty */ + } finally { + if (shouldSwitchCwd) { + process.chdir(cwd); } - return baseToPairs(object, keysFunc(object)); - }; } - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * 512 - `_.flip` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; + // If we successfully resolved, ensure that an absolute path is returned + // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it + if (resolved) { + resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); + } - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; + return resolved; +} - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func); +function resolveCommand(parsed) { + return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); +} - var newData = [ - func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, - argPos, ary, arity - ]; +module.exports = resolveCommand; - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result = createPartial(func, bitmask, thisArg, partials); - } else { - result = createHybrid.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setWrapToString(setter(result, newData), func, bitmask); - } +/***/ }), - /** - * Used by `_.defaults` to customize its `_.assignIn` use to assign properties - * of source objects to the destination object for all destination properties - * that resolve to `undefined`. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ - function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; - } +/***/ 8597: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source - * objects into destination objects that are passed thru. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - * @returns {*} Returns the value to assign. - */ - function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); - } - return objValue; - } +"use strict"; - /** - * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain - * objects. - * - * @private - * @param {*} value The value to inspect. - * @param {string} key The key of the property to inspect. - * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. - */ - function customOmitClone(value) { - return isPlainObject(value) ? undefined : value; - } +const path = __nccwpck_require__(1017); +const childProcess = __nccwpck_require__(2081); +const crossSpawn = __nccwpck_require__(9716); +const stripFinalNewline = __nccwpck_require__(8174); +const npmRunPath = __nccwpck_require__(2888); +const onetime = __nccwpck_require__(9082); +const makeError = __nccwpck_require__(7874); +const normalizeStdio = __nccwpck_require__(4918); +const {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} = __nccwpck_require__(1452); +const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __nccwpck_require__(8339); +const {mergePromise, getSpawnedPromise} = __nccwpck_require__(5031); +const {joinCommand, parseCommand, getEscapedCommand} = __nccwpck_require__(226); - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; +const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Check that cyclic values are equal. - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; +const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { + const env = extendEnv ? {...process.env, ...envOption} : envOption; - stack.set(array, other); - stack.set(other, array); + if (preferLocal) { + return npmRunPath.env({env, cwd: localDir, execPath}); + } - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; + return env; +}; - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } +const handleArguments = (file, args, options = {}) => { + const parsed = crossSpawn._parse(file, args, options); + file = parsed.command; + args = parsed.args; + options = parsed.options; - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; + options = { + maxBuffer: DEFAULT_MAX_BUFFER, + buffer: true, + stripFinalNewline: true, + extendEnv: true, + preferLocal: false, + localDir: options.cwd || process.cwd(), + execPath: process.execPath, + encoding: 'utf8', + reject: true, + cleanup: true, + all: false, + windowsHide: true, + ...options + }; - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; + options.env = getEnv(options); - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); + options.stdio = normalizeStdio(options); - case errorTag: - return object.name == other.name && object.message == other.message; + if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { + // #116 + args.unshift('/q'); + } - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); + return {file, args, options, parsed}; +}; - case mapTag: - var convert = mapToArray; +const handleOutput = (options, value, error) => { + if (typeof value !== 'string' && !Buffer.isBuffer(value)) { + // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` + return error === undefined ? undefined : ''; + } - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); + if (options.stripFinalNewline) { + return stripFinalNewline(value); + } - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; + return value; +}; - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; +const execa = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); + const escapedCommand = getEscapedCommand(file, args); - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } + validateTimeout(parsed.options); - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; + let spawned; + try { + spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); + } catch (error) { + // Ensure the returned error is always both a promise and a child process + const dummySpawned = new childProcess.ChildProcess(); + const errorPromise = Promise.reject(makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + escapedCommand, + parsed, + timedOut: false, + isCanceled: false, + killed: false + })); + return mergePromise(dummySpawned, errorPromise); + } - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Check that cyclic values are equal. - var objStacked = stack.get(object); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object; - } - var result = true; - stack.set(object, other); - stack.set(other, object); + const spawnedPromise = getSpawnedPromise(spawned); + const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); + const processDone = setExitHandler(spawned, parsed.options, timedPromise); - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; + const context = {isCanceled: false}; - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; + spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); + spawned.cancel = spawnedCancel.bind(null, spawned, context); - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; - } + const handlePromise = async () => { + const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); + const stdout = handleOutput(parsed.options, stdoutResult); + const stderr = handleOutput(parsed.options, stderrResult); + const all = handleOutput(parsed.options, allResult); - /** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); - } + if (error || exitCode !== 0 || signal !== null) { + const returnedError = makeError({ + error, + exitCode, + signal, + stdout, + stderr, + all, + command, + escapedCommand, + parsed, + timedOut, + isCanceled: context.isCanceled, + killed: spawned.killed + }); - /** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); - } + if (!parsed.options.reject) { + return returnedError; + } - /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); - } + throw returnedError; + } - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; + return { + command, + escapedCommand, + exitCode: 0, + stdout, + stderr, + all, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; + }; - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; + const handlePromiseOnce = onetime(handlePromise); - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } + handleInput(spawned, parsed.options.input); - /** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ - function getHolder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } + spawned.all = makeAllStream(spawned, parsed.options); - /** - * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, - * this function returns the custom method, otherwise it returns `baseIteratee`. - * If arguments are provided, the chosen function is invoked with them and - * its result is returned. - * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. - */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; - } + return mergePromise(spawned, handlePromiseOnce); +}; - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } +module.exports = execa; - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = keys(object), - length = result.length; +module.exports.sync = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); + const escapedCommand = getEscapedCommand(file, args); - while (length--) { - var key = result[length], - value = object[key]; + validateInputSync(parsed.options); - result[length] = [key, value, isStrictComparable(value)]; - } - return result; - } + let result; + try { + result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); + } catch (error) { + throw makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + escapedCommand, + parsed, + timedOut: false, + isCanceled: false, + killed: false + }); + } - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } + const stdout = handleOutput(parsed.options, result.stdout, result.error); + const stderr = handleOutput(parsed.options, result.stderr, result.error); - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; + if (result.error || result.status !== 0 || result.signal !== null) { + const error = makeError({ + stdout, + stderr, + error: result.error, + signal: result.signal, + exitCode: result.status, + command, + escapedCommand, + parsed, + timedOut: result.error && result.error.code === 'ETIMEDOUT', + isCanceled: false, + killed: result.signal !== null + }); - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} + if (!parsed.options.reject) { + return error; + } - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } + throw error; + } - /** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); - }; + return { + command, + escapedCommand, + exitCode: 0, + stdout, + stderr, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; +}; - /** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; - }; +module.exports.command = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa(file, args, options); +}; - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; +module.exports.commandSync = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa.sync(file, args, options); +}; - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; +module.exports.node = (scriptPath, args, options = {}) => { + if (args && !Array.isArray(args) && typeof args === 'object') { + options = args; + args = []; + } - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } + const stdio = normalizeStdio.node(options); + const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect')); - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms.length; + const { + nodePath = process.execPath, + nodeOptions = defaultExecArgv + } = options; - while (++index < length) { - var data = transforms[index], - size = data.size; + return execa( + nodePath, + [ + ...nodeOptions, + scriptPath, + ...(Array.isArray(args) ? args : []) + ], + { + ...options, + stdin: undefined, + stdout: undefined, + stderr: undefined, + stdio, + shell: false + } + ); +}; - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - /** - * Extracts wrapper details from the `source` body comment. - * - * @private - * @param {string} source The source to inspect. - * @returns {Array} Returns the wrapper details. - */ - function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; - } +/***/ }), - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - path = castPath(path, object); +/***/ 226: +/***/ ((module) => { - var index = -1, - length = path.length, - result = false; +"use strict"; - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); - } +const normalizeArgs = (file, args = []) => { + if (!Array.isArray(args)) { + return [file]; + } - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); + return [file, ...args]; +}; - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } +const NO_ESCAPE_REGEXP = /^[\w.-]+$/; +const DOUBLE_QUOTES_REGEXP = /"/g; - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } +const escapeArg = arg => { + if (typeof arg !== 'string' || NO_ESCAPE_REGEXP.test(arg)) { + return arg; + } - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); + return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`; +}; - case boolTag: - case dateTag: - return new Ctor(+object); +const joinCommand = (file, args) => { + return normalizeArgs(file, args).join(' '); +}; - case dataViewTag: - return cloneDataView(object, isDeep); +const getEscapedCommand = (file, args) => { + return normalizeArgs(file, args).map(arg => escapeArg(arg)).join(' '); +}; - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); +const SPACES_REGEXP = / +/g; - case mapTag: - return new Ctor; +// Handle `execa.command()` +const parseCommand = command => { + const tokens = []; + for (const token of command.trim().split(SPACES_REGEXP)) { + // Allow spaces to be escaped by a backslash if not meant as a delimiter + const previousToken = tokens[tokens.length - 1]; + if (previousToken && previousToken.endsWith('\\')) { + // Merge previous token with current one + tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; + } else { + tokens.push(token); + } + } - case numberTag: - case stringTag: - return new Ctor(object); + return tokens; +}; - case regexpTag: - return cloneRegExp(object); +module.exports = { + joinCommand, + getEscapedCommand, + parseCommand +}; - case setTag: - return new Ctor; - case symbolTag: - return cloneSymbol(object); - } - } +/***/ }), - /** - * Inserts wrapper `details` in a comment at the top of the `source` body. - * - * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. - */ - function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); - } +/***/ 7874: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); - } +"use strict"; - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; +const {signalsByName} = __nccwpck_require__(7873); - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } +const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { + if (timedOut) { + return `timed out after ${timeout} milliseconds`; + } - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } + if (isCanceled) { + return 'was canceled'; + } - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } + if (errorCode !== undefined) { + return `failed with ${errorCode}`; + } - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } + if (signal !== undefined) { + return `was killed with ${signal} (${signalDescription})`; + } - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; + if (exitCode !== undefined) { + return `failed with exit code ${exitCode}`; + } - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } + return 'failed'; +}; - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } +const makeError = ({ + stdout, + stderr, + all, + error, + signal, + exitCode, + command, + escapedCommand, + timedOut, + isCanceled, + killed, + parsed: {options: {timeout}} +}) => { + // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. + // We normalize them to `undefined` + exitCode = exitCode === null ? undefined : exitCode; + signal = signal === null ? undefined : signal; + const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; - /** - * Checks if `func` is capable of being masked. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `func` is maskable, else `false`. - */ - var isMaskable = coreJsData ? isFunction : stubFalse; + const errorCode = error && error.code; - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); + const execaMessage = `Command ${prefix}: ${command}`; + const isError = Object.prototype.toString.call(error) === '[object Error]'; + const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; + const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); - return value === proto; - } + if (isError) { + error.originalMessage = error.message; + error.message = message; + } else { + error = new Error(message); + } - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } + error.shortMessage = shortMessage; + error.command = command; + error.escapedCommand = escapedCommand; + error.exitCode = exitCode; + error.signal = signal; + error.signalDescription = signalDescription; + error.stdout = stdout; + error.stderr = stderr; - /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; - } + if (all !== undefined) { + error.all = all; + } - /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); + if ('bufferedData' in error) { + delete error.bufferedData; + } - var cache = result.cache; - return result; - } + error.failed = true; + error.timedOut = Boolean(timedOut); + error.isCanceled = isCanceled; + error.killed = killed && !timedOut; - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and - * `_.rearg` modify function arguments, making the order in which they are - * executed important, preventing the merging of metadata. However, we make - * an exception for a safe combined case where curried functions have `_.ary` - * and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + return error; +}; - var isCombo = - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); +module.exports = makeError; - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = value; - } - // Use source `ary` if it's smaller. - if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - return data; - } +/***/ }), - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } +/***/ 1452: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } +"use strict"; - /** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); +const os = __nccwpck_require__(2037); +const onExit = __nccwpck_require__(4931); - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; - } +const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; - /** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ - function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); - } +// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior +const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { + const killResult = kill(signal); + setKillTimeout(kill, signal, options, killResult); + return killResult; +}; - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); +const setKillTimeout = (kill, signal, options, killResult) => { + if (!shouldForceKill(signal, options, killResult)) { + return; + } - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } + const timeout = getForceKillAfterTimeout(options); + const t = setTimeout(() => { + kill('SIGKILL'); + }, timeout); - /** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { - return; - } + // Guarded because there's no `.unref()` when `execa` is used in the renderer + // process in Electron. This cannot be tested since we don't run tests in + // Electron. + // istanbul ignore else + if (t.unref) { + t.unref(); + } +}; - if (key == '__proto__') { - return; - } +const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { + return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; +}; - return object[key]; - } +const isSigterm = signal => { + return signal === os.constants.signals.SIGTERM || + (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); +}; - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity - * function to avoid garbage collection pauses in V8. See - * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = shortOut(baseSetData); +const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { + if (forceKillAfterTimeout === true) { + return DEFAULT_FORCE_KILL_TIMEOUT; + } - /** - * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @returns {number|Object} Returns the timer id or timeout object. - */ - var setTimeout = ctxSetTimeout || function(func, wait) { - return root.setTimeout(func, wait); - }; + if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { + throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); + } - /** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var setToString = shortOut(baseSetToString); + return forceKillAfterTimeout; +}; - /** - * Sets the `toString` method of `wrapper` to mimic the source of `reference` - * with wrapper details in a comment at the top of the source body. - * - * @private - * @param {Function} wrapper The function to modify. - * @param {Function} reference The reference function. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Function} Returns `wrapper`. - */ - function setWrapToString(wrapper, reference, bitmask) { - var source = (reference + ''); - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); - } +// `childProcess.cancel()` +const spawnedCancel = (spawned, context) => { + const killResult = spawned.kill(); - /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ - function shortOut(func) { - var count = 0, - lastCalled = 0; + if (killResult) { + context.isCanceled = true; + } +}; - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); +const timeoutKill = (spawned, signal, reject) => { + spawned.kill(signal); + reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); +}; - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; - } +// `timeout` option handling +const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { + if (timeout === 0 || timeout === undefined) { + return spawnedPromise; + } - /** - * A specialized version of `_.shuffle` which mutates and sets the size of `array`. - * - * @private - * @param {Array} array The array to shuffle. - * @param {number} [size=array.length] The size of `array`. - * @returns {Array} Returns `array`. - */ - function shuffleSelf(array, size) { - var index = -1, - length = array.length, - lastIndex = length - 1; + let timeoutId; + const timeoutPromise = new Promise((resolve, reject) => { + timeoutId = setTimeout(() => { + timeoutKill(spawned, killSignal, reject); + }, timeout); + }); - size = size === undefined ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; + const safeSpawnedPromise = spawnedPromise.finally(() => { + clearTimeout(timeoutId); + }); - array[rand] = array[index]; - array[index] = value; - } - array.length = size; - return array; - } + return Promise.race([timeoutPromise, safeSpawnedPromise]); +}; - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); +const validateTimeout = ({timeout}) => { + if (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) { + throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); + } +}; - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } +// `cleanup` option handling +const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { + if (!cleanup || detached) { + return timedPromise; + } - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } + const removeExitHandler = onExit(() => { + spawned.kill(); + }); - /** - * Updates wrapper `details` based on `bitmask` flags. - * - * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. - */ - function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); - } + return timedPromise.finally(() => { + removeExitHandler(); + }); +}; - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; - } +module.exports = { + spawnedKill, + spawnedCancel, + setupTimeout, + validateTimeout, + setExitHandler +}; - /*------------------------------------------------------------------------*/ - /** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array of chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); +/***/ }), - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; - } +/***/ 5031: +/***/ ((module) => { - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; +"use strict"; - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; - } - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; +const nativePromisePrototype = (async () => {})().constructor.prototype; +const descriptors = ['then', 'catch', 'finally'].map(property => [ + property, + Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) +]); - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); - } +// The return value is a mixin of `childProcess` and `Promise` +const mergePromise = (spawned, promise) => { + for (const [property, descriptor] of descriptors) { + // Starting the main `promise` is deferred to avoid consuming streams + const value = typeof promise === 'function' ? + (...args) => Reflect.apply(descriptor.value, promise(), args) : + descriptor.value.bind(promise); - /** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ - var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; - }); + Reflect.defineProperty(spawned, property, {...descriptor, value}); + } - /** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * **Note:** Unlike `_.pullAllBy`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) - : []; - }); + return spawned; +}; - /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The order and - * references of result values are determined by the first array. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.pullAllWith`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; - }); +// Use promises instead of `child_process` events +const getSpawnedPromise = spawned => { + return new Promise((resolve, reject) => { + spawned.on('exit', (exitCode, signal) => { + resolve({exitCode, signal}); + }); - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); - } + spawned.on('error', error => { + reject(error); + }); - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); - } + if (spawned.stdin) { + spawned.stdin.on('error', error => { + reject(error); + }); + } + }); +}; - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] - * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; - } +module.exports = { + mergePromise, + getSpawnedPromise +}; - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; - } - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] - */ - function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, getIteratee(predicate, 3), index); - } +/***/ }), - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); - } +/***/ 4918: +/***/ ((module) => { - /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] - */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } +"use strict"; - /** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; - } +const aliases = ['stdin', 'stdout', 'stderr']; - /** - * Recursively flatten `array` up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Array - * @param {Array} array The array to flatten. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * var array = [1, [2, [3, [4]], 5]]; - * - * _.flattenDepth(array, 1); - * // => [1, 2, [3, [4]], 5] - * - * _.flattenDepth(array, 2); - * // => [1, 2, 3, [4], 5] - */ - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); - } +const hasAlias = options => aliases.some(alias => options[alias] !== undefined); - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['a', 1], ['b', 2]]); - * // => { 'a': 1, 'b': 2 } - */ - function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } +const normalizeStdio = options => { + if (!options) { + return; + } - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ - function head(array) { - return (array && array.length) ? array[0] : undefined; - } + const {stdio} = options; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); - } + if (stdio === undefined) { + return aliases.map(alias => options[alias]); + } - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; - } + if (hasAlias(options)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); + } - /** - * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersection([2, 1], [2, 3]); - * // => [2] - */ - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; - }); + if (typeof stdio === 'string') { + return stdio; + } - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [2.1] - * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee, 2)) - : []; - }); + const length = Math.max(stdio.length, aliases.length); + return Array.from({length}, (value, index) => stdio[index]); +}; - /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The order and references - * of result values are determined by the first array. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); +module.exports = normalizeStdio; - comparator = typeof comparator == 'function' ? comparator : undefined; - if (comparator) { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; - }); +// `ipc` is pushed unless it is already present +module.exports.node = options => { + const stdio = normalizeStdio(options); - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example - * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ - function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); - } + if (stdio === 'ipc') { + return 'ipc'; + } - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; - } + if (stdio === undefined || typeof stdio === 'string') { + return [stdio, stdio, stdio, 'ipc']; + } - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); - } + if (stdio.includes('ipc')) { + return stdio; + } - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth - * element from the end is returned. - * - * @static - * @memberOf _ - * @since 4.11.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=0] The index of the element to return. - * @returns {*} Returns the nth element of `array`. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * - * _.nth(array, 1); - * // => 'b' - * - * _.nth(array, -2); - * // => 'c'; - */ - function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; - } + return [...stdio, 'ipc']; +}; - /** - * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` - * to remove elements from an array by predicate. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pull(array, 'a', 'c'); - * console.log(array); - * // => ['b', 'b'] - */ - var pull = baseRest(pullAll); - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pullAll(array, ['a', 'c']); - * console.log(array); - * // => ['b', 'b'] - */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; - } +/***/ }), - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee, 2)) - : array; - } +/***/ 8339: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which - * is invoked to compare elements of `array` to `values`. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - function pullAllWith(array, values, comparator) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, undefined, comparator) - : array; - } +"use strict"; - /** - * Removes elements from `array` corresponding to `indexes` and returns an - * array of removed elements. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * var pulled = _.pullAt(array, [1, 3]); - * - * console.log(array); - * // => ['a', 'c'] - * - * console.log(pulled); - * // => ['b', 'd'] - */ - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); +const isStream = __nccwpck_require__(5056); +const getStream = __nccwpck_require__(3734); +const mergeStream = __nccwpck_require__(5699); - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); +// `input` option +const handleInput = (spawned, input) => { + // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 + // @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 + if (input === undefined || spawned.stdin === undefined) { + return; + } - return result; - }); + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +}; - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked - * with three arguments: (value, index, array). - * - * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` - * to pull elements from an array by value. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; +// `all` interleaves `stdout` and `stderr` +const makeAllStream = (spawned, {all}) => { + if (!all || (!spawned.stdout && !spawned.stderr)) { + return; + } - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } + const mixed = mergeStream(); - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function reverse(array) { - return array == null ? array : nativeReverse.call(array); - } + if (spawned.stdout) { + mixed.add(spawned.stdout); + } - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of - * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are - * returned. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); - } - return baseSlice(array, start, end); - } + if (spawned.stderr) { + mixed.add(spawned.stderr); + } - /** - * Uses a binary search to determine the lowest index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } + return mixed; +}; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); - * // => 0 - */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); - } +// On failure, `result.stdout|stderr|all` should contain the currently buffered stream +const getBufferedData = async (stream, streamPromise) => { + if (!stream) { + return; + } - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([4, 5, 5, 5, 6], 5); - * // => 1 - */ - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } - } - return -1; - } + stream.destroy(); - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 5, 5, 5, 6], 5); - * // => 4 - */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); - } + try { + return await streamPromise; + } catch (error) { + return error.bufferedData; + } +}; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 1 - * - * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); - * // => 1 - */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); - } +const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { + if (!stream || !buffer) { + return; + } - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); - * // => 3 - */ - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; - } + if (encoding) { + return getStream(stream, {encoding, maxBuffer}); + } - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; - } + return getStream.buffer(stream, {maxBuffer}); +}; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.3] - */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee, 2)) - : []; - } +// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) +const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { + const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); + const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); + const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.tail([1, 2, 3]); - * // => [2, 3] - */ - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; - } + try { + return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); + } catch (error) { + return Promise.all([ + {error, signal: error.signal, timedOut: error.timedOut}, + getBufferedData(stdout, stdoutPromise), + getBufferedData(stderr, stderrPromise), + getBufferedData(all, allPromise) + ]); + } +}; - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); - } +const validateInputSync = ({input}) => { + if (isStream(input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } +}; - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); - } +module.exports = { + handleInput, + makeAllStream, + getSpawnedResult, + validateInputSync +}; - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.takeRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeRightWhile(users, ['active', false]); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.takeRightWhile(users, 'active'); - * // => [] - */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; - } - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.takeWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matches` iteratee shorthand. - * _.takeWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeWhile(users, ['active', false]); - * // => objects for ['barney', 'fred'] - * - * // The `_.property` iteratee shorthand. - * _.takeWhile(users, 'active'); - * // => [] - */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; - } - /** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([2], [1, 2]); - * // => [2, 1] - */ - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); +/***/ }), - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. Result values are chosen from the first - * array in which the value occurs. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.unionBy([2.1], [1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - var unionBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); - }); +/***/ 3786: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. Result values are chosen from - * the first array in which the value occurs. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); - }); +"use strict"; - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. The order of result values is determined by the order they occur - * in the array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - function uniq(array) { - return (array && array.length) ? baseUniq(array) : []; - } +const {PassThrough: PassThroughStream} = __nccwpck_require__(2781); - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The order of result values is determined by the - * order they occur in the array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniqBy(array, iteratee) { - return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; - } +module.exports = options => { + options = {...options}; - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The order of result values is - * determined by the order they occur in the array.The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - function uniqWith(array, comparator) { - comparator = typeof comparator == 'function' ? comparator : undefined; - return (array && array.length) ? baseUniq(array, undefined, comparator) : []; - } + const {array} = options; + let {encoding} = options; + const isBuffer = encoding === 'buffer'; + let objectMode = false; - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @since 1.2.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - * - * _.unzip(zipped); - * // => [['a', 'b'], [1, 2], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); - } + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || 'utf8'; + } - /** - * This method is like `_.unzip` except that it accepts `iteratee` to specify - * how regrouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine - * regrouped values. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - return arrayMap(result, function(group) { - return apply(iteratee, undefined, group); - }); - } + if (isBuffer) { + encoding = null; + } - /** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.pull`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.xor - * @example - * - * _.without([2, 1, 2, 3], 1, 2); - * // => [3] - */ - var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); + const stream = new PassThroughStream({objectMode}); - /** - * Creates an array of unique values that is the - * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. The order of result values is determined by the order - * they occur in the arrays. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.without - * @example - * - * _.xor([2, 1], [2, 3]); - * // => [1, 3] - */ - var xor = baseRest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); + if (encoding) { + stream.setEncoding(encoding); + } - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which by which they're compared. The order of result values is determined - * by the order they occur in the arrays. The iteratee is invoked with one - * argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2, 3.4] - * - * // The `_.property` iteratee shorthand. - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var xorBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); - }); + let length = 0; + const chunks = []; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The order of result values is - * determined by the order they occur in the arrays. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var xorWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); - }); + stream.on('data', chunk => { + chunks.push(chunk); - /** - * Creates an array of grouped elements, the first of which contains the - * first elements of the given arrays, the second of which contains the - * second elements of the given arrays, and so on. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - */ - var zip = baseRest(unzip); + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); - /** - * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property identifiers and one of corresponding values. - * - * @static - * @memberOf _ - * @since 0.4.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject(['a', 'b'], [1, 2]); - * // => { 'a': 1, 'b': 2 } - */ - function zipObject(props, values) { - return baseZipObject(props || [], values || [], assignValue); - } + stream.getBufferedValue = () => { + if (array) { + return chunks; + } - /** - * This method is like `_.zipObject` except that it supports property paths. - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); - * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } - */ - function zipObjectDeep(props, values) { - return baseZipObject(props || [], values || [], baseSet); - } + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); + }; - /** - * This method is like `_.zip` except that it accepts `iteratee` to specify - * how grouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee=_.identity] The function to combine - * grouped values. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { - * return a + b + c; - * }); - * // => [111, 222] - */ - var zipWith = baseRest(function(arrays) { - var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined; + stream.getBufferedLength = () => length; - iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; - return unzipWith(arrays, iteratee); - }); + return stream; +}; - /*------------------------------------------------------------------------*/ - /** - * Creates a `lodash` wrapper instance that wraps `value` with explicit method - * chain sequences enabled. The result of such sequences must be unwrapped - * with `_#value`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } +/***/ }), - /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain sequence in order to modify intermediate results. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } +/***/ 3734: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain sequence. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } +"use strict"; - /** - * This method is the wrapper version of `_.at`. - * - * @name at - * @memberOf _ - * @since 1.0.0 - * @category Seq - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _(object).at(['a[0].b.c', 'a[1]']).value(); - * // => [3, 4] - */ - var wrapperAt = flatRest(function(paths) { - var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; +const {constants: BufferConstants} = __nccwpck_require__(4300); +const stream = __nccwpck_require__(2781); +const {promisify} = __nccwpck_require__(3837); +const bufferStream = __nccwpck_require__(3786); - if (length > 1 || this.__actions__.length || - !(value instanceof LazyWrapper) || !isIndex(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ - 'func': thru, - 'args': [interceptor], - 'thisArg': undefined - }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined); - } - return array; - }); - }); +const streamPipelinePromisified = promisify(stream.pipeline); - /** - * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. - * - * @name chain - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } - * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} - /** - * Executes the chain sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } +async function getStream(inputStream, options) { + if (!inputStream) { + throw new Error('Expected a stream'); + } - /** - * Gets the next value on a wrapped object following the - * [iterator protocol](https://mdn.io/iteration_protocols#iterator). - * - * @name next - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the next iterator value. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped.next(); - * // => { 'done': false, 'value': 1 } - * - * wrapped.next(); - * // => { 'done': false, 'value': 2 } - * - * wrapped.next(); - * // => { 'done': true, 'value': undefined } - */ - function wrapperNext() { - if (this.__values__ === undefined) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, - value = done ? undefined : this.__values__[this.__index__++]; + options = { + maxBuffer: Infinity, + ...options + }; - return { 'done': done, 'value': value }; - } + const {maxBuffer} = options; + const stream = bufferStream(options); - /** - * Enables the wrapper to be iterable. - * - * @name Symbol.iterator - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the wrapper object. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped[Symbol.iterator]() === wrapped; - * // => true - * - * Array.from(wrapped); - * // => [1, 2] - */ - function wrapperToIterator() { - return this; - } + await new Promise((resolve, reject) => { + const rejectPromise = error => { + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error.bufferedData = stream.getBufferedValue(); + } - /** - * Creates a clone of the chain sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @param {*} value The value to plant. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2]).map(square); - * var other = wrapped.plant([3, 4]); - * - * other.value(); - * // => [9, 16] - * - * wrapped.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; + reject(error); + }; - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - clone.__index__ = 0; - clone.__values__ = undefined; - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } + (async () => { + try { + await streamPipelinePromisified(inputStream, stream); + resolve(); + } catch (error) { + rejectPromise(error); + } + })(); - /** - * This method is the wrapper version of `_.reverse`. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - 'func': thru, - 'args': [reverse], - 'thisArg': undefined - }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(reverse); - } + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); - /** - * Executes the chain sequence to resolve the unwrapped value. - * - * @name value - * @memberOf _ - * @since 0.1.0 - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } + return stream.getBufferedValue(); +} - /*------------------------------------------------------------------------*/ +module.exports = getStream; +module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); +module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); +module.exports.MaxBufferError = MaxBufferError; - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the number of times the key was returned by `iteratee`. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } - * - * // The `_.property` iteratee shorthand. - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); - } - }); - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } +/***/ }), - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - * - * // Combining several predicates using `_.overEvery` or `_.overSome`. - * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); - * // => objects for ['fred', 'barney'] - */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); - } +/***/ 5877: +/***/ ((__unused_webpack_module, exports) => { - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ - var find = createFind(findIndex); +"use strict"; +Object.defineProperty(exports, "__esModule", ({value:true}));exports.SIGNALS=void 0; - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - var findLast = createFind(findLastIndex); +const SIGNALS=[ +{ +name:"SIGHUP", +number:1, +action:"terminate", +description:"Terminal closed", +standard:"posix"}, - /** - * Creates a flattened array of values by running each element in `collection` - * thru `iteratee` and flattening the mapped results. The iteratee is invoked - * with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); - } +{ +name:"SIGINT", +number:2, +action:"terminate", +description:"User interruption with CTRL-C", +standard:"ansi"}, - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); - } +{ +name:"SIGQUIT", +number:3, +action:"core", +description:"User interruption with CTRL-\\", +standard:"posix"}, - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); - } +{ +name:"SIGILL", +number:4, +action:"core", +description:"Invalid machine instruction", +standard:"ansi"}, - /** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, getIteratee(iteratee, 3)); - } +{ +name:"SIGTRAP", +number:5, +action:"core", +description:"Debugger breakpoint", +standard:"posix"}, - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEach - * @example - * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `2` then `1`. - */ - function forEachRight(collection, iteratee) { - var func = isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, getIteratee(iteratee, 3)); - } +{ +name:"SIGABRT", +number:6, +action:"core", +description:"Aborted", +standard:"ansi"}, - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } - }); +{ +name:"SIGIOT", +number:6, +action:"core", +description:"Aborted", +standard:"bsd"}, - /** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; +{ +name:"SIGBUS", +number:7, +action:"core", +description: +"Bus error due to misaligned, non-existing address or paging error", +standard:"bsd"}, - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } +{ +name:"SIGEMT", +number:7, +action:"terminate", +description:"Command should be emulated but is not implemented", +standard:"other"}, - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `path` is a function, it's invoked - * for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; +{ +name:"SIGFPE", +number:8, +action:"core", +description:"Floating point arithmetic error", +standard:"ansi"}, - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; - }); +{ +name:"SIGKILL", +number:9, +action:"terminate", +description:"Forced termination", +standard:"posix", +forced:true}, - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ - var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); - }); +{ +name:"SIGUSR1", +number:10, +action:"terminate", +description:"Application-specific signal", +standard:"posix"}, - /** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); - } +{ +name:"SIGSEGV", +number:11, +action:"core", +description:"Segmentation fault", +standard:"ansi"}, - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] - * The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // Sort by `user` in ascending order and by `age` in descending order. - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - */ - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); - } +{ +name:"SIGUSR2", +number:12, +action:"terminate", +description:"Application-specific signal", +standard:"posix"}, - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, the second of which - * contains elements `predicate` returns falsey for. The predicate is - * invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.partition(users, function(o) { return o.active; }); - * // => objects for [['fred'], ['barney', 'pebbles']] - * - * // The `_.matches` iteratee shorthand. - * _.partition(users, { 'age': 1, 'active': false }); - * // => objects for [['pebbles'], ['barney', 'fred']] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.partition(users, ['active', false]); - * // => objects for [['barney', 'pebbles'], ['fred']] - * - * // The `_.property` iteratee shorthand. - * _.partition(users, 'active'); - * // => objects for [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); +{ +name:"SIGPIPE", +number:13, +action:"terminate", +description:"Broken pipe or socket", +standard:"posix"}, - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; +{ +name:"SIGALRM", +number:14, +action:"terminate", +description:"Timeout or timer", +standard:"posix"}, - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); - } +{ +name:"SIGTERM", +number:15, +action:"terminate", +description:"Termination", +standard:"ansi"}, - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduce - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; +{ +name:"SIGSTKFLT", +number:16, +action:"terminate", +description:"Stack is empty or overflowed", +standard:"other"}, - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); - } +{ +name:"SIGCHLD", +number:17, +action:"ignore", +description:"Child process terminated, paused or unpaused", +standard:"posix"}, - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.filter - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] - */ - function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(getIteratee(predicate, 3))); - } +{ +name:"SIGCLD", +number:17, +action:"ignore", +description:"Child process terminated, paused or unpaused", +standard:"other"}, - /** - * Gets a random element from `collection`. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - */ - function sample(collection) { - var func = isArray(collection) ? arraySample : baseSample; - return func(collection); - } +{ +name:"SIGCONT", +number:18, +action:"unpause", +description:"Unpaused", +standard:"posix", +forced:true}, - /** - * Gets `n` random elements at unique keys from `collection` up to the - * size of `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @param {number} [n=1] The number of elements to sample. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the random elements. - * @example - * - * _.sampleSize([1, 2, 3], 2); - * // => [3, 1] - * - * _.sampleSize([1, 2, 3], 4); - * // => [2, 3, 1] - */ - function sampleSize(collection, n, guard) { - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - var func = isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); - } +{ +name:"SIGSTOP", +number:19, +action:"pause", +description:"Paused", +standard:"posix", +forced:true}, - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - var func = isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); - } +{ +name:"SIGTSTP", +number:20, +action:"pause", +description:"Paused using CTRL-Z or \"suspend\"", +standard:"posix"}, - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable string keyed properties for objects. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } - return baseKeys(collection).length; - } +{ +name:"SIGTTIN", +number:21, +action:"pause", +description:"Background process cannot read terminal input", +standard:"posix"}, - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } +{ +name:"SIGBREAK", +number:21, +action:"terminate", +description:"User interruption with CTRL-BREAK", +standard:"other"}, - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection thru each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to sort by. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 30 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] - */ - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); +{ +name:"SIGTTOU", +number:22, +action:"pause", +description:"Background process cannot write to terminal output", +standard:"posix"}, - /*------------------------------------------------------------------------*/ +{ +name:"SIGURG", +number:23, +action:"ignore", +description:"Socket received out-of-band data", +standard:"bsd"}, - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = ctxNow || function() { - return root.Date.now(); - }; +{ +name:"SIGXCPU", +number:24, +action:"core", +description:"Process timed out", +standard:"bsd"}, - /*------------------------------------------------------------------------*/ +{ +name:"SIGXFSZ", +number:25, +action:"core", +description:"File too big", +standard:"bsd"}, - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => Logs 'done saving!' after the two async saves have completed. - */ - function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } +{ +name:"SIGVTALRM", +number:26, +action:"terminate", +description:"Timeout or timer", +standard:"bsd"}, - /** - * Creates a function that invokes `func`, with up to `n` arguments, - * ignoring any additional arguments. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); - } +{ +name:"SIGPROF", +number:27, +action:"terminate", +description:"Timeout or timer", +standard:"bsd"}, - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } +{ +name:"SIGWINCH", +number:28, +action:"ignore", +description:"Terminal window size changed", +standard:"bsd"}, - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and `partials` prepended to the arguments it receives. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * function greet(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(func, bitmask, thisArg, partials, holders); - }); +{ +name:"SIGIO", +number:29, +action:"terminate", +description:"I/O is available", +standard:"other"}, - /** - * Creates a function that invokes the method at `object[key]` with `partials` - * prepended to the arguments it receives. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. See - * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(key, bitmask, object, partials, holders); - }); +{ +name:"SIGPOLL", +number:29, +action:"terminate", +description:"Watched event", +standard:"other"}, - /** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; - } +{ +name:"SIGINFO", +number:29, +action:"ignore", +description:"Request for process information", +standard:"other"}, - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; - } +{ +name:"SIGPWR", +number:30, +action:"terminate", +description:"Device running out of power", +standard:"systemv"}, - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; +{ +name:"SIGSYS", +number:31, +action:"core", +description:"Invalid system call", +standard:"other"}, - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } +{ +name:"SIGUNUSED", +number:31, +action:"terminate", +description:"Invalid system call", +standard:"other"}];exports.SIGNALS=SIGNALS; +//# sourceMappingURL=core.js.map - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; +/***/ }), - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } +/***/ 7873: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } +"use strict"; +Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__nccwpck_require__(2037); - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; +var _signals=__nccwpck_require__(9925); +var _realtime=__nccwpck_require__(7413); - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } +const getSignalsByName=function(){ +const signals=(0,_signals.getSignals)(); +return signals.reduce(getSignalByName,{}); +}; - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } +const getSignalByName=function( +signalByNameMemo, +{name,number,description,supported,action,forced,standard}) +{ +return{ +...signalByNameMemo, +[name]:{name,number,description,supported,action,forced,standard}}; - function trailingEdge(time) { - timerId = undefined; +}; - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } +const signalsByName=getSignalsByName();exports.signalsByName=signalsByName; - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - lastArgs = arguments; - lastThis = this; - lastCallTime = time; +const getSignalsByNumber=function(){ +const signals=(0,_signals.getSignals)(); +const length=_realtime.SIGRTMAX+1; +const signalsA=Array.from({length},(value,number)=> +getSignalByNumber(number,signals)); - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - clearTimeout(timerId); - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } +return Object.assign({},...signalsA); +}; - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. - */ - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); +const getSignalByNumber=function(number,signals){ +const signal=findSignalByNumber(number,signals); - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. - */ - var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); +if(signal===undefined){ +return{}; +} - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new flipped function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); - } +const{name,description,supported,action,forced,standard}=signal; +return{ +[number]:{ +name, +number, +description, +supported, +action, +forced, +standard}}; - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } +}; - // Expose `MapCache`. - memoize.Cache = MapCache; - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new negated function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: return !predicate.call(this); - case 1: return !predicate.call(this, args[0]); - case 2: return !predicate.call(this, args[0], args[1]); - case 3: return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; - } - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once - */ - function once(func) { - return before(2, func); - } +const findSignalByNumber=function(number,signals){ +const signal=signals.find(({name})=>_os.constants.signals[name]===number); - /** - * Creates a function that invokes `func` with its arguments transformed. - * - * @static - * @since 4.0.0 - * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms=[_.identity]] - * The argument transforms. - * @returns {Function} Returns the new function. - * @example - * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var func = _.overArgs(function(x, y) { - * return [x, y]; - * }, [square, doubled]); - * - * func(9, 3); - * // => [81, 6] - * - * func(10, 5); - * // => [100, 10] - */ - var overArgs = castRest(function(func, transforms) { - transforms = (transforms.length == 1 && isArray(transforms[0])) - ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); +if(signal!==undefined){ +return signal; +} - var funcsLength = transforms.length; - return baseRest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); +return signals.find(signalA=>signalA.number===number); +}; - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); - }); - }); +const signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumber; +//# sourceMappingURL=main.js.map - /** - * Creates a function that invokes `func` with `partials` prepended to the - * arguments it receives. This method is like `_.bind` except it does **not** - * alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 0.2.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // Partially applied with placeholders. - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partial)); - return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); - }); +/***/ }), - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to the arguments it receives. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // Partially applied with placeholders. - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); - }); +/***/ 7413: +/***/ ((__unused_webpack_module, exports) => { - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified `indexes` where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, [2, 0, 1]); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - */ - var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); - }); +"use strict"; +Object.defineProperty(exports, "__esModule", ({value:true}));exports.SIGRTMAX=exports.getRealtimeSignals=void 0; +const getRealtimeSignals=function(){ +const length=SIGRTMAX-SIGRTMIN+1; +return Array.from({length},getRealtimeSignal); +};exports.getRealtimeSignals=getRealtimeSignals; - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start === undefined ? start : toInteger(start); - return baseRest(func, start); - } +const getRealtimeSignal=function(value,index){ +return{ +name:`SIGRT${index+1}`, +number:SIGRTMIN+index, +action:"terminate", +description:"Application-specific signal (realtime)", +standard:"posix"}; - /** - * Creates a function that invokes `func` with the `this` binding of the - * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). - * - * **Note:** This method is based on the - * [spread operator](https://mdn.io/spread_operator). - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Function - * @param {Function} func The function to spread arguments over. - * @param {number} [start=0] The start position of the spread. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { - var array = args[start], - otherArgs = castSlice(args, 0, start); +}; - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); - } +const SIGRTMIN=34; +const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; +//# sourceMappingURL=realtime.js.map - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; +/***/ }), - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); - } +/***/ 9925: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - function unary(func) { - return ary(func, 1); - } +"use strict"; +Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__nccwpck_require__(2037); - /** - * Creates a function that provides `value` to `wrapper` as its first - * argument. Any additional arguments provided to the function are appended - * to those provided to the `wrapper`. The wrapper is invoked with the `this` - * binding of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {*} value The value to wrap. - * @param {Function} [wrapper=identity] The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ - function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); - } +var _core=__nccwpck_require__(5877); +var _realtime=__nccwpck_require__(7413); - /*------------------------------------------------------------------------*/ - /** - * Casts `value` as an array if it's not one. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Lang - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast array. - * @example - * - * _.castArray(1); - * // => [1] - * - * _.castArray({ 'a': 1 }); - * // => [{ 'a': 1 }] - * - * _.castArray('abc'); - * // => ['abc'] - * - * _.castArray(null); - * // => [null] - * - * _.castArray(undefined); - * // => [undefined] - * - * _.castArray(); - * // => [] - * - * var array = [1, 2, 3]; - * console.log(_.castArray(array) === array); - * // => true - */ - function castArray() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray(value) ? value : [value]; - } - /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ - function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); - } +const getSignals=function(){ +const realtimeSignals=(0,_realtime.getRealtimeSignals)(); +const signals=[..._core.SIGNALS,...realtimeSignals].map(normalizeSignal); +return signals; +};exports.getSignals=getSignals; - /** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined`, - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @see _.cloneDeepWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } - * - * var el = _.cloneWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 - */ - function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); - } - /** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } - /** - * This method is like `_.cloneWith` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @see _.cloneWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 - */ - function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); - } - /** - * Checks if `object` conforms to `source` by invoking the predicate - * properties of `source` with the corresponding property values of `object`. - * - * **Note:** This method is equivalent to `_.conforms` when `source` is - * partially applied. - * - * @static - * @memberOf _ - * @since 4.14.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); - * // => true - * - * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); - * // => false - */ - function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); + + + +const normalizeSignal=function({ +name, +number:defaultNumber, +description, +action, +forced=false, +standard}) +{ +const{ +signals:{[name]:constantSignal}}= +_os.constants; +const supported=constantSignal!==undefined; +const number=supported?constantSignal:defaultNumber; +return{name,number,description,supported,action,forced,standard}; +}; +//# sourceMappingURL=signals.js.map + +/***/ }), + +/***/ 5056: +/***/ ((module) => { + +"use strict"; + + +const isStream = stream => + stream !== null && + typeof stream === 'object' && + typeof stream.pipe === 'function'; + +isStream.writable = stream => + isStream(stream) && + stream.writable !== false && + typeof stream._write === 'function' && + typeof stream._writableState === 'object'; + +isStream.readable = stream => + isStream(stream) && + stream.readable !== false && + typeof stream._read === 'function' && + typeof stream._readableState === 'object'; + +isStream.duplex = stream => + isStream.writable(stream) && + isStream.readable(stream); + +isStream.transform = stream => + isStream.duplex(stream) && + typeof stream._transform === 'function'; + +module.exports = isStream; + + +/***/ }), + +/***/ 2888: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const path = __nccwpck_require__(1017); +const pathKey = __nccwpck_require__(5235); + +const npmRunPath = options => { + options = { + cwd: process.cwd(), + path: process.env[pathKey()], + execPath: process.execPath, + ...options + }; + + let previous; + let cwdPath = path.resolve(options.cwd); + const result = []; + + while (previous !== cwdPath) { + result.push(path.join(cwdPath, 'node_modules/.bin')); + previous = cwdPath; + cwdPath = path.resolve(cwdPath, '..'); + } + + // Ensure the running `node` binary is used + const execPathDir = path.resolve(options.cwd, options.execPath, '..'); + result.push(execPathDir); + + return result.concat(options.path).join(path.delimiter); +}; + +module.exports = npmRunPath; +// TODO: Remove this for the next major release +module.exports["default"] = npmRunPath; + +module.exports.env = options => { + options = { + env: process.env, + ...options + }; + + const env = {...options.env}; + const path = pathKey({env}); + + options.path = env[path]; + env[path] = module.exports(options); + + return env; +}; + + +/***/ }), + +/***/ 5235: +/***/ ((module) => { + +"use strict"; + + +const pathKey = (options = {}) => { + const environment = options.env || process.env; + const platform = options.platform || process.platform; + + if (platform !== 'win32') { + return 'PATH'; + } + + return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; +}; + +module.exports = pathKey; +// TODO: Remove this for the next major release +module.exports["default"] = pathKey; + + +/***/ }), + +/***/ 2437: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } } - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version } - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - * @see _.lt - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - var gt = createRelationalOperation(baseGt); + debug('comp', this) + } - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to - * `other`, else `false`. - * @see _.lte - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - var gte = createRelationalOperation(function(value, other) { - return value >= other; - }); + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } - /** - * Checks if `value` is classified as an `ArrayBuffer` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - * @example - * - * _.isArrayBuffer(new ArrayBuffer(2)); - * // => true - * - * _.isArrayBuffer(new Array(2)); - * // => false - */ - var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true } - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } } - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') } - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + options = parseOptions(options) - /** - * Checks if `value` is likely a DOM element. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false } - /** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = __nccwpck_require__(3204) +const { safeRe: re, t } = __nccwpck_require__(2012) +const cmp = __nccwpck_require__(1748) +const debug = __nccwpck_require__(3983) +const SemVer = __nccwpck_require__(7384) +const Range = __nccwpck_require__(4094) + + +/***/ }), + +/***/ 4094: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) } - return true; } - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are compared by strict equality, i.e. `===`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this } - /** - * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with up to - * six arguments: (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) } - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - if (!isObjectLike(value)) { - return false; + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on - * [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MIN_VALUE); - * // => true - * - * _.isFinite(Infinity); - * // => false - * - * _.isFinite('3'); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); + this.format() + } + + format () { + this.range = this.set + .map((comps) => comps.join(' ').trim()) + .join('||') + .trim() + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached } - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') } - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on - * [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') } - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false } - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } } - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } } + return false + } +} - /** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true - * - * _.isMap(new WeakMap); - * // => false - */ - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; +module.exports = Range - /** - * Performs a partial deep comparison between `object` and `source` to - * determine if `object` contains equivalent property values. - * - * **Note:** This method is equivalent to `_.matches` when `source` is - * partially applied. - * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.isMatch(object, { 'b': 2 }); - * // => true - * - * _.isMatch(object, { 'b': 1 }); - * // => false - */ - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } +const LRU = __nccwpck_require__(7129) +const cache = new LRU({ max: 1000 }) - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); - } +const parseOptions = __nccwpck_require__(3204) +const Comparator = __nccwpck_require__(2437) +const debug = __nccwpck_require__(3983) +const SemVer = __nccwpck_require__(7384) +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = __nccwpck_require__(2012) +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(6529) - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is based on - * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as - * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for - * `undefined` and other non-number values. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; - } +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' - /** - * Checks if `value` is a pristine native function. - * - * **Note:** This method can't reliably detect native functions in the presence - * of the core-js package because core-js circumvents this kind of detection. - * Despite multiple requests, the core-js maintainer has made it clear: any - * attempt to fix the detection will be obstructed. As a result, we're left - * with little choice but to throw an error. Unfortunately, this also affects - * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on core-js. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (isMaskable(value)) { - throw new Error(CORE_ERROR_TEXT); - } - return baseIsNative(value); - } +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - function isNil(value) { - return value == null; - } + testComparator = remainingComparators.pop() + } - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` } - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` } - var proto = getPrototype(value); - if (proto === null) { - return true; + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; } - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + debug('caret return', ret) + return ret + }) +} - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on - * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; - } +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} - /** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true - * - * _.isSet(new WeakSet); - * // => false - */ - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + if (gtlt === '=' && anyX) { + gtlt = '' } - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 - /** - * Checks if `value` is `undefined`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } - /** - * Checks if `value` is classified as a `WeakMap` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. - * @example - * - * _.isWeakMap(new WeakMap); - * // => true - * - * _.isWeakMap(new Map); - * // => false - */ - function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; - } + if (gtlt === '<') { + pr = '-0' + } - /** - * Checks if `value` is classified as a `WeakSet` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. - * @example - * - * _.isWeakSet(new WeakSet); - * // => true - * - * _.isWeakSet(new Set); - * // => false - */ - function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` } - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - * @see _.gt - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - var lt = createRelationalOperation(baseLt); + debug('xRange return', ret) - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to - * `other`, else `false`. - * @see _.gte - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - var lte = createRelationalOperation(function(value, other) { - return value <= other; - }); + return ret + }) +} - /** - * Converts `value` to an array. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} - return func(value); +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false } + } - /** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } } - return value === value ? value : 0; } - /** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; + // Version has a -pre, but it's not one of the ones we like. + return false + } - return result === result ? (remainder ? result - remainder : result) : 0; - } + return true +} - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toLength(3.2); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3.2'); - * // => 3 - */ - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; - } - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; +/***/ }), + +/***/ 7384: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const debug = __nccwpck_require__(3983) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(6529) +const { safeRe: re, t } = __nccwpck_require__(2012) + +const parseOptions = __nccwpck_require__(3204) +const { compareIdentifiers } = __nccwpck_require__(2126) +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version } - value = baseTrim(value); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) } - /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) } - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toSafeInteger(3.2); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3.2'); - * // => 3 - */ - function toSafeInteger(value) { - return value - ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) - : (value === 0 ? value : 0); + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) } - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') } - /*------------------------------------------------------------------------*/ + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } - /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ - var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 } - }); + other = new SemVer(other, this.options) + } - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); + if (other.version === this.version) { + return 0 + } - /** - * This method is like `_.assignIn` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); + return this.compareMain(other) || this.comparePre(other) + } - /** - * This method is like `_.assign` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignInWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); - }); + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - /** - * Creates an array of values corresponding to `paths` of `object`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Array} Returns the picked values. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] - */ - var at = flatRest(baseAt); + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } - /** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) } - /** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep - * @example - * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var defaults = baseRest(function(object, sources) { - object = Object(object); + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) } + } while (++i) + } - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 - if (value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease } } + break } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} - return object; - }); +module.exports = SemVer - /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaults - * @example - * - * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); - * // => { 'a': { 'b': 2, 'c': 3 } } - */ - var defaultsDeep = baseRest(function(args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); - }); - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' - */ - function findKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); - } +/***/ }), - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - function findLastKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); - } +/***/ 8929: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Iterates over own and inherited enumerable string keyed properties of an - * object and invokes `iteratee` for each property. The iteratee is invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forInRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). - */ - function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, getIteratee(iteratee, 3), keysIn); - } +const parse = __nccwpck_require__(4147) +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forIn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. - */ - function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, getIteratee(iteratee, 3), keysIn); - } - /** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee, 3)); - } +/***/ }), - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. - */ - function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee, 3)); - } +/***/ 1748: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functionsIn - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } +const eq = __nccwpck_require__(8364) +const neq = __nccwpck_require__(8681) +const gt = __nccwpck_require__(6017) +const gte = __nccwpck_require__(5583) +const lt = __nccwpck_require__(3969) +const lte = __nccwpck_require__(6732) - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functions - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - function has(object, path) { - return object != null && hasPath(object, path, baseHas); - } + case '': + case '=': + case '==': + return eq(a, b, loose) - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } + case '!=': + return neq(a, b, loose) - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite - * property assignments of previous values. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - */ - var invert = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } + case '>': + return gt(a, b, loose) - result[value] = key; - }, constant(identity)); + case '>=': + return gte(a, b, loose) - /** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` thru `iteratee`. The - * corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Object - * @param {Object} object The object to invert. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } - * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ - var invertBy = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } + case '<': + return lt(a, b, loose) - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - }, getIteratee); + case '<=': + return lte(a, b, loose) - /** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ - var invoke = baseRest(baseInvoke); + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } +/***/ }), - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * string keyed property of `object` thru `iteratee`. The iteratee is invoked - * with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapValues - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - function mapKeys(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); +/***/ 402: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; - } +const SemVer = __nccwpck_require__(7384) +const parse = __nccwpck_require__(4147) +const { safeRe: re, t } = __nccwpck_require__(2012) - /** - * Creates an object with the same keys as `object` and values generated - * by running each own enumerable string keyed property of `object` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, key, object). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapKeys - * @example - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * _.mapValues(users, function(o) { return o.age; }); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - * - * // The `_.property` iteratee shorthand. - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - function mapValues(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; - } + if (typeof version === 'number') { + version = String(version) + } - /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); + if (typeof version !== 'string') { + return null + } - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined`, merging is handled by the - * method instead. The `customizer` is invoked with six arguments: - * (objValue, srcValue, key, object, source, stack). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { 'a': [1], 'b': [2] }; - * var other = { 'a': [3], 'b': [4] }; - * - * _.mergeWith(object, other, customizer); - * // => { 'a': [1, 3], 'b': [2, 4] } - */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); + options = options || {} - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable property paths of `object` that are not omitted. - * - * **Note:** This method is considerably slower than `_.pick`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to omit. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); + let match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + let next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next } - return result; - }); - - /** - * The opposite of `_.pickBy`; this method creates an object composed of - * the own and inherited enumerable string keyed properties of `object` that - * `predicate` doesn't return truthy for. The predicate is invoked with two - * arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - function omitBy(object, predicate) { - return pickBy(object, negate(getIteratee(predicate))); + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); + if (match === null) { + return null + } - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - function pickBy(object, predicate) { - if (object == null) { - return {}; - } - var props = arrayMap(getAllKeysIn(object), function(prop) { - return [prop]; - }); - predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { - return predicate(value, path[0]); - }); - } + return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) +} +module.exports = coerce - /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - path = castPath(path, object); - var index = -1, - length = path.length; +/***/ }), - // Ensure the loop is entered when path is empty. - if (!length) { - length = 1; - object = undefined; - } - while (++index < length) { - var value = object == null ? undefined : object[toKey(path[index])]; - if (value === undefined) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; +/***/ 7882: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(7384) +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild + + +/***/ }), + +/***/ 6466: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(8652) +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose + + +/***/ }), + +/***/ 8652: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(7384) +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare + + +/***/ }), + +/***/ 8403: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(4147) + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' } - /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); + // Otherwise it can be determined by checking the high version + + if (highVersion.patch) { + // anything higher than a patch bump would result in the wrong version + return 'patch' } - /** - * This method is like `_.set` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.setWith(object, '[0][1]', 'a', Object); - * // => { '0': { '1': 'a' } } - */ - function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); + if (highVersion.minor) { + // anything higher than a minor bump would result in the wrong version + return 'minor' } - /** - * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. If `object` is a map or set, its - * entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entries - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) - */ - var toPairs = createToPairs(keys); + // bumping major/minor/patch all have same result + return 'major' + } - /** - * Creates an array of own and inherited enumerable string keyed-value pairs - * for `object` which can be consumed by `_.fromPairs`. If `object` is a map - * or set, its entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entriesIn - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) - */ - var toPairsIn = createToPairs(keysIn); + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own - * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. If `accumulator` is not - * provided, a new object with the same `[[Prototype]]` will be used. The - * iteratee is invoked with four arguments: (accumulator, value, key, object). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); + if (v1.major !== v2.major) { + return prefix + 'major' + } - iteratee = getIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } - /** - * Removes the property at `path` of `object`. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 7 } }] }; - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - * - * _.unset(object, ['a', '0', 'b', 'c']); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - */ - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } - /** - * This method is like `_.set` except that accepts `updater` to produce the - * value to set. Use `_.updateWith` to customize `path` creation. The `updater` - * is invoked with one argument: (value). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.update(object, 'a[0].b.c', function(n) { return n * n; }); - * console.log(object.a[0].b.c); - * // => 9 - * - * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); - * console.log(object.x[0].y.z); - * // => 0 - */ - function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); - } + // high and low are preleases + return 'prerelease' +} - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); - } +module.exports = diff - /** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - /** - * Creates an array of the own and inherited enumerable string keyed property - * values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); - } +/***/ }), - /*------------------------------------------------------------------------*/ +/***/ 8364: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); - } +const compare = __nccwpck_require__(8652) +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq - /** - * Checks if `n` is between `start` and up to, but not including, `end`. If - * `end` is not specified, it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. - * - * @static - * @memberOf _ - * @since 3.3.0 - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @see _.range, _.rangeRight - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - * - * _.inRange(-3, -2, -6); - * // => true - */ - function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - number = toNumber(number); - return baseInRange(number, start, end); - } - /** - * Produces a random number between the inclusive `lower` and `upper` bounds. - * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are - * floats, a floating-point number is returned instead of an integer. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Number - * @param {number} [lower=0] The lower bound. - * @param {number} [upper=1] The upper bound. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; - } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; - } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } - else { - lower = toFinite(lower); - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); - } +/***/ }), - /*------------------------------------------------------------------------*/ +/***/ 6017: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' - * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); +const compare = __nccwpck_require__(8652) +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt - /** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); - } - /** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); - } +/***/ }), - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search up to. - * @returns {boolean} Returns `true` if `string` ends with `target`, - * else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); +/***/ 5583: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); +const compare = __nccwpck_require__(8652) +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte - var end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; - } - /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to their - * corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. See - * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * When working with HTML you should always - * [quote attribute values](http://wonko.com/post/html-escaping) to reduce - * XSS vectors. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } +/***/ }), - /** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } +/***/ 5698: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Converts `string` to - * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__FOO_BAR__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); +const SemVer = __nccwpck_require__(7384) - /** - * Converts `string`, as space separated words, to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the lower cased string. - * @example - * - * _.lowerCase('--Foo-Bar--'); - * // => 'foo bar' - * - * _.lowerCase('fooBar'); - * // => 'foo bar' - * - * _.lowerCase('__FOO_BAR__'); - * // => 'foo bar' - */ - var lowerCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toLowerCase(); - }); +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } - /** - * Converts the first character of `string` to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.lowerFirst('Fred'); - * // => 'fred' - * - * _.lowerFirst('FRED'); - * // => 'fRED' - */ - var lowerFirst = createCaseFirst('toLowerCase'); + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); - } +/***/ }), - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padEnd('abc', 3); - * // => 'abc' - */ - function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); +/***/ 3969: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; - } +const compare = __nccwpck_require__(8652) +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padStart('abc', 6); - * // => ' abc' - * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padStart('abc', 3); - * // => 'abc' - */ - function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; - } +/***/ }), - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a - * hexadecimal, in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the - * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category String - * @param {string} string The string to convert. - * @param {number} [radix=10] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); - } +/***/ 6732: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=1] The number of times to repeat the string. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n, guard) { - if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - return baseRepeat(toString(string), n); - } +const compare = __nccwpck_require__(8652) +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte - /** - * Replaces matches for `pattern` in `string` with `replacement`. - * - * **Note:** This method is based on - * [`String#replace`](https://mdn.io/String/replace). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to modify. - * @param {RegExp|string} pattern The pattern to replace. - * @param {Function|string} replacement The match replacement. - * @returns {string} Returns the modified string. - * @example - * - * _.replace('Hi Fred', 'Fred', 'Barney'); - * // => 'Hi Barney' - */ - function replace() { - var args = arguments, - string = toString(args[0]); - return args.length < 3 ? string : string.replace(args[1], args[2]); - } +/***/ }), - /** - * Converts `string` to - * [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--FOO-BAR--'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); +/***/ 7803: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Splits `string` by `separator`. - * - * **Note:** This method is based on - * [`String#split`](https://mdn.io/String/split). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to split. - * @param {RegExp|string} separator The separator pattern to split by. - * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the string segments. - * @example - * - * _.split('a-b-c', '-', 2); - * // => ['a', 'b'] - */ - function split(string, separator, limit) { - if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { - separator = limit = undefined; - } - limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; - if (!limit) { - return []; - } - string = toString(string); - if (string && ( - typeof separator == 'string' || - (separator != null && !isRegExp(separator)) - )) { - separator = baseToString(separator); - if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); - } - } - return string.split(separator, limit); - } +const SemVer = __nccwpck_require__(7384) +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major - /** - * Converts `string` to - * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @since 3.1.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar--'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__FOO_BAR__'); - * // => 'FOO BAR' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + upperFirst(word); - }); - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, - * else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = toString(string); - position = position == null - ? 0 - : baseClamp(toInteger(position), 0, string.length); +/***/ }), - target = baseToString(target); - return string.slice(position, position + target.length) == target; - } +/***/ 6959: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is given, it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options={}] The options object. - * @param {RegExp} [options.escape=_.templateSettings.escape] - * The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] - * The "evaluate" delimiter. - * @param {Object} [options.imports=_.templateSettings.imports] - * An object to import into the template as free variables. - * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] - * The "interpolate" delimiter. - * @param {string} [options.sourceURL='lodash.templateSources[n]'] - * The sourceURL of the compiled template. - * @param {string} [options.variable='obj'] - * The data object variable name. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the compiled template function. - * @example - * - * // Use the "interpolate" delimiter to create a compiled template. - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // Use the HTML "escape" delimiter to escape data property values. - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': '