@hebcal/leyning
Version:
Torah Reading API for Parashat HaShavua and holidays
884 lines (868 loc) • 134 kB
JavaScript
/*! @hebcal/leyning v9.2.5 */
var hebcal__leyning = (function (exports, locale, event, holidays, sedra, ParshaEvent) {
'use strict';
var poHe$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat Machar Chodesh": ["שַׁבָּת מָחָר חוֹדֶשׁ"], "Shabbat Rosh Chodesh": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Pesach I (on Shabbat)": ["פֶּסַח יוֹם א׳ (בְּשַׁבָּת)"], "Pesach Chol ha-Moed Day 1": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם א׳"], "Pesach Chol ha-Moed Day 2": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳"], "Pesach Chol ha-Moed Day 2 on Sunday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳ (בְּיוֹם רִאשׁוֹן)"], "Pesach Chol ha-Moed Day 3": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳"], "Pesach Chol ha-Moed Day 3 on Monday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳ (בְּיוֹם שָׁנִי)"], "Pesach Chol ha-Moed Day 4": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ד׳"], "Pesach Chol ha-Moed Day 5": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ה׳"], "Pesach Shabbat Chol ha-Moed": ["פֶּסַח שַׁבָּת חוֹל הַמּוֹעֵד"], "Pesach VII (on Shabbat)": ["פֶּסַח ז׳ (בְּשַׁבָּת)"], "Pesach VIII (on Shabbat)": ["פֶּסַח ח׳ (בְּשַׁבָּת)"], "Shavuot II (on Shabbat)": ["שָׁבוּעוֹת יוֹם ב׳ (בְּשַׁבָּת)"], "Rosh Hashana I (on Shabbat)": ["רֹאשׁ הַשָּׁנָה יוֹם א׳ (בְּשַׁבָּת)"], "Yom Kippur (on Shabbat)": ["יוֹם כִּפּוּר (בְּשַׁבָּת)"], "Yom Kippur (Mincha, Traditional)": ["יוֹם כִּפּוּר מִנחָה"], "Yom Kippur (Mincha, Alternate)": ["יוֹם כִּפּוּר מִנחָה"], "Sukkot I (on Shabbat)": ["סוּכּוֹת יוֹם א׳ (בְּשַׁבָּת)"], "Sukkot Chol ha-Moed Day 1": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם א׳"], "Sukkot Chol ha-Moed Day 2": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ב׳"], "Sukkot Chol ha-Moed Day 3": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ג׳"], "Sukkot Chol ha-Moed Day 4": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ד׳"], "Sukkot Chol ha-Moed Day 5": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ה׳"], "Sukkot Shabbat Chol ha-Moed": ["סוּכּוֹת שַׁבָּת חוֹל הַמּוֹעֵד"], "Sukkot Final Day (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Shmini Atzeret (on Shabbat)": ["שְׁמִינִי עֲצֶרֶת (בְּשַׁבָּת)"], "Chanukah Day 1": ["חֲנוּכָּה יוֹם א׳"], "Chanukah Day 2": ["חֲנוּכָּה יוֹם ב׳"], "Chanukah Day 3": ["חֲנוּכָּה יוֹם ג׳"], "Chanukah Day 4": ["חֲנוּכָּה יוֹם ד׳"], "Chanukah Day 5": ["חֲנוּכָּה יוֹם ה׳"], "Chanukah Day 6": ["חֲנוּכָּה יוֹם ו׳"], "Chanukah Day 7": ["חֲנוּכָּה יוֹם ז׳"], "Chanukah Day 7 (on Rosh Chodesh)": ["חֲנוּכָּה יוֹם ז׳ (רֹאשׁ חוֹדֶשׁ)"], "Chanukah Day 8": ["חֲנוּכָּה יוֹם ח׳"], "Chanukah Day 1 (on Shabbat)": ["חֲנוּכָּה יוֹם א׳ (בְּשַׁבָּת)"], "Chanukah Day 2 (on Shabbat)": ["חֲנוּכָּה יוֹם ב׳ (בְּשַׁבָּת)"], "Chanukah Day 3 (on Shabbat)": ["חֲנוּכָּה יוֹם ג׳ (בְּשַׁבָּת)"], "Chanukah Day 4 (on Shabbat)": ["חֲנוּכָּה יוֹם ד׳ (בְּשַׁבָּת)"], "Chanukah Day 5 (on Shabbat)": ["חֲנוּכָּה יוֹם ה׳ (בְּשַׁבָּת)"], "Chanukah Day 7 (on Shabbat)": ["חֲנוּכָּה יוֹם ז׳ (בְּשַׁבָּת)"], "Chanukah Day 8 (on Shabbat)": ["חֲנוּכָּה יוֹם ח׳ (בְּשַׁבָּת)"], "Shabbat Rosh Chodesh Chanukah": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ חֲנוּכָּה"], "Yom Kippur (Mincha)": ["יוֹם כִּפּוּר מִנחָה"], "Tish'a B'Av (Mincha)": ["תִּשְׁעָה בְּאָב מִנחָה"], "Asara B'Tevet (Mincha)": ["עֲשָׂרָה בְּטֵבֵת מִנחָה"], "Ta'anit Bechorot (Mincha)": ["תַּעֲנִית בְּכוֹרוֹת מִנחָה"], "Ta'anit Esther (Mincha)": ["תַּעֲנִית אֶסְתֵּר מִנחָה"], "Tzom Gedaliah (Mincha)": ["צוֹם גְּדַלְיָה מִנחָה"], "Tzom Tammuz (Mincha)": ["צוֹם י״ז בְּתַמּוּז מִנחָה"] } } };
locale.Locale.addTranslations('he', poHe$1);
locale.Locale.addTranslations('h', poHe$1);
const heStrs$1 = poHe$1.contexts[''];
const heNoNikud$1 = {};
for (const [key, val] of Object.entries(heStrs$1)) {
heNoNikud$1[key] = [locale.Locale.hebrewStripNikkud(val[0])];
}
const poHeNoNikud$1 = {
headers: poHe$1.headers,
contexts: { '': heNoNikud$1 },
};
locale.Locale.addTranslations('he-x-NoNikud', poHeNoNikud$1);
const Genesis=[0,31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26];const Exodus=[0,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,23,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38];const Leviticus=[0,17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34];const Numbers=[0,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13];const Deuteronomy=[0,46,37,29,49,30,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12];const Joshua=[0,18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33];const Judges=[0,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25];const Ruth=[0,22,23,18,22];const Isaiah=[0,31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24];const Jeremiah=[0,19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34];const Lamentations=[0,22,22,66,22,22];const Esther=[0,22,23,15,17,14,14,10,17,32,3];const Ecclesiastes=[0,18,26,22,17,19,12,29,17,18,20,10,14];const Ezekiel=[0,28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35];const Daniel=[0,21,49,100,34,30,29,28,27,27,21,45,13,64,42];const Hosea=[0,9,25,5,19,15,11,16,14,17,15,11,15,15,10];const Joel=[0,20,27,5,21];const Amos=[0,15,16,15,13,27,14,17,14,15];const Obadiah=[0,21];const Jonah=[0,16,11,10,11];const Micah=[0,16,13,12,14,14,16,20];const Nachum=[0,14,14,19];const Habakkuk=[0,17,20,19];const Zephaniah=[0,18,15,20];const Haggai=[0,15,23];const Zechariah=[0,17,17,10,14,11,15,14,23,17,12,17,14,9,21];const Malachi=[0,14,17,24];var numverses = {Genesis:Genesis,Exodus:Exodus,Leviticus:Leviticus,Numbers:Numbers,Deuteronomy:Deuteronomy,Joshua:Joshua,Judges:Judges,Ruth:Ruth,"I Samuel":[0,28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,28,23,43,25,12,25,11,31,13],"II Samuel":[0,27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25],"I Kings":[0,53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],"II Kings":[0,18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30],Isaiah:Isaiah,Jeremiah:Jeremiah,Lamentations:Lamentations,Esther:Esther,Ecclesiastes:Ecclesiastes,"Song of Songs":[0,17,17,11,16,16,12,14,14],Ezekiel:Ezekiel,Daniel:Daniel,Hosea:Hosea,Joel:Joel,Amos:Amos,Obadiah:Obadiah,Jonah:Jonah,Micah:Micah,Nachum:Nachum,Habakkuk:Habakkuk,Zephaniah:Zephaniah,Haggai:Haggai,Zechariah:Zechariah,Malachi:Malachi};
/**
* Names of the books of the Torah.
*
* `BOOK[1] === 'Genesis'`
* @readonly
*/
const BOOK = [
'',
'Genesis',
'Exodus',
'Leviticus',
'Numbers',
'Deuteronomy',
];
/**
* The number of verses in each book of the Tanakh.
* Indexed by English transliterated name of book,
* and arrays are 1-based.
*
* There are 51 chapters in Genesis, so
* `NUM_VERSES['Genesis'].length === 51`.
*
* There are 26 verses in Genesis chapter 4,
* so `NUM_VERSES['Genesis'][4] === 26`.
* @readonly
*/
const NUM_VERSES = numverses;
/**
* Formats parsha as a string
* @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
*/
function parshaToString(parsha) {
if (typeof parsha === 'string') {
return parsha;
}
else if (!Array.isArray(parsha) ||
parsha.length === 0 ||
parsha.length > 2) {
throw new TypeError(`Bad parsha argument: ${parsha}`);
}
let s = parsha[0];
if (parsha.length === 2) {
s += '-' + parsha[1];
}
return s;
}
/**
* Calculates the number of verses in an aliyah or haftara based on
* the `b` (begin verse), `e` (end verse) and `k` (book).
* Modifies `aliyah` by setting the `v` field.
*/
function calculateNumVerses(aliyah) {
if (aliyah.v) {
return aliyah.v;
}
aliyah.v = subtractVerses(aliyah.k, aliyah.b, aliyah.e) + 1;
return aliyah.v;
}
/**
* Finds the number of verses between two locations in the same book.
* @param book The English name of the book (e.g. "Numbers")
* @param from The starting verse (e.g. "28:9")
* @param to The ending verse (e.g. "28:15")
* @returns The number of verses between the two locations, excluding the `to` verse.
*/
function subtractVerses(book, from, to) {
const chapVerseBegin = from.split(':');
const chapVerseEnd = to.split(':');
const c1 = parseInt(chapVerseBegin[0], 10);
const c2 = parseInt(chapVerseEnd[0], 10);
const v1 = parseInt(chapVerseBegin[1], 10);
const v2 = parseInt(chapVerseEnd[1], 10);
let result = 0;
if (c1 === c2) {
return v2 - v1;
}
const numv = NUM_VERSES[book];
if (typeof numv !== 'object' || !numv.length) {
throw new ReferenceError(`Can't find numverses for ${book}`);
}
let total = numv[c1] - v1;
for (let chap = c1 + 1; chap < c2; chap++) {
total += numv[chap];
}
total += v2;
result = total;
return result;
}
/**
* Calculates the next verse after adding a number of verses to a given location.
* @param book The English name of the book (e.g. "Numbers")
* @param from The starting verse (e.g. "28:9")
* @param numVerses The number of verses to add; must be nonnegative.
* @returns The next verse after adding the specified number of verses,
* or null if the resulting verse exceeds the number of verses
* in the book.
*/
function addVerses(book, from, numVerses) {
const chapVerseBegin = from.split(':');
const c1 = parseInt(chapVerseBegin[0], 10);
const v1 = parseInt(chapVerseBegin[1], 10);
const numv = NUM_VERSES[book];
if (typeof numv !== 'object' || !numv.length) {
throw new ReferenceError(`Can't find numverses for ${book}`);
}
let total = v1 + numVerses;
let c2 = c1;
while (total > numv[c2]) {
total -= numv[c2];
c2++;
if (!numv[c2])
return null;
}
return `${c2}:${total}`;
}
/**
* Formats an aliyah object like "Numbers 28:9-28:15"
*/
function formatAliyahWithBook(a) {
return `${a.k} ${a.b}-${a.e}`;
}
/**
* Formats an aliyah object like "Numbers 28:9-15"
*/
function formatAliyahShort(aliyah, showBook) {
const begin = aliyah.b;
const end0 = aliyah.e;
const prefix = showBook ? aliyah.k + ' ' : '';
if (begin === end0) {
return `${prefix}${begin}`;
}
const cv1 = begin.split(':');
const cv2 = end0.split(':');
const end = cv1[0] === cv2[0] ? cv2[1] : end0;
return `${prefix}${begin}-${end}`;
}
/**
* @private
*/
function isChapVerseBefore(a, b) {
const cv1 = a.split(':').map(x => +x);
const cv2 = b.split(':').map(x => +x);
return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
}
/**
* Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
* Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
*/
function makeLeyningParts(aliyot) {
const nums = Object.keys(aliyot).filter(x => {
if (x.length === 1) {
return true;
}
const code = x.charCodeAt(0);
return code >= 48 && code <= 57;
});
let start = aliyot[nums[0]];
let end = start;
const parts = [];
for (let i = 0; i < nums.length; i++) {
const num = nums[i];
const aliyah = aliyot[num];
if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
// short-circuit when final aliyah is within the previous (e.g. M inside of 7)
continue;
}
const prevEndChap = +end.e.split(':')[0];
const curStartChap = +aliyah.b.split(':')[0];
const sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
if (i !== 0 &&
(aliyah.k !== start.k ||
isChapVerseBefore(aliyah.b, start.e) ||
!sameOrNextChap)) {
parts.push({ k: start.k, b: start.b, e: end.e });
start = aliyah;
}
end = aliyah;
}
parts.push({ k: start.k, b: start.b, e: end.e });
return parts;
}
/**
* Returns a string representation of the leyning parts.
* Separate verse ranges read from the same book are separated
* by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
* Verse ranges from different books are separated by semicolons,
* e.g. `Genesis 21:1-34; Numbers 29:1-6`.
*/
function makeSummaryFromParts(parts) {
if (!Array.isArray(parts)) {
parts = [parts];
}
let prev = parts[0];
let summary = formatAliyahShort(prev, true);
for (let i = 1; i < parts.length; i++) {
const part = parts[i];
if (part.k === prev.k) {
summary += ', ';
}
else {
summary += `; ${part.k} `;
}
summary += formatAliyahShort(part, false);
prev = part;
}
return summary;
}
/**
* Makes a summary of the leyning, like "Genesis 6:9-11:32"
*/
function makeLeyningSummary(aliyot) {
const parts = makeLeyningParts(aliyot);
return makeSummaryFromParts(parts);
}
/**
* Makes a deep copy of the src object using JSON stringify and parse
*/
function clone(src) {
return JSON.parse(JSON.stringify(src));
}
function cloneHaftara(haft) {
if (!haft) {
return haft;
}
const dest = clone(haft);
if (Array.isArray(dest)) {
dest.forEach(calculateNumVerses);
}
else {
calculateNumVerses(dest);
}
return dest;
}
/**
* Returns the total number of verses in an array of Aliyah (or haftarah) objects
*/
function sumVerses(aliyot) {
return Array.isArray(aliyot)
? aliyot.reduce((prev, cur) => prev + cur.v, 0)
: aliyot.v;
}
const Shavuot={note:"Israel only",il:true,megillah:"Ruth",haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}};const Purim={megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}};var festivals0 = {"Pesach I":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:36"},"4":{p:15,k:2,b:"12:37",e:"12:42"},"5":{p:15,k:2,b:"12:43",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach I (on Shabbat)":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:32"},"4":{p:15,k:2,b:"12:33",e:"12:36"},"5":{p:15,k:2,b:"12:37",e:"12:42"},"6":{p:15,k:2,b:"12:43",e:"12:47"},"7":{p:15,k:2,b:"12:48",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II":{haft:[{k:"II Kings",b:"23:1",e:"23:9"},{k:"II Kings",b:"23:21",e:"23:25"}],fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II (CH''M)":{note:"Israel only - according to Vaani T'fillati Siddur Yisraeli",il:true,fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:8"},"2":{p:31,k:3,b:"23:9",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:44"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 1":{fullkriyah:{"1":{p:15,k:2,b:"13:1",e:"13:4"},"2":{p:15,k:2,b:"13:5",e:"13:10"},"3":{p:15,k:2,b:"13:11",e:"13:16"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 2":{fullkriyah:{"1":{p:18,k:2,b:"22:24",e:"22:26"},"2":{p:18,k:2,b:"22:27",e:"23:5"},"3":{p:18,k:2,b:"23:6",e:"23:19"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 3":{fullkriyah:{"1":{p:21,k:2,b:"34:1",e:"34:10"},"2":{p:21,k:2,b:"34:11",e:"34:17"},"3":{p:21,k:2,b:"34:18",e:"34:26"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 4":{fullkriyah:{"1":{p:36,k:4,b:"9:1",e:"9:5"},"2":{p:36,k:4,b:"9:6",e:"9:8"},"3":{p:36,k:4,b:"9:9",e:"9:14"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Shabbat Chol ha-Moed":{megillah:"Song of Songs",haft:{k:"Ezekiel",b:"37:1",e:"37:14"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII":{haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:22"},"2":{p:16,k:2,b:"14:1",e:"14:8"},"3":{p:16,k:2,b:"14:9",e:"14:14"},"4":{p:16,k:2,b:"14:15",e:"14:25"},"5":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:19"},"2":{p:16,k:2,b:"13:20",e:"13:22"},"3":{p:16,k:2,b:"14:1",e:"14:4"},"4":{p:16,k:2,b:"14:5",e:"14:8"},"5":{p:16,k:2,b:"14:9",e:"14:14"},"6":{p:16,k:2,b:"14:15",e:"14:25"},"7":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII":{haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach III (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 1"},"Pesach IV (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 2"},"Pesach V (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 3"},"Pesach VI (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 4"},"Pesach Chol ha-Moed Day 2 on Sunday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 1"},"Pesach Chol ha-Moed Day 3 on Monday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 2"},Shavuot:Shavuot,"Shavuot I":{haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II (on Shabbat)":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Fast Day (Morning)":{fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},"3":{p:21,k:2,b:"34:4",e:"34:10"}}},"Fast Day (Afternoon)":{haft:{k:"Isaiah",b:"55:6",e:"56:8"},fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},M:{p:21,k:2,b:"34:4",e:"34:10"}}},"Asara B'Tevet":{alias:true,key:"Fast Day (Morning)"},"Ta'anit Esther":{alias:true,key:"Fast Day (Morning)"},"Tzom Gedaliah":{alias:true,key:"Fast Day (Morning)"},"Tzom Tammuz":{alias:true,key:"Fast Day (Morning)"},"Asara B'Tevet (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Ta'anit Esther (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Gedaliah (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Tammuz (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Erev Tish'a B'Av":{megillah:"Lamentations"},"Tish'a B'Av":{haft:{k:"Jeremiah",b:"8:13",e:"9:23"},fullkriyah:{"1":{p:45,k:5,b:"4:25",e:"4:29"},"2":{p:45,k:5,b:"4:30",e:"4:35"},"3":{p:45,k:5,b:"4:36",e:"4:40"}},megillah:"Lamentations"},"Tish'a B'Av (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Rosh Hashana I":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:12"},"3":{p:4,k:1,b:"21:13",e:"21:21"},"4":{p:4,k:1,b:"21:22",e:"21:27"},"5":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana I (on Shabbat)":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:8"},"3":{p:4,k:1,b:"21:9",e:"21:12"},"4":{p:4,k:1,b:"21:13",e:"21:17"},"5":{p:4,k:1,b:"21:18",e:"21:21"},"6":{p:4,k:1,b:"21:22",e:"21:27"},"7":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana II":{haft:{k:"Jeremiah",b:"31:2",e:"31:20",note:"labeled 31:1–19 in some books"},fullkriyah:{"1":{p:4,k:1,b:"22:1",e:"22:3"},"2":{p:4,k:1,b:"22:4",e:"22:8"},"3":{p:4,k:1,b:"22:9",e:"22:14"},"4":{p:4,k:1,b:"22:15",e:"22:19"},"5":{p:4,k:1,b:"22:20",e:"22:24"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Yom Kippur":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:6"},"2":{p:29,k:3,b:"16:7",e:"16:11"},"3":{p:29,k:3,b:"16:12",e:"16:17"},"4":{p:29,k:3,b:"16:18",e:"16:24"},"5":{p:29,k:3,b:"16:25",e:"16:30"},"6":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (on Shabbat)":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:3"},"2":{p:29,k:3,b:"16:4",e:"16:6"},"3":{p:29,k:3,b:"16:7",e:"16:11"},"4":{p:29,k:3,b:"16:12",e:"16:17"},"5":{p:29,k:3,b:"16:18",e:"16:24"},"6":{p:29,k:3,b:"16:25",e:"16:30"},"7":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (Mincha)":{alias:true,key:"Yom Kippur (Mincha, Traditional)"},"Yom Kippur (Mincha, Traditional)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:29,k:3,b:"18:1",e:"18:5"},"2":{p:29,k:3,b:"18:6",e:"18:21"},M:{p:29,k:3,b:"18:22",e:"18:30"}}},"Yom Kippur (Mincha, Alternate)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:30,k:3,b:"19:1",e:"19:4"},"2":{p:30,k:3,b:"19:5",e:"19:10"},M:{p:30,k:3,b:"19:11",e:"19:18"}}},"Sukkot I":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot I (on Shabbat)":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"22:33"},"2":{p:31,k:3,b:"23:1",e:"23:3"},"3":{p:31,k:3,b:"23:4",e:"23:8"},"4":{p:31,k:3,b:"23:9",e:"23:14"},"5":{p:31,k:3,b:"23:15",e:"23:22"},"6":{p:31,k:3,b:"23:23",e:"23:32"},"7":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot II":{haft:{k:"I Kings",b:"8:2",e:"8:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot Chol ha-Moed Day 1":{fullkriyah:{"1":{p:41,k:4,b:"29:17",e:"29:19"},"2":{p:41,k:4,b:"29:20",e:"29:22"},"3":{p:41,k:4,b:"29:23",e:"29:25"},"4":{p:41,k:4,b:"29:17",e:"29:22"}}},"Sukkot Chol ha-Moed Day 2":{fullkriyah:{"1":{p:41,k:4,b:"29:20",e:"29:22"},"2":{p:41,k:4,b:"29:23",e:"29:25"},"3":{p:41,k:4,b:"29:26",e:"29:28"},"4":{p:41,k:4,b:"29:20",e:"29:25"}}},"Sukkot Chol ha-Moed Day 3":{fullkriyah:{"1":{p:41,k:4,b:"29:23",e:"29:25"},"2":{p:41,k:4,b:"29:26",e:"29:28"},"3":{p:41,k:4,b:"29:29",e:"29:31"},"4":{p:41,k:4,b:"29:23",e:"29:28"}}},"Sukkot Chol ha-Moed Day 4":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:26",e:"29:31"}}},"Sukkot Chol ha-Moed Day 5":{fullkriyah:{"1":{p:41,k:4,b:"29:29",e:"29:31"},"2":{p:41,k:4,b:"29:32",e:"29:34"},"3":{p:41,k:4,b:"29:35",e:"29:37"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Shabbat Chol ha-Moed":{megillah:"Ecclesiastes",haft:{k:"Ezekiel",b:"38:18",e:"39:16"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},"M-day1":{p:41,k:4,b:"29:17",e:"29:22"},"M-day2":{p:41,k:4,b:"29:20",e:"29:25"},"M-day3":{p:41,k:4,b:"29:23",e:"29:28"},"M-day4":{p:41,k:4,b:"29:26",e:"29:31"},"M-day5":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Final Day (Hoshana Raba)":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Shmini Atzeret":{haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"16:3"},"4":{p:47,k:5,b:"16:4",e:"16:8"},"5":{p:47,k:5,b:"16:9",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}},alt:{"1":{p:47,k:5,b:"14:22",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shmini Atzeret (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Erev Simchat Torah":{fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"}}},"Simchat Torah":{haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"34:12"},"7":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Simchat Torah (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"33:29"},"7":{p:54,k:5,b:"34:1",e:"34:12"},"8":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shabbat Rosh Chodesh Chanukah":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 1":{fullkriyah:{"1":{p:35,k:4,b:"7:1",e:"7:11"},"2":{p:35,k:4,b:"7:12",e:"7:14"},"3":{p:35,k:4,b:"7:15",e:"7:17"}},alt:{"1":{p:35,k:4,b:"7:1",e:"7:3"},"2":{p:35,k:4,b:"7:4",e:"7:11"},"3":{p:35,k:4,b:"7:12",e:"7:17"}}},"Chanukah Day 1 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:1",e:"7:17"}}},"Chanukah Day 2":{fullkriyah:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:24",e:"7:29"}},alt:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 2 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 3":{fullkriyah:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:30",e:"7:35"}},alt:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 3 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 4":{fullkriyah:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:36",e:"7:41"}},alt:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 4 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 5":{fullkriyah:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:42",e:"7:47"}},alt:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 5 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 6":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 7":{fullkriyah:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:54",e:"7:59"}},alt:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Rosh Chodesh)":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 8":{fullkriyah:{"1":{p:35,k:4,b:"7:54",e:"7:56"},"2":{p:35,k:4,b:"7:57",e:"7:59"},"3":{p:35,k:4,b:"7:60",e:"8:4"}}},"Chanukah Day 8 (on Shabbat)":{haft:{k:"I Kings",b:"7:40",e:"7:50"},fullkriyah:{M:{p:35,k:4,b:"7:54",e:"8:4"}}},"Erev Purim":{megillah:"Esther"},Purim:Purim,"Shushan Purim":{note:"Jerusalem & walled cities only",il:true,megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}},"Shushan Purim (on Shabbat)":{il:true,note:"Jerusalem & walled cities only: special maftir Exodus 17:8-16, same Haftara as Shabbat Zachor"},"Shabbat HaChodesh":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaChodesh (on Rosh Chodesh)":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaGadol":{haft:{k:"Malachi",b:"3:4",e:"3:24"}},"Shabbat Parah":{haft:{k:"Ezekiel",b:"36:16",e:"36:38"},seph:{k:"Ezekiel",b:"36:16",e:"36:36"},fullkriyah:{M:{p:39,k:4,b:"19:1",e:"19:22"}}},"Shabbat Shekalim":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shekalim (on Rosh Chodesh)":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shuva (with Vayeilech)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva (with Ha'azinu)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Joel",b:"2:15",e:"2:27"}],seph:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"},{k:"Joel",b:"2:15",e:"2:27"}]},"Shabbat Zachor":{haft:{k:"I Samuel",b:"15:2",e:"15:34"},seph:{k:"I Samuel",b:"15:1",e:"15:34"},fullkriyah:{M:{p:49,k:5,b:"25:17",e:"25:19"}}},"Pinchas occurring after 17 Tammuz":{haft:{k:"Jeremiah",b:"1:1",e:"2:3"}},"Kedoshim following Special Shabbat":{haft:{k:"Amos",b:"9:7",e:"9:15"},seph:{k:"Ezekiel",b:"20:2",e:"20:20"}},"Masei on Shabbat Rosh Chodesh":{haft:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"3:4",e:"3:4"}],seph:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"4:1",e:"4:2"},{k:"Isaiah",b:"66:1",e:"66:1"},{k:"Isaiah",b:"66:23",e:"66:23"}],fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Matot-Masei on Shabbat Rosh Chodesh":{alias:true,key:"Masei on Shabbat Rosh Chodesh"},"Ki Teitzei with 3rd Haftarah of Consolation":{haft:[{k:"Isaiah",b:"54:1",e:"54:10"},{k:"Isaiah",b:"54:11",e:"55:5"}]},"Rosh Chodesh":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:3"},"2":{p:41,k:4,b:"28:3",e:"28:5"},"3":{p:41,k:4,b:"28:6",e:"28:10"},"4":{p:41,k:4,b:"28:11",e:"28:15"}}},"Rosh Chodesh Nisan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Iyyar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sivan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tamuz":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Av":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Elul":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tishrei":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Cheshvan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Kislev":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sh'vat":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar I":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar II":{alias:true,key:"Rosh Chodesh"},"Shabbat Rosh Chodesh":{haft:{k:"Isaiah",b:"66:1",e:"66:24"},fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Shabbat Machar Chodesh":{haft:{k:"I Samuel",b:"20:18",e:"20:42"}}};
const festivals = festivals0;
/**
* Is there a special festival Torah Reading for `holiday`?
*/
function hasFestival(holiday) {
return typeof festivals[holiday] === 'object';
}
function aliyotBookNumToStr(aliyot) {
if (aliyot) {
for (const aliyah of Object.values(aliyot)) {
if (typeof aliyah.k === 'number') {
aliyah.k = BOOK[aliyah.k];
}
}
}
}
/**
* Returns the raw metadata for festival reading for `holiday`
*/
function lookupFestival(holiday) {
let src = festivals[holiday];
if (typeof src === 'undefined') {
return undefined;
}
if (src.alias) {
const tmp = festivals[src.key];
if (typeof tmp === 'undefined') {
throw new Error(`Leyning alias ${holiday} => ${src.key} not found`);
}
src = tmp;
}
const result = src.fullkriyah ? clone(src) : src;
aliyotBookNumToStr(result.fullkriyah);
aliyotBookNumToStr(result.alt);
if (src.note) {
result.note = src.note;
}
return result;
}
/*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
/* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
/** @private */
const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
/** @private */
const monthLengths = [lengths, lengths.slice()];
monthLengths[1][2] = 29;
/**
* @private
*/
function mod$1(x, y) {
return x - y * Math.floor(x / y);
}
/**
* @private
*/
function quotient(x, y) {
return Math.floor(x / y);
}
/**
* @private
* @param abs - R.D. number of days
*/
function yearFromFixed(abs) {
const l0 = abs - 1;
const n400 = quotient(l0, 146097);
const d1 = mod$1(l0, 146097);
const n100 = quotient(d1, 36524);
const d2 = mod$1(d1, 36524);
const n4 = quotient(d2, 1461);
const d3 = mod$1(d2, 1461);
const n1 = quotient(d3, 365);
const year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
return n100 !== 4 && n1 !== 4 ? year + 1 : year;
}
/*
const ABS_14SEP1752 = 639797;
const ABS_2SEP1752 = 639785;
*/
/*
* Formerly in namespace, now top-level
*/
/**
* Returns true if the Gregorian year is a leap year
* @param year Gregorian year
*/
function isGregLeapYear(year) {
return !(year % 4) && (!!(year % 100) || !(year % 400));
}
/**
* Number of days in the Gregorian month for given year
* @param month Gregorian month (1=January, 12=December)
* @param year Gregorian year
*/
function daysInGregMonth(month, year) {
// 1 based months
return monthLengths[+isGregLeapYear(year)][month];
}
/**
* Returns true if the object is a Javascript Date
*/
function isDate(obj) {
// eslint-disable-next-line no-prototype-builtins
return typeof obj === 'object' && Date.prototype.isPrototypeOf(obj);
}
/**
* @private
* @param year
* @param month (1-12)
* @param day (1-31)
*/
function toFixed(year, month, day) {
const py = year - 1;
return (365 * py +
quotient(py, 4) -
quotient(py, 100) +
quotient(py, 400) +
quotient(367 * month - 362, 12) +
(month <= 2 ? 0 : isGregLeapYear(year) ? -1 : -2) +
day);
}
/**
* Converts Gregorian date to absolute R.D. (Rata Die) days
* @param date Gregorian date
*/
function greg2abs(date) {
if (!isDate(date)) {
throw new TypeError(`not a Date: ${date}`);
}
else if (isNaN(date.getTime())) {
throw new RangeError('Invalid Date');
}
const abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());
/*
if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
throw new RangeError(`Invalid Date: ${date}`);
}
*/
return abs;
}
/**
* Converts from Rata Die (R.D. number) to Gregorian date.
* See the footnote on page 384 of ``Calendrical Calculations, Part II:
* Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
* Clamen, Software--Practice and Experience, Volume 23, Number 4
* (April, 1993), pages 383-404 for an explanation.
*
* Note that this function returns the daytime portion of the date.
* For example, the 15th of Cheshvan 5769 began at sundown on
* 12 November 2008 and continues through 13 November 2008. This
* function would return only the date 13 November 2008.
* @param abs - R.D. number of days
* @example
* const abs = hebrew2abs(5769, months.CHESHVAN, 15);
* const date = abs2greg(abs); // 13 November 2008
* const year = date.getFullYear(); // 2008
* const monthNum = date.getMonth() + 1; // 11
* const day = date.getDate(); // 13
*/
function abs2greg(abs) {
if (typeof abs !== 'number' || isNaN(abs)) {
throw new TypeError(`not a Number: ${abs}`);
}
abs = Math.trunc(abs);
/*
if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
throw new RangeError(`Invalid Date: ${abs}`);
}
*/
const year = yearFromFixed(abs);
const priorDays = abs - toFixed(year, 1, 1);
const correction = abs < toFixed(year, 3, 1) ? 0 : isGregLeapYear(year) ? 1 : 2;
const month = quotient(12 * (priorDays + correction) + 373, 367);
const day = abs - toFixed(year, month, 1) + 1;
const dt = new Date(year, month - 1, day);
if (year < 100 && year >= 0) {
dt.setFullYear(year);
}
return dt;
}
/*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
/**
* Gregorian date helper functions
*/
var greg;
(function (greg) {
})(greg || (greg = {}));
greg.abs2greg = abs2greg;
greg.daysInMonth = daysInGregMonth;
greg.greg2abs = greg2abs;
greg.isDate = isDate;
greg.isLeapYear = isGregLeapYear;
/*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
/**
* Removes nekudot from Hebrew string
*/
function hebrewStripNikkud(str) {
const a = str.normalize();
// now strip out niqqud and trope
return a.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
}
/*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
/*
* More minimal HDate
*/
const NISAN = 1;
const IYYAR = 2;
const SIVAN = 3;
const TAMUZ = 4;
const AV = 5;
const ELUL = 6;
const TISHREI = 7;
const CHESHVAN = 8;
const KISLEV = 9;
const TEVET = 10;
const SHVAT = 11;
const ADAR_I = 12;
const ADAR_II = 13;
/**
* Hebrew months of the year (NISAN=1, TISHREI=7)
* @readonly
* @enum {number}
*/
const months = {
/** Av / אב */
AV,
/** Elul / אלול */
ELUL,
/** Tishrei / תִּשְׁרֵי */
TISHREI,
/** Adar Sheini (only on leap years) / אדר ב׳ */
ADAR_II,
};
const NISAN_STR = 'Nisan';
const monthNames0 = [
'',
NISAN_STR,
'Iyyar',
'Sivan',
'Tamuz',
'Av',
'Elul',
'Tishrei',
'Cheshvan',
'Kislev',
'Tevet',
"Sh'vat",
];
/*
* Transliterations of Hebrew month names.
* Regular years are index 0 and leap years are index 1.
* @private
*/
const monthNames = [
[...monthNames0, 'Adar', NISAN_STR],
[...monthNames0, 'Adar I', 'Adar II', NISAN_STR],
];
const edCache = new Map();
const EPOCH = -1373428;
// Avg year length in the cycle (19 solar years with 235 lunar months)
const AVG_HEBYEAR_DAYS = 365.24682220597794;
/**
* @private
*/
function assertNumber(n, name) {
if (typeof n !== 'number' || isNaN(n)) {
throw new TypeError(`param '${name}' not a number: ${n}`);
}
}
/**
* Converts Hebrew date to R.D. (Rata Die) fixed days.
* R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
* Calendar.
* @param year Hebrew year
* @param month Hebrew month
* @param day Hebrew date (1-30)
* @example
* const abs = hebrew2abs(5769, months.CHESHVAN, 15);
*/
function hebrew2abs(year, month, day) {
assertNumber(year, 'year');
assertNumber(month, 'month');
assertNumber(day, 'day');
if (year < 1) {
throw new RangeError(`hebrew2abs: invalid year ${year}`);
}
let tempabs = day;
if (month < TISHREI) {
for (let m = TISHREI; m <= monthsInYear(year); m++) {
tempabs += daysInMonth(m, year);
}
for (let m = NISAN; m < month; m++) {
tempabs += daysInMonth(m, year);
}
}
else {
for (let m = TISHREI; m < month; m++) {
tempabs += daysInMonth(m, year);
}
}
return EPOCH + elapsedDays(year) + tempabs - 1;
}
/**
* @private
*/
function newYear(year) {
return EPOCH + elapsedDays(year);
}
/**
* Converts absolute R.D. days to Hebrew date
* @param abs absolute R.D. days
*/
function abs2hebrew(abs) {
assertNumber(abs, 'abs');
abs = Math.trunc(abs);
if (abs <= EPOCH) {
throw new RangeError(`abs2hebrew: ${abs} is before epoch`);
}
// first, quickly approximate year
let year = Math.floor((abs - EPOCH) / AVG_HEBYEAR_DAYS);
while (newYear(year) <= abs) {
++year;
}
--year;
let month = abs < hebrew2abs(year, 1, 1) ? 7 : 1;
while (abs > hebrew2abs(year, month, daysInMonth(month, year))) {
++month;
}
const day = 1 + abs - hebrew2abs(year, month, 1);
return { yy: year, mm: month, dd: day };
}
/**
* Returns true if Hebrew year is a leap year
* @param year Hebrew year
*/
function isLeapYear(year) {
return (1 + year * 7) % 19 < 7;
}
/**
* Number of months in this Hebrew year (either 12 or 13 depending on leap year)
* @param year Hebrew year
*/
function monthsInYear(year) {
return 12 + +isLeapYear(year); // boolean is cast to 1 or 0
}
/**
* Number of days in Hebrew month in a given year (29 or 30)
* @param month Hebrew month (e.g. months.TISHREI)
* @param year Hebrew year
*/
function daysInMonth(month, year) {
switch (month) {
case IYYAR:
case TAMUZ:
case ELUL:
case TEVET:
case ADAR_II:
return 29;
}
if ((month === ADAR_I && !isLeapYear(year)) ||
(month === CHESHVAN && !longCheshvan(year)) ||
(month === KISLEV && shortKislev(year))) {
return 29;
}
else {
return 30;
}
}
/**
* Returns a transliterated string name of Hebrew month in year,
* for example 'Elul' or 'Cheshvan'.
* @param month Hebrew month (e.g. months.TISHREI)
* @param year Hebrew year
*/
function getMonthName(month, year) {
assertNumber(month, 'month');
assertNumber(year, 'year');
if (month < 1 || month > 14) {
throw new TypeError(`bad monthNum: ${month}`);
}
return monthNames[+isLeapYear(year)][month];
}
/**
* Days from sunday prior to start of Hebrew calendar to mean
* conjunction of Tishrei in Hebrew YEAR
* @param year Hebrew year
*/
function elapsedDays(year) {
const n = edCache.get(year);
if (typeof n === 'number') {
return n;
}
const elapsed = elapsedDays0(year);
edCache.set(year, elapsed);
return elapsed;
}
/**
* Days from sunday prior to start of Hebrew calendar to mean
* conjunction of Tishrei in Hebrew YEAR
* @private
* @param year Hebrew year
*/
function elapsedDays0(year) {
const prevYear = year - 1;
const mElapsed = 235 * Math.floor(prevYear / 19) + // Months in complete 19 year lunar (Metonic) cycles so far
12 * (prevYear % 19) + // Regular months in this cycle
Math.floor(((prevYear % 19) * 7 + 1) / 19); // Leap months this cycle
const pElapsed = 204 + 793 * (mElapsed % 1080);
const hElapsed = 5 +
12 * mElapsed +
793 * Math.floor(mElapsed / 1080) +
Math.floor(pElapsed / 1080);
const parts = (pElapsed % 1080) + 1080 * (hElapsed % 24);
const day = 1 + 29 * mElapsed + Math.floor(hElapsed / 24);
let altDay = day;
if (parts >= 19440 ||
(2 === day % 7 && parts >= 9924 && !isLeapYear(year)) ||
(1 === day % 7 && parts >= 16789 && isLeapYear(prevYear))) {
altDay++;
}
if (altDay % 7 === 0 || altDay % 7 === 3 || altDay % 7 === 5) {
return altDay + 1;
}
else {
return altDay;
}
}
/**
* Number of days in the hebrew YEAR.
* A common Hebrew calendar year can have a length of 353, 354 or 355 days
* A leap Hebrew calendar year can have a length of 383, 384 or 385 days
* @param year Hebrew year
*/
function daysInYear(year) {
return elapsedDays(year + 1) - elapsedDays(year);
}
/**
* true if Cheshvan is long in Hebrew year
* @param year Hebrew year
*/
function longCheshvan(year) {
return daysInYear(year) % 10 === 5;
}
/**
* true if Kislev is short in Hebrew year
* @param year Hebrew year
*/
function shortKislev(year) {
return daysInYear(year) % 10 === 3;
}
/**
* Converts Hebrew month string name to numeric
* @param monthName monthName
*/
function monthFromName(monthName) {
if (typeof monthName === 'number') {
if (isNaN(monthName) || monthName < 1 || monthName > 14) {
throw new RangeError(`bad monthName: ${monthName}`);
}
return monthName;
}
let c = monthName.trim().toLowerCase();
// remove all niqud and trailing gershayim (for Adar Alef/Bet)
c = hebrewStripNikkud(c).replace(/׳$/, '');
// If Hebrew month starts with a bet (for example `בתמוז`) then ignore it
if (c[0] === 'ב') {
c = c.substring(1);
}
/*
the Hebrew months are unique to their second letter
N Nisan (November?)
I Iyyar
E Elul
C Cheshvan
K Kislev
1 1Adar
2 2Adar
Si Sh Sivan, Shvat
Ta Ti Te Tamuz, Tishrei, Tevet
Av Ad Av, Adar
אב אד אי אל אב אדר אייר אלול
ח חשון
ט טבת
כ כסלו
נ ניסן
ס סיון
ש שבט
תמ תש תמוז תשרי
*/
switch (c[0]) {
case 'n':
case 'נ':
if (c[1] === 'o') {
break; /* this catches "november" */
}
return NISAN;
case 'i':
return IYYAR;
case 'e':
return ELUL;
case 'c':
case 'ח':
return CHESHVAN;
case 'k':
case 'כ':
return KISLEV;
case 's':
switch (c[1]) {
case 'i':
return SIVAN;
case 'h':
return SHVAT;
}
break;
case 't':
switch (c[1]) {
case 'a':
return TAMUZ;
case 'i':
return TISHREI;
case 'e':
return TEVET;
}
break;
case 'a':
switch (c[1]) {
case 'v':
return AV;
case 'd':
if (/(1|[^i]i|a|א)$/i.test(c)) {
return ADAR_I;
}
return ADAR_II; // else assume sheini
}
break;
case 'ס':
return SIVAN;
case 'ט':
return TEVET;
case 'ש':
return SHVAT;
case 'א':
switch (c[1]) {
case 'ב':
return AV;
case 'ד':
if (/(1|[^i]i|a|א)$/i.test(c)) {
return ADAR_I;
}
return ADAR_II; // else assume sheini
case 'י':
return IYYAR;
case 'ל':
return ELUL;
}
break;
case 'ת':
switch (c[1]) {
case 'מ':
return TAMUZ;
case 'ש':
return TISHREI;
}
break;
}
throw new RangeError(`bad monthName: ${monthName}`);
}
/*! @hebcal/hdate v0.14.4, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
const GERESH = '׳';
const GERSHAYIM = '״';
const heb2num = {
א: 1,
ב: 2,
ג: 3,
ד: 4,
ה: 5,
ו: 6,
ז: 7,
ח: 8,
ט: 9,
י: 10,
כ: 20,
ל: 30,
מ: 40,
נ: 50,
ס: 60,
ע: 70,
פ: 80,
צ: 90,
ק: 100,
ר: 200,
ש: 300,
ת: 400,
};
const num2heb = {};
for (const [key, val] of Object.entries(heb2num)) {
num2heb[val] = key;
}
function num2digits(num) {
const digits = [];
while (num > 0) {
if (num === 15 || num === 16) {
digits.push(9);
digits.push(num - 9);
break;
}
let incr = 100;
let i;
for (i = 400; i > num; i -