@hebcal/leyning 6.2.3 → 6.2.4

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/dist/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/leyning v6.2.3 */
1
+ /*! @hebcal/leyning v6.2.4 */
2
2
  var hebcal__leyning = (function (exports, core) {
3
3
  'use strict';
4
4
 
@@ -12,6 +12,233 @@ function _typeof(obj) {
12
12
  }, _typeof(obj);
13
13
  }
14
14
 
15
+ var 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];var Exodus=[0,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,26,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38];var 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];var 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];var 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];var 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];var Judges=[0,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25];var Ruth=[0,22,23,18,22];var 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];var 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];var Lamentations=[0,22,22,66,22,22];var Baruch=[0,22,35,38,37,9,72];var 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];var Daniel=[0,21,49,100,34,30,29,28,27,27,21,45,13,64,42];var Hosea=[0,9,25,5,19,15,11,16,14,17,15,11,15,15,10];var Joel=[0,20,27,5,21];var Amos=[0,15,16,15,13,27,14,17,14,15];var Obadiah=[0,21];var Jonah=[0,16,11,10,11];var Micah=[0,16,13,12,14,14,16,20];var Nachum=[0,14,14,19];var Habakkuk=[0,17,20,19];var Zephaniah=[0,18,15,20];var Haggai=[0,15,23];var Zechariah=[0,17,17,10,14,11,15,14,23,17,12,17,14,9,21];var 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,Baruch:Baruch,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};
16
+
17
+ /**
18
+ * Names of the books of the Torah. BOOK[1] === 'Genesis'
19
+ * @readonly
20
+ * @const {string[]}
21
+ */
22
+ var BOOK = ['', 'Genesis', 'Exodus', 'Leviticus', 'Numbers', 'Deuteronomy'];
23
+
24
+ /**
25
+ * Formats parsha as a string
26
+ * @param {string[]} parsha
27
+ * @return {string}
28
+ */
29
+ function parshaToString(parsha) {
30
+ var s = parsha[0];
31
+ if (parsha.length == 2) {
32
+ s += '-' + parsha[1];
33
+ }
34
+ return s;
35
+ }
36
+
37
+ /**
38
+ * Represents an aliyah
39
+ * @typedef {Object} Aliyah
40
+ * @property {string} k - Book (e.g. "Numbers")
41
+ * @property {string} b - beginning verse (e.g. "28:9")
42
+ * @property {string} e - ending verse (e.g. "28:15")
43
+ * @property {number} [v] - number of verses
44
+ * @property {number} [p] - parsha number (1=Bereshit, 54=Vezot HaBracha)
45
+ */
46
+
47
+ /**
48
+ * Makes a deep copy of the src object using JSON stringify and parse
49
+ * @param {any} src
50
+ * @return {any}
51
+ */
52
+ function clone(src) {
53
+ return JSON.parse(JSON.stringify(src));
54
+ }
55
+
56
+ /**
57
+ * Calculates the number of verses in an aliyah or haftara based on
58
+ * the `b` (begin verse), `e` (end verse) and `k` (book).
59
+ * Modifies `aliyah` by setting the `v` field.
60
+ * @param {Aliyah} aliyah
61
+ * @return {number}
62
+ */
63
+ function calculateNumVerses(aliyah) {
64
+ if (aliyah.v) {
65
+ return aliyah.v;
66
+ }
67
+ var chapVerseBegin = aliyah.b.split(':');
68
+ var chapVerseEnd = aliyah.e.split(':');
69
+ var c1 = parseInt(chapVerseBegin[0], 10);
70
+ var c2 = parseInt(chapVerseEnd[0], 10);
71
+ var v1 = parseInt(chapVerseBegin[1], 10);
72
+ var v2 = parseInt(chapVerseEnd[1], 10);
73
+ if (c1 === c2) {
74
+ aliyah.v = v2 - v1 + 1;
75
+ } else if (typeof aliyah.k === 'string') {
76
+ var numv = numverses[aliyah.k];
77
+ if (_typeof(numv) !== 'object' || !numv.length) {
78
+ throw new ReferenceError("Can't find numverses for ".concat(aliyah.k));
79
+ }
80
+ var total = numv[c1] - v1 + 1;
81
+ for (var chap = c1 + 1; chap < c2; chap++) {
82
+ total += numv[chap];
83
+ }
84
+ total += v2;
85
+ aliyah.v = total;
86
+ }
87
+ return aliyah.v;
88
+ }
89
+
90
+ /**
91
+ * Formats an aliyah object like "Numbers 28:9-28:15"
92
+ * @param {Aliyah} a aliyah
93
+ * @return {string}
94
+ */
95
+ function formatAliyahWithBook(a) {
96
+ return "".concat(a.k, " ").concat(a.b, "-").concat(a.e);
97
+ }
98
+
99
+ /**
100
+ * Formats an aliyah object like "Numbers 28:9-15"
101
+ * @param {Aliyah} aliyah
102
+ * @param {boolean} showBook
103
+ * @return {string}
104
+ */
105
+ function formatAliyahShort(aliyah, showBook) {
106
+ var begin = aliyah.b;
107
+ var end0 = aliyah.e;
108
+ var prefix = showBook ? aliyah.k + ' ' : '';
109
+ if (begin === end0) {
110
+ return "".concat(prefix).concat(begin);
111
+ }
112
+ var cv1 = begin.split(':');
113
+ var cv2 = end0.split(':');
114
+ var end = cv1[0] === cv2[0] ? cv2[1] : end0;
115
+ return "".concat(prefix).concat(begin, "-").concat(end);
116
+ }
117
+
118
+ /**
119
+ * Returns the total number of verses in an array of Aliyah (or haftarah) objects
120
+ * @param {Aliyah|Aliyah[]} aliyot
121
+ * @return {number}
122
+ */
123
+ function sumVerses(aliyot) {
124
+ return Array.isArray(aliyot) ? aliyot.reduce(function (prev, cur) {
125
+ return prev + cur.v;
126
+ }, 0) : aliyot.v;
127
+ }
128
+
129
+ /**
130
+ * @private
131
+ * @param {Aliyah|Aliyah[]} haft
132
+ * @return {Aliyah|Aliyah[]}
133
+ */
134
+ function cloneHaftara(haft) {
135
+ if (!haft) {
136
+ return haft;
137
+ }
138
+ var dest = clone(haft);
139
+ if (Array.isArray(dest)) {
140
+ dest.map(calculateNumVerses);
141
+ } else {
142
+ calculateNumVerses(dest);
143
+ }
144
+ return dest;
145
+ }
146
+
147
+ /**
148
+ * @private
149
+ * @param {string} a
150
+ * @param {string} b
151
+ * @return {boolean}
152
+ */
153
+ function isChapVerseBefore(a, b) {
154
+ var cv1 = a.split(':').map(function (x) {
155
+ return +x;
156
+ });
157
+ var cv2 = b.split(':').map(function (x) {
158
+ return +x;
159
+ });
160
+ return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
161
+ }
162
+
163
+ /**
164
+ * Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
165
+ * Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
166
+ * @param {Object<string,Aliyah>} aliyot
167
+ * @return {Aliyah[]}
168
+ */
169
+ function makeLeyningParts(aliyot) {
170
+ var nums = Object.keys(aliyot).filter(function (x) {
171
+ return x.length === 1;
172
+ });
173
+ var start = aliyot[nums[0]];
174
+ var end = start;
175
+ var parts = [];
176
+ for (var i = 0; i < nums.length; i++) {
177
+ var num = nums[i];
178
+ var aliyah = aliyot[num];
179
+ if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
180
+ // short-circuit when final aliyah is within the previous (e.g. M inside of 7)
181
+ continue;
182
+ }
183
+ var prevEndChap = +end.e.split(':')[0];
184
+ var curStartChap = +aliyah.b.split(':')[0];
185
+ var sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
186
+ if (i !== 0 && (aliyah.k !== start.k || isChapVerseBefore(aliyah.b, start.e) || !sameOrNextChap)) {
187
+ parts.push({
188
+ k: start.k,
189
+ b: start.b,
190
+ e: end.e
191
+ });
192
+ start = aliyah;
193
+ }
194
+ end = aliyah;
195
+ }
196
+ parts.push({
197
+ k: start.k,
198
+ b: start.b,
199
+ e: end.e
200
+ });
201
+ return parts;
202
+ }
203
+
204
+ /**
205
+ * Returns a string representation of the leyning parts.
206
+ * Separate verse ranges read from the same book are separated
207
+ * by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
208
+ * Verse ranges from different books are separated by semicolons,
209
+ * e.g. `Genesis 21:1-34; Numbers 29:1-6`.
210
+ * @param {Aliyah|Aliyah[]} parts
211
+ * @return {string}
212
+ */
213
+ function makeSummaryFromParts(parts) {
214
+ if (!Array.isArray(parts)) {
215
+ parts = [parts];
216
+ }
217
+ var prev = parts[0];
218
+ var summary = formatAliyahShort(prev, true);
219
+ for (var i = 1; i < parts.length; i++) {
220
+ var part = parts[i];
221
+ if (part.k === prev.k) {
222
+ summary += ', ';
223
+ } else {
224
+ summary += "; ".concat(part.k, " ");
225
+ }
226
+ summary += formatAliyahShort(part, false);
227
+ prev = part;
228
+ }
229
+ return summary;
230
+ }
231
+
232
+ /**
233
+ * Makes a summary of the leyning, like "Genesis 6:9-11:32"
234
+ * @param {Object<string,Aliyah>} aliyot
235
+ * @return {string}
236
+ */
237
+ function makeLeyningSummary(aliyot) {
238
+ var parts = makeLeyningParts(aliyot);
239
+ return makeSummaryFromParts(parts);
240
+ }
241
+
15
242
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
16
243
 
17
244
  var check = function (it) {
@@ -19,7 +246,7 @@ var check = function (it) {
19
246
  };
20
247
 
21
248
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
22
- var global$b =
249
+ var global$a =
23
250
  // eslint-disable-next-line es/no-global-this -- safe
24
251
  check(typeof globalThis == 'object' && globalThis) ||
25
252
  check(typeof window == 'object' && window) ||
@@ -31,7 +258,7 @@ var global$b =
31
258
 
32
259
  var objectGetOwnPropertyDescriptor = {};
33
260
 
34
- var fails$9 = function (exec) {
261
+ var fails$8 = function (exec) {
35
262
  try {
36
263
  return !!exec();
37
264
  } catch (error) {
@@ -39,17 +266,17 @@ var fails$9 = function (exec) {
39
266
  }
40
267
  };
41
268
 
42
- var fails$8 = fails$9;
269
+ var fails$7 = fails$8;
43
270
 
44
271
  // Detect IE8's incomplete defineProperty implementation
45
- var descriptors = !fails$8(function () {
272
+ var descriptors = !fails$7(function () {
46
273
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
47
274
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
48
275
  });
49
276
 
50
- var fails$7 = fails$9;
277
+ var fails$6 = fails$8;
51
278
 
52
- var functionBindNative = !fails$7(function () {
279
+ var functionBindNative = !fails$6(function () {
53
280
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
54
281
  var test = (function () { /* empty */ }).bind();
55
282
  // eslint-disable-next-line no-prototype-builtins -- safe
@@ -111,19 +338,19 @@ var classofRaw = function (it) {
111
338
  };
112
339
 
113
340
  var uncurryThis$7 = functionUncurryThis;
114
- var fails$6 = fails$9;
115
- var classof$1 = classofRaw;
341
+ var fails$5 = fails$8;
342
+ var classof = classofRaw;
116
343
 
117
344
  var $Object$2 = Object;
118
345
  var split = uncurryThis$7(''.split);
119
346
 
120
347
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
121
- var indexedObject = fails$6(function () {
348
+ var indexedObject = fails$5(function () {
122
349
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
123
350
  // eslint-disable-next-line no-prototype-builtins -- safe
124
351
  return !$Object$2('z').propertyIsEnumerable(0);
125
352
  }) ? function (it) {
126
- return classof$1(it) == 'String' ? split(it, '') : $Object$2(it);
353
+ return classof(it) == 'String' ? split(it, '') : $Object$2(it);
127
354
  } : $Object$2;
128
355
 
129
356
  // we can't use just `it == null` since of `document.all` special case
@@ -134,21 +361,21 @@ var isNullOrUndefined$2 = function (it) {
134
361
 
135
362
  var isNullOrUndefined$1 = isNullOrUndefined$2;
136
363
 
137
- var $TypeError$6 = TypeError;
364
+ var $TypeError$5 = TypeError;
138
365
 
139
366
  // `RequireObjectCoercible` abstract operation
140
367
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
141
368
  var requireObjectCoercible$2 = function (it) {
142
- if (isNullOrUndefined$1(it)) throw $TypeError$6("Can't call method on " + it);
369
+ if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
143
370
  return it;
144
371
  };
145
372
 
146
373
  // toObject with fallback for non-array-like ES3 strings
147
- var IndexedObject$1 = indexedObject;
374
+ var IndexedObject = indexedObject;
148
375
  var requireObjectCoercible$1 = requireObjectCoercible$2;
149
376
 
150
377
  var toIndexedObject$4 = function (it) {
151
- return IndexedObject$1(requireObjectCoercible$1(it));
378
+ return IndexedObject(requireObjectCoercible$1(it));
152
379
  };
153
380
 
154
381
  var documentAll$2 = typeof document == 'object' && document.all;
@@ -184,7 +411,7 @@ var isObject$5 = $documentAll.IS_HTMLDDA ? function (it) {
184
411
  return typeof it == 'object' ? it !== null : isCallable$9(it);
185
412
  };
186
413
 
187
- var global$a = global$b;
414
+ var global$9 = global$a;
188
415
  var isCallable$8 = isCallable$a;
189
416
 
190
417
  var aFunction = function (argument) {
@@ -192,7 +419,7 @@ var aFunction = function (argument) {
192
419
  };
193
420
 
194
421
  var getBuiltIn$3 = function (namespace, method) {
195
- return arguments.length < 2 ? aFunction(global$a[namespace]) : global$a[namespace] && global$a[namespace][method];
422
+ return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
196
423
  };
197
424
 
198
425
  var uncurryThis$6 = functionUncurryThis;
@@ -203,11 +430,11 @@ var getBuiltIn$2 = getBuiltIn$3;
203
430
 
204
431
  var engineUserAgent = getBuiltIn$2('navigator', 'userAgent') || '';
205
432
 
206
- var global$9 = global$b;
433
+ var global$8 = global$a;
207
434
  var userAgent = engineUserAgent;
208
435
 
209
- var process = global$9.process;
210
- var Deno = global$9.Deno;
436
+ var process = global$8.process;
437
+ var Deno = global$8.Deno;
211
438
  var versions = process && process.versions || Deno && Deno.version;
212
439
  var v8 = versions && versions.v8;
213
440
  var match, version;
@@ -234,10 +461,10 @@ var engineV8Version = version;
234
461
  /* eslint-disable es/no-symbol -- required for testing */
235
462
 
236
463
  var V8_VERSION = engineV8Version;
237
- var fails$5 = fails$9;
464
+ var fails$4 = fails$8;
238
465
 
239
466
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
240
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
467
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$4(function () {
241
468
  var symbol = Symbol();
242
469
  // Chrome 38 Symbol has incorrect toString conversion
243
470
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
@@ -281,29 +508,29 @@ var tryToString$1 = function (argument) {
281
508
  var isCallable$6 = isCallable$a;
282
509
  var tryToString = tryToString$1;
283
510
 
284
- var $TypeError$5 = TypeError;
511
+ var $TypeError$4 = TypeError;
285
512
 
286
513
  // `Assert: IsCallable(argument) is true`
287
- var aCallable$2 = function (argument) {
514
+ var aCallable$1 = function (argument) {
288
515
  if (isCallable$6(argument)) return argument;
289
- throw $TypeError$5(tryToString(argument) + ' is not a function');
516
+ throw $TypeError$4(tryToString(argument) + ' is not a function');
290
517
  };
291
518
 
292
- var aCallable$1 = aCallable$2;
519
+ var aCallable = aCallable$1;
293
520
  var isNullOrUndefined = isNullOrUndefined$2;
294
521
 
295
522
  // `GetMethod` abstract operation
296
523
  // https://tc39.es/ecma262/#sec-getmethod
297
524
  var getMethod$1 = function (V, P) {
298
525
  var func = V[P];
299
- return isNullOrUndefined(func) ? undefined : aCallable$1(func);
526
+ return isNullOrUndefined(func) ? undefined : aCallable(func);
300
527
  };
301
528
 
302
529
  var call$2 = functionCall;
303
530
  var isCallable$5 = isCallable$a;
304
531
  var isObject$4 = isObject$5;
305
532
 
306
- var $TypeError$4 = TypeError;
533
+ var $TypeError$3 = TypeError;
307
534
 
308
535
  // `OrdinaryToPrimitive` abstract operation
309
536
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
@@ -312,29 +539,33 @@ var ordinaryToPrimitive$1 = function (input, pref) {
312
539
  if (pref === 'string' && isCallable$5(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
313
540
  if (isCallable$5(fn = input.valueOf) && !isObject$4(val = call$2(fn, input))) return val;
314
541
  if (pref !== 'string' && isCallable$5(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
315
- throw $TypeError$4("Can't convert object to primitive value");
542
+ throw $TypeError$3("Can't convert object to primitive value");
316
543
  };
317
544
 
318
- var shared$3 = {exports: {}};
545
+ var sharedExports = {};
546
+ var shared$3 = {
547
+ get exports(){ return sharedExports; },
548
+ set exports(v){ sharedExports = v; },
549
+ };
319
550
 
320
- var global$8 = global$b;
551
+ var global$7 = global$a;
321
552
 
322
553
  // eslint-disable-next-line es/no-object-defineproperty -- safe
323
554
  var defineProperty$1 = Object.defineProperty;
324
555
 
325
556
  var defineGlobalProperty$3 = function (key, value) {
326
557
  try {
327
- defineProperty$1(global$8, key, { value: value, configurable: true, writable: true });
558
+ defineProperty$1(global$7, key, { value: value, configurable: true, writable: true });
328
559
  } catch (error) {
329
- global$8[key] = value;
560
+ global$7[key] = value;
330
561
  } return value;
331
562
  };
332
563
 
333
- var global$7 = global$b;
564
+ var global$6 = global$a;
334
565
  var defineGlobalProperty$2 = defineGlobalProperty$3;
335
566
 
336
567
  var SHARED = '__core-js_shared__';
337
- var store$3 = global$7[SHARED] || defineGlobalProperty$2(SHARED, {});
568
+ var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
338
569
 
339
570
  var sharedStore = store$3;
340
571
 
@@ -356,12 +587,12 @@ var $Object = Object;
356
587
 
357
588
  // `ToObject` abstract operation
358
589
  // https://tc39.es/ecma262/#sec-toobject
359
- var toObject$2 = function (argument) {
590
+ var toObject$1 = function (argument) {
360
591
  return $Object(requireObjectCoercible(argument));
361
592
  };
362
593
 
363
594
  var uncurryThis$5 = functionUncurryThis;
364
- var toObject$1 = toObject$2;
595
+ var toObject = toObject$1;
365
596
 
366
597
  var hasOwnProperty = uncurryThis$5({}.hasOwnProperty);
367
598
 
@@ -369,7 +600,7 @@ var hasOwnProperty = uncurryThis$5({}.hasOwnProperty);
369
600
  // https://tc39.es/ecma262/#sec-hasownproperty
370
601
  // eslint-disable-next-line es/no-object-hasown -- safe
371
602
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
372
- return hasOwnProperty(toObject$1(it), key);
603
+ return hasOwnProperty(toObject(it), key);
373
604
  };
374
605
 
375
606
  var uncurryThis$4 = functionUncurryThis;
@@ -382,15 +613,15 @@ var uid$2 = function (key) {
382
613
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
383
614
  };
384
615
 
385
- var global$6 = global$b;
386
- var shared$2 = shared$3.exports;
616
+ var global$5 = global$a;
617
+ var shared$2 = sharedExports;
387
618
  var hasOwn$6 = hasOwnProperty_1;
388
619
  var uid$1 = uid$2;
389
620
  var NATIVE_SYMBOL = symbolConstructorDetection;
390
621
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
391
622
 
392
623
  var WellKnownSymbolsStore = shared$2('wks');
393
- var Symbol$1 = global$6.Symbol;
624
+ var Symbol$1 = global$5.Symbol;
394
625
  var symbolFor = Symbol$1 && Symbol$1['for'];
395
626
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
396
627
 
@@ -414,7 +645,7 @@ var getMethod = getMethod$1;
414
645
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
415
646
  var wellKnownSymbol = wellKnownSymbol$1;
416
647
 
417
- var $TypeError$3 = TypeError;
648
+ var $TypeError$2 = TypeError;
418
649
  var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
419
650
 
420
651
  // `ToPrimitive` abstract operation
@@ -427,7 +658,7 @@ var toPrimitive$1 = function (input, pref) {
427
658
  if (pref === undefined) pref = 'default';
428
659
  result = call$1(exoticToPrim, input, pref);
429
660
  if (!isObject$3(result) || isSymbol$1(result)) return result;
430
- throw $TypeError$3("Can't convert object to primitive value");
661
+ throw $TypeError$2("Can't convert object to primitive value");
431
662
  }
432
663
  if (pref === undefined) pref = 'number';
433
664
  return ordinaryToPrimitive(input, pref);
@@ -443,10 +674,10 @@ var toPropertyKey$2 = function (argument) {
443
674
  return isSymbol(key) ? key : key + '';
444
675
  };
445
676
 
446
- var global$5 = global$b;
677
+ var global$4 = global$a;
447
678
  var isObject$2 = isObject$5;
448
679
 
449
- var document$1 = global$5.document;
680
+ var document$1 = global$4.document;
450
681
  // typeof document.createElement is 'object' in old IE
451
682
  var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
452
683
 
@@ -455,11 +686,11 @@ var documentCreateElement = function (it) {
455
686
  };
456
687
 
457
688
  var DESCRIPTORS$7 = descriptors;
458
- var fails$4 = fails$9;
689
+ var fails$3 = fails$8;
459
690
  var createElement = documentCreateElement;
460
691
 
461
692
  // Thanks to IE8 for its funny defineProperty
462
- var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
693
+ var ie8DomDefine = !DESCRIPTORS$7 && !fails$3(function () {
463
694
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
464
695
  return Object.defineProperty(createElement('div'), 'a', {
465
696
  get: function () { return 7; }
@@ -492,11 +723,11 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 :
492
723
  var objectDefineProperty = {};
493
724
 
494
725
  var DESCRIPTORS$5 = descriptors;
495
- var fails$3 = fails$9;
726
+ var fails$2 = fails$8;
496
727
 
497
728
  // V8 ~ Chrome 36-
498
729
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
499
- var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
730
+ var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$2(function () {
500
731
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
501
732
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
502
733
  value: 42,
@@ -507,12 +738,12 @@ var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
507
738
  var isObject$1 = isObject$5;
508
739
 
509
740
  var $String = String;
510
- var $TypeError$2 = TypeError;
741
+ var $TypeError$1 = TypeError;
511
742
 
512
743
  // `Assert: Type(argument) is Object`
513
744
  var anObject$2 = function (argument) {
514
745
  if (isObject$1(argument)) return argument;
515
- throw $TypeError$2($String(argument) + ' is not an object');
746
+ throw $TypeError$1($String(argument) + ' is not an object');
516
747
  };
517
748
 
518
749
  var DESCRIPTORS$4 = descriptors;
@@ -521,7 +752,7 @@ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
521
752
  var anObject$1 = anObject$2;
522
753
  var toPropertyKey = toPropertyKey$2;
523
754
 
524
- var $TypeError$1 = TypeError;
755
+ var $TypeError = TypeError;
525
756
  // eslint-disable-next-line es/no-object-defineproperty -- safe
526
757
  var $defineProperty = Object.defineProperty;
527
758
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -554,7 +785,7 @@ objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG ? function defi
554
785
  if (IE8_DOM_DEFINE) try {
555
786
  return $defineProperty(O, P, Attributes);
556
787
  } catch (error) { /* empty */ }
557
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$1('Accessors not supported');
788
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
558
789
  if ('value' in Attributes) O[P] = Attributes.value;
559
790
  return O;
560
791
  };
@@ -570,7 +801,11 @@ var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value
570
801
  return object;
571
802
  };
572
803
 
573
- var makeBuiltIn$2 = {exports: {}};
804
+ var makeBuiltInExports = {};
805
+ var makeBuiltIn$2 = {
806
+ get exports(){ return makeBuiltInExports; },
807
+ set exports(v){ makeBuiltInExports = v; },
808
+ };
574
809
 
575
810
  var DESCRIPTORS$2 = descriptors;
576
811
  var hasOwn$4 = hasOwnProperty_1;
@@ -605,14 +840,14 @@ if (!isCallable$4(store$1.inspectSource)) {
605
840
 
606
841
  var inspectSource$1 = store$1.inspectSource;
607
842
 
608
- var global$4 = global$b;
843
+ var global$3 = global$a;
609
844
  var isCallable$3 = isCallable$a;
610
845
 
611
- var WeakMap$1 = global$4.WeakMap;
846
+ var WeakMap$1 = global$3.WeakMap;
612
847
 
613
848
  var weakMapBasicDetection = isCallable$3(WeakMap$1) && /native code/.test(String(WeakMap$1));
614
849
 
615
- var shared$1 = shared$3.exports;
850
+ var shared$1 = sharedExports;
616
851
  var uid = uid$2;
617
852
 
618
853
  var keys = shared$1('keys');
@@ -624,7 +859,7 @@ var sharedKey$1 = function (key) {
624
859
  var hiddenKeys$3 = {};
625
860
 
626
861
  var NATIVE_WEAK_MAP = weakMapBasicDetection;
627
- var global$3 = global$b;
862
+ var global$2 = global$a;
628
863
  var isObject = isObject$5;
629
864
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
630
865
  var hasOwn$3 = hasOwnProperty_1;
@@ -633,8 +868,8 @@ var sharedKey = sharedKey$1;
633
868
  var hiddenKeys$2 = hiddenKeys$3;
634
869
 
635
870
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
636
- var TypeError$1 = global$3.TypeError;
637
- var WeakMap = global$3.WeakMap;
871
+ var TypeError$1 = global$2.TypeError;
872
+ var WeakMap = global$2.WeakMap;
638
873
  var set, get, has;
639
874
 
640
875
  var enforce = function (it) {
@@ -694,7 +929,7 @@ var internalState = {
694
929
  getterFor: getterFor
695
930
  };
696
931
 
697
- var fails$2 = fails$9;
932
+ var fails$1 = fails$8;
698
933
  var isCallable$2 = isCallable$a;
699
934
  var hasOwn$2 = hasOwnProperty_1;
700
935
  var DESCRIPTORS$1 = descriptors;
@@ -707,7 +942,7 @@ var getInternalState = InternalStateModule.get;
707
942
  // eslint-disable-next-line es/no-object-defineproperty -- safe
708
943
  var defineProperty = Object.defineProperty;
709
944
 
710
- var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
945
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$1(function () {
711
946
  return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
712
947
  });
713
948
 
@@ -746,7 +981,7 @@ Function.prototype.toString = makeBuiltIn$1(function toString() {
746
981
 
747
982
  var isCallable$1 = isCallable$a;
748
983
  var definePropertyModule$1 = objectDefineProperty;
749
- var makeBuiltIn = makeBuiltIn$2.exports;
984
+ var makeBuiltIn = makeBuiltInExports;
750
985
  var defineGlobalProperty$1 = defineGlobalProperty$3;
751
986
 
752
987
  var defineBuiltIn$1 = function (O, key, value, options) {
@@ -822,19 +1057,19 @@ var toLength = toLength$1;
822
1057
 
823
1058
  // `LengthOfArrayLike` abstract operation
824
1059
  // https://tc39.es/ecma262/#sec-lengthofarraylike
825
- var lengthOfArrayLike$2 = function (obj) {
1060
+ var lengthOfArrayLike$1 = function (obj) {
826
1061
  return toLength(obj.length);
827
1062
  };
828
1063
 
829
1064
  var toIndexedObject$2 = toIndexedObject$4;
830
1065
  var toAbsoluteIndex = toAbsoluteIndex$1;
831
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
1066
+ var lengthOfArrayLike = lengthOfArrayLike$1;
832
1067
 
833
1068
  // `Array.prototype.{ indexOf, includes }` methods implementation
834
- var createMethod$2 = function (IS_INCLUDES) {
1069
+ var createMethod$1 = function (IS_INCLUDES) {
835
1070
  return function ($this, el, fromIndex) {
836
1071
  var O = toIndexedObject$2($this);
837
- var length = lengthOfArrayLike$1(O);
1072
+ var length = lengthOfArrayLike(O);
838
1073
  var index = toAbsoluteIndex(fromIndex, length);
839
1074
  var value;
840
1075
  // Array#includes uses SameValueZero equality algorithm
@@ -853,10 +1088,10 @@ var createMethod$2 = function (IS_INCLUDES) {
853
1088
  var arrayIncludes = {
854
1089
  // `Array.prototype.includes` method
855
1090
  // https://tc39.es/ecma262/#sec-array.prototype.includes
856
- includes: createMethod$2(true),
1091
+ includes: createMethod$1(true),
857
1092
  // `Array.prototype.indexOf` method
858
1093
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
859
- indexOf: createMethod$2(false)
1094
+ indexOf: createMethod$1(false)
860
1095
  };
861
1096
 
862
1097
  var uncurryThis$2 = functionUncurryThis;
@@ -940,7 +1175,7 @@ var copyConstructorProperties$1 = function (target, source, exceptions) {
940
1175
  }
941
1176
  };
942
1177
 
943
- var fails$1 = fails$9;
1178
+ var fails = fails$8;
944
1179
  var isCallable = isCallable$a;
945
1180
 
946
1181
  var replacement = /#|\.prototype\./;
@@ -949,7 +1184,7 @@ var isForced$1 = function (feature, detection) {
949
1184
  var value = data[normalize(feature)];
950
1185
  return value == POLYFILL ? true
951
1186
  : value == NATIVE ? false
952
- : isCallable(detection) ? fails$1(detection)
1187
+ : isCallable(detection) ? fails(detection)
953
1188
  : !!detection;
954
1189
  };
955
1190
 
@@ -963,7 +1198,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
963
1198
 
964
1199
  var isForced_1 = isForced$1;
965
1200
 
966
- var global$2 = global$b;
1201
+ var global$1 = global$a;
967
1202
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
968
1203
  var createNonEnumerableProperty = createNonEnumerableProperty$2;
969
1204
  var defineBuiltIn = defineBuiltIn$1;
@@ -992,11 +1227,11 @@ var _export = function (options, source) {
992
1227
  var STATIC = options.stat;
993
1228
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
994
1229
  if (GLOBAL) {
995
- target = global$2;
1230
+ target = global$1;
996
1231
  } else if (STATIC) {
997
- target = global$2[TARGET] || defineGlobalProperty(TARGET, {});
1232
+ target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
998
1233
  } else {
999
- target = (global$2[TARGET] || {}).prototype;
1234
+ target = (global$1[TARGET] || {}).prototype;
1000
1235
  }
1001
1236
  if (target) for (key in source) {
1002
1237
  sourceProperty = source[key];
@@ -1018,311 +1253,6 @@ var _export = function (options, source) {
1018
1253
  }
1019
1254
  };
1020
1255
 
1021
- var aCallable = aCallable$2;
1022
- var toObject = toObject$2;
1023
- var IndexedObject = indexedObject;
1024
- var lengthOfArrayLike = lengthOfArrayLike$2;
1025
-
1026
- var $TypeError = TypeError;
1027
-
1028
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
1029
- var createMethod$1 = function (IS_RIGHT) {
1030
- return function (that, callbackfn, argumentsLength, memo) {
1031
- aCallable(callbackfn);
1032
- var O = toObject(that);
1033
- var self = IndexedObject(O);
1034
- var length = lengthOfArrayLike(O);
1035
- var index = IS_RIGHT ? length - 1 : 0;
1036
- var i = IS_RIGHT ? -1 : 1;
1037
- if (argumentsLength < 2) while (true) {
1038
- if (index in self) {
1039
- memo = self[index];
1040
- index += i;
1041
- break;
1042
- }
1043
- index += i;
1044
- if (IS_RIGHT ? index < 0 : length <= index) {
1045
- throw $TypeError('Reduce of empty array with no initial value');
1046
- }
1047
- }
1048
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
1049
- memo = callbackfn(memo, self[index], index, O);
1050
- }
1051
- return memo;
1052
- };
1053
- };
1054
-
1055
- var arrayReduce = {
1056
- // `Array.prototype.reduce` method
1057
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1058
- left: createMethod$1(false),
1059
- // `Array.prototype.reduceRight` method
1060
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
1061
- right: createMethod$1(true)
1062
- };
1063
-
1064
- var fails = fails$9;
1065
-
1066
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1067
- var method = [][METHOD_NAME];
1068
- return !!method && fails(function () {
1069
- // eslint-disable-next-line no-useless-call -- required for testing
1070
- method.call(null, argument || function () { return 1; }, 1);
1071
- });
1072
- };
1073
-
1074
- var classof = classofRaw;
1075
- var global$1 = global$b;
1076
-
1077
- var engineIsNode = classof(global$1.process) == 'process';
1078
-
1079
- var $$1 = _export;
1080
- var $reduce = arrayReduce.left;
1081
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
1082
- var CHROME_VERSION = engineV8Version;
1083
- var IS_NODE = engineIsNode;
1084
-
1085
- var STRICT_METHOD = arrayMethodIsStrict('reduce');
1086
- // Chrome 80-82 has a critical bug
1087
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
1088
- var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1089
-
1090
- // `Array.prototype.reduce` method
1091
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1092
- $$1({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
1093
- reduce: function reduce(callbackfn /* , initialValue */) {
1094
- var length = arguments.length;
1095
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
1096
- }
1097
- });
1098
-
1099
- var 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];var Exodus=[0,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,26,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38];var 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];var 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];var 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];var 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];var Judges=[0,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25];var Ruth=[0,22,23,18,22];var 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];var 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];var Lamentations=[0,22,22,66,22,22];var Baruch=[0,22,35,38,37,9,72];var 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];var Daniel=[0,21,49,100,34,30,29,28,27,27,21,45,13,64,42];var Hosea=[0,9,25,5,19,15,11,16,14,17,15,11,15,15,10];var Joel=[0,20,27,5,21];var Amos=[0,15,16,15,13,27,14,17,14,15];var Obadiah=[0,21];var Jonah=[0,16,11,10,11];var Micah=[0,16,13,12,14,14,16,20];var Nachum=[0,14,14,19];var Habakkuk=[0,17,20,19];var Zephaniah=[0,18,15,20];var Haggai=[0,15,23];var Zechariah=[0,17,17,10,14,11,15,14,23,17,12,17,14,9,21];var 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,Baruch:Baruch,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};
1100
-
1101
- /**
1102
- * Names of the books of the Torah. BOOK[1] === 'Genesis'
1103
- * @readonly
1104
- * @const {string[]}
1105
- */
1106
- var BOOK = ['', 'Genesis', 'Exodus', 'Leviticus', 'Numbers', 'Deuteronomy'];
1107
-
1108
- /**
1109
- * Formats parsha as a string
1110
- * @param {string[]} parsha
1111
- * @return {string}
1112
- */
1113
- function parshaToString(parsha) {
1114
- var s = parsha[0];
1115
- if (parsha.length == 2) {
1116
- s += '-' + parsha[1];
1117
- }
1118
- return s;
1119
- }
1120
-
1121
- /**
1122
- * Represents an aliyah
1123
- * @typedef {Object} Aliyah
1124
- * @property {string} k - Book (e.g. "Numbers")
1125
- * @property {string} b - beginning verse (e.g. "28:9")
1126
- * @property {string} e - ending verse (e.g. "28:15")
1127
- * @property {number} [v] - number of verses
1128
- * @property {number} [p] - parsha number (1=Bereshit, 54=Vezot HaBracha)
1129
- */
1130
-
1131
- /**
1132
- * Makes a deep copy of the src object using JSON stringify and parse
1133
- * @param {any} src
1134
- * @return {any}
1135
- */
1136
- function clone(src) {
1137
- return JSON.parse(JSON.stringify(src));
1138
- }
1139
-
1140
- /**
1141
- * Calculates the number of verses in an aliyah or haftara based on
1142
- * the `b` (begin verse), `e` (end verse) and `k` (book).
1143
- * Modifies `aliyah` by setting the `v` field.
1144
- * @param {Aliyah} aliyah
1145
- * @return {number}
1146
- */
1147
- function calculateNumVerses(aliyah) {
1148
- if (aliyah.v) {
1149
- return aliyah.v;
1150
- }
1151
- var chapVerseBegin = aliyah.b.split(':');
1152
- var chapVerseEnd = aliyah.e.split(':');
1153
- var c1 = parseInt(chapVerseBegin[0], 10);
1154
- var c2 = parseInt(chapVerseEnd[0], 10);
1155
- var v1 = parseInt(chapVerseBegin[1], 10);
1156
- var v2 = parseInt(chapVerseEnd[1], 10);
1157
- if (c1 === c2) {
1158
- aliyah.v = v2 - v1 + 1;
1159
- } else if (typeof aliyah.k === 'string') {
1160
- var numv = numverses[aliyah.k];
1161
- if (_typeof(numv) !== 'object' || !numv.length) {
1162
- throw new ReferenceError("Can't find numverses for ".concat(aliyah.k));
1163
- }
1164
- var total = numv[c1] - v1 + 1;
1165
- for (var chap = c1 + 1; chap < c2; chap++) {
1166
- total += numv[chap];
1167
- }
1168
- total += v2;
1169
- aliyah.v = total;
1170
- }
1171
- return aliyah.v;
1172
- }
1173
-
1174
- /**
1175
- * Formats an aliyah object like "Numbers 28:9-28:15"
1176
- * @param {Aliyah} a aliyah
1177
- * @return {string}
1178
- */
1179
- function formatAliyahWithBook(a) {
1180
- return "".concat(a.k, " ").concat(a.b, "-").concat(a.e);
1181
- }
1182
-
1183
- /**
1184
- * Formats an aliyah object like "Numbers 28:9-15"
1185
- * @param {Aliyah} aliyah
1186
- * @param {boolean} showBook
1187
- * @return {string}
1188
- */
1189
- function formatAliyahShort(aliyah, showBook) {
1190
- var begin = aliyah.b;
1191
- var end0 = aliyah.e;
1192
- var prefix = showBook ? aliyah.k + ' ' : '';
1193
- if (begin === end0) {
1194
- return "".concat(prefix).concat(begin);
1195
- }
1196
- var cv1 = begin.split(':');
1197
- var cv2 = end0.split(':');
1198
- var end = cv1[0] === cv2[0] ? cv2[1] : end0;
1199
- return "".concat(prefix).concat(begin, "-").concat(end);
1200
- }
1201
-
1202
- /**
1203
- * Returns the total number of verses in an array of Aliyah (or haftarah) objects
1204
- * @param {Aliyah|Aliyah[]} aliyot
1205
- * @return {number}
1206
- */
1207
- function sumVerses(aliyot) {
1208
- return Array.isArray(aliyot) ? aliyot.reduce(function (prev, cur) {
1209
- return prev + cur.v;
1210
- }, 0) : aliyot.v;
1211
- }
1212
-
1213
- /**
1214
- * @private
1215
- * @param {Aliyah|Aliyah[]} haft
1216
- * @return {Aliyah|Aliyah[]}
1217
- */
1218
- function cloneHaftara(haft) {
1219
- if (!haft) {
1220
- return haft;
1221
- }
1222
- var dest = clone(haft);
1223
- if (Array.isArray(dest)) {
1224
- dest.map(calculateNumVerses);
1225
- } else {
1226
- calculateNumVerses(dest);
1227
- }
1228
- return dest;
1229
- }
1230
-
1231
- /**
1232
- * @private
1233
- * @param {string} a
1234
- * @param {string} b
1235
- * @return {boolean}
1236
- */
1237
- function isChapVerseBefore(a, b) {
1238
- var cv1 = a.split(':').map(function (x) {
1239
- return +x;
1240
- });
1241
- var cv2 = b.split(':').map(function (x) {
1242
- return +x;
1243
- });
1244
- return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
1245
- }
1246
-
1247
- /**
1248
- * Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
1249
- * Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
1250
- * @param {Object<string,Aliyah>} aliyot
1251
- * @return {Aliyah[]}
1252
- */
1253
- function makeLeyningParts(aliyot) {
1254
- var nums = Object.keys(aliyot).filter(function (x) {
1255
- return x.length === 1;
1256
- });
1257
- var start = aliyot[nums[0]];
1258
- var end = start;
1259
- var parts = [];
1260
- for (var i = 0; i < nums.length; i++) {
1261
- var num = nums[i];
1262
- var aliyah = aliyot[num];
1263
- if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
1264
- // short-circuit when final aliyah is within the previous (e.g. M inside of 7)
1265
- continue;
1266
- }
1267
- var prevEndChap = +end.e.split(':')[0];
1268
- var curStartChap = +aliyah.b.split(':')[0];
1269
- var sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
1270
- if (i !== 0 && (aliyah.k !== start.k || isChapVerseBefore(aliyah.b, start.e) || !sameOrNextChap)) {
1271
- parts.push({
1272
- k: start.k,
1273
- b: start.b,
1274
- e: end.e
1275
- });
1276
- start = aliyah;
1277
- }
1278
- end = aliyah;
1279
- }
1280
- parts.push({
1281
- k: start.k,
1282
- b: start.b,
1283
- e: end.e
1284
- });
1285
- return parts;
1286
- }
1287
-
1288
- /**
1289
- * Returns a string representation of the leyning parts.
1290
- * Separate verse ranges read from the same book are separated
1291
- * by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
1292
- * Verse ranges from different books are separated by semicolons,
1293
- * e.g. `Genesis 21:1-34; Numbers 29:1-6`.
1294
- * @param {Aliyah|Aliyah[]} parts
1295
- * @return {string}
1296
- */
1297
- function makeSummaryFromParts(parts) {
1298
- if (!Array.isArray(parts)) {
1299
- parts = [parts];
1300
- }
1301
- var prev = parts[0];
1302
- var summary = formatAliyahShort(prev, true);
1303
- for (var i = 1; i < parts.length; i++) {
1304
- var part = parts[i];
1305
- if (part.k === prev.k) {
1306
- summary += ', ';
1307
- } else {
1308
- summary += "; ".concat(part.k, " ");
1309
- }
1310
- summary += formatAliyahShort(part, false);
1311
- prev = part;
1312
- }
1313
- return summary;
1314
- }
1315
-
1316
- /**
1317
- * Makes a summary of the leyning, like "Genesis 6:9-11:32"
1318
- * @param {Object<string,Aliyah>} aliyot
1319
- * @return {string}
1320
- */
1321
- function makeLeyningSummary(aliyot) {
1322
- var parts = makeLeyningParts(aliyot);
1323
- return makeSummaryFromParts(parts);
1324
- }
1325
-
1326
1256
  var internalObjectKeys = objectKeysInternal;
1327
1257
  var enumBugKeys = enumBugKeys$2;
1328
1258
 
@@ -1492,6 +1422,9 @@ function getLeyningKeyForEvent(ev) {
1492
1422
  } else if (il && desc == 'Shmini Atzeret') {
1493
1423
  return 'Simchat Torah';
1494
1424
  }
1425
+ if (desc === 'Chag HaBanot') {
1426
+ return undefined;
1427
+ }
1495
1428
  if (isShabbat && 'Shabbat' != desc.substring(0, 7)) {
1496
1429
  if (isRoshChodesh) {
1497
1430
  if (desc === 'Rosh Chodesh Tevet') {