main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
import type { FormatDistanceFn } from "../../types.js";
export declare const formatDistance: FormatDistanceFn;

View File

@@ -0,0 +1,2 @@
import type { FormatDistanceFn } from "../../types.js";
export declare const formatDistance: FormatDistanceFn;

View File

@@ -0,0 +1,105 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "کمتر از یک ثانیه",
other: "کمتر از {{count}} ثانیه",
},
xSeconds: {
one: "1 ثانیه",
other: "{{count}} ثانیه",
},
halfAMinute: "نیم دقیقه",
lessThanXMinutes: {
one: "کمتر از یک دقیقه",
other: "کمتر از {{count}} دقیقه",
},
xMinutes: {
one: "1 دقیقه",
other: "{{count}} دقیقه",
},
aboutXHours: {
one: "حدود 1 ساعت",
other: "حدود {{count}} ساعت",
},
xHours: {
one: "1 ساعت",
other: "{{count}} ساعت",
},
xDays: {
one: "1 روز",
other: "{{count}} روز",
},
aboutXWeeks: {
one: "حدود 1 هفته",
other: "حدود {{count}} هفته",
},
xWeeks: {
one: "1 هفته",
other: "{{count}} هفته",
},
aboutXMonths: {
one: "حدود 1 ماه",
other: "حدود {{count}} ماه",
},
xMonths: {
one: "1 ماه",
other: "{{count}} ماه",
},
aboutXYears: {
one: "حدود 1 سال",
other: "حدود {{count}} سال",
},
xYears: {
one: "1 سال",
other: "{{count}} سال",
},
overXYears: {
one: "بیشتر از 1 سال",
other: "بیشتر از {{count}} سال",
},
almostXYears: {
one: "نزدیک 1 سال",
other: "نزدیک {{count}} سال",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "در " + result;
} else {
return result + " قبل";
}
}
return result;
};
exports.formatDistance = formatDistance;

View File

@@ -0,0 +1,101 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "کمتر از یک ثانیه",
other: "کمتر از {{count}} ثانیه",
},
xSeconds: {
one: "1 ثانیه",
other: "{{count}} ثانیه",
},
halfAMinute: "نیم دقیقه",
lessThanXMinutes: {
one: "کمتر از یک دقیقه",
other: "کمتر از {{count}} دقیقه",
},
xMinutes: {
one: "1 دقیقه",
other: "{{count}} دقیقه",
},
aboutXHours: {
one: "حدود 1 ساعت",
other: "حدود {{count}} ساعت",
},
xHours: {
one: "1 ساعت",
other: "{{count}} ساعت",
},
xDays: {
one: "1 روز",
other: "{{count}} روز",
},
aboutXWeeks: {
one: "حدود 1 هفته",
other: "حدود {{count}} هفته",
},
xWeeks: {
one: "1 هفته",
other: "{{count}} هفته",
},
aboutXMonths: {
one: "حدود 1 ماه",
other: "حدود {{count}} ماه",
},
xMonths: {
one: "1 ماه",
other: "{{count}} ماه",
},
aboutXYears: {
one: "حدود 1 سال",
other: "حدود {{count}} سال",
},
xYears: {
one: "1 سال",
other: "{{count}} سال",
},
overXYears: {
one: "بیشتر از 1 سال",
other: "بیشتر از {{count}} سال",
},
almostXYears: {
one: "نزدیک 1 سال",
other: "نزدیک {{count}} سال",
},
};
export const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "در " + result;
} else {
return result + " قبل";
}
}
return result;
};

View File

@@ -0,0 +1,2 @@
import type { FormatLong } from "../../types.js";
export declare const formatLong: FormatLong;

View File

@@ -0,0 +1,2 @@
import type { FormatLong } from "../../types.js";
export declare const formatLong: FormatLong;

41
node_modules/date-fns/locale/fa-IR/_lib/formatLong.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE do MMMM y",
long: "do MMMM y",
medium: "d MMM y",
short: "yyyy/MM/dd",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'در' {{time}}",
long: "{{date}} 'در' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

39
node_modules/date-fns/locale/fa-IR/_lib/formatLong.mjs generated vendored Normal file
View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE do MMMM y",
long: "do MMMM y",
medium: "d MMM y",
short: "yyyy/MM/dd",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'در' {{time}}",
long: "{{date}} 'در' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@@ -0,0 +1,2 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

View File

@@ -0,0 +1,2 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "eeee 'گذشته در' p",
yesterday: "'دیروز در' p",
today: "'امروز در' p",
tomorrow: "'فردا در' p",
nextWeek: "eeee 'در' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,11 @@
const formatRelativeLocale = {
lastWeek: "eeee 'گذشته در' p",
yesterday: "'دیروز در' p",
today: "'امروز در' p",
tomorrow: "'فردا در' p",
nextWeek: "eeee 'در' p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

View File

@@ -0,0 +1,2 @@
import type { Localize } from "../../types.js";
export declare const localize: Localize;

View File

@@ -0,0 +1,2 @@
import type { Localize } from "../../types.js";
export declare const localize: Localize;

170
node_modules/date-fns/locale/fa-IR/_lib/localize.js generated vendored Normal file
View File

@@ -0,0 +1,170 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["ق", "ب"],
abbreviated: ["ق.م.", "ب.م."],
wide: ["قبل از میلاد", "بعد از میلاد"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: [م1", م2", م3", م4"],
wide: ["سه‌ماهه 1", "سه‌ماهه 2", "سه‌ماهه 3", "سه‌ماهه 4"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["ژ", "ف", "م", "آ", "م", "ج", "ج", "آ", "س", "ا", "ن", "د"],
abbreviated: [
"ژانـ",
"فور",
"مارس",
"آپر",
"می",
"جون",
"جولـ",
"آگو",
"سپتـ",
"اکتـ",
"نوامـ",
"دسامـ",
],
wide: [
"ژانویه",
"فوریه",
"مارس",
"آپریل",
"می",
"جون",
"جولای",
"آگوست",
"سپتامبر",
"اکتبر",
"نوامبر",
"دسامبر",
],
};
const dayValues = {
narrow: ["ی", "د", "س", "چ", "پ", "ج", "ش"],
short: ["1ش", "2ش", "3ش", "4ش", "5ش", "ج", "ش"],
abbreviated: [
"یکشنبه",
"دوشنبه",
"سه‌شنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه",
],
wide: ["یکشنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
};
const dayPeriodValues = {
narrow: {
am: "ق",
pm: "ب",
midnight: "ن",
noon: "ظ",
morning: "ص",
afternoon: "ب.ظ.",
evening: "ع",
night: "ش",
},
abbreviated: {
am: "ق.ظ.",
pm: "ب.ظ.",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
wide: {
am: "قبل‌ازظهر",
pm: "بعدازظهر",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ق",
pm: "ب",
midnight: "ن",
noon: "ظ",
morning: "ص",
afternoon: "ب.ظ.",
evening: "ع",
night: "ش",
},
abbreviated: {
am: "ق.ظ.",
pm: "ب.ظ.",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
wide: {
am: "قبل‌ازظهر",
pm: "بعدازظهر",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
return String(dirtyNumber);
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

168
node_modules/date-fns/locale/fa-IR/_lib/localize.mjs generated vendored Normal file
View File

@@ -0,0 +1,168 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["ق", "ب"],
abbreviated: ["ق.م.", "ب.م."],
wide: ["قبل از میلاد", "بعد از میلاد"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: [م1", م2", م3", م4"],
wide: ["سه‌ماهه 1", "سه‌ماهه 2", "سه‌ماهه 3", "سه‌ماهه 4"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["ژ", "ف", "م", "آ", "م", "ج", "ج", "آ", "س", "ا", "ن", "د"],
abbreviated: [
"ژانـ",
"فور",
"مارس",
"آپر",
"می",
"جون",
"جولـ",
"آگو",
"سپتـ",
"اکتـ",
"نوامـ",
"دسامـ",
],
wide: [
"ژانویه",
"فوریه",
"مارس",
"آپریل",
"می",
"جون",
"جولای",
"آگوست",
"سپتامبر",
"اکتبر",
"نوامبر",
"دسامبر",
],
};
const dayValues = {
narrow: ["ی", "د", "س", "چ", "پ", "ج", "ش"],
short: ["1ش", "2ش", "3ش", "4ش", "5ش", "ج", "ش"],
abbreviated: [
"یکشنبه",
"دوشنبه",
"سه‌شنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه",
],
wide: ["یکشنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
};
const dayPeriodValues = {
narrow: {
am: "ق",
pm: "ب",
midnight: "ن",
noon: "ظ",
morning: "ص",
afternoon: "ب.ظ.",
evening: "ع",
night: "ش",
},
abbreviated: {
am: "ق.ظ.",
pm: "ب.ظ.",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
wide: {
am: "قبل‌ازظهر",
pm: "بعدازظهر",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ق",
pm: "ب",
midnight: "ن",
noon: "ظ",
morning: "ص",
afternoon: "ب.ظ.",
evening: "ع",
night: "ش",
},
abbreviated: {
am: "ق.ظ.",
pm: "ب.ظ.",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
wide: {
am: "قبل‌ازظهر",
pm: "بعدازظهر",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
return String(dirtyNumber);
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

2
node_modules/date-fns/locale/fa-IR/_lib/match.d.mts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Match } from "../../types.js";
export declare const match: Match;

2
node_modules/date-fns/locale/fa-IR/_lib/match.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Match } from "../../types.js";
export declare const match: Match;

145
node_modules/date-fns/locale/fa-IR/_lib/match.js generated vendored Normal file
View File

@@ -0,0 +1,145 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ق|ب)/i,
abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?د\.?\s?م\.?|م\.?\s?|د\.?\s?م\.?)/i,
wide: /^(قبل از میلاد|قبل از دوران مشترک|میلادی|دوران مشترک|بعد از میلاد)/i,
};
const parseEraPatterns = {
any: [/^قبل/i, /^بعد/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^س‌م[1234]/i,
wide: /^سه‌ماهه [1234]/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[جژفمآاماسند]/i,
abbreviated:
/^(جنو|ژانـ|ژانویه|فوریه|فور|مارس|آوریل|آپر|مه|می|ژوئن|جون|جول|جولـ|ژوئیه|اوت|آگو|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نوامـ|دسامبر|دسامـ|دسم)/i,
wide: /^(ژانویه|جنوری|فبروری|فوریه|مارچ|مارس|آپریل|اپریل|ایپریل|آوریل|مه|می|ژوئن|جون|جولای|ژوئیه|آگست|اگست|آگوست|اوت|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نومبر|دسامبر|دسمبر)/i,
};
const parseMonthPatterns = {
narrow: [
/^(ژ|ج)/i,
/^ف/i,
/^م/i,
/^(آ|ا)/i,
/^م/i,
/^(ژ|ج)/i,
/^(ج|ژ)/i,
/^(آ|ا)/i,
/^س/i,
/^ا/i,
/^ن/i,
/^د/i,
],
any: [
/^ژا/i,
/^ف/i,
/^ما/i,
/^آپ/i,
/^(می|مه)/i,
/^(ژوئن|جون)/i,
/^(ژوئی|جول)/i,
/^(اوت|آگ)/i,
/^س/i,
/^(اوک|اک)/i,
/^ن/i,
/^د/i,
],
};
const matchDayPatterns = {
narrow: /^[شیدسچپج]/i,
short: /^(ش|ج|1ش|2ش|3ش|4ش|5ش)/i,
abbreviated: /^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i,
wide: /^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i,
};
const parseDayPatterns = {
narrow: [/^ی/i, /^دو/i, /^س/i, /^چ/i, /^پ/i, /^ج/i, /^ش/i],
any: [
/^(ی|1ش|یکشنبه)/i,
/^(د|2ش|دوشنبه)/i,
/^(س|3ش|سه‌شنبه)/i,
/^(چ|4ش|چهارشنبه)/i,
/^(پ|5ش|پنجشنبه)/i,
/^(ج|جمعه)/i,
/^(ش|شنبه)/i,
],
};
const matchDayPeriodPatterns = {
narrow: /^(ب|ق|ن|ظ|ص|ب.ظ.|ع|ش)/i,
abbreviated: /^(ق.ظ.|ب.ظ.|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i,
wide: /^(قبل‌ازظهر|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^(ق|ق.ظ.|قبل‌ازظهر)/i,
pm: /^(ب|ب.ظ.|بعدازظهر)/i,
midnight: /^(‌نیمه‌شب|ن)/i,
noon: /^(ظ|ظهر)/i,
morning: /(ص|صبح)/i,
afternoon: /(ب|ب.ظ.|بعدازظهر)/i,
evening: /(ع|عصر)/i,
night: /(ش|شب)/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

142
node_modules/date-fns/locale/fa-IR/_lib/match.mjs generated vendored Normal file
View File

@@ -0,0 +1,142 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ق|ب)/i,
abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?د\.?\s?م\.?|م\.?\s?|د\.?\s?م\.?)/i,
wide: /^(قبل از میلاد|قبل از دوران مشترک|میلادی|دوران مشترک|بعد از میلاد)/i,
};
const parseEraPatterns = {
any: [/^قبل/i, /^بعد/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^س‌م[1234]/i,
wide: /^سه‌ماهه [1234]/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[جژفمآاماسند]/i,
abbreviated:
/^(جنو|ژانـ|ژانویه|فوریه|فور|مارس|آوریل|آپر|مه|می|ژوئن|جون|جول|جولـ|ژوئیه|اوت|آگو|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نوامـ|دسامبر|دسامـ|دسم)/i,
wide: /^(ژانویه|جنوری|فبروری|فوریه|مارچ|مارس|آپریل|اپریل|ایپریل|آوریل|مه|می|ژوئن|جون|جولای|ژوئیه|آگست|اگست|آگوست|اوت|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نومبر|دسامبر|دسمبر)/i,
};
const parseMonthPatterns = {
narrow: [
/^(ژ|ج)/i,
/^ف/i,
/^م/i,
/^(آ|ا)/i,
/^م/i,
/^(ژ|ج)/i,
/^(ج|ژ)/i,
/^(آ|ا)/i,
/^س/i,
/^ا/i,
/^ن/i,
/^د/i,
],
any: [
/^ژا/i,
/^ف/i,
/^ما/i,
/^آپ/i,
/^(می|مه)/i,
/^(ژوئن|جون)/i,
/^(ژوئی|جول)/i,
/^(اوت|آگ)/i,
/^س/i,
/^(اوک|اک)/i,
/^ن/i,
/^د/i,
],
};
const matchDayPatterns = {
narrow: /^[شیدسچپج]/i,
short: /^(ش|ج|1ش|2ش|3ش|4ش|5ش)/i,
abbreviated: /^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i,
wide: /^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i,
};
const parseDayPatterns = {
narrow: [/^ی/i, /^دو/i, /^س/i, /^چ/i, /^پ/i, /^ج/i, /^ش/i],
any: [
/^(ی|1ش|یکشنبه)/i,
/^(د|2ش|دوشنبه)/i,
/^(س|3ش|سه‌شنبه)/i,
/^(چ|4ش|چهارشنبه)/i,
/^(پ|5ش|پنجشنبه)/i,
/^(ج|جمعه)/i,
/^(ش|شنبه)/i,
],
};
const matchDayPeriodPatterns = {
narrow: /^(ب|ق|ن|ظ|ص|ب.ظ.|ع|ش)/i,
abbreviated: /^(ق.ظ.|ب.ظ.|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i,
wide: /^(قبل‌ازظهر|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^(ق|ق.ظ.|قبل‌ازظهر)/i,
pm: /^(ب|ب.ظ.|بعدازظهر)/i,
midnight: /^(‌نیمه‌شب|ن)/i,
noon: /^(ظ|ظهر)/i,
morning: /(ص|صبح)/i,
afternoon: /(ب|ب.ظ.|بعدازظهر)/i,
evening: /(ع|عصر)/i,
night: /(ش|شب)/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};