chrono-node 2.2.7 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -9
- package/benchmark/benchmark.js +4 -0
- package/dist/bundle.js +5047 -0
- package/dist/chrono.d.ts +7 -6
- package/dist/chrono.js +6 -5
- package/dist/common/casualReferences.d.ts +6 -6
- package/dist/common/casualReferences.js +16 -15
- package/dist/common/refiners/ForwardDateRefiner.js +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/locales/de/constants.js +1 -1
- package/dist/locales/de/parsers/DECasualDateParser.js +2 -2
- package/dist/locales/en/constants.d.ts +1 -1
- package/dist/locales/en/constants.js +5 -5
- package/dist/locales/en/parsers/ENCasualDateParser.js +5 -5
- package/dist/locales/en/parsers/ENCasualTimeParser.js +1 -1
- package/dist/locales/en/parsers/ENMonthNameLittleEndianParser.js +6 -8
- package/dist/locales/en/parsers/ENRelativeDateFormatParser.js +3 -3
- package/dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js +3 -3
- package/dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js +1 -1
- package/dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js +2 -2
- package/dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js +1 -1
- package/dist/locales/fr/constants.js +1 -1
- package/dist/locales/fr/parsers/FRCasualDateParser.js +4 -4
- package/dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js +1 -1
- package/dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js +1 -1
- package/dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js +1 -1
- package/dist/locales/ja/parsers/JPCasualDateParser.js +3 -3
- package/dist/locales/nl/constants.js +8 -5
- package/dist/locales/nl/index.js +12 -3
- package/dist/locales/nl/parsers/NLCasualDateParser.js +4 -4
- package/dist/locales/nl/parsers/NLRelativeDateFormatParser.d.ts +7 -0
- package/dist/locales/nl/parsers/NLRelativeDateFormatParser.js +57 -0
- package/dist/locales/nl/parsers/NLTimeExpressionParser.d.ts +1 -0
- package/dist/locales/nl/parsers/NLTimeExpressionParser.js +3 -0
- package/dist/locales/nl/parsers/NLTimeUnitAgoFormatParser.d.ts +9 -0
- package/dist/locales/nl/parsers/NLTimeUnitAgoFormatParser.js +23 -0
- package/dist/locales/nl/parsers/NLTimeUnitCasualRelativeFormatParser.d.ts +7 -0
- package/dist/locales/nl/parsers/NLTimeUnitCasualRelativeFormatParser.js +25 -0
- package/dist/locales/nl/parsers/NLTimeUnitLaterFormatParser.d.ts +9 -0
- package/dist/locales/nl/parsers/NLTimeUnitLaterFormatParser.js +22 -0
- package/dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js +1 -1
- package/dist/locales/pt/parsers/PTCasualDateParser.js +4 -4
- package/dist/main.js +1078 -0
- package/dist/results.d.ts +12 -5
- package/dist/results.js +40 -17
- package/dist/timezone.d.ts +194 -0
- package/dist/timezone.js +207 -0
- package/dist/utils/dayjs.js +0 -2
- package/dist/utils/pattern.js +1 -1
- package/package.json +3 -3
- package/src/chrono.ts +21 -8
- package/src/common/casualReferences.ts +17 -18
- package/src/common/refiners/ForwardDateRefiner.ts +1 -1
- package/src/index.ts +19 -3
- package/src/locales/de/constants.ts +1 -1
- package/src/locales/de/parsers/DECasualDateParser.ts +2 -2
- package/src/locales/en/constants.ts +5 -5
- package/src/locales/en/parsers/ENCasualDateParser.ts +5 -5
- package/src/locales/en/parsers/ENCasualTimeParser.ts +1 -1
- package/src/locales/en/parsers/ENMonthNameLittleEndianParser.ts +9 -10
- package/src/locales/en/parsers/ENRelativeDateFormatParser.ts +3 -3
- package/src/locales/en/parsers/ENTimeUnitAgoFormatParser.ts +3 -4
- package/src/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.ts +1 -1
- package/src/locales/en/parsers/ENTimeUnitLaterFormatParser.ts +2 -2
- package/src/locales/en/parsers/ENTimeUnitWithinFormatParser.ts +1 -1
- package/src/locales/fr/constants.ts +1 -1
- package/src/locales/fr/parsers/FRCasualDateParser.ts +4 -4
- package/src/locales/fr/parsers/FRTimeUnitAgoFormatParser.ts +1 -1
- package/src/locales/fr/parsers/FRTimeUnitRelativeFormatParser.ts +1 -1
- package/src/locales/fr/parsers/FRTimeUnitWithinFormatParser.ts +1 -1
- package/src/locales/ja/parsers/JPCasualDateParser.ts +3 -3
- package/src/locales/nl/constants.ts +11 -5
- package/src/locales/nl/index.ts +12 -3
- package/src/locales/nl/parsers/NLCasualDateParser.ts +4 -4
- package/src/locales/nl/parsers/NLRelativeDateFormatParser.ts +70 -0
- package/src/locales/nl/parsers/NLTimeExpressionParser.ts +4 -0
- package/src/locales/nl/parsers/NLTimeUnitAgoFormatParser.ts +26 -0
- package/src/locales/nl/parsers/NLTimeUnitCasualRelativeFormatParser.ts +27 -0
- package/src/locales/nl/parsers/NLTimeUnitLaterFormatParser.ts +27 -0
- package/src/locales/nl/parsers/NLTimeUnitWithinFormatParser.ts +1 -1
- package/src/locales/pt/parsers/PTCasualDateParser.ts +4 -4
- package/src/results.ts +52 -18
- package/src/timezone.ts +205 -0
- package/src/utils/dayjs.ts +0 -2
- package/src/utils/pattern.ts +1 -1
- package/test/en/en_month_name_little_endian.test.ts +10 -0
- package/test/en/en_relative.test.ts +30 -0
- package/test/en/en_slash.test.ts +11 -0
- package/test/en/en_timezone_exp.test.ts +7 -4
- package/test/en/en_weekday.test.ts +69 -25
- package/test/en/negative_cases.test.ts +2 -0
- package/test/nl/nl_relative.test.ts +212 -0
- package/test/nl/nl_time_units_ago.test.ts +243 -0
- package/test/nl/nl_time_units_casual_relative.test.ts +130 -0
- package/test/nl/nl_time_units_later.test.ts +250 -0
- package/test/result.test.ts +32 -13
- package/test/system_timezone.test.ts +100 -0
- package/test/test_util.ts +10 -7
package/dist/main.js
ADDED
|
@@ -0,0 +1,1078 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ (() => { // webpackBootstrap
|
|
10
|
+
/******/ var __webpack_modules__ = ({
|
|
11
|
+
|
|
12
|
+
/***/ "./dist/calculation/mergingCalculation.js":
|
|
13
|
+
/*!************************************************!*\
|
|
14
|
+
!*** ./dist/calculation/mergingCalculation.js ***!
|
|
15
|
+
\************************************************/
|
|
16
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
17
|
+
|
|
18
|
+
"use strict";
|
|
19
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.mergeDateTimeComponent = exports.mergeDateTimeResult = void 0;\nconst index_1 = __webpack_require__(/*! ../index */ \"./dist/index.js\");\nfunction mergeDateTimeResult(dateResult, timeResult) {\n const result = dateResult.clone();\n const beginDate = dateResult.start;\n const beginTime = timeResult.start;\n result.start = mergeDateTimeComponent(beginDate, beginTime);\n if (dateResult.end != null || timeResult.end != null) {\n const endDate = dateResult.end == null ? dateResult.start : dateResult.end;\n const endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n const endDateTime = mergeDateTimeComponent(endDate, endTime);\n if (dateResult.end == null && endDateTime.date().getTime() < result.start.date().getTime()) {\n if (endDateTime.isCertain(\"day\")) {\n endDateTime.assign(\"day\", endDateTime.get(\"day\") + 1);\n }\n else {\n endDateTime.imply(\"day\", endDateTime.get(\"day\") + 1);\n }\n }\n result.end = endDateTime;\n }\n return result;\n}\nexports.mergeDateTimeResult = mergeDateTimeResult;\nfunction mergeDateTimeComponent(dateComponent, timeComponent) {\n const dateTimeComponent = dateComponent.clone();\n if (timeComponent.isCertain(\"hour\")) {\n dateTimeComponent.assign(\"hour\", timeComponent.get(\"hour\"));\n dateTimeComponent.assign(\"minute\", timeComponent.get(\"minute\"));\n if (timeComponent.isCertain(\"second\")) {\n dateTimeComponent.assign(\"second\", timeComponent.get(\"second\"));\n if (timeComponent.isCertain(\"millisecond\")) {\n dateTimeComponent.assign(\"millisecond\", timeComponent.get(\"millisecond\"));\n }\n else {\n dateTimeComponent.imply(\"millisecond\", timeComponent.get(\"millisecond\"));\n }\n }\n else {\n dateTimeComponent.imply(\"second\", timeComponent.get(\"second\"));\n dateTimeComponent.imply(\"millisecond\", timeComponent.get(\"millisecond\"));\n }\n }\n else {\n dateTimeComponent.imply(\"hour\", timeComponent.get(\"hour\"));\n dateTimeComponent.imply(\"minute\", timeComponent.get(\"minute\"));\n dateTimeComponent.imply(\"second\", timeComponent.get(\"second\"));\n dateTimeComponent.imply(\"millisecond\", timeComponent.get(\"millisecond\"));\n }\n if (timeComponent.isCertain(\"timezoneOffset\")) {\n dateTimeComponent.assign(\"timezoneOffset\", timeComponent.get(\"timezoneOffset\"));\n }\n if (timeComponent.isCertain(\"meridiem\")) {\n dateTimeComponent.assign(\"meridiem\", timeComponent.get(\"meridiem\"));\n }\n else if (timeComponent.get(\"meridiem\") != null && dateTimeComponent.get(\"meridiem\") == null) {\n dateTimeComponent.imply(\"meridiem\", timeComponent.get(\"meridiem\"));\n }\n if (dateTimeComponent.get(\"meridiem\") == index_1.Meridiem.PM && dateTimeComponent.get(\"hour\") < 12) {\n if (timeComponent.isCertain(\"hour\")) {\n dateTimeComponent.assign(\"hour\", dateTimeComponent.get(\"hour\") + 12);\n }\n else {\n dateTimeComponent.imply(\"hour\", dateTimeComponent.get(\"hour\") + 12);\n }\n }\n return dateTimeComponent;\n}\nexports.mergeDateTimeComponent = mergeDateTimeComponent;\n\n\n//# sourceURL=webpack://chrono-node/./dist/calculation/mergingCalculation.js?");
|
|
20
|
+
|
|
21
|
+
/***/ }),
|
|
22
|
+
|
|
23
|
+
/***/ "./dist/calculation/weeks.js":
|
|
24
|
+
/*!***********************************!*\
|
|
25
|
+
!*** ./dist/calculation/weeks.js ***!
|
|
26
|
+
\***********************************/
|
|
27
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
28
|
+
|
|
29
|
+
"use strict";
|
|
30
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.toDayJSClosestWeekday = exports.toDayJSWeekday = void 0;\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nfunction toDayJSWeekday(refDate, offset, modifier) {\n if (!modifier) {\n return toDayJSClosestWeekday(refDate, offset);\n }\n let date = dayjs_1.default(refDate);\n switch (modifier) {\n case \"this\":\n date = date.day(offset);\n break;\n case \"next\":\n date = date.day(offset + 7);\n break;\n case \"last\":\n date = date.day(offset - 7);\n break;\n }\n return date;\n}\nexports.toDayJSWeekday = toDayJSWeekday;\nfunction toDayJSClosestWeekday(refDate, offset) {\n let date = dayjs_1.default(refDate);\n const refOffset = date.day();\n if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n date = date.day(offset - 7);\n }\n else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n date = date.day(offset + 7);\n }\n else {\n date = date.day(offset);\n }\n return date;\n}\nexports.toDayJSClosestWeekday = toDayJSClosestWeekday;\n\n\n//# sourceURL=webpack://chrono-node/./dist/calculation/weeks.js?");
|
|
31
|
+
|
|
32
|
+
/***/ }),
|
|
33
|
+
|
|
34
|
+
/***/ "./dist/calculation/years.js":
|
|
35
|
+
/*!***********************************!*\
|
|
36
|
+
!*** ./dist/calculation/years.js ***!
|
|
37
|
+
\***********************************/
|
|
38
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
39
|
+
|
|
40
|
+
"use strict";
|
|
41
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.findYearClosestToRef = exports.findMostLikelyADYear = void 0;\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nfunction findMostLikelyADYear(yearNumber) {\n if (yearNumber < 100) {\n if (yearNumber > 50) {\n yearNumber = yearNumber + 1900;\n }\n else {\n yearNumber = yearNumber + 2000;\n }\n }\n return yearNumber;\n}\nexports.findMostLikelyADYear = findMostLikelyADYear;\nfunction findYearClosestToRef(refDate, day, month) {\n const refMoment = dayjs_1.default(refDate);\n let dateMoment = refMoment;\n dateMoment = dateMoment.month(month - 1);\n dateMoment = dateMoment.date(day);\n dateMoment = dateMoment.year(refMoment.year());\n const nextYear = dateMoment.add(1, \"y\");\n const lastYear = dateMoment.add(-1, \"y\");\n if (Math.abs(nextYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment))) {\n dateMoment = nextYear;\n }\n else if (Math.abs(lastYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment))) {\n dateMoment = lastYear;\n }\n return dateMoment.year();\n}\nexports.findYearClosestToRef = findYearClosestToRef;\n\n\n//# sourceURL=webpack://chrono-node/./dist/calculation/years.js?");
|
|
42
|
+
|
|
43
|
+
/***/ }),
|
|
44
|
+
|
|
45
|
+
/***/ "./dist/chrono.js":
|
|
46
|
+
/*!************************!*\
|
|
47
|
+
!*** ./dist/chrono.js ***!
|
|
48
|
+
\************************/
|
|
49
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
50
|
+
|
|
51
|
+
"use strict";
|
|
52
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ParsingContext = exports.Chrono = void 0;\nconst results_1 = __webpack_require__(/*! ./results */ \"./dist/results.js\");\nconst en_1 = __webpack_require__(/*! ./locales/en */ \"./dist/locales/en/index.js\");\nclass Chrono {\n constructor(configuration) {\n configuration = configuration || en_1.createCasualConfiguration();\n this.parsers = [...configuration.parsers];\n this.refiners = [...configuration.refiners];\n }\n clone() {\n return new Chrono({\n parsers: [...this.parsers],\n refiners: [...this.refiners],\n });\n }\n parseDate(text, referenceDate, option) {\n const results = this.parse(text, referenceDate, option);\n return results.length > 0 ? results[0].start.date() : null;\n }\n parse(text, referenceDate, option) {\n const context = new ParsingContext(text, referenceDate || new Date(), option || {});\n let results = [];\n this.parsers.forEach((parser) => {\n const parsedResults = Chrono.executeParser(context, parser);\n results = results.concat(parsedResults);\n });\n results.sort((a, b) => {\n return a.index - b.index;\n });\n this.refiners.forEach(function (refiner) {\n results = refiner.refine(context, results);\n });\n return results;\n }\n static executeParser(context, parser) {\n const results = [];\n const pattern = parser.pattern(context);\n const originalText = context.text;\n let remainingText = context.text;\n let match = pattern.exec(remainingText);\n while (match) {\n const index = match.index + originalText.length - remainingText.length;\n match.index = index;\n const result = parser.extract(context, match);\n if (!result) {\n remainingText = originalText.substring(match.index + 1);\n match = pattern.exec(remainingText);\n continue;\n }\n let parsedResult = null;\n if (result instanceof results_1.ParsingResult) {\n parsedResult = result;\n }\n else if (result instanceof results_1.ParsingComponents) {\n parsedResult = context.createParsingResult(match.index, match[0]);\n parsedResult.start = result;\n }\n else {\n parsedResult = context.createParsingResult(match.index, match[0], result);\n }\n context.debug(() => console.log(`${parser.constructor.name} extracted result ${parsedResult}`));\n results.push(parsedResult);\n remainingText = originalText.substring(index + parsedResult.text.length);\n match = pattern.exec(remainingText);\n }\n return results;\n }\n}\nexports.Chrono = Chrono;\nclass ParsingContext {\n constructor(text, refDate, option) {\n this.text = text;\n this.refDate = refDate;\n this.option = option;\n }\n createParsingComponents(components) {\n if (components instanceof results_1.ParsingComponents) {\n return components;\n }\n return new results_1.ParsingComponents(this.refDate, components);\n }\n createParsingResult(index, textOrEndIndex, startComponents, endComponents) {\n const text = typeof textOrEndIndex === \"string\" ? textOrEndIndex : this.text.substring(index, textOrEndIndex);\n const start = startComponents ? this.createParsingComponents(startComponents) : null;\n const end = endComponents ? this.createParsingComponents(endComponents) : null;\n return new results_1.ParsingResult(this.refDate, index, text, start, end);\n }\n debug(block) {\n if (this.option.debug) {\n if (this.option.debug instanceof Function) {\n this.option.debug(block);\n }\n else {\n const handler = this.option.debug;\n handler.debug(block);\n }\n }\n }\n}\nexports.ParsingContext = ParsingContext;\n\n\n//# sourceURL=webpack://chrono-node/./dist/chrono.js?");
|
|
53
|
+
|
|
54
|
+
/***/ }),
|
|
55
|
+
|
|
56
|
+
/***/ "./dist/common/abstractRefiners.js":
|
|
57
|
+
/*!*****************************************!*\
|
|
58
|
+
!*** ./dist/common/abstractRefiners.js ***!
|
|
59
|
+
\*****************************************/
|
|
60
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
61
|
+
|
|
62
|
+
"use strict";
|
|
63
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MergingRefiner = exports.Filter = void 0;\nclass Filter {\n refine(context, results) {\n return results.filter((r) => this.isValid(context, r));\n }\n}\nexports.Filter = Filter;\nclass MergingRefiner {\n refine(context, results) {\n if (results.length < 2) {\n return results;\n }\n const mergedResults = [];\n let curResult = results[0];\n let nextResult = null;\n for (let i = 1; i < results.length; i++) {\n nextResult = results[i];\n const textBetween = context.text.substring(curResult.index + curResult.text.length, nextResult.index);\n if (!this.shouldMergeResults(textBetween, curResult, nextResult, context)) {\n mergedResults.push(curResult);\n curResult = nextResult;\n }\n else {\n const left = curResult;\n const right = nextResult;\n const mergedResult = this.mergeResults(textBetween, left, right, context);\n context.debug(() => {\n console.log(`${this.constructor.name} merged ${left} and ${right} into ${mergedResult}`);\n });\n curResult = mergedResult;\n }\n }\n if (curResult != null) {\n mergedResults.push(curResult);\n }\n return mergedResults;\n }\n}\nexports.MergingRefiner = MergingRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/abstractRefiners.js?");
|
|
64
|
+
|
|
65
|
+
/***/ }),
|
|
66
|
+
|
|
67
|
+
/***/ "./dist/common/casualReferences.js":
|
|
68
|
+
/*!*****************************************!*\
|
|
69
|
+
!*** ./dist/common/casualReferences.js ***!
|
|
70
|
+
\*****************************************/
|
|
71
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
72
|
+
|
|
73
|
+
"use strict";
|
|
74
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.tonight = exports.tomorrow = exports.yesterday = exports.today = exports.now = void 0;\nconst results_1 = __webpack_require__(/*! ../results */ \"./dist/results.js\");\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst dayjs_2 = __webpack_require__(/*! ../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst index_1 = __webpack_require__(/*! ../index */ \"./dist/index.js\");\nfunction now(refDate) {\n const targetDate = dayjs_1.default(refDate);\n const component = new results_1.ParsingComponents(refDate, {});\n dayjs_2.assignSimilarDate(component, targetDate);\n dayjs_2.assignSimilarTime(component, targetDate);\n return component;\n}\nexports.now = now;\nfunction today(refDate) {\n const targetDate = dayjs_1.default(refDate);\n const component = new results_1.ParsingComponents(refDate, {});\n dayjs_2.assignSimilarDate(component, targetDate);\n dayjs_2.implySimilarTime(component, targetDate);\n return component;\n}\nexports.today = today;\nfunction yesterday(refDate) {\n let targetDate = dayjs_1.default(refDate);\n const component = new results_1.ParsingComponents(refDate, {});\n targetDate = targetDate.add(-1, \"day\");\n dayjs_2.assignSimilarDate(component, targetDate);\n dayjs_2.implySimilarTime(component, targetDate);\n return component;\n}\nexports.yesterday = yesterday;\nfunction tomorrow(refDate) {\n const targetDate = dayjs_1.default(refDate);\n const component = new results_1.ParsingComponents(refDate, {});\n dayjs_2.assignTheNextDay(component, targetDate);\n return component;\n}\nexports.tomorrow = tomorrow;\nfunction tonight(refDate, implyHour = 22) {\n const targetDate = dayjs_1.default(refDate);\n const component = new results_1.ParsingComponents(refDate, {});\n component.imply(\"hour\", implyHour);\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n dayjs_2.assignSimilarDate(component, targetDate);\n return component;\n}\nexports.tonight = tonight;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/casualReferences.js?");
|
|
75
|
+
|
|
76
|
+
/***/ }),
|
|
77
|
+
|
|
78
|
+
/***/ "./dist/common/parsers/AbstractParserWithWordBoundary.js":
|
|
79
|
+
/*!***************************************************************!*\
|
|
80
|
+
!*** ./dist/common/parsers/AbstractParserWithWordBoundary.js ***!
|
|
81
|
+
\***************************************************************/
|
|
82
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
83
|
+
|
|
84
|
+
"use strict";
|
|
85
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AbstractParserWithWordBoundaryChecking = void 0;\nclass AbstractParserWithWordBoundaryChecking {\n constructor() {\n this.cachedInnerPattern = null;\n this.cachedPattern = null;\n }\n pattern(context) {\n const innerPattern = this.innerPattern(context);\n if (innerPattern == this.cachedInnerPattern) {\n return this.cachedPattern;\n }\n this.cachedPattern = new RegExp(`(\\\\W|^)${innerPattern.source}`, innerPattern.flags);\n this.cachedInnerPattern = innerPattern;\n return this.cachedPattern;\n }\n extract(context, match) {\n const header = match[1];\n match.index = match.index + header.length;\n match[0] = match[0].substring(header.length);\n for (let i = 2; i < match.length; i++) {\n match[i - 1] = match[i];\n }\n return this.innerExtract(context, match);\n }\n}\nexports.AbstractParserWithWordBoundaryChecking = AbstractParserWithWordBoundaryChecking;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/parsers/AbstractParserWithWordBoundary.js?");
|
|
86
|
+
|
|
87
|
+
/***/ }),
|
|
88
|
+
|
|
89
|
+
/***/ "./dist/common/parsers/AbstractTimeExpressionParser.js":
|
|
90
|
+
/*!*************************************************************!*\
|
|
91
|
+
!*** ./dist/common/parsers/AbstractTimeExpressionParser.js ***!
|
|
92
|
+
\*************************************************************/
|
|
93
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
94
|
+
|
|
95
|
+
"use strict";
|
|
96
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AbstractTimeExpressionParser = void 0;\nconst index_1 = __webpack_require__(/*! ../../index */ \"./dist/index.js\");\nfunction primaryTimePattern(primaryPrefix, primarySuffix) {\n return new RegExp(\"(^|\\\\s|T|\\\\b)\" +\n `${primaryPrefix}` +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)\" +\n \"(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)\" +\n \"(\\\\d{2})\" +\n \"(?:\\\\.(\\\\d{1,6}))?\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(a\\\\.m\\\\.|p\\\\.m\\\\.|am?|pm?))?\" +\n `${primarySuffix}`, \"i\");\n}\nfunction followingTimePatten(followingPhase, followingSuffix) {\n return new RegExp(`^(${followingPhase})` +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)\" +\n \"(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)\" +\n \"(\\\\d{1,2})(?:\\\\.(\\\\d{1,6}))?\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(a\\\\.m\\\\.|p\\\\.m\\\\.|am?|pm?))?\" +\n `${followingSuffix}`, \"i\");\n}\nconst HOUR_GROUP = 2;\nconst MINUTE_GROUP = 3;\nconst SECOND_GROUP = 4;\nconst MILLI_SECOND_GROUP = 5;\nconst AM_PM_HOUR_GROUP = 6;\nclass AbstractTimeExpressionParser {\n constructor(strictMode = false) {\n this.cachedPrimaryPrefix = null;\n this.cachedPrimarySuffix = null;\n this.cachedPrimaryTimePattern = null;\n this.cachedFollowingPhase = null;\n this.cachedFollowingSuffix = null;\n this.cachedFollowingTimePatten = null;\n this.strictMode = strictMode;\n }\n primarySuffix() {\n return \"(?=\\\\W|$)\";\n }\n followingSuffix() {\n return \"(?=\\\\W|$)\";\n }\n pattern(context) {\n return this.getPrimaryTimePatternThroughCache();\n }\n extract(context, match) {\n const startComponents = this.extractPrimaryTimeComponents(context, match);\n if (!startComponents) {\n match.index += match[0].length;\n return null;\n }\n const index = match.index + match[1].length;\n const text = match[0].substring(match[1].length);\n const result = context.createParsingResult(index, text, startComponents);\n match.index += match[0].length;\n const remainingText = context.text.substring(match.index);\n const followingPattern = this.getFollowingTimePatternThroughCache();\n const followingMatch = followingPattern.exec(remainingText);\n if (!followingMatch ||\n followingMatch[0].match(/^\\s*([+-])\\s*\\d{3,4}$/)) {\n return this.checkAndReturnWithoutFollowingPattern(result);\n }\n result.end = this.extractFollowingTimeComponents(context, followingMatch, result);\n if (result.end) {\n result.text += followingMatch[0];\n }\n return this.checkAndReturnWithFollowingPattern(result);\n }\n extractPrimaryTimeComponents(context, match, strict = false) {\n const components = context.createParsingComponents();\n let minute = 0;\n let meridiem = null;\n let hour = parseInt(match[HOUR_GROUP]);\n if (hour > 100) {\n if (this.strictMode || match[MINUTE_GROUP] != null) {\n return null;\n }\n minute = hour % 100;\n hour = Math.floor(hour / 100);\n }\n if (hour > 24) {\n return null;\n }\n if (match[MINUTE_GROUP] != null) {\n if (match[MINUTE_GROUP].length == 1 && !match[AM_PM_HOUR_GROUP]) {\n return null;\n }\n minute = parseInt(match[MINUTE_GROUP]);\n }\n if (minute >= 60) {\n return null;\n }\n if (hour > 12) {\n meridiem = index_1.Meridiem.PM;\n }\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12)\n return null;\n const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = index_1.Meridiem.AM;\n if (hour == 12) {\n hour = 0;\n }\n }\n if (ampm == \"p\") {\n meridiem = index_1.Meridiem.PM;\n if (hour != 12) {\n hour += 12;\n }\n }\n }\n components.assign(\"hour\", hour);\n components.assign(\"minute\", minute);\n if (meridiem !== null) {\n components.assign(\"meridiem\", meridiem);\n }\n else {\n if (hour < 12) {\n components.imply(\"meridiem\", index_1.Meridiem.AM);\n }\n else {\n components.imply(\"meridiem\", index_1.Meridiem.PM);\n }\n }\n if (match[MILLI_SECOND_GROUP] != null) {\n const millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if (millisecond >= 1000)\n return null;\n components.assign(\"millisecond\", millisecond);\n }\n if (match[SECOND_GROUP] != null) {\n const second = parseInt(match[SECOND_GROUP]);\n if (second >= 60)\n return null;\n components.assign(\"second\", second);\n }\n return components;\n }\n extractFollowingTimeComponents(context, match, result) {\n const components = context.createParsingComponents();\n if (match[MILLI_SECOND_GROUP] != null) {\n const millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if (millisecond >= 1000)\n return null;\n components.assign(\"millisecond\", millisecond);\n }\n if (match[SECOND_GROUP] != null) {\n const second = parseInt(match[SECOND_GROUP]);\n if (second >= 60)\n return null;\n components.assign(\"second\", second);\n }\n let hour = parseInt(match[HOUR_GROUP]);\n let minute = 0;\n let meridiem = -1;\n if (match[MINUTE_GROUP] != null) {\n minute = parseInt(match[MINUTE_GROUP]);\n }\n else if (hour > 100) {\n minute = hour % 100;\n hour = Math.floor(hour / 100);\n }\n if (minute >= 60 || hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = index_1.Meridiem.PM;\n }\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) {\n return null;\n }\n const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = index_1.Meridiem.AM;\n if (hour == 12) {\n hour = 0;\n if (!components.isCertain(\"day\")) {\n components.imply(\"day\", components.get(\"day\") + 1);\n }\n }\n }\n if (ampm == \"p\") {\n meridiem = index_1.Meridiem.PM;\n if (hour != 12)\n hour += 12;\n }\n if (!result.start.isCertain(\"meridiem\")) {\n if (meridiem == index_1.Meridiem.AM) {\n result.start.imply(\"meridiem\", index_1.Meridiem.AM);\n if (result.start.get(\"hour\") == 12) {\n result.start.assign(\"hour\", 0);\n }\n }\n else {\n result.start.imply(\"meridiem\", index_1.Meridiem.PM);\n if (result.start.get(\"hour\") != 12) {\n result.start.assign(\"hour\", result.start.get(\"hour\") + 12);\n }\n }\n }\n }\n components.assign(\"hour\", hour);\n components.assign(\"minute\", minute);\n if (meridiem >= 0) {\n components.assign(\"meridiem\", meridiem);\n }\n else {\n const startAtPM = result.start.isCertain(\"meridiem\") && result.start.get(\"hour\") > 12;\n if (startAtPM) {\n if (result.start.get(\"hour\") - 12 > hour) {\n components.imply(\"meridiem\", index_1.Meridiem.AM);\n }\n else if (hour <= 12) {\n components.assign(\"hour\", hour + 12);\n components.assign(\"meridiem\", index_1.Meridiem.PM);\n }\n }\n else if (hour > 12) {\n components.imply(\"meridiem\", index_1.Meridiem.PM);\n }\n else if (hour <= 12) {\n components.imply(\"meridiem\", index_1.Meridiem.AM);\n }\n }\n if (components.date().getTime() < result.start.date().getTime()) {\n components.imply(\"day\", components.get(\"day\") + 1);\n }\n return components;\n }\n checkAndReturnWithoutFollowingPattern(result) {\n if (result.text.match(/^\\d$/)) {\n return null;\n }\n if (result.text.match(/\\d[apAP]$/)) {\n return null;\n }\n const endingWithNumbers = result.text.match(/[^\\d:.](\\d[\\d.]+)$/);\n if (endingWithNumbers) {\n const endingNumbers = endingWithNumbers[1];\n if (this.strictMode) {\n return null;\n }\n if (endingNumbers.includes(\".\") && !endingNumbers.match(/\\d(\\.\\d{2})+$/)) {\n return null;\n }\n const endingNumberVal = parseInt(endingNumbers);\n if (endingNumberVal > 24) {\n return null;\n }\n }\n return result;\n }\n checkAndReturnWithFollowingPattern(result) {\n if (result.text.match(/^\\d+-\\d+$/)) {\n return null;\n }\n const endingWithNumbers = result.text.match(/[^\\d:.](\\d[\\d.]+)\\s*-\\s*(\\d[\\d.]+)$/);\n if (endingWithNumbers) {\n if (this.strictMode) {\n return null;\n }\n const startingNumbers = endingWithNumbers[1];\n const endingNumbers = endingWithNumbers[2];\n if (endingNumbers.includes(\".\") && !endingNumbers.match(/\\d(\\.\\d{2})+$/)) {\n return null;\n }\n const endingNumberVal = parseInt(endingNumbers);\n const startingNumberVal = parseInt(startingNumbers);\n if (endingNumberVal > 24 || startingNumberVal > 24) {\n return null;\n }\n }\n return result;\n }\n getPrimaryTimePatternThroughCache() {\n const primaryPrefix = this.primaryPrefix();\n const primarySuffix = this.primarySuffix();\n if (this.cachedPrimaryPrefix === primaryPrefix && this.cachedPrimarySuffix === primarySuffix) {\n return this.cachedPrimaryTimePattern;\n }\n this.cachedPrimaryTimePattern = primaryTimePattern(primaryPrefix, primarySuffix);\n this.cachedPrimaryPrefix = primaryPrefix;\n this.cachedPrimarySuffix = primarySuffix;\n return this.cachedPrimaryTimePattern;\n }\n getFollowingTimePatternThroughCache() {\n const followingPhase = this.followingPhase();\n const followingSuffix = this.followingSuffix();\n if (this.cachedFollowingPhase === followingPhase && this.cachedFollowingSuffix === followingSuffix) {\n return this.cachedFollowingTimePatten;\n }\n this.cachedFollowingTimePatten = followingTimePatten(followingPhase, followingSuffix);\n this.cachedFollowingPhase = followingPhase;\n this.cachedFollowingSuffix = followingSuffix;\n return this.cachedFollowingTimePatten;\n }\n}\nexports.AbstractTimeExpressionParser = AbstractTimeExpressionParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/parsers/AbstractTimeExpressionParser.js?");
|
|
97
|
+
|
|
98
|
+
/***/ }),
|
|
99
|
+
|
|
100
|
+
/***/ "./dist/common/parsers/ISOFormatParser.js":
|
|
101
|
+
/*!************************************************!*\
|
|
102
|
+
!*** ./dist/common/parsers/ISOFormatParser.js ***!
|
|
103
|
+
\************************************************/
|
|
104
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
105
|
+
|
|
106
|
+
"use strict";
|
|
107
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ./AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(\"([0-9]{4})\\\\-([0-9]{1,2})\\\\-([0-9]{1,2})\" +\n \"(?:T\" +\n \"([0-9]{1,2}):([0-9]{1,2})\" +\n \"(?:\" +\n \":([0-9]{1,2})(?:\\\\.(\\\\d{1,4}))?\" +\n \")?\" +\n \"(?:\" +\n \"Z|([+-]\\\\d{2}):?(\\\\d{2})?\" +\n \")?\" +\n \")?\" +\n \"(?=\\\\W|$)\", \"i\");\nconst YEAR_NUMBER_GROUP = 1;\nconst MONTH_NUMBER_GROUP = 2;\nconst DATE_NUMBER_GROUP = 3;\nconst HOUR_NUMBER_GROUP = 4;\nconst MINUTE_NUMBER_GROUP = 5;\nconst SECOND_NUMBER_GROUP = 6;\nconst MILLISECOND_NUMBER_GROUP = 7;\nconst TZD_HOUR_OFFSET_GROUP = 8;\nconst TZD_MINUTE_OFFSET_GROUP = 9;\nclass ISOFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const components = {};\n components[\"year\"] = parseInt(match[YEAR_NUMBER_GROUP]);\n components[\"month\"] = parseInt(match[MONTH_NUMBER_GROUP]);\n components[\"day\"] = parseInt(match[DATE_NUMBER_GROUP]);\n if (match[HOUR_NUMBER_GROUP] != null) {\n components[\"hour\"] = parseInt(match[HOUR_NUMBER_GROUP]);\n components[\"minute\"] = parseInt(match[MINUTE_NUMBER_GROUP]);\n if (match[SECOND_NUMBER_GROUP] != null) {\n components[\"second\"] = parseInt(match[SECOND_NUMBER_GROUP]);\n }\n if (match[MILLISECOND_NUMBER_GROUP] != null) {\n components[\"millisecond\"] = parseInt(match[MILLISECOND_NUMBER_GROUP]);\n }\n if (match[TZD_HOUR_OFFSET_GROUP] == null) {\n components[\"timezoneOffset\"] = 0;\n }\n else {\n const hourOffset = parseInt(match[TZD_HOUR_OFFSET_GROUP]);\n let minuteOffset = 0;\n if (match[TZD_MINUTE_OFFSET_GROUP] != null) {\n minuteOffset = parseInt(match[TZD_MINUTE_OFFSET_GROUP]);\n }\n let offset = hourOffset * 60;\n if (offset < 0) {\n offset -= minuteOffset;\n }\n else {\n offset += minuteOffset;\n }\n components[\"timezoneOffset\"] = offset;\n }\n }\n return components;\n }\n}\nexports.default = ISOFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/parsers/ISOFormatParser.js?");
|
|
108
|
+
|
|
109
|
+
/***/ }),
|
|
110
|
+
|
|
111
|
+
/***/ "./dist/common/parsers/SlashDateFormatParser.js":
|
|
112
|
+
/*!******************************************************!*\
|
|
113
|
+
!*** ./dist/common/parsers/SlashDateFormatParser.js ***!
|
|
114
|
+
\******************************************************/
|
|
115
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
116
|
+
|
|
117
|
+
"use strict";
|
|
118
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst years_1 = __webpack_require__(/*! ../../calculation/years */ \"./dist/calculation/years.js\");\nconst PATTERN = new RegExp(\"([^\\\\d]|^)\" +\n \"([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})\" +\n \"(?:[\\\\/\\\\.\\\\-]([0-9]{4}|[0-9]{2}))?\" +\n \"(\\\\W|$)\", \"i\");\nconst OPENING_GROUP = 1;\nconst ENDING_GROUP = 5;\nconst FIRST_NUMBERS_GROUP = 2;\nconst SECOND_NUMBERS_GROUP = 3;\nconst YEAR_GROUP = 4;\nclass SlashDateFormatParser {\n constructor(littleEndian) {\n this.groupNumberMonth = littleEndian ? SECOND_NUMBERS_GROUP : FIRST_NUMBERS_GROUP;\n this.groupNumberDay = littleEndian ? FIRST_NUMBERS_GROUP : SECOND_NUMBERS_GROUP;\n }\n pattern() {\n return PATTERN;\n }\n extract(context, match) {\n if (match[OPENING_GROUP] == \"/\" || match[ENDING_GROUP] == \"/\") {\n match.index += match[0].length;\n return;\n }\n const index = match.index + match[OPENING_GROUP].length;\n const text = match[0].substr(match[OPENING_GROUP].length, match[0].length - match[OPENING_GROUP].length - match[ENDING_GROUP].length);\n if (text.match(/^\\d\\.\\d$/) || text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}\\s*$/)) {\n return;\n }\n if (!match[YEAR_GROUP] && match[0].indexOf(\"/\") < 0) {\n return;\n }\n const result = context.createParsingResult(index, text);\n let month = parseInt(match[this.groupNumberMonth]);\n let day = parseInt(match[this.groupNumberDay]);\n if (month < 1 || month > 12) {\n if (month > 12) {\n if (day >= 1 && day <= 12 && month <= 31) {\n [day, month] = [month, day];\n }\n else {\n return null;\n }\n }\n }\n if (day < 1 || day > 31) {\n return null;\n }\n result.start.assign(\"day\", day);\n result.start.assign(\"month\", month);\n if (match[YEAR_GROUP]) {\n const rawYearNumber = parseInt(match[YEAR_GROUP]);\n const year = years_1.findMostLikelyADYear(rawYearNumber);\n result.start.assign(\"year\", year);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, day, month);\n result.start.imply(\"year\", year);\n }\n return result;\n }\n}\nexports.default = SlashDateFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/parsers/SlashDateFormatParser.js?");
|
|
119
|
+
|
|
120
|
+
/***/ }),
|
|
121
|
+
|
|
122
|
+
/***/ "./dist/common/refiners/AbstractMergeDateRangeRefiner.js":
|
|
123
|
+
/*!***************************************************************!*\
|
|
124
|
+
!*** ./dist/common/refiners/AbstractMergeDateRangeRefiner.js ***!
|
|
125
|
+
\***************************************************************/
|
|
126
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
127
|
+
|
|
128
|
+
"use strict";
|
|
129
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst abstractRefiners_1 = __webpack_require__(/*! ../abstractRefiners */ \"./dist/common/abstractRefiners.js\");\nclass AbstractMergeDateRangeRefiner extends abstractRefiners_1.MergingRefiner {\n shouldMergeResults(textBetween, currentResult, nextResult) {\n return !currentResult.end && !nextResult.end && textBetween.match(this.patternBetween()) != null;\n }\n mergeResults(textBetween, fromResult, toResult) {\n if (!fromResult.start.isOnlyWeekdayComponent() && !toResult.start.isOnlyWeekdayComponent()) {\n toResult.start.getCertainComponents().forEach((key) => {\n if (!fromResult.start.isCertain(key)) {\n fromResult.start.assign(key, toResult.start.get(key));\n }\n });\n fromResult.start.getCertainComponents().forEach((key) => {\n if (!toResult.start.isCertain(key)) {\n toResult.start.assign(key, fromResult.start.get(key));\n }\n });\n }\n if (fromResult.start.date().getTime() > toResult.start.date().getTime()) {\n let fromMoment = fromResult.start.dayjs();\n let toMoment = toResult.start.dayjs();\n if (fromResult.start.isOnlyWeekdayComponent() && fromMoment.add(-7, \"days\").isBefore(toMoment)) {\n fromMoment = fromMoment.add(-7, \"days\");\n fromResult.start.imply(\"day\", fromMoment.date());\n fromResult.start.imply(\"month\", fromMoment.month() + 1);\n fromResult.start.imply(\"year\", fromMoment.year());\n }\n else if (toResult.start.isOnlyWeekdayComponent() && toMoment.add(7, \"days\").isAfter(fromMoment)) {\n toMoment = toMoment.add(7, \"days\");\n toResult.start.imply(\"day\", toMoment.date());\n toResult.start.imply(\"month\", toMoment.month() + 1);\n toResult.start.imply(\"year\", toMoment.year());\n }\n else {\n [toResult, fromResult] = [fromResult, toResult];\n }\n }\n const result = fromResult.clone();\n result.start = fromResult.start;\n result.end = toResult.start;\n result.index = Math.min(fromResult.index, toResult.index);\n if (fromResult.index < toResult.index) {\n result.text = fromResult.text + textBetween + toResult.text;\n }\n else {\n result.text = toResult.text + textBetween + fromResult.text;\n }\n return result;\n }\n}\nexports.default = AbstractMergeDateRangeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/refiners/AbstractMergeDateRangeRefiner.js?");
|
|
130
|
+
|
|
131
|
+
/***/ }),
|
|
132
|
+
|
|
133
|
+
/***/ "./dist/common/refiners/AbstractMergeDateTimeRefiner.js":
|
|
134
|
+
/*!**************************************************************!*\
|
|
135
|
+
!*** ./dist/common/refiners/AbstractMergeDateTimeRefiner.js ***!
|
|
136
|
+
\**************************************************************/
|
|
137
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
138
|
+
|
|
139
|
+
"use strict";
|
|
140
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst abstractRefiners_1 = __webpack_require__(/*! ../abstractRefiners */ \"./dist/common/abstractRefiners.js\");\nconst mergingCalculation_1 = __webpack_require__(/*! ../../calculation/mergingCalculation */ \"./dist/calculation/mergingCalculation.js\");\nclass ENMergeDateTimeRefiner extends abstractRefiners_1.MergingRefiner {\n shouldMergeResults(textBetween, currentResult, nextResult) {\n return (((currentResult.start.isOnlyDate() && nextResult.start.isOnlyTime()) ||\n (nextResult.start.isOnlyDate() && currentResult.start.isOnlyTime())) &&\n textBetween.match(this.patternBetween()) != null);\n }\n mergeResults(textBetween, currentResult, nextResult) {\n const result = currentResult.start.isOnlyDate()\n ? mergingCalculation_1.mergeDateTimeResult(currentResult, nextResult)\n : mergingCalculation_1.mergeDateTimeResult(nextResult, currentResult);\n result.index = currentResult.index;\n result.text = currentResult.text + textBetween + nextResult.text;\n return result;\n }\n}\nexports.default = ENMergeDateTimeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/refiners/AbstractMergeDateTimeRefiner.js?");
|
|
141
|
+
|
|
142
|
+
/***/ }),
|
|
143
|
+
|
|
144
|
+
/***/ "./dist/common/refiners/ExtractTimezoneAbbrRefiner.js":
|
|
145
|
+
/*!************************************************************!*\
|
|
146
|
+
!*** ./dist/common/refiners/ExtractTimezoneAbbrRefiner.js ***!
|
|
147
|
+
\************************************************************/
|
|
148
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
149
|
+
|
|
150
|
+
"use strict";
|
|
151
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst TIMEZONE_NAME_PATTERN = new RegExp(\"^\\\\s*,?\\\\s*\\\\(?([A-Z]{2,4})\\\\)?(?=\\\\W|$)\", \"i\");\nconst DEFAULT_TIMEZONE_ABBR_MAP = {\n ACDT: 630,\n ACST: 570,\n ADT: -180,\n AEDT: 660,\n AEST: 600,\n AFT: 270,\n AKDT: -480,\n AKST: -540,\n ALMT: 360,\n AMST: -180,\n AMT: -240,\n ANAST: 720,\n ANAT: 720,\n AQTT: 300,\n ART: -180,\n AST: -240,\n AWDT: 540,\n AWST: 480,\n AZOST: 0,\n AZOT: -60,\n AZST: 300,\n AZT: 240,\n BNT: 480,\n BOT: -240,\n BRST: -120,\n BRT: -180,\n BST: 60,\n BTT: 360,\n CAST: 480,\n CAT: 120,\n CCT: 390,\n CDT: -300,\n CEST: 120,\n CET: 60,\n CHADT: 825,\n CHAST: 765,\n CKT: -600,\n CLST: -180,\n CLT: -240,\n COT: -300,\n CST: -360,\n CVT: -60,\n CXT: 420,\n ChST: 600,\n DAVT: 420,\n EASST: -300,\n EAST: -360,\n EAT: 180,\n ECT: -300,\n EDT: -240,\n EEST: 180,\n EET: 120,\n EGST: 0,\n EGT: -60,\n EST: -300,\n ET: -300,\n FJST: 780,\n FJT: 720,\n FKST: -180,\n FKT: -240,\n FNT: -120,\n GALT: -360,\n GAMT: -540,\n GET: 240,\n GFT: -180,\n GILT: 720,\n GMT: 0,\n GST: 240,\n GYT: -240,\n HAA: -180,\n HAC: -300,\n HADT: -540,\n HAE: -240,\n HAP: -420,\n HAR: -360,\n HAST: -600,\n HAT: -90,\n HAY: -480,\n HKT: 480,\n HLV: -210,\n HNA: -240,\n HNC: -360,\n HNE: -300,\n HNP: -480,\n HNR: -420,\n HNT: -150,\n HNY: -540,\n HOVT: 420,\n ICT: 420,\n IDT: 180,\n IOT: 360,\n IRDT: 270,\n IRKST: 540,\n IRKT: 540,\n IRST: 210,\n IST: 330,\n JST: 540,\n KGT: 360,\n KRAST: 480,\n KRAT: 480,\n KST: 540,\n KUYT: 240,\n LHDT: 660,\n LHST: 630,\n LINT: 840,\n MAGST: 720,\n MAGT: 720,\n MART: -510,\n MAWT: 300,\n MDT: -360,\n MESZ: 120,\n MEZ: 60,\n MHT: 720,\n MMT: 390,\n MSD: 240,\n MSK: 240,\n MST: -420,\n MUT: 240,\n MVT: 300,\n MYT: 480,\n NCT: 660,\n NDT: -90,\n NFT: 690,\n NOVST: 420,\n NOVT: 360,\n NPT: 345,\n NST: -150,\n NUT: -660,\n NZDT: 780,\n NZST: 720,\n OMSST: 420,\n OMST: 420,\n PDT: -420,\n PET: -300,\n PETST: 720,\n PETT: 720,\n PGT: 600,\n PHOT: 780,\n PHT: 480,\n PKT: 300,\n PMDT: -120,\n PMST: -180,\n PONT: 660,\n PST: -480,\n PT: -480,\n PWT: 540,\n PYST: -180,\n PYT: -240,\n RET: 240,\n SAMT: 240,\n SAST: 120,\n SBT: 660,\n SCT: 240,\n SGT: 480,\n SRT: -180,\n SST: -660,\n TAHT: -600,\n TFT: 300,\n TJT: 300,\n TKT: 780,\n TLT: 540,\n TMT: 300,\n TVT: 720,\n ULAT: 480,\n UTC: 0,\n UYST: -120,\n UYT: -180,\n UZT: 300,\n VET: -210,\n VLAST: 660,\n VLAT: 660,\n VUT: 660,\n WAST: 120,\n WAT: 60,\n WEST: 60,\n WESZ: 60,\n WET: 0,\n WEZ: 0,\n WFT: 720,\n WGST: -120,\n WGT: -180,\n WIB: 420,\n WIT: 540,\n WITA: 480,\n WST: 780,\n WT: 0,\n YAKST: 600,\n YAKT: 600,\n YAPT: 600,\n YEKST: 360,\n YEKT: 360,\n};\nclass ExtractTimezoneAbbrRefiner {\n constructor(timezoneOverrides) {\n this.timezone = Object.assign(Object.assign({}, DEFAULT_TIMEZONE_ABBR_MAP), timezoneOverrides);\n }\n refine(context, results) {\n var _a;\n const timezoneOverrides = (_a = context.option.timezones) !== null && _a !== void 0 ? _a : {};\n results.forEach((result) => {\n var _a, _b;\n const suffix = context.text.substring(result.index + result.text.length);\n const match = TIMEZONE_NAME_PATTERN.exec(suffix);\n if (!match) {\n return;\n }\n const timezoneAbbr = match[1].toUpperCase();\n const extractedTimezoneOffset = (_b = (_a = timezoneOverrides[timezoneAbbr]) !== null && _a !== void 0 ? _a : this.timezone[timezoneAbbr]) !== null && _b !== void 0 ? _b : null;\n if (extractedTimezoneOffset === null) {\n return;\n }\n context.debug(() => {\n console.log(`Extracting timezone: '${timezoneAbbr}' into : ${extractedTimezoneOffset}`);\n });\n const currentTimezoneOffset = result.start.get(\"timezoneOffset\");\n if (currentTimezoneOffset !== null && extractedTimezoneOffset != currentTimezoneOffset) {\n if (result.start.isCertain(\"timezoneOffset\")) {\n return;\n }\n if (timezoneAbbr != match[1]) {\n return;\n }\n }\n result.text += match[0];\n if (!result.start.isCertain(\"timezoneOffset\")) {\n result.start.assign(\"timezoneOffset\", extractedTimezoneOffset);\n }\n if (result.end != null && !result.end.isCertain(\"timezoneOffset\")) {\n result.end.assign(\"timezoneOffset\", extractedTimezoneOffset);\n }\n });\n return results;\n }\n}\nexports.default = ExtractTimezoneAbbrRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/refiners/ExtractTimezoneAbbrRefiner.js?");
|
|
152
|
+
|
|
153
|
+
/***/ }),
|
|
154
|
+
|
|
155
|
+
/***/ "./dist/common/refiners/ExtractTimezoneOffsetRefiner.js":
|
|
156
|
+
/*!**************************************************************!*\
|
|
157
|
+
!*** ./dist/common/refiners/ExtractTimezoneOffsetRefiner.js ***!
|
|
158
|
+
\**************************************************************/
|
|
159
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
160
|
+
|
|
161
|
+
"use strict";
|
|
162
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst TIMEZONE_OFFSET_PATTERN = new RegExp(\"^\\\\s*(?:(?:GMT|UTC)\\\\s?)?([+-])(\\\\d{1,2})(?::?(\\\\d{2}))?\", \"i\");\nconst TIMEZONE_OFFSET_SIGN_GROUP = 1;\nconst TIMEZONE_OFFSET_HOUR_OFFSET_GROUP = 2;\nconst TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP = 3;\nclass ExtractTimezoneOffsetRefiner {\n refine(context, results) {\n results.forEach(function (result) {\n if (result.start.isCertain(\"timezoneOffset\")) {\n return;\n }\n const suffix = context.text.substring(result.index + result.text.length);\n const match = TIMEZONE_OFFSET_PATTERN.exec(suffix);\n if (!match) {\n return;\n }\n context.debug(() => {\n console.log(`Extracting timezone: '${match[0]}' into : ${result}`);\n });\n const hourOffset = parseInt(match[TIMEZONE_OFFSET_HOUR_OFFSET_GROUP]);\n const minuteOffset = parseInt(match[TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP] || \"0\");\n let timezoneOffset = hourOffset * 60 + minuteOffset;\n if (match[TIMEZONE_OFFSET_SIGN_GROUP] === \"-\") {\n timezoneOffset = -timezoneOffset;\n }\n if (result.end != null) {\n result.end.assign(\"timezoneOffset\", timezoneOffset);\n }\n result.start.assign(\"timezoneOffset\", timezoneOffset);\n result.text += match[0];\n });\n return results;\n }\n}\nexports.default = ExtractTimezoneOffsetRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/refiners/ExtractTimezoneOffsetRefiner.js?");
|
|
163
|
+
|
|
164
|
+
/***/ }),
|
|
165
|
+
|
|
166
|
+
/***/ "./dist/common/refiners/ForwardDateRefiner.js":
|
|
167
|
+
/*!****************************************************!*\
|
|
168
|
+
!*** ./dist/common/refiners/ForwardDateRefiner.js ***!
|
|
169
|
+
\****************************************************/
|
|
170
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
171
|
+
|
|
172
|
+
"use strict";
|
|
173
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nclass ForwardDateRefiner {\n refine(context, results) {\n if (!context.option.forwardDate) {\n return results;\n }\n results.forEach(function (result) {\n let refMoment = dayjs_1.default(context.refDate);\n if (result.start.isOnlyDayMonthComponent() && refMoment.isAfter(result.start.dayjs())) {\n for (let i = 0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) {\n result.start.imply(\"year\", result.start.get(\"year\") + 1);\n context.debug(() => {\n console.log(`Forward yearly adjusted for ${result} (${result.start})`);\n });\n if (result.end && !result.end.isCertain(\"year\")) {\n result.end.imply(\"year\", result.end.get(\"year\") + 1);\n context.debug(() => {\n console.log(`Forward yearly adjusted for ${result} (${result.end})`);\n });\n }\n }\n }\n if (result.start.isOnlyWeekdayComponent() && refMoment.isAfter(result.start.dayjs())) {\n if (refMoment.day() > result.start.get(\"weekday\")) {\n refMoment = refMoment.day(result.start.get(\"weekday\") + 7);\n }\n else {\n refMoment = refMoment.day(result.start.get(\"weekday\"));\n }\n result.start.imply(\"day\", refMoment.date());\n result.start.imply(\"month\", refMoment.month() + 1);\n result.start.imply(\"year\", refMoment.year());\n context.debug(() => {\n console.log(`Forward weekly adjusted for ${result} (${result.start})`);\n });\n if (result.end && result.end.isOnlyWeekdayComponent()) {\n if (refMoment.day() > result.end.get(\"weekday\")) {\n refMoment = refMoment.day(result.end.get(\"weekday\") + 7);\n }\n else {\n refMoment = refMoment.day(result.end.get(\"weekday\"));\n }\n result.end.imply(\"day\", refMoment.date());\n result.end.imply(\"month\", refMoment.month() + 1);\n result.end.imply(\"year\", refMoment.year());\n context.debug(() => {\n console.log(`Forward weekly adjusted for ${result} (${result.end})`);\n });\n }\n }\n });\n return results;\n }\n}\nexports.default = ForwardDateRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/refiners/ForwardDateRefiner.js?");
|
|
174
|
+
|
|
175
|
+
/***/ }),
|
|
176
|
+
|
|
177
|
+
/***/ "./dist/common/refiners/MergeWeekdayComponentRefiner.js":
|
|
178
|
+
/*!**************************************************************!*\
|
|
179
|
+
!*** ./dist/common/refiners/MergeWeekdayComponentRefiner.js ***!
|
|
180
|
+
\**************************************************************/
|
|
181
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
182
|
+
|
|
183
|
+
"use strict";
|
|
184
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst abstractRefiners_1 = __webpack_require__(/*! ../abstractRefiners */ \"./dist/common/abstractRefiners.js\");\nclass MergeWeekdayComponentRefiner extends abstractRefiners_1.MergingRefiner {\n mergeResults(textBetween, currentResult, nextResult) {\n const newResult = nextResult.clone();\n newResult.index = currentResult.index;\n newResult.text = currentResult.text + textBetween + newResult.text;\n newResult.start.assign(\"weekday\", currentResult.start.get(\"weekday\"));\n if (newResult.end) {\n newResult.end.assign(\"weekday\", currentResult.start.get(\"weekday\"));\n }\n return newResult;\n }\n shouldMergeResults(textBetween, currentResult, nextResult) {\n const weekdayThenNormalDate = currentResult.start.isOnlyWeekdayComponent() &&\n !currentResult.start.isCertain(\"hour\") &&\n nextResult.start.isCertain(\"day\");\n return weekdayThenNormalDate && textBetween.match(/^,?\\s*$/) != null;\n }\n}\nexports.default = MergeWeekdayComponentRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/refiners/MergeWeekdayComponentRefiner.js?");
|
|
185
|
+
|
|
186
|
+
/***/ }),
|
|
187
|
+
|
|
188
|
+
/***/ "./dist/common/refiners/OverlapRemovalRefiner.js":
|
|
189
|
+
/*!*******************************************************!*\
|
|
190
|
+
!*** ./dist/common/refiners/OverlapRemovalRefiner.js ***!
|
|
191
|
+
\*******************************************************/
|
|
192
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
193
|
+
|
|
194
|
+
"use strict";
|
|
195
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nclass OverlapRemovalRefiner {\n refine(context, results) {\n if (results.length < 2) {\n return results;\n }\n const filteredResults = [];\n let prevResult = results[0];\n for (let i = 1; i < results.length; i++) {\n const result = results[i];\n if (result.index < prevResult.index + prevResult.text.length) {\n if (result.text.length > prevResult.text.length) {\n prevResult = result;\n }\n }\n else {\n filteredResults.push(prevResult);\n prevResult = result;\n }\n }\n if (prevResult != null) {\n filteredResults.push(prevResult);\n }\n return filteredResults;\n }\n}\nexports.default = OverlapRemovalRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/refiners/OverlapRemovalRefiner.js?");
|
|
196
|
+
|
|
197
|
+
/***/ }),
|
|
198
|
+
|
|
199
|
+
/***/ "./dist/common/refiners/UnlikelyFormatFilter.js":
|
|
200
|
+
/*!******************************************************!*\
|
|
201
|
+
!*** ./dist/common/refiners/UnlikelyFormatFilter.js ***!
|
|
202
|
+
\******************************************************/
|
|
203
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
204
|
+
|
|
205
|
+
"use strict";
|
|
206
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst abstractRefiners_1 = __webpack_require__(/*! ../abstractRefiners */ \"./dist/common/abstractRefiners.js\");\nclass UnlikelyFormatFilter extends abstractRefiners_1.Filter {\n constructor(strictMode) {\n super();\n this.strictMode = strictMode;\n }\n isValid(context, result) {\n if (result.text.replace(\" \", \"\").match(/^\\d*(\\.\\d*)?$/)) {\n context.debug(() => {\n console.log(`Removing unlikely result '${result.text}'`);\n });\n return false;\n }\n if (!result.start.isValidDate()) {\n context.debug(() => {\n console.log(`Removing invalid result: ${result} (${result.start})`);\n });\n return false;\n }\n if (result.end && !result.end.isValidDate()) {\n context.debug(() => {\n console.log(`Removing invalid result: ${result} (${result.end})`);\n });\n return false;\n }\n if (this.strictMode) {\n return this.isStrictModeValid(context, result);\n }\n return true;\n }\n isStrictModeValid(context, result) {\n if (result.start.isOnlyWeekdayComponent()) {\n context.debug(() => {\n console.log(`(Strict) Removing weekday only component: ${result} (${result.end})`);\n });\n return false;\n }\n if (result.start.isOnlyTime() && (!result.start.isCertain(\"hour\") || !result.start.isCertain(\"minute\"))) {\n context.debug(() => {\n console.log(`(Strict) Removing uncertain time component: ${result} (${result.end})`);\n });\n return false;\n }\n return true;\n }\n}\nexports.default = UnlikelyFormatFilter;\n\n\n//# sourceURL=webpack://chrono-node/./dist/common/refiners/UnlikelyFormatFilter.js?");
|
|
207
|
+
|
|
208
|
+
/***/ }),
|
|
209
|
+
|
|
210
|
+
/***/ "./dist/configurations.js":
|
|
211
|
+
/*!********************************!*\
|
|
212
|
+
!*** ./dist/configurations.js ***!
|
|
213
|
+
\********************************/
|
|
214
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
215
|
+
|
|
216
|
+
"use strict";
|
|
217
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.includeCommonConfiguration = void 0;\nconst ExtractTimezoneAbbrRefiner_1 = __importDefault(__webpack_require__(/*! ./common/refiners/ExtractTimezoneAbbrRefiner */ \"./dist/common/refiners/ExtractTimezoneAbbrRefiner.js\"));\nconst ExtractTimezoneOffsetRefiner_1 = __importDefault(__webpack_require__(/*! ./common/refiners/ExtractTimezoneOffsetRefiner */ \"./dist/common/refiners/ExtractTimezoneOffsetRefiner.js\"));\nconst OverlapRemovalRefiner_1 = __importDefault(__webpack_require__(/*! ./common/refiners/OverlapRemovalRefiner */ \"./dist/common/refiners/OverlapRemovalRefiner.js\"));\nconst ForwardDateRefiner_1 = __importDefault(__webpack_require__(/*! ./common/refiners/ForwardDateRefiner */ \"./dist/common/refiners/ForwardDateRefiner.js\"));\nconst UnlikelyFormatFilter_1 = __importDefault(__webpack_require__(/*! ./common/refiners/UnlikelyFormatFilter */ \"./dist/common/refiners/UnlikelyFormatFilter.js\"));\nconst ISOFormatParser_1 = __importDefault(__webpack_require__(/*! ./common/parsers/ISOFormatParser */ \"./dist/common/parsers/ISOFormatParser.js\"));\nconst MergeWeekdayComponentRefiner_1 = __importDefault(__webpack_require__(/*! ./common/refiners/MergeWeekdayComponentRefiner */ \"./dist/common/refiners/MergeWeekdayComponentRefiner.js\"));\nfunction includeCommonConfiguration(configuration, strictMode = false) {\n configuration.parsers.unshift(new ISOFormatParser_1.default());\n configuration.refiners.unshift(new MergeWeekdayComponentRefiner_1.default());\n configuration.refiners.unshift(new ExtractTimezoneAbbrRefiner_1.default());\n configuration.refiners.unshift(new ExtractTimezoneOffsetRefiner_1.default());\n configuration.refiners.unshift(new OverlapRemovalRefiner_1.default());\n configuration.refiners.push(new OverlapRemovalRefiner_1.default());\n configuration.refiners.push(new ForwardDateRefiner_1.default());\n configuration.refiners.push(new UnlikelyFormatFilter_1.default(strictMode));\n return configuration;\n}\nexports.includeCommonConfiguration = includeCommonConfiguration;\n\n\n//# sourceURL=webpack://chrono-node/./dist/configurations.js?");
|
|
218
|
+
|
|
219
|
+
/***/ }),
|
|
220
|
+
|
|
221
|
+
/***/ "./dist/index.js":
|
|
222
|
+
/*!***********************!*\
|
|
223
|
+
!*** ./dist/index.js ***!
|
|
224
|
+
\***********************/
|
|
225
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
226
|
+
|
|
227
|
+
"use strict";
|
|
228
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.parseDate = exports.parse = exports.casual = exports.strict = exports.nl = exports.pt = exports.ja = exports.fr = exports.de = exports.Meridiem = exports.Chrono = exports.en = void 0;\nconst en = __importStar(__webpack_require__(/*! ./locales/en */ \"./dist/locales/en/index.js\"));\nexports.en = en;\nconst chrono_1 = __webpack_require__(/*! ./chrono */ \"./dist/chrono.js\");\nObject.defineProperty(exports, \"Chrono\", ({ enumerable: true, get: function () { return chrono_1.Chrono; } }));\nvar Meridiem;\n(function (Meridiem) {\n Meridiem[Meridiem[\"AM\"] = 0] = \"AM\";\n Meridiem[Meridiem[\"PM\"] = 1] = \"PM\";\n})(Meridiem = exports.Meridiem || (exports.Meridiem = {}));\nconst de = __importStar(__webpack_require__(/*! ./locales/de */ \"./dist/locales/de/index.js\"));\nexports.de = de;\nconst fr = __importStar(__webpack_require__(/*! ./locales/fr */ \"./dist/locales/fr/index.js\"));\nexports.fr = fr;\nconst ja = __importStar(__webpack_require__(/*! ./locales/ja */ \"./dist/locales/ja/index.js\"));\nexports.ja = ja;\nconst pt = __importStar(__webpack_require__(/*! ./locales/pt */ \"./dist/locales/pt/index.js\"));\nexports.pt = pt;\nconst nl = __importStar(__webpack_require__(/*! ./locales/nl */ \"./dist/locales/nl/index.js\"));\nexports.nl = nl;\nexports.strict = en.strict;\nexports.casual = en.casual;\nfunction parse(text, ref, option) {\n return exports.casual.parse(text, ref, option);\n}\nexports.parse = parse;\nfunction parseDate(text, ref, option) {\n return exports.casual.parseDate(text, ref, option);\n}\nexports.parseDate = parseDate;\n\n\n//# sourceURL=webpack://chrono-node/./dist/index.js?");
|
|
229
|
+
|
|
230
|
+
/***/ }),
|
|
231
|
+
|
|
232
|
+
/***/ "./dist/locales/de/constants.js":
|
|
233
|
+
/*!**************************************!*\
|
|
234
|
+
!*** ./dist/locales/de/constants.js ***!
|
|
235
|
+
\**************************************/
|
|
236
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
237
|
+
|
|
238
|
+
"use strict";
|
|
239
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;\nconst pattern_1 = __webpack_require__(/*! ../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst years_1 = __webpack_require__(/*! ../../calculation/years */ \"./dist/calculation/years.js\");\nexports.WEEKDAY_DICTIONARY = {\n \"sonntag\": 0,\n \"so\": 0,\n \"montag\": 1,\n \"mo\": 1,\n \"dienstag\": 2,\n \"di\": 2,\n \"mittwoch\": 3,\n \"mi\": 3,\n \"donnerstag\": 4,\n \"do\": 4,\n \"freitag\": 5,\n \"fr\": 5,\n \"samstag\": 6,\n \"sa\": 6,\n};\nexports.MONTH_DICTIONARY = {\n \"januar\": 1,\n \"jan\": 1,\n \"jan.\": 1,\n \"februar\": 2,\n \"feb\": 2,\n \"feb.\": 2,\n \"märz\": 3,\n \"maerz\": 3,\n \"mär\": 3,\n \"mär.\": 3,\n \"mrz\": 3,\n \"mrz.\": 3,\n \"april\": 4,\n \"apr\": 4,\n \"apr.\": 4,\n \"mai\": 5,\n \"juni\": 6,\n \"jun\": 6,\n \"jun.\": 6,\n \"juli\": 7,\n \"jul\": 7,\n \"jul.\": 7,\n \"august\": 8,\n \"aug\": 8,\n \"aug.\": 8,\n \"september\": 9,\n \"sep\": 9,\n \"sep.\": 9,\n \"sept\": 9,\n \"sept.\": 9,\n \"oktober\": 10,\n \"okt\": 10,\n \"okt.\": 10,\n \"november\": 11,\n \"nov\": 11,\n \"nov.\": 11,\n \"dezember\": 12,\n \"dez\": 12,\n \"dez.\": 12,\n};\nexports.INTEGER_WORD_DICTIONARY = {\n \"eins\": 1,\n \"zwei\": 2,\n \"drei\": 3,\n \"vier\": 4,\n \"fünf\": 5,\n \"fuenf\": 5,\n \"sechs\": 6,\n \"sieben\": 7,\n \"acht\": 8,\n \"neun\": 9,\n \"zehn\": 10,\n \"elf\": 11,\n \"zwölf\": 12,\n \"zwoelf\": 12,\n};\nexports.TIME_UNIT_DICTIONARY = {\n sec: \"second\",\n second: \"second\",\n seconds: \"second\",\n min: \"minute\",\n mins: \"minute\",\n minute: \"minute\",\n minutes: \"minute\",\n h: \"hour\",\n hr: \"hour\",\n hrs: \"hour\",\n hour: \"hour\",\n hours: \"hour\",\n day: \"d\",\n days: \"d\",\n week: \"week\",\n weeks: \"week\",\n month: \"month\",\n months: \"month\",\n y: \"year\",\n yr: \"year\",\n year: \"year\",\n years: \"year\",\n};\nexports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\\\.[0-9]+|half(?:\\\\s*an?)?|an?(?:\\\\s*few)?|few|several|a?\\\\s*couple\\\\s*(?:of)?)`;\nfunction parseNumberPattern(match) {\n const num = match.toLowerCase();\n if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) {\n return exports.INTEGER_WORD_DICTIONARY[num];\n }\n else if (num === \"a\" || num === \"an\") {\n return 1;\n }\n else if (num.match(/few/)) {\n return 3;\n }\n else if (num.match(/half/)) {\n return 0.5;\n }\n else if (num.match(/couple/)) {\n return 2;\n }\n else if (num.match(/several/)) {\n return 7;\n }\n return parseFloat(num);\n}\nexports.parseNumberPattern = parseNumberPattern;\nexports.YEAR_PATTERN = `(?:[0-9]{1,4}(?:\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?)`;\nfunction parseYear(match) {\n if (/v/i.test(match)) {\n return -parseInt(match.replace(/[^0-9]+/gi, \"\"));\n }\n if (/n/i.test(match)) {\n return parseInt(match.replace(/[^0-9]+/gi, \"\"));\n }\n const rawYearNumber = parseInt(match);\n return years_1.findMostLikelyADYear(rawYearNumber);\n}\nexports.parseYear = parseYear;\nconst SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\\\s{0,5}`;\nconst SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, \"i\");\nexports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(\"\", SINGLE_TIME_UNIT_PATTERN);\nfunction parseTimeUnits(timeunitText) {\n const fragments = {};\n let remainingText = timeunitText;\n let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);\n while (match) {\n collectDateTimeFragment(fragments, match);\n remainingText = remainingText.substring(match[0].length);\n match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);\n }\n return fragments;\n}\nexports.parseTimeUnits = parseTimeUnits;\nfunction collectDateTimeFragment(fragments, match) {\n const num = parseNumberPattern(match[1]);\n const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()];\n fragments[unit] = num;\n}\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/constants.js?");
|
|
240
|
+
|
|
241
|
+
/***/ }),
|
|
242
|
+
|
|
243
|
+
/***/ "./dist/locales/de/index.js":
|
|
244
|
+
/*!**********************************!*\
|
|
245
|
+
!*** ./dist/locales/de/index.js ***!
|
|
246
|
+
\**********************************/
|
|
247
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
248
|
+
|
|
249
|
+
"use strict";
|
|
250
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;\nconst configurations_1 = __webpack_require__(/*! ../../configurations */ \"./dist/configurations.js\");\nconst chrono_1 = __webpack_require__(/*! ../../chrono */ \"./dist/chrono.js\");\nconst SlashDateFormatParser_1 = __importDefault(__webpack_require__(/*! ../../common/parsers/SlashDateFormatParser */ \"./dist/common/parsers/SlashDateFormatParser.js\"));\nconst ISOFormatParser_1 = __importDefault(__webpack_require__(/*! ../../common/parsers/ISOFormatParser */ \"./dist/common/parsers/ISOFormatParser.js\"));\nconst DETimeExpressionParser_1 = __importDefault(__webpack_require__(/*! ./parsers/DETimeExpressionParser */ \"./dist/locales/de/parsers/DETimeExpressionParser.js\"));\nconst DEWeekdayParser_1 = __importDefault(__webpack_require__(/*! ./parsers/DEWeekdayParser */ \"./dist/locales/de/parsers/DEWeekdayParser.js\"));\nconst DEMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/DEMergeDateRangeRefiner */ \"./dist/locales/de/refiners/DEMergeDateRangeRefiner.js\"));\nconst DEMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/DEMergeDateTimeRefiner */ \"./dist/locales/de/refiners/DEMergeDateTimeRefiner.js\"));\nconst DECasualDateParser_1 = __importDefault(__webpack_require__(/*! ./parsers/DECasualDateParser */ \"./dist/locales/de/parsers/DECasualDateParser.js\"));\nconst DECasualTimeParser_1 = __importDefault(__webpack_require__(/*! ./parsers/DECasualTimeParser */ \"./dist/locales/de/parsers/DECasualTimeParser.js\"));\nconst DEMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__(/*! ./parsers/DEMonthNameLittleEndianParser */ \"./dist/locales/de/parsers/DEMonthNameLittleEndianParser.js\"));\nexports.casual = new chrono_1.Chrono(createCasualConfiguration());\nexports.strict = new chrono_1.Chrono(createConfiguration(true));\nfunction parse(text, ref, option) {\n return exports.casual.parse(text, ref, option);\n}\nexports.parse = parse;\nfunction parseDate(text, ref, option) {\n return exports.casual.parseDate(text, ref, option);\n}\nexports.parseDate = parseDate;\nfunction createCasualConfiguration(littleEndian = true) {\n const option = createConfiguration(false, littleEndian);\n option.parsers.unshift(new DECasualTimeParser_1.default());\n option.parsers.unshift(new DECasualDateParser_1.default());\n return option;\n}\nexports.createCasualConfiguration = createCasualConfiguration;\nfunction createConfiguration(strictMode = true, littleEndian = true) {\n return configurations_1.includeCommonConfiguration({\n parsers: [\n new ISOFormatParser_1.default(),\n new SlashDateFormatParser_1.default(littleEndian),\n new DETimeExpressionParser_1.default(),\n new DEMonthNameLittleEndianParser_1.default(),\n new DEWeekdayParser_1.default(),\n ],\n refiners: [new DEMergeDateRangeRefiner_1.default(), new DEMergeDateTimeRefiner_1.default()],\n }, strictMode);\n}\nexports.createConfiguration = createConfiguration;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/index.js?");
|
|
251
|
+
|
|
252
|
+
/***/ }),
|
|
253
|
+
|
|
254
|
+
/***/ "./dist/locales/de/parsers/DECasualDateParser.js":
|
|
255
|
+
/*!*******************************************************!*\
|
|
256
|
+
!*** ./dist/locales/de/parsers/DECasualDateParser.js ***!
|
|
257
|
+
\*******************************************************/
|
|
258
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
259
|
+
|
|
260
|
+
"use strict";
|
|
261
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst dayjs_2 = __webpack_require__(/*! ../../../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst DECasualTimeParser_1 = __importDefault(__webpack_require__(/*! ./DECasualTimeParser */ \"./dist/locales/de/parsers/DECasualTimeParser.js\"));\nconst references = __importStar(__webpack_require__(/*! ../../../common/casualReferences */ \"./dist/common/casualReferences.js\"));\nconst PATTERN = new RegExp(`(jetzt|heute|morgen|übermorgen|uebermorgen|gestern|vorgestern|letzte\\\\s*nacht)` +\n `(?:\\\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?` +\n `(?=\\\\W|$)`, \"i\");\nconst DATE_GROUP = 1;\nconst TIME_GROUP = 2;\nclass DECasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return PATTERN;\n }\n innerExtract(context, match) {\n let targetDate = dayjs_1.default(context.refDate);\n const dateKeyword = (match[DATE_GROUP] || \"\").toLowerCase();\n const timeKeyword = (match[TIME_GROUP] || \"\").toLowerCase();\n let component = context.createParsingComponents();\n switch (dateKeyword) {\n case \"jetzt\":\n component = references.now(context.refDate);\n break;\n case \"heute\":\n component = references.today(context.refDate);\n break;\n case \"morgen\":\n dayjs_2.assignTheNextDay(component, targetDate);\n break;\n case \"übermorgen\":\n case \"uebermorgen\":\n targetDate = targetDate.add(1, \"day\");\n dayjs_2.assignTheNextDay(component, targetDate);\n break;\n case \"gestern\":\n targetDate = targetDate.add(-1, \"day\");\n dayjs_2.assignSimilarDate(component, targetDate);\n dayjs_2.implySimilarTime(component, targetDate);\n break;\n case \"vorgestern\":\n targetDate = targetDate.add(-2, \"day\");\n dayjs_2.assignSimilarDate(component, targetDate);\n dayjs_2.implySimilarTime(component, targetDate);\n break;\n default:\n if (dateKeyword.match(/letzte\\s*nacht/)) {\n if (targetDate.hour() > 6) {\n targetDate = targetDate.add(-1, \"day\");\n }\n dayjs_2.assignSimilarDate(component, targetDate);\n component.imply(\"hour\", 0);\n }\n break;\n }\n if (timeKeyword) {\n component = DECasualTimeParser_1.default.extractTimeComponents(component, timeKeyword);\n }\n return component;\n }\n}\nexports.default = DECasualDateParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/parsers/DECasualDateParser.js?");
|
|
262
|
+
|
|
263
|
+
/***/ }),
|
|
264
|
+
|
|
265
|
+
/***/ "./dist/locales/de/parsers/DECasualTimeParser.js":
|
|
266
|
+
/*!*******************************************************!*\
|
|
267
|
+
!*** ./dist/locales/de/parsers/DECasualTimeParser.js ***!
|
|
268
|
+
\*******************************************************/
|
|
269
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
270
|
+
|
|
271
|
+
"use strict";
|
|
272
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst dayjs_2 = __webpack_require__(/*! ../../../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst timeunits_1 = __webpack_require__(/*! ../../../utils/timeunits */ \"./dist/utils/timeunits.js\");\nclass DECasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return /(diesen)?\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\\W|$)/i;\n }\n innerExtract(context, match) {\n const targetDate = dayjs_1.default(context.refDate);\n const timeKeywordPattern = match[2].toLowerCase();\n const component = context.createParsingComponents();\n dayjs_2.implySimilarTime(component, targetDate);\n return DECasualTimeParser.extractTimeComponents(component, timeKeywordPattern);\n }\n static extractTimeComponents(component, timeKeywordPattern) {\n switch (timeKeywordPattern) {\n case \"morgen\":\n component.imply(\"hour\", 6);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n break;\n case \"vormittag\":\n component.imply(\"hour\", 9);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n break;\n case \"mittag\":\n case \"mittags\":\n component.imply(\"hour\", 12);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n break;\n case \"nachmittag\":\n component.imply(\"hour\", 15);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n break;\n case \"abend\":\n component.imply(\"hour\", 18);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n break;\n case \"nacht\":\n component.imply(\"hour\", 22);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n break;\n case \"mitternacht\":\n if (component.get(\"hour\") > 1) {\n component = timeunits_1.addImpliedTimeUnits(component, { \"day\": 1 });\n }\n component.imply(\"hour\", 0);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n break;\n }\n return component;\n }\n}\nexports.default = DECasualTimeParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/parsers/DECasualTimeParser.js?");
|
|
273
|
+
|
|
274
|
+
/***/ }),
|
|
275
|
+
|
|
276
|
+
/***/ "./dist/locales/de/parsers/DEMonthNameLittleEndianParser.js":
|
|
277
|
+
/*!******************************************************************!*\
|
|
278
|
+
!*** ./dist/locales/de/parsers/DEMonthNameLittleEndianParser.js ***!
|
|
279
|
+
\******************************************************************/
|
|
280
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
281
|
+
|
|
282
|
+
"use strict";
|
|
283
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/de/constants.js\");\nconst constants_2 = __webpack_require__(/*! ../constants */ \"./dist/locales/de/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(\"(?:am\\\\s*?)?\" +\n \"(?:den\\\\s*?)?\" +\n `([0-9]{1,2})\\\\.` +\n `(?:\\\\s*(?:bis(?:\\\\s*(?:am|zum))?|\\\\-|\\\\–|\\\\s)\\\\s*([0-9]{1,2})\\\\.?)?\\\\s*` +\n `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` +\n `(?:(?:-|/|,?\\\\s*)(${constants_2.YEAR_PATTERN}(?![^\\\\s]\\\\d)))?` +\n `(?=\\\\W|$)`, \"i\");\nconst DATE_GROUP = 1;\nconst DATE_TO_GROUP = 2;\nconst MONTH_NAME_GROUP = 3;\nconst YEAR_GROUP = 4;\nclass DEMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const result = context.createParsingResult(match.index, match[0]);\n const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];\n const day = parseInt(match[DATE_GROUP]);\n if (day > 31) {\n match.index = match.index + match[DATE_GROUP].length;\n return null;\n }\n result.start.assign(\"month\", month);\n result.start.assign(\"day\", day);\n if (match[YEAR_GROUP]) {\n const yearNumber = constants_2.parseYear(match[YEAR_GROUP]);\n result.start.assign(\"year\", yearNumber);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, day, month);\n result.start.imply(\"year\", year);\n }\n if (match[DATE_TO_GROUP]) {\n const endDate = parseInt(match[DATE_TO_GROUP]);\n result.end = result.start.clone();\n result.end.assign(\"day\", endDate);\n }\n return result;\n }\n}\nexports.default = DEMonthNameLittleEndianParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/parsers/DEMonthNameLittleEndianParser.js?");
|
|
284
|
+
|
|
285
|
+
/***/ }),
|
|
286
|
+
|
|
287
|
+
/***/ "./dist/locales/de/parsers/DETimeExpressionParser.js":
|
|
288
|
+
/*!***********************************************************!*\
|
|
289
|
+
!*** ./dist/locales/de/parsers/DETimeExpressionParser.js ***!
|
|
290
|
+
\***********************************************************/
|
|
291
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
292
|
+
|
|
293
|
+
"use strict";
|
|
294
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractTimeExpressionParser_1 = __webpack_require__(/*! ../../../common/parsers/AbstractTimeExpressionParser */ \"./dist/common/parsers/AbstractTimeExpressionParser.js\");\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nclass DETimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {\n primaryPrefix() {\n return \"(?:(?:um|von)\\\\s*)?\";\n }\n followingPhase() {\n return \"\\\\s*(?:\\\\-|\\\\–|\\\\~|\\\\〜|bis)\\\\s*\";\n }\n primarySuffix() {\n return \"(?:\\\\s*uhr)?(?:\\\\s*(?:morgens|vormittags|nachmittags|abends|nachts))?(?=\\\\W|$)\";\n }\n extractPrimaryTimeComponents(context, match) {\n const components = super.extractPrimaryTimeComponents(context, match);\n if (components) {\n if (match[0].endsWith(\"morgens\") || match[0].endsWith(\"vormittags\")) {\n components.assign(\"meridiem\", index_1.Meridiem.AM);\n const hour = components.get(\"hour\");\n if (hour < 12) {\n components.assign(\"hour\", components.get(\"hour\"));\n }\n }\n if (match[0].endsWith(\"nachmittags\") || match[0].endsWith(\"abends\") || match[0].endsWith(\"nachts\")) {\n components.assign(\"meridiem\", index_1.Meridiem.PM);\n const hour = components.get(\"hour\");\n if (hour < 12) {\n components.assign(\"hour\", components.get(\"hour\") + 12);\n }\n }\n }\n return components;\n }\n}\nexports.default = DETimeExpressionParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/parsers/DETimeExpressionParser.js?");
|
|
295
|
+
|
|
296
|
+
/***/ }),
|
|
297
|
+
|
|
298
|
+
/***/ "./dist/locales/de/parsers/DEWeekdayParser.js":
|
|
299
|
+
/*!****************************************************!*\
|
|
300
|
+
!*** ./dist/locales/de/parsers/DEWeekdayParser.js ***!
|
|
301
|
+
\****************************************************/
|
|
302
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
303
|
+
|
|
304
|
+
"use strict";
|
|
305
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/de/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst weeks_1 = __webpack_require__(/*! ../../../calculation/weeks */ \"./dist/calculation/weeks.js\");\nconst PATTERN = new RegExp(\"(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?\" +\n \"(?:a[mn]\\\\s*?)?\" +\n \"(?:(diese[mn]|letzte[mn]|n(?:ä|ae)chste[mn])\\\\s*)?\" +\n `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` +\n \"(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?\" +\n \"(?:\\\\s*(diese|letzte|n(?:ä|ae)chste)\\\\s*woche)?\" +\n \"(?=\\\\W|$)\", \"i\");\nconst PREFIX_GROUP = 1;\nconst SUFFIX_GROUP = 3;\nconst WEEKDAY_GROUP = 2;\nclass DEWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];\n const prefix = match[PREFIX_GROUP];\n const postfix = match[SUFFIX_GROUP];\n let modifierWord = prefix || postfix;\n modifierWord = modifierWord || \"\";\n modifierWord = modifierWord.toLowerCase();\n let modifier = null;\n if (modifierWord.match(/letzte/)) {\n modifier = \"last\";\n }\n else if (modifierWord.match(/chste/)) {\n modifier = \"next\";\n }\n else if (modifierWord.match(/diese/)) {\n modifier = \"this\";\n }\n const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);\n return context\n .createParsingComponents()\n .assign(\"weekday\", offset)\n .imply(\"day\", date.date())\n .imply(\"month\", date.month() + 1)\n .imply(\"year\", date.year());\n }\n}\nexports.default = DEWeekdayParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/parsers/DEWeekdayParser.js?");
|
|
306
|
+
|
|
307
|
+
/***/ }),
|
|
308
|
+
|
|
309
|
+
/***/ "./dist/locales/de/refiners/DEMergeDateRangeRefiner.js":
|
|
310
|
+
/*!*************************************************************!*\
|
|
311
|
+
!*** ./dist/locales/de/refiners/DEMergeDateRangeRefiner.js ***!
|
|
312
|
+
\*************************************************************/
|
|
313
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
314
|
+
|
|
315
|
+
"use strict";
|
|
316
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateRangeRefiner */ \"./dist/common/refiners/AbstractMergeDateRangeRefiner.js\"));\nclass DEMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {\n patternBetween() {\n return /^\\s*(bis(?:\\s*(?:am|zum))?|-)\\s*$/i;\n }\n}\nexports.default = DEMergeDateRangeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/refiners/DEMergeDateRangeRefiner.js?");
|
|
317
|
+
|
|
318
|
+
/***/ }),
|
|
319
|
+
|
|
320
|
+
/***/ "./dist/locales/de/refiners/DEMergeDateTimeRefiner.js":
|
|
321
|
+
/*!************************************************************!*\
|
|
322
|
+
!*** ./dist/locales/de/refiners/DEMergeDateTimeRefiner.js ***!
|
|
323
|
+
\************************************************************/
|
|
324
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
325
|
+
|
|
326
|
+
"use strict";
|
|
327
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateTimeRefiner */ \"./dist/common/refiners/AbstractMergeDateTimeRefiner.js\"));\nclass DEMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {\n patternBetween() {\n return new RegExp(\"^\\\\s*(T|um|am|,|-)?\\\\s*$\");\n }\n}\nexports.default = DEMergeDateTimeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/de/refiners/DEMergeDateTimeRefiner.js?");
|
|
328
|
+
|
|
329
|
+
/***/ }),
|
|
330
|
+
|
|
331
|
+
/***/ "./dist/locales/en/constants.js":
|
|
332
|
+
/*!**************************************!*\
|
|
333
|
+
!*** ./dist/locales/en/constants.js ***!
|
|
334
|
+
\**************************************/
|
|
335
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
336
|
+
|
|
337
|
+
"use strict";
|
|
338
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.ORDINAL_WORD_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.FULL_MONTH_NAME_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;\nconst pattern_1 = __webpack_require__(/*! ../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst years_1 = __webpack_require__(/*! ../../calculation/years */ \"./dist/calculation/years.js\");\nexports.WEEKDAY_DICTIONARY = {\n sunday: 0,\n sun: 0,\n \"sun.\": 0,\n monday: 1,\n mon: 1,\n \"mon.\": 1,\n tuesday: 2,\n tue: 2,\n \"tue.\": 2,\n wednesday: 3,\n wed: 3,\n \"wed.\": 3,\n thursday: 4,\n thurs: 4,\n \"thurs.\": 4,\n thur: 4,\n \"thur.\": 4,\n thu: 4,\n \"thu.\": 4,\n friday: 5,\n fri: 5,\n \"fri.\": 5,\n saturday: 6,\n sat: 6,\n \"sat.\": 6,\n};\nexports.FULL_MONTH_NAME_DICTIONARY = {\n january: 1,\n february: 2,\n march: 3,\n april: 4,\n may: 5,\n june: 6,\n july: 7,\n august: 8,\n september: 9,\n october: 10,\n november: 11,\n december: 12,\n};\nexports.MONTH_DICTIONARY = Object.assign(Object.assign({}, exports.FULL_MONTH_NAME_DICTIONARY), { jan: 1, \"jan.\": 1, feb: 2, \"feb.\": 2, mar: 3, \"mar.\": 3, apr: 4, \"apr.\": 4, jun: 6, \"jun.\": 6, jul: 7, \"jul.\": 7, aug: 8, \"aug.\": 8, sep: 9, \"sep.\": 9, sept: 9, \"sept.\": 9, oct: 10, \"oct.\": 10, nov: 11, \"nov.\": 11, dec: 12, \"dec.\": 12 });\nexports.INTEGER_WORD_DICTIONARY = {\n one: 1,\n two: 2,\n three: 3,\n four: 4,\n five: 5,\n six: 6,\n seven: 7,\n eight: 8,\n nine: 9,\n ten: 10,\n eleven: 11,\n twelve: 12,\n};\nexports.ORDINAL_WORD_DICTIONARY = {\n first: 1,\n second: 2,\n third: 3,\n fourth: 4,\n fifth: 5,\n sixth: 6,\n seventh: 7,\n eighth: 8,\n ninth: 9,\n tenth: 10,\n eleventh: 11,\n twelfth: 12,\n thirteenth: 13,\n fourteenth: 14,\n fifteenth: 15,\n sixteenth: 16,\n seventeenth: 17,\n eighteenth: 18,\n nineteenth: 19,\n twentieth: 20,\n \"twenty first\": 21,\n \"twenty-first\": 21,\n \"twenty second\": 22,\n \"twenty-second\": 22,\n \"twenty third\": 23,\n \"twenty-third\": 23,\n \"twenty fourth\": 24,\n \"twenty-fourth\": 24,\n \"twenty fifth\": 25,\n \"twenty-fifth\": 25,\n \"twenty sixth\": 26,\n \"twenty-sixth\": 26,\n \"twenty seventh\": 27,\n \"twenty-seventh\": 27,\n \"twenty eighth\": 28,\n \"twenty-eighth\": 28,\n \"twenty ninth\": 29,\n \"twenty-ninth\": 29,\n \"thirtieth\": 30,\n \"thirty first\": 31,\n \"thirty-first\": 31,\n};\nexports.TIME_UNIT_DICTIONARY = {\n sec: \"second\",\n second: \"second\",\n seconds: \"second\",\n min: \"minute\",\n mins: \"minute\",\n minute: \"minute\",\n minutes: \"minute\",\n h: \"hour\",\n hr: \"hour\",\n hrs: \"hour\",\n hour: \"hour\",\n hours: \"hour\",\n day: \"d\",\n days: \"d\",\n week: \"week\",\n weeks: \"week\",\n month: \"month\",\n months: \"month\",\n y: \"year\",\n yr: \"year\",\n year: \"year\",\n years: \"year\",\n};\nexports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\\\.[0-9]+|half(?:\\\\s*an?)?|an?(?:\\\\s*few)?|few|several|a?\\\\s*couple\\\\s*(?:of)?)`;\nfunction parseNumberPattern(match) {\n const num = match.toLowerCase();\n if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) {\n return exports.INTEGER_WORD_DICTIONARY[num];\n }\n else if (num === \"a\" || num === \"an\") {\n return 1;\n }\n else if (num.match(/few/)) {\n return 3;\n }\n else if (num.match(/half/)) {\n return 0.5;\n }\n else if (num.match(/couple/)) {\n return 2;\n }\n else if (num.match(/several/)) {\n return 7;\n }\n return parseFloat(num);\n}\nexports.parseNumberPattern = parseNumberPattern;\nexports.ORDINAL_NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;\nfunction parseOrdinalNumberPattern(match) {\n let num = match.toLowerCase();\n if (exports.ORDINAL_WORD_DICTIONARY[num] !== undefined) {\n return exports.ORDINAL_WORD_DICTIONARY[num];\n }\n num = num.replace(/(?:st|nd|rd|th)$/i, \"\");\n return parseInt(num);\n}\nexports.parseOrdinalNumberPattern = parseOrdinalNumberPattern;\nexports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\\\s*(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])`;\nfunction parseYear(match) {\n if (/BE/i.test(match)) {\n match = match.replace(/BE/i, \"\");\n return parseInt(match) - 543;\n }\n if (/BCE?/i.test(match)) {\n match = match.replace(/BCE?/i, \"\");\n return -parseInt(match);\n }\n if (/(AD|CE)/i.test(match)) {\n match = match.replace(/(AD|CE)/i, \"\");\n return parseInt(match);\n }\n const rawYearNumber = parseInt(match);\n return years_1.findMostLikelyADYear(rawYearNumber);\n}\nexports.parseYear = parseYear;\nconst SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\\\s{0,5}`;\nconst SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, \"i\");\nexports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(`(?:(?:about|around)\\\\s*)?`, SINGLE_TIME_UNIT_PATTERN);\nfunction parseTimeUnits(timeunitText) {\n const fragments = {};\n let remainingText = timeunitText;\n let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);\n while (match) {\n collectDateTimeFragment(fragments, match);\n remainingText = remainingText.substring(match[0].length);\n match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);\n }\n return fragments;\n}\nexports.parseTimeUnits = parseTimeUnits;\nfunction collectDateTimeFragment(fragments, match) {\n const num = parseNumberPattern(match[1]);\n const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()];\n fragments[unit] = num;\n}\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/constants.js?");
|
|
339
|
+
|
|
340
|
+
/***/ }),
|
|
341
|
+
|
|
342
|
+
/***/ "./dist/locales/en/index.js":
|
|
343
|
+
/*!**********************************!*\
|
|
344
|
+
!*** ./dist/locales/en/index.js ***!
|
|
345
|
+
\**********************************/
|
|
346
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
347
|
+
|
|
348
|
+
"use strict";
|
|
349
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.GB = exports.strict = exports.casual = void 0;\nconst ENTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENTimeUnitWithinFormatParser */ \"./dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js\"));\nconst ENMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENMonthNameLittleEndianParser */ \"./dist/locales/en/parsers/ENMonthNameLittleEndianParser.js\"));\nconst ENMonthNameMiddleEndianParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENMonthNameMiddleEndianParser */ \"./dist/locales/en/parsers/ENMonthNameMiddleEndianParser.js\"));\nconst ENMonthNameParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENMonthNameParser */ \"./dist/locales/en/parsers/ENMonthNameParser.js\"));\nconst ENCasualYearMonthDayParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENCasualYearMonthDayParser */ \"./dist/locales/en/parsers/ENCasualYearMonthDayParser.js\"));\nconst ENSlashMonthFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENSlashMonthFormatParser */ \"./dist/locales/en/parsers/ENSlashMonthFormatParser.js\"));\nconst ENTimeExpressionParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENTimeExpressionParser */ \"./dist/locales/en/parsers/ENTimeExpressionParser.js\"));\nconst ENTimeUnitAgoFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENTimeUnitAgoFormatParser */ \"./dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js\"));\nconst ENTimeUnitLaterFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENTimeUnitLaterFormatParser */ \"./dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js\"));\nconst ENMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/ENMergeDateRangeRefiner */ \"./dist/locales/en/refiners/ENMergeDateRangeRefiner.js\"));\nconst ENMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/ENMergeDateTimeRefiner */ \"./dist/locales/en/refiners/ENMergeDateTimeRefiner.js\"));\nconst configurations_1 = __webpack_require__(/*! ../../configurations */ \"./dist/configurations.js\");\nconst ENCasualDateParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENCasualDateParser */ \"./dist/locales/en/parsers/ENCasualDateParser.js\"));\nconst ENCasualTimeParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENCasualTimeParser */ \"./dist/locales/en/parsers/ENCasualTimeParser.js\"));\nconst ENWeekdayParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENWeekdayParser */ \"./dist/locales/en/parsers/ENWeekdayParser.js\"));\nconst ENRelativeDateFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENRelativeDateFormatParser */ \"./dist/locales/en/parsers/ENRelativeDateFormatParser.js\"));\nconst chrono_1 = __webpack_require__(/*! ../../chrono */ \"./dist/chrono.js\");\nconst SlashDateFormatParser_1 = __importDefault(__webpack_require__(/*! ../../common/parsers/SlashDateFormatParser */ \"./dist/common/parsers/SlashDateFormatParser.js\"));\nconst ENTimeUnitCasualRelativeFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/ENTimeUnitCasualRelativeFormatParser */ \"./dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js\"));\nexports.casual = new chrono_1.Chrono(createCasualConfiguration(false));\nexports.strict = new chrono_1.Chrono(createConfiguration(true, false));\nexports.GB = new chrono_1.Chrono(createConfiguration(false, true));\nfunction parse(text, ref, option) {\n return exports.casual.parse(text, ref, option);\n}\nexports.parse = parse;\nfunction parseDate(text, ref, option) {\n return exports.casual.parseDate(text, ref, option);\n}\nexports.parseDate = parseDate;\nfunction createCasualConfiguration(littleEndian = false) {\n const option = createConfiguration(false, littleEndian);\n option.parsers.unshift(new ENCasualDateParser_1.default());\n option.parsers.unshift(new ENCasualTimeParser_1.default());\n option.parsers.unshift(new ENMonthNameParser_1.default());\n option.parsers.unshift(new ENRelativeDateFormatParser_1.default());\n option.parsers.unshift(new ENTimeUnitCasualRelativeFormatParser_1.default());\n return option;\n}\nexports.createCasualConfiguration = createCasualConfiguration;\nfunction createConfiguration(strictMode = true, littleEndian = false) {\n return configurations_1.includeCommonConfiguration({\n parsers: [\n new SlashDateFormatParser_1.default(littleEndian),\n new ENTimeUnitWithinFormatParser_1.default(),\n new ENMonthNameLittleEndianParser_1.default(),\n new ENMonthNameMiddleEndianParser_1.default(),\n new ENWeekdayParser_1.default(),\n new ENCasualYearMonthDayParser_1.default(),\n new ENSlashMonthFormatParser_1.default(),\n new ENTimeExpressionParser_1.default(strictMode),\n new ENTimeUnitAgoFormatParser_1.default(strictMode),\n new ENTimeUnitLaterFormatParser_1.default(strictMode),\n ],\n refiners: [new ENMergeDateTimeRefiner_1.default(), new ENMergeDateRangeRefiner_1.default()],\n }, strictMode);\n}\nexports.createConfiguration = createConfiguration;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/index.js?");
|
|
350
|
+
|
|
351
|
+
/***/ }),
|
|
352
|
+
|
|
353
|
+
/***/ "./dist/locales/en/parsers/ENCasualDateParser.js":
|
|
354
|
+
/*!*******************************************************!*\
|
|
355
|
+
!*** ./dist/locales/en/parsers/ENCasualDateParser.js ***!
|
|
356
|
+
\*******************************************************/
|
|
357
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
358
|
+
|
|
359
|
+
"use strict";
|
|
360
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst dayjs_2 = __webpack_require__(/*! ../../../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst references = __importStar(__webpack_require__(/*! ../../../common/casualReferences */ \"./dist/common/casualReferences.js\"));\nconst PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\\s*night)(?=\\W|$)/i;\nclass ENCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return PATTERN;\n }\n innerExtract(context, match) {\n let targetDate = dayjs_1.default(context.refDate);\n const lowerText = match[0].toLowerCase();\n const component = context.createParsingComponents();\n switch (lowerText) {\n case \"now\":\n return references.now(context.refDate);\n case \"today\":\n return references.today(context.refDate);\n case \"yesterday\":\n return references.yesterday(context.refDate);\n case \"tomorrow\":\n case \"tmr\":\n case \"tmrw\":\n return references.tomorrow(context.refDate);\n case \"tonight\":\n return references.tonight(context.refDate);\n default:\n if (lowerText.match(/last\\s*night/)) {\n if (targetDate.hour() > 6) {\n targetDate = targetDate.add(-1, \"day\");\n }\n dayjs_2.assignSimilarDate(component, targetDate);\n component.imply(\"hour\", 0);\n }\n break;\n }\n return component;\n }\n}\nexports.default = ENCasualDateParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENCasualDateParser.js?");
|
|
361
|
+
|
|
362
|
+
/***/ }),
|
|
363
|
+
|
|
364
|
+
/***/ "./dist/locales/en/parsers/ENCasualTimeParser.js":
|
|
365
|
+
/*!*******************************************************!*\
|
|
366
|
+
!*** ./dist/locales/en/parsers/ENCasualTimeParser.js ***!
|
|
367
|
+
\*******************************************************/
|
|
368
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
369
|
+
|
|
370
|
+
"use strict";
|
|
371
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst dayjs_2 = __webpack_require__(/*! ../../../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst PATTERN = /(?:this)?\\s*(morning|afternoon|evening|night|midnight|noon)(?=\\W|$)/i;\nclass ENCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const targetDate = dayjs_1.default(context.refDate);\n const component = context.createParsingComponents();\n switch (match[1].toLowerCase()) {\n case \"afternoon\":\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n component.imply(\"hour\", 15);\n break;\n case \"evening\":\n case \"night\":\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n component.imply(\"hour\", 20);\n break;\n case \"midnight\":\n dayjs_2.assignTheNextDay(component, targetDate);\n component.imply(\"hour\", 0);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n break;\n case \"morning\":\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n component.imply(\"hour\", 6);\n break;\n case \"noon\":\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n component.imply(\"hour\", 12);\n break;\n }\n return component;\n }\n}\nexports.default = ENCasualTimeParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENCasualTimeParser.js?");
|
|
372
|
+
|
|
373
|
+
/***/ }),
|
|
374
|
+
|
|
375
|
+
/***/ "./dist/locales/en/parsers/ENCasualYearMonthDayParser.js":
|
|
376
|
+
/*!***************************************************************!*\
|
|
377
|
+
!*** ./dist/locales/en/parsers/ENCasualYearMonthDayParser.js ***!
|
|
378
|
+
\***************************************************************/
|
|
379
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
380
|
+
|
|
381
|
+
"use strict";
|
|
382
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(`([0-9]{4})[\\\\.\\\\/\\\\s]` +\n `(?:(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\\\.\\\\/\\\\s]` +\n `([0-9]{1,2})` +\n \"(?=\\\\W|$)\", \"i\");\nconst YEAR_NUMBER_GROUP = 1;\nconst MONTH_NAME_GROUP = 2;\nconst MONTH_NUMBER_GROUP = 3;\nconst DATE_NUMBER_GROUP = 4;\nclass ENCasualYearMonthDayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const month = match[MONTH_NUMBER_GROUP]\n ? parseInt(match[MONTH_NUMBER_GROUP])\n : constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];\n if (month < 1 || month > 12) {\n return null;\n }\n const year = parseInt(match[YEAR_NUMBER_GROUP]);\n const day = parseInt(match[DATE_NUMBER_GROUP]);\n return {\n day: day,\n month: month,\n year: year,\n };\n }\n}\nexports.default = ENCasualYearMonthDayParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENCasualYearMonthDayParser.js?");
|
|
383
|
+
|
|
384
|
+
/***/ }),
|
|
385
|
+
|
|
386
|
+
/***/ "./dist/locales/en/parsers/ENMonthNameLittleEndianParser.js":
|
|
387
|
+
/*!******************************************************************!*\
|
|
388
|
+
!*** ./dist/locales/en/parsers/ENMonthNameLittleEndianParser.js ***!
|
|
389
|
+
\******************************************************************/
|
|
390
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
391
|
+
|
|
392
|
+
"use strict";
|
|
393
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst constants_2 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst constants_3 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(\"(?:on\\\\s*?)?\" +\n `(${constants_3.ORDINAL_NUMBER_PATTERN})` +\n \"(?:\\\\s*\" +\n \"(?:to|\\\\-|\\\\–|until|through|till|\\\\s)\\\\s*\" +\n `(${constants_3.ORDINAL_NUMBER_PATTERN})` +\n \")?\" +\n \"(?:-|/|\\\\s*(?:of)?\\\\s*)\" +\n \"(\" +\n pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY) +\n \")\" +\n \"(?:\" +\n \"(?:-|/|,?\\\\s*)\" +\n `(${constants_2.YEAR_PATTERN}(?![^\\\\s]\\\\d))` +\n \")?\" +\n \"(?=\\\\W|$)\", \"i\");\nconst DATE_GROUP = 1;\nconst DATE_TO_GROUP = 2;\nconst MONTH_NAME_GROUP = 3;\nconst YEAR_GROUP = 4;\nclass ENMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const result = context.createParsingResult(match.index, match[0]);\n const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];\n const day = constants_3.parseOrdinalNumberPattern(match[DATE_GROUP]);\n if (day > 31) {\n match.index = match.index + match[DATE_GROUP].length;\n return null;\n }\n result.start.assign(\"month\", month);\n result.start.assign(\"day\", day);\n if (match[YEAR_GROUP]) {\n const yearNumber = constants_2.parseYear(match[YEAR_GROUP]);\n result.start.assign(\"year\", yearNumber);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, day, month);\n result.start.imply(\"year\", year);\n }\n if (match[DATE_TO_GROUP]) {\n const endDate = constants_3.parseOrdinalNumberPattern(match[DATE_TO_GROUP]);\n result.end = result.start.clone();\n result.end.assign(\"day\", endDate);\n }\n return result;\n }\n}\nexports.default = ENMonthNameLittleEndianParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENMonthNameLittleEndianParser.js?");
|
|
394
|
+
|
|
395
|
+
/***/ }),
|
|
396
|
+
|
|
397
|
+
/***/ "./dist/locales/en/parsers/ENMonthNameMiddleEndianParser.js":
|
|
398
|
+
/*!******************************************************************!*\
|
|
399
|
+
!*** ./dist/locales/en/parsers/ENMonthNameMiddleEndianParser.js ***!
|
|
400
|
+
\******************************************************************/
|
|
401
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
402
|
+
|
|
403
|
+
"use strict";
|
|
404
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst constants_2 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst constants_3 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(`(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` +\n \"(?:-|/|\\\\s*,?\\\\s*)\" +\n `(${constants_2.ORDINAL_NUMBER_PATTERN})(?!\\\\s*(?:am|pm))\\\\s*` +\n \"(?:\" +\n \"(?:to|\\\\-)\\\\s*\" +\n `(${constants_2.ORDINAL_NUMBER_PATTERN})\\\\s*` +\n \")?\" +\n \"(?:\" +\n \"(?:-|/|\\\\s*,?\\\\s*)\" +\n `(${constants_3.YEAR_PATTERN})` +\n \")?\" +\n \"(?=\\\\W|$)(?!\\\\:\\\\d)\", \"i\");\nconst MONTH_NAME_GROUP = 1;\nconst DATE_GROUP = 2;\nconst DATE_TO_GROUP = 3;\nconst YEAR_GROUP = 4;\nclass ENMonthNameMiddleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];\n const day = constants_2.parseOrdinalNumberPattern(match[DATE_GROUP]);\n if (day > 31) {\n return null;\n }\n const components = context.createParsingComponents({\n day: day,\n month: month,\n });\n if (match[YEAR_GROUP]) {\n const year = constants_3.parseYear(match[YEAR_GROUP]);\n components.assign(\"year\", year);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, day, month);\n components.imply(\"year\", year);\n }\n if (!match[DATE_TO_GROUP]) {\n return components;\n }\n const endDate = constants_2.parseOrdinalNumberPattern(match[DATE_TO_GROUP]);\n const result = context.createParsingResult(match.index, match[0]);\n result.start = components;\n result.end = components.clone();\n result.end.assign(\"day\", endDate);\n return result;\n }\n}\nexports.default = ENMonthNameMiddleEndianParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENMonthNameMiddleEndianParser.js?");
|
|
405
|
+
|
|
406
|
+
/***/ }),
|
|
407
|
+
|
|
408
|
+
/***/ "./dist/locales/en/parsers/ENMonthNameParser.js":
|
|
409
|
+
/*!******************************************************!*\
|
|
410
|
+
!*** ./dist/locales/en/parsers/ENMonthNameParser.js ***!
|
|
411
|
+
\******************************************************/
|
|
412
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
413
|
+
|
|
414
|
+
"use strict";
|
|
415
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst constants_2 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(`((?:in)\\\\s*)?` +\n `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` +\n `\\\\s*` +\n `(?:` +\n `[,-]?\\\\s*(${constants_2.YEAR_PATTERN})?` +\n \")?\" +\n \"(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)\", \"i\");\nconst PREFIX_GROUP = 1;\nconst MONTH_NAME_GROUP = 2;\nconst YEAR_GROUP = 3;\nclass ENMonthNameParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const monthName = match[MONTH_NAME_GROUP].toLowerCase();\n if (match[0].length <= 3 && !constants_1.FULL_MONTH_NAME_DICTIONARY[monthName]) {\n return null;\n }\n const result = context.createParsingResult(match.index + (match[PREFIX_GROUP] || \"\").length, match.index + match[0].length);\n result.start.imply(\"day\", 1);\n const month = constants_1.MONTH_DICTIONARY[monthName];\n result.start.assign(\"month\", month);\n if (match[YEAR_GROUP]) {\n const year = constants_2.parseYear(match[YEAR_GROUP]);\n result.start.assign(\"year\", year);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, 1, month);\n result.start.imply(\"year\", year);\n }\n return result;\n }\n}\nexports.default = ENMonthNameParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENMonthNameParser.js?");
|
|
416
|
+
|
|
417
|
+
/***/ }),
|
|
418
|
+
|
|
419
|
+
/***/ "./dist/locales/en/parsers/ENRelativeDateFormatParser.js":
|
|
420
|
+
/*!***************************************************************!*\
|
|
421
|
+
!*** ./dist/locales/en/parsers/ENRelativeDateFormatParser.js ***!
|
|
422
|
+
\***************************************************************/
|
|
423
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
424
|
+
|
|
425
|
+
"use strict";
|
|
426
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst PATTERN = new RegExp(`(this|next|last|past)\\\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})(?=\\\\s*)` + \"(?=\\\\W|$)\", \"i\");\nconst MODIFIER_WORD_GROUP = 1;\nconst RELATIVE_WORD_GROUP = 2;\nclass ENRelativeDateFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const modifier = match[MODIFIER_WORD_GROUP].toLowerCase();\n const unitWord = match[RELATIVE_WORD_GROUP].toLowerCase();\n const timeunit = constants_1.TIME_UNIT_DICTIONARY[unitWord];\n if (modifier == \"next\") {\n const timeUnits = {};\n timeUnits[timeunit] = 1;\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, timeUnits);\n }\n if (modifier == \"last\" || modifier == \"past\") {\n const timeUnits = {};\n timeUnits[timeunit] = -1;\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, timeUnits);\n }\n const components = context.createParsingComponents();\n let date = dayjs_1.default(context.refDate);\n if (unitWord.match(/week/i)) {\n date = date.add(-date.get(\"d\"), \"d\");\n components.imply(\"day\", date.date());\n components.imply(\"month\", date.month() + 1);\n components.imply(\"year\", date.year());\n }\n else if (unitWord.match(/month/i)) {\n date = date.add(-date.date() + 1, \"d\");\n components.imply(\"day\", date.date());\n components.assign(\"year\", date.year());\n components.assign(\"month\", date.month() + 1);\n }\n else if (unitWord.match(/year/i)) {\n date = date.add(-date.date() + 1, \"d\");\n date = date.add(-date.month(), \"month\");\n components.imply(\"day\", date.date());\n components.imply(\"month\", date.month() + 1);\n components.assign(\"year\", date.year());\n }\n return components;\n }\n}\nexports.default = ENRelativeDateFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENRelativeDateFormatParser.js?");
|
|
427
|
+
|
|
428
|
+
/***/ }),
|
|
429
|
+
|
|
430
|
+
/***/ "./dist/locales/en/parsers/ENSlashMonthFormatParser.js":
|
|
431
|
+
/*!*************************************************************!*\
|
|
432
|
+
!*** ./dist/locales/en/parsers/ENSlashMonthFormatParser.js ***!
|
|
433
|
+
\*************************************************************/
|
|
434
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
435
|
+
|
|
436
|
+
"use strict";
|
|
437
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(\"([0-9]|0[1-9]|1[012])/([0-9]{4})\" + \"\", \"i\");\nconst MONTH_GROUP = 1;\nconst YEAR_GROUP = 2;\nclass ENSlashMonthFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const year = parseInt(match[YEAR_GROUP]);\n const month = parseInt(match[MONTH_GROUP]);\n return context.createParsingComponents().imply(\"day\", 1).assign(\"month\", month).assign(\"year\", year);\n }\n}\nexports.default = ENSlashMonthFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENSlashMonthFormatParser.js?");
|
|
438
|
+
|
|
439
|
+
/***/ }),
|
|
440
|
+
|
|
441
|
+
/***/ "./dist/locales/en/parsers/ENTimeExpressionParser.js":
|
|
442
|
+
/*!***********************************************************!*\
|
|
443
|
+
!*** ./dist/locales/en/parsers/ENTimeExpressionParser.js ***!
|
|
444
|
+
\***********************************************************/
|
|
445
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
446
|
+
|
|
447
|
+
"use strict";
|
|
448
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst AbstractTimeExpressionParser_1 = __webpack_require__(/*! ../../../common/parsers/AbstractTimeExpressionParser */ \"./dist/common/parsers/AbstractTimeExpressionParser.js\");\nclass ENTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {\n constructor(strictMode) {\n super(strictMode);\n }\n followingPhase() {\n return \"\\\\s*(?:\\\\-|\\\\–|\\\\~|\\\\〜|to|\\\\?)\\\\s*\";\n }\n primaryPrefix() {\n return \"(?:(?:at|from)\\\\s*)??\";\n }\n primarySuffix() {\n return \"(?:\\\\s*(?:o\\\\W*clock|at\\\\s*night|in\\\\s*the\\\\s*(?:morning|afternoon)))?(?!/)(?=\\\\W|$)\";\n }\n extractPrimaryTimeComponents(context, match) {\n const components = super.extractPrimaryTimeComponents(context, match);\n if (components) {\n if (match[0].endsWith(\"night\")) {\n const hour = components.get(\"hour\");\n if (hour >= 6 && hour < 12) {\n components.assign(\"hour\", components.get(\"hour\") + 12);\n components.assign(\"meridiem\", index_1.Meridiem.PM);\n }\n else if (hour < 6) {\n components.assign(\"meridiem\", index_1.Meridiem.AM);\n }\n }\n if (match[0].endsWith(\"afternoon\")) {\n components.assign(\"meridiem\", index_1.Meridiem.PM);\n const hour = components.get(\"hour\");\n if (hour >= 0 && hour <= 6) {\n components.assign(\"hour\", components.get(\"hour\") + 12);\n }\n }\n if (match[0].endsWith(\"morning\")) {\n components.assign(\"meridiem\", index_1.Meridiem.AM);\n const hour = components.get(\"hour\");\n if (hour < 12) {\n components.assign(\"hour\", components.get(\"hour\"));\n }\n }\n }\n return components;\n }\n}\nexports.default = ENTimeExpressionParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENTimeExpressionParser.js?");
|
|
449
|
+
|
|
450
|
+
/***/ }),
|
|
451
|
+
|
|
452
|
+
/***/ "./dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js":
|
|
453
|
+
/*!**************************************************************!*\
|
|
454
|
+
!*** ./dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js ***!
|
|
455
|
+
\**************************************************************/
|
|
456
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
457
|
+
|
|
458
|
+
"use strict";
|
|
459
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst timeunits_1 = __webpack_require__(/*! ../../../utils/timeunits */ \"./dist/utils/timeunits.js\");\nconst PATTERN = new RegExp(\"\" + \"(\" + constants_1.TIME_UNITS_PATTERN + \")\" + \"(?:ago|before|earlier)(?=(?:\\\\W|$))\", \"i\");\nconst STRICT_PATTERN = new RegExp(\"\" + \"(\" + constants_1.TIME_UNITS_PATTERN + \")\" + \"ago(?=(?:\\\\W|$))\", \"i\");\nclass ENTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n constructor(strictMode) {\n super();\n this.strictMode = strictMode;\n }\n innerPattern() {\n return this.strictMode ? STRICT_PATTERN : PATTERN;\n }\n innerExtract(context, match) {\n const timeUnits = constants_1.parseTimeUnits(match[1]);\n const outputTimeUnits = timeunits_1.reverseTimeUnits(timeUnits);\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, outputTimeUnits);\n }\n}\nexports.default = ENTimeUnitAgoFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js?");
|
|
460
|
+
|
|
461
|
+
/***/ }),
|
|
462
|
+
|
|
463
|
+
/***/ "./dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js":
|
|
464
|
+
/*!*************************************************************************!*\
|
|
465
|
+
!*** ./dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js ***!
|
|
466
|
+
\*************************************************************************/
|
|
467
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
468
|
+
|
|
469
|
+
"use strict";
|
|
470
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst timeunits_1 = __webpack_require__(/*! ../../../utils/timeunits */ \"./dist/utils/timeunits.js\");\nconst PATTERN = new RegExp(`(this|last|past|next|\\\\+|-)\\\\s*(${constants_1.TIME_UNITS_PATTERN})(?=\\\\W|$)`, \"i\");\nclass ENTimeUnitCasualRelativeFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const prefix = match[1].toLowerCase();\n let timeUnits = constants_1.parseTimeUnits(match[2]);\n switch (prefix) {\n case \"last\":\n case \"past\":\n case \"-\":\n timeUnits = timeunits_1.reverseTimeUnits(timeUnits);\n break;\n }\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, timeUnits);\n }\n}\nexports.default = ENTimeUnitCasualRelativeFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js?");
|
|
471
|
+
|
|
472
|
+
/***/ }),
|
|
473
|
+
|
|
474
|
+
/***/ "./dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js":
|
|
475
|
+
/*!****************************************************************!*\
|
|
476
|
+
!*** ./dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js ***!
|
|
477
|
+
\****************************************************************/
|
|
478
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
479
|
+
|
|
480
|
+
"use strict";
|
|
481
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(\"\" + \"(\" + constants_1.TIME_UNITS_PATTERN + \")\" + \"(later|after|from now|henceforth|forward|out)\" + \"(?=(?:\\\\W|$))\", \"i\");\nconst STRICT_PATTERN = new RegExp(\"\" + \"(\" + constants_1.TIME_UNITS_PATTERN + \")\" + \"(later|from now)\" + \"(?=(?:\\\\W|$))\", \"i\");\nconst GROUP_NUM_TIMEUNITS = 1;\nclass ENTimeUnitLaterFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n constructor(strictMode) {\n super();\n this.strictMode = strictMode;\n }\n innerPattern() {\n return this.strictMode ? STRICT_PATTERN : PATTERN;\n }\n innerExtract(context, match) {\n const fragments = constants_1.parseTimeUnits(match[GROUP_NUM_TIMEUNITS]);\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, fragments);\n }\n}\nexports.default = ENTimeUnitLaterFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js?");
|
|
482
|
+
|
|
483
|
+
/***/ }),
|
|
484
|
+
|
|
485
|
+
/***/ "./dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js":
|
|
486
|
+
/*!*****************************************************************!*\
|
|
487
|
+
!*** ./dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js ***!
|
|
488
|
+
\*****************************************************************/
|
|
489
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
490
|
+
|
|
491
|
+
"use strict";
|
|
492
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN_WITH_PREFIX = new RegExp(`(?:within|in|for)\\\\s*` +\n `(?:(?:about|around|roughly|approximately|just)\\\\s*(?:~\\\\s*)?)?(${constants_1.TIME_UNITS_PATTERN})(?=\\\\W|$)`, \"i\");\nconst PATTERN_WITHOUT_PREFIX = new RegExp(`(?:(?:about|around|roughly|approximately|just)\\\\s*(?:~\\\\s*)?)?(${constants_1.TIME_UNITS_PATTERN})(?=\\\\W|$)`, \"i\");\nclass ENTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return context.option.forwardDate ? PATTERN_WITHOUT_PREFIX : PATTERN_WITH_PREFIX;\n }\n innerExtract(context, match) {\n const timeUnits = constants_1.parseTimeUnits(match[1]);\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, timeUnits);\n }\n}\nexports.default = ENTimeUnitWithinFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js?");
|
|
493
|
+
|
|
494
|
+
/***/ }),
|
|
495
|
+
|
|
496
|
+
/***/ "./dist/locales/en/parsers/ENWeekdayParser.js":
|
|
497
|
+
/*!****************************************************!*\
|
|
498
|
+
!*** ./dist/locales/en/parsers/ENWeekdayParser.js ***!
|
|
499
|
+
\****************************************************/
|
|
500
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
501
|
+
|
|
502
|
+
"use strict";
|
|
503
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/en/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst weeks_1 = __webpack_require__(/*! ../../../calculation/weeks */ \"./dist/calculation/weeks.js\");\nconst PATTERN = new RegExp(\"(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?\" +\n \"(?:on\\\\s*?)?\" +\n \"(?:(this|last|past|next)\\\\s*)?\" +\n `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` +\n \"(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?\" +\n \"(?:\\\\s*(this|last|past|next)\\\\s*week)?\" +\n \"(?=\\\\W|$)\", \"i\");\nconst PREFIX_GROUP = 1;\nconst WEEKDAY_GROUP = 2;\nconst POSTFIX_GROUP = 3;\nclass ENWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];\n const prefix = match[PREFIX_GROUP];\n const postfix = match[POSTFIX_GROUP];\n let modifierWord = prefix || postfix;\n modifierWord = modifierWord || \"\";\n modifierWord = modifierWord.toLowerCase();\n let modifier = null;\n if (modifierWord == \"last\" || modifierWord == \"past\") {\n modifier = \"last\";\n }\n else if (modifierWord == \"next\") {\n modifier = \"next\";\n }\n else if (modifierWord == \"this\") {\n modifier = \"this\";\n }\n const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);\n return context\n .createParsingComponents()\n .assign(\"weekday\", offset)\n .imply(\"day\", date.date())\n .imply(\"month\", date.month() + 1)\n .imply(\"year\", date.year());\n }\n}\nexports.default = ENWeekdayParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/parsers/ENWeekdayParser.js?");
|
|
504
|
+
|
|
505
|
+
/***/ }),
|
|
506
|
+
|
|
507
|
+
/***/ "./dist/locales/en/refiners/ENMergeDateRangeRefiner.js":
|
|
508
|
+
/*!*************************************************************!*\
|
|
509
|
+
!*** ./dist/locales/en/refiners/ENMergeDateRangeRefiner.js ***!
|
|
510
|
+
\*************************************************************/
|
|
511
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
512
|
+
|
|
513
|
+
"use strict";
|
|
514
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateRangeRefiner */ \"./dist/common/refiners/AbstractMergeDateRangeRefiner.js\"));\nclass ENMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {\n patternBetween() {\n return /^\\s*(to|-)\\s*$/i;\n }\n}\nexports.default = ENMergeDateRangeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/refiners/ENMergeDateRangeRefiner.js?");
|
|
515
|
+
|
|
516
|
+
/***/ }),
|
|
517
|
+
|
|
518
|
+
/***/ "./dist/locales/en/refiners/ENMergeDateTimeRefiner.js":
|
|
519
|
+
/*!************************************************************!*\
|
|
520
|
+
!*** ./dist/locales/en/refiners/ENMergeDateTimeRefiner.js ***!
|
|
521
|
+
\************************************************************/
|
|
522
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
523
|
+
|
|
524
|
+
"use strict";
|
|
525
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateTimeRefiner */ \"./dist/common/refiners/AbstractMergeDateTimeRefiner.js\"));\nclass ENMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {\n patternBetween() {\n return new RegExp(\"^\\\\s*(T|at|after|before|on|of|,|-)?\\\\s*$\");\n }\n}\nexports.default = ENMergeDateTimeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/en/refiners/ENMergeDateTimeRefiner.js?");
|
|
526
|
+
|
|
527
|
+
/***/ }),
|
|
528
|
+
|
|
529
|
+
/***/ "./dist/locales/fr/constants.js":
|
|
530
|
+
/*!**************************************!*\
|
|
531
|
+
!*** ./dist/locales/fr/constants.js ***!
|
|
532
|
+
\**************************************/
|
|
533
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
534
|
+
|
|
535
|
+
"use strict";
|
|
536
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;\nconst pattern_1 = __webpack_require__(/*! ../../utils/pattern */ \"./dist/utils/pattern.js\");\nexports.WEEKDAY_DICTIONARY = {\n \"dimanche\": 0,\n \"dim\": 0,\n \"lundi\": 1,\n \"lun\": 1,\n \"mardi\": 2,\n \"mar\": 2,\n \"mercredi\": 3,\n \"mer\": 3,\n \"jeudi\": 4,\n \"jeu\": 4,\n \"vendredi\": 5,\n \"ven\": 5,\n \"samedi\": 6,\n \"sam\": 6,\n};\nexports.MONTH_DICTIONARY = {\n \"janvier\": 1,\n \"jan\": 1,\n \"jan.\": 1,\n \"février\": 2,\n \"fév\": 2,\n \"fév.\": 2,\n \"fevrier\": 2,\n \"fev\": 2,\n \"fev.\": 2,\n \"mars\": 3,\n \"mar\": 3,\n \"mar.\": 3,\n \"avril\": 4,\n \"avr\": 4,\n \"avr.\": 4,\n \"mai\": 5,\n \"juin\": 6,\n \"jun\": 6,\n \"juillet\": 7,\n \"juil\": 7,\n \"jul\": 7,\n \"jul.\": 7,\n \"août\": 8,\n \"aout\": 8,\n \"septembre\": 9,\n \"sep\": 9,\n \"sep.\": 9,\n \"sept\": 9,\n \"sept.\": 9,\n \"octobre\": 10,\n \"oct\": 10,\n \"oct.\": 10,\n \"novembre\": 11,\n \"nov\": 11,\n \"nov.\": 11,\n \"décembre\": 12,\n \"decembre\": 12,\n \"dec\": 12,\n \"dec.\": 12,\n};\nexports.INTEGER_WORD_DICTIONARY = {\n \"un\": 1,\n \"deux\": 2,\n \"trois\": 3,\n \"quatre\": 4,\n \"cinq\": 5,\n \"six\": 6,\n \"sept\": 7,\n \"huit\": 8,\n \"neuf\": 9,\n \"dix\": 10,\n \"onze\": 11,\n \"douze\": 12,\n \"treize\": 13,\n};\nexports.TIME_UNIT_DICTIONARY = {\n \"sec\": \"second\",\n \"seconde\": \"second\",\n \"secondes\": \"second\",\n \"min\": \"minute\",\n \"mins\": \"minute\",\n \"minute\": \"minute\",\n \"minutes\": \"minute\",\n \"h\": \"hour\",\n \"hr\": \"hour\",\n \"hrs\": \"hour\",\n \"heure\": \"hour\",\n \"heures\": \"hour\",\n \"jour\": \"d\",\n \"jours\": \"d\",\n \"semaine\": \"week\",\n \"semaines\": \"week\",\n \"mois\": \"month\",\n \"trimestre\": \"quarter\",\n \"trimestres\": \"quarter\",\n \"ans\": \"year\",\n \"année\": \"year\",\n \"années\": \"year\",\n};\nexports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\\\.[0-9]+|une?|quelques?|demi-?)`;\nfunction parseNumberPattern(match) {\n const num = match.toLowerCase();\n if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) {\n return exports.INTEGER_WORD_DICTIONARY[num];\n }\n else if (num === \"une\" || num === \"un\") {\n return 1;\n }\n else if (num.match(/quelques?/)) {\n return 3;\n }\n else if (num.match(/demi-?/)) {\n return 0.5;\n }\n return parseFloat(num);\n}\nexports.parseNumberPattern = parseNumberPattern;\nexports.ORDINAL_NUMBER_PATTERN = `(?:[0-9]{1,2}(?:er)?)`;\nfunction parseOrdinalNumberPattern(match) {\n let num = match.toLowerCase();\n num = num.replace(/(?:er)$/i, \"\");\n return parseInt(num);\n}\nexports.parseOrdinalNumberPattern = parseOrdinalNumberPattern;\nexports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\\\s*(?:AC|AD|p\\\\.\\\\s*C(?:hr?)?\\\\.\\\\s*n\\\\.)|[1-2][0-9]{3}|[5-9][0-9])`;\nfunction parseYear(match) {\n if (/AC/i.test(match)) {\n match = match.replace(/BC/i, \"\");\n return -parseInt(match);\n }\n if (/AD/i.test(match) || /C/i.test(match)) {\n match = match.replace(/[^\\d]+/i, \"\");\n return parseInt(match);\n }\n let yearNumber = parseInt(match);\n if (yearNumber < 100) {\n if (yearNumber > 50) {\n yearNumber = yearNumber + 1900;\n }\n else {\n yearNumber = yearNumber + 2000;\n }\n }\n return yearNumber;\n}\nexports.parseYear = parseYear;\nconst SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\\\s{0,5}`;\nconst SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, \"i\");\nexports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(\"\", SINGLE_TIME_UNIT_PATTERN);\nfunction parseTimeUnits(timeunitText) {\n const fragments = {};\n let remainingText = timeunitText;\n let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);\n while (match) {\n collectDateTimeFragment(fragments, match);\n remainingText = remainingText.substring(match[0].length);\n match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);\n }\n return fragments;\n}\nexports.parseTimeUnits = parseTimeUnits;\nfunction collectDateTimeFragment(fragments, match) {\n const num = parseNumberPattern(match[1]);\n const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()];\n fragments[unit] = num;\n}\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/constants.js?");
|
|
537
|
+
|
|
538
|
+
/***/ }),
|
|
539
|
+
|
|
540
|
+
/***/ "./dist/locales/fr/index.js":
|
|
541
|
+
/*!**********************************!*\
|
|
542
|
+
!*** ./dist/locales/fr/index.js ***!
|
|
543
|
+
\**********************************/
|
|
544
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
545
|
+
|
|
546
|
+
"use strict";
|
|
547
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;\nconst configurations_1 = __webpack_require__(/*! ../../configurations */ \"./dist/configurations.js\");\nconst chrono_1 = __webpack_require__(/*! ../../chrono */ \"./dist/chrono.js\");\nconst FRCasualDateParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRCasualDateParser */ \"./dist/locales/fr/parsers/FRCasualDateParser.js\"));\nconst FRCasualTimeParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRCasualTimeParser */ \"./dist/locales/fr/parsers/FRCasualTimeParser.js\"));\nconst SlashDateFormatParser_1 = __importDefault(__webpack_require__(/*! ../../common/parsers/SlashDateFormatParser */ \"./dist/common/parsers/SlashDateFormatParser.js\"));\nconst FRTimeExpressionParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRTimeExpressionParser */ \"./dist/locales/fr/parsers/FRTimeExpressionParser.js\"));\nconst FRMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/FRMergeDateTimeRefiner */ \"./dist/locales/fr/refiners/FRMergeDateTimeRefiner.js\"));\nconst FRMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/FRMergeDateRangeRefiner */ \"./dist/locales/fr/refiners/FRMergeDateRangeRefiner.js\"));\nconst FRWeekdayParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRWeekdayParser */ \"./dist/locales/fr/parsers/FRWeekdayParser.js\"));\nconst FRSpecificTimeExpressionParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRSpecificTimeExpressionParser */ \"./dist/locales/fr/parsers/FRSpecificTimeExpressionParser.js\"));\nconst FRMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRMonthNameLittleEndianParser */ \"./dist/locales/fr/parsers/FRMonthNameLittleEndianParser.js\"));\nconst FRTimeUnitAgoFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRTimeUnitAgoFormatParser */ \"./dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js\"));\nconst FRTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRTimeUnitWithinFormatParser */ \"./dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js\"));\nconst FRTimeUnitRelativeFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/FRTimeUnitRelativeFormatParser */ \"./dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js\"));\nexports.casual = new chrono_1.Chrono(createCasualConfiguration());\nexports.strict = new chrono_1.Chrono(createConfiguration(true));\nfunction parse(text, ref, option) {\n return exports.casual.parse(text, ref, option);\n}\nexports.parse = parse;\nfunction parseDate(text, ref, option) {\n return exports.casual.parseDate(text, ref, option);\n}\nexports.parseDate = parseDate;\nfunction createCasualConfiguration(littleEndian = true) {\n const option = createConfiguration(false, littleEndian);\n option.parsers.unshift(new FRCasualDateParser_1.default());\n option.parsers.unshift(new FRCasualTimeParser_1.default());\n option.parsers.unshift(new FRTimeUnitRelativeFormatParser_1.default());\n return option;\n}\nexports.createCasualConfiguration = createCasualConfiguration;\nfunction createConfiguration(strictMode = true, littleEndian = true) {\n return configurations_1.includeCommonConfiguration({\n parsers: [\n new SlashDateFormatParser_1.default(littleEndian),\n new FRMonthNameLittleEndianParser_1.default(),\n new FRTimeExpressionParser_1.default(),\n new FRSpecificTimeExpressionParser_1.default(),\n new FRTimeUnitAgoFormatParser_1.default(),\n new FRTimeUnitWithinFormatParser_1.default(),\n new FRWeekdayParser_1.default(),\n ],\n refiners: [new FRMergeDateTimeRefiner_1.default(), new FRMergeDateRangeRefiner_1.default()],\n }, strictMode);\n}\nexports.createConfiguration = createConfiguration;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/index.js?");
|
|
548
|
+
|
|
549
|
+
/***/ }),
|
|
550
|
+
|
|
551
|
+
/***/ "./dist/locales/fr/parsers/FRCasualDateParser.js":
|
|
552
|
+
/*!*******************************************************!*\
|
|
553
|
+
!*** ./dist/locales/fr/parsers/FRCasualDateParser.js ***!
|
|
554
|
+
\*******************************************************/
|
|
555
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
556
|
+
|
|
557
|
+
"use strict";
|
|
558
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst dayjs_2 = __webpack_require__(/*! ../../../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst references = __importStar(__webpack_require__(/*! ../../../common/casualReferences */ \"./dist/common/casualReferences.js\"));\nclass FRCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return /(maintenant|aujourd'hui|demain|hier|cette\\s*nuit|la\\s*veille)(?=\\W|$)/i;\n }\n innerExtract(context, match) {\n let targetDate = dayjs_1.default(context.refDate);\n const lowerText = match[0].toLowerCase();\n const component = context.createParsingComponents();\n switch (lowerText) {\n case \"maintenant\":\n return references.now(context.refDate);\n case \"aujourd'hui\":\n return references.today(context.refDate);\n case \"hier\":\n return references.yesterday(context.refDate);\n case \"demain\":\n return references.tomorrow(context.refDate);\n default:\n if (lowerText.match(/cette\\s*nuit/)) {\n dayjs_2.assignSimilarDate(component, targetDate);\n component.imply(\"hour\", 22);\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n }\n else if (lowerText.match(/la\\s*veille/)) {\n targetDate = targetDate.add(-1, \"day\");\n dayjs_2.assignSimilarDate(component, targetDate);\n component.imply(\"hour\", 0);\n }\n }\n return component;\n }\n}\nexports.default = FRCasualDateParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRCasualDateParser.js?");
|
|
559
|
+
|
|
560
|
+
/***/ }),
|
|
561
|
+
|
|
562
|
+
/***/ "./dist/locales/fr/parsers/FRCasualTimeParser.js":
|
|
563
|
+
/*!*******************************************************!*\
|
|
564
|
+
!*** ./dist/locales/fr/parsers/FRCasualTimeParser.js ***!
|
|
565
|
+
\*******************************************************/
|
|
566
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
567
|
+
|
|
568
|
+
"use strict";
|
|
569
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nclass FRCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return /(cet?)?\\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\\W|$)/i;\n }\n innerExtract(context, match) {\n const suffixLower = match[2].toLowerCase();\n const component = context.createParsingComponents();\n switch (suffixLower) {\n case \"après-midi\":\n case \"aprem\":\n component.imply(\"hour\", 14);\n component.imply(\"minute\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n break;\n case \"soir\":\n component.imply(\"hour\", 18);\n component.imply(\"minute\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n break;\n case \"matin\":\n component.imply(\"hour\", 8);\n component.imply(\"minute\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n break;\n case \"a midi\":\n component.imply(\"hour\", 12);\n component.imply(\"minute\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n break;\n case \"à minuit\":\n component.imply(\"hour\", 0);\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n break;\n }\n return component;\n }\n}\nexports.default = FRCasualTimeParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRCasualTimeParser.js?");
|
|
570
|
+
|
|
571
|
+
/***/ }),
|
|
572
|
+
|
|
573
|
+
/***/ "./dist/locales/fr/parsers/FRMonthNameLittleEndianParser.js":
|
|
574
|
+
/*!******************************************************************!*\
|
|
575
|
+
!*** ./dist/locales/fr/parsers/FRMonthNameLittleEndianParser.js ***!
|
|
576
|
+
\******************************************************************/
|
|
577
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
578
|
+
|
|
579
|
+
"use strict";
|
|
580
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/fr/constants.js\");\nconst constants_2 = __webpack_require__(/*! ../constants */ \"./dist/locales/fr/constants.js\");\nconst constants_3 = __webpack_require__(/*! ../constants */ \"./dist/locales/fr/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(\"(?:on\\\\s*?)?\" +\n `(${constants_3.ORDINAL_NUMBER_PATTERN})` +\n `(?:\\\\s*(?:au|\\\\-|\\\\–|jusqu'au?|\\\\s)\\\\s*(${constants_3.ORDINAL_NUMBER_PATTERN}))?` +\n `(?:-|/|\\\\s*(?:de)?\\\\s*)` +\n `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` +\n `(?:(?:-|/|,?\\\\s*)(${constants_2.YEAR_PATTERN}(?![^\\\\s]\\\\d)))?` +\n `(?=\\\\W|$)`, \"i\");\nconst DATE_GROUP = 1;\nconst DATE_TO_GROUP = 2;\nconst MONTH_NAME_GROUP = 3;\nconst YEAR_GROUP = 4;\nclass FRMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const result = context.createParsingResult(match.index, match[0]);\n const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];\n const day = constants_3.parseOrdinalNumberPattern(match[DATE_GROUP]);\n if (day > 31) {\n match.index = match.index + match[DATE_GROUP].length;\n return null;\n }\n result.start.assign(\"month\", month);\n result.start.assign(\"day\", day);\n if (match[YEAR_GROUP]) {\n const yearNumber = constants_2.parseYear(match[YEAR_GROUP]);\n result.start.assign(\"year\", yearNumber);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, day, month);\n result.start.imply(\"year\", year);\n }\n if (match[DATE_TO_GROUP]) {\n const endDate = constants_3.parseOrdinalNumberPattern(match[DATE_TO_GROUP]);\n result.end = result.start.clone();\n result.end.assign(\"day\", endDate);\n }\n return result;\n }\n}\nexports.default = FRMonthNameLittleEndianParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRMonthNameLittleEndianParser.js?");
|
|
581
|
+
|
|
582
|
+
/***/ }),
|
|
583
|
+
|
|
584
|
+
/***/ "./dist/locales/fr/parsers/FRSpecificTimeExpressionParser.js":
|
|
585
|
+
/*!*******************************************************************!*\
|
|
586
|
+
!*** ./dist/locales/fr/parsers/FRSpecificTimeExpressionParser.js ***!
|
|
587
|
+
\*******************************************************************/
|
|
588
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
589
|
+
|
|
590
|
+
"use strict";
|
|
591
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:[àa])\\\\s*)?\" +\n \"(\\\\d{1,2})(?:h|:)?\" +\n \"(?:(\\\\d{1,2})(?:m|:)?)?\" +\n \"(?:(\\\\d{1,2})(?:s|:)?)?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", \"i\");\nconst SECOND_REG_PATTERN = new RegExp(\"^\\\\s*(\\\\-|\\\\–|\\\\~|\\\\〜|[àa]|\\\\?)\\\\s*\" +\n \"(\\\\d{1,2})(?:h|:)?\" +\n \"(?:(\\\\d{1,2})(?:m|:)?)?\" +\n \"(?:(\\\\d{1,2})(?:s|:)?)?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", \"i\");\nconst HOUR_GROUP = 2;\nconst MINUTE_GROUP = 3;\nconst SECOND_GROUP = 4;\nconst AM_PM_HOUR_GROUP = 5;\nclass FRSpecificTimeExpressionParser {\n pattern(context) {\n return FIRST_REG_PATTERN;\n }\n extract(context, match) {\n const result = context.createParsingResult(match.index + match[1].length, match[0].substring(match[1].length));\n if (result.text.match(/^\\d{4}$/)) {\n match.index += match[0].length;\n return null;\n }\n result.start = FRSpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), match);\n if (!result.start) {\n match.index += match[0].length;\n return null;\n }\n const remainingText = context.text.substring(match.index + match[0].length);\n const secondMatch = SECOND_REG_PATTERN.exec(remainingText);\n if (secondMatch) {\n result.end = FRSpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), secondMatch);\n if (result.end) {\n result.text += secondMatch[0];\n }\n }\n return result;\n }\n static extractTimeComponent(extractingComponents, match) {\n let hour = 0;\n let minute = 0;\n let meridiem = null;\n hour = parseInt(match[HOUR_GROUP]);\n if (match[MINUTE_GROUP] != null) {\n minute = parseInt(match[MINUTE_GROUP]);\n }\n if (minute >= 60 || hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = index_1.Meridiem.PM;\n }\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12)\n return null;\n const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = index_1.Meridiem.AM;\n if (hour == 12) {\n hour = 0;\n }\n }\n if (ampm == \"p\") {\n meridiem = index_1.Meridiem.PM;\n if (hour != 12) {\n hour += 12;\n }\n }\n }\n extractingComponents.assign(\"hour\", hour);\n extractingComponents.assign(\"minute\", minute);\n if (meridiem !== null) {\n extractingComponents.assign(\"meridiem\", meridiem);\n }\n else {\n if (hour < 12) {\n extractingComponents.imply(\"meridiem\", index_1.Meridiem.AM);\n }\n else {\n extractingComponents.imply(\"meridiem\", index_1.Meridiem.PM);\n }\n }\n if (match[SECOND_GROUP] != null) {\n const second = parseInt(match[SECOND_GROUP]);\n if (second >= 60)\n return null;\n extractingComponents.assign(\"second\", second);\n }\n return extractingComponents;\n }\n}\nexports.default = FRSpecificTimeExpressionParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRSpecificTimeExpressionParser.js?");
|
|
592
|
+
|
|
593
|
+
/***/ }),
|
|
594
|
+
|
|
595
|
+
/***/ "./dist/locales/fr/parsers/FRTimeExpressionParser.js":
|
|
596
|
+
/*!***********************************************************!*\
|
|
597
|
+
!*** ./dist/locales/fr/parsers/FRTimeExpressionParser.js ***!
|
|
598
|
+
\***********************************************************/
|
|
599
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
600
|
+
|
|
601
|
+
"use strict";
|
|
602
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractTimeExpressionParser_1 = __webpack_require__(/*! ../../../common/parsers/AbstractTimeExpressionParser */ \"./dist/common/parsers/AbstractTimeExpressionParser.js\");\nclass FRTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {\n primaryPrefix() {\n return \"(?:(?:[àa])\\\\s*)?\";\n }\n followingPhase() {\n return \"\\\\s*(?:\\\\-|\\\\–|\\\\~|\\\\〜|[àa]|\\\\?)\\\\s*\";\n }\n extractPrimaryTimeComponents(context, match) {\n if (match[0].match(/^\\s*\\d{4}\\s*$/)) {\n return null;\n }\n return super.extractPrimaryTimeComponents(context, match);\n }\n}\nexports.default = FRTimeExpressionParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRTimeExpressionParser.js?");
|
|
603
|
+
|
|
604
|
+
/***/ }),
|
|
605
|
+
|
|
606
|
+
/***/ "./dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js":
|
|
607
|
+
/*!**************************************************************!*\
|
|
608
|
+
!*** ./dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js ***!
|
|
609
|
+
\**************************************************************/
|
|
610
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
611
|
+
|
|
612
|
+
"use strict";
|
|
613
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/fr/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst timeunits_1 = __webpack_require__(/*! ../../../utils/timeunits */ \"./dist/utils/timeunits.js\");\nclass FRTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n constructor() {\n super();\n }\n innerPattern() {\n return new RegExp(`il y a\\\\s*(${constants_1.TIME_UNITS_PATTERN})(?=(?:\\\\W|$))`, \"i\");\n }\n innerExtract(context, match) {\n const timeUnits = constants_1.parseTimeUnits(match[1]);\n const outputTimeUnits = timeunits_1.reverseTimeUnits(timeUnits);\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, outputTimeUnits);\n }\n}\nexports.default = FRTimeUnitAgoFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js?");
|
|
614
|
+
|
|
615
|
+
/***/ }),
|
|
616
|
+
|
|
617
|
+
/***/ "./dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js":
|
|
618
|
+
/*!*******************************************************************!*\
|
|
619
|
+
!*** ./dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js ***!
|
|
620
|
+
\*******************************************************************/
|
|
621
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
622
|
+
|
|
623
|
+
"use strict";
|
|
624
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/fr/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst timeunits_1 = __webpack_require__(/*! ../../../utils/timeunits */ \"./dist/utils/timeunits.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nclass FRTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n constructor() {\n super();\n }\n innerPattern() {\n return new RegExp(`(?:les?|la|l'|du|des?)\\\\s*` +\n `(${constants_1.NUMBER_PATTERN})?` +\n `(?:\\\\s*(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?))?` +\n `\\\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})` +\n `(?:\\\\s*(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?))?`, \"i\");\n }\n innerExtract(context, match) {\n const num = match[1] ? constants_1.parseNumberPattern(match[1]) : 1;\n const unit = constants_1.TIME_UNIT_DICTIONARY[match[3].toLowerCase()];\n let timeUnits = {};\n timeUnits[unit] = num;\n let modifier = match[2] || match[4] || \"\";\n modifier = modifier.toLowerCase();\n if (!modifier) {\n return;\n }\n if (/derni[eè]re?s?/.test(modifier) || /pass[ée]e?s?/.test(modifier) || /pr[ée]c[ée]dents?/.test(modifier)) {\n timeUnits = timeunits_1.reverseTimeUnits(timeUnits);\n }\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, timeUnits);\n }\n}\nexports.default = FRTimeUnitAgoFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js?");
|
|
625
|
+
|
|
626
|
+
/***/ }),
|
|
627
|
+
|
|
628
|
+
/***/ "./dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js":
|
|
629
|
+
/*!*****************************************************************!*\
|
|
630
|
+
!*** ./dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js ***!
|
|
631
|
+
\*****************************************************************/
|
|
632
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
633
|
+
|
|
634
|
+
"use strict";
|
|
635
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/fr/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nclass FRTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return new RegExp(`(?:dans|en|pour|pendant)\\\\s*(${constants_1.TIME_UNITS_PATTERN})(?=\\\\W|$)`, \"i\");\n }\n innerExtract(context, match) {\n const timeUnits = constants_1.parseTimeUnits(match[1]);\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, timeUnits);\n }\n}\nexports.default = FRTimeUnitWithinFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js?");
|
|
636
|
+
|
|
637
|
+
/***/ }),
|
|
638
|
+
|
|
639
|
+
/***/ "./dist/locales/fr/parsers/FRWeekdayParser.js":
|
|
640
|
+
/*!****************************************************!*\
|
|
641
|
+
!*** ./dist/locales/fr/parsers/FRWeekdayParser.js ***!
|
|
642
|
+
\****************************************************/
|
|
643
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
644
|
+
|
|
645
|
+
"use strict";
|
|
646
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/fr/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst weeks_1 = __webpack_require__(/*! ../../../calculation/weeks */ \"./dist/calculation/weeks.js\");\nconst PATTERN = new RegExp(\"(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?\" +\n \"(?:(?:ce)\\\\s*)?\" +\n `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` +\n \"(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?\" +\n \"(?:\\\\s*(dernier|prochain)\\\\s*)?\" +\n \"(?=\\\\W|\\\\d|$)\", \"i\");\nconst WEEKDAY_GROUP = 1;\nconst POSTFIX_GROUP = 2;\nclass FRWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];\n if (offset === undefined) {\n return null;\n }\n let suffix = match[POSTFIX_GROUP];\n suffix = suffix || \"\";\n suffix = suffix.toLowerCase();\n let modifier = null;\n if (suffix == \"dernier\") {\n modifier = \"last\";\n }\n else if (suffix == \"prochain\") {\n modifier = \"next\";\n }\n const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);\n return context\n .createParsingComponents()\n .assign(\"weekday\", offset)\n .imply(\"day\", date.date())\n .imply(\"month\", date.month() + 1)\n .imply(\"year\", date.year());\n }\n}\nexports.default = FRWeekdayParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/parsers/FRWeekdayParser.js?");
|
|
647
|
+
|
|
648
|
+
/***/ }),
|
|
649
|
+
|
|
650
|
+
/***/ "./dist/locales/fr/refiners/FRMergeDateRangeRefiner.js":
|
|
651
|
+
/*!*************************************************************!*\
|
|
652
|
+
!*** ./dist/locales/fr/refiners/FRMergeDateRangeRefiner.js ***!
|
|
653
|
+
\*************************************************************/
|
|
654
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
655
|
+
|
|
656
|
+
"use strict";
|
|
657
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateRangeRefiner */ \"./dist/common/refiners/AbstractMergeDateRangeRefiner.js\"));\nclass FRMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {\n patternBetween() {\n return /^\\s*(à|a|-)\\s*$/i;\n }\n}\nexports.default = FRMergeDateRangeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/refiners/FRMergeDateRangeRefiner.js?");
|
|
658
|
+
|
|
659
|
+
/***/ }),
|
|
660
|
+
|
|
661
|
+
/***/ "./dist/locales/fr/refiners/FRMergeDateTimeRefiner.js":
|
|
662
|
+
/*!************************************************************!*\
|
|
663
|
+
!*** ./dist/locales/fr/refiners/FRMergeDateTimeRefiner.js ***!
|
|
664
|
+
\************************************************************/
|
|
665
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
666
|
+
|
|
667
|
+
"use strict";
|
|
668
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateTimeRefiner */ \"./dist/common/refiners/AbstractMergeDateTimeRefiner.js\"));\nclass FRMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {\n patternBetween() {\n return new RegExp(\"^\\\\s*(T|à|a|vers|de|,|-)?\\\\s*$\");\n }\n}\nexports.default = FRMergeDateTimeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/fr/refiners/FRMergeDateTimeRefiner.js?");
|
|
669
|
+
|
|
670
|
+
/***/ }),
|
|
671
|
+
|
|
672
|
+
/***/ "./dist/locales/ja/constants.js":
|
|
673
|
+
/*!**************************************!*\
|
|
674
|
+
!*** ./dist/locales/ja/constants.js ***!
|
|
675
|
+
\**************************************/
|
|
676
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
677
|
+
|
|
678
|
+
"use strict";
|
|
679
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.toHankaku = void 0;\nfunction toHankaku(text) {\n return String(text)\n .replace(/\\u2019/g, \"\\u0027\")\n .replace(/\\u201D/g, \"\\u0022\")\n .replace(/\\u3000/g, \"\\u0020\")\n .replace(/\\uFFE5/g, \"\\u00A5\")\n .replace(/[\\uFF01\\uFF03-\\uFF06\\uFF08\\uFF09\\uFF0C-\\uFF19\\uFF1C-\\uFF1F\\uFF21-\\uFF3B\\uFF3D\\uFF3F\\uFF41-\\uFF5B\\uFF5D\\uFF5E]/g, alphaNum);\n}\nexports.toHankaku = toHankaku;\nfunction alphaNum(token) {\n return String.fromCharCode(token.charCodeAt(0) - 65248);\n}\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/ja/constants.js?");
|
|
680
|
+
|
|
681
|
+
/***/ }),
|
|
682
|
+
|
|
683
|
+
/***/ "./dist/locales/ja/index.js":
|
|
684
|
+
/*!**********************************!*\
|
|
685
|
+
!*** ./dist/locales/ja/index.js ***!
|
|
686
|
+
\**********************************/
|
|
687
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
688
|
+
|
|
689
|
+
"use strict";
|
|
690
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;\nconst JPStandardParser_1 = __importDefault(__webpack_require__(/*! ./parsers/JPStandardParser */ \"./dist/locales/ja/parsers/JPStandardParser.js\"));\nconst JPMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/JPMergeDateRangeRefiner */ \"./dist/locales/ja/refiners/JPMergeDateRangeRefiner.js\"));\nconst JPCasualDateParser_1 = __importDefault(__webpack_require__(/*! ./parsers/JPCasualDateParser */ \"./dist/locales/ja/parsers/JPCasualDateParser.js\"));\nconst chrono_1 = __webpack_require__(/*! ../../chrono */ \"./dist/chrono.js\");\nexports.casual = new chrono_1.Chrono(createCasualConfiguration());\nexports.strict = new chrono_1.Chrono(createConfiguration());\nfunction parse(text, ref, option) {\n return exports.casual.parse(text, ref, option);\n}\nexports.parse = parse;\nfunction parseDate(text, ref, option) {\n return exports.casual.parseDate(text, ref, option);\n}\nexports.parseDate = parseDate;\nfunction createCasualConfiguration() {\n const option = createConfiguration();\n option.parsers.unshift(new JPCasualDateParser_1.default());\n return option;\n}\nexports.createCasualConfiguration = createCasualConfiguration;\nfunction createConfiguration() {\n return {\n parsers: [new JPStandardParser_1.default()],\n refiners: [new JPMergeDateRangeRefiner_1.default()],\n };\n}\nexports.createConfiguration = createConfiguration;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/ja/index.js?");
|
|
691
|
+
|
|
692
|
+
/***/ }),
|
|
693
|
+
|
|
694
|
+
/***/ "./dist/locales/ja/parsers/JPCasualDateParser.js":
|
|
695
|
+
/*!*******************************************************!*\
|
|
696
|
+
!*** ./dist/locales/ja/parsers/JPCasualDateParser.js ***!
|
|
697
|
+
\*******************************************************/
|
|
698
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
699
|
+
|
|
700
|
+
"use strict";
|
|
701
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst references = __importStar(__webpack_require__(/*! ../../../common/casualReferences */ \"./dist/common/casualReferences.js\"));\nconst PATTERN = /今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i;\nclass JPCasualDateParser {\n pattern() {\n return PATTERN;\n }\n extract(context, match) {\n const text = match[0];\n const date = dayjs_1.default(context.refDate);\n const components = context.createParsingComponents();\n switch (text) {\n case \"昨日\":\n return references.yesterday(context.refDate);\n case \"明日\":\n return references.tomorrow(context.refDate);\n case \"今日\":\n case \"当日\":\n return references.today(context.refDate);\n }\n if (text == \"今夜\" || text == \"今夕\" || text == \"今晩\") {\n components.imply(\"hour\", 22);\n components.assign(\"meridiem\", index_1.Meridiem.PM);\n }\n else if (text.match(\"今朝\")) {\n components.imply(\"hour\", 6);\n components.assign(\"meridiem\", index_1.Meridiem.AM);\n }\n components.assign(\"day\", date.date());\n components.assign(\"month\", date.month() + 1);\n components.assign(\"year\", date.year());\n return components;\n }\n}\nexports.default = JPCasualDateParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/ja/parsers/JPCasualDateParser.js?");
|
|
702
|
+
|
|
703
|
+
/***/ }),
|
|
704
|
+
|
|
705
|
+
/***/ "./dist/locales/ja/parsers/JPStandardParser.js":
|
|
706
|
+
/*!*****************************************************!*\
|
|
707
|
+
!*** ./dist/locales/ja/parsers/JPStandardParser.js ***!
|
|
708
|
+
\*****************************************************/
|
|
709
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
710
|
+
|
|
711
|
+
"use strict";
|
|
712
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/ja/constants.js\");\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst PATTERN = /(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\\s*)?([0-90-9]{1,2})月\\s*([0-90-9]{1,2})日/i;\nconst SPECIAL_YEAR_GROUP = 1;\nconst TYPICAL_YEAR_GROUP = 2;\nconst ERA_GROUP = 3;\nconst YEAR_NUMBER_GROUP = 4;\nconst MONTH_GROUP = 5;\nconst DAY_GROUP = 6;\nclass JPStandardParser {\n pattern() {\n return PATTERN;\n }\n extract(context, match) {\n const month = parseInt(constants_1.toHankaku(match[MONTH_GROUP]));\n const day = parseInt(constants_1.toHankaku(match[DAY_GROUP]));\n const components = context.createParsingComponents({\n day: day,\n month: month,\n });\n if (match[SPECIAL_YEAR_GROUP] && match[SPECIAL_YEAR_GROUP].match(\"同|今|本\")) {\n const moment = dayjs_1.default(context.refDate);\n components.assign(\"year\", moment.year());\n }\n if (match[TYPICAL_YEAR_GROUP]) {\n const yearNumText = match[YEAR_NUMBER_GROUP];\n let year = yearNumText == \"元\" ? 1 : parseInt(constants_1.toHankaku(yearNumText));\n if (match[ERA_GROUP] == \"令和\") {\n year += 2018;\n }\n else if (match[ERA_GROUP] == \"平成\") {\n year += 1988;\n }\n else if (match[ERA_GROUP] == \"昭和\") {\n year += 1925;\n }\n components.assign(\"year\", year);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, day, month);\n components.imply(\"year\", year);\n }\n return components;\n }\n}\nexports.default = JPStandardParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/ja/parsers/JPStandardParser.js?");
|
|
713
|
+
|
|
714
|
+
/***/ }),
|
|
715
|
+
|
|
716
|
+
/***/ "./dist/locales/ja/refiners/JPMergeDateRangeRefiner.js":
|
|
717
|
+
/*!*************************************************************!*\
|
|
718
|
+
!*** ./dist/locales/ja/refiners/JPMergeDateRangeRefiner.js ***!
|
|
719
|
+
\*************************************************************/
|
|
720
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
721
|
+
|
|
722
|
+
"use strict";
|
|
723
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateRangeRefiner */ \"./dist/common/refiners/AbstractMergeDateRangeRefiner.js\"));\nclass JPMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {\n patternBetween() {\n return /^\\s*(から|ー|-)\\s*$/i;\n }\n}\nexports.default = JPMergeDateRangeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/ja/refiners/JPMergeDateRangeRefiner.js?");
|
|
724
|
+
|
|
725
|
+
/***/ }),
|
|
726
|
+
|
|
727
|
+
/***/ "./dist/locales/nl/constants.js":
|
|
728
|
+
/*!**************************************!*\
|
|
729
|
+
!*** ./dist/locales/nl/constants.js ***!
|
|
730
|
+
\**************************************/
|
|
731
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
732
|
+
|
|
733
|
+
"use strict";
|
|
734
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.ORDINAL_WORD_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;\nconst pattern_1 = __webpack_require__(/*! ../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst years_1 = __webpack_require__(/*! ../../calculation/years */ \"./dist/calculation/years.js\");\nexports.WEEKDAY_DICTIONARY = {\n zondag: 0,\n zon: 0,\n \"zon.\": 0,\n zo: 0,\n \"zo.\": 0,\n maandag: 1,\n ma: 1,\n \"ma.\": 1,\n dinsdag: 2,\n din: 2,\n \"din.\": 2,\n di: 2,\n \"di.\": 2,\n woensdag: 3,\n woe: 3,\n \"woe.\": 3,\n wo: 3,\n \"wo.\": 3,\n donderdag: 4,\n dond: 4,\n \"dond.\": 4,\n do: 4,\n \"do.\": 4,\n vrijdag: 5,\n vrij: 5,\n \"vrij.\": 5,\n vr: 5,\n \"vr.\": 5,\n zaterdag: 6,\n zat: 6,\n \"zat.\": 6,\n \"za\": 6,\n \"za.\": 6,\n};\nexports.MONTH_DICTIONARY = {\n januari: 1,\n jan: 1,\n \"jan.\": 1,\n februari: 2,\n feb: 2,\n \"feb.\": 2,\n maart: 3,\n mar: 3,\n \"mar.\": 3,\n april: 4,\n apr: 4,\n \"apr.\": 4,\n mei: 5,\n juni: 6,\n jun: 6,\n \"jun.\": 6,\n juli: 7,\n jul: 7,\n \"jul.\": 7,\n augustus: 8,\n aug: 8,\n \"aug.\": 8,\n september: 9,\n sep: 9,\n \"sep.\": 9,\n sept: 9,\n \"sept.\": 9,\n oktober: 10,\n okt: 10,\n \"okt.\": 10,\n november: 11,\n nov: 11,\n \"nov.\": 11,\n december: 12,\n dec: 12,\n \"dec.\": 12,\n};\nexports.INTEGER_WORD_DICTIONARY = {\n een: 1,\n twee: 2,\n drie: 3,\n vier: 4,\n vijf: 5,\n zes: 6,\n zeven: 7,\n acht: 8,\n negen: 9,\n tien: 10,\n elf: 11,\n twaalf: 12,\n};\nexports.ORDINAL_WORD_DICTIONARY = {\n eerste: 1,\n tweede: 2,\n derde: 3,\n vierde: 4,\n vijfde: 5,\n zesde: 6,\n zevende: 7,\n achtste: 8,\n negende: 9,\n tiende: 10,\n elfde: 11,\n twaalfde: 12,\n dertiende: 13,\n veertiende: 14,\n vijftiende: 15,\n zestiende: 16,\n zeventiende: 17,\n achttiende: 18,\n negentiende: 19,\n twintigste: 20,\n \"eenentwintigste\": 21,\n \"tweeëntwintigste\": 22,\n \"drieentwintigste\": 23,\n \"vierentwintigste\": 24,\n \"vijfentwintigste\": 25,\n \"zesentwintigste\": 26,\n \"zevenentwintigste\": 27,\n \"achtentwintig\": 28,\n \"negenentwintig\": 29,\n \"dertigste\": 30,\n \"eenendertigste\": 31,\n};\nexports.TIME_UNIT_DICTIONARY = {\n sec: \"second\",\n second: \"second\",\n seconden: \"second\",\n min: \"minute\",\n mins: \"minute\",\n minute: \"minute\",\n minuten: \"minute\",\n h: \"hour\",\n hr: \"hour\",\n hrs: \"hour\",\n uur: \"hour\",\n uren: \"hour\",\n dag: \"d\",\n dagen: \"d\",\n week: \"week\",\n weken: \"week\",\n maand: \"month\",\n maanden: \"month\",\n jaar: \"year\",\n jr: \"year\",\n jaren: \"year\",\n};\nexports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\\\.[0-9]+|een?|halve?)`;\nfunction parseNumberPattern(match) {\n const num = match.toLowerCase();\n if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) {\n return exports.INTEGER_WORD_DICTIONARY[num];\n }\n else if (num === \"een\") {\n return 1;\n }\n else if (num.match(/halve?/)) {\n return 0.5;\n }\n return parseFloat(num);\n}\nexports.parseNumberPattern = parseNumberPattern;\nexports.ORDINAL_NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;\nfunction parseOrdinalNumberPattern(match) {\n let num = match.toLowerCase();\n if (exports.ORDINAL_WORD_DICTIONARY[num] !== undefined) {\n return exports.ORDINAL_WORD_DICTIONARY[num];\n }\n num = num.replace(/(?:ste|de)$/i, \"\");\n return parseInt(num);\n}\nexports.parseOrdinalNumberPattern = parseOrdinalNumberPattern;\nexports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])`;\nfunction parseYear(match) {\n if (/voor Christus/i.test(match)) {\n match = match.replace(/voor Christus/i, \"\");\n return -parseInt(match);\n }\n if (/na Christus/i.test(match)) {\n match = match.replace(/na Christus/i, \"\");\n return parseInt(match);\n }\n const rawYearNumber = parseInt(match);\n return years_1.findMostLikelyADYear(rawYearNumber);\n}\nexports.parseYear = parseYear;\nconst SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\\\s{0,5}`;\nconst SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, \"i\");\nexports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(`(?:(?:binnen|in)\\\\s*)?`, SINGLE_TIME_UNIT_PATTERN);\nfunction parseTimeUnits(timeunitText) {\n const fragments = {};\n let remainingText = timeunitText;\n let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);\n while (match) {\n collectDateTimeFragment(fragments, match);\n remainingText = remainingText.substring(match[0].length);\n match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);\n }\n return fragments;\n}\nexports.parseTimeUnits = parseTimeUnits;\nfunction collectDateTimeFragment(fragments, match) {\n const num = parseNumberPattern(match[1]);\n const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()];\n fragments[unit] = num;\n}\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/constants.js?");
|
|
735
|
+
|
|
736
|
+
/***/ }),
|
|
737
|
+
|
|
738
|
+
/***/ "./dist/locales/nl/index.js":
|
|
739
|
+
/*!**********************************!*\
|
|
740
|
+
!*** ./dist/locales/nl/index.js ***!
|
|
741
|
+
\**********************************/
|
|
742
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
743
|
+
|
|
744
|
+
"use strict";
|
|
745
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;\nconst configurations_1 = __webpack_require__(/*! ../../configurations */ \"./dist/configurations.js\");\nconst chrono_1 = __webpack_require__(/*! ../../chrono */ \"./dist/chrono.js\");\nconst NLMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/NLMergeDateRangeRefiner */ \"./dist/locales/nl/refiners/NLMergeDateRangeRefiner.js\"));\nconst NLMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/NLMergeDateTimeRefiner */ \"./dist/locales/nl/refiners/NLMergeDateTimeRefiner.js\"));\nconst NLCasualDateParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLCasualDateParser */ \"./dist/locales/nl/parsers/NLCasualDateParser.js\"));\nconst NLCasualTimeParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLCasualTimeParser */ \"./dist/locales/nl/parsers/NLCasualTimeParser.js\"));\nconst SlashDateFormatParser_1 = __importDefault(__webpack_require__(/*! ../../common/parsers/SlashDateFormatParser */ \"./dist/common/parsers/SlashDateFormatParser.js\"));\nconst NLTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLTimeUnitWithinFormatParser */ \"./dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js\"));\nconst NLWeekdayParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLWeekdayParser */ \"./dist/locales/nl/parsers/NLWeekdayParser.js\"));\nconst NLMonthNameMiddleEndianParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLMonthNameMiddleEndianParser */ \"./dist/locales/nl/parsers/NLMonthNameMiddleEndianParser.js\"));\nconst NLMonthNameParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLMonthNameParser */ \"./dist/locales/nl/parsers/NLMonthNameParser.js\"));\nconst NLSlashMonthFormatParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLSlashMonthFormatParser */ \"./dist/locales/nl/parsers/NLSlashMonthFormatParser.js\"));\nconst NLTimeExpressionParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLTimeExpressionParser */ \"./dist/locales/nl/parsers/NLTimeExpressionParser.js\"));\nconst NLCasualYearMonthDayParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLCasualYearMonthDayParser */ \"./dist/locales/nl/parsers/NLCasualYearMonthDayParser.js\"));\nconst NLCasualDateTimeParser_1 = __importDefault(__webpack_require__(/*! ./parsers/NLCasualDateTimeParser */ \"./dist/locales/nl/parsers/NLCasualDateTimeParser.js\"));\nexports.casual = new chrono_1.Chrono(createCasualConfiguration());\nexports.strict = new chrono_1.Chrono(createConfiguration(true));\nfunction parse(text, ref, option) {\n return exports.casual.parse(text, ref, option);\n}\nexports.parse = parse;\nfunction parseDate(text, ref, option) {\n return exports.casual.parseDate(text, ref, option);\n}\nexports.parseDate = parseDate;\nfunction createCasualConfiguration(littleEndian = true) {\n const option = createConfiguration(false, littleEndian);\n option.parsers.unshift(new NLCasualDateParser_1.default());\n option.parsers.unshift(new NLCasualTimeParser_1.default());\n option.parsers.unshift(new NLCasualDateTimeParser_1.default());\n return option;\n}\nexports.createCasualConfiguration = createCasualConfiguration;\nfunction createConfiguration(strictMode = true, littleEndian = true) {\n return configurations_1.includeCommonConfiguration({\n parsers: [\n new SlashDateFormatParser_1.default(littleEndian),\n new NLMonthNameMiddleEndianParser_1.default(),\n new NLMonthNameParser_1.default(),\n new NLTimeExpressionParser_1.default(),\n new NLTimeUnitWithinFormatParser_1.default(),\n new NLSlashMonthFormatParser_1.default(),\n new NLWeekdayParser_1.default(),\n new NLCasualYearMonthDayParser_1.default(),\n ],\n refiners: [new NLMergeDateTimeRefiner_1.default(), new NLMergeDateRangeRefiner_1.default()],\n }, strictMode);\n}\nexports.createConfiguration = createConfiguration;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/index.js?");
|
|
746
|
+
|
|
747
|
+
/***/ }),
|
|
748
|
+
|
|
749
|
+
/***/ "./dist/locales/nl/parsers/NLCasualDateParser.js":
|
|
750
|
+
/*!*******************************************************!*\
|
|
751
|
+
!*** ./dist/locales/nl/parsers/NLCasualDateParser.js ***!
|
|
752
|
+
\*******************************************************/
|
|
753
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
754
|
+
|
|
755
|
+
"use strict";
|
|
756
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst references = __importStar(__webpack_require__(/*! ../../../common/casualReferences */ \"./dist/common/casualReferences.js\"));\nclass NLCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return /(nu|vandaag|morgen|morgend|gisteren)(?=\\W|$)/i;\n }\n innerExtract(context, match) {\n const lowerText = match[0].toLowerCase();\n const component = context.createParsingComponents();\n switch (lowerText) {\n case \"nu\":\n return references.now(context.refDate);\n case \"vandaag\":\n return references.today(context.refDate);\n case \"morgen\":\n case \"morgend\":\n return references.tomorrow(context.refDate);\n case \"gisteren\":\n return references.yesterday(context.refDate);\n }\n return component;\n }\n}\nexports.default = NLCasualDateParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLCasualDateParser.js?");
|
|
757
|
+
|
|
758
|
+
/***/ }),
|
|
759
|
+
|
|
760
|
+
/***/ "./dist/locales/nl/parsers/NLCasualDateTimeParser.js":
|
|
761
|
+
/*!***********************************************************!*\
|
|
762
|
+
!*** ./dist/locales/nl/parsers/NLCasualDateTimeParser.js ***!
|
|
763
|
+
\***********************************************************/
|
|
764
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
765
|
+
|
|
766
|
+
"use strict";
|
|
767
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst dayjs_1 = __webpack_require__(/*! ../../../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst dayjs_2 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst DATE_GROUP = 1;\nconst TIME_OF_DAY_GROUP = 2;\nclass NLCasualDateTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return /(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\\W|$)/i;\n }\n innerExtract(context, match) {\n const dateText = match[DATE_GROUP].toLowerCase();\n const timeText = match[TIME_OF_DAY_GROUP].toLowerCase();\n const component = context.createParsingComponents();\n const targetDate = dayjs_2.default(context.refDate);\n switch (dateText) {\n case \"gisteren\":\n dayjs_1.assignSimilarDate(component, targetDate.add(-1, \"day\"));\n break;\n case \"van\":\n dayjs_1.assignSimilarDate(component, targetDate);\n break;\n case \"morgen\":\n dayjs_1.assignTheNextDay(component, targetDate);\n break;\n }\n switch (timeText) {\n case \"ochtend\":\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n component.imply(\"hour\", 6);\n break;\n case \"middag\":\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n component.imply(\"hour\", 12);\n break;\n case \"namiddag\":\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n component.imply(\"hour\", 15);\n break;\n case \"avond\":\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n component.imply(\"hour\", 20);\n break;\n }\n return component;\n }\n}\nexports.default = NLCasualDateTimeParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLCasualDateTimeParser.js?");
|
|
768
|
+
|
|
769
|
+
/***/ }),
|
|
770
|
+
|
|
771
|
+
/***/ "./dist/locales/nl/parsers/NLCasualTimeParser.js":
|
|
772
|
+
/*!*******************************************************!*\
|
|
773
|
+
!*** ./dist/locales/nl/parsers/NLCasualTimeParser.js ***!
|
|
774
|
+
\*******************************************************/
|
|
775
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
776
|
+
|
|
777
|
+
"use strict";
|
|
778
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst dayjs_2 = __webpack_require__(/*! ../../../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst DAY_GROUP = 1;\nconst MOMENT_GROUP = 2;\nclass NLCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return /(deze)?\\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\\W|$)/i;\n }\n innerExtract(context, match) {\n const targetDate = dayjs_1.default(context.refDate);\n const component = context.createParsingComponents();\n if (match[DAY_GROUP] === \"deze\") {\n component.assign(\"day\", context.refDate.getDate());\n component.assign(\"month\", context.refDate.getMonth() + 1);\n component.assign(\"year\", context.refDate.getFullYear());\n }\n switch (match[MOMENT_GROUP].toLowerCase()) {\n case \"namiddag\":\n case \"'s namiddags\":\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n component.imply(\"hour\", 15);\n break;\n case \"avond\":\n case \"'s avonds'\":\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n component.imply(\"hour\", 20);\n break;\n case \"middernacht\":\n dayjs_2.assignTheNextDay(component, targetDate);\n component.imply(\"hour\", 0);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n break;\n case \"ochtend\":\n case \"'s ochtends\":\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n component.imply(\"hour\", 6);\n break;\n case \"middag\":\n case \"'s middags\":\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n component.imply(\"hour\", 12);\n break;\n }\n return component;\n }\n}\nexports.default = NLCasualTimeParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLCasualTimeParser.js?");
|
|
779
|
+
|
|
780
|
+
/***/ }),
|
|
781
|
+
|
|
782
|
+
/***/ "./dist/locales/nl/parsers/NLCasualYearMonthDayParser.js":
|
|
783
|
+
/*!***************************************************************!*\
|
|
784
|
+
!*** ./dist/locales/nl/parsers/NLCasualYearMonthDayParser.js ***!
|
|
785
|
+
\***************************************************************/
|
|
786
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
787
|
+
|
|
788
|
+
"use strict";
|
|
789
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/nl/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(`([0-9]{4})[\\\\.\\\\/\\\\s]` +\n `(?:(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\\\.\\\\/\\\\s]` +\n `([0-9]{1,2})` +\n \"(?=\\\\W|$)\", \"i\");\nconst YEAR_NUMBER_GROUP = 1;\nconst MONTH_NAME_GROUP = 2;\nconst MONTH_NUMBER_GROUP = 3;\nconst DATE_NUMBER_GROUP = 4;\nclass NLCasualYearMonthDayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const month = match[MONTH_NUMBER_GROUP]\n ? parseInt(match[MONTH_NUMBER_GROUP])\n : constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];\n if (month < 1 || month > 12) {\n return null;\n }\n const year = parseInt(match[YEAR_NUMBER_GROUP]);\n const day = parseInt(match[DATE_NUMBER_GROUP]);\n return {\n day: day,\n month: month,\n year: year,\n };\n }\n}\nexports.default = NLCasualYearMonthDayParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLCasualYearMonthDayParser.js?");
|
|
790
|
+
|
|
791
|
+
/***/ }),
|
|
792
|
+
|
|
793
|
+
/***/ "./dist/locales/nl/parsers/NLMonthNameMiddleEndianParser.js":
|
|
794
|
+
/*!******************************************************************!*\
|
|
795
|
+
!*** ./dist/locales/nl/parsers/NLMonthNameMiddleEndianParser.js ***!
|
|
796
|
+
\******************************************************************/
|
|
797
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
798
|
+
|
|
799
|
+
"use strict";
|
|
800
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/nl/constants.js\");\nconst constants_2 = __webpack_require__(/*! ../constants */ \"./dist/locales/nl/constants.js\");\nconst constants_3 = __webpack_require__(/*! ../constants */ \"./dist/locales/nl/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(\"(?:on\\\\s*?)?\" +\n `(${constants_2.ORDINAL_NUMBER_PATTERN})` +\n \"(?:\\\\s*\" +\n \"(?:tot|\\\\-|\\\\–|until|through|till|\\\\s)\\\\s*\" +\n `(${constants_2.ORDINAL_NUMBER_PATTERN})` +\n \")?\" +\n \"(?:-|/|\\\\s*(?:of)?\\\\s*)\" +\n \"(\" +\n pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY) +\n \")\" +\n \"(?:\" +\n \"(?:-|/|,?\\\\s*)\" +\n `(${constants_3.YEAR_PATTERN}(?![^\\\\s]\\\\d))` +\n \")?\" +\n \"(?=\\\\W|$)\", \"i\");\nconst MONTH_NAME_GROUP = 3;\nconst DATE_GROUP = 1;\nconst DATE_TO_GROUP = 2;\nconst YEAR_GROUP = 4;\nclass NLMonthNameMiddleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];\n const day = constants_2.parseOrdinalNumberPattern(match[DATE_GROUP]);\n if (day > 31) {\n match.index = match.index + match[DATE_GROUP].length;\n return null;\n }\n const components = context.createParsingComponents({\n day: day,\n month: month,\n });\n if (match[YEAR_GROUP]) {\n const year = constants_3.parseYear(match[YEAR_GROUP]);\n components.assign(\"year\", year);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, day, month);\n components.imply(\"year\", year);\n }\n if (!match[DATE_TO_GROUP]) {\n return components;\n }\n const endDate = constants_2.parseOrdinalNumberPattern(match[DATE_TO_GROUP]);\n const result = context.createParsingResult(match.index, match[0]);\n result.start = components;\n result.end = components.clone();\n result.end.assign(\"day\", endDate);\n return result;\n }\n}\nexports.default = NLMonthNameMiddleEndianParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLMonthNameMiddleEndianParser.js?");
|
|
801
|
+
|
|
802
|
+
/***/ }),
|
|
803
|
+
|
|
804
|
+
/***/ "./dist/locales/nl/parsers/NLMonthNameParser.js":
|
|
805
|
+
/*!******************************************************!*\
|
|
806
|
+
!*** ./dist/locales/nl/parsers/NLMonthNameParser.js ***!
|
|
807
|
+
\******************************************************/
|
|
808
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
809
|
+
|
|
810
|
+
"use strict";
|
|
811
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/nl/constants.js\");\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst constants_2 = __webpack_require__(/*! ../constants */ \"./dist/locales/nl/constants.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(`(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` +\n `\\\\s*` +\n `(?:` +\n `[,-]?\\\\s*(${constants_2.YEAR_PATTERN})?` +\n \")?\" +\n \"(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)\", \"i\");\nconst MONTH_NAME_GROUP = 1;\nconst YEAR_GROUP = 2;\nclass NLMonthNameParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const components = context.createParsingComponents();\n components.imply(\"day\", 1);\n const monthName = match[MONTH_NAME_GROUP];\n const month = constants_1.MONTH_DICTIONARY[monthName.toLowerCase()];\n components.assign(\"month\", month);\n if (match[YEAR_GROUP]) {\n const year = constants_2.parseYear(match[YEAR_GROUP]);\n components.assign(\"year\", year);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, 1, month);\n components.imply(\"year\", year);\n }\n return components;\n }\n}\nexports.default = NLMonthNameParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLMonthNameParser.js?");
|
|
812
|
+
|
|
813
|
+
/***/ }),
|
|
814
|
+
|
|
815
|
+
/***/ "./dist/locales/nl/parsers/NLSlashMonthFormatParser.js":
|
|
816
|
+
/*!*************************************************************!*\
|
|
817
|
+
!*** ./dist/locales/nl/parsers/NLSlashMonthFormatParser.js ***!
|
|
818
|
+
\*************************************************************/
|
|
819
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
820
|
+
|
|
821
|
+
"use strict";
|
|
822
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(\"([0-9]|0[1-9]|1[012])/([0-9]{4})\" + \"\", \"i\");\nconst MONTH_GROUP = 1;\nconst YEAR_GROUP = 2;\nclass NLSlashMonthFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const year = parseInt(match[YEAR_GROUP]);\n const month = parseInt(match[MONTH_GROUP]);\n return context.createParsingComponents().imply(\"day\", 1).assign(\"month\", month).assign(\"year\", year);\n }\n}\nexports.default = NLSlashMonthFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLSlashMonthFormatParser.js?");
|
|
823
|
+
|
|
824
|
+
/***/ }),
|
|
825
|
+
|
|
826
|
+
/***/ "./dist/locales/nl/parsers/NLTimeExpressionParser.js":
|
|
827
|
+
/*!***********************************************************!*\
|
|
828
|
+
!*** ./dist/locales/nl/parsers/NLTimeExpressionParser.js ***!
|
|
829
|
+
\***********************************************************/
|
|
830
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
831
|
+
|
|
832
|
+
"use strict";
|
|
833
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractTimeExpressionParser_1 = __webpack_require__(/*! ../../../common/parsers/AbstractTimeExpressionParser */ \"./dist/common/parsers/AbstractTimeExpressionParser.js\");\nclass NLTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {\n primaryPrefix() {\n return \"(?:(?:om)\\\\s*)?\";\n }\n followingPhase() {\n return \"\\\\s*(?:\\\\-|\\\\–|\\\\~|\\\\〜|om|\\\\?)\\\\s*\";\n }\n extractPrimaryTimeComponents(context, match) {\n if (match[0].match(/^\\s*\\d{4}\\s*$/)) {\n return null;\n }\n return super.extractPrimaryTimeComponents(context, match);\n }\n}\nexports.default = NLTimeExpressionParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLTimeExpressionParser.js?");
|
|
834
|
+
|
|
835
|
+
/***/ }),
|
|
836
|
+
|
|
837
|
+
/***/ "./dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js":
|
|
838
|
+
/*!*****************************************************************!*\
|
|
839
|
+
!*** ./dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js ***!
|
|
840
|
+
\*****************************************************************/
|
|
841
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
842
|
+
|
|
843
|
+
"use strict";
|
|
844
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/nl/constants.js\");\nconst results_1 = __webpack_require__(/*! ../../../results */ \"./dist/results.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nclass NLTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return new RegExp(`(?:binnen|in|binnen de|voor)\\\\s*` + \"(\" + constants_1.TIME_UNITS_PATTERN + \")\" + `(?=\\\\W|$)`, \"i\");\n }\n innerExtract(context, match) {\n const timeUnits = constants_1.parseTimeUnits(match[1]);\n return results_1.ParsingComponents.createRelativeFromRefDate(context.refDate, timeUnits);\n }\n}\nexports.default = NLTimeUnitWithinFormatParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js?");
|
|
845
|
+
|
|
846
|
+
/***/ }),
|
|
847
|
+
|
|
848
|
+
/***/ "./dist/locales/nl/parsers/NLWeekdayParser.js":
|
|
849
|
+
/*!****************************************************!*\
|
|
850
|
+
!*** ./dist/locales/nl/parsers/NLWeekdayParser.js ***!
|
|
851
|
+
\****************************************************/
|
|
852
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
853
|
+
|
|
854
|
+
"use strict";
|
|
855
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../../nl/constants */ \"./dist/locales/nl/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst weeks_1 = __webpack_require__(/*! ../../../calculation/weeks */ \"./dist/calculation/weeks.js\");\nconst PATTERN = new RegExp(\"(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?\" +\n \"(?:op\\\\s*?)?\" +\n \"(?:(deze|vorige|volgende)\\\\s*(?:week\\\\s*)?)?\" +\n `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` +\n \"(?=\\\\W|$)\", \"i\");\nconst PREFIX_GROUP = 1;\nconst WEEKDAY_GROUP = 2;\nconst POSTFIX_GROUP = 3;\nclass NLWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];\n const prefix = match[PREFIX_GROUP];\n const postfix = match[POSTFIX_GROUP];\n let modifierWord = prefix || postfix;\n modifierWord = modifierWord || \"\";\n modifierWord = modifierWord.toLowerCase();\n let modifier = null;\n if (modifierWord == \"vorige\") {\n modifier = \"last\";\n }\n else if (modifierWord == \"volgende\") {\n modifier = \"next\";\n }\n else if (modifierWord == \"deze\") {\n modifier = \"this\";\n }\n const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);\n return context\n .createParsingComponents()\n .assign(\"weekday\", offset)\n .imply(\"day\", date.date())\n .imply(\"month\", date.month() + 1)\n .imply(\"year\", date.year());\n }\n}\nexports.default = NLWeekdayParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/parsers/NLWeekdayParser.js?");
|
|
856
|
+
|
|
857
|
+
/***/ }),
|
|
858
|
+
|
|
859
|
+
/***/ "./dist/locales/nl/refiners/NLMergeDateRangeRefiner.js":
|
|
860
|
+
/*!*************************************************************!*\
|
|
861
|
+
!*** ./dist/locales/nl/refiners/NLMergeDateRangeRefiner.js ***!
|
|
862
|
+
\*************************************************************/
|
|
863
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
864
|
+
|
|
865
|
+
"use strict";
|
|
866
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateRangeRefiner */ \"./dist/common/refiners/AbstractMergeDateRangeRefiner.js\"));\nclass NLMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {\n patternBetween() {\n return /^\\s*(tot|-)\\s*$/i;\n }\n}\nexports.default = NLMergeDateRangeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/refiners/NLMergeDateRangeRefiner.js?");
|
|
867
|
+
|
|
868
|
+
/***/ }),
|
|
869
|
+
|
|
870
|
+
/***/ "./dist/locales/nl/refiners/NLMergeDateTimeRefiner.js":
|
|
871
|
+
/*!************************************************************!*\
|
|
872
|
+
!*** ./dist/locales/nl/refiners/NLMergeDateTimeRefiner.js ***!
|
|
873
|
+
\************************************************************/
|
|
874
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
875
|
+
|
|
876
|
+
"use strict";
|
|
877
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateTimeRefiner */ \"./dist/common/refiners/AbstractMergeDateTimeRefiner.js\"));\nclass NLMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {\n patternBetween() {\n return new RegExp(\"^\\\\s*(om|na|voor|in de|,|-)?\\\\s*$\");\n }\n}\nexports.default = NLMergeDateTimeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/nl/refiners/NLMergeDateTimeRefiner.js?");
|
|
878
|
+
|
|
879
|
+
/***/ }),
|
|
880
|
+
|
|
881
|
+
/***/ "./dist/locales/pt/constants.js":
|
|
882
|
+
/*!**************************************!*\
|
|
883
|
+
!*** ./dist/locales/pt/constants.js ***!
|
|
884
|
+
\**************************************/
|
|
885
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
886
|
+
|
|
887
|
+
"use strict";
|
|
888
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.parseYear = exports.YEAR_PATTERN = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;\nexports.WEEKDAY_DICTIONARY = {\n \"domingo\": 0,\n \"dom\": 0,\n \"segunda\": 1,\n \"segunda-feira\": 1,\n \"seg\": 1,\n \"terça\": 2,\n \"terça-feira\": 2,\n \"ter\": 2,\n \"quarta\": 3,\n \"quarta-feira\": 3,\n \"qua\": 3,\n \"quinta\": 4,\n \"quinta-feira\": 4,\n \"qui\": 4,\n \"sexta\": 5,\n \"sexta-feira\": 5,\n \"sex\": 5,\n \"sábado\": 6,\n \"sabado\": 6,\n \"sab\": 6,\n};\nexports.MONTH_DICTIONARY = {\n \"janeiro\": 1,\n \"jan\": 1,\n \"jan.\": 1,\n \"fevereiro\": 2,\n \"fev\": 2,\n \"fev.\": 2,\n \"março\": 3,\n \"mar\": 3,\n \"mar.\": 3,\n \"abril\": 4,\n \"abr\": 4,\n \"abr.\": 4,\n \"maio\": 5,\n \"mai\": 5,\n \"mai.\": 5,\n \"junho\": 6,\n \"jun\": 6,\n \"jun.\": 6,\n \"julho\": 7,\n \"jul\": 7,\n \"jul.\": 7,\n \"agosto\": 8,\n \"ago\": 8,\n \"ago.\": 8,\n \"setembro\": 9,\n \"set\": 9,\n \"set.\": 9,\n \"outubro\": 10,\n \"out\": 10,\n \"out.\": 10,\n \"novembro\": 11,\n \"nov\": 11,\n \"nov.\": 11,\n \"dezembro\": 12,\n \"dez\": 12,\n \"dez.\": 12,\n};\nexports.YEAR_PATTERN = \"[0-9]{1,4}(?![^\\\\s]\\\\d)(?:\\\\s*[a|d]\\\\.?\\\\s*c\\\\.?|\\\\s*a\\\\.?\\\\s*d\\\\.?)?\";\nfunction parseYear(match) {\n if (match.match(/^[0-9]{1,4}$/)) {\n let yearNumber = parseInt(match);\n if (yearNumber < 100) {\n if (yearNumber > 50) {\n yearNumber = yearNumber + 1900;\n }\n else {\n yearNumber = yearNumber + 2000;\n }\n }\n return yearNumber;\n }\n if (match.match(/a\\.?\\s*c\\.?/i)) {\n match = match.replace(/a\\.?\\s*c\\.?/i, \"\");\n return -parseInt(match);\n }\n return parseInt(match);\n}\nexports.parseYear = parseYear;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/constants.js?");
|
|
889
|
+
|
|
890
|
+
/***/ }),
|
|
891
|
+
|
|
892
|
+
/***/ "./dist/locales/pt/index.js":
|
|
893
|
+
/*!**********************************!*\
|
|
894
|
+
!*** ./dist/locales/pt/index.js ***!
|
|
895
|
+
\**********************************/
|
|
896
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
897
|
+
|
|
898
|
+
"use strict";
|
|
899
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;\nconst configurations_1 = __webpack_require__(/*! ../../configurations */ \"./dist/configurations.js\");\nconst chrono_1 = __webpack_require__(/*! ../../chrono */ \"./dist/chrono.js\");\nconst SlashDateFormatParser_1 = __importDefault(__webpack_require__(/*! ../../common/parsers/SlashDateFormatParser */ \"./dist/common/parsers/SlashDateFormatParser.js\"));\nconst PTWeekdayParser_1 = __importDefault(__webpack_require__(/*! ./parsers/PTWeekdayParser */ \"./dist/locales/pt/parsers/PTWeekdayParser.js\"));\nconst PTTimeExpressionParser_1 = __importDefault(__webpack_require__(/*! ./parsers/PTTimeExpressionParser */ \"./dist/locales/pt/parsers/PTTimeExpressionParser.js\"));\nconst PTMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/PTMergeDateTimeRefiner */ \"./dist/locales/pt/refiners/PTMergeDateTimeRefiner.js\"));\nconst PTMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ./refiners/PTMergeDateRangeRefiner */ \"./dist/locales/pt/refiners/PTMergeDateRangeRefiner.js\"));\nconst PTMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__(/*! ./parsers/PTMonthNameLittleEndianParser */ \"./dist/locales/pt/parsers/PTMonthNameLittleEndianParser.js\"));\nconst PTCasualDateParser_1 = __importDefault(__webpack_require__(/*! ./parsers/PTCasualDateParser */ \"./dist/locales/pt/parsers/PTCasualDateParser.js\"));\nconst PTCasualTimeParser_1 = __importDefault(__webpack_require__(/*! ./parsers/PTCasualTimeParser */ \"./dist/locales/pt/parsers/PTCasualTimeParser.js\"));\nexports.casual = new chrono_1.Chrono(createCasualConfiguration());\nexports.strict = new chrono_1.Chrono(createConfiguration(true));\nfunction parse(text, ref, option) {\n return exports.casual.parse(text, ref, option);\n}\nexports.parse = parse;\nfunction parseDate(text, ref, option) {\n return exports.casual.parseDate(text, ref, option);\n}\nexports.parseDate = parseDate;\nfunction createCasualConfiguration(littleEndian = true) {\n const option = createConfiguration(false, littleEndian);\n option.parsers.push(new PTCasualDateParser_1.default());\n option.parsers.push(new PTCasualTimeParser_1.default());\n return option;\n}\nexports.createCasualConfiguration = createCasualConfiguration;\nfunction createConfiguration(strictMode = true, littleEndian = true) {\n return configurations_1.includeCommonConfiguration({\n parsers: [\n new SlashDateFormatParser_1.default(littleEndian),\n new PTWeekdayParser_1.default(),\n new PTTimeExpressionParser_1.default(),\n new PTMonthNameLittleEndianParser_1.default(),\n ],\n refiners: [new PTMergeDateTimeRefiner_1.default(), new PTMergeDateRangeRefiner_1.default()],\n }, strictMode);\n}\nexports.createConfiguration = createConfiguration;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/index.js?");
|
|
900
|
+
|
|
901
|
+
/***/ }),
|
|
902
|
+
|
|
903
|
+
/***/ "./dist/locales/pt/parsers/PTCasualDateParser.js":
|
|
904
|
+
/*!*******************************************************!*\
|
|
905
|
+
!*** ./dist/locales/pt/parsers/PTCasualDateParser.js ***!
|
|
906
|
+
\*******************************************************/
|
|
907
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
908
|
+
|
|
909
|
+
"use strict";
|
|
910
|
+
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst references = __importStar(__webpack_require__(/*! ../../../common/casualReferences */ \"./dist/common/casualReferences.js\"));\nclass PTCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern(context) {\n return /(agora|hoje|amanha|amanhã|ontem)(?=\\W|$)/i;\n }\n innerExtract(context, match) {\n const lowerText = match[0].toLowerCase();\n const component = context.createParsingComponents();\n switch (lowerText) {\n case \"agora\":\n return references.now(context.refDate);\n case \"hoje\":\n return references.today(context.refDate);\n case \"amanha\":\n case \"amanhã\":\n return references.tomorrow(context.refDate);\n case \"ontem\":\n return references.yesterday(context.refDate);\n }\n return component;\n }\n}\nexports.default = PTCasualDateParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/parsers/PTCasualDateParser.js?");
|
|
911
|
+
|
|
912
|
+
/***/ }),
|
|
913
|
+
|
|
914
|
+
/***/ "./dist/locales/pt/parsers/PTCasualTimeParser.js":
|
|
915
|
+
/*!*******************************************************!*\
|
|
916
|
+
!*** ./dist/locales/pt/parsers/PTCasualTimeParser.js ***!
|
|
917
|
+
\*******************************************************/
|
|
918
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
919
|
+
|
|
920
|
+
"use strict";
|
|
921
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst index_1 = __webpack_require__(/*! ../../../index */ \"./dist/index.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst dayjs_1 = __webpack_require__(/*! ../../../utils/dayjs */ \"./dist/utils/dayjs.js\");\nconst dayjs_2 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nclass PTCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return /(?:esta\\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\\W|$)/i;\n }\n innerExtract(context, match) {\n const targetDate = dayjs_2.default(context.refDate);\n const component = context.createParsingComponents();\n switch (match[1].toLowerCase()) {\n case \"tarde\":\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n component.imply(\"hour\", 15);\n break;\n case \"noite\":\n component.imply(\"meridiem\", index_1.Meridiem.PM);\n component.imply(\"hour\", 22);\n break;\n case \"manha\":\n case \"manhã\":\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n component.imply(\"hour\", 6);\n break;\n case \"meia-noite\":\n dayjs_1.assignTheNextDay(component, targetDate);\n component.imply(\"hour\", 0);\n component.imply(\"minute\", 0);\n component.imply(\"second\", 0);\n break;\n case \"meio-dia\":\n component.imply(\"meridiem\", index_1.Meridiem.AM);\n component.imply(\"hour\", 12);\n break;\n }\n return component;\n }\n}\nexports.default = PTCasualTimeParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/parsers/PTCasualTimeParser.js?");
|
|
922
|
+
|
|
923
|
+
/***/ }),
|
|
924
|
+
|
|
925
|
+
/***/ "./dist/locales/pt/parsers/PTMonthNameLittleEndianParser.js":
|
|
926
|
+
/*!******************************************************************!*\
|
|
927
|
+
!*** ./dist/locales/pt/parsers/PTMonthNameLittleEndianParser.js ***!
|
|
928
|
+
\******************************************************************/
|
|
929
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
930
|
+
|
|
931
|
+
"use strict";
|
|
932
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst years_1 = __webpack_require__(/*! ../../../calculation/years */ \"./dist/calculation/years.js\");\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/pt/constants.js\");\nconst constants_2 = __webpack_require__(/*! ../constants */ \"./dist/locales/pt/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst PATTERN = new RegExp(`([0-9]{1,2})(?:º|ª|°)?` +\n \"(?:\\\\s*(?:desde|de|\\\\-|\\\\–|ao?|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*\" +\n `(?:-|/|\\\\s*(?:de|,)?\\\\s*)` +\n `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` +\n `(?:\\\\s*(?:de|,)?\\\\s*(${constants_2.YEAR_PATTERN}))?` +\n `(?=\\\\W|$)`, \"i\");\nconst DATE_GROUP = 1;\nconst DATE_TO_GROUP = 2;\nconst MONTH_NAME_GROUP = 3;\nconst YEAR_GROUP = 4;\nclass PTMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const result = context.createParsingResult(match.index, match[0]);\n const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];\n const day = parseInt(match[DATE_GROUP]);\n if (day > 31) {\n match.index = match.index + match[DATE_GROUP].length;\n return null;\n }\n result.start.assign(\"month\", month);\n result.start.assign(\"day\", day);\n if (match[YEAR_GROUP]) {\n const yearNumber = constants_2.parseYear(match[YEAR_GROUP]);\n result.start.assign(\"year\", yearNumber);\n }\n else {\n const year = years_1.findYearClosestToRef(context.refDate, day, month);\n result.start.imply(\"year\", year);\n }\n if (match[DATE_TO_GROUP]) {\n const endDate = parseInt(match[DATE_TO_GROUP]);\n result.end = result.start.clone();\n result.end.assign(\"day\", endDate);\n }\n return result;\n }\n}\nexports.default = PTMonthNameLittleEndianParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/parsers/PTMonthNameLittleEndianParser.js?");
|
|
933
|
+
|
|
934
|
+
/***/ }),
|
|
935
|
+
|
|
936
|
+
/***/ "./dist/locales/pt/parsers/PTTimeExpressionParser.js":
|
|
937
|
+
/*!***********************************************************!*\
|
|
938
|
+
!*** ./dist/locales/pt/parsers/PTTimeExpressionParser.js ***!
|
|
939
|
+
\***********************************************************/
|
|
940
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
941
|
+
|
|
942
|
+
"use strict";
|
|
943
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractTimeExpressionParser_1 = __webpack_require__(/*! ../../../common/parsers/AbstractTimeExpressionParser */ \"./dist/common/parsers/AbstractTimeExpressionParser.js\");\nclass PTTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {\n primaryPrefix() {\n return \"(?:(?:ao?|às?|das|da|de|do)\\\\s*)?\";\n }\n followingPhase() {\n return \"\\\\s*(?:\\\\-|\\\\–|\\\\~|\\\\〜|a(?:o)?|\\\\?)\\\\s*\";\n }\n}\nexports.default = PTTimeExpressionParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/parsers/PTTimeExpressionParser.js?");
|
|
944
|
+
|
|
945
|
+
/***/ }),
|
|
946
|
+
|
|
947
|
+
/***/ "./dist/locales/pt/parsers/PTWeekdayParser.js":
|
|
948
|
+
/*!****************************************************!*\
|
|
949
|
+
!*** ./dist/locales/pt/parsers/PTWeekdayParser.js ***!
|
|
950
|
+
\****************************************************/
|
|
951
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
952
|
+
|
|
953
|
+
"use strict";
|
|
954
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst constants_1 = __webpack_require__(/*! ../constants */ \"./dist/locales/pt/constants.js\");\nconst pattern_1 = __webpack_require__(/*! ../../../utils/pattern */ \"./dist/utils/pattern.js\");\nconst AbstractParserWithWordBoundary_1 = __webpack_require__(/*! ../../../common/parsers/AbstractParserWithWordBoundary */ \"./dist/common/parsers/AbstractParserWithWordBoundary.js\");\nconst weeks_1 = __webpack_require__(/*! ../../../calculation/weeks */ \"./dist/calculation/weeks.js\");\nconst PATTERN = new RegExp(\"(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?\" +\n \"(?:(este|esta|passado|pr[oó]ximo)\\\\s*)?\" +\n `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` +\n \"(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?\" +\n \"(?:\\\\s*(este|esta|passado|pr[óo]ximo)\\\\s*semana)?\" +\n \"(?=\\\\W|\\\\d|$)\", \"i\");\nconst PREFIX_GROUP = 1;\nconst WEEKDAY_GROUP = 2;\nconst POSTFIX_GROUP = 3;\nclass PTWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {\n innerPattern() {\n return PATTERN;\n }\n innerExtract(context, match) {\n const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];\n if (offset === undefined) {\n return null;\n }\n const prefix = match[PREFIX_GROUP];\n const postfix = match[POSTFIX_GROUP];\n let norm = prefix || postfix || \"\";\n norm = norm.toLowerCase();\n let modifier = null;\n if (norm == \"passado\") {\n modifier = \"this\";\n }\n else if (norm == \"próximo\" || norm == \"proximo\") {\n modifier = \"next\";\n }\n else if (norm == \"este\") {\n modifier = \"this\";\n }\n const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);\n return context\n .createParsingComponents()\n .assign(\"weekday\", offset)\n .imply(\"day\", date.date())\n .imply(\"month\", date.month() + 1)\n .imply(\"year\", date.year());\n }\n}\nexports.default = PTWeekdayParser;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/parsers/PTWeekdayParser.js?");
|
|
955
|
+
|
|
956
|
+
/***/ }),
|
|
957
|
+
|
|
958
|
+
/***/ "./dist/locales/pt/refiners/PTMergeDateRangeRefiner.js":
|
|
959
|
+
/*!*************************************************************!*\
|
|
960
|
+
!*** ./dist/locales/pt/refiners/PTMergeDateRangeRefiner.js ***!
|
|
961
|
+
\*************************************************************/
|
|
962
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
963
|
+
|
|
964
|
+
"use strict";
|
|
965
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateRangeRefiner */ \"./dist/common/refiners/AbstractMergeDateRangeRefiner.js\"));\nclass PTMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {\n patternBetween() {\n return /^\\s*(?:-)\\s*$/i;\n }\n}\nexports.default = PTMergeDateRangeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/refiners/PTMergeDateRangeRefiner.js?");
|
|
966
|
+
|
|
967
|
+
/***/ }),
|
|
968
|
+
|
|
969
|
+
/***/ "./dist/locales/pt/refiners/PTMergeDateTimeRefiner.js":
|
|
970
|
+
/*!************************************************************!*\
|
|
971
|
+
!*** ./dist/locales/pt/refiners/PTMergeDateTimeRefiner.js ***!
|
|
972
|
+
\************************************************************/
|
|
973
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
974
|
+
|
|
975
|
+
"use strict";
|
|
976
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__(/*! ../../../common/refiners/AbstractMergeDateTimeRefiner */ \"./dist/common/refiners/AbstractMergeDateTimeRefiner.js\"));\nclass PTMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {\n patternBetween() {\n return new RegExp(\"^\\\\s*(?:,|à)?\\\\s*$\");\n }\n}\nexports.default = PTMergeDateTimeRefiner;\n\n\n//# sourceURL=webpack://chrono-node/./dist/locales/pt/refiners/PTMergeDateTimeRefiner.js?");
|
|
977
|
+
|
|
978
|
+
/***/ }),
|
|
979
|
+
|
|
980
|
+
/***/ "./dist/results.js":
|
|
981
|
+
/*!*************************!*\
|
|
982
|
+
!*** ./dist/results.js ***!
|
|
983
|
+
\*************************/
|
|
984
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
985
|
+
|
|
986
|
+
"use strict";
|
|
987
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ParsingResult = exports.ParsingComponents = void 0;\nconst quarterOfYear_1 = __importDefault(__webpack_require__(/*! dayjs/plugin/quarterOfYear */ \"./node_modules/dayjs/plugin/quarterOfYear.js\"));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst dayjs_2 = __webpack_require__(/*! ./utils/dayjs */ \"./dist/utils/dayjs.js\");\ndayjs_1.default.extend(quarterOfYear_1.default);\nclass ParsingComponents {\n constructor(refDate, knownComponents) {\n this.knownValues = {};\n this.impliedValues = {};\n if (knownComponents) {\n for (const key in knownComponents) {\n this.knownValues[key] = knownComponents[key];\n }\n }\n const refDayJs = dayjs_1.default(refDate);\n this.imply(\"day\", refDayJs.date());\n this.imply(\"month\", refDayJs.month() + 1);\n this.imply(\"year\", refDayJs.year());\n this.imply(\"hour\", 12);\n this.imply(\"minute\", 0);\n this.imply(\"second\", 0);\n this.imply(\"millisecond\", 0);\n }\n get(component) {\n if (component in this.knownValues) {\n return this.knownValues[component];\n }\n if (component in this.impliedValues) {\n return this.impliedValues[component];\n }\n return null;\n }\n isCertain(component) {\n return component in this.knownValues;\n }\n getCertainComponents() {\n return Object.keys(this.knownValues);\n }\n imply(component, value) {\n if (component in this.knownValues) {\n return this;\n }\n this.impliedValues[component] = value;\n return this;\n }\n assign(component, value) {\n this.knownValues[component] = value;\n delete this.impliedValues[component];\n return this;\n }\n delete(component) {\n delete this.knownValues[component];\n delete this.impliedValues[component];\n }\n clone() {\n const component = new ParsingComponents(new Date());\n component.knownValues = {};\n component.impliedValues = {};\n for (const key in this.knownValues) {\n component.knownValues[key] = this.knownValues[key];\n }\n for (const key in this.impliedValues) {\n component.impliedValues[key] = this.impliedValues[key];\n }\n return component;\n }\n isOnlyDate() {\n return !this.isCertain(\"hour\") && !this.isCertain(\"minute\") && !this.isCertain(\"second\");\n }\n isOnlyTime() {\n return !this.isCertain(\"weekday\") && !this.isCertain(\"day\") && !this.isCertain(\"month\");\n }\n isOnlyWeekdayComponent() {\n return this.isCertain(\"weekday\") && !this.isCertain(\"day\") && !this.isCertain(\"month\");\n }\n isOnlyDayMonthComponent() {\n return this.isCertain(\"day\") && this.isCertain(\"month\") && !this.isCertain(\"year\");\n }\n isValidDate() {\n const date = this.isCertain(\"timezoneOffset\") ? this.dateWithoutTimezoneAdjustment() : this.date();\n if (date.getFullYear() !== this.get(\"year\"))\n return false;\n if (date.getMonth() !== this.get(\"month\") - 1)\n return false;\n if (date.getDate() !== this.get(\"day\"))\n return false;\n if (this.get(\"hour\") != null && date.getHours() != this.get(\"hour\"))\n return false;\n if (this.get(\"minute\") != null && date.getMinutes() != this.get(\"minute\"))\n return false;\n return true;\n }\n toString() {\n return `[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}]`;\n }\n dayjs() {\n return dayjs_1.default(this.date());\n }\n date() {\n const date = this.dateWithoutTimezoneAdjustment();\n return new Date(date.getTime() + this.getTimezoneAdjustmentMinute(date) * 60000);\n }\n dateWithoutTimezoneAdjustment() {\n const date = new Date(this.get(\"year\"), this.get(\"month\") - 1, this.get(\"day\"), this.get(\"hour\"), this.get(\"minute\"), this.get(\"second\"), this.get(\"millisecond\"));\n date.setFullYear(this.get(\"year\"));\n return date;\n }\n getTimezoneAdjustmentMinute(date) {\n var _a;\n date = date !== null && date !== void 0 ? date : new Date();\n const currentTimezoneOffset = -date.getTimezoneOffset();\n const targetTimezoneOffset = (_a = this.get(\"timezoneOffset\")) !== null && _a !== void 0 ? _a : currentTimezoneOffset;\n return currentTimezoneOffset - targetTimezoneOffset;\n }\n static createRelativeFromRefDate(refDate, fragments) {\n let date = dayjs_1.default(refDate);\n for (const key in fragments) {\n date = date.add(fragments[key], key);\n }\n const components = new ParsingComponents(refDate);\n if (fragments[\"hour\"] || fragments[\"minute\"] || fragments[\"second\"]) {\n dayjs_2.assignSimilarTime(components, date);\n dayjs_2.assignSimilarDate(components, date);\n }\n else {\n dayjs_2.implySimilarTime(components, date);\n if (fragments[\"d\"]) {\n components.assign(\"day\", date.date());\n components.assign(\"month\", date.month() + 1);\n components.assign(\"year\", date.year());\n }\n else {\n if (fragments[\"week\"]) {\n components.imply(\"weekday\", date.day());\n }\n components.imply(\"day\", date.date());\n if (fragments[\"month\"]) {\n components.assign(\"month\", date.month() + 1);\n components.assign(\"year\", date.year());\n }\n else {\n components.imply(\"month\", date.month() + 1);\n if (fragments[\"year\"]) {\n components.assign(\"year\", date.year());\n }\n else {\n components.imply(\"year\", date.year());\n }\n }\n }\n }\n return components;\n }\n}\nexports.ParsingComponents = ParsingComponents;\nclass ParsingResult {\n constructor(refDate, index, text, start, end) {\n this.refDate = refDate;\n this.index = index;\n this.text = text;\n this.start = start || new ParsingComponents(this.refDate);\n this.end = end;\n }\n clone() {\n const result = new ParsingResult(this.refDate, this.index, this.text);\n result.start = this.start ? this.start.clone() : null;\n result.end = this.end ? this.end.clone() : null;\n return result;\n }\n date() {\n return this.start.date();\n }\n toString() {\n return `[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`;\n }\n}\nexports.ParsingResult = ParsingResult;\n\n\n//# sourceURL=webpack://chrono-node/./dist/results.js?");
|
|
988
|
+
|
|
989
|
+
/***/ }),
|
|
990
|
+
|
|
991
|
+
/***/ "./dist/utils/dayjs.js":
|
|
992
|
+
/*!*****************************!*\
|
|
993
|
+
!*** ./dist/utils/dayjs.js ***!
|
|
994
|
+
\*****************************/
|
|
995
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
996
|
+
|
|
997
|
+
"use strict";
|
|
998
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.implySimilarTime = exports.assignSimilarTime = exports.assignSimilarDate = exports.assignTheNextDay = void 0;\nfunction assignTheNextDay(component, targetDayJs) {\n targetDayJs = targetDayJs.add(1, \"day\");\n assignSimilarDate(component, targetDayJs);\n implySimilarTime(component, targetDayJs);\n}\nexports.assignTheNextDay = assignTheNextDay;\nfunction assignSimilarDate(component, targetDayJs) {\n component.assign(\"day\", targetDayJs.date());\n component.assign(\"month\", targetDayJs.month() + 1);\n component.assign(\"year\", targetDayJs.year());\n}\nexports.assignSimilarDate = assignSimilarDate;\nfunction assignSimilarTime(component, targetDayJs) {\n component.assign(\"hour\", targetDayJs.hour());\n component.assign(\"minute\", targetDayJs.minute());\n component.assign(\"second\", targetDayJs.second());\n component.assign(\"millisecond\", targetDayJs.millisecond());\n component.assign(\"timezoneOffset\", targetDayJs.utcOffset());\n}\nexports.assignSimilarTime = assignSimilarTime;\nfunction implySimilarTime(component, targetDayJs) {\n component.imply(\"hour\", targetDayJs.hour());\n component.imply(\"minute\", targetDayJs.minute());\n component.imply(\"second\", targetDayJs.second());\n component.imply(\"millisecond\", targetDayJs.millisecond());\n component.imply(\"timezoneOffset\", targetDayJs.utcOffset());\n}\nexports.implySimilarTime = implySimilarTime;\n\n\n//# sourceURL=webpack://chrono-node/./dist/utils/dayjs.js?");
|
|
999
|
+
|
|
1000
|
+
/***/ }),
|
|
1001
|
+
|
|
1002
|
+
/***/ "./dist/utils/pattern.js":
|
|
1003
|
+
/*!*******************************!*\
|
|
1004
|
+
!*** ./dist/utils/pattern.js ***!
|
|
1005
|
+
\*******************************/
|
|
1006
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1007
|
+
|
|
1008
|
+
"use strict";
|
|
1009
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.matchAnyPattern = exports.extractTerms = exports.repeatedTimeunitPattern = void 0;\nfunction repeatedTimeunitPattern(prefix, singleTimeunitPattern) {\n const singleTimeunitPatternNoCapture = singleTimeunitPattern.replace(/\\((?!\\?)/g, \"(?:\");\n return `${prefix}${singleTimeunitPatternNoCapture}\\\\s*(?:,?\\\\s{0,5}${singleTimeunitPatternNoCapture}){0,10}`;\n}\nexports.repeatedTimeunitPattern = repeatedTimeunitPattern;\nfunction extractTerms(dictionary) {\n let keys;\n if (dictionary instanceof Array) {\n keys = [...dictionary];\n }\n else if (dictionary instanceof Map) {\n keys = Array.from(dictionary.keys());\n }\n else {\n keys = Object.keys(dictionary);\n }\n return keys;\n}\nexports.extractTerms = extractTerms;\nfunction matchAnyPattern(dictionary) {\n const joinedTerms = extractTerms(dictionary)\n .sort((a, b) => b.length - a.length)\n .join(\"|\")\n .replace(/\\./g, \"\\\\.\");\n return `(?:${joinedTerms})`;\n}\nexports.matchAnyPattern = matchAnyPattern;\n\n\n//# sourceURL=webpack://chrono-node/./dist/utils/pattern.js?");
|
|
1010
|
+
|
|
1011
|
+
/***/ }),
|
|
1012
|
+
|
|
1013
|
+
/***/ "./dist/utils/timeunits.js":
|
|
1014
|
+
/*!*********************************!*\
|
|
1015
|
+
!*** ./dist/utils/timeunits.js ***!
|
|
1016
|
+
\*********************************/
|
|
1017
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1018
|
+
|
|
1019
|
+
"use strict";
|
|
1020
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.addImpliedTimeUnits = exports.reverseTimeUnits = void 0;\nfunction reverseTimeUnits(timeUnits) {\n const reversed = {};\n for (const key in timeUnits) {\n reversed[key] = -timeUnits[key];\n }\n return reversed;\n}\nexports.reverseTimeUnits = reverseTimeUnits;\nfunction addImpliedTimeUnits(components, timeUnits) {\n const output = components.clone();\n let date = components.dayjs();\n for (const key in timeUnits) {\n date = date.add(timeUnits[key], key);\n }\n if (\"day\" in timeUnits || \"d\" in timeUnits || \"week\" in timeUnits || \"month\" in timeUnits || \"year\" in timeUnits) {\n output.imply(\"day\", date.date());\n output.imply(\"month\", date.month() + 1);\n output.imply(\"year\", date.year());\n }\n if (\"second\" in timeUnits || \"minute\" in timeUnits || \"hour\" in timeUnits) {\n output.imply(\"second\", date.second());\n output.imply(\"minute\", date.minute());\n output.imply(\"hour\", date.hour());\n }\n return output;\n}\nexports.addImpliedTimeUnits = addImpliedTimeUnits;\n\n\n//# sourceURL=webpack://chrono-node/./dist/utils/timeunits.js?");
|
|
1021
|
+
|
|
1022
|
+
/***/ }),
|
|
1023
|
+
|
|
1024
|
+
/***/ "./node_modules/dayjs/dayjs.min.js":
|
|
1025
|
+
/*!*****************************************!*\
|
|
1026
|
+
!*** ./node_modules/dayjs/dayjs.min.js ***!
|
|
1027
|
+
\*****************************************/
|
|
1028
|
+
/***/ (function(module) {
|
|
1029
|
+
|
|
1030
|
+
eval("!function(t,e){ true?module.exports=e():0}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",f=\"month\",h=\"quarter\",c=\"year\",d=\"date\",$=\"Invalid Date\",l=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},D=\"en\",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if(\"string\"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else{var i=t.name;v[i]=t,r=i}return!n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g=\"set\"+(this.$u?\"UTC\":\"\");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+\"Hours\",0);case u:return l(g+\"Minutes\",1);case s:return l(g+\"Seconds\",2);case i:return l(g+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h=\"set\"+(this.$u?\"UTC\":\"\"),$=(n={},n[a]=h+\"Date\",n[d]=h+\"Date\",n[f]=h+\"Month\",n[c]=h+\"FullYear\",n[u]=h+\"Hours\",n[s]=h+\"Minutes\",n[i]=h+\"Seconds\",n[r]=h+\"Milliseconds\",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this;if(!this.isValid())return $;var n=t||\"YYYY-MM-DDTHH:mm:ssZ\",r=O.z(this),i=this.$locale(),s=this.$H,u=this.$m,a=this.$M,o=i.weekdays,f=i.months,h=function(t,r,i,s){return t&&(t[r]||t(e,n))||i[r].substr(0,s)},c=function(t){return O.s(s%12||12,t,\"0\")},d=i.meridiem||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,\"0\"),MMM:h(i.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,\"0\"),d:String(this.$W),dd:h(i.weekdaysMin,this.$W,o,2),ddd:h(i.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,\"0\"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,\"0\"),s:String(this.$s),ss:O.s(this.$s,2,\"0\"),SSS:O.s(this.$ms,3,\"0\"),Z:r};return n.replace(y,(function(t,e){return e||l[t]||r.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",f],[\"$y\",c],[\"$D\",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));\n\n//# sourceURL=webpack://chrono-node/./node_modules/dayjs/dayjs.min.js?");
|
|
1031
|
+
|
|
1032
|
+
/***/ }),
|
|
1033
|
+
|
|
1034
|
+
/***/ "./node_modules/dayjs/plugin/quarterOfYear.js":
|
|
1035
|
+
/*!****************************************************!*\
|
|
1036
|
+
!*** ./node_modules/dayjs/plugin/quarterOfYear.js ***!
|
|
1037
|
+
\****************************************************/
|
|
1038
|
+
/***/ (function(module) {
|
|
1039
|
+
|
|
1040
|
+
eval("!function(t,n){ true?module.exports=n():0}(this,(function(){\"use strict\";var t=\"month\",n=\"quarter\";return function(e,i){var r=i.prototype;r.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var s=r.add;r.add=function(e,i){return e=Number(e),this.$utils().p(i)===n?this.add(3*e,t):s.bind(this)(e,i)};var u=r.startOf;r.startOf=function(e,i){var r=this.$utils(),s=!!r.u(i)||i;if(r.p(e)===n){var o=this.quarter()-1;return s?this.month(3*o).startOf(t).startOf(\"day\"):this.month(3*o+2).endOf(t).endOf(\"day\")}return u.bind(this)(e,i)}}}));\n\n//# sourceURL=webpack://chrono-node/./node_modules/dayjs/plugin/quarterOfYear.js?");
|
|
1041
|
+
|
|
1042
|
+
/***/ })
|
|
1043
|
+
|
|
1044
|
+
/******/ });
|
|
1045
|
+
/************************************************************************/
|
|
1046
|
+
/******/ // The module cache
|
|
1047
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1048
|
+
/******/
|
|
1049
|
+
/******/ // The require function
|
|
1050
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1051
|
+
/******/ // Check if module is in cache
|
|
1052
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1053
|
+
/******/ if (cachedModule !== undefined) {
|
|
1054
|
+
/******/ return cachedModule.exports;
|
|
1055
|
+
/******/ }
|
|
1056
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1057
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1058
|
+
/******/ // no module.id needed
|
|
1059
|
+
/******/ // no module.loaded needed
|
|
1060
|
+
/******/ exports: {}
|
|
1061
|
+
/******/ };
|
|
1062
|
+
/******/
|
|
1063
|
+
/******/ // Execute the module function
|
|
1064
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1065
|
+
/******/
|
|
1066
|
+
/******/ // Return the exports of the module
|
|
1067
|
+
/******/ return module.exports;
|
|
1068
|
+
/******/ }
|
|
1069
|
+
/******/
|
|
1070
|
+
/************************************************************************/
|
|
1071
|
+
/******/
|
|
1072
|
+
/******/ // startup
|
|
1073
|
+
/******/ // Load entry module and return exports
|
|
1074
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
1075
|
+
/******/ var __webpack_exports__ = __webpack_require__("./dist/chrono.js");
|
|
1076
|
+
/******/
|
|
1077
|
+
/******/ })()
|
|
1078
|
+
;
|