calendaryjs-plugin-liturgical 0.1.0

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/index.cjs ADDED
@@ -0,0 +1,3150 @@
1
+ 'use strict';
2
+
3
+ var calendaryjs = require('calendaryjs');
4
+
5
+ // package.json
6
+ var package_default = {
7
+ name: "calendaryjs-plugin-liturgical",
8
+ version: "0.1.0"};
9
+
10
+ // src/computus.ts
11
+ function computeEaster(year) {
12
+ const a = year % 19;
13
+ const b = Math.floor(year / 100);
14
+ const c = year % 100;
15
+ const d = Math.floor(b / 4);
16
+ const e = b % 4;
17
+ const f = Math.floor((b + 8) / 25);
18
+ const g = Math.floor((b - f + 1) / 3);
19
+ const h = (19 * a + b - d - g + 15) % 30;
20
+ const i = Math.floor(c / 4);
21
+ const k = c % 4;
22
+ const l = (32 + 2 * e + 2 * i - h - k) % 7;
23
+ const m = Math.floor((a + 11 * h + 22 * l) / 451);
24
+ const month = Math.floor((h + l - 7 * m + 114) / 31);
25
+ const day = (h + l - 7 * m + 114) % 31 + 1;
26
+ return new Date(year, month - 1, day);
27
+ }
28
+ function computeOrthodoxEaster(year) {
29
+ const a = year % 4;
30
+ const b = year % 7;
31
+ const c = year % 19;
32
+ const d = (19 * c + 15) % 30;
33
+ const e = (2 * a + 4 * b - d + 34) % 7;
34
+ const month = Math.floor((d + e + 114) / 31);
35
+ const day = (d + e + 114) % 31 + 1;
36
+ const julianDate = new Date(year, month - 1, day);
37
+ const gregorianDate = new Date(julianDate.getTime() + 13 * 864e5);
38
+ return gregorianDate;
39
+ }
40
+ function getEasterDateString(year) {
41
+ const easter = computeEaster(year);
42
+ const month = String(easter.getMonth() + 1).padStart(2, "0");
43
+ const day = String(easter.getDate()).padStart(2, "0");
44
+ return `${year}-${month}-${day}`;
45
+ }
46
+ function easterRelativeDate(year, offsetDays) {
47
+ const easter = computeEaster(year);
48
+ return new Date(easter.getFullYear(), easter.getMonth(), easter.getDate() + offsetDays);
49
+ }
50
+
51
+ // src/formulas/advent.ts
52
+ function getAdvent1(year) {
53
+ const christmas = new Date(year, 11, 25);
54
+ const christmasDay = christmas.getDay();
55
+ let daysBack;
56
+ if (christmasDay === 0) {
57
+ daysBack = 28;
58
+ } else {
59
+ daysBack = christmasDay + 21;
60
+ }
61
+ const advent1 = new Date(year, 11, 25 - daysBack);
62
+ return advent1;
63
+ }
64
+ function getAdvent2(year) {
65
+ const advent1 = getAdvent1(year);
66
+ return new Date(advent1.getFullYear(), advent1.getMonth(), advent1.getDate() + 7);
67
+ }
68
+ function getAdvent3(year) {
69
+ const advent1 = getAdvent1(year);
70
+ return new Date(advent1.getFullYear(), advent1.getMonth(), advent1.getDate() + 14);
71
+ }
72
+ function getAdvent4(year) {
73
+ const advent1 = getAdvent1(year);
74
+ return new Date(advent1.getFullYear(), advent1.getMonth(), advent1.getDate() + 21);
75
+ }
76
+ function getBaptismOfLord(year, epiphanyOnSunday = false) {
77
+ let epiphany;
78
+ if (epiphanyOnSunday) {
79
+ const jan2 = new Date(year, 0, 2);
80
+ const jan2Day = jan2.getDay();
81
+ const daysToSunday = jan2Day === 0 ? 0 : 7 - jan2Day;
82
+ epiphany = new Date(year, 0, 2 + daysToSunday);
83
+ } else {
84
+ epiphany = new Date(year, 0, 6);
85
+ }
86
+ const epiphanyDay = epiphany.getDay();
87
+ if (epiphanyOnSunday && epiphany.getDate() >= 7) {
88
+ return new Date(year, 0, epiphany.getDate() + 1);
89
+ }
90
+ const daysToNextSunday = epiphanyDay === 0 ? 7 : 7 - epiphanyDay;
91
+ return new Date(year, 0, epiphany.getDate() + daysToNextSunday);
92
+ }
93
+ function getChristTheKing(year) {
94
+ const advent1 = getAdvent1(year);
95
+ return new Date(advent1.getFullYear(), advent1.getMonth(), advent1.getDate() - 7);
96
+ }
97
+ function getHolyFamily(year) {
98
+ const christmas = new Date(year, 11, 25);
99
+ const christmasDay = christmas.getDay();
100
+ if (christmasDay === 0) {
101
+ return new Date(year, 11, 30);
102
+ }
103
+ const daysToSunday = 7 - christmasDay;
104
+ return new Date(year, 11, 25 + daysToSunday);
105
+ }
106
+
107
+ // src/daily/boundaries.ts
108
+ function getLiturgicalYear(date) {
109
+ const year = date.getFullYear();
110
+ const advent1ThisYear = getAdvent1(year);
111
+ if (date < advent1ThisYear) {
112
+ return year;
113
+ }
114
+ return year + 1;
115
+ }
116
+ function getLiturgicalYearBoundaries(liturgicalYear, epiphanyOnSunday = false) {
117
+ const advent1 = getAdvent1(liturgicalYear - 1);
118
+ const christmas = new Date(liturgicalYear - 1, 11, 25);
119
+ const baptismOfLord = getBaptismOfLord(liturgicalYear, epiphanyOnSunday);
120
+ const easter = computeEaster(liturgicalYear);
121
+ const ashWednesday = calendaryjs.addDays(easter, -46);
122
+ const pentecost = calendaryjs.addDays(easter, 49);
123
+ const christTheKing = getChristTheKing(liturgicalYear);
124
+ return {
125
+ advent1,
126
+ christmas,
127
+ baptismOfLord,
128
+ ashWednesday,
129
+ easter,
130
+ pentecost,
131
+ christTheKing
132
+ };
133
+ }
134
+
135
+ // src/daily/calculator.ts
136
+ function getLiturgicalDay(date, options = {}) {
137
+ const { epiphanyOnSunday = false } = options;
138
+ const d = typeof date === "string" ? calendaryjs.parseDate(date) : date;
139
+ const dateStr = calendaryjs.formatDate(d);
140
+ const dayOfWeek = d.getDay();
141
+ const isSunday = dayOfWeek === 0;
142
+ const isWeekday = !isSunday;
143
+ const litYear = getLiturgicalYear(d);
144
+ const boundaries = getLiturgicalYearBoundaries(litYear, epiphanyOnSunday);
145
+ const { season, week, rank, vestmentColor } = calculateSeasonAndWeek(
146
+ d,
147
+ boundaries,
148
+ litYear,
149
+ epiphanyOnSunday
150
+ );
151
+ return {
152
+ date: dateStr,
153
+ season,
154
+ week,
155
+ dayOfWeek,
156
+ rank,
157
+ vestmentColor,
158
+ isSunday,
159
+ isWeekday,
160
+ metadata: {
161
+ season,
162
+ rank,
163
+ vestmentColor
164
+ }
165
+ };
166
+ }
167
+ function calculateSeasonAndWeek(date, boundaries, litYear, epiphanyOnSunday) {
168
+ const { advent1, christmas, baptismOfLord, ashWednesday, easter, pentecost } = boundaries;
169
+ const nextAdvent1 = getLiturgicalYearBoundaries(litYear + 1, epiphanyOnSunday).advent1;
170
+ if (date >= advent1 && date < christmas) {
171
+ const daysFromAdvent1 = calendaryjs.daysBetween(advent1, date);
172
+ const week = Math.floor(daysFromAdvent1 / 7) + 1;
173
+ const dayOfWeek = date.getDay();
174
+ return {
175
+ season: "advent",
176
+ week,
177
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
178
+ vestmentColor: week === 3 && dayOfWeek === 0 ? "rose" : "violet"
179
+ };
180
+ }
181
+ if (date >= christmas && date <= baptismOfLord) {
182
+ const daysFromChristmas = calendaryjs.daysBetween(christmas, date);
183
+ const week = daysFromChristmas <= 7 ? 1 : 2;
184
+ return {
185
+ season: "christmas",
186
+ week,
187
+ rank: daysFromChristmas === 0 ? "solemnity" : "ordinary",
188
+ vestmentColor: "white"
189
+ };
190
+ }
191
+ if (date > baptismOfLord && date < ashWednesday) {
192
+ const daysFromBaptism = calendaryjs.daysBetween(baptismOfLord, date);
193
+ const week = Math.floor(daysFromBaptism / 7) + 1;
194
+ const dayOfWeek = date.getDay();
195
+ return {
196
+ season: "ordinary-time-1",
197
+ week,
198
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
199
+ vestmentColor: "green"
200
+ };
201
+ }
202
+ const holySaturday = calendaryjs.addDays(easter, -1);
203
+ if (date >= ashWednesday && date <= holySaturday) {
204
+ const firstSundayOfLent = calendaryjs.addDays(ashWednesday, 7 - ashWednesday.getDay());
205
+ let week;
206
+ if (date < firstSundayOfLent) {
207
+ week = 0;
208
+ } else {
209
+ const daysFromFirstSunday = calendaryjs.daysBetween(firstSundayOfLent, date);
210
+ week = Math.floor(daysFromFirstSunday / 7) + 1;
211
+ }
212
+ const dayOfWeek = date.getDay();
213
+ const palmSunday = calendaryjs.addDays(easter, -7);
214
+ if (date >= palmSunday) {
215
+ week = 6;
216
+ }
217
+ return {
218
+ season: "lent",
219
+ week,
220
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
221
+ vestmentColor: week === 4 && dayOfWeek === 0 ? "rose" : "violet"
222
+ };
223
+ }
224
+ if (date >= easter && date <= pentecost) {
225
+ const daysFromEaster = calendaryjs.daysBetween(easter, date);
226
+ const week = Math.floor(daysFromEaster / 7) + 1;
227
+ const dayOfWeek = date.getDay();
228
+ return {
229
+ season: "easter",
230
+ week,
231
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
232
+ vestmentColor: daysFromEaster === 49 ? "red" : "white"
233
+ // Pentecost is red
234
+ };
235
+ }
236
+ if (date > pentecost && date < nextAdvent1) {
237
+ const daysFromPentecost = calendaryjs.daysBetween(pentecost, date);
238
+ const ot1Weeks = Math.floor(calendaryjs.daysBetween(baptismOfLord, ashWednesday) / 7);
239
+ const ot2WeekOffset = ot1Weeks + 1;
240
+ const week = Math.floor(daysFromPentecost / 7) + ot2WeekOffset;
241
+ const dayOfWeek = date.getDay();
242
+ return {
243
+ season: "ordinary-time-2",
244
+ week,
245
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
246
+ vestmentColor: "green"
247
+ };
248
+ }
249
+ return {
250
+ season: "ordinary-time-2",
251
+ week: 1,
252
+ rank: "ordinary",
253
+ vestmentColor: "green"
254
+ };
255
+ }
256
+ function getLiturgicalDaysInRange(startDate, endDate, options = {}) {
257
+ const start = typeof startDate === "string" ? calendaryjs.parseDate(startDate) : startDate;
258
+ const end = typeof endDate === "string" ? calendaryjs.parseDate(endDate) : endDate;
259
+ const days = [];
260
+ const current = new Date(start);
261
+ while (current <= end) {
262
+ days.push(getLiturgicalDay(current, options));
263
+ current.setDate(current.getDate() + 1);
264
+ }
265
+ return days;
266
+ }
267
+ function getLiturgicalDaysForMonth(year, month, options = {}) {
268
+ const startDate = new Date(year, month - 1, 1);
269
+ const endDate = new Date(year, month, 0);
270
+ return getLiturgicalDaysInRange(startDate, endDate, options);
271
+ }
272
+ function getLiturgicalDaysForYear(year, options = {}) {
273
+ const startDate = new Date(year, 0, 1);
274
+ const endDate = new Date(year, 11, 31);
275
+ return getLiturgicalDaysInRange(startDate, endDate, options);
276
+ }
277
+
278
+ // src/generators/easter.ts
279
+ var easterEventHandler = {
280
+ validate(event) {
281
+ if (typeof event !== "object" || event === null) return false;
282
+ const e = event;
283
+ return e.type === "easter" && typeof e.id === "string";
284
+ },
285
+ generate(_event, year) {
286
+ return [computeEaster(year)];
287
+ }
288
+ };
289
+
290
+ // src/generators/offset.ts
291
+ var offsetEventHandler = {
292
+ validate(event) {
293
+ if (typeof event !== "object" || event === null) return false;
294
+ const e = event;
295
+ return e.type === "offset" && typeof e.baseEvent === "string" && typeof e.offsetDays === "number" && typeof e.id === "string";
296
+ },
297
+ generate(event, year) {
298
+ const offsetEvent = event;
299
+ let baseDate;
300
+ switch (offsetEvent.baseEvent) {
301
+ case "easter":
302
+ baseDate = computeEaster(year);
303
+ break;
304
+ default:
305
+ throw new Error(
306
+ `Unknown base event "${offsetEvent.baseEvent}". Supported base events: "easter".`
307
+ );
308
+ }
309
+ const resultDate = new Date(baseDate);
310
+ resultDate.setDate(resultDate.getDate() + offsetEvent.offsetDays);
311
+ return [resultDate];
312
+ }
313
+ };
314
+
315
+ // src/plugin.ts
316
+ function liturgical(options = {}) {
317
+ const { epiphanyOnSunday = false, enrichDays = true } = options;
318
+ const liturgicalDayEnricher = {
319
+ name: "liturgical",
320
+ priority: 20,
321
+ enrich(day) {
322
+ const litDay = getLiturgicalDay(day.date, {
323
+ epiphanyOnSunday
324
+ });
325
+ return {
326
+ ...day,
327
+ liturgical: {
328
+ season: litDay.season,
329
+ week: litDay.week,
330
+ rank: litDay.rank,
331
+ vestmentColor: litDay.vestmentColor
332
+ }
333
+ };
334
+ }
335
+ };
336
+ return {
337
+ name: package_default.name,
338
+ version: package_default.version,
339
+ install(calendary) {
340
+ if (enrichDays) {
341
+ calendary.registerDayEnricher(liturgicalDayEnricher);
342
+ }
343
+ },
344
+ eventTypes: {
345
+ easter: easterEventHandler,
346
+ offset: offsetEventHandler
347
+ },
348
+ formulas: {
349
+ "advent-1": (year) => getAdvent1(year),
350
+ "advent-2": (year) => getAdvent2(year),
351
+ "advent-3": (year) => getAdvent3(year),
352
+ "advent-4": (year) => getAdvent4(year),
353
+ "baptism-of-lord": (year) => getBaptismOfLord(year, epiphanyOnSunday),
354
+ "christ-the-king": (year) => getChristTheKing(year)
355
+ }
356
+ };
357
+ }
358
+
359
+ // src/keys.ts
360
+ var EASTER_CYCLE_KEYS = [
361
+ "EASTER_SUNDAY",
362
+ "ASH_WEDNESDAY",
363
+ "PALM_SUNDAY",
364
+ "HOLY_THURSDAY",
365
+ "GOOD_FRIDAY",
366
+ "HOLY_SATURDAY",
367
+ "DIVINE_MERCY_SUNDAY",
368
+ "ASCENSION",
369
+ "PENTECOST",
370
+ "TRINITY_SUNDAY",
371
+ "CORPUS_CHRISTI",
372
+ "SACRED_HEART",
373
+ "IMMACULATE_HEART"
374
+ ];
375
+ var FIXED_SOLEMNITY_KEYS = [
376
+ "MARY_MOTHER_OF_GOD",
377
+ "EPIPHANY",
378
+ "PRESENTATION",
379
+ "SAINT_JOSEPH",
380
+ "ANNUNCIATION",
381
+ "NATIVITY_OF_JOHN_BAPTIST",
382
+ "PETER_AND_PAUL",
383
+ "TRANSFIGURATION",
384
+ "ASSUMPTION",
385
+ "EXALTATION_OF_CROSS",
386
+ "ALL_SAINTS",
387
+ "ALL_SOULS",
388
+ "IMMACULATE_CONCEPTION",
389
+ "CHRISTMAS",
390
+ "HOLY_INNOCENTS",
391
+ "HOLY_FAMILY"
392
+ ];
393
+ var COMPUTED_KEYS = [
394
+ "ADVENT_1",
395
+ "ADVENT_2",
396
+ "ADVENT_3",
397
+ "ADVENT_4",
398
+ "BAPTISM_OF_LORD",
399
+ "CHRIST_THE_KING"
400
+ ];
401
+ var MEMORIAL_SAINT_KEYS = [
402
+ // January
403
+ "BASIL_GREGORY",
404
+ "ANTHONY_ABBOT",
405
+ "AGNES",
406
+ "FRANCIS_DE_SALES",
407
+ "TIMOTHY_TITUS",
408
+ "THOMAS_AQUINAS",
409
+ "JOHN_BOSCO",
410
+ // February
411
+ "AGATHA",
412
+ "PAUL_MIKI",
413
+ "SCHOLASTICA",
414
+ "OUR_LADY_OF_LOURDES",
415
+ "CYRIL_METHODIUS",
416
+ "POLYCARP",
417
+ // March
418
+ "PERPETUA_FELICITY",
419
+ "PATRICK",
420
+ "CYRIL_OF_JERUSALEM",
421
+ // April
422
+ "MARTIN_I",
423
+ "ANSELM",
424
+ "GEORGE",
425
+ "ADALBERT",
426
+ "FIDELIS",
427
+ "LOUIS_GRIGNION",
428
+ "PETER_CHANEL",
429
+ "CATHERINE_OF_SIENA",
430
+ "PIUS_V",
431
+ // May
432
+ "JOSEPH_WORKER",
433
+ "ATHANASIUS",
434
+ "NEREUS_ACHILLEUS",
435
+ "PANCRAS",
436
+ "OUR_LADY_OF_FATIMA",
437
+ "JOHN_I",
438
+ "BERNARDINE",
439
+ "PHILIP_NERI",
440
+ "AUGUSTINE_OF_CANTERBURY",
441
+ // June
442
+ "JUSTIN",
443
+ "MARCELLINUS_PETER",
444
+ "CHARLES_LWANGA",
445
+ "BONIFACE",
446
+ "NORBERT",
447
+ "EPHREM",
448
+ "BARNABAS",
449
+ "ROMUALD",
450
+ "JOHN_FISHER_THOMAS_MORE",
451
+ "FIRST_MARTYRS_OF_ROME",
452
+ // July
453
+ "THOMAS_APOSTLE",
454
+ "ELIZABETH_OF_PORTUGAL",
455
+ "MARIA_GORETTI",
456
+ "AUGUSTINE_ZHAO",
457
+ "BENEDICT",
458
+ "HENRY",
459
+ "CAMILLUS",
460
+ "BONAVENTURE",
461
+ "OUR_LADY_OF_MOUNT_CARMEL",
462
+ "APOLLINARIS",
463
+ "LAWRENCE_OF_BRINDISI",
464
+ "MARY_MAGDALENE",
465
+ "BRIDGET",
466
+ "SHARBEL",
467
+ "JAMES_APOSTLE",
468
+ "MARTHA",
469
+ "PETER_CHRYSOLOGUS",
470
+ "IGNATIUS_OF_LOYOLA",
471
+ // August
472
+ "ALPHONSUS",
473
+ "JOHN_VIANNEY",
474
+ "DEDICATION_MARY_MAJOR",
475
+ "SIXTUS_II",
476
+ "CAJETAN",
477
+ "DOMINIC",
478
+ "LAWRENCE",
479
+ "CLARE",
480
+ "JANE_FRANCES",
481
+ "PONTIAN_HIPPOLYTUS",
482
+ "MAXIMILIAN_KOLBE",
483
+ "JOHN_EUDES",
484
+ "BERNARD",
485
+ "PIUS_X",
486
+ "QUEENSHIP_OF_MARY",
487
+ "BARTHOLOMEW",
488
+ "LOUIS_IX",
489
+ "JOSEPH_CALASANZ",
490
+ "MONICA",
491
+ "AUGUSTINE",
492
+ "PASSION_OF_JOHN_BAPTIST",
493
+ // September
494
+ "GREGORY_THE_GREAT",
495
+ "BIRTH_OF_MARY",
496
+ "PETER_CLAVER",
497
+ "MOST_HOLY_NAME_OF_MARY",
498
+ "OUR_LADY_OF_SORROWS",
499
+ "CORNELIUS_CYPRIAN",
500
+ "ROBERT_BELLARMINE",
501
+ "JANUARIUS",
502
+ "MATTHEW",
503
+ "PADRE_PIO",
504
+ "COSMAS_DAMIAN",
505
+ "WENCESLAUS",
506
+ "LAWRENCE_RUIZ",
507
+ "ARCHANGELS",
508
+ "JEROME",
509
+ // October
510
+ "THERESE_OF_LISIEUX",
511
+ "GUARDIAN_ANGELS",
512
+ "FRANCIS_OF_ASSISI",
513
+ "FAUSTINA",
514
+ "BRUNO",
515
+ "OUR_LADY_OF_ROSARY",
516
+ "DENIS",
517
+ "CALLISTUS_I",
518
+ "TERESA_OF_AVILA",
519
+ "HEDWIG",
520
+ "MARGARET_MARY",
521
+ "IGNATIUS_OF_ANTIOCH",
522
+ "LUKE",
523
+ "ISAAC_JOGUES",
524
+ "PAUL_OF_CROSS",
525
+ "JOHN_PAUL_II",
526
+ "JOHN_OF_CAPISTRANO",
527
+ "ANTHONY_MARY_CLARET",
528
+ "SIMON_JUDE",
529
+ // November
530
+ "DEDICATION_LATERAN",
531
+ "LEO_THE_GREAT",
532
+ "MARTIN_OF_TOURS",
533
+ "JOSAPHAT",
534
+ "MARGARET_OF_SCOTLAND",
535
+ "GERTRUDE",
536
+ "ELIZABETH_OF_HUNGARY",
537
+ "DEDICATION_PETER_PAUL",
538
+ "PRESENTATION_OF_MARY",
539
+ "CLEMENT_I",
540
+ "COLUMBAN",
541
+ "CATHERINE_OF_ALEXANDRIA",
542
+ "ANDREW_APOSTLE",
543
+ // December
544
+ "FRANCIS_XAVIER",
545
+ "LUCY",
546
+ "STEPHEN_FIRST_MARTYR",
547
+ "JOHN_APOSTLE"
548
+ ];
549
+ var ALL_MASS_KEYS = [
550
+ ...EASTER_CYCLE_KEYS,
551
+ ...FIXED_SOLEMNITY_KEYS,
552
+ ...COMPUTED_KEYS,
553
+ ...MEMORIAL_SAINT_KEYS
554
+ ];
555
+ var MassKeys = {
556
+ // Easter Cycle
557
+ EASTER_SUNDAY: "EASTER_SUNDAY",
558
+ ASH_WEDNESDAY: "ASH_WEDNESDAY",
559
+ PALM_SUNDAY: "PALM_SUNDAY",
560
+ HOLY_THURSDAY: "HOLY_THURSDAY",
561
+ GOOD_FRIDAY: "GOOD_FRIDAY",
562
+ HOLY_SATURDAY: "HOLY_SATURDAY",
563
+ DIVINE_MERCY_SUNDAY: "DIVINE_MERCY_SUNDAY",
564
+ ASCENSION: "ASCENSION",
565
+ PENTECOST: "PENTECOST",
566
+ TRINITY_SUNDAY: "TRINITY_SUNDAY",
567
+ CORPUS_CHRISTI: "CORPUS_CHRISTI",
568
+ SACRED_HEART: "SACRED_HEART",
569
+ IMMACULATE_HEART: "IMMACULATE_HEART",
570
+ // Fixed Solemnities
571
+ MARY_MOTHER_OF_GOD: "MARY_MOTHER_OF_GOD",
572
+ EPIPHANY: "EPIPHANY",
573
+ PRESENTATION: "PRESENTATION",
574
+ SAINT_JOSEPH: "SAINT_JOSEPH",
575
+ ANNUNCIATION: "ANNUNCIATION",
576
+ NATIVITY_OF_JOHN_BAPTIST: "NATIVITY_OF_JOHN_BAPTIST",
577
+ PETER_AND_PAUL: "PETER_AND_PAUL",
578
+ TRANSFIGURATION: "TRANSFIGURATION",
579
+ ASSUMPTION: "ASSUMPTION",
580
+ EXALTATION_OF_CROSS: "EXALTATION_OF_CROSS",
581
+ ALL_SAINTS: "ALL_SAINTS",
582
+ ALL_SOULS: "ALL_SOULS",
583
+ IMMACULATE_CONCEPTION: "IMMACULATE_CONCEPTION",
584
+ CHRISTMAS: "CHRISTMAS",
585
+ HOLY_INNOCENTS: "HOLY_INNOCENTS",
586
+ HOLY_FAMILY: "HOLY_FAMILY",
587
+ // Computed
588
+ ADVENT_1: "ADVENT_1",
589
+ ADVENT_2: "ADVENT_2",
590
+ ADVENT_3: "ADVENT_3",
591
+ ADVENT_4: "ADVENT_4",
592
+ BAPTISM_OF_LORD: "BAPTISM_OF_LORD",
593
+ CHRIST_THE_KING: "CHRIST_THE_KING",
594
+ // Memorial Saints - January
595
+ BASIL_GREGORY: "BASIL_GREGORY",
596
+ ANTHONY_ABBOT: "ANTHONY_ABBOT",
597
+ AGNES: "AGNES",
598
+ FRANCIS_DE_SALES: "FRANCIS_DE_SALES",
599
+ TIMOTHY_TITUS: "TIMOTHY_TITUS",
600
+ THOMAS_AQUINAS: "THOMAS_AQUINAS",
601
+ JOHN_BOSCO: "JOHN_BOSCO",
602
+ // February
603
+ AGATHA: "AGATHA",
604
+ PAUL_MIKI: "PAUL_MIKI",
605
+ SCHOLASTICA: "SCHOLASTICA",
606
+ OUR_LADY_OF_LOURDES: "OUR_LADY_OF_LOURDES",
607
+ CYRIL_METHODIUS: "CYRIL_METHODIUS",
608
+ POLYCARP: "POLYCARP",
609
+ // March
610
+ PERPETUA_FELICITY: "PERPETUA_FELICITY",
611
+ PATRICK: "PATRICK",
612
+ CYRIL_OF_JERUSALEM: "CYRIL_OF_JERUSALEM",
613
+ // April
614
+ MARTIN_I: "MARTIN_I",
615
+ ANSELM: "ANSELM",
616
+ GEORGE: "GEORGE",
617
+ ADALBERT: "ADALBERT",
618
+ FIDELIS: "FIDELIS",
619
+ LOUIS_GRIGNION: "LOUIS_GRIGNION",
620
+ PETER_CHANEL: "PETER_CHANEL",
621
+ CATHERINE_OF_SIENA: "CATHERINE_OF_SIENA",
622
+ PIUS_V: "PIUS_V",
623
+ // May
624
+ JOSEPH_WORKER: "JOSEPH_WORKER",
625
+ ATHANASIUS: "ATHANASIUS",
626
+ NEREUS_ACHILLEUS: "NEREUS_ACHILLEUS",
627
+ PANCRAS: "PANCRAS",
628
+ OUR_LADY_OF_FATIMA: "OUR_LADY_OF_FATIMA",
629
+ JOHN_I: "JOHN_I",
630
+ BERNARDINE: "BERNARDINE",
631
+ PHILIP_NERI: "PHILIP_NERI",
632
+ AUGUSTINE_OF_CANTERBURY: "AUGUSTINE_OF_CANTERBURY",
633
+ // June
634
+ JUSTIN: "JUSTIN",
635
+ MARCELLINUS_PETER: "MARCELLINUS_PETER",
636
+ CHARLES_LWANGA: "CHARLES_LWANGA",
637
+ BONIFACE: "BONIFACE",
638
+ NORBERT: "NORBERT",
639
+ EPHREM: "EPHREM",
640
+ BARNABAS: "BARNABAS",
641
+ ROMUALD: "ROMUALD",
642
+ JOHN_FISHER_THOMAS_MORE: "JOHN_FISHER_THOMAS_MORE",
643
+ FIRST_MARTYRS_OF_ROME: "FIRST_MARTYRS_OF_ROME",
644
+ // July
645
+ THOMAS_APOSTLE: "THOMAS_APOSTLE",
646
+ ELIZABETH_OF_PORTUGAL: "ELIZABETH_OF_PORTUGAL",
647
+ MARIA_GORETTI: "MARIA_GORETTI",
648
+ AUGUSTINE_ZHAO: "AUGUSTINE_ZHAO",
649
+ BENEDICT: "BENEDICT",
650
+ HENRY: "HENRY",
651
+ CAMILLUS: "CAMILLUS",
652
+ BONAVENTURE: "BONAVENTURE",
653
+ OUR_LADY_OF_MOUNT_CARMEL: "OUR_LADY_OF_MOUNT_CARMEL",
654
+ APOLLINARIS: "APOLLINARIS",
655
+ LAWRENCE_OF_BRINDISI: "LAWRENCE_OF_BRINDISI",
656
+ MARY_MAGDALENE: "MARY_MAGDALENE",
657
+ BRIDGET: "BRIDGET",
658
+ SHARBEL: "SHARBEL",
659
+ JAMES_APOSTLE: "JAMES_APOSTLE",
660
+ MARTHA: "MARTHA",
661
+ PETER_CHRYSOLOGUS: "PETER_CHRYSOLOGUS",
662
+ IGNATIUS_OF_LOYOLA: "IGNATIUS_OF_LOYOLA",
663
+ // August
664
+ ALPHONSUS: "ALPHONSUS",
665
+ JOHN_VIANNEY: "JOHN_VIANNEY",
666
+ DEDICATION_MARY_MAJOR: "DEDICATION_MARY_MAJOR",
667
+ SIXTUS_II: "SIXTUS_II",
668
+ CAJETAN: "CAJETAN",
669
+ DOMINIC: "DOMINIC",
670
+ LAWRENCE: "LAWRENCE",
671
+ CLARE: "CLARE",
672
+ JANE_FRANCES: "JANE_FRANCES",
673
+ PONTIAN_HIPPOLYTUS: "PONTIAN_HIPPOLYTUS",
674
+ MAXIMILIAN_KOLBE: "MAXIMILIAN_KOLBE",
675
+ JOHN_EUDES: "JOHN_EUDES",
676
+ BERNARD: "BERNARD",
677
+ PIUS_X: "PIUS_X",
678
+ QUEENSHIP_OF_MARY: "QUEENSHIP_OF_MARY",
679
+ BARTHOLOMEW: "BARTHOLOMEW",
680
+ LOUIS_IX: "LOUIS_IX",
681
+ JOSEPH_CALASANZ: "JOSEPH_CALASANZ",
682
+ MONICA: "MONICA",
683
+ AUGUSTINE: "AUGUSTINE",
684
+ PASSION_OF_JOHN_BAPTIST: "PASSION_OF_JOHN_BAPTIST",
685
+ // September
686
+ GREGORY_THE_GREAT: "GREGORY_THE_GREAT",
687
+ BIRTH_OF_MARY: "BIRTH_OF_MARY",
688
+ PETER_CLAVER: "PETER_CLAVER",
689
+ MOST_HOLY_NAME_OF_MARY: "MOST_HOLY_NAME_OF_MARY",
690
+ OUR_LADY_OF_SORROWS: "OUR_LADY_OF_SORROWS",
691
+ CORNELIUS_CYPRIAN: "CORNELIUS_CYPRIAN",
692
+ ROBERT_BELLARMINE: "ROBERT_BELLARMINE",
693
+ JANUARIUS: "JANUARIUS",
694
+ MATTHEW: "MATTHEW",
695
+ PADRE_PIO: "PADRE_PIO",
696
+ COSMAS_DAMIAN: "COSMAS_DAMIAN",
697
+ WENCESLAUS: "WENCESLAUS",
698
+ LAWRENCE_RUIZ: "LAWRENCE_RUIZ",
699
+ ARCHANGELS: "ARCHANGELS",
700
+ JEROME: "JEROME",
701
+ // October
702
+ THERESE_OF_LISIEUX: "THERESE_OF_LISIEUX",
703
+ GUARDIAN_ANGELS: "GUARDIAN_ANGELS",
704
+ FRANCIS_OF_ASSISI: "FRANCIS_OF_ASSISI",
705
+ FAUSTINA: "FAUSTINA",
706
+ BRUNO: "BRUNO",
707
+ OUR_LADY_OF_ROSARY: "OUR_LADY_OF_ROSARY",
708
+ DENIS: "DENIS",
709
+ CALLISTUS_I: "CALLISTUS_I",
710
+ TERESA_OF_AVILA: "TERESA_OF_AVILA",
711
+ HEDWIG: "HEDWIG",
712
+ MARGARET_MARY: "MARGARET_MARY",
713
+ IGNATIUS_OF_ANTIOCH: "IGNATIUS_OF_ANTIOCH",
714
+ LUKE: "LUKE",
715
+ ISAAC_JOGUES: "ISAAC_JOGUES",
716
+ PAUL_OF_CROSS: "PAUL_OF_CROSS",
717
+ JOHN_PAUL_II: "JOHN_PAUL_II",
718
+ JOHN_OF_CAPISTRANO: "JOHN_OF_CAPISTRANO",
719
+ ANTHONY_MARY_CLARET: "ANTHONY_MARY_CLARET",
720
+ SIMON_JUDE: "SIMON_JUDE",
721
+ // November
722
+ DEDICATION_LATERAN: "DEDICATION_LATERAN",
723
+ LEO_THE_GREAT: "LEO_THE_GREAT",
724
+ MARTIN_OF_TOURS: "MARTIN_OF_TOURS",
725
+ JOSAPHAT: "JOSAPHAT",
726
+ MARGARET_OF_SCOTLAND: "MARGARET_OF_SCOTLAND",
727
+ GERTRUDE: "GERTRUDE",
728
+ ELIZABETH_OF_HUNGARY: "ELIZABETH_OF_HUNGARY",
729
+ DEDICATION_PETER_PAUL: "DEDICATION_PETER_PAUL",
730
+ PRESENTATION_OF_MARY: "PRESENTATION_OF_MARY",
731
+ CLEMENT_I: "CLEMENT_I",
732
+ COLUMBAN: "COLUMBAN",
733
+ CATHERINE_OF_ALEXANDRIA: "CATHERINE_OF_ALEXANDRIA",
734
+ ANDREW_APOSTLE: "ANDREW_APOSTLE",
735
+ // December
736
+ FRANCIS_XAVIER: "FRANCIS_XAVIER",
737
+ LUCY: "LUCY",
738
+ STEPHEN_FIRST_MARTYR: "STEPHEN_FIRST_MARTYR",
739
+ JOHN_APOSTLE: "JOHN_APOSTLE"
740
+ };
741
+
742
+ // src/definitions.ts
743
+ function meta(season, rank, vestmentColor) {
744
+ return { season, rank, vestmentColor };
745
+ }
746
+ var EASTER_CYCLE_EVENTS = [
747
+ {
748
+ key: "EASTER_SUNDAY",
749
+ type: "easter",
750
+ category: "easter-cycle",
751
+ metadata: meta("easter", "solemnity", "white")
752
+ },
753
+ {
754
+ key: "ASH_WEDNESDAY",
755
+ type: "offset",
756
+ category: "easter-cycle",
757
+ offsetDays: -46,
758
+ metadata: meta("lent", "solemnity", "violet")
759
+ },
760
+ {
761
+ key: "PALM_SUNDAY",
762
+ type: "offset",
763
+ category: "easter-cycle",
764
+ offsetDays: -7,
765
+ metadata: meta("lent", "solemnity", "red")
766
+ },
767
+ {
768
+ key: "HOLY_THURSDAY",
769
+ type: "offset",
770
+ category: "easter-cycle",
771
+ offsetDays: -3,
772
+ metadata: meta("lent", "solemnity", "white")
773
+ },
774
+ {
775
+ key: "GOOD_FRIDAY",
776
+ type: "offset",
777
+ category: "easter-cycle",
778
+ offsetDays: -2,
779
+ metadata: meta("lent", "solemnity", "red")
780
+ },
781
+ {
782
+ key: "HOLY_SATURDAY",
783
+ type: "offset",
784
+ category: "easter-cycle",
785
+ offsetDays: -1,
786
+ metadata: meta("lent", "solemnity", "white")
787
+ },
788
+ {
789
+ key: "DIVINE_MERCY_SUNDAY",
790
+ type: "offset",
791
+ category: "easter-cycle",
792
+ offsetDays: 7,
793
+ metadata: meta("easter", "solemnity", "white")
794
+ },
795
+ {
796
+ key: "ASCENSION",
797
+ type: "offset",
798
+ category: "easter-cycle",
799
+ offsetDays: 39,
800
+ // Thursday, can be moved to Sunday (+42)
801
+ metadata: meta("easter", "solemnity", "white")
802
+ },
803
+ {
804
+ key: "PENTECOST",
805
+ type: "offset",
806
+ category: "easter-cycle",
807
+ offsetDays: 49,
808
+ metadata: meta("easter", "solemnity", "red")
809
+ },
810
+ {
811
+ key: "TRINITY_SUNDAY",
812
+ type: "offset",
813
+ category: "easter-cycle",
814
+ offsetDays: 56,
815
+ metadata: meta("ordinary-time-2", "solemnity", "white")
816
+ },
817
+ {
818
+ key: "CORPUS_CHRISTI",
819
+ type: "offset",
820
+ category: "easter-cycle",
821
+ offsetDays: 60,
822
+ // Thursday, usually moved to Sunday (+63)
823
+ metadata: meta("ordinary-time-2", "solemnity", "white")
824
+ },
825
+ {
826
+ key: "SACRED_HEART",
827
+ type: "offset",
828
+ category: "easter-cycle",
829
+ offsetDays: 68,
830
+ // Friday after Corpus Christi
831
+ metadata: meta("ordinary-time-2", "solemnity", "white")
832
+ },
833
+ {
834
+ key: "IMMACULATE_HEART",
835
+ type: "offset",
836
+ category: "easter-cycle",
837
+ offsetDays: 69,
838
+ // Saturday after Sacred Heart
839
+ metadata: meta("ordinary-time-2", "memorial", "white")
840
+ }
841
+ ];
842
+ var FIXED_SOLEMNITY_EVENTS = [
843
+ {
844
+ key: "MARY_MOTHER_OF_GOD",
845
+ type: "const",
846
+ category: "solemnities",
847
+ month: 1,
848
+ day: 1,
849
+ metadata: meta("christmas", "solemnity", "white")
850
+ },
851
+ {
852
+ key: "EPIPHANY",
853
+ type: "const",
854
+ category: "solemnities",
855
+ month: 1,
856
+ day: 6,
857
+ metadata: meta("christmas", "solemnity", "white")
858
+ },
859
+ {
860
+ key: "PRESENTATION",
861
+ type: "const",
862
+ category: "feasts",
863
+ month: 2,
864
+ day: 2,
865
+ metadata: meta("ordinary-time-1", "feast", "white")
866
+ },
867
+ {
868
+ key: "SAINT_JOSEPH",
869
+ type: "const",
870
+ category: "solemnities",
871
+ month: 3,
872
+ day: 19,
873
+ metadata: meta("lent", "solemnity", "white")
874
+ },
875
+ {
876
+ key: "ANNUNCIATION",
877
+ type: "const",
878
+ category: "solemnities",
879
+ month: 3,
880
+ day: 25,
881
+ metadata: meta("lent", "solemnity", "white")
882
+ },
883
+ {
884
+ key: "NATIVITY_OF_JOHN_BAPTIST",
885
+ type: "const",
886
+ category: "solemnities",
887
+ month: 6,
888
+ day: 24,
889
+ metadata: meta("ordinary-time-2", "solemnity", "white")
890
+ },
891
+ {
892
+ key: "PETER_AND_PAUL",
893
+ type: "const",
894
+ category: "solemnities",
895
+ month: 6,
896
+ day: 29,
897
+ metadata: meta("ordinary-time-2", "solemnity", "red")
898
+ },
899
+ {
900
+ key: "TRANSFIGURATION",
901
+ type: "const",
902
+ category: "feasts",
903
+ month: 8,
904
+ day: 6,
905
+ metadata: meta("ordinary-time-2", "feast", "white")
906
+ },
907
+ {
908
+ key: "ASSUMPTION",
909
+ type: "const",
910
+ category: "solemnities",
911
+ month: 8,
912
+ day: 15,
913
+ metadata: meta("ordinary-time-2", "solemnity", "white")
914
+ },
915
+ {
916
+ key: "EXALTATION_OF_CROSS",
917
+ type: "const",
918
+ category: "feasts",
919
+ month: 9,
920
+ day: 14,
921
+ metadata: meta("ordinary-time-2", "feast", "red")
922
+ },
923
+ {
924
+ key: "ALL_SAINTS",
925
+ type: "const",
926
+ category: "solemnities",
927
+ month: 11,
928
+ day: 1,
929
+ metadata: meta("ordinary-time-2", "solemnity", "white")
930
+ },
931
+ {
932
+ key: "ALL_SOULS",
933
+ type: "const",
934
+ category: "solemnities",
935
+ month: 11,
936
+ day: 2,
937
+ metadata: meta("ordinary-time-2", "solemnity", "violet")
938
+ },
939
+ {
940
+ key: "IMMACULATE_CONCEPTION",
941
+ type: "const",
942
+ category: "solemnities",
943
+ month: 12,
944
+ day: 8,
945
+ metadata: meta("advent", "solemnity", "white")
946
+ },
947
+ {
948
+ key: "CHRISTMAS",
949
+ type: "const",
950
+ category: "solemnities",
951
+ month: 12,
952
+ day: 25,
953
+ metadata: meta("christmas", "solemnity", "white")
954
+ },
955
+ {
956
+ key: "HOLY_INNOCENTS",
957
+ type: "const",
958
+ category: "feasts",
959
+ month: 12,
960
+ day: 28,
961
+ metadata: meta("christmas", "feast", "red")
962
+ },
963
+ {
964
+ key: "HOLY_FAMILY",
965
+ type: "nth-weekday",
966
+ category: "solemnities",
967
+ // First Sunday after Dec 25; if Dec 25 itself is Sunday use Dec 30
968
+ dayOfWeek: 0,
969
+ after: { month: 12, day: 26 },
970
+ before: { month: 12, day: 31 },
971
+ fallback: { month: 12, day: 30 },
972
+ metadata: meta("christmas", "feast", "white")
973
+ }
974
+ ];
975
+ var COMPUTED_EVENTS = [
976
+ {
977
+ key: "ADVENT_1",
978
+ type: "formula",
979
+ category: "computed",
980
+ formula: "advent-1",
981
+ metadata: meta("advent", "solemnity", "violet")
982
+ },
983
+ {
984
+ key: "ADVENT_2",
985
+ type: "formula",
986
+ category: "computed",
987
+ formula: "advent-2",
988
+ metadata: meta("advent", "solemnity", "violet")
989
+ },
990
+ {
991
+ key: "ADVENT_3",
992
+ type: "formula",
993
+ category: "computed",
994
+ formula: "advent-3",
995
+ metadata: meta("advent", "solemnity", "rose")
996
+ },
997
+ {
998
+ key: "ADVENT_4",
999
+ type: "formula",
1000
+ category: "computed",
1001
+ formula: "advent-4",
1002
+ metadata: meta("advent", "solemnity", "violet")
1003
+ },
1004
+ {
1005
+ key: "BAPTISM_OF_LORD",
1006
+ type: "formula",
1007
+ category: "computed",
1008
+ formula: "baptism-of-lord",
1009
+ metadata: meta("christmas", "feast", "white")
1010
+ },
1011
+ {
1012
+ key: "CHRIST_THE_KING",
1013
+ type: "formula",
1014
+ category: "computed",
1015
+ formula: "christ-the-king",
1016
+ metadata: meta("ordinary-time-2", "solemnity", "white")
1017
+ }
1018
+ ];
1019
+ var MEMORIAL_SAINT_EVENTS = [
1020
+ // ===== JANUARY =====
1021
+ {
1022
+ key: "BASIL_GREGORY",
1023
+ type: "const",
1024
+ category: "memorials",
1025
+ month: 1,
1026
+ day: 2,
1027
+ metadata: meta("christmas", "memorial", "white")
1028
+ },
1029
+ {
1030
+ key: "ANTHONY_ABBOT",
1031
+ type: "const",
1032
+ category: "memorials",
1033
+ month: 1,
1034
+ day: 17,
1035
+ metadata: meta("ordinary-time-1", "memorial", "white")
1036
+ },
1037
+ {
1038
+ key: "AGNES",
1039
+ type: "const",
1040
+ category: "memorials",
1041
+ month: 1,
1042
+ day: 21,
1043
+ metadata: meta("ordinary-time-1", "memorial", "red")
1044
+ },
1045
+ {
1046
+ key: "FRANCIS_DE_SALES",
1047
+ type: "const",
1048
+ category: "memorials",
1049
+ month: 1,
1050
+ day: 24,
1051
+ metadata: meta("ordinary-time-1", "memorial", "white")
1052
+ },
1053
+ {
1054
+ key: "TIMOTHY_TITUS",
1055
+ type: "const",
1056
+ category: "memorials",
1057
+ month: 1,
1058
+ day: 26,
1059
+ metadata: meta("ordinary-time-1", "memorial", "white")
1060
+ },
1061
+ {
1062
+ key: "THOMAS_AQUINAS",
1063
+ type: "const",
1064
+ category: "memorials",
1065
+ month: 1,
1066
+ day: 28,
1067
+ metadata: meta("ordinary-time-1", "memorial", "white")
1068
+ },
1069
+ {
1070
+ key: "JOHN_BOSCO",
1071
+ type: "const",
1072
+ category: "memorials",
1073
+ month: 1,
1074
+ day: 31,
1075
+ metadata: meta("ordinary-time-1", "memorial", "white")
1076
+ },
1077
+ // ===== FEBRUARY =====
1078
+ {
1079
+ key: "AGATHA",
1080
+ type: "const",
1081
+ category: "memorials",
1082
+ month: 2,
1083
+ day: 5,
1084
+ metadata: meta("ordinary-time-1", "memorial", "red")
1085
+ },
1086
+ {
1087
+ key: "PAUL_MIKI",
1088
+ type: "const",
1089
+ category: "memorials",
1090
+ month: 2,
1091
+ day: 6,
1092
+ metadata: meta("ordinary-time-1", "memorial", "red")
1093
+ },
1094
+ {
1095
+ key: "SCHOLASTICA",
1096
+ type: "const",
1097
+ category: "memorials",
1098
+ month: 2,
1099
+ day: 10,
1100
+ metadata: meta("ordinary-time-1", "memorial", "white")
1101
+ },
1102
+ {
1103
+ key: "OUR_LADY_OF_LOURDES",
1104
+ type: "const",
1105
+ category: "memorials",
1106
+ month: 2,
1107
+ day: 11,
1108
+ metadata: meta("ordinary-time-1", "memorial", "white")
1109
+ },
1110
+ {
1111
+ key: "CYRIL_METHODIUS",
1112
+ type: "const",
1113
+ category: "memorials",
1114
+ month: 2,
1115
+ day: 14,
1116
+ metadata: meta("ordinary-time-1", "memorial", "white")
1117
+ },
1118
+ {
1119
+ key: "POLYCARP",
1120
+ type: "const",
1121
+ category: "memorials",
1122
+ month: 2,
1123
+ day: 23,
1124
+ metadata: meta("ordinary-time-1", "memorial", "red")
1125
+ },
1126
+ // ===== MARCH =====
1127
+ {
1128
+ key: "PERPETUA_FELICITY",
1129
+ type: "const",
1130
+ category: "memorials",
1131
+ month: 3,
1132
+ day: 7,
1133
+ metadata: meta("lent", "memorial", "red")
1134
+ },
1135
+ {
1136
+ key: "PATRICK",
1137
+ type: "const",
1138
+ category: "memorials",
1139
+ month: 3,
1140
+ day: 17,
1141
+ metadata: meta("lent", "memorial", "white")
1142
+ },
1143
+ {
1144
+ key: "CYRIL_OF_JERUSALEM",
1145
+ type: "const",
1146
+ category: "memorials",
1147
+ month: 3,
1148
+ day: 18,
1149
+ metadata: meta("lent", "memorial", "white")
1150
+ },
1151
+ // ===== APRIL =====
1152
+ {
1153
+ key: "MARTIN_I",
1154
+ type: "const",
1155
+ category: "memorials",
1156
+ month: 4,
1157
+ day: 13,
1158
+ metadata: meta("lent", "memorial", "red")
1159
+ },
1160
+ {
1161
+ key: "ANSELM",
1162
+ type: "const",
1163
+ category: "memorials",
1164
+ month: 4,
1165
+ day: 21,
1166
+ metadata: meta("easter", "memorial", "white")
1167
+ },
1168
+ {
1169
+ key: "GEORGE",
1170
+ type: "const",
1171
+ category: "memorials",
1172
+ month: 4,
1173
+ day: 23,
1174
+ metadata: meta("easter", "memorial", "red")
1175
+ },
1176
+ {
1177
+ key: "ADALBERT",
1178
+ type: "const",
1179
+ category: "memorials",
1180
+ month: 4,
1181
+ day: 23,
1182
+ metadata: meta("easter", "memorial", "red")
1183
+ },
1184
+ {
1185
+ key: "FIDELIS",
1186
+ type: "const",
1187
+ category: "memorials",
1188
+ month: 4,
1189
+ day: 24,
1190
+ metadata: meta("easter", "memorial", "red")
1191
+ },
1192
+ {
1193
+ key: "LOUIS_GRIGNION",
1194
+ type: "const",
1195
+ category: "memorials",
1196
+ month: 4,
1197
+ day: 28,
1198
+ metadata: meta("easter", "memorial", "white")
1199
+ },
1200
+ {
1201
+ key: "PETER_CHANEL",
1202
+ type: "const",
1203
+ category: "memorials",
1204
+ month: 4,
1205
+ day: 28,
1206
+ metadata: meta("easter", "memorial", "red")
1207
+ },
1208
+ {
1209
+ key: "CATHERINE_OF_SIENA",
1210
+ type: "const",
1211
+ category: "memorials",
1212
+ month: 4,
1213
+ day: 29,
1214
+ metadata: meta("easter", "memorial", "white")
1215
+ },
1216
+ {
1217
+ key: "PIUS_V",
1218
+ type: "const",
1219
+ category: "memorials",
1220
+ month: 4,
1221
+ day: 30,
1222
+ metadata: meta("easter", "memorial", "white")
1223
+ },
1224
+ // ===== MAY =====
1225
+ {
1226
+ key: "JOSEPH_WORKER",
1227
+ type: "const",
1228
+ category: "memorials",
1229
+ month: 5,
1230
+ day: 1,
1231
+ metadata: meta("easter", "memorial", "white")
1232
+ },
1233
+ {
1234
+ key: "ATHANASIUS",
1235
+ type: "const",
1236
+ category: "memorials",
1237
+ month: 5,
1238
+ day: 2,
1239
+ metadata: meta("easter", "memorial", "white")
1240
+ },
1241
+ {
1242
+ key: "NEREUS_ACHILLEUS",
1243
+ type: "const",
1244
+ category: "memorials",
1245
+ month: 5,
1246
+ day: 12,
1247
+ metadata: meta("easter", "memorial", "red")
1248
+ },
1249
+ {
1250
+ key: "PANCRAS",
1251
+ type: "const",
1252
+ category: "memorials",
1253
+ month: 5,
1254
+ day: 12,
1255
+ metadata: meta("easter", "memorial", "red")
1256
+ },
1257
+ {
1258
+ key: "OUR_LADY_OF_FATIMA",
1259
+ type: "const",
1260
+ category: "memorials",
1261
+ month: 5,
1262
+ day: 13,
1263
+ metadata: meta("easter", "memorial", "white")
1264
+ },
1265
+ {
1266
+ key: "JOHN_I",
1267
+ type: "const",
1268
+ category: "memorials",
1269
+ month: 5,
1270
+ day: 18,
1271
+ metadata: meta("easter", "memorial", "red")
1272
+ },
1273
+ {
1274
+ key: "BERNARDINE",
1275
+ type: "const",
1276
+ category: "memorials",
1277
+ month: 5,
1278
+ day: 20,
1279
+ metadata: meta("easter", "memorial", "white")
1280
+ },
1281
+ {
1282
+ key: "PHILIP_NERI",
1283
+ type: "const",
1284
+ category: "memorials",
1285
+ month: 5,
1286
+ day: 26,
1287
+ metadata: meta("easter", "memorial", "white")
1288
+ },
1289
+ {
1290
+ key: "AUGUSTINE_OF_CANTERBURY",
1291
+ type: "const",
1292
+ category: "memorials",
1293
+ month: 5,
1294
+ day: 27,
1295
+ metadata: meta("easter", "memorial", "white")
1296
+ },
1297
+ // ===== JUNE =====
1298
+ {
1299
+ key: "JUSTIN",
1300
+ type: "const",
1301
+ category: "memorials",
1302
+ month: 6,
1303
+ day: 1,
1304
+ metadata: meta("ordinary-time-2", "memorial", "red")
1305
+ },
1306
+ {
1307
+ key: "MARCELLINUS_PETER",
1308
+ type: "const",
1309
+ category: "memorials",
1310
+ month: 6,
1311
+ day: 2,
1312
+ metadata: meta("ordinary-time-2", "memorial", "red")
1313
+ },
1314
+ {
1315
+ key: "CHARLES_LWANGA",
1316
+ type: "const",
1317
+ category: "memorials",
1318
+ month: 6,
1319
+ day: 3,
1320
+ metadata: meta("ordinary-time-2", "memorial", "red")
1321
+ },
1322
+ {
1323
+ key: "BONIFACE",
1324
+ type: "const",
1325
+ category: "memorials",
1326
+ month: 6,
1327
+ day: 5,
1328
+ metadata: meta("ordinary-time-2", "memorial", "red")
1329
+ },
1330
+ {
1331
+ key: "NORBERT",
1332
+ type: "const",
1333
+ category: "memorials",
1334
+ month: 6,
1335
+ day: 6,
1336
+ metadata: meta("ordinary-time-2", "memorial", "white")
1337
+ },
1338
+ {
1339
+ key: "EPHREM",
1340
+ type: "const",
1341
+ category: "memorials",
1342
+ month: 6,
1343
+ day: 9,
1344
+ metadata: meta("ordinary-time-2", "memorial", "white")
1345
+ },
1346
+ {
1347
+ key: "BARNABAS",
1348
+ type: "const",
1349
+ category: "memorials",
1350
+ month: 6,
1351
+ day: 11,
1352
+ metadata: meta("ordinary-time-2", "memorial", "red")
1353
+ },
1354
+ {
1355
+ key: "ROMUALD",
1356
+ type: "const",
1357
+ category: "memorials",
1358
+ month: 6,
1359
+ day: 19,
1360
+ metadata: meta("ordinary-time-2", "memorial", "white")
1361
+ },
1362
+ {
1363
+ key: "JOHN_FISHER_THOMAS_MORE",
1364
+ type: "const",
1365
+ category: "memorials",
1366
+ month: 6,
1367
+ day: 22,
1368
+ metadata: meta("ordinary-time-2", "memorial", "red")
1369
+ },
1370
+ {
1371
+ key: "FIRST_MARTYRS_OF_ROME",
1372
+ type: "const",
1373
+ category: "memorials",
1374
+ month: 6,
1375
+ day: 30,
1376
+ metadata: meta("ordinary-time-2", "memorial", "red")
1377
+ },
1378
+ // ===== JULY =====
1379
+ {
1380
+ key: "THOMAS_APOSTLE",
1381
+ type: "const",
1382
+ category: "feasts",
1383
+ month: 7,
1384
+ day: 3,
1385
+ metadata: meta("ordinary-time-2", "feast", "red")
1386
+ },
1387
+ {
1388
+ key: "ELIZABETH_OF_PORTUGAL",
1389
+ type: "const",
1390
+ category: "memorials",
1391
+ month: 7,
1392
+ day: 4,
1393
+ metadata: meta("ordinary-time-2", "memorial", "white")
1394
+ },
1395
+ {
1396
+ key: "MARIA_GORETTI",
1397
+ type: "const",
1398
+ category: "memorials",
1399
+ month: 7,
1400
+ day: 6,
1401
+ metadata: meta("ordinary-time-2", "memorial", "red")
1402
+ },
1403
+ {
1404
+ key: "AUGUSTINE_ZHAO",
1405
+ type: "const",
1406
+ category: "memorials",
1407
+ month: 7,
1408
+ day: 9,
1409
+ metadata: meta("ordinary-time-2", "memorial", "red")
1410
+ },
1411
+ {
1412
+ key: "BENEDICT",
1413
+ type: "const",
1414
+ category: "memorials",
1415
+ month: 7,
1416
+ day: 11,
1417
+ metadata: meta("ordinary-time-2", "memorial", "white")
1418
+ },
1419
+ {
1420
+ key: "HENRY",
1421
+ type: "const",
1422
+ category: "memorials",
1423
+ month: 7,
1424
+ day: 13,
1425
+ metadata: meta("ordinary-time-2", "memorial", "white")
1426
+ },
1427
+ {
1428
+ key: "CAMILLUS",
1429
+ type: "const",
1430
+ category: "memorials",
1431
+ month: 7,
1432
+ day: 14,
1433
+ metadata: meta("ordinary-time-2", "memorial", "white")
1434
+ },
1435
+ {
1436
+ key: "BONAVENTURE",
1437
+ type: "const",
1438
+ category: "memorials",
1439
+ month: 7,
1440
+ day: 15,
1441
+ metadata: meta("ordinary-time-2", "memorial", "white")
1442
+ },
1443
+ {
1444
+ key: "OUR_LADY_OF_MOUNT_CARMEL",
1445
+ type: "const",
1446
+ category: "memorials",
1447
+ month: 7,
1448
+ day: 16,
1449
+ metadata: meta("ordinary-time-2", "memorial", "white")
1450
+ },
1451
+ {
1452
+ key: "APOLLINARIS",
1453
+ type: "const",
1454
+ category: "memorials",
1455
+ month: 7,
1456
+ day: 20,
1457
+ metadata: meta("ordinary-time-2", "memorial", "red")
1458
+ },
1459
+ {
1460
+ key: "LAWRENCE_OF_BRINDISI",
1461
+ type: "const",
1462
+ category: "memorials",
1463
+ month: 7,
1464
+ day: 21,
1465
+ metadata: meta("ordinary-time-2", "memorial", "white")
1466
+ },
1467
+ {
1468
+ key: "MARY_MAGDALENE",
1469
+ type: "const",
1470
+ category: "feasts",
1471
+ month: 7,
1472
+ day: 22,
1473
+ metadata: meta("ordinary-time-2", "feast", "white")
1474
+ },
1475
+ {
1476
+ key: "BRIDGET",
1477
+ type: "const",
1478
+ category: "memorials",
1479
+ month: 7,
1480
+ day: 23,
1481
+ metadata: meta("ordinary-time-2", "memorial", "white")
1482
+ },
1483
+ {
1484
+ key: "SHARBEL",
1485
+ type: "const",
1486
+ category: "memorials",
1487
+ month: 7,
1488
+ day: 24,
1489
+ metadata: meta("ordinary-time-2", "memorial", "white")
1490
+ },
1491
+ {
1492
+ key: "JAMES_APOSTLE",
1493
+ type: "const",
1494
+ category: "feasts",
1495
+ month: 7,
1496
+ day: 25,
1497
+ metadata: meta("ordinary-time-2", "feast", "red")
1498
+ },
1499
+ {
1500
+ key: "MARTHA",
1501
+ type: "const",
1502
+ category: "memorials",
1503
+ month: 7,
1504
+ day: 29,
1505
+ metadata: meta("ordinary-time-2", "memorial", "white")
1506
+ },
1507
+ {
1508
+ key: "PETER_CHRYSOLOGUS",
1509
+ type: "const",
1510
+ category: "memorials",
1511
+ month: 7,
1512
+ day: 30,
1513
+ metadata: meta("ordinary-time-2", "memorial", "white")
1514
+ },
1515
+ {
1516
+ key: "IGNATIUS_OF_LOYOLA",
1517
+ type: "const",
1518
+ category: "memorials",
1519
+ month: 7,
1520
+ day: 31,
1521
+ metadata: meta("ordinary-time-2", "memorial", "white")
1522
+ },
1523
+ // ===== AUGUST =====
1524
+ {
1525
+ key: "ALPHONSUS",
1526
+ type: "const",
1527
+ category: "memorials",
1528
+ month: 8,
1529
+ day: 1,
1530
+ metadata: meta("ordinary-time-2", "memorial", "white")
1531
+ },
1532
+ {
1533
+ key: "JOHN_VIANNEY",
1534
+ type: "const",
1535
+ category: "memorials",
1536
+ month: 8,
1537
+ day: 4,
1538
+ metadata: meta("ordinary-time-2", "memorial", "white")
1539
+ },
1540
+ {
1541
+ key: "DEDICATION_MARY_MAJOR",
1542
+ type: "const",
1543
+ category: "memorials",
1544
+ month: 8,
1545
+ day: 5,
1546
+ metadata: meta("ordinary-time-2", "memorial", "white")
1547
+ },
1548
+ {
1549
+ key: "SIXTUS_II",
1550
+ type: "const",
1551
+ category: "memorials",
1552
+ month: 8,
1553
+ day: 7,
1554
+ metadata: meta("ordinary-time-2", "memorial", "red")
1555
+ },
1556
+ {
1557
+ key: "CAJETAN",
1558
+ type: "const",
1559
+ category: "memorials",
1560
+ month: 8,
1561
+ day: 7,
1562
+ metadata: meta("ordinary-time-2", "memorial", "white")
1563
+ },
1564
+ {
1565
+ key: "DOMINIC",
1566
+ type: "const",
1567
+ category: "memorials",
1568
+ month: 8,
1569
+ day: 8,
1570
+ metadata: meta("ordinary-time-2", "memorial", "white")
1571
+ },
1572
+ {
1573
+ key: "LAWRENCE",
1574
+ type: "const",
1575
+ category: "feasts",
1576
+ month: 8,
1577
+ day: 10,
1578
+ metadata: meta("ordinary-time-2", "feast", "red")
1579
+ },
1580
+ {
1581
+ key: "CLARE",
1582
+ type: "const",
1583
+ category: "memorials",
1584
+ month: 8,
1585
+ day: 11,
1586
+ metadata: meta("ordinary-time-2", "memorial", "white")
1587
+ },
1588
+ {
1589
+ key: "JANE_FRANCES",
1590
+ type: "const",
1591
+ category: "memorials",
1592
+ month: 8,
1593
+ day: 12,
1594
+ metadata: meta("ordinary-time-2", "memorial", "white")
1595
+ },
1596
+ {
1597
+ key: "PONTIAN_HIPPOLYTUS",
1598
+ type: "const",
1599
+ category: "memorials",
1600
+ month: 8,
1601
+ day: 13,
1602
+ metadata: meta("ordinary-time-2", "memorial", "red")
1603
+ },
1604
+ {
1605
+ key: "MAXIMILIAN_KOLBE",
1606
+ type: "const",
1607
+ category: "memorials",
1608
+ month: 8,
1609
+ day: 14,
1610
+ metadata: meta("ordinary-time-2", "memorial", "red")
1611
+ },
1612
+ {
1613
+ key: "JOHN_EUDES",
1614
+ type: "const",
1615
+ category: "memorials",
1616
+ month: 8,
1617
+ day: 19,
1618
+ metadata: meta("ordinary-time-2", "memorial", "white")
1619
+ },
1620
+ {
1621
+ key: "BERNARD",
1622
+ type: "const",
1623
+ category: "memorials",
1624
+ month: 8,
1625
+ day: 20,
1626
+ metadata: meta("ordinary-time-2", "memorial", "white")
1627
+ },
1628
+ {
1629
+ key: "PIUS_X",
1630
+ type: "const",
1631
+ category: "memorials",
1632
+ month: 8,
1633
+ day: 21,
1634
+ metadata: meta("ordinary-time-2", "memorial", "white")
1635
+ },
1636
+ {
1637
+ key: "QUEENSHIP_OF_MARY",
1638
+ type: "const",
1639
+ category: "memorials",
1640
+ month: 8,
1641
+ day: 22,
1642
+ metadata: meta("ordinary-time-2", "memorial", "white")
1643
+ },
1644
+ {
1645
+ key: "BARTHOLOMEW",
1646
+ type: "const",
1647
+ category: "feasts",
1648
+ month: 8,
1649
+ day: 24,
1650
+ metadata: meta("ordinary-time-2", "feast", "red")
1651
+ },
1652
+ {
1653
+ key: "LOUIS_IX",
1654
+ type: "const",
1655
+ category: "memorials",
1656
+ month: 8,
1657
+ day: 25,
1658
+ metadata: meta("ordinary-time-2", "memorial", "white")
1659
+ },
1660
+ {
1661
+ key: "JOSEPH_CALASANZ",
1662
+ type: "const",
1663
+ category: "memorials",
1664
+ month: 8,
1665
+ day: 25,
1666
+ metadata: meta("ordinary-time-2", "memorial", "white")
1667
+ },
1668
+ {
1669
+ key: "MONICA",
1670
+ type: "const",
1671
+ category: "memorials",
1672
+ month: 8,
1673
+ day: 27,
1674
+ metadata: meta("ordinary-time-2", "memorial", "white")
1675
+ },
1676
+ {
1677
+ key: "AUGUSTINE",
1678
+ type: "const",
1679
+ category: "memorials",
1680
+ month: 8,
1681
+ day: 28,
1682
+ metadata: meta("ordinary-time-2", "memorial", "white")
1683
+ },
1684
+ {
1685
+ key: "PASSION_OF_JOHN_BAPTIST",
1686
+ type: "const",
1687
+ category: "memorials",
1688
+ month: 8,
1689
+ day: 29,
1690
+ metadata: meta("ordinary-time-2", "memorial", "red")
1691
+ },
1692
+ // ===== SEPTEMBER =====
1693
+ {
1694
+ key: "GREGORY_THE_GREAT",
1695
+ type: "const",
1696
+ category: "memorials",
1697
+ month: 9,
1698
+ day: 3,
1699
+ metadata: meta("ordinary-time-2", "memorial", "white")
1700
+ },
1701
+ {
1702
+ key: "BIRTH_OF_MARY",
1703
+ type: "const",
1704
+ category: "feasts",
1705
+ month: 9,
1706
+ day: 8,
1707
+ metadata: meta("ordinary-time-2", "feast", "white")
1708
+ },
1709
+ {
1710
+ key: "PETER_CLAVER",
1711
+ type: "const",
1712
+ category: "memorials",
1713
+ month: 9,
1714
+ day: 9,
1715
+ metadata: meta("ordinary-time-2", "memorial", "white")
1716
+ },
1717
+ {
1718
+ key: "MOST_HOLY_NAME_OF_MARY",
1719
+ type: "const",
1720
+ category: "memorials",
1721
+ month: 9,
1722
+ day: 12,
1723
+ metadata: meta("ordinary-time-2", "memorial", "white")
1724
+ },
1725
+ {
1726
+ key: "OUR_LADY_OF_SORROWS",
1727
+ type: "const",
1728
+ category: "memorials",
1729
+ month: 9,
1730
+ day: 15,
1731
+ metadata: meta("ordinary-time-2", "memorial", "white")
1732
+ },
1733
+ {
1734
+ key: "CORNELIUS_CYPRIAN",
1735
+ type: "const",
1736
+ category: "memorials",
1737
+ month: 9,
1738
+ day: 16,
1739
+ metadata: meta("ordinary-time-2", "memorial", "red")
1740
+ },
1741
+ {
1742
+ key: "ROBERT_BELLARMINE",
1743
+ type: "const",
1744
+ category: "memorials",
1745
+ month: 9,
1746
+ day: 17,
1747
+ metadata: meta("ordinary-time-2", "memorial", "white")
1748
+ },
1749
+ {
1750
+ key: "JANUARIUS",
1751
+ type: "const",
1752
+ category: "memorials",
1753
+ month: 9,
1754
+ day: 19,
1755
+ metadata: meta("ordinary-time-2", "memorial", "red")
1756
+ },
1757
+ {
1758
+ key: "MATTHEW",
1759
+ type: "const",
1760
+ category: "feasts",
1761
+ month: 9,
1762
+ day: 21,
1763
+ metadata: meta("ordinary-time-2", "feast", "red")
1764
+ },
1765
+ {
1766
+ key: "PADRE_PIO",
1767
+ type: "const",
1768
+ category: "memorials",
1769
+ month: 9,
1770
+ day: 23,
1771
+ metadata: meta("ordinary-time-2", "memorial", "white")
1772
+ },
1773
+ {
1774
+ key: "COSMAS_DAMIAN",
1775
+ type: "const",
1776
+ category: "memorials",
1777
+ month: 9,
1778
+ day: 26,
1779
+ metadata: meta("ordinary-time-2", "memorial", "red")
1780
+ },
1781
+ {
1782
+ key: "WENCESLAUS",
1783
+ type: "const",
1784
+ category: "memorials",
1785
+ month: 9,
1786
+ day: 28,
1787
+ metadata: meta("ordinary-time-2", "memorial", "red")
1788
+ },
1789
+ {
1790
+ key: "LAWRENCE_RUIZ",
1791
+ type: "const",
1792
+ category: "memorials",
1793
+ month: 9,
1794
+ day: 28,
1795
+ metadata: meta("ordinary-time-2", "memorial", "red")
1796
+ },
1797
+ {
1798
+ key: "ARCHANGELS",
1799
+ type: "const",
1800
+ category: "feasts",
1801
+ month: 9,
1802
+ day: 29,
1803
+ metadata: meta("ordinary-time-2", "feast", "white")
1804
+ },
1805
+ {
1806
+ key: "JEROME",
1807
+ type: "const",
1808
+ category: "memorials",
1809
+ month: 9,
1810
+ day: 30,
1811
+ metadata: meta("ordinary-time-2", "memorial", "white")
1812
+ },
1813
+ // ===== OCTOBER =====
1814
+ {
1815
+ key: "THERESE_OF_LISIEUX",
1816
+ type: "const",
1817
+ category: "memorials",
1818
+ month: 10,
1819
+ day: 1,
1820
+ metadata: meta("ordinary-time-2", "memorial", "white")
1821
+ },
1822
+ {
1823
+ key: "GUARDIAN_ANGELS",
1824
+ type: "const",
1825
+ category: "memorials",
1826
+ month: 10,
1827
+ day: 2,
1828
+ metadata: meta("ordinary-time-2", "memorial", "white")
1829
+ },
1830
+ {
1831
+ key: "FRANCIS_OF_ASSISI",
1832
+ type: "const",
1833
+ category: "memorials",
1834
+ month: 10,
1835
+ day: 4,
1836
+ metadata: meta("ordinary-time-2", "memorial", "white")
1837
+ },
1838
+ {
1839
+ key: "FAUSTINA",
1840
+ type: "const",
1841
+ category: "memorials",
1842
+ month: 10,
1843
+ day: 5,
1844
+ metadata: meta("ordinary-time-2", "memorial", "white")
1845
+ },
1846
+ {
1847
+ key: "BRUNO",
1848
+ type: "const",
1849
+ category: "memorials",
1850
+ month: 10,
1851
+ day: 6,
1852
+ metadata: meta("ordinary-time-2", "memorial", "white")
1853
+ },
1854
+ {
1855
+ key: "OUR_LADY_OF_ROSARY",
1856
+ type: "const",
1857
+ category: "memorials",
1858
+ month: 10,
1859
+ day: 7,
1860
+ metadata: meta("ordinary-time-2", "memorial", "white")
1861
+ },
1862
+ {
1863
+ key: "DENIS",
1864
+ type: "const",
1865
+ category: "memorials",
1866
+ month: 10,
1867
+ day: 9,
1868
+ metadata: meta("ordinary-time-2", "memorial", "red")
1869
+ },
1870
+ {
1871
+ key: "CALLISTUS_I",
1872
+ type: "const",
1873
+ category: "memorials",
1874
+ month: 10,
1875
+ day: 14,
1876
+ metadata: meta("ordinary-time-2", "memorial", "red")
1877
+ },
1878
+ {
1879
+ key: "TERESA_OF_AVILA",
1880
+ type: "const",
1881
+ category: "memorials",
1882
+ month: 10,
1883
+ day: 15,
1884
+ metadata: meta("ordinary-time-2", "memorial", "white")
1885
+ },
1886
+ {
1887
+ key: "HEDWIG",
1888
+ type: "const",
1889
+ category: "memorials",
1890
+ month: 10,
1891
+ day: 16,
1892
+ metadata: meta("ordinary-time-2", "memorial", "white")
1893
+ },
1894
+ {
1895
+ key: "MARGARET_MARY",
1896
+ type: "const",
1897
+ category: "memorials",
1898
+ month: 10,
1899
+ day: 16,
1900
+ metadata: meta("ordinary-time-2", "memorial", "white")
1901
+ },
1902
+ {
1903
+ key: "IGNATIUS_OF_ANTIOCH",
1904
+ type: "const",
1905
+ category: "memorials",
1906
+ month: 10,
1907
+ day: 17,
1908
+ metadata: meta("ordinary-time-2", "memorial", "red")
1909
+ },
1910
+ {
1911
+ key: "LUKE",
1912
+ type: "const",
1913
+ category: "feasts",
1914
+ month: 10,
1915
+ day: 18,
1916
+ metadata: meta("ordinary-time-2", "feast", "red")
1917
+ },
1918
+ {
1919
+ key: "ISAAC_JOGUES",
1920
+ type: "const",
1921
+ category: "memorials",
1922
+ month: 10,
1923
+ day: 19,
1924
+ metadata: meta("ordinary-time-2", "memorial", "red")
1925
+ },
1926
+ {
1927
+ key: "PAUL_OF_CROSS",
1928
+ type: "const",
1929
+ category: "memorials",
1930
+ month: 10,
1931
+ day: 19,
1932
+ metadata: meta("ordinary-time-2", "memorial", "white")
1933
+ },
1934
+ {
1935
+ key: "JOHN_PAUL_II",
1936
+ type: "const",
1937
+ category: "memorials",
1938
+ month: 10,
1939
+ day: 22,
1940
+ metadata: meta("ordinary-time-2", "memorial", "white")
1941
+ },
1942
+ {
1943
+ key: "JOHN_OF_CAPISTRANO",
1944
+ type: "const",
1945
+ category: "memorials",
1946
+ month: 10,
1947
+ day: 23,
1948
+ metadata: meta("ordinary-time-2", "memorial", "white")
1949
+ },
1950
+ {
1951
+ key: "ANTHONY_MARY_CLARET",
1952
+ type: "const",
1953
+ category: "memorials",
1954
+ month: 10,
1955
+ day: 24,
1956
+ metadata: meta("ordinary-time-2", "memorial", "white")
1957
+ },
1958
+ {
1959
+ key: "SIMON_JUDE",
1960
+ type: "const",
1961
+ category: "feasts",
1962
+ month: 10,
1963
+ day: 28,
1964
+ metadata: meta("ordinary-time-2", "feast", "red")
1965
+ },
1966
+ // ===== NOVEMBER =====
1967
+ {
1968
+ key: "DEDICATION_LATERAN",
1969
+ type: "const",
1970
+ category: "feasts",
1971
+ month: 11,
1972
+ day: 9,
1973
+ metadata: meta("ordinary-time-2", "feast", "white")
1974
+ },
1975
+ {
1976
+ key: "LEO_THE_GREAT",
1977
+ type: "const",
1978
+ category: "memorials",
1979
+ month: 11,
1980
+ day: 10,
1981
+ metadata: meta("ordinary-time-2", "memorial", "white")
1982
+ },
1983
+ {
1984
+ key: "MARTIN_OF_TOURS",
1985
+ type: "const",
1986
+ category: "memorials",
1987
+ month: 11,
1988
+ day: 11,
1989
+ metadata: meta("ordinary-time-2", "memorial", "white")
1990
+ },
1991
+ {
1992
+ key: "JOSAPHAT",
1993
+ type: "const",
1994
+ category: "memorials",
1995
+ month: 11,
1996
+ day: 12,
1997
+ metadata: meta("ordinary-time-2", "memorial", "red")
1998
+ },
1999
+ {
2000
+ key: "MARGARET_OF_SCOTLAND",
2001
+ type: "const",
2002
+ category: "memorials",
2003
+ month: 11,
2004
+ day: 16,
2005
+ metadata: meta("ordinary-time-2", "memorial", "white")
2006
+ },
2007
+ {
2008
+ key: "GERTRUDE",
2009
+ type: "const",
2010
+ category: "memorials",
2011
+ month: 11,
2012
+ day: 16,
2013
+ metadata: meta("ordinary-time-2", "memorial", "white")
2014
+ },
2015
+ {
2016
+ key: "ELIZABETH_OF_HUNGARY",
2017
+ type: "const",
2018
+ category: "memorials",
2019
+ month: 11,
2020
+ day: 17,
2021
+ metadata: meta("ordinary-time-2", "memorial", "white")
2022
+ },
2023
+ {
2024
+ key: "DEDICATION_PETER_PAUL",
2025
+ type: "const",
2026
+ category: "memorials",
2027
+ month: 11,
2028
+ day: 18,
2029
+ metadata: meta("ordinary-time-2", "memorial", "white")
2030
+ },
2031
+ {
2032
+ key: "PRESENTATION_OF_MARY",
2033
+ type: "const",
2034
+ category: "memorials",
2035
+ month: 11,
2036
+ day: 21,
2037
+ metadata: meta("ordinary-time-2", "memorial", "white")
2038
+ },
2039
+ {
2040
+ key: "CLEMENT_I",
2041
+ type: "const",
2042
+ category: "memorials",
2043
+ month: 11,
2044
+ day: 23,
2045
+ metadata: meta("ordinary-time-2", "memorial", "red")
2046
+ },
2047
+ {
2048
+ key: "COLUMBAN",
2049
+ type: "const",
2050
+ category: "memorials",
2051
+ month: 11,
2052
+ day: 23,
2053
+ metadata: meta("ordinary-time-2", "memorial", "white")
2054
+ },
2055
+ {
2056
+ key: "CATHERINE_OF_ALEXANDRIA",
2057
+ type: "const",
2058
+ category: "memorials",
2059
+ month: 11,
2060
+ day: 25,
2061
+ metadata: meta("ordinary-time-2", "memorial", "red")
2062
+ },
2063
+ {
2064
+ key: "ANDREW_APOSTLE",
2065
+ type: "const",
2066
+ category: "feasts",
2067
+ month: 11,
2068
+ day: 30,
2069
+ metadata: meta("advent", "feast", "red")
2070
+ },
2071
+ // ===== DECEMBER =====
2072
+ {
2073
+ key: "FRANCIS_XAVIER",
2074
+ type: "const",
2075
+ category: "memorials",
2076
+ month: 12,
2077
+ day: 3,
2078
+ metadata: meta("advent", "memorial", "white")
2079
+ },
2080
+ {
2081
+ key: "LUCY",
2082
+ type: "const",
2083
+ category: "memorials",
2084
+ month: 12,
2085
+ day: 13,
2086
+ metadata: meta("advent", "memorial", "red")
2087
+ },
2088
+ {
2089
+ key: "STEPHEN_FIRST_MARTYR",
2090
+ type: "const",
2091
+ category: "feasts",
2092
+ month: 12,
2093
+ day: 26,
2094
+ metadata: meta("christmas", "feast", "red")
2095
+ },
2096
+ {
2097
+ key: "JOHN_APOSTLE",
2098
+ type: "const",
2099
+ category: "feasts",
2100
+ month: 12,
2101
+ day: 27,
2102
+ metadata: meta("christmas", "feast", "white")
2103
+ }
2104
+ ];
2105
+ var ALL_LITURGICAL_EVENTS = [
2106
+ ...EASTER_CYCLE_EVENTS,
2107
+ ...FIXED_SOLEMNITY_EVENTS,
2108
+ ...COMPUTED_EVENTS,
2109
+ ...MEMORIAL_SAINT_EVENTS
2110
+ ];
2111
+ function getEventsByCategory(categories) {
2112
+ return ALL_LITURGICAL_EVENTS.filter((e) => categories.includes(e.category));
2113
+ }
2114
+
2115
+ // src/presets.ts
2116
+ var EASTER = {
2117
+ type: "easter",
2118
+ id: "easter-sunday",
2119
+ title: "Easter Sunday",
2120
+ categories: ["easter-cycle", "solemnities"],
2121
+ priority: 1,
2122
+ metadata: {
2123
+ season: "easter",
2124
+ rank: "solemnity",
2125
+ vestmentColor: "white"
2126
+ }
2127
+ };
2128
+ var ASH_WEDNESDAY = {
2129
+ type: "offset",
2130
+ id: "ash-wednesday",
2131
+ title: "Ash Wednesday",
2132
+ baseEvent: "easter",
2133
+ offsetDays: -46,
2134
+ categories: ["easter-cycle", "solemnities"],
2135
+ metadata: {
2136
+ season: "lent",
2137
+ rank: "solemnity",
2138
+ vestmentColor: "violet"
2139
+ }
2140
+ };
2141
+ var PALM_SUNDAY = {
2142
+ type: "offset",
2143
+ id: "palm-sunday",
2144
+ title: "Palm Sunday",
2145
+ baseEvent: "easter",
2146
+ offsetDays: -7,
2147
+ categories: ["easter-cycle", "solemnities"],
2148
+ metadata: {
2149
+ season: "lent",
2150
+ rank: "solemnity",
2151
+ vestmentColor: "red"
2152
+ }
2153
+ };
2154
+ var HOLY_THURSDAY = {
2155
+ type: "offset",
2156
+ id: "holy-thursday",
2157
+ title: "Holy Thursday",
2158
+ baseEvent: "easter",
2159
+ offsetDays: -3,
2160
+ categories: ["easter-cycle", "solemnities"],
2161
+ metadata: {
2162
+ season: "lent",
2163
+ rank: "solemnity",
2164
+ vestmentColor: "white"
2165
+ }
2166
+ };
2167
+ var GOOD_FRIDAY = {
2168
+ type: "offset",
2169
+ id: "good-friday",
2170
+ title: "Good Friday",
2171
+ baseEvent: "easter",
2172
+ offsetDays: -2,
2173
+ categories: ["easter-cycle", "solemnities"],
2174
+ metadata: {
2175
+ season: "lent",
2176
+ rank: "solemnity",
2177
+ vestmentColor: "red"
2178
+ }
2179
+ };
2180
+ var HOLY_SATURDAY = {
2181
+ type: "offset",
2182
+ id: "holy-saturday",
2183
+ title: "Holy Saturday",
2184
+ baseEvent: "easter",
2185
+ offsetDays: -1,
2186
+ categories: ["easter-cycle", "solemnities"],
2187
+ metadata: {
2188
+ season: "lent",
2189
+ rank: "solemnity",
2190
+ vestmentColor: "white"
2191
+ }
2192
+ };
2193
+ var ASCENSION = {
2194
+ type: "offset",
2195
+ id: "ascension",
2196
+ title: "Ascension",
2197
+ baseEvent: "easter",
2198
+ offsetDays: 39,
2199
+ categories: ["easter-cycle", "solemnities"],
2200
+ metadata: {
2201
+ season: "easter",
2202
+ rank: "solemnity",
2203
+ vestmentColor: "white"
2204
+ }
2205
+ };
2206
+ var PENTECOST = {
2207
+ type: "offset",
2208
+ id: "pentecost",
2209
+ title: "Pentecost",
2210
+ baseEvent: "easter",
2211
+ offsetDays: 49,
2212
+ categories: ["easter-cycle", "solemnities"],
2213
+ metadata: {
2214
+ season: "easter",
2215
+ rank: "solemnity",
2216
+ vestmentColor: "red"
2217
+ }
2218
+ };
2219
+ var TRINITY_SUNDAY = {
2220
+ type: "offset",
2221
+ id: "trinity-sunday",
2222
+ title: "Trinity Sunday",
2223
+ baseEvent: "easter",
2224
+ offsetDays: 56,
2225
+ categories: ["easter-cycle", "solemnities"],
2226
+ metadata: {
2227
+ season: "ordinary-time-2",
2228
+ rank: "solemnity",
2229
+ vestmentColor: "white"
2230
+ }
2231
+ };
2232
+ var CORPUS_CHRISTI = {
2233
+ type: "offset",
2234
+ id: "corpus-christi",
2235
+ title: "Corpus Christi",
2236
+ baseEvent: "easter",
2237
+ offsetDays: 60,
2238
+ categories: ["easter-cycle", "solemnities"],
2239
+ metadata: {
2240
+ season: "ordinary-time-2",
2241
+ rank: "solemnity",
2242
+ vestmentColor: "white"
2243
+ }
2244
+ };
2245
+ var LITURGICAL_EVENTS = [
2246
+ EASTER,
2247
+ ASH_WEDNESDAY,
2248
+ PALM_SUNDAY,
2249
+ HOLY_THURSDAY,
2250
+ GOOD_FRIDAY,
2251
+ HOLY_SATURDAY,
2252
+ ASCENSION,
2253
+ PENTECOST,
2254
+ TRINITY_SUNDAY,
2255
+ CORPUS_CHRISTI
2256
+ ];
2257
+ var SEASON_VESTMENT_COLORS = {
2258
+ advent: "violet",
2259
+ christmas: "white",
2260
+ "ordinary-time-1": "green",
2261
+ lent: "violet",
2262
+ easter: "white",
2263
+ "ordinary-time-2": "green"
2264
+ };
2265
+ function getSeason(date, options = {}) {
2266
+ const { epiphanyOnSunday = false } = options;
2267
+ const d = typeof date === "string" ? calendaryjs.parseDate(date) : date;
2268
+ const liturgicalYear = getLiturgicalYear(d);
2269
+ const day = getLiturgicalDay(d, { epiphanyOnSunday });
2270
+ return {
2271
+ season: day.season,
2272
+ vestmentColor: SEASON_VESTMENT_COLORS[day.season],
2273
+ week: day.week,
2274
+ liturgicalYear
2275
+ };
2276
+ }
2277
+ function getCurrentSeason(options = {}) {
2278
+ return getSeason(/* @__PURE__ */ new Date(), options);
2279
+ }
2280
+ function getLiturgicalYearChart(liturgicalYear, options = {}) {
2281
+ const { epiphanyOnSunday = false } = options;
2282
+ const boundaries = getLiturgicalYearBoundaries(liturgicalYear, epiphanyOnSunday);
2283
+ const nextBoundaries = getLiturgicalYearBoundaries(liturgicalYear + 1, epiphanyOnSunday);
2284
+ const startDate = boundaries.advent1;
2285
+ const endDate = new Date(nextBoundaries.advent1);
2286
+ endDate.setDate(endDate.getDate() - 1);
2287
+ const totalDays = Math.round((endDate.getTime() - startDate.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
2288
+ const holySaturday = new Date(boundaries.easter);
2289
+ holySaturday.setDate(holySaturday.getDate() - 1);
2290
+ const beforeAshWednesday = new Date(boundaries.ashWednesday);
2291
+ beforeAshWednesday.setDate(beforeAshWednesday.getDate() - 1);
2292
+ const beforeNextAdvent = new Date(nextBoundaries.advent1);
2293
+ beforeNextAdvent.setDate(beforeNextAdvent.getDate() - 1);
2294
+ const seasonBoundaries = [
2295
+ {
2296
+ season: "advent",
2297
+ start: boundaries.advent1,
2298
+ end: new Date(boundaries.christmas.getTime() - 24 * 60 * 60 * 1e3)
2299
+ // Dec 24
2300
+ },
2301
+ {
2302
+ season: "christmas",
2303
+ start: boundaries.christmas,
2304
+ end: boundaries.baptismOfLord
2305
+ },
2306
+ {
2307
+ season: "ordinary-time-1",
2308
+ start: new Date(boundaries.baptismOfLord.getTime() + 24 * 60 * 60 * 1e3),
2309
+ // Day after Baptism
2310
+ end: beforeAshWednesday
2311
+ },
2312
+ {
2313
+ season: "lent",
2314
+ start: boundaries.ashWednesday,
2315
+ end: holySaturday
2316
+ },
2317
+ {
2318
+ season: "easter",
2319
+ start: boundaries.easter,
2320
+ end: boundaries.pentecost
2321
+ },
2322
+ {
2323
+ season: "ordinary-time-2",
2324
+ start: new Date(boundaries.pentecost.getTime() + 24 * 60 * 60 * 1e3),
2325
+ // Day after Pentecost
2326
+ end: beforeNextAdvent
2327
+ }
2328
+ ];
2329
+ let cumulativeDays = 0;
2330
+ const segments = seasonBoundaries.map(({ season, start, end }) => {
2331
+ const days = Math.round((end.getTime() - start.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
2332
+ const percentage = days / totalDays * 100;
2333
+ const startAngle = cumulativeDays / totalDays * 360;
2334
+ const endAngle = (cumulativeDays + days) / totalDays * 360;
2335
+ cumulativeDays += days;
2336
+ return {
2337
+ season,
2338
+ vestmentColor: SEASON_VESTMENT_COLORS[season],
2339
+ startDate: calendaryjs.formatDate(start),
2340
+ endDate: calendaryjs.formatDate(end),
2341
+ days,
2342
+ startAngle,
2343
+ endAngle,
2344
+ percentage
2345
+ };
2346
+ });
2347
+ return {
2348
+ liturgicalYear,
2349
+ calendarYearStart: liturgicalYear - 1,
2350
+ calendarYearEnd: liturgicalYear,
2351
+ startDate: calendaryjs.formatDate(startDate),
2352
+ endDate: calendaryjs.formatDate(endDate),
2353
+ totalDays,
2354
+ segments
2355
+ };
2356
+ }
2357
+ function getCalendarYearSeasons(calendarYear, options = {}) {
2358
+ const { epiphanyOnSunday = false } = options;
2359
+ const startDate = new Date(calendarYear, 0, 1);
2360
+ const endDate = new Date(calendarYear, 11, 31);
2361
+ const totalDays = 365 + (isLeapYear(calendarYear) ? 1 : 0);
2362
+ const segments = [];
2363
+ const currentDate = new Date(startDate);
2364
+ let currentSeason = null;
2365
+ let segmentStart = null;
2366
+ let cumulativeDays = 0;
2367
+ while (currentDate <= endDate) {
2368
+ const day = getLiturgicalDay(currentDate, { epiphanyOnSunday });
2369
+ if (day.season !== currentSeason) {
2370
+ if (currentSeason !== null && segmentStart !== null) {
2371
+ const prevEnd = new Date(currentDate);
2372
+ prevEnd.setDate(prevEnd.getDate() - 1);
2373
+ const days = Math.round((prevEnd.getTime() - segmentStart.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
2374
+ const percentage = days / totalDays * 100;
2375
+ const startAngle = cumulativeDays / totalDays * 360;
2376
+ cumulativeDays += days;
2377
+ const endAngle = cumulativeDays / totalDays * 360;
2378
+ segments.push({
2379
+ season: currentSeason,
2380
+ vestmentColor: SEASON_VESTMENT_COLORS[currentSeason],
2381
+ startDate: calendaryjs.formatDate(segmentStart),
2382
+ endDate: calendaryjs.formatDate(prevEnd),
2383
+ days,
2384
+ startAngle,
2385
+ endAngle,
2386
+ percentage
2387
+ });
2388
+ }
2389
+ currentSeason = day.season;
2390
+ segmentStart = new Date(currentDate);
2391
+ }
2392
+ currentDate.setDate(currentDate.getDate() + 1);
2393
+ }
2394
+ if (currentSeason !== null && segmentStart !== null) {
2395
+ const days = Math.round((endDate.getTime() - segmentStart.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
2396
+ const percentage = days / totalDays * 100;
2397
+ const startAngle = cumulativeDays / totalDays * 360;
2398
+ const endAngle = 360;
2399
+ segments.push({
2400
+ season: currentSeason,
2401
+ vestmentColor: SEASON_VESTMENT_COLORS[currentSeason],
2402
+ startDate: calendaryjs.formatDate(segmentStart),
2403
+ endDate: calendaryjs.formatDate(endDate),
2404
+ days,
2405
+ startAngle,
2406
+ endAngle,
2407
+ percentage
2408
+ });
2409
+ }
2410
+ return segments;
2411
+ }
2412
+ function isLeapYear(year) {
2413
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
2414
+ }
2415
+
2416
+ // src/utils/texts.ts
2417
+ var DEFAULT_LITURGICAL_TEXTS = {
2418
+ // Easter Cycle
2419
+ EASTER_SUNDAY: {
2420
+ title: "Easter Sunday",
2421
+ keywords: ["easter", "resurrection", "paschal"]
2422
+ },
2423
+ ASH_WEDNESDAY: {
2424
+ title: "Ash Wednesday",
2425
+ keywords: ["ash", "lent", "fasting"]
2426
+ },
2427
+ PALM_SUNDAY: {
2428
+ title: "Palm Sunday",
2429
+ keywords: ["palm", "passion", "holy week"]
2430
+ },
2431
+ HOLY_THURSDAY: {
2432
+ title: "Holy Thursday",
2433
+ keywords: ["maundy", "last supper", "holy week"]
2434
+ },
2435
+ GOOD_FRIDAY: {
2436
+ title: "Good Friday",
2437
+ keywords: ["crucifixion", "passion", "holy week"]
2438
+ },
2439
+ HOLY_SATURDAY: {
2440
+ title: "Holy Saturday",
2441
+ keywords: ["vigil", "holy week"]
2442
+ },
2443
+ DIVINE_MERCY_SUNDAY: {
2444
+ title: "Divine Mercy Sunday",
2445
+ keywords: ["divine mercy", "octave of easter"]
2446
+ },
2447
+ ASCENSION: {
2448
+ title: "Ascension",
2449
+ keywords: ["ascension", "heaven"]
2450
+ },
2451
+ PENTECOST: {
2452
+ title: "Pentecost",
2453
+ keywords: ["pentecost", "holy spirit", "tongues of fire"]
2454
+ },
2455
+ TRINITY_SUNDAY: {
2456
+ title: "Trinity Sunday",
2457
+ keywords: ["trinity", "father son spirit"]
2458
+ },
2459
+ CORPUS_CHRISTI: {
2460
+ title: "Corpus Christi",
2461
+ keywords: ["corpus christi", "body of christ", "eucharist"]
2462
+ },
2463
+ SACRED_HEART: {
2464
+ title: "Sacred Heart of Jesus",
2465
+ keywords: ["sacred heart", "heart of jesus"]
2466
+ },
2467
+ IMMACULATE_HEART: {
2468
+ title: "Immaculate Heart of Mary",
2469
+ keywords: ["immaculate heart", "heart of mary"]
2470
+ },
2471
+ // Fixed Solemnities
2472
+ MARY_MOTHER_OF_GOD: {
2473
+ title: "Mary, Mother of God",
2474
+ keywords: ["mary", "mother of god", "theotokos"]
2475
+ },
2476
+ EPIPHANY: {
2477
+ title: "Epiphany",
2478
+ keywords: ["epiphany", "magi", "three kings"]
2479
+ },
2480
+ PRESENTATION: {
2481
+ title: "Presentation of the Lord",
2482
+ keywords: ["presentation", "candlemas", "simeon"]
2483
+ },
2484
+ SAINT_JOSEPH: {
2485
+ title: "Saint Joseph",
2486
+ keywords: ["joseph", "foster father"]
2487
+ },
2488
+ ANNUNCIATION: {
2489
+ title: "Annunciation",
2490
+ keywords: ["annunciation", "gabriel", "mary"]
2491
+ },
2492
+ NATIVITY_OF_JOHN_BAPTIST: {
2493
+ title: "Nativity of John the Baptist",
2494
+ keywords: ["john baptist", "birth"]
2495
+ },
2496
+ PETER_AND_PAUL: {
2497
+ title: "Saints Peter and Paul",
2498
+ keywords: ["peter", "paul", "apostles"]
2499
+ },
2500
+ TRANSFIGURATION: {
2501
+ title: "Transfiguration",
2502
+ keywords: ["transfiguration", "mount tabor"]
2503
+ },
2504
+ ASSUMPTION: {
2505
+ title: "Assumption of Mary",
2506
+ keywords: ["assumption", "mary", "heaven"]
2507
+ },
2508
+ EXALTATION_OF_CROSS: {
2509
+ title: "Exaltation of the Holy Cross",
2510
+ keywords: ["cross", "exaltation", "holy cross"]
2511
+ },
2512
+ ALL_SAINTS: {
2513
+ title: "All Saints",
2514
+ keywords: ["all saints", "saints"]
2515
+ },
2516
+ ALL_SOULS: {
2517
+ title: "All Souls",
2518
+ keywords: ["all souls", "faithful departed", "dead"]
2519
+ },
2520
+ IMMACULATE_CONCEPTION: {
2521
+ title: "Immaculate Conception",
2522
+ keywords: ["immaculate conception", "mary"]
2523
+ },
2524
+ CHRISTMAS: {
2525
+ title: "Christmas",
2526
+ keywords: ["christmas", "nativity", "birth of christ"]
2527
+ },
2528
+ HOLY_INNOCENTS: {
2529
+ title: "Holy Innocents",
2530
+ keywords: ["holy innocents", "martyrs", "herod"]
2531
+ },
2532
+ HOLY_FAMILY: {
2533
+ title: "Holy Family",
2534
+ keywords: ["holy family", "jesus mary joseph"]
2535
+ },
2536
+ // Computed
2537
+ ADVENT_1: {
2538
+ title: "First Sunday of Advent",
2539
+ keywords: ["advent", "first sunday"]
2540
+ },
2541
+ ADVENT_2: {
2542
+ title: "Second Sunday of Advent",
2543
+ keywords: ["advent", "second sunday"]
2544
+ },
2545
+ ADVENT_3: {
2546
+ title: "Third Sunday of Advent",
2547
+ keywords: ["advent", "third sunday", "gaudete"]
2548
+ },
2549
+ ADVENT_4: {
2550
+ title: "Fourth Sunday of Advent",
2551
+ keywords: ["advent", "fourth sunday"]
2552
+ },
2553
+ BAPTISM_OF_LORD: {
2554
+ title: "Baptism of the Lord",
2555
+ keywords: ["baptism", "jordan", "epiphany"]
2556
+ },
2557
+ CHRIST_THE_KING: {
2558
+ title: "Christ the King",
2559
+ keywords: ["christ the king", "king", "reign"]
2560
+ },
2561
+ // ===== MEMORIAL SAINTS =====
2562
+ // January
2563
+ BASIL_GREGORY: {
2564
+ title: "Saints Basil the Great and Gregory Nazianzen",
2565
+ keywords: ["basil", "gregory", "doctors"]
2566
+ },
2567
+ ANTHONY_ABBOT: { title: "Saint Anthony, Abbot", keywords: ["anthony", "abbot", "desert father"] },
2568
+ AGNES: { title: "Saint Agnes, Virgin and Martyr", keywords: ["agnes", "virgin", "martyr"] },
2569
+ FRANCIS_DE_SALES: {
2570
+ title: "Saint Francis de Sales",
2571
+ keywords: ["francis de sales", "doctor", "bishop"]
2572
+ },
2573
+ TIMOTHY_TITUS: { title: "Saints Timothy and Titus", keywords: ["timothy", "titus", "bishops"] },
2574
+ THOMAS_AQUINAS: {
2575
+ title: "Saint Thomas Aquinas",
2576
+ keywords: ["thomas aquinas", "doctor", "angelic"]
2577
+ },
2578
+ JOHN_BOSCO: { title: "Saint John Bosco", keywords: ["john bosco", "don bosco", "salesians"] },
2579
+ // February
2580
+ AGATHA: { title: "Saint Agatha", keywords: ["agatha", "virgin", "martyr"] },
2581
+ PAUL_MIKI: {
2582
+ title: "Saints Paul Miki and Companions",
2583
+ keywords: ["paul miki", "japan", "martyrs"]
2584
+ },
2585
+ SCHOLASTICA: { title: "Saint Scholastica", keywords: ["scholastica", "virgin", "benedict"] },
2586
+ OUR_LADY_OF_LOURDES: {
2587
+ title: "Our Lady of Lourdes",
2588
+ keywords: ["lourdes", "mary", "bernadette"]
2589
+ },
2590
+ CYRIL_METHODIUS: {
2591
+ title: "Saints Cyril and Methodius",
2592
+ keywords: ["cyril", "methodius", "slavs"]
2593
+ },
2594
+ POLYCARP: { title: "Saint Polycarp", keywords: ["polycarp", "bishop", "martyr"] },
2595
+ // March
2596
+ PERPETUA_FELICITY: {
2597
+ title: "Saints Perpetua and Felicity",
2598
+ keywords: ["perpetua", "felicity", "martyrs"]
2599
+ },
2600
+ PATRICK: { title: "Saint Patrick", keywords: ["patrick", "ireland", "bishop"] },
2601
+ CYRIL_OF_JERUSALEM: {
2602
+ title: "Saint Cyril of Jerusalem",
2603
+ keywords: ["cyril", "jerusalem", "doctor"]
2604
+ },
2605
+ // April
2606
+ MARTIN_I: { title: "Saint Martin I", keywords: ["martin", "pope", "martyr"] },
2607
+ ANSELM: { title: "Saint Anselm", keywords: ["anselm", "canterbury", "doctor"] },
2608
+ GEORGE: { title: "Saint George", keywords: ["george", "martyr", "dragon"] },
2609
+ ADALBERT: { title: "Saint Adalbert", keywords: ["adalbert", "bishop", "martyr"] },
2610
+ FIDELIS: { title: "Saint Fidelis of Sigmaringen", keywords: ["fidelis", "martyr", "capuchin"] },
2611
+ LOUIS_GRIGNION: {
2612
+ title: "Saint Louis Grignion de Montfort",
2613
+ keywords: ["louis montfort", "mary"]
2614
+ },
2615
+ PETER_CHANEL: { title: "Saint Peter Chanel", keywords: ["peter chanel", "martyr", "oceania"] },
2616
+ CATHERINE_OF_SIENA: {
2617
+ title: "Saint Catherine of Siena",
2618
+ keywords: ["catherine siena", "doctor", "mystic"]
2619
+ },
2620
+ PIUS_V: { title: "Saint Pius V", keywords: ["pius", "pope", "rosary"] },
2621
+ // May
2622
+ JOSEPH_WORKER: { title: "Saint Joseph the Worker", keywords: ["joseph", "worker", "labor"] },
2623
+ ATHANASIUS: { title: "Saint Athanasius", keywords: ["athanasius", "doctor", "alexandria"] },
2624
+ NEREUS_ACHILLEUS: {
2625
+ title: "Saints Nereus and Achilleus",
2626
+ keywords: ["nereus", "achilleus", "martyrs"]
2627
+ },
2628
+ PANCRAS: { title: "Saint Pancras", keywords: ["pancras", "martyr"] },
2629
+ OUR_LADY_OF_FATIMA: { title: "Our Lady of Fatima", keywords: ["fatima", "mary", "portugal"] },
2630
+ JOHN_I: { title: "Saint John I", keywords: ["john", "pope", "martyr"] },
2631
+ BERNARDINE: { title: "Saint Bernardine of Siena", keywords: ["bernardine", "siena", "preacher"] },
2632
+ PHILIP_NERI: { title: "Saint Philip Neri", keywords: ["philip neri", "oratory", "rome"] },
2633
+ AUGUSTINE_OF_CANTERBURY: {
2634
+ title: "Saint Augustine of Canterbury",
2635
+ keywords: ["augustine", "canterbury", "england"]
2636
+ },
2637
+ // June
2638
+ JUSTIN: { title: "Saint Justin Martyr", keywords: ["justin", "martyr", "philosopher"] },
2639
+ MARCELLINUS_PETER: {
2640
+ title: "Saints Marcellinus and Peter",
2641
+ keywords: ["marcellinus", "peter", "martyrs"]
2642
+ },
2643
+ CHARLES_LWANGA: {
2644
+ title: "Saints Charles Lwanga and Companions",
2645
+ keywords: ["charles lwanga", "uganda", "martyrs"]
2646
+ },
2647
+ BONIFACE: { title: "Saint Boniface", keywords: ["boniface", "germany", "martyr"] },
2648
+ NORBERT: { title: "Saint Norbert", keywords: ["norbert", "premonstratensians"] },
2649
+ EPHREM: { title: "Saint Ephrem", keywords: ["ephrem", "syria", "doctor"] },
2650
+ BARNABAS: { title: "Saint Barnabas", keywords: ["barnabas", "apostle", "cyprus"] },
2651
+ ROMUALD: { title: "Saint Romuald", keywords: ["romuald", "camaldolese"] },
2652
+ JOHN_FISHER_THOMAS_MORE: {
2653
+ title: "Saints John Fisher and Thomas More",
2654
+ keywords: ["john fisher", "thomas more", "martyrs", "england"]
2655
+ },
2656
+ FIRST_MARTYRS_OF_ROME: {
2657
+ title: "First Martyrs of the Holy Roman Church",
2658
+ keywords: ["martyrs", "rome", "nero"]
2659
+ },
2660
+ // July
2661
+ THOMAS_APOSTLE: { title: "Saint Thomas, Apostle", keywords: ["thomas", "apostle", "doubting"] },
2662
+ ELIZABETH_OF_PORTUGAL: {
2663
+ title: "Saint Elizabeth of Portugal",
2664
+ keywords: ["elizabeth", "portugal", "queen"]
2665
+ },
2666
+ MARIA_GORETTI: { title: "Saint Maria Goretti", keywords: ["maria goretti", "virgin", "martyr"] },
2667
+ AUGUSTINE_ZHAO: {
2668
+ title: "Saints Augustine Zhao Rong and Companions",
2669
+ keywords: ["augustine zhao", "china", "martyrs"]
2670
+ },
2671
+ BENEDICT: { title: "Saint Benedict", keywords: ["benedict", "monks", "nursia"] },
2672
+ HENRY: { title: "Saint Henry", keywords: ["henry", "emperor"] },
2673
+ CAMILLUS: { title: "Saint Camillus de Lellis", keywords: ["camillus", "sick", "nurses"] },
2674
+ BONAVENTURE: { title: "Saint Bonaventure", keywords: ["bonaventure", "doctor", "franciscan"] },
2675
+ OUR_LADY_OF_MOUNT_CARMEL: {
2676
+ title: "Our Lady of Mount Carmel",
2677
+ keywords: ["carmel", "mary", "scapular"]
2678
+ },
2679
+ APOLLINARIS: { title: "Saint Apollinaris", keywords: ["apollinaris", "ravenna", "martyr"] },
2680
+ LAWRENCE_OF_BRINDISI: {
2681
+ title: "Saint Lawrence of Brindisi",
2682
+ keywords: ["lawrence brindisi", "doctor", "capuchin"]
2683
+ },
2684
+ MARY_MAGDALENE: {
2685
+ title: "Saint Mary Magdalene",
2686
+ keywords: ["mary magdalene", "apostle to apostles"]
2687
+ },
2688
+ BRIDGET: { title: "Saint Bridget", keywords: ["bridget", "sweden", "mystic"] },
2689
+ SHARBEL: { title: "Saint Sharbel Makhluf", keywords: ["sharbel", "lebanon", "hermit"] },
2690
+ JAMES_APOSTLE: { title: "Saint James, Apostle", keywords: ["james", "apostle", "compostela"] },
2691
+ MARTHA: { title: "Saint Martha", keywords: ["martha", "bethany"] },
2692
+ PETER_CHRYSOLOGUS: {
2693
+ title: "Saint Peter Chrysologus",
2694
+ keywords: ["peter chrysologus", "doctor", "ravenna"]
2695
+ },
2696
+ IGNATIUS_OF_LOYOLA: {
2697
+ title: "Saint Ignatius of Loyola",
2698
+ keywords: ["ignatius", "loyola", "jesuits"]
2699
+ },
2700
+ // August
2701
+ ALPHONSUS: {
2702
+ title: "Saint Alphonsus Liguori",
2703
+ keywords: ["alphonsus", "liguori", "doctor", "redemptorists"]
2704
+ },
2705
+ JOHN_VIANNEY: {
2706
+ title: "Saint John Vianney",
2707
+ keywords: ["john vianney", "cure of ars", "priest"]
2708
+ },
2709
+ DEDICATION_MARY_MAJOR: {
2710
+ title: "Dedication of the Basilica of Saint Mary Major",
2711
+ keywords: ["mary major", "basilica", "rome"]
2712
+ },
2713
+ SIXTUS_II: { title: "Saint Sixtus II and Companions", keywords: ["sixtus", "pope", "martyrs"] },
2714
+ CAJETAN: { title: "Saint Cajetan", keywords: ["cajetan", "theatines"] },
2715
+ DOMINIC: { title: "Saint Dominic", keywords: ["dominic", "dominicans", "preacher"] },
2716
+ LAWRENCE: {
2717
+ title: "Saint Lawrence, Deacon and Martyr",
2718
+ keywords: ["lawrence", "deacon", "martyr"]
2719
+ },
2720
+ CLARE: { title: "Saint Clare", keywords: ["clare", "assisi", "poor clares"] },
2721
+ JANE_FRANCES: {
2722
+ title: "Saint Jane Frances de Chantal",
2723
+ keywords: ["jane frances", "chantal", "visitation"]
2724
+ },
2725
+ PONTIAN_HIPPOLYTUS: {
2726
+ title: "Saints Pontian and Hippolytus",
2727
+ keywords: ["pontian", "hippolytus", "martyrs"]
2728
+ },
2729
+ MAXIMILIAN_KOLBE: {
2730
+ title: "Saint Maximilian Kolbe",
2731
+ keywords: ["maximilian kolbe", "auschwitz", "martyr"]
2732
+ },
2733
+ JOHN_EUDES: { title: "Saint John Eudes", keywords: ["john eudes", "hearts"] },
2734
+ BERNARD: { title: "Saint Bernard", keywords: ["bernard", "clairvaux", "doctor"] },
2735
+ PIUS_X: { title: "Saint Pius X", keywords: ["pius", "pope", "eucharist"] },
2736
+ QUEENSHIP_OF_MARY: {
2737
+ title: "Queenship of the Blessed Virgin Mary",
2738
+ keywords: ["queenship", "mary", "queen"]
2739
+ },
2740
+ BARTHOLOMEW: {
2741
+ title: "Saint Bartholomew, Apostle",
2742
+ keywords: ["bartholomew", "apostle", "nathanael"]
2743
+ },
2744
+ LOUIS_IX: { title: "Saint Louis IX", keywords: ["louis", "france", "king"] },
2745
+ JOSEPH_CALASANZ: {
2746
+ title: "Saint Joseph Calasanz",
2747
+ keywords: ["joseph calasanz", "piarists", "schools"]
2748
+ },
2749
+ MONICA: { title: "Saint Monica", keywords: ["monica", "augustine", "mother"] },
2750
+ AUGUSTINE: { title: "Saint Augustine", keywords: ["augustine", "hippo", "doctor"] },
2751
+ PASSION_OF_JOHN_BAPTIST: {
2752
+ title: "Passion of Saint John the Baptist",
2753
+ keywords: ["john baptist", "beheading", "martyr"]
2754
+ },
2755
+ // September
2756
+ GREGORY_THE_GREAT: { title: "Saint Gregory the Great", keywords: ["gregory", "pope", "doctor"] },
2757
+ BIRTH_OF_MARY: {
2758
+ title: "Nativity of the Blessed Virgin Mary",
2759
+ keywords: ["birth", "mary", "nativity"]
2760
+ },
2761
+ PETER_CLAVER: { title: "Saint Peter Claver", keywords: ["peter claver", "slaves", "jesuit"] },
2762
+ MOST_HOLY_NAME_OF_MARY: { title: "Most Holy Name of Mary", keywords: ["name", "mary"] },
2763
+ OUR_LADY_OF_SORROWS: {
2764
+ title: "Our Lady of Sorrows",
2765
+ keywords: ["sorrows", "mary", "seven sorrows"]
2766
+ },
2767
+ CORNELIUS_CYPRIAN: {
2768
+ title: "Saints Cornelius and Cyprian",
2769
+ keywords: ["cornelius", "cyprian", "martyrs"]
2770
+ },
2771
+ ROBERT_BELLARMINE: {
2772
+ title: "Saint Robert Bellarmine",
2773
+ keywords: ["robert bellarmine", "doctor", "jesuit"]
2774
+ },
2775
+ JANUARIUS: { title: "Saint Januarius", keywords: ["januarius", "naples", "martyr"] },
2776
+ MATTHEW: {
2777
+ title: "Saint Matthew, Apostle and Evangelist",
2778
+ keywords: ["matthew", "apostle", "evangelist"]
2779
+ },
2780
+ PADRE_PIO: {
2781
+ title: "Saint Padre Pio of Pietrelcina",
2782
+ keywords: ["padre pio", "stigmata", "capuchin"]
2783
+ },
2784
+ COSMAS_DAMIAN: {
2785
+ title: "Saints Cosmas and Damian",
2786
+ keywords: ["cosmas", "damian", "martyrs", "physicians"]
2787
+ },
2788
+ WENCESLAUS: { title: "Saint Wenceslaus", keywords: ["wenceslaus", "bohemia", "martyr"] },
2789
+ LAWRENCE_RUIZ: {
2790
+ title: "Saints Lawrence Ruiz and Companions",
2791
+ keywords: ["lawrence ruiz", "philippines", "martyrs"]
2792
+ },
2793
+ ARCHANGELS: {
2794
+ title: "Saints Michael, Gabriel, and Raphael, Archangels",
2795
+ keywords: ["michael", "gabriel", "raphael", "archangels"]
2796
+ },
2797
+ JEROME: { title: "Saint Jerome", keywords: ["jerome", "doctor", "bible", "vulgate"] },
2798
+ // October
2799
+ THERESE_OF_LISIEUX: {
2800
+ title: "Saint Therese of the Child Jesus",
2801
+ keywords: ["therese", "lisieux", "little flower", "doctor"]
2802
+ },
2803
+ GUARDIAN_ANGELS: { title: "Holy Guardian Angels", keywords: ["guardian angels", "angels"] },
2804
+ FRANCIS_OF_ASSISI: {
2805
+ title: "Saint Francis of Assisi",
2806
+ keywords: ["francis", "assisi", "franciscans"]
2807
+ },
2808
+ FAUSTINA: { title: "Saint Faustina Kowalska", keywords: ["faustina", "divine mercy"] },
2809
+ BRUNO: { title: "Saint Bruno", keywords: ["bruno", "carthusians"] },
2810
+ OUR_LADY_OF_ROSARY: { title: "Our Lady of the Rosary", keywords: ["rosary", "mary", "lepanto"] },
2811
+ DENIS: { title: "Saint Denis and Companions", keywords: ["denis", "paris", "martyrs"] },
2812
+ CALLISTUS_I: { title: "Saint Callistus I", keywords: ["callistus", "pope", "martyr"] },
2813
+ TERESA_OF_AVILA: {
2814
+ title: "Saint Teresa of Avila",
2815
+ keywords: ["teresa", "avila", "doctor", "carmelite"]
2816
+ },
2817
+ HEDWIG: { title: "Saint Hedwig", keywords: ["hedwig", "silesia"] },
2818
+ MARGARET_MARY: {
2819
+ title: "Saint Margaret Mary Alacoque",
2820
+ keywords: ["margaret mary", "sacred heart"]
2821
+ },
2822
+ IGNATIUS_OF_ANTIOCH: {
2823
+ title: "Saint Ignatius of Antioch",
2824
+ keywords: ["ignatius", "antioch", "martyr"]
2825
+ },
2826
+ LUKE: { title: "Saint Luke, Evangelist", keywords: ["luke", "evangelist", "physician"] },
2827
+ ISAAC_JOGUES: {
2828
+ title: "Saints Isaac Jogues and Companions",
2829
+ keywords: ["isaac jogues", "north america", "martyrs"]
2830
+ },
2831
+ PAUL_OF_CROSS: { title: "Saint Paul of the Cross", keywords: ["paul cross", "passionists"] },
2832
+ JOHN_PAUL_II: { title: "Saint John Paul II", keywords: ["john paul", "pope", "poland"] },
2833
+ JOHN_OF_CAPISTRANO: {
2834
+ title: "Saint John of Capistrano",
2835
+ keywords: ["john capistrano", "franciscan"]
2836
+ },
2837
+ ANTHONY_MARY_CLARET: {
2838
+ title: "Saint Anthony Mary Claret",
2839
+ keywords: ["anthony claret", "claretians"]
2840
+ },
2841
+ SIMON_JUDE: { title: "Saints Simon and Jude, Apostles", keywords: ["simon", "jude", "apostles"] },
2842
+ // November
2843
+ DEDICATION_LATERAN: {
2844
+ title: "Dedication of the Lateran Basilica",
2845
+ keywords: ["lateran", "basilica", "rome"]
2846
+ },
2847
+ LEO_THE_GREAT: { title: "Saint Leo the Great", keywords: ["leo", "pope", "doctor"] },
2848
+ MARTIN_OF_TOURS: { title: "Saint Martin of Tours", keywords: ["martin", "tours", "cloak"] },
2849
+ JOSAPHAT: { title: "Saint Josaphat", keywords: ["josaphat", "bishop", "martyr"] },
2850
+ MARGARET_OF_SCOTLAND: {
2851
+ title: "Saint Margaret of Scotland",
2852
+ keywords: ["margaret", "scotland", "queen"]
2853
+ },
2854
+ GERTRUDE: { title: "Saint Gertrude", keywords: ["gertrude", "mystic"] },
2855
+ ELIZABETH_OF_HUNGARY: {
2856
+ title: "Saint Elizabeth of Hungary",
2857
+ keywords: ["elizabeth", "hungary", "charity"]
2858
+ },
2859
+ DEDICATION_PETER_PAUL: {
2860
+ title: "Dedication of the Basilicas of Saints Peter and Paul",
2861
+ keywords: ["peter", "paul", "basilicas", "rome"]
2862
+ },
2863
+ PRESENTATION_OF_MARY: {
2864
+ title: "Presentation of the Blessed Virgin Mary",
2865
+ keywords: ["presentation", "mary", "temple"]
2866
+ },
2867
+ CLEMENT_I: { title: "Saint Clement I", keywords: ["clement", "pope", "martyr"] },
2868
+ COLUMBAN: { title: "Saint Columban", keywords: ["columban", "ireland", "missionary"] },
2869
+ CATHERINE_OF_ALEXANDRIA: {
2870
+ title: "Saint Catherine of Alexandria",
2871
+ keywords: ["catherine", "alexandria", "martyr"]
2872
+ },
2873
+ ANDREW_APOSTLE: { title: "Saint Andrew, Apostle", keywords: ["andrew", "apostle", "scotland"] },
2874
+ // December
2875
+ FRANCIS_XAVIER: {
2876
+ title: "Saint Francis Xavier",
2877
+ keywords: ["francis xavier", "jesuit", "missions"]
2878
+ },
2879
+ LUCY: { title: "Saint Lucy", keywords: ["lucy", "virgin", "martyr", "light"] },
2880
+ STEPHEN_FIRST_MARTYR: {
2881
+ title: "Saint Stephen, First Martyr",
2882
+ keywords: ["stephen", "first martyr", "deacon"]
2883
+ },
2884
+ JOHN_APOSTLE: {
2885
+ title: "Saint John, Apostle and Evangelist",
2886
+ keywords: ["john", "apostle", "evangelist", "beloved"]
2887
+ }
2888
+ };
2889
+
2890
+ // src/utils/generator.ts
2891
+ function getYearsInRange(range) {
2892
+ const startYear = calendaryjs.getYear(range.from);
2893
+ const endYear = calendaryjs.getYear(range.to);
2894
+ const years = [];
2895
+ for (let y = startYear; y <= endYear; y++) {
2896
+ years.push(y);
2897
+ }
2898
+ return years;
2899
+ }
2900
+ function computeEventDate(def, year, options) {
2901
+ switch (def.type) {
2902
+ case "easter": {
2903
+ const easter = computeEaster(year);
2904
+ return calendaryjs.formatDate(easter);
2905
+ }
2906
+ case "offset": {
2907
+ let offsetDays = def.offsetDays;
2908
+ if (def.key === "ASCENSION" && options.ascensionOnSunday) {
2909
+ offsetDays = 42;
2910
+ }
2911
+ if (def.key === "CORPUS_CHRISTI" && options.corpusChristiOnSunday) {
2912
+ offsetDays = 63;
2913
+ }
2914
+ const easter = computeEaster(year);
2915
+ const eventDate = calendaryjs.addDays(easter, offsetDays);
2916
+ return calendaryjs.formatDate(eventDate);
2917
+ }
2918
+ case "const": {
2919
+ if (def.month && def.day) {
2920
+ const month = String(def.month).padStart(2, "0");
2921
+ const day = String(def.day).padStart(2, "0");
2922
+ return `${year}-${month}-${day}`;
2923
+ }
2924
+ return null;
2925
+ }
2926
+ case "nth-weekday": {
2927
+ return computeNthWeekdayDate(def, year);
2928
+ }
2929
+ case "formula":
2930
+ return null;
2931
+ /* v8 ignore next 2 -- defensive: def.type is an exhaustive union (no other case) */
2932
+ default:
2933
+ return null;
2934
+ }
2935
+ }
2936
+ function computeNthWeekdayDate(def, year) {
2937
+ const dayOfWeek = def.dayOfWeek;
2938
+ if (dayOfWeek === void 0) return null;
2939
+ if (def.after !== void 0) {
2940
+ const candidate = firstWeekdayOnOrAfterAnchor(year, def.after, dayOfWeek);
2941
+ if (def.before !== void 0) {
2942
+ const beforeDate = new Date(year, def.before.month - 1, def.before.day);
2943
+ if (candidate === null || candidate >= beforeDate) {
2944
+ if (def.fallback !== void 0) {
2945
+ const m2 = String(def.fallback.month).padStart(2, "0");
2946
+ const d2 = String(def.fallback.day).padStart(2, "0");
2947
+ return `${year}-${m2}-${d2}`;
2948
+ }
2949
+ return null;
2950
+ }
2951
+ }
2952
+ if (candidate === null) return null;
2953
+ const m = String(candidate.getMonth() + 1).padStart(2, "0");
2954
+ const d = String(candidate.getDate()).padStart(2, "0");
2955
+ return `${year}-${m}-${d}`;
2956
+ }
2957
+ if (def.nth !== void 0 && def.nthMonth !== void 0) {
2958
+ const date = nthWeekdayInMonth(year, def.nthMonth, dayOfWeek, def.nth);
2959
+ if (!date) return null;
2960
+ const m = String(date.getMonth() + 1).padStart(2, "0");
2961
+ const d = String(date.getDate()).padStart(2, "0");
2962
+ return `${year}-${m}-${d}`;
2963
+ }
2964
+ return null;
2965
+ }
2966
+ function firstWeekdayOnOrAfterAnchor(year, anchor, dayOfWeek) {
2967
+ for (let offset = 0; offset <= 6; offset++) {
2968
+ const date = new Date(year, anchor.month - 1, anchor.day + offset);
2969
+ if (date.getDay() === dayOfWeek) return date;
2970
+ }
2971
+ return null;
2972
+ }
2973
+ function nthWeekdayInMonth(year, month, dayOfWeek, nth) {
2974
+ if (nth === -1) {
2975
+ const daysInMonth2 = new Date(year, month, 0).getDate();
2976
+ for (let d = daysInMonth2; d >= 1; d--) {
2977
+ const date = new Date(year, month - 1, d);
2978
+ if (date.getDay() === dayOfWeek) return date;
2979
+ }
2980
+ return null;
2981
+ }
2982
+ let count = 0;
2983
+ const daysInMonth = new Date(year, month, 0).getDate();
2984
+ for (let d = 1; d <= daysInMonth; d++) {
2985
+ const date = new Date(year, month - 1, d);
2986
+ if (date.getDay() === dayOfWeek) {
2987
+ count++;
2988
+ if (count === nth) return date;
2989
+ }
2990
+ }
2991
+ return null;
2992
+ }
2993
+ function buildEventConfig(def, options) {
2994
+ const key = def.key;
2995
+ const defaultText = DEFAULT_LITURGICAL_TEXTS[key] ?? { title: def.key };
2996
+ const customConfig = options.customResolver?.(key);
2997
+ const baseConfig = {
2998
+ id: def.key.toLowerCase().replace(/_/g, "-"),
2999
+ title: defaultText.title,
3000
+ metadata: def.metadata,
3001
+ priority: def.metadata.rank === "solemnity" ? 1 : def.metadata.rank === "feast" ? 2 : 3
3002
+ };
3003
+ if (defaultText.keywords && defaultText.keywords.length > 0) {
3004
+ baseConfig.keywords = defaultText.keywords;
3005
+ }
3006
+ const mergedConfig = calendaryjs.mergeEventConfig(baseConfig, customConfig);
3007
+ switch (def.type) {
3008
+ case "easter":
3009
+ return { ...mergedConfig, type: "easter" };
3010
+ case "offset": {
3011
+ let offsetDays = def.offsetDays;
3012
+ if (def.key === "ASCENSION" && options.ascensionOnSunday) {
3013
+ offsetDays = 42;
3014
+ }
3015
+ if (def.key === "CORPUS_CHRISTI" && options.corpusChristiOnSunday) {
3016
+ offsetDays = 63;
3017
+ }
3018
+ return {
3019
+ ...mergedConfig,
3020
+ type: "offset",
3021
+ baseEvent: "easter",
3022
+ offsetDays
3023
+ };
3024
+ }
3025
+ case "const":
3026
+ return {
3027
+ ...mergedConfig,
3028
+ type: "const",
3029
+ month: def.month,
3030
+ day: def.day
3031
+ };
3032
+ case "nth-weekday":
3033
+ return {
3034
+ ...mergedConfig,
3035
+ type: "nth-weekday",
3036
+ dayOfWeek: def.dayOfWeek,
3037
+ nth: def.nth,
3038
+ month: def.nthMonth,
3039
+ after: def.after,
3040
+ before: def.before,
3041
+ fallback: def.fallback
3042
+ };
3043
+ case "formula":
3044
+ return {
3045
+ ...mergedConfig,
3046
+ type: "formula",
3047
+ formula: def.formula
3048
+ };
3049
+ /* v8 ignore start -- defensive: def.type is an exhaustive union, no unknown type reaches here */
3050
+ default:
3051
+ return { ...mergedConfig, type: "const", month: 1, day: 1 };
3052
+ }
3053
+ }
3054
+ var DEFAULT_OPTIONS = {
3055
+ epiphanyOnSunday: false,
3056
+ ascensionOnSunday: false,
3057
+ corpusChristiOnSunday: true,
3058
+ includeCategories: ["easter-cycle", "solemnities", "feasts", "memorials", "computed"],
3059
+ groupId: "liturgical-calendar"
3060
+ };
3061
+ function generateLiturgicalEvents(options) {
3062
+ const mergedOptions = { ...DEFAULT_OPTIONS, ...options };
3063
+ const range = mergedOptions.range;
3064
+ const years = getYearsInRange(range);
3065
+ const allEvents = [];
3066
+ const categories = mergedOptions.includeCategories;
3067
+ const eventDefs = getEventsByCategory(categories);
3068
+ for (const def of eventDefs) {
3069
+ const eventConfig = buildEventConfig(def, mergedOptions);
3070
+ let shouldDrop = false;
3071
+ const onConflict = "onConflict" in eventConfig ? eventConfig.onConflict : void 0;
3072
+ if (onConflict) {
3073
+ for (const year of years) {
3074
+ const eventDate = computeEventDate(def, year, mergedOptions);
3075
+ if (eventDate) {
3076
+ const conflictAction = calendaryjs.resolveConflict(onConflict, eventDate);
3077
+ if (conflictAction.action === "drop") {
3078
+ shouldDrop = true;
3079
+ break;
3080
+ }
3081
+ }
3082
+ }
3083
+ }
3084
+ if (!shouldDrop) {
3085
+ allEvents.push(eventConfig);
3086
+ }
3087
+ }
3088
+ return {
3089
+ id: mergedOptions.groupId,
3090
+ events: allEvents
3091
+ };
3092
+ }
3093
+ function createLiturgicalGenerator(generatorOptions = {}) {
3094
+ const { defaults } = generatorOptions;
3095
+ return (options) => {
3096
+ const mergedOptions = { ...defaults, ...options };
3097
+ return generateLiturgicalEvents(mergedOptions);
3098
+ };
3099
+ }
3100
+
3101
+ exports.ALL_LITURGICAL_EVENTS = ALL_LITURGICAL_EVENTS;
3102
+ exports.ALL_MASS_KEYS = ALL_MASS_KEYS;
3103
+ exports.ASCENSION = ASCENSION;
3104
+ exports.ASH_WEDNESDAY = ASH_WEDNESDAY;
3105
+ exports.COMPUTED_EVENTS = COMPUTED_EVENTS;
3106
+ exports.COMPUTED_KEYS = COMPUTED_KEYS;
3107
+ exports.CORPUS_CHRISTI = CORPUS_CHRISTI;
3108
+ exports.DEFAULT_LITURGICAL_TEXTS = DEFAULT_LITURGICAL_TEXTS;
3109
+ exports.EASTER = EASTER;
3110
+ exports.EASTER_CYCLE_EVENTS = EASTER_CYCLE_EVENTS;
3111
+ exports.EASTER_CYCLE_KEYS = EASTER_CYCLE_KEYS;
3112
+ exports.FIXED_SOLEMNITY_EVENTS = FIXED_SOLEMNITY_EVENTS;
3113
+ exports.FIXED_SOLEMNITY_KEYS = FIXED_SOLEMNITY_KEYS;
3114
+ exports.GOOD_FRIDAY = GOOD_FRIDAY;
3115
+ exports.HOLY_SATURDAY = HOLY_SATURDAY;
3116
+ exports.HOLY_THURSDAY = HOLY_THURSDAY;
3117
+ exports.LITURGICAL_EVENTS = LITURGICAL_EVENTS;
3118
+ exports.MEMORIAL_SAINT_EVENTS = MEMORIAL_SAINT_EVENTS;
3119
+ exports.MEMORIAL_SAINT_KEYS = MEMORIAL_SAINT_KEYS;
3120
+ exports.MassKeys = MassKeys;
3121
+ exports.PALM_SUNDAY = PALM_SUNDAY;
3122
+ exports.PENTECOST = PENTECOST;
3123
+ exports.TRINITY_SUNDAY = TRINITY_SUNDAY;
3124
+ exports.computeEaster = computeEaster;
3125
+ exports.computeOrthodoxEaster = computeOrthodoxEaster;
3126
+ exports.createLiturgicalGenerator = createLiturgicalGenerator;
3127
+ exports.easterEventHandler = easterEventHandler;
3128
+ exports.easterRelativeDate = easterRelativeDate;
3129
+ exports.generateLiturgicalEvents = generateLiturgicalEvents;
3130
+ exports.getAdvent1 = getAdvent1;
3131
+ exports.getAdvent2 = getAdvent2;
3132
+ exports.getAdvent3 = getAdvent3;
3133
+ exports.getAdvent4 = getAdvent4;
3134
+ exports.getBaptismOfLord = getBaptismOfLord;
3135
+ exports.getCalendarYearSeasons = getCalendarYearSeasons;
3136
+ exports.getChristTheKing = getChristTheKing;
3137
+ exports.getCurrentSeason = getCurrentSeason;
3138
+ exports.getEasterDateString = getEasterDateString;
3139
+ exports.getEventsByCategory = getEventsByCategory;
3140
+ exports.getHolyFamily = getHolyFamily;
3141
+ exports.getLiturgicalDay = getLiturgicalDay;
3142
+ exports.getLiturgicalDaysForMonth = getLiturgicalDaysForMonth;
3143
+ exports.getLiturgicalDaysForYear = getLiturgicalDaysForYear;
3144
+ exports.getLiturgicalDaysInRange = getLiturgicalDaysInRange;
3145
+ exports.getLiturgicalYear = getLiturgicalYear;
3146
+ exports.getLiturgicalYearBoundaries = getLiturgicalYearBoundaries;
3147
+ exports.getLiturgicalYearChart = getLiturgicalYearChart;
3148
+ exports.getSeason = getSeason;
3149
+ exports.liturgical = liturgical;
3150
+ exports.offsetEventHandler = offsetEventHandler;