quran-meta
Version:
Library with meta data and functionality related to Holy Quran
3,738 lines (3,708 loc) • 83.4 kB
JavaScript
//#region src/lists/QalunLists.ts
const HizbEighthList = [
0,
1,
20,
32,
40,
50,
60,
66,
73,
82,
91,
98,
108,
112,
121,
130,
139,
148,
154,
164,
174,
183,
191,
195,
203,
208,
218,
224,
233,
238,
241,
248,
253,
258,
264,
269,
273,
278,
288,
289,
297,
307,
318,
325,
334,
343,
355,
366,
374,
383,
396,
405,
413,
425,
436,
445,
452,
463,
471,
478,
487,
498,
503,
505,
511,
516,
523,
528,
538,
549,
555,
565,
569,
578,
584,
591,
596,
605,
614,
621,
629,
639,
650,
657,
663,
671,
674,
680,
686,
692,
701,
710,
714,
718,
728,
736,
744,
751,
759,
766,
775,
780,
790,
803,
815,
826,
840,
849,
859,
870,
881,
885,
890,
901,
910,
917,
926,
931,
935,
941,
948,
957,
974,
984,
992,
1002,
1010,
1020,
1030,
1043,
1055,
1072,
1087,
1098,
1104,
1112,
1119,
1127,
1136,
1144,
1155,
1167,
1174,
1184,
1194,
1203,
1212,
1223,
1235,
1243,
1250,
1257,
1263,
1272,
1278,
1284,
1292,
1299,
1308,
1314,
1323,
1332,
1340,
1350,
1356,
1362,
1371,
1379,
1387,
1394,
1405,
1417,
1429,
1439,
1451,
1461,
1472,
1483,
1492,
1501,
1509,
1518,
1527,
1538,
1550,
1560,
1571,
1582,
1596,
1608,
1620,
1631,
1641,
1651,
1665,
1675,
1686,
1699,
1708,
1714,
1726,
1730,
1740,
1745,
1754,
1766,
1775,
1783,
1794,
1808,
1833,
1856,
1887,
1907,
1921,
1936,
1944,
1957,
1969,
1977,
1985,
1996,
2004,
2017,
2026,
2035,
2045,
2057,
2070,
2084,
2095,
2104,
2119,
2133,
2145,
2161,
2167,
2176,
2188,
2197,
2207,
2218,
2226,
2239,
2250,
2270,
2289,
2308,
2327,
2349,
2372,
2402,
2419,
2429,
2441,
2456,
2474,
2483,
2498,
2512,
2524,
2533,
2555,
2568,
2582,
2594,
2604,
2612,
2621,
2629,
2640,
2651,
2661,
2670,
2690,
2705,
2727,
2745,
2767,
2785,
2799,
2809,
2818,
2823,
2830,
2839,
2846,
2849,
2860,
2871,
2882,
2895,
2911,
2928,
2949,
2977,
3005,
3038,
3073,
3108,
3135,
3159,
3171,
3180,
3195,
3211,
3222,
3237,
3249,
3259,
3267,
3277,
3286,
3299,
3309,
3324,
3331,
3343,
3351,
3361,
3372,
3382,
3396,
3413,
3426,
3435,
3445,
3458,
3475,
3485,
3495,
3508,
3520,
3533,
3540,
3547,
3555,
3558,
3567,
3578,
3582,
3587,
3599,
3607,
3615,
3624,
3634,
3646,
3659,
3669,
3685,
3694,
3701,
3727,
3744,
3759,
3776,
3804,
3833,
3865,
3896,
3927,
3965,
3984,
3993,
4015,
4047,
4059,
4068,
4081,
4090,
4100,
4114,
4123,
4131,
4143,
4152,
4163,
4175,
4188,
4200,
4214,
4222,
4231,
4243,
4252,
4260,
4270,
4278,
4290,
4299,
4307,
4320,
4332,
4351,
4372,
4393,
4422,
4446,
4464,
4476,
4491,
4504,
4510,
4522,
4535,
4545,
4558,
4571,
4581,
4590,
4593,
4601,
4606,
4616,
4637,
4656,
4686,
4711,
4737,
4757,
4788,
4817,
4841,
4864,
4879,
4909,
4937,
4984,
5033,
5061,
5069,
5075,
5083,
5090,
5096,
5108,
5114,
5128,
5134,
5141,
5155,
5163,
5174,
5183,
5190,
5200,
5206,
5214,
5219,
5238,
5268,
5297,
5339,
5372,
5393,
5412,
5428,
5445,
5473,
5504,
5529,
5568,
5586,
5614,
5649,
5689,
5729,
5766,
5790,
5830,
5875,
5896,
5924,
5959,
6001,
6036,
6068,
6104,
6134,
6167,
6215
];
const HizbQuarterList$1 = [
0,
1,
32,
50,
66,
82,
98,
112,
130,
148,
164,
183,
195,
208,
224,
238,
248,
258,
269,
278,
289,
307,
325,
343,
366,
383,
405,
425,
445,
463,
478,
498,
505,
516,
528,
549,
565,
578,
591,
605,
621,
639,
657,
671,
680,
692,
710,
718,
736,
751,
766,
780,
803,
826,
849,
870,
885,
901,
917,
931,
941,
957,
984,
1002,
1020,
1043,
1072,
1098,
1112,
1127,
1144,
1167,
1184,
1203,
1223,
1243,
1257,
1272,
1284,
1299,
1314,
1332,
1350,
1362,
1379,
1394,
1417,
1439,
1461,
1483,
1501,
1518,
1538,
1560,
1582,
1608,
1631,
1651,
1675,
1699,
1714,
1730,
1745,
1766,
1783,
1808,
1856,
1907,
1936,
1957,
1977,
1996,
2017,
2035,
2057,
2084,
2104,
2133,
2161,
2176,
2197,
2218,
2239,
2270,
2308,
2349,
2402,
2429,
2456,
2483,
2512,
2533,
2568,
2594,
2612,
2629,
2651,
2670,
2705,
2745,
2785,
2809,
2823,
2839,
2849,
2871,
2895,
2928,
2977,
3038,
3108,
3159,
3180,
3211,
3237,
3259,
3277,
3299,
3324,
3343,
3361,
3382,
3413,
3435,
3458,
3485,
3508,
3533,
3547,
3558,
3578,
3587,
3607,
3624,
3646,
3669,
3694,
3727,
3759,
3804,
3865,
3927,
3984,
4015,
4059,
4081,
4100,
4123,
4143,
4163,
4188,
4214,
4231,
4252,
4270,
4290,
4307,
4332,
4372,
4422,
4464,
4491,
4510,
4535,
4558,
4581,
4593,
4606,
4637,
4686,
4737,
4788,
4841,
4879,
4937,
5033,
5069,
5083,
5096,
5114,
5134,
5155,
5174,
5190,
5206,
5219,
5268,
5339,
5393,
5428,
5473,
5529,
5586,
5649,
5729,
5790,
5875,
5924,
6001,
6068,
6134,
6215
];
const JuzList$1 = [
0,
1,
148,
258,
383,
516,
639,
751,
901,
1043,
1203,
1332,
1483,
1651,
1808,
2035,
2218,
2483,
2670,
2871,
3211,
3382,
3558,
3727,
4081,
4252,
4491,
4686,
5083,
5219,
5649,
6215
];
const ManzilList$1 = [
0,
1,
668,
1369,
2035,
2928,
3783,
4611,
6215
];
const PageList$1 = [
0,
1,
8,
12,
23,
31,
36,
44,
55,
64,
68,
76,
83,
90,
95,
100,
108,
112,
119,
126,
133,
141,
148,
152,
160,
170,
176,
183,
188,
193,
197,
203,
208,
216,
221,
225,
230,
236,
239,
243,
251,
254,
258,
263,
266,
271,
276,
281,
288,
289,
293,
302,
308,
315,
322,
330,
338,
344,
353,
362,
369,
375,
383,
393,
401,
408,
414,
425,
433,
441,
446,
450,
458,
466,
473,
479,
487,
493,
499,
504,
507,
512,
516,
519,
526,
530,
537,
543,
551,
557,
566,
571,
578,
583,
586,
593,
597,
605,
613,
619,
626,
632,
639,
646,
654,
662,
667,
671,
674,
678,
682,
687,
693,
701,
706,
711,
715,
720,
727,
734,
740,
747,
753,
760,
765,
773,
778,
783,
790,
799,
809,
818,
826,
835,
843,
850,
858,
864,
872,
881,
885,
892,
901,
909,
915,
921,
928,
933,
937,
942,
948,
957,
967,
978,
985,
992,
999,
1007,
1013,
1023,
1029,
1037,
1043,
1051,
1060,
1076,
1086,
1094,
1100,
1106,
1112,
1116,
1120,
1127,
1135,
1144,
1152,
1163,
1171,
1179,
1188,
1196,
1203,
1209,
1216,
1225,
1233,
1239,
1245,
1252,
1259,
1265,
1270,
1275,
1279,
1286,
1293,
1300,
1307,
1312,
1319,
1326,
1333,
1339,
1346,
1351,
1357,
1362,
1369,
1375,
1383,
1389,
1394,
1402,
1411,
1422,
1430,
1439,
1447,
1457,
1466,
1475,
1483,
1490,
1497,
1506,
1515,
1523,
1531,
1539,
1548,
1558,
1566,
1575,
1586,
1595,
1603,
1613,
1621,
1629,
1636,
1642,
1651,
1662,
1668,
1677,
1685,
1694,
1702,
1710,
1716,
1724,
1730,
1739,
1745,
1753,
1761,
1767,
1775,
1780,
1789,
1798,
1808,
1823,
1839,
1859,
1878,
1898,
1913,
1921,
1933,
1941,
1949,
1961,
1971,
1979,
1986,
1994,
2e3,
2009,
2017,
2025,
2035,
2042,
2052,
2062,
2073,
2084,
2093,
2101,
2110,
2121,
2131,
2139,
2149,
2160,
2165,
2172,
2179,
2189,
2197,
2205,
2218,
2227,
2238,
2250,
2260,
2274,
2287,
2301,
2314,
2327,
2346,
2360,
2385,
2399,
2412,
2424,
2435,
2445,
2459,
2472,
2483,
2493,
2507,
2518,
2527,
2540,
2554,
2563,
2572,
2583,
2594,
2599,
2609,
2615,
2622,
2630,
2638,
2647,
2656,
2664,
2670,
2687,
2697,
2712,
2730,
2745,
2760,
2775,
2789,
2799,
2809,
2816,
2820,
2825,
2831,
2840,
2845,
2848,
2853,
2862,
2871,
2883,
2894,
2906,
2918,
2928,
2946,
2966,
2988,
3011,
3039,
3064,
3087,
3111,
3134,
3154,
3167,
3176,
3190,
3200,
3211,
3219,
3232,
3244,
3253,
3261,
3269,
3277,
3284,
3292,
3299,
3308,
3319,
3326,
3333,
3342,
3350,
3359,
3367,
3375,
3382,
3389,
3400,
3410,
3420,
3429,
3437,
3446,
3455,
3465,
3475,
3483,
3492,
3498,
3509,
3518,
3528,
3534,
3543,
3550,
3558,
3563,
3571,
3578,
3582,
3590,
3601,
3608,
3615,
3623,
3632,
3640,
3649,
3658,
3666,
3673,
3685,
3693,
3700,
3712,
3727,
3740,
3754,
3770,
3783,
3807,
3834,
3859,
3885,
3909,
3936,
3965,
3980,
3990,
4006,
4025,
4047,
4057,
4062,
4071,
4081,
4088,
4095,
4104,
4115,
4122,
4129,
4138,
4148,
4156,
4163,
4172,
4181,
4189,
4199,
4207,
4217,
4226,
4235,
4244,
4252,
4260,
4268,
4273,
4280,
4289,
4301,
4308,
4319,
4331,
4342,
4356,
4370,
4383,
4399,
4416,
4436,
4455,
4467,
4476,
4486,
4495,
4504,
4510,
4518,
4525,
4537,
4545,
4555,
4564,
4573,
4579,
4587,
4592,
4597,
4604,
4611,
4626,
4646,
4662,
4686,
4707,
4728,
4745,
4763,
4789,
4806,
4830,
4851,
4873,
4895,
4919,
4947,
4974,
5009,
5035,
5058,
5066,
5072,
5078,
5083,
5089,
5094,
5103,
5107,
5113,
5120,
5128,
5133,
5139,
5146,
5155,
5163,
5170,
5177,
5186,
5195,
5200,
5207,
5214,
5219,
5232,
5246,
5266,
5292,
5309,
5337,
5364,
5394,
5408,
5428,
5441,
5456,
5473,
5492,
5520,
5547,
5573,
5593,
5618,
5649,
5679,
5705,
5734,
5774,
5805,
5828,
5857,
5884,
5907,
5934,
5965,
5993,
6019,
6045,
6070,
6096,
6114,
6131,
6155,
6172,
6186,
6200,
6215
];
const RukuList$1 = [
0,
1,
8,
14,
27,
36,
46,
53,
66,
68,
78,
90,
93,
103,
110,
119,
128,
136,
148,
154,
159,
170,
174,
183,
189,
195,
203,
216,
224,
227,
234,
237,
241,
251,
254,
259,
264,
267,
273,
280,
288,
290,
293,
302,
313,
323,
334,
346,
355,
363,
372,
383,
394,
402,
413,
422,
436,
441,
448,
464,
473,
482,
493,
503,
507,
515,
518,
526,
535,
542,
551,
562,
568,
579,
583,
588,
592,
596,
604,
607,
618,
627,
633,
644,
654,
663,
668,
674,
680,
689,
696,
704,
713,
720,
723,
736,
747,
756,
759,
770,
778,
785,
790,
801,
811,
821,
832,
841,
846,
851,
860,
873,
881,
885,
891,
901,
912,
920,
931,
935,
941,
945,
957,
966,
981,
986,
995,
1003,
1009,
1014,
1020,
1028,
1040,
1049,
1055,
1064,
1082,
1085,
1098,
1104,
1108,
1114,
1119,
1128,
1138,
1145,
1163,
1173,
1182,
1191,
1200,
1208,
1212,
1222,
1227,
1233,
1239,
1245,
1255,
1263,
1268,
1276,
1281,
1298,
1305,
1312,
1320,
1329,
1339,
1350,
1358,
1362,
1369,
1379,
1389,
1399,
1409,
1422,
1429,
1439,
1451,
1461,
1472,
1478,
1486,
1502,
1513,
1527,
1537,
1545,
1560,
1573,
1587,
1599,
1605,
1619,
1628,
1634,
1641,
1648,
1656,
1667,
1678,
1692,
1703,
1710,
1718,
1730,
1737,
1742,
1748,
1754,
1762,
1769,
1777,
1783,
1790,
1797,
1808,
1823,
1833,
1852,
1868,
1887,
1907,
1916,
1928,
1932,
1941,
1947,
1957,
1967,
1972,
1977,
1983,
1990,
1996,
2007,
2017,
2026,
2035,
2045,
2057,
2065,
2075,
2087,
2095,
2105,
2112,
2119,
2128,
2135,
2145,
2157,
2162,
2168,
2176,
2188,
2193,
2197,
2203,
2214,
2226,
2242,
2250,
2264,
2289,
2300,
2315,
2333,
2349,
2372,
2402,
2424,
2437,
2451,
2461,
2475,
2483,
2493,
2512,
2524,
2533,
2557,
2575,
2594,
2604,
2614,
2617,
2625,
2630,
2640,
2649,
2656,
2664,
2670,
2692,
2702,
2721,
2748,
2763,
2789,
2799,
2809,
2815,
2823,
2828,
2837,
2844,
2848,
2851,
2860,
2871,
2885,
2895,
2911,
2928,
2936,
2960,
2980,
2997,
3032,
3050,
3068,
3087,
3103,
3119,
3154,
3168,
3185,
3200,
3211,
3222,
3238,
3249,
3261,
3269,
3277,
3291,
3299,
3309,
3324,
3337,
3349,
3358,
3367,
3381,
3388,
3400,
3406,
3415,
3425,
3432,
3445,
3458,
3465,
3475,
3483,
3498,
3509,
3520,
3528,
3536,
3548,
3555,
3558,
3568,
3580,
3586,
3596,
3601,
3610,
3622,
3631,
3637,
3646,
3655,
3662,
3669,
3681,
3692,
3701,
3712,
3732,
3750,
3767,
3783,
3804,
3857,
3896,
3921,
3965,
3978,
3990,
4004,
4028,
4051,
4061,
4071,
4081,
4089,
4100,
4111,
4118,
4123,
4131,
4143,
4150,
4160,
4173,
4183,
4191,
4200,
4207,
4214,
4224,
4231,
4238,
4250,
4260,
4267,
4277,
4287,
4300,
4310,
4324,
4334,
4344,
4354,
4366,
4377,
4399,
4427,
4439,
4455,
4465,
4475,
4480,
4491,
4500,
4510,
4516,
4525,
4537,
4545,
4554,
4564,
4574,
4581,
4590,
4593,
4603,
4611,
4626,
4640,
4656,
4679,
4702,
4716,
4742,
4763,
4788,
4794,
4824,
4846,
4864,
4879,
4902,
4923,
4956,
4996,
5033,
5055,
5065,
5073,
5079,
5083,
5089,
5096,
5104,
5114,
5121,
5128,
5134,
5141,
5150,
5155,
5163,
5166,
5174,
5177,
5187,
5195,
5202,
5207,
5214,
5219,
5234,
5250,
5283,
5302,
5339,
5354,
5389,
5398,
5418,
5428,
5447,
5456,
5473,
5474,
5505,
5529,
5558,
5568,
5590,
5599,
5639,
5649,
5679,
5689,
5715,
5734,
5776,
5805,
5824,
5860,
5885,
5907,
5924,
5943,
5969,
6001,
6021,
6036,
6057,
6068,
6076,
6084,
6104,
6109,
6117,
6126,
6137,
6147,
6155,
6158,
6167,
6172,
6177,
6183,
6186,
6192,
6195,
6200,
6204,
6209,
6215
];
const SajdaList$1 = [
1162,
1725,
1956,
2142,
2307,
2611,
2910,
3179,
3512,
3987,
4242,
4823
];
const SurahList$1 = [
[
-1,
1,
1,
1,
"",
false
],
[
1,
7,
5,
1,
"الفَاتِحة",
true
],
[
8,
285,
87,
40,
"البَقَرَة",
false
],
[
293,
200,
89,
20,
"آل عِمران",
false
],
[
493,
175,
92,
24,
"النِّسَاء",
false
],
[
668,
122,
112,
16,
"المَائدة",
false
],
[
790,
167,
55,
20,
"الأنعَام",
true
],
[
957,
206,
39,
24,
"الأعرَاف",
true
],
[
1163,
76,
88,
10,
"الأنفَال",
false
],
[
1239,
130,
113,
16,
"التوبَة",
false
],
[
1369,
109,
51,
11,
"يُونس",
true
],
[
1478,
121,
52,
10,
"هُود",
true
],
[
1599,
111,
53,
12,
"يُوسُف",
true
],
[
1710,
44,
96,
6,
"الرَّعد",
false
],
[
1754,
54,
72,
7,
"إبراهِيم",
true
],
[
1808,
99,
54,
6,
"الحِجر",
true
],
[
1907,
128,
70,
16,
"النَّحل",
true
],
[
2035,
110,
50,
12,
"الإسرَاء",
true
],
[
2145,
105,
69,
12,
"الكَهف",
true
],
[
2250,
99,
44,
6,
"مَريَم",
true
],
[
2349,
134,
45,
8,
"طه",
true
],
[
2483,
111,
73,
7,
"الأنبيَاء",
true
],
[
2594,
76,
103,
10,
"الحج",
false
],
[
2670,
119,
74,
6,
"المؤمنُون",
true
],
[
2789,
62,
102,
9,
"النور",
false
],
[
2851,
77,
42,
6,
"الفُرقَان",
true
],
[
2928,
226,
47,
11,
"الشعراء",
true
],
[
3154,
95,
48,
7,
"النَّمل",
true
],
[
3249,
88,
49,
8,
"القَصَص",
true
],
[
3337,
69,
85,
7,
"العَنكبُوت",
true
],
[
3406,
59,
84,
6,
"الرُّوم",
true
],
[
3465,
33,
57,
3,
"لُقمَان",
true
],
[
3498,
30,
75,
3,
"السَّجدة",
true
],
[
3528,
73,
90,
9,
"الأحزَاب",
false
],
[
3601,
54,
58,
6,
"سَبإ",
true
],
[
3655,
46,
43,
5,
"فَاطِر",
true
],
[
3701,
82,
41,
5,
"يسٓ",
true
],
[
3783,
182,
56,
5,
"الصَّافَات",
true
],
[
3965,
86,
38,
5,
"صٓ",
true
],
[
4051,
72,
59,
8,
"الزُّمَر",
true
],
[
4123,
84,
60,
9,
"غَافِر",
true
],
[
4207,
53,
61,
6,
"فُصِّلَت",
true
],
[
4260,
50,
62,
5,
"الشُّوري",
true
],
[
4310,
89,
63,
7,
"الزُّخرُف",
true
],
[
4399,
56,
64,
3,
"الدُّخان",
true
],
[
4455,
36,
65,
4,
"الجاثِية",
true
],
[
4491,
34,
66,
4,
"الأحقَاف",
true
],
[
4525,
39,
95,
4,
"مُحمد",
false
],
[
4564,
29,
111,
4,
"الفَتح",
false
],
[
4593,
18,
106,
2,
"الحُجُرَات",
false
],
[
4611,
45,
34,
3,
"قٓ",
true
],
[
4656,
60,
67,
3,
"الذَّاريَات",
true
],
[
4716,
47,
76,
2,
"الطُّور",
true
],
[
4763,
61,
23,
3,
"النَّجم",
true
],
[
4824,
55,
37,
3,
"القَمَر",
true
],
[
4879,
77,
97,
3,
"الرَّحمٰن",
false
],
[
4956,
99,
46,
3,
"الوَاقِعة",
true
],
[
5055,
28,
94,
4,
"الحدِيد",
false
],
[
5083,
21,
105,
3,
"المُجَادلة",
false
],
[
5104,
24,
101,
3,
"الحَشر",
false
],
[
5128,
13,
91,
2,
"المُمتَحنَة",
false
],
[
5141,
14,
109,
2,
"الصَّف",
false
],
[
5155,
11,
110,
2,
"الجُمعَة",
false
],
[
5166,
11,
104,
2,
"المُنَافِقُونَ",
false
],
[
5177,
18,
108,
2,
"التغَابُن",
false
],
[
5195,
12,
99,
2,
"الطَّلَاق",
false
],
[
5207,
12,
107,
2,
"التَّحرِيم",
false
],
[
5219,
31,
77,
2,
"المُلك",
true
],
[
5250,
52,
2,
2,
"القَلَم",
true
],
[
5302,
52,
78,
2,
"الحَاقة",
true
],
[
5354,
44,
79,
2,
"المَعَارج",
true
],
[
5398,
30,
71,
2,
"نُوح",
true
],
[
5428,
28,
40,
2,
"الجِن",
true
],
[
5456,
18,
3,
2,
"المُزمل",
true
],
[
5474,
55,
4,
2,
"المُدثر",
true
],
[
5529,
39,
31,
2,
"القِيَامة",
true
],
[
5568,
31,
98,
2,
"الإنسَان",
false
],
[
5599,
50,
33,
2,
"المُرسَلات",
true
],
[
5649,
40,
80,
2,
"النَّبَإ",
true
],
[
5689,
45,
81,
2,
"النَّازعَات",
true
],
[
5734,
42,
24,
1,
"عَبَسَ",
true
],
[
5776,
29,
7,
1,
"التَّكوير",
true
],
[
5805,
19,
82,
1,
"الانفِطَار",
true
],
[
5824,
36,
86,
1,
"المُطَففين",
true
],
[
5860,
25,
83,
1,
"الانشِقَاق",
true
],
[
5885,
22,
27,
1,
"البُرُوج",
true
],
[
5907,
17,
36,
1,
"الطَّارق",
true
],
[
5924,
19,
8,
1,
"الأعلى",
true
],
[
5943,
26,
68,
1,
"الغَاشِية",
true
],
[
5969,
32,
10,
1,
"الفَجر",
true
],
[
6001,
20,
35,
1,
"البَلَد",
true
],
[
6021,
15,
26,
1,
"الشَّمس",
true
],
[
6036,
21,
9,
1,
"اللَّيل",
true
],
[
6057,
11,
11,
1,
"الضُّحى",
true
],
[
6068,
8,
12,
1,
"الشَّرح",
true
],
[
6076,
8,
28,
1,
"التِّين",
true
],
[
6084,
20,
1,
1,
"العَلَق",
true
],
[
6104,
5,
25,
1,
"القَدر",
true
],
[
6109,
8,
100,
1,
"البَينَة",
false
],
[
6117,
9,
93,
1,
"الزَّلزَلة",
false
],
[
6126,
11,
14,
1,
"العَاديَات",
true
],
[
6137,
10,
30,
1,
"القَارعَة",
true
],
[
6147,
8,
16,
1,
"التَّكاثُر",
true
],
[
6155,
3,
13,
1,
"العَصر",
true
],
[
6158,
9,
32,
1,
"الهُمَزة",
true
],
[
6167,
5,
19,
1,
"الفِيل",
true
],
[
6172,
5,
29,
1,
"قُرَيش",
true
],
[
6177,
6,
17,
1,
"المَاعُون",
true
],
[
6183,
3,
15,
1,
"الكَوثر",
true
],
[
6186,
6,
18,
1,
"الكافِرون",
true
],
[
6192,
3,
114,
1,
"النَّصر",
false
],
[
6195,
5,
6,
1,
"المَسَد",
true
],
[
6200,
4,
22,
1,
"الإخلَاص",
true
],
[
6204,
5,
20,
1,
"الفَلَق",
true
],
[
6209,
6,
21,
1,
"النَّاس",
true
],
[
6216,
1,
1,
1,
"",
false
]
];
/**
* Qalun riwaya metadata
*/
const QalunMeta = {
riwayaName: "Qalun",
numAyahs: 6214,
numSurahs: 114,
numPages: 604,
numJuzs: 30,
numHizbs: 60,
numRubAlHizbs: 240,
numThumunAlHizbs: 480,
numRubsInJuz: 8,
numSajdas: 12,
numRukus: 556,
numManzils: 7
};
const QalunLists = {
meta: QalunMeta,
HizbEighthList,
HizbQuarterList: HizbQuarterList$1,
JuzList: JuzList$1,
ManzilList: ManzilList$1,
PageList: PageList$1,
RukuList: RukuList$1,
SajdaList: SajdaList$1,
SurahList: SurahList$1
};
//#endregion
//#region src/lists/types.ts
const parts = {
surah: "SurahList",
juz: "JuzList",
rubAlHizb: "HizbQuarterList",
thumunAlHizb: "HizbEighthList",
page: "PageList",
manzil: "ManzilList",
ruku: "RukuList"
};
//#endregion
//#region src/lists/getList.ts
function toPartFormatter(type, list) {
return type === "surah" ? ([startAyahId, ayahCount]) => ({
startAyahId,
ayahCount
}) : (ayahId, index) => {
return {
startAyahId: ayahId,
ayahCount: list[index + 2] - ayahId
};
};
}
/**
* Retrieves a formatted list of Quran parts based on the specified type.
* @param name - The type of parts to retrieve (e.g., juz, hizb, rub)
* @param data - The Lists object for the riwaya.
* @returns An array of formatted part blocks, excluding the first and last elements
*/
function generatePartBlocks$1(name, data) {
if (!parts[name]) throw new Error(`Invalid part type: ${name}`);
const listName = parts[name];
const list = data[listName];
if (!list) return null;
if (!Array.isArray(list)) throw new TypeError(`Expected array for ${String(listName)}`);
return list.slice(1, -1).map(toPartFormatter(name, list));
}
const getList$1 = (name, lists) => {
if (!parts[name]) throw new Error(`Invalid list name: ${name}`);
const listName = parts[name];
if (listName in lists) return lists[listName];
throw new Error(`List ${String(listName)} not found in ${lists.meta.riwayaName} riwaya`);
};
function getListNormalised$1(name, lists) {
const list = getList$1(name, lists);
return list.slice(1, list.length - 1).map(toPartFormatter(name, list));
}
//#endregion
//#region src/types.ts
/**
* The maximum number of ayahs (verses) that can exist in any surah (chapter) of the Quran.
* This maximum occurs in Surah Al-Baqarah (2), which has 286 ayahs.
*/
const maxAyahsInSurah = 286;
//#endregion
//#region src/validation.ts
/**
* Validates if the provided value is a valid Surah number.
*
* @param surah - The value to validate, can be a Surah object, number, or unknown type
* @throws TypeError When the provided value is not an integer
* @throws RangeError When the provided surah number is outside the valid range (1 to total number of surahs)
* @remarks This is a type assertion function that ensures the input is a valid Surah
*/
function checkValidSurah$1(surah, meta$1) {
if (typeof surah !== "number" || !Number.isInteger(surah)) throw new TypeError("Ayah ID must be an integer");
if (!isValidSurah$1(surah, meta$1)) throw new RangeError("Surah must be between 1 and " + meta$1.numSurahs);
}
/**
* Validates if the given surah and ayah numbers form a valid combination.
* @param surah - The surah number or Surah object to validate
* @param ayah - The ayah number or AyahNo object to validate
* @throws Error If the surah-ayah combination is invalid
*/
function checkValidSurahAyah$1(surah, ayah, data) {
checkValidSurahAyahPair$1([surah, ayah], data);
}
/**
* Validates that a surah-ayah pair contains valid values
* @param surahAyah - A tuple containing surah number/object and ayah number
* @throws RangeError If ayah number is not between 1 and the maximum ayah count for the given surah
* @throws If surah is invalid (from checkValidSurah)
* @example
* ```ts
* checkValidSurahAyahPair([1, 7]) // Valid
* checkValidSurahAyahPair([1, 8]) // Throws RangeError
* ```
*/
function checkValidSurahAyahPair$1(surahAyah, data) {
const [surah, ayah] = surahAyah;
checkValidSurah$1(surah, data.meta);
if (typeof ayah !== "number" || !Number.isInteger(ayah) || ayah < 1 || ayah > getAyahCountInSurah$1(surah, data)) throw new RangeError("Ayah must be between 1 and " + getAyahCountInSurah$1(surah, data));
}
/**
* Validates and asserts that the given value is a valid Ayah ID.
* An Ayah ID must be an integer between 1 and the total number of Ayahs.
*
* @param ayahId - The value to check as an Ayah ID
* @throws TypeError If the value is not an integer
* @throws RangeError If the value is not within valid Ayah ID range
*/
function checkValidAyahId$1(ayahId, meta$1) {
if (typeof ayahId !== "number" || !Number.isInteger(ayahId)) throw new TypeError("Ayah ID must be an integer");
if (!isValidAyahId$1(ayahId, meta$1)) throw new RangeError("Ayah ID must be between 1 and " + meta$1.numAyahs);
}
/**
* Checks if a value is a valid Page number.
* @param x - The value to check
* @throws {@link TypeError} When the value is not an integer
* @throws {@link RangeError} When the value is not within valid page range (1 to numPages)
* @remarks This is a type assertion function that ensures a value is a valid Page number
*/
function checkValidPage$1(x, meta$1) {
if (typeof x !== "number" || !Number.isInteger(x)) throw new TypeError("Page must be an integer");
if (!isValidPage$1(x, meta$1)) throw new RangeError("Page must be between 1 and " + meta$1.numPages);
}
/**
* Type guard that checks if a value is a valid Juz number.
* Throws TypeError if value is not an integer.
* Throws RangeError if value is outside valid Juz range.
*
* @param x - Value to check
* @throws {@link TypeError} If value is not an integer
* @throws {@link RangeError} If value is not between 1 and the total number of Juz
*/
function checkValidJuz$1(x, meta$1) {
if (typeof x !== "number" || !Number.isInteger(x)) throw new TypeError("Juz must be an integer");
if (!isValidJuz$1(x, meta$1)) throw new RangeError("Juz must be between 1 and " + meta$1.numJuzs);
}
/**
* Type guard that checks if a value is a valid Ruku number.
* @param x - The value to check
* @throws {@link TypeError} If the value is not an integer number
* @throws {@link RangeError} If the number is not within valid Ruku range
* @example
* ```ts
* checkValidRuku(5); // OK
* checkValidRuku("5"); // Throws TypeError
* checkValidRuku(999); // Throws RangeError
* ```
*/
function checkValidRuku$1(x, meta$1) {
if (typeof x !== "number" || !Number.isInteger(x)) throw new TypeError("Ruku must be an integer");
if (!isValidRuku$1(x, meta$1)) throw new RangeError("Ruku must be between 1 and " + meta$1.numRukus);
}
/**
* Type guard that checks if a value is a valid Manzil number.
* @param x - The value to check
* @throws {@link TypeError} If the value is not an integer
* @throws {@link RangeError} If the value is not within valid Manzil range (1 to max manzils)
* @remarks This is an assertion function that ensures the input is a valid Manzil type
*/
function checkValidManzil$1(x, meta$1) {
if (typeof x !== "number" || !Number.isInteger(x)) throw new TypeError("Manzil must be an integer");
if (!isValidManzil(x, meta$1)) throw new RangeError("Manzil must be between 1 and " + meta$1.numManzils);
}
//#endregion
//#region src/getSurahInfo.ts
/**
* Gets the metadata for the specified Surah.
*
* @param surah - The Surah to get the metadata for.
* @param data - The Lists object containing SurahList.
* @returns The metadata for the specified Surah.
*/
function getSurahInfo$1(surah, data) {
checkValidSurah$1(surah, data.meta);
return data.SurahList[surah];
}
//#endregion
//#region src/getAyahCountInSurah.ts
/**
* Get the number of ayahs (verses) in the specified surah.
* @param surah - The surah number.
* @param data - The Lists object containing SurahList.
* @returns The number of ayahs in the specified surah.
*/
function getAyahCountInSurah$1(surah, data) {
return getSurahInfo$1(surah, data)[1];
}
//#endregion
//#region src/typeGuards.ts
/**
* Checks if the given value is a valid AyahId.
*
* @param x - The value to check.
* @returns True if the value is a valid AyahId, otherwise false.
*/
function isValidAyahId$1(x, meta$1) {
return Number.isInteger(x) && 1 <= x && x <= meta$1.numAyahs;
}
/**
* Checks if the given value is a valid Ayah number.
*
* @param x - The value to check.
* @returns True if the value is a valid Ayah number, otherwise false.
*/
function isValidAyahNo$1(x) {
return Number.isInteger(x) && 1 <= x && x <= maxAyahsInSurah;
}
/**
* Checks if the given value is a valid Surah number.
*
* @param x - The value to check.
* @returns `true` if the value is a valid Surah number, otherwise `false`.
*/
function isValidSurah$1(x, meta$1) {
return Number.isInteger(x) && 1 <= x && x <= meta$1.numSurahs;
}
/**
* Type guard function that checks if a tuple of two numbers represents a valid Surah and Ayah combination.
*
* @param x - A tuple containing [surahNumber, ayahNumber]
* @param lists - The Lists object for the riwaya
* @returns True if the tuple represents a valid Surah-Ayah combination, false otherwise
*
* @example
* ```ts
* isValidSurahAyah([1, 7], HafsLists) // true - Al-Fatiha has 7 ayahs
* isValidSurahAyah([1, 8], HafsLists) // false - Al-Fatiha only has 7 ayahs
* isValidSurahAyah([115, 1], HafsLists) // false - there are only 114 surahs
* ```
*/
function isValidSurahAyah$1(x, data) {
const [surah, ayah] = x;
if (!isValidSurah$1(surah, data.meta)) return false;
return Number.isInteger(ayah) && ayah >= 1 && ayah <= getAyahCountInSurah$1(surah, data);
}
/**
* Type guard that checks if a number is a valid Juz number
* @param x - The number to check
* @returns True if the number is an integer between 1 and the total number of Juzs (inclusive)
*/
function isValidJuz$1(x, meta$1) {
return Number.isInteger(x) && 1 <= x && x <= meta$1.numJuzs;
}
/**
* Type guard to check if a number is a valid Quran page number
* @param x - The number to check
* @returns True if the number is an integer between 1 and the total number of pages (inclusive)
*/
function isValidPage$1(x, meta$1) {
return Number.isInteger(x) && 1 <= x && x <= meta$1.numPages;
}
/**
* Type guard that checks if a value is a valid Ruku number
* @param x - The value to check
* @returns True if x is an integer between 1 and the total number of Rukus
* @example
* ```ts
* if (isValidRuku(5)) {
* // 5 is a valid Ruku number
* }
* ```
*/
function isValidRuku$1(x, meta$1) {
return Number.isInteger(x) && 1 <= x && x <= meta$1.numRukus;
}
/**
* Type guard to check if a value is a valid Manzil number
*
* @param x - The value to check
* @returns True if the value is an integer between 1 and the total number of Manzils
*
* @example
* ```ts
* if (isValidManzil(3)) {
* // value is a valid Manzil number
* }
* ```
*/
function isValidManzil(x, meta$1) {
return Number.isInteger(x) && 1 <= x && x <= meta$1.numManzils;
}
//#endregion
//#region src/ayahStringSplitter.ts
/**
* Splits a string representation of Quran reference into surah and ayah components
* @param str - The string to parse, expected format: "surah:ayah" or "surah:ayahStart-ayahEnd"
* @param isStrict - If true, enforces strict format checking. Defaults to true. If false, allows for additional characters in the string
* @returns A tuple containing surah number and either a single ayah number or a range [start, end]
* @throws {@link Error} If the string format is invalid
* @throws {@link Error} If surah number is invalid
* @throws {@link Error} If ayah number(s) are invalid
* @throws {@link sError} If ayah range is invalid (start should be less than end)
* @example
* ```ts
* ayahStringSplitter("2:255") // returns [2, 255]
* ayahStringSplitter("1:1-7") // returns [1, [1, 7]]
* ```
*/
function ayahStringSplitter$1(str, isStrict = true, data) {
const result = isStrict ? string2NumberSplitterStrict(str) : string2NumberSplitter$1(str);
if (!result) throw new Error("Invalid string format: " + str);
const { surahOrAyah: surahX, ayah, ayahTo } = result;
const meta$1 = data.meta;
if (!isValidSurah$1(surahX, meta$1)) throw new Error("Invalid ayah number: " + str);
const surah = surahX;
let ayahs;
if (ayahTo) {
checkValidAyahId$1(ayah, meta$1);
checkValidAyahId$1(ayahTo, meta$1);
if (ayah > ayahTo) throw new Error("Invalid ayah range: " + str);
ayahs = [ayah, ayahTo];
} else {
if (!isValidAyahNo$1(ayah)) throw new Error("Error in data " + str);
checkValidSurahAyah$1(surah, ayah, data);
ayahs = ayah;
}
return [surah, ayahs];
}
/**
* Splits a string containing surah and ayah numbers into their numeric components.
*
* @param str - Input string containing numbers separated by non-digits (e.g., "2:255" or "2 255" or "2-255")
* @returns An object containing the parsed numbers, or null if parsing fails
* - ayah: The ayah number if present
* - ayahTo: The ending ayah number if a range is specified
* - surahOrAyah: The surah number
* @example
* stringNumberSplitter("2:255") // returns \{ ayah: 255, ayahTo: 0, surahOrAyah: 2 \}
* stringNumberSplitter("2:255-260") // returns \{ ayah: 255, ayahTo: 260, surahOrAyah: 2 \}
* stringNumberSplitter("invalid") // returns null
*/
function string2NumberSplitter$1(str) {
const sr = /(?<surah>\d{1,3})\D*(?<ayah>\d{0,3})\D*(?<ayahTo>\d{0,3})/.exec(str);
if (sr?.groups && +sr.groups.surah > 0) {
const { ayah, ayahTo, surah } = sr.groups;
return {
surahOrAyah: +surah,
ayah: +ayah,
ayahTo: +ayahTo
};
}
return null;
}
/**
* Splits a string in the format "surah:ayah" or "surah:ayah-ayah" into its numeric components.
*
* @param str - The input string to parse in the format "surah:ayah" or "surah:ayah-ayah"
* @returns An object containing the parsed numbers:
* - surahOrAyah: The surah number
* - ayah: The first or only ayah number
* - ayahTo: The ending ayah number (if range specified)
* @throws {@link Error} When the input string format is invalid or contains non-numeric values
*
* @example
* string2NumberSplitterStrict("2:255") // returns \{ surahOrAyah: 2, ayah: 255, ayahTo: NaN \}
* string2NumberSplitterStrict("2:255-260") // returns \{ surahOrAyah: 2, ayah: 255, ayahTo: 260 \}
*/
function string2NumberSplitterStrict(str) {
let [surahStr, ayahsStr] = str.trim().split(":");
surahStr = surahStr.trim();
const surahX = parseInt(surahStr.trim(), 10);
if (isNaN(surahX)) throw new Error("Error in surah format " + str);
ayahsStr = ayahsStr.trim();
if (!ayahsStr) throw new Error("Error in data " + str);
let ayahs;
if (ayahsStr.includes("-")) ayahs = ayahsStr.split("-").map((a) => {
const ayahX = parseInt(a, 10);
if (isNaN(ayahX)) throw new Error("Error in surah format " + str);
return ayahX;
});
else {
const ayahX = parseInt(ayahsStr, 10);
if (isNaN(ayahX)) throw new Error("Error in surah format " + str);
ayahs = [ayahX, NaN];
}
return {
surahOrAyah: +surahX,
ayah: +ayahs[0],
ayahTo: +ayahs[1]
};
}
//#endregion
//#region src/findAyahIdBySurah.ts
/**
* Get the ayah ID for the given surah and ayah number.
* @param surah - The surah number.
* @param ayah - The ayah number within the surah.
* @param data - The Lists object containing SurahList.
* @returns The ayah ID for the given surah and ayah number.
*/
function findAyahIdBySurah$1(surah, ayah, data) {
checkValidSurahAyah$1(surah, ayah, data);
const [startAyahId] = data.SurahList[surah];
return startAyahId + ayah - 1;
}
//#endregion
//#region src/utils.ts
/**
* Performs a binary search on the given array to find the index of the specified element.
*
* @param ar - The array to search.
* @param el - The element to search for.
* @param compare_fn - An optional comparison function to use for the search. Defaults to a simple numeric comparison.
* @returns The index of the element if found, or a negative value indicating the insertion point if not found.
*/
function binarySearch(ar, el, compare_fn = (a, b) => a - b) {
let m = 0;
let n = ar.length - 1;
while (m <= n) {
const k = n + m >> 1;
const cmp = compare_fn(el, ar[k]);
if (cmp > 0) m = k + 1;
else if (cmp < 0) n = k - 1;
else return k;
}
return -m - 1;
}
//#endregion
//#region src/findJuzByAyahId.ts
/**
* Finds the Juz (part) of the Quran that contains the given Ayah (verse) ID.
*
* @param ayahId - The ID of the Ayah (verse) to find the Juz for.
* @param data - The Lists object containing JuzList.
* @returns The Juz (part) of the Quran that contains the given Ayah ID.
*/
function findJuzByAyahId$1(ayahId, data) {
checkValidAyahId$1(ayahId, data.meta);
const jj = binarySearch(data.JuzList, ayahId);
return jj < 0 ? -jj - 2 : jj;
}
//#endregion
//#region src/findJuz.ts
/**
* Finds the Juz (part) of the Quran that the given Ayah (verse) belongs to.
*
* @param surah - The Surah (chapter) number.
* @param ayah - The Ayah (verse) number. Defaults to 1 if not provided.
* @param lists - The Lists object containing JuzList and SurahList.
* @returns The Juz (part) number that the given Ayah belongs to.
*/
function findJuz$1(surah, ayah = 1, lists) {
return findJuzByAyahId$1(findAyahIdBySurah$1(surah, ayah, lists), lists);
}
//#endregion
//#region src/findSurahAyahByAyahId.ts
/**
* Finds the Surah (chapter) and Ayah (verse) numbers that the given Ayah ID belongs to.
*
* @param ayahId - The Ayah ID to find the Surah and Ayah numbers for.
* @param lists - The Lists object containing SurahList.
* @returns An array containing the Surah number and the Ayah number within that Surah.
*/
function findSurahAyahByAyahId$1(ayahId, data) {
checkValidAyahId$1(ayahId, data.meta);
const SurahList$2 = data.SurahList;
const ss = binarySearch(SurahList$2, ayahId, (aya, b) => aya - b[0]);
const suraNum = ss < 0 ? -ss - 2 : ss;
return [suraNum, ayahId - SurahList$2[suraNum][0] + 1];
}
//#endregion
//#region src/findSurahByAyahId.ts
/**
* Finds a Surah based on the provided Ayah ID.
*
* @param ayaId - The unique identifier of the Ayah
* @param data - The Lists object containing SurahList.
* @returns The Surah that contains the specified Ayah
*
* @example
* const surah = findSurahByAyahId(1234, data);
*/
function findSurahByAyahId$1(ayaId, data) {
return findSurahAyahByAyahId$1(ayaId, data)[0];
}
//#endregion
//#region src/findJuzAndShift.ts
/**
* Finds the juz (section) that contains the specified ayah (verse) and calculates the number of ayahs between the start of the juz and the start of the surah (chapter) that contains the ayah.
*
* @param surah - The surah (chapter) that contains the ayah.
* @param ayah - The ayah (verse) number.
* @param lists - The Lists object for the riwaya.
* @returns An object containing the following properties:
* - `juz`: The juz (section) that contains the ayah.
* - `leftAyahId`: The ayah ID of the first ayah in the juz.
* - `ayahsBetweenJuzSurah`: The number of ayahs between the start of the juz and the start of the surah (positive if the surah starts is in the juz, negative if the surah starts before the juz).
*/
function findJuzAndShift$1(surah, ayah, lists) {
const ayahId = findAyahIdBySurah$1(surah, ayah, lists);
const JuzList$2 = lists.JuzList;
const SurahList$2 = lists.SurahList;
const juz = findJuzByAyahId$1(ayahId, lists);
const juzLeftAyahId = JuzList$2[juz];
const [surahStartAyahId] = SurahList$2[surah];
return {
juz,
ayahsBetweenJuzSurah: surahStartAyahId - juzLeftAyahId,
leftAyahId: juzLeftAyahId
};
}
/**
* Finds the Juz number and calculates the shift between Juz start and Surah start for a given Ayah ID
*
* @param ayahId - The unique identifier of an Ayah (verse) in the Quran
* @param data - The Lists object for the riwaya.
* @returns An object containing:
* - juz: The Juz number where the Ayah is located
* - leftAyahId: The starting Ayah ID of the Juz
* - ayahsBetweenJuzSurah: The number of Ayahs between the Juz start and the Surah start
*
* @throws Error If the provided Ayah ID is invalid
*/
function findJuzAndShiftByAyahId$1(ayahId, data) {
checkValidAyahId$1(ayahId, data.meta);
const JuzList$2 = data.JuzList;
const SurahList$2 = data.SurahList;
const juz = findJuzByAyahId$1(ayahId, data);
const leftAyahId = JuzList$2[juz];
const [surahStartAyahId] = SurahList$2[findSurahByAyahId$1(ayahId, data)];
return {
juz,
ayahsBetweenJuzSurah: surahStartAyahId - leftAyahId,
leftAyahId
};
}
//#endregion
//#region src/findJuzMetaBySurah.ts
/**
* Finds the SurahJuzMeta for a given Surah and Ayah.
*
* @param surah - The Surah (chapter) number.
* @param ayah - The Ayah (verse) number.
* @param data - The Lists object for the riwaya.
* @returns The SurahJuzMeta object containing the left juz, ayahs between juz and surah, right juz, ayah ID of first ayah in left juz, and last ayah ID of right juz .
*/
function findJuzMetaBySurah$1(surah, ayah = 1, data) {
const { juz: leftjuz, ayahsBetweenJuzSurah, leftAyahId } = findJuzAndShift$1(surah, ayah, data);
const JuzList$2 = data.JuzList;
let rightJuz = leftjuz;
while (rightJuz < data.meta.numJuzs && findSurahByAyahId$1(JuzList$2[rightJuz + 1], data) === surah) rightJuz++;
return {
leftjuz,
ayahsBetweenJuzSurah,
rightJuz,
leftAyahId,
rightAyahId: JuzList$2[rightJuz + 1]
};
}
//#endregion
//#region src/findManzilByAyahId.ts
/**
* Finds the Manzil number for a given Ayah ID using binary search.
* A Manzil is one of seven approximately equal divisions of the Quran.
*
* @param ayahId - The ID of the Ayah to find the Manzil for
* @param data - The Lists object for the riwaya.
* @returns The Manzil number (1-7) containing the specified Ayah
* @throws {@link Error} If the provided Ayah ID is invalid
*
* @example
* ```typescript
* const manzil = findManzilByAyahId(2345, HafsLists); // Returns the Manzil containing Ayah 2345
* ```
*/
function findManzilByAyahId$1(ayahId, data) {
checkValidAyahId$1(ayahId, data.meta);
const ManzilList$2 = data.ManzilList;
const jj = binarySearch(ManzilList$2, ayahId);
return jj < 0 ? -jj - 2 : jj;
}
//#endregion
//#region src/findManzil.ts
/**
* Finds the Manzil number for a given Surah and Ayah
* @param surah - The Surah number or object
* @param ayah - Optional Ayah number (defaults to 1)
* @param data - The Lists object for the riwaya.
* @returns The Manzil number (1-7) containing the specified Ayah
*/
function findManzil$1(surah, ayah = 1, data) {
return findManzilByAyahId$1(findAyahIdBySurah$1(surah, ayah, data), data);
}
//#endregion
//#region src/findPage.ts
/**
* Finds the page number for the given Surah and Ayah number.
*
* @param surah - The Surah to find the page for.
* @param ayah - The Ayah number to find the page for.
* @param data - The Lists object for the riwaya.
* @returns The page number for the given Surah and Ayah.
*/
function findPage$1(surah, ayah = 1, data) {
checkValidSurah$1(surah, data.meta);
const ayahId = findAyahIdBySurah$1(surah, ayah, data);
const PageList$2 = data.PageList;
const jj = binarySearch(PageList$2, ayahId);
return jj < 0 ? -jj - 2 : jj;
}
//#endregion
//#region src/findPagebyAyahId.ts
/**
* Returns the page number for a given ayah ID in the Quran.
*
* @param ayahId - A numeric identifier representing a verse (ayah) in the Quran
* @param data - The Lists object for the riwaya.
* @returns The page number where the specified ayah can be found
* @throws Will throw an error if the ayahId is invalid
*
* @example
* ```ts
* const page = findPagebyAyahId(142, HafsLists); // Returns the page number containing ayah 142
* ```
*/
function findPagebyAyahId$1(ayahId, data) {
checkValidAyahId$1(ayahId, data.meta);
const PageList$2 = data.PageList;
const jj = binarySearch(PageList$2, ayahId);
return jj < 0 ? -jj - 2 : jj;
}
//#endregion
//#region src/findRukuByAyahId.ts
/**
* Finds the Ruku number for a given Ayah ID using binary search.
*
* @param ayahId - The unique identifier of an Ayah in format: surah:ayah (e.g., "2:255")
* @param data - The Lists object for the riwaya.
* @returns The Ruku number corresponding to the given Ayah ID
* @throws {@link Error} If the provided Ayah ID is invalid
*
* @example
* ```ts
* const ruku = findRukuByAyahId("2:255", HafsLists);
* // Returns the Ruku number containing Ayah 255 of Surah 2
* ```
*/
function findRukuByAyahId$1(ayahId, data) {
checkValidAyahId$1(ayahId, data.meta);
const RukuList$2 = data.RukuList;
const jj = binarySearch(RukuList$2, ayahId);
return jj < 0 ? -jj - 2 : jj;
}
//#endregion
//#region src/findRangeAroundAyah.ts
/**
* Finds the range of ayahs surrounding a given ayah based on specified mode
* @param ayahId - The unique identifier of the ayah
* @param mode - The scope for finding the range:
* - "juz": Returns range of ayahs in the same juz
* - "surah": Returns range of ayahs in the same surah
* - "ayah": Returns the single ayah as both start and end of range
* - "page": Returns range of ayahs on the same page
* - "ruku": Returns range of ayahs on the same ruku
* - "all": Returns range covering all ayahs (1 to total number of ayahs)
* @param data - The Lists object for the riwaya.
* @returns An array of two numbers representing the start and end ayah IDs of the range [startAyahId, endAyahId]
*/
function findRangeAroundAyah$1(ayahId, mode, data) {
const JuzList$2 = data.JuzList;
const SurahList$2 = data.SurahList;
const PageList$2 = data.PageList;
const RukuList$2 = data.RukuList;
switch (mode) {
case "juz": {
const juz = findJuzByAyahId$1(ayahId, data);
return [JuzList$2[juz], JuzList$2[juz + 1] - 1];
}
case "surah": {
const surah = findSurahByAyahId$1(ayahId, data);
return [SurahList$2[surah][0], SurahList$2[surah + 1][0] - 1];
}
case "ayah": return [ayahId, ayahId];
case "page": {
const page = findPagebyAyahId$1(ayahId, data);
return [PageList$2[page], PageList$2[page + 1] - 1];
}
case "ruku": {
const ruku = findRukuByAyahId$1(ayahId, data);
return [RukuList$2[ruku], RukuList$2[ruku + 1] - 1];
}
case "all":
default: return [1, data.meta.numAyahs];
}
}
//#endregion
//#region src/findRangeAroundSurahAyah.ts
/**
* Finds a range of ayahs around a given ayah based on the specified mode.
*
* @param surah - The surah number (1-114)
* @param ayah - The ayah number within the surah
* @param mode - The range mode: "juz", "surah", "ayah", "page", "ruku" or "all"
* @param lists - The Lists object for the riwaya.
* @returns A tuple containing the start and end ayah IDs of the range
*/
function findRangeAroundSurahAyah$1(surah, ayah, mode, data) {
checkValidSurah$1(surah, data.meta);
const SurahList$2 = data.SurahList;
if (mode === "surah") return [SurahList$2[surah][0], SurahList$2[surah + 1][0] - 1];
return findRangeAroundAyah$1(findAyahIdBySurah$1(surah, ayah, data), mode, data);
}
//#endregion
//#region src/findRubAlHizbByAyahId.ts
/**
* Finds the Maqra/Rub-al-Hizb of the Quran that contains the given Ayah (verse) ID.
*
* @param ayahId - The ID of the Ayah (verse) to find the Juz for.
* @param lists - The Lists object for the riwaya.
* @returns The Maqra of the Quran that contains the given Ayah ID.
*/
function findRubAlHizbByAyahId$1(ayahId, data) {
checkValidAyahId$1(ayahId, data.meta);
const HizbQuarterList$2 = data.HizbQuarterList;
const jj = binarySearch(HizbQuarterList$2, ayahId);
return jj < 0 ? -jj - 2 : jj;
}
//#endregion
//#region src/findRubAlHizb.ts
/**
* Finds the Juz (part) and Rub-ul-Hizb/Maqra (quarter section) of the Quran that the given Ayah (verse) belongs to.
*
* @param surah - The Surah (chapter) number.
* @param ayah - The Ayah (verse) number. Defaults to 1 if not provided.
* @param data - The Lists object containing SurahList and HizbQuarterList.
* @returns An object containing the Juz (part) number, Hizb (section) number, and the index of the Hizb that the given Ayah belongs to.
*/
function findRubAlHizb$1(surah, ayah = 1, data) {
checkValidSurah$1(surah, data.meta);
return findRubAlHizbByAyahId$1(findAyahIdBySurah$1(surah, ayah, data), data);
}
//#endregion
//#region src/findThumunAlHizbByAyahId.ts
/**
* Finds the Maqra/Rub-al-Hizb of the Quran that contains the given Ayah (verse) ID.
*
* @param ayahId - The ID of the Ayah (verse) to find the Juz for.
* @param data - The Lists object for the riwaya.
* @returns The thumun of the Quran that contains the given Ayah ID.
*/
function findThumunAlHizbByAyahId$1(ayahId, data) {
checkValidAyahId$1(ayahId, data.meta);
const HizbEighthList$1 = data.HizbEighthList;
if (!HizbEighthList$1) throw new Error(`Riwaya ${data.meta.riwayaName} does not have Hizb Eighth List data.`);
const jj = binarySearch(HizbEighthList$1, ayahId);
return jj < 0 ? -jj - 2 : jj;
}
//#endregion
//#region src/findThumunAlHizb.ts
/**
* Finds the Juz (part) and thumun-ul-Hizb (Eighth section) of the Quran that the given Ayah (verse) belongs to.
*
* @param surah - The Surah (chapter) number.
* @param ayah - The Ayah (verse) number. Defaults to 1 if not provided.
* @param riwaya - The riwaya. Defaults to "Qalun" if not provided.
* @returns An object containing the Juz (part) number, Hizb (section) number, and the index of the Hizb that the given Ayah belongs to.
*/
function findThumunAlHizb$1(surah, ayah = 1, data) {
checkValidSurah$1(surah, data.meta);
return findThumunAlHizbByAyahId$1(findAyahIdBySurah$1(surah, ayah, data), data);
}
//#endregion
//#region src/getRubAlHizb.ts
/**
* Retrieves the basic metadata for a specific quarter (rub' al-hizb) of the Quran.
*
* @param quarterIndex - The index of the quarter (rub' al-hizb) to retrieve metadata for, where 1 is the first quarter.
* @param riwaya - The riwaya. Defaults to "Hafs" if not provided.
* @returns An object containing the metadata for the specified quarter, including the juz' (part), hizb (section), and the quarter (rub' al-hizb) index.
*/
function getRubAlHizb$1(quarterIndex) {
return {
juz: Math.floor((quarterIndex - 1) / 8) + 1,
hizbId: Math.floor((quarterIndex - 1) / 4) + 1,
juzPart: quarterIndex % 8 || 8,
rubAlHizbId: quarterIndex
};
}
//#endregion
//#region src/getThumunAlHizb.ts
/**
* Retrieves the basic metadata for a specific Eighth (thumun' al-hizb) of the Quran.
*
* @param eighthIndex - The index of the Eighth (thumun' al-hizb) to retrieve metadata for, where 1 is the first quarter.
* @returns An object containing the metadata for the specified quarter, including the juz' (part), hizb (section), and the quarter (rub' al-hizb) index.
*/
function getThumunAlHizb$1(eighthIndex) {
return {
...getRubAlHizb$1(Math.floor((eighthIndex - 1) / 2) + 1),
thumunAlHizbId: eighthIndex
};
}
//#endregion
//#region src/getThumunAlHizbByAyahId.ts
/**
* Finds the Juz, Hizb, Rub-el-Hizb id and thuumun-el-Hizb id for the given Ayah ID.
*
* @param ayahId - The Ayah ID to find the Juz, Hizb, and Hizb ID for.
* @param data - The riwaya. Defaults to "Qalun" if not provided.
* @retu