@zodiacs/engine 1.0.0 → 1.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +1020 -0
  2. package/LICENSING.md +168 -27
  3. package/NOTICE +78 -12
  4. package/README.md +288 -44
  5. package/dist/{api-WbxJ4Wj-.d.ts → api-ChL1N2Sr.d.ts} +33 -2
  6. package/dist/{ayanamsa--YQ46fET.d.ts → ayanamsa-ClFzkKmV.d.ts} +2 -1
  7. package/dist/calc.d.ts +90 -4
  8. package/dist/calc.js +360 -126
  9. package/dist/chunk-2PZYJQV5.js +83 -0
  10. package/dist/{chunk-7TRLIFFI.js → chunk-4XOYTBLS.js} +1 -1
  11. package/dist/chunk-767FTO7O.js +48 -0
  12. package/dist/{chunk-YIITY7Q7.js → chunk-7Y2F2IWN.js} +19 -17
  13. package/dist/{chunk-OG4OYTJJ.js → chunk-B4M2Y7FT.js} +1 -129
  14. package/dist/{chunk-PFGUCNOK.js → chunk-BMDASNPB.js} +6 -6
  15. package/dist/chunk-I3L4POY7.js +18 -0
  16. package/dist/{chunk-CHSYDKBL.js → chunk-LNGURVNH.js} +3 -3
  17. package/dist/{chunk-DMGHYCDI.js → chunk-NNOSOOWS.js} +1 -1
  18. package/dist/chunk-OVXQQEXL.js +41 -0
  19. package/dist/{chunk-SRXBTP5H.js → chunk-QLIEEICB.js} +201 -190
  20. package/dist/chunk-RMBWKZI2.js +130 -0
  21. package/dist/{chunk-FTX3JDJA.js → chunk-TZVPZHZM.js} +42 -23
  22. package/dist/{chunk-WS3TDSP3.js → chunk-WBTWY2OB.js} +7 -3
  23. package/dist/chunk-Y4E3WJU5.js +87 -0
  24. package/dist/chunk-YPU3MDNI.js +852 -0
  25. package/dist/conventions.d.ts +70 -0
  26. package/dist/conventions.js +26 -0
  27. package/dist/crossings.d.ts +15 -4
  28. package/dist/de440-pack.d.ts +43 -0
  29. package/dist/de440-pack.js +16 -0
  30. package/dist/de440.d.ts +113 -0
  31. package/dist/de440.js +19 -0
  32. package/dist/ephemeris-exTSqBgb.d.ts +60 -0
  33. package/dist/geo.d.ts +16 -4
  34. package/dist/geo.js +2 -2
  35. package/dist/{houses-CFERsAlK.d.ts → houses-Bh7GCnPi.d.ts} +3 -3
  36. package/dist/houses-extra.d.ts +5 -4
  37. package/dist/index.d.ts +8 -6
  38. package/dist/index.js +40 -28
  39. package/dist/{internal-math-DJJ8BYex.d.ts → internal-math-CxenuGfm.d.ts} +2 -2
  40. package/dist/internal-math.d.ts +4 -3
  41. package/dist/internal-math.js +14 -12
  42. package/dist/internal.d.ts +16 -7
  43. package/dist/internal.js +25 -4
  44. package/dist/lite-composite.js +114 -0
  45. package/dist/lite-declinations.js +253 -0
  46. package/dist/lite-dignities.js +333 -0
  47. package/dist/lite-sect.js +72 -0
  48. package/dist/lite.d.ts +82 -0
  49. package/dist/lite.js +4 -0
  50. package/dist/receipt.d.ts +3 -2
  51. package/dist/receipt.js +143 -65
  52. package/dist/{rulers-Dla6h_Sm.d.ts → rulers-CSSWtiWF.d.ts} +1 -1
  53. package/dist/sky.d.ts +4 -3
  54. package/dist/sky.js +17 -10
  55. package/dist/techniques.d.ts +102 -6
  56. package/dist/techniques.js +131 -56
  57. package/dist/time-bands-CZA9AlLg.d.ts +36 -0
  58. package/dist/time-scale-DIFNa0gz.d.ts +47 -0
  59. package/dist/time.d.ts +81 -0
  60. package/dist/time.js +74 -0
  61. package/dist/timing.d.ts +6 -5
  62. package/dist/timing.js +24 -17
  63. package/dist/types-DpPdtXgO.d.ts +335 -0
  64. package/dist/vedic.d.ts +112 -4
  65. package/dist/vedic.js +369 -14
  66. package/dist/window.d.ts +22 -2
  67. package/dist/window.js +86 -28
  68. package/dist/{zone-history-ghdyO0Sc.d.ts → zone-history-BxmDCcTK.d.ts} +32 -10
  69. package/package.json +24 -3
  70. package/dist/types-B-yb_tGL.d.ts +0 -240
@@ -0,0 +1,333 @@
1
+ // src/signs.ts
2
+ var SIGNS = /* @__PURE__ */ Object.freeze([
3
+ /* @__PURE__ */ Object.freeze({
4
+ slug: "aries",
5
+ name: "Aries",
6
+ element: "fire",
7
+ modality: "cardinal",
8
+ polarity: "day",
9
+ naturalHouse: 1
10
+ }),
11
+ /* @__PURE__ */ Object.freeze({
12
+ slug: "taurus",
13
+ name: "Taurus",
14
+ element: "earth",
15
+ modality: "fixed",
16
+ polarity: "night",
17
+ naturalHouse: 2
18
+ }),
19
+ /* @__PURE__ */ Object.freeze({
20
+ slug: "gemini",
21
+ name: "Gemini",
22
+ element: "air",
23
+ modality: "mutable",
24
+ polarity: "day",
25
+ naturalHouse: 3
26
+ }),
27
+ /* @__PURE__ */ Object.freeze({
28
+ slug: "cancer",
29
+ name: "Cancer",
30
+ element: "water",
31
+ modality: "cardinal",
32
+ polarity: "night",
33
+ naturalHouse: 4
34
+ }),
35
+ /* @__PURE__ */ Object.freeze({
36
+ slug: "leo",
37
+ name: "Leo",
38
+ element: "fire",
39
+ modality: "fixed",
40
+ polarity: "day",
41
+ naturalHouse: 5
42
+ }),
43
+ /* @__PURE__ */ Object.freeze({
44
+ slug: "virgo",
45
+ name: "Virgo",
46
+ element: "earth",
47
+ modality: "mutable",
48
+ polarity: "night",
49
+ naturalHouse: 6
50
+ }),
51
+ /* @__PURE__ */ Object.freeze({
52
+ slug: "libra",
53
+ name: "Libra",
54
+ element: "air",
55
+ modality: "cardinal",
56
+ polarity: "day",
57
+ naturalHouse: 7
58
+ }),
59
+ /* @__PURE__ */ Object.freeze({
60
+ slug: "scorpio",
61
+ name: "Scorpio",
62
+ element: "water",
63
+ modality: "fixed",
64
+ polarity: "night",
65
+ naturalHouse: 8
66
+ }),
67
+ /* @__PURE__ */ Object.freeze({
68
+ slug: "sagittarius",
69
+ name: "Sagittarius",
70
+ element: "fire",
71
+ modality: "mutable",
72
+ polarity: "day",
73
+ naturalHouse: 9
74
+ }),
75
+ /* @__PURE__ */ Object.freeze({
76
+ slug: "capricorn",
77
+ name: "Capricorn",
78
+ element: "earth",
79
+ modality: "cardinal",
80
+ polarity: "night",
81
+ naturalHouse: 10
82
+ }),
83
+ /* @__PURE__ */ Object.freeze({
84
+ slug: "aquarius",
85
+ name: "Aquarius",
86
+ element: "air",
87
+ modality: "fixed",
88
+ polarity: "day",
89
+ naturalHouse: 11
90
+ }),
91
+ /* @__PURE__ */ Object.freeze({
92
+ slug: "pisces",
93
+ name: "Pisces",
94
+ element: "water",
95
+ modality: "mutable",
96
+ polarity: "night",
97
+ naturalHouse: 12
98
+ })
99
+ ]);
100
+ var SIGN_SLUGS = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ SIGNS.map((sign) => sign.slug));
101
+ function normalizeLongitude(lon) {
102
+ if (!Number.isFinite(lon)) throw new RangeError("Longitude must be finite.");
103
+ return (lon % 360 + 360) % 360;
104
+ }
105
+ function signIndexForLongitude(lon) {
106
+ return Math.floor(normalizeLongitude(lon) / 30);
107
+ }
108
+
109
+ // src/read-options.ts
110
+ function readOptions(value, allowed, label) {
111
+ const out = /* @__PURE__ */ Object.create(null);
112
+ if (value === void 0) return out;
113
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
114
+ throw new RangeError(`${label} must be an options object.`);
115
+ }
116
+ const prototype = Object.getPrototypeOf(value);
117
+ if (prototype !== Object.prototype && prototype !== null) {
118
+ throw new RangeError(`${label} must be a plain options object.`);
119
+ }
120
+ for (const key of Reflect.ownKeys(value)) {
121
+ if (typeof key !== "string" || !allowed.includes(key)) {
122
+ throw new RangeError(`${label} has an unknown option: ${String(key)}.`);
123
+ }
124
+ const slot = Object.getOwnPropertyDescriptor(value, key);
125
+ if (!slot || !("value" in slot) || !slot.enumerable) {
126
+ throw new RangeError(`${label} must contain only plain data properties.`);
127
+ }
128
+ if (slot.value !== void 0) out[key] = slot.value;
129
+ }
130
+ return out;
131
+ }
132
+
133
+ // src/techniques/names.ts
134
+ var BODY_NAMES = [
135
+ "Sun",
136
+ "Moon",
137
+ "Mercury",
138
+ "Venus",
139
+ "Mars",
140
+ "Jupiter",
141
+ "Saturn",
142
+ "Uranus",
143
+ "Neptune",
144
+ "Pluto",
145
+ "North Node",
146
+ "South Node"
147
+ ];
148
+ function bodyName(value, label) {
149
+ if (typeof value === "string" && BODY_NAMES.includes(value)) return value;
150
+ throw new RangeError(`${label} must be a body name.`);
151
+ }
152
+ function oneOf(value, allowed, fallback, label) {
153
+ if (value === void 0) return fallback;
154
+ if (typeof value === "string" && allowed.includes(value)) return value;
155
+ throw new RangeError(`${label} must be one of ${allowed.map((name) => `"${name}"`).join(", ")}.`);
156
+ }
157
+ function finiteDegrees(value, label) {
158
+ if (typeof value !== "number" || !Number.isFinite(value)) throw new RangeError(`${label} must be a finite number of degrees.`);
159
+ return value;
160
+ }
161
+
162
+ // src/techniques/dignities.ts
163
+ var CLASSICAL_PLANETS = /* @__PURE__ */ Object.freeze([
164
+ "Sun",
165
+ "Moon",
166
+ "Mercury",
167
+ "Venus",
168
+ "Mars",
169
+ "Jupiter",
170
+ "Saturn"
171
+ ]);
172
+ var DOMICILE_RULERS = /* @__PURE__ */ Object.freeze({
173
+ aries: "Mars",
174
+ taurus: "Venus",
175
+ gemini: "Mercury",
176
+ cancer: "Moon",
177
+ leo: "Sun",
178
+ virgo: "Mercury",
179
+ libra: "Venus",
180
+ scorpio: "Mars",
181
+ sagittarius: "Jupiter",
182
+ capricorn: "Saturn",
183
+ aquarius: "Saturn",
184
+ pisces: "Jupiter"
185
+ });
186
+ var EXALTATIONS = /* @__PURE__ */ Object.freeze({
187
+ Sun: "aries",
188
+ Moon: "taurus",
189
+ Mercury: "virgo",
190
+ Venus: "pisces",
191
+ Mars: "capricorn",
192
+ Jupiter: "cancer",
193
+ Saturn: "libra"
194
+ });
195
+ var TRIPLICITY_LORDS = /* @__PURE__ */ Object.freeze({
196
+ fire: /* @__PURE__ */ Object.freeze({ day: "Sun", night: "Jupiter", participating: "Saturn" }),
197
+ earth: /* @__PURE__ */ Object.freeze({ day: "Venus", night: "Moon", participating: "Mars" }),
198
+ air: /* @__PURE__ */ Object.freeze({ day: "Saturn", night: "Mercury", participating: "Jupiter" }),
199
+ water: /* @__PURE__ */ Object.freeze({ day: "Venus", night: "Mars", participating: "Moon" })
200
+ });
201
+ var terms = (...rows) => Object.freeze(Object.fromEntries(SIGN_SLUGS.map((sign, index) => [sign, Object.freeze(rows[index].map((row) => Object.freeze(row)))])));
202
+ var EGYPTIAN_TERMS = /* @__PURE__ */ terms(
203
+ [["Jupiter", 6], ["Venus", 12], ["Mercury", 20], ["Mars", 25], ["Saturn", 30]],
204
+ [["Venus", 8], ["Mercury", 14], ["Jupiter", 22], ["Saturn", 27], ["Mars", 30]],
205
+ [["Mercury", 6], ["Jupiter", 12], ["Venus", 17], ["Mars", 24], ["Saturn", 30]],
206
+ [["Mars", 7], ["Venus", 13], ["Mercury", 19], ["Jupiter", 26], ["Saturn", 30]],
207
+ [["Jupiter", 6], ["Venus", 11], ["Saturn", 18], ["Mercury", 24], ["Mars", 30]],
208
+ [["Mercury", 7], ["Venus", 17], ["Jupiter", 21], ["Mars", 28], ["Saturn", 30]],
209
+ [["Saturn", 6], ["Mercury", 14], ["Jupiter", 21], ["Venus", 28], ["Mars", 30]],
210
+ [["Mars", 7], ["Venus", 11], ["Mercury", 19], ["Jupiter", 24], ["Saturn", 30]],
211
+ [["Jupiter", 12], ["Venus", 17], ["Mercury", 21], ["Saturn", 26], ["Mars", 30]],
212
+ [["Mercury", 7], ["Jupiter", 14], ["Venus", 22], ["Saturn", 26], ["Mars", 30]],
213
+ [["Mercury", 7], ["Venus", 13], ["Jupiter", 20], ["Mars", 25], ["Saturn", 30]],
214
+ [["Venus", 12], ["Jupiter", 16], ["Mercury", 19], ["Mars", 28], ["Saturn", 30]]
215
+ );
216
+ var CHALDEAN_FACES = /* @__PURE__ */ Object.freeze(
217
+ /* @__PURE__ */ Array.from({ length: 36 }, (_, index) => ["Mars", "Sun", "Venus", "Mercury", "Moon", "Saturn", "Jupiter"][index % 7])
218
+ );
219
+ var opposite = (sign) => SIGN_SLUGS[(SIGN_SLUGS.indexOf(sign) + 6) % 12];
220
+ var isClassical = (body) => CLASSICAL_PLANETS.includes(body);
221
+ function signName(value) {
222
+ if (typeof value === "string" && SIGN_SLUGS.includes(value)) return value;
223
+ throw new RangeError("sign must be a lowercase zodiac sign name.");
224
+ }
225
+ function hasClassicalDignities(planet) {
226
+ return isClassical(bodyName(planet, "planet"));
227
+ }
228
+ function dignitiesFor(planet, sign) {
229
+ const body = bodyName(planet, "planet");
230
+ const where = signName(sign);
231
+ const out = [];
232
+ if (isClassical(body)) {
233
+ if (DOMICILE_RULERS[where] === body) out.push("domicile");
234
+ if (EXALTATIONS[body] === where) out.push("exaltation");
235
+ if (DOMICILE_RULERS[opposite(where)] === body) out.push("detriment");
236
+ if (opposite(EXALTATIONS[body]) === where) out.push("fall");
237
+ }
238
+ return Object.freeze(out);
239
+ }
240
+ function dignityFor(planet, sign) {
241
+ const all = dignitiesFor(planet, sign);
242
+ return ["exaltation", "fall", "domicile", "detriment"].find((condition) => all.includes(condition)) ?? null;
243
+ }
244
+ function dignityRulersAt(longitude) {
245
+ const lon = normalizeLongitude(finiteDegrees(longitude, "longitude"));
246
+ const index = signIndexForLongitude(lon);
247
+ const sign = SIGN_SLUGS[index];
248
+ const degree = Math.max(0, lon - index * 30);
249
+ const row = EGYPTIAN_TERMS[sign];
250
+ const at = Math.max(0, row.findIndex(([, end]) => degree < end));
251
+ const face = Math.min(2, Math.floor(degree / 10));
252
+ const element = SIGNS[index].element;
253
+ return Object.freeze({
254
+ lon,
255
+ sign,
256
+ domicile: DOMICILE_RULERS[sign],
257
+ exaltation: CLASSICAL_PLANETS.find((planet) => EXALTATIONS[planet] === sign) ?? null,
258
+ triplicity: Object.freeze({ element, ...TRIPLICITY_LORDS[element] }),
259
+ term: Object.freeze({ planet: row[at][0], from: at === 0 ? 0 : row[at - 1][1], to: row[at][1] }),
260
+ face: Object.freeze({ planet: CHALDEAN_FACES[index * 3 + face], from: face * 10, to: face * 10 + 10 }),
261
+ detriment: DOMICILE_RULERS[opposite(sign)],
262
+ fall: CLASSICAL_PLANETS.find((planet) => opposite(EXALTATIONS[planet]) === sign) ?? null
263
+ });
264
+ }
265
+ function essentialDignities(planet, longitude, sect) {
266
+ const body = bodyName(planet, "planet");
267
+ if (!isClassical(body)) throw new RangeError("Essential dignities are defined for the seven classical planets only.");
268
+ if (sect !== "day" && sect !== "night") throw new RangeError('sect must be "day" or "night".');
269
+ const rulers = dignityRulersAt(longitude);
270
+ const held = [
271
+ [rulers.domicile === body, "domicile"],
272
+ [rulers.exaltation === body, "exaltation"],
273
+ [rulers.triplicity[sect] === body, "triplicity"],
274
+ [rulers.term.planet === body, "term"],
275
+ [rulers.face.planet === body, "face"]
276
+ ];
277
+ const dignities = held.filter(([has]) => has).map(([, name]) => name);
278
+ const debilities = [[rulers.detriment === body, "detriment"], [rulers.fall === body, "fall"]].filter(([has]) => has).map(([, name]) => name);
279
+ return Object.freeze({
280
+ planet: body,
281
+ lon: rulers.lon,
282
+ sign: rulers.sign,
283
+ sect,
284
+ dignities: Object.freeze(dignities),
285
+ debilities: Object.freeze(debilities),
286
+ peregrine: dignities.length === 0
287
+ });
288
+ }
289
+ var ALL_DIGNITIES = ["domicile", "exaltation", "triplicity", "term", "face"];
290
+ function mutualReceptions(positions, options) {
291
+ const read = readOptions(options, ["dignities", "sect"], "mutualReceptions options");
292
+ const wanted = read.dignities ?? ["domicile", "exaltation"];
293
+ if (!Array.isArray(wanted) || !wanted.length || wanted.some((name) => !ALL_DIGNITIES.includes(name))) {
294
+ throw new RangeError(`dignities must be a nonempty list of ${ALL_DIGNITIES.join(", ")}.`);
295
+ }
296
+ const sect = read.sect === void 0 ? void 0 : oneOf(read.sect, ["day", "night"], "day", "sect");
297
+ if (wanted.includes("triplicity") && sect === void 0) throw new RangeError("Reception by triplicity needs the chart's sect.");
298
+ if (!Array.isArray(positions)) throw new RangeError("positions must be an array of { body, lon }.");
299
+ const seen = /* @__PURE__ */ new Set();
300
+ const planets = [];
301
+ for (const row of positions) {
302
+ const body = bodyName(row?.body, "position");
303
+ if (seen.has(body)) throw new RangeError(`positions name ${body} twice.`);
304
+ seen.add(body);
305
+ const lon = finiteDegrees(row.lon, `${body}'s longitude`);
306
+ if (isClassical(body)) planets.push({ planet: body, lon });
307
+ }
308
+ planets.sort((x, y) => CLASSICAL_PLANETS.indexOf(x.planet) - CLASSICAL_PLANETS.indexOf(y.planet));
309
+ const receives = (host, guestLon) => Object.freeze(essentialDignities(host, guestLon, sect ?? "day").dignities.filter((name) => wanted.includes(name)));
310
+ const out = [];
311
+ planets.forEach((a, i) => {
312
+ for (const b of planets.slice(i + 1)) {
313
+ const aReceivesB = receives(a.planet, b.lon);
314
+ const bReceivesA = receives(b.planet, a.lon);
315
+ if (aReceivesB.length && bReceivesA.length) out.push(Object.freeze({ a: a.planet, b: b.planet, aReceivesB, bReceivesA }));
316
+ }
317
+ });
318
+ return Object.freeze(out);
319
+ }
320
+ export {
321
+ CHALDEAN_FACES,
322
+ CLASSICAL_PLANETS,
323
+ DOMICILE_RULERS,
324
+ EGYPTIAN_TERMS,
325
+ EXALTATIONS,
326
+ TRIPLICITY_LORDS,
327
+ dignitiesFor,
328
+ dignityFor,
329
+ dignityRulersAt,
330
+ essentialDignities,
331
+ hasClassicalDignities,
332
+ mutualReceptions
333
+ };
@@ -0,0 +1,72 @@
1
+ // src/signs.ts
2
+ function normalizeLongitude(lon) {
3
+ if (!Number.isFinite(lon)) throw new RangeError("Longitude must be finite.");
4
+ return (lon % 360 + 360) % 360;
5
+ }
6
+
7
+ // src/points.ts
8
+ var DEG = Math.PI / 180;
9
+ var RAD = 180 / Math.PI;
10
+ var ARCSEC = 1 / 3600;
11
+ function sectOf(ascendant, sun) {
12
+ return normalizeLongitude(sun - ascendant) >= 180 ? "day" : "night";
13
+ }
14
+
15
+ // src/read-options.ts
16
+ function readOptions(value, allowed, label) {
17
+ const out = /* @__PURE__ */ Object.create(null);
18
+ if (value === void 0) return out;
19
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
20
+ throw new RangeError(`${label} must be an options object.`);
21
+ }
22
+ const prototype = Object.getPrototypeOf(value);
23
+ if (prototype !== Object.prototype && prototype !== null) {
24
+ throw new RangeError(`${label} must be a plain options object.`);
25
+ }
26
+ for (const key of Reflect.ownKeys(value)) {
27
+ if (typeof key !== "string" || !allowed.includes(key)) {
28
+ throw new RangeError(`${label} has an unknown option: ${String(key)}.`);
29
+ }
30
+ const slot = Object.getOwnPropertyDescriptor(value, key);
31
+ if (!slot || !("value" in slot) || !slot.enumerable) {
32
+ throw new RangeError(`${label} must contain only plain data properties.`);
33
+ }
34
+ if (slot.value !== void 0) out[key] = slot.value;
35
+ }
36
+ return out;
37
+ }
38
+
39
+ // src/sect.ts
40
+ var SECT_CONVENTIONS = /* @__PURE__ */ Object.freeze(["altitude", "ecliptic"]);
41
+ var DIURNAL_PLANETS = /* @__PURE__ */ Object.freeze(["Sun", "Jupiter", "Saturn"]);
42
+ var NOCTURNAL_PLANETS = /* @__PURE__ */ Object.freeze(["Moon", "Venus", "Mars"]);
43
+ function degrees(value, name) {
44
+ if (!Number.isFinite(value)) throw new RangeError(`${name} must be a finite number of degrees.`);
45
+ return value;
46
+ }
47
+ function orientality(bodyLon, sunLon) {
48
+ const raw = ((degrees(sunLon, "sunLon") % 360 - degrees(bodyLon, "bodyLon") % 360) % 360 + 360) % 360;
49
+ return (raw > 180 ? raw - 360 : raw) > 0 ? "oriental" : "occidental";
50
+ }
51
+ function sectReading(input) {
52
+ const { convention } = readOptions(input, ["convention", "sunAltitude", "ascendant", "sunLon", "mercuryLon"], "sectReading's input");
53
+ if (convention !== "altitude" && convention !== "ecliptic") throw new RangeError('convention must be "altitude" or "ecliptic".');
54
+ const read = readOptions(input, ["convention", convention === "altitude" ? "sunAltitude" : "ascendant", "sunLon", "mercuryLon"], `sectReading's ${convention} input`);
55
+ const sunLon = degrees(read.sunLon, "sunLon");
56
+ const sunAltitude = convention === "altitude" ? degrees(read.sunAltitude, "sunAltitude") : null;
57
+ if (Math.abs(sunAltitude ?? 0) > 90) throw new RangeError("sunAltitude must be from -90 to 90 degrees.");
58
+ const day = sunAltitude === null ? sectOf(degrees(read.ascendant, "ascendant"), sunLon) === "day" : sunAltitude >= 0;
59
+ const mercury = read.mercuryLon == null ? null : orientality(degrees(read.mercuryLon, "mercuryLon"), sunLon);
60
+ const inSect = [...day ? DIURNAL_PLANETS : NOCTURNAL_PLANETS];
61
+ const outOfSect = [...day ? NOCTURNAL_PLANETS : DIURNAL_PLANETS];
62
+ if (mercury) (mercury === "oriental" === day ? inSect : outOfSect).push("Mercury");
63
+ const light = day ? "Sun" : "Moon";
64
+ return Object.freeze({ convention, sect: day ? "day" : "night", sunAltitude, light, mercury, inSect: Object.freeze(inSect), outOfSect: Object.freeze(outOfSect) });
65
+ }
66
+ export {
67
+ DIURNAL_PLANETS,
68
+ NOCTURNAL_PLANETS,
69
+ SECT_CONVENTIONS,
70
+ orientality,
71
+ sectReading
72
+ };
package/dist/lite.d.ts ADDED
@@ -0,0 +1,82 @@
1
+ export { DEFAULT_DECLINATION_ORB_POLICY, RA_POLE_TOLERANCE, SUN_BOUND_LATITUDE, declinationOf, declinationOrb, declinationsForBodies, eclipticToEquatorial, findDeclinationAspects } from './index.js';
2
+ export type { DeclinationAspect, DeclinationAspectType, DeclinationBody, DeclinationOrbPolicy, DeclinationRow, Declinations, EquatorialCoordinates } from './index.js';
3
+ /** The rule that decides day or night: the Sun's altitude, or its half of the ecliptic. */
4
+ export type SectConvention = "altitude" | "ecliptic";
5
+ /** The conventions `sectReading` takes. */
6
+ export declare const SECT_CONVENTIONS: readonly SectConvention[];
7
+ /** Whether a body rises ahead of the Sun (oriental) or behind it (occidental). */
8
+ export type Orientality = "oriental" | "occidental";
9
+ /** The planets of the day, in the order the lists of a reading give them. */
10
+ export declare const DIURNAL_PLANETS: readonly ["Sun", "Jupiter", "Saturn"];
11
+ /** The planets of the night, in the order the lists of a reading give them. */
12
+ export declare const NOCTURNAL_PLANETS: readonly ["Moon", "Venus", "Mars"];
13
+ /**
14
+ * Whether a body rises ahead of the Sun or behind it, from their ecliptic
15
+ * longitudes in degrees, finite and of any size: each is reduced modulo 360,
16
+ * which is exact, before their difference is taken. The signed arc from the
17
+ * body to the Sun, in (-180, 180], is above 0 for an oriental body: one
18
+ * earlier in the order of the signs, which the ascendant reaches first. A body
19
+ * exactly opposite the Sun is oriental, and one exactly on it occidental.
20
+ */
21
+ export declare function orientality(bodyLon: number, sunLon: number): Orientality;
22
+ /** A reading by the Sun's altitude, which the caller computes. */
23
+ export interface AltitudeSectInput {
24
+ readonly convention: "altitude";
25
+ /** Degrees of the Sun above the horizon, in [-90, 90]; negative below it. */
26
+ readonly sunAltitude: number;
27
+ /** The Sun's ecliptic longitude, degrees. */
28
+ readonly sunLon: number;
29
+ /** Mercury's ecliptic longitude, degrees; null or absent when it is not known. */
30
+ readonly mercuryLon?: number | null | undefined;
31
+ }
32
+ /** A reading by the Sun's half of the ecliptic, as the root's `sectOf` takes it. */
33
+ export interface EclipticSectInput {
34
+ readonly convention: "ecliptic";
35
+ /** The ascendant's ecliptic longitude, degrees. */
36
+ readonly ascendant: number;
37
+ /** The Sun's ecliptic longitude, degrees. */
38
+ readonly sunLon: number;
39
+ /** Mercury's ecliptic longitude, degrees; null or absent when it is not known. */
40
+ readonly mercuryLon?: number | null | undefined;
41
+ }
42
+ export type SectInput = AltitudeSectInput | EclipticSectInput;
43
+ /** A chart's sect under the convention named, frozen with its lists. */
44
+ export interface SectReading {
45
+ readonly convention: SectConvention;
46
+ readonly sect: "day" | "night";
47
+ /** The altitude given, unchanged; null under the ecliptic convention. */
48
+ readonly sunAltitude: number | null;
49
+ /** The luminary of the chart's own half: the Sun by day, the Moon by night. */
50
+ readonly light: "Sun" | "Moon";
51
+ /** Mercury's side of the Sun; null when no Mercury longitude was given. */
52
+ readonly mercury: Orientality | null;
53
+ /**
54
+ * The planets of the chart's own half, in the order of `DIURNAL_PLANETS` or
55
+ * `NOCTURNAL_PLANETS`, then Mercury when its side matches the chart's:
56
+ * oriental by day, occidental by night.
57
+ */
58
+ readonly inSect: readonly ("Sun" | "Moon" | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn")[];
59
+ /** The planets of the other half, in their order, then Mercury when its side does not match. */
60
+ readonly outOfSect: readonly ("Sun" | "Moon" | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn")[];
61
+ }
62
+ /**
63
+ * A chart's sect under the convention the input names, which it must name:
64
+ *
65
+ * - `"altitude"`: day when `sunAltitude` is 0 or more, so a Sun exactly on
66
+ * the horizon, and an altitude of -0, count to the day;
67
+ * - `"ecliptic"`: the root's `sectOf(ascendant, sunLon)`, so a Sun exactly on
68
+ * the ascendant counts to the night and one exactly on the descendant to
69
+ * the day.
70
+ *
71
+ * The sect light is the Sun by day and the Moon by night; Mercury's side is
72
+ * `orientality(mercuryLon, sunLon)`. Throws RangeError for an input that is
73
+ * not a plain object of its convention's own keys, a convention other than
74
+ * the two, an altitude that is not a finite number from -90 to 90, and a
75
+ * longitude that is not finite; `mercuryLon` null or absent gives a reading
76
+ * whose `mercury` is null.
77
+ */
78
+ export declare function sectReading(input: SectInput): SectReading;
79
+ export { compositeAspects, compositeMidpoints } from './techniques.js';
80
+ export type { CompositeAspect, CompositePosition } from './techniques.js';
81
+ export { CHALDEAN_FACES, CLASSICAL_PLANETS, DOMICILE_RULERS, EGYPTIAN_TERMS, EXALTATIONS, TRIPLICITY_LORDS, dignitiesFor, dignityFor, dignityRulersAt, essentialDignities, hasClassicalDignities, mutualReceptions } from './techniques.js';
82
+ export type { ClassicalPlanet, Debility, DignityRulers, DignitySpan, EssentialDignity, MutualReception, PlanetDignities, ReceptionOptions, SignDignity } from './techniques.js';
package/dist/lite.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./lite-declinations.js";
2
+ export * from "./lite-sect.js";
3
+ export * from "./lite-composite.js";
4
+ export * from "./lite-dignities.js";
package/dist/receipt.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- import './types-B-yb_tGL.js';
1
+ import './time-scale-DIFNa0gz.js';
2
+ import './types-DpPdtXgO.js';
2
3
  import './deltat.js';
3
- export { a as NATAL_DIAGNOSTIC_SCHEMA, b as NATAL_ENVELOPE_LIMITS, c as NATAL_ENVELOPE_SCHEMA, d as NATAL_RECEIPT_CONVENTION_SETS, e as NATAL_RECEIPT_SCHEMA, f as NatalAnglesRecord, g as NatalAspectRecord, h as NatalBodyRecord, i as NatalConventionSet, j as NatalCoverage, k as NatalDeltaTRecord, l as NatalDiagnostic, m as NatalEnvelope, n as NatalEnvelopeContext, o as NatalEnvelopeError, p as NatalEnvelopeErrorCode, q as NatalEnvelopeParseResult, r as NatalHousesRecord, s as NatalJsonObject, t as NatalJsonValue, N as NatalLocalResolution, u as NatalProvenanceClaims, v as NatalReceipt, w as NatalRecordedResult, x as NatalReference, y as NatalTimeScaleRecord, z as NatalZoneTransition, A as createNatalEnvelope, B as natalReplayInput, C as parseNatalEnvelope, D as redactNatalEnvelope, E as serializeNatalEnvelope } from './zone-history-ghdyO0Sc.js';
4
+ export { a as NATAL_DIAGNOSTIC_SCHEMA, b as NATAL_ENVELOPE_LIMITS, c as NATAL_ENVELOPE_SCHEMA, d as NATAL_RECEIPT_CONVENTION_SETS, e as NATAL_RECEIPT_SCHEMA, f as NatalAnglesRecord, g as NatalAspectRecord, h as NatalBodyRecord, i as NatalConventionSet, j as NatalCoverage, k as NatalDeltaTRecord, l as NatalDiagnostic, m as NatalEnvelope, n as NatalEnvelopeContext, o as NatalEnvelopeError, p as NatalEnvelopeErrorCode, q as NatalEnvelopeParseResult, r as NatalHousesRecord, s as NatalJsonObject, t as NatalJsonValue, N as NatalLocalResolution, u as NatalProvenanceClaims, v as NatalReceipt, w as NatalRecordedResult, x as NatalReference, y as NatalTimeScaleRecord, z as NatalZoneTransition, A as createNatalEnvelope, B as natalReplayInput, C as parseNatalEnvelope, D as redactNatalEnvelope, E as serializeNatalEnvelope } from './zone-history-BxmDCcTK.js';