@motioncomplex/cosmos-lib 1.0.9

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 (47) hide show
  1. package/README.md +125 -0
  2. package/dist/api.d.ts +246 -0
  3. package/dist/cache.d.ts +11 -0
  4. package/dist/clock.d.ts +181 -0
  5. package/dist/constants.d.ts +43 -0
  6. package/dist/data/constellations.d.ts +58 -0
  7. package/dist/data/cutouts.d.ts +70 -0
  8. package/dist/data/deep-sky.d.ts +27 -0
  9. package/dist/data/images.d.ts +147 -0
  10. package/dist/data/index.d.ts +422 -0
  11. package/dist/data/messier.d.ts +61 -0
  12. package/dist/data/ps1-files.d.ts +11 -0
  13. package/dist/data/showers.d.ts +62 -0
  14. package/dist/data/solar-system.d.ts +34 -0
  15. package/dist/data/stars.d.ts +57 -0
  16. package/dist/data/textures.d.ts +67 -0
  17. package/dist/eclipse.d.ts +176 -0
  18. package/dist/index.cjs +1 -0
  19. package/dist/index.d.ts +237 -0
  20. package/dist/index.js +713 -0
  21. package/dist/math.d.ts +532 -0
  22. package/dist/media-DVOcIMa1.js +252 -0
  23. package/dist/media-DlE7RKBL.cjs +1 -0
  24. package/dist/media.d.ts +217 -0
  25. package/dist/moon.d.ts +170 -0
  26. package/dist/planner.d.ts +224 -0
  27. package/dist/react/index.cjs +1 -0
  28. package/dist/react/index.d.ts +167 -0
  29. package/dist/react/index.js +163 -0
  30. package/dist/skymap-hittest.d.ts +69 -0
  31. package/dist/skymap-interactive-CLg6FA0X.js +6377 -0
  32. package/dist/skymap-interactive-D2OZFwJ7.cjs +1 -0
  33. package/dist/skymap-interactive.d.ts +153 -0
  34. package/dist/skymap.d.ts +172 -0
  35. package/dist/sun.d.ts +119 -0
  36. package/dist/three/factories.d.ts +160 -0
  37. package/dist/three/flight.d.ts +116 -0
  38. package/dist/three/index.cjs +20 -0
  39. package/dist/three/index.d.ts +21 -0
  40. package/dist/three/index.js +404 -0
  41. package/dist/three/lod.d.ts +100 -0
  42. package/dist/three/shaders.d.ts +22 -0
  43. package/dist/three/types.d.ts +169 -0
  44. package/dist/transitions.d.ts +246 -0
  45. package/dist/types.d.ts +730 -0
  46. package/dist/units.d.ts +132 -0
  47. package/package.json +93 -0
package/dist/index.js ADDED
@@ -0,0 +1,713 @@
1
+ import { C as h, M as w, A as k, c as P, I as $, g as x, m as C, s as N, r as I, a as R, E as D, N as j, D as F, b as Y, P as X, S as K } from "./skymap-interactive-CLg6FA0X.js";
2
+ import { B as ee, d as te, e as ie, f as ne, h as ae, i as se, j as re, k as oe, l as ce, n as le, o as ue, p as de, q as me, t as pe, u as he, v as fe } from "./skymap-interactive-CLg6FA0X.js";
3
+ import { M as q } from "./media-DVOcIMa1.js";
4
+ const J = {
5
+ // ── Distance ───────────────────────────────────────────────────────────────
6
+ /**
7
+ * Convert Astronomical Units to kilometres.
8
+ * @param au - Distance in AU.
9
+ * @returns Distance in kilometres.
10
+ */
11
+ auToKm: (e) => e * h.AU_TO_KM,
12
+ /**
13
+ * Convert kilometres to Astronomical Units.
14
+ * @param km - Distance in kilometres.
15
+ * @returns Distance in AU.
16
+ */
17
+ kmToAu: (e) => e / h.AU_TO_KM,
18
+ /**
19
+ * Convert light-years to parsecs.
20
+ * @param ly - Distance in light-years.
21
+ * @returns Distance in parsecs.
22
+ */
23
+ lyToPc: (e) => e / h.PC_TO_LY,
24
+ /**
25
+ * Convert parsecs to light-years.
26
+ * @param pc - Distance in parsecs.
27
+ * @returns Distance in light-years.
28
+ */
29
+ pcToLy: (e) => e * h.PC_TO_LY,
30
+ /**
31
+ * Convert parsecs to kilometres.
32
+ * @param pc - Distance in parsecs.
33
+ * @returns Distance in kilometres.
34
+ */
35
+ pcToKm: (e) => e * h.PC_TO_KM,
36
+ /**
37
+ * Convert light-years to kilometres.
38
+ * @param ly - Distance in light-years.
39
+ * @returns Distance in kilometres.
40
+ */
41
+ lyToKm: (e) => e * h.LY_TO_KM,
42
+ /**
43
+ * Convert kilometres to light-years.
44
+ * @param km - Distance in kilometres.
45
+ * @returns Distance in light-years.
46
+ */
47
+ kmToLy: (e) => e / h.LY_TO_KM,
48
+ // ── Angular ────────────────────────────────────────────────────────────────
49
+ /**
50
+ * Convert degrees to radians.
51
+ * @param d - Angle in degrees.
52
+ * @returns Angle in radians.
53
+ */
54
+ degToRad: (e) => e * h.DEG_TO_RAD,
55
+ /**
56
+ * Convert radians to degrees.
57
+ * @param r - Angle in radians.
58
+ * @returns Angle in degrees.
59
+ */
60
+ radToDeg: (e) => e * h.RAD_TO_DEG,
61
+ /**
62
+ * Convert arcseconds to degrees.
63
+ * @param a - Angle in arcseconds.
64
+ * @returns Angle in degrees.
65
+ */
66
+ arcsecToDeg: (e) => e / 3600,
67
+ /**
68
+ * Convert degrees to arcseconds.
69
+ * @param d - Angle in degrees.
70
+ * @returns Angle in arcseconds.
71
+ */
72
+ degToArcsec: (e) => e * 3600,
73
+ /**
74
+ * Convert Right Ascension from hours to degrees.
75
+ * @param h - RA in hours (0–24).
76
+ * @returns RA in degrees (0–360).
77
+ */
78
+ hrsToDeg: (e) => e * 15,
79
+ /**
80
+ * Convert Right Ascension from degrees to hours.
81
+ * @param d - RA in degrees (0–360).
82
+ * @returns RA in hours (0–24).
83
+ */
84
+ degToHrs: (e) => e / 15,
85
+ /**
86
+ * Format a distance in kilometres into a human-readable string,
87
+ * automatically choosing the most appropriate unit (km, AU, ly, or Mly).
88
+ *
89
+ * @param km - Distance in kilometres.
90
+ * @returns Formatted string with unit suffix.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * Units.formatDistance(384_400) // '0.002570 AU'
95
+ * Units.formatDistance(9_460_730_472_580 * 8.6) // '8.600 ly'
96
+ * ```
97
+ */
98
+ formatDistance(e) {
99
+ const a = e / h.AU_TO_KM;
100
+ if (a < 0.01) return `${e.toFixed(0)} km`;
101
+ if (a < 1e3) return `${a.toPrecision(4)} AU`;
102
+ const i = e / h.LY_TO_KM;
103
+ return i < 1e6 ? `${i.toPrecision(4)} ly` : `${(i / 1e6).toPrecision(4)} Mly`;
104
+ },
105
+ /**
106
+ * Format decimal degrees as d°m′s″ (signed).
107
+ *
108
+ * @param deg - Angle in decimal degrees.
109
+ * @returns Formatted DMS string.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * Units.formatAngle(-16.716) // '-16°42′57.6″'
114
+ * Units.formatAngle(83.822) // '83°49′19.2″'
115
+ * ```
116
+ */
117
+ formatAngle(e) {
118
+ const a = e < 0 ? "-" : "", i = Math.abs(e), s = Math.floor(i), r = Math.floor((i - s) * 60), o = ((i - s) * 60 - r) * 60;
119
+ return `${a}${s}°${r}′${o.toFixed(1)}″`;
120
+ },
121
+ /**
122
+ * Format Right Ascension from decimal degrees into hours/minutes/seconds.
123
+ *
124
+ * @param deg - RA in decimal degrees (0–360).
125
+ * @returns Formatted string like `'5h 35m 17.3s'`.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * Units.formatRA(83.822) // '5h 35m 17.3s'
130
+ * Units.formatRA(0) // '0h 0m 0.0s'
131
+ * ```
132
+ */
133
+ formatRA(e) {
134
+ const a = (e % 360 + 360) % 360, i = Math.floor(a / 15), s = Math.floor((a / 15 - i) * 60), r = ((a / 15 - i) * 60 - s) * 60;
135
+ return `${i}h ${s}m ${r.toFixed(1)}s`;
136
+ }
137
+ }, B = {
138
+ /**
139
+ * Find the next solar eclipse after the given date.
140
+ *
141
+ * Iterates through upcoming new moons (up to 26 lunations, approximately
142
+ * 2 years) and checks each one for a solar eclipse condition.
143
+ *
144
+ * @param date - Start date from which to search forward. Defaults to the current date/time.
145
+ * @returns An {@link EclipseEvent} describing the next solar eclipse, or `null` if none is found within approximately 2 years.
146
+ *
147
+ * @example
148
+ * ```ts
149
+ * import { Eclipse } from '@motioncomplex/cosmos-lib'
150
+ *
151
+ * const next = Eclipse.nextSolar(new Date('2024-03-20'))
152
+ * if (next) {
153
+ * console.log(`Next solar eclipse: ${next.subtype} on ${next.date.toISOString()}`)
154
+ * console.log(`Magnitude: ${next.magnitude.toFixed(3)}`)
155
+ * }
156
+ * ```
157
+ */
158
+ nextSolar(e = /* @__PURE__ */ new Date()) {
159
+ let a = new Date(e);
160
+ for (let i = 0; i < 26; i++) {
161
+ const s = w.nextPhase(a, "new"), r = this._checkSolarEclipse(s);
162
+ if (r) return r;
163
+ a = new Date(s.valueOf() + 864e5);
164
+ }
165
+ return null;
166
+ },
167
+ /**
168
+ * Find the next lunar eclipse after the given date.
169
+ *
170
+ * Iterates through upcoming full moons (up to 26 lunations, approximately
171
+ * 2 years) and checks each one for a lunar eclipse condition.
172
+ *
173
+ * @param date - Start date from which to search forward. Defaults to the current date/time.
174
+ * @returns An {@link EclipseEvent} describing the next lunar eclipse, or `null` if none is found within approximately 2 years.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * import { Eclipse } from '@motioncomplex/cosmos-lib'
179
+ *
180
+ * const next = Eclipse.nextLunar(new Date('2024-03-20'))
181
+ * if (next) {
182
+ * console.log(`Next lunar eclipse: ${next.subtype} on ${next.date.toISOString()}`)
183
+ * console.log(`Magnitude: ${next.magnitude.toFixed(3)}`)
184
+ * }
185
+ * ```
186
+ */
187
+ nextLunar(e = /* @__PURE__ */ new Date()) {
188
+ let a = new Date(e);
189
+ for (let i = 0; i < 26; i++) {
190
+ const s = w.nextPhase(a, "full"), r = this._checkLunarEclipse(s);
191
+ if (r) return r;
192
+ a = new Date(s.valueOf() + 864e5);
193
+ }
194
+ return null;
195
+ },
196
+ /**
197
+ * Search for all eclipses in a date range.
198
+ *
199
+ * Scans the interval from `startDate` to `endDate` in steps of approximately
200
+ * 15 days, checking both new moons (solar) and full moons (lunar) for eclipse
201
+ * conditions. Results are sorted chronologically and deduplicated (eclipses
202
+ * found within 1 day of each other are treated as the same event).
203
+ *
204
+ * @remarks
205
+ * The search advances by 15-day increments to ensure both new and full moons
206
+ * within each lunation are tested. When `type` is specified, only that eclipse
207
+ * type is checked, improving performance for targeted searches. Deduplication
208
+ * uses a 1-day threshold to handle cases where the same eclipse is detected
209
+ * from adjacent search windows.
210
+ *
211
+ * @param startDate - The beginning of the search window (inclusive).
212
+ * @param endDate - The end of the search window (exclusive).
213
+ * @param type - Optional filter: `'solar'` to search only for solar eclipses, `'lunar'` for only lunar eclipses, or omit for both.
214
+ * @returns An array of {@link EclipseEvent} objects sorted by date, with duplicates removed.
215
+ *
216
+ * @example
217
+ * ```ts
218
+ * import { Eclipse } from '@motioncomplex/cosmos-lib'
219
+ *
220
+ * // Find all eclipses in 2024
221
+ * const all = Eclipse.search(new Date('2024-01-01'), new Date('2025-01-01'))
222
+ * console.log(`Found ${all.length} eclipses in 2024`)
223
+ * all.forEach(e => console.log(`${e.type} ${e.subtype} — ${e.date.toISOString()}`))
224
+ *
225
+ * // Only solar eclipses in a 5-year span
226
+ * const solar = Eclipse.search(
227
+ * new Date('2024-01-01'),
228
+ * new Date('2029-01-01'),
229
+ * 'solar',
230
+ * )
231
+ * solar.forEach(e => console.log(`${e.subtype} solar eclipse: ${e.date.toISOString()}`))
232
+ * ```
233
+ */
234
+ search(e, a, i) {
235
+ const s = [];
236
+ let r = new Date(e);
237
+ const o = a.valueOf();
238
+ for (; r.valueOf() < o; ) {
239
+ if (i !== "lunar") {
240
+ const t = w.nextPhase(r, "new");
241
+ if (t.valueOf() > o) break;
242
+ const n = this._checkSolarEclipse(t);
243
+ n && s.push(n);
244
+ }
245
+ if (i !== "solar") {
246
+ const t = w.nextPhase(r, "full");
247
+ if (t.valueOf() <= o) {
248
+ const n = this._checkLunarEclipse(t);
249
+ n && s.push(n);
250
+ }
251
+ }
252
+ r = new Date(r.valueOf() + 15 * 864e5);
253
+ }
254
+ return s.sort((t, n) => t.date.valueOf() - n.date.valueOf()), s.filter(
255
+ (t, n) => n === 0 || Math.abs(t.date.valueOf() - s[n - 1].date.valueOf()) > 864e5
256
+ );
257
+ },
258
+ /**
259
+ * Check if a new moon produces a solar eclipse.
260
+ *
261
+ * Computes the Moon's ecliptic latitude and angular separation from the Sun
262
+ * at the instant of new moon. If the Moon is within 1.5° of the ecliptic plane
263
+ * and the angular separation is less than 1.5 times the sum of the apparent
264
+ * solar and lunar radii, an eclipse is predicted. The subtype (total, annular,
265
+ * or partial) is determined by comparing the apparent radii and the separation.
266
+ *
267
+ * @internal
268
+ * @param newMoon - The date/time of the new moon to test.
269
+ * @returns An {@link EclipseEvent} if a solar eclipse occurs at this new moon, or `null` otherwise.
270
+ */
271
+ _checkSolarEclipse(e) {
272
+ const a = w.position(e), i = k.planetEcliptic("earth", e), s = ((i.lon + 180) % 360 + 360) % 360;
273
+ if (Math.abs(a.eclipticLat) > 1.5) return null;
274
+ const o = i.r * 1495978707e-1, t = Math.atan2(696e3, o) * (180 / Math.PI), n = Math.atan2(1737.4, a.distance_km) * (180 / Math.PI), l = k.angularSeparation(
275
+ a,
276
+ k.eclipticToEquatorial({ lon: s, lat: 0 })
277
+ ), d = t + n;
278
+ if (l > d * 1.5) return null;
279
+ let u, c;
280
+ if (n >= t && l < n - t)
281
+ u = "total", c = 1;
282
+ else if (n < t && l < t - n)
283
+ u = "annular", c = n / t;
284
+ else if (l < d)
285
+ u = "partial", c = (d - l) / (2 * t);
286
+ else
287
+ return null;
288
+ return { type: "solar", subtype: u, date: e, magnitude: c };
289
+ },
290
+ /**
291
+ * Check if a full moon produces a lunar eclipse.
292
+ *
293
+ * Computes the Moon's ecliptic latitude at the instant of full moon and
294
+ * compares it against the angular radii of Earth's umbral and penumbral
295
+ * shadow cones at the Moon's distance. The subtype (total, partial, or
296
+ * penumbral) is determined by where the Moon's latitude falls relative
297
+ * to the umbral and penumbral boundaries.
298
+ *
299
+ * @remarks
300
+ * The umbral cone angular radius is approximated as 2.6 times the Earth's
301
+ * angular radius at the Moon's distance, and the penumbral cone as 4.3 times.
302
+ * These are simplified multipliers; a full calculation would use solar parallax
303
+ * and Earth's atmospheric extension.
304
+ *
305
+ * @internal
306
+ * @param fullMoon - The date/time of the full moon to test.
307
+ * @returns An {@link EclipseEvent} if a lunar eclipse occurs at this full moon, or `null` otherwise.
308
+ */
309
+ _checkLunarEclipse(e) {
310
+ const a = w.position(e), i = Math.abs(a.eclipticLat), s = Math.atan2(6371, a.distance_km) * (180 / Math.PI), r = s * 2.6, o = s * 4.3, t = Math.atan2(1737.4, a.distance_km) * (180 / Math.PI);
311
+ if (i > o + t) return null;
312
+ let n, l;
313
+ if (i < r - t)
314
+ n = "total", l = (r - i) / (2 * t);
315
+ else if (i < r + t)
316
+ n = "partial", l = (r + t - i) / (2 * t);
317
+ else if (i < o + t)
318
+ n = "penumbral", l = (o + t - i) / (2 * t);
319
+ else
320
+ return null;
321
+ return { type: "lunar", subtype: n, date: e, magnitude: Math.min(l, 1) };
322
+ }
323
+ }, V = {
324
+ sun: {
325
+ id: "sun",
326
+ name: "Sun Surface",
327
+ urls: [
328
+ "https://upload.wikimedia.org/wikipedia/commons/b/b4/The_Sun_by_the_Atmospheric_Imaging_Assembly_of_NASA%27s_Solar_Dynamics_Observatory_-_20100819.jpg"
329
+ ],
330
+ credit: "NASA/SDO (AIA)",
331
+ license: "public-domain",
332
+ width: 4096,
333
+ height: 4096
334
+ },
335
+ mercury: {
336
+ id: "mercury",
337
+ name: "Mercury Surface",
338
+ urls: [
339
+ "https://upload.wikimedia.org/wikipedia/commons/9/92/Solarsystemscope_texture_2k_mercury.jpg"
340
+ ],
341
+ credit: "NASA/Johns Hopkins APL/Carnegie Institution",
342
+ license: "public-domain",
343
+ width: 2048,
344
+ height: 1024
345
+ },
346
+ venus: {
347
+ id: "venus",
348
+ name: "Venus Surface (Radar)",
349
+ urls: [
350
+ "https://upload.wikimedia.org/wikipedia/commons/1/16/Solarsystemscope_texture_2k_venus_surface.jpg"
351
+ ],
352
+ credit: "NASA/JPL-Caltech",
353
+ license: "public-domain",
354
+ width: 2048,
355
+ height: 1024
356
+ },
357
+ venus_atmosphere: {
358
+ id: "venus_atmosphere",
359
+ name: "Venus Atmosphere",
360
+ urls: [
361
+ "https://upload.wikimedia.org/wikipedia/commons/7/72/Solarsystemscope_texture_2k_venus_atmosphere.jpg"
362
+ ],
363
+ credit: "NASA/JPL-Caltech",
364
+ license: "public-domain",
365
+ width: 2048,
366
+ height: 1024
367
+ },
368
+ earth: {
369
+ id: "earth",
370
+ name: "Earth Blue Marble",
371
+ urls: [
372
+ "https://upload.wikimedia.org/wikipedia/commons/0/04/Solarsystemscope_texture_8k_earth_daymap.jpg",
373
+ "https://upload.wikimedia.org/wikipedia/commons/2/23/Blue_Marble_2002.png"
374
+ ],
375
+ credit: "NASA Visible Earth",
376
+ license: "public-domain",
377
+ width: 8192,
378
+ height: 4096
379
+ },
380
+ earth_night: {
381
+ id: "earth_night",
382
+ name: "Earth Night Lights",
383
+ urls: [
384
+ "https://upload.wikimedia.org/wikipedia/commons/b/ba/Solarsystemscope_texture_8k_earth_nightmap.jpg"
385
+ ],
386
+ credit: "NASA Earth Observatory",
387
+ license: "public-domain",
388
+ width: 8192,
389
+ height: 4096
390
+ },
391
+ earth_clouds: {
392
+ id: "earth_clouds",
393
+ name: "Earth Clouds",
394
+ urls: [
395
+ "https://upload.wikimedia.org/wikipedia/commons/9/9d/Solarsystemscope_texture_8k_earth_clouds.jpg"
396
+ ],
397
+ credit: "NASA Visible Earth",
398
+ license: "public-domain",
399
+ width: 8192,
400
+ height: 4096
401
+ },
402
+ moon: {
403
+ id: "moon",
404
+ name: "Moon Surface",
405
+ urls: [
406
+ "https://upload.wikimedia.org/wikipedia/commons/a/a8/Solarsystemscope_texture_8k_moon.jpg"
407
+ ],
408
+ credit: "NASA/GSFC/Arizona State University (LROC)",
409
+ license: "public-domain",
410
+ width: 8192,
411
+ height: 4096
412
+ },
413
+ mars: {
414
+ id: "mars",
415
+ name: "Mars Surface",
416
+ urls: [
417
+ "https://upload.wikimedia.org/wikipedia/commons/f/fe/Solarsystemscope_texture_8k_mars.jpg"
418
+ ],
419
+ credit: "NASA/JPL-Caltech (MOLA)",
420
+ license: "public-domain",
421
+ width: 8192,
422
+ height: 4096
423
+ },
424
+ jupiter: {
425
+ id: "jupiter",
426
+ name: "Jupiter Surface",
427
+ urls: [
428
+ "https://upload.wikimedia.org/wikipedia/commons/4/48/Solarsystemscope_texture_8k_jupiter.jpg"
429
+ ],
430
+ credit: "NASA/JPL-Caltech (Cassini/Juno)",
431
+ license: "public-domain",
432
+ width: 8192,
433
+ height: 4096
434
+ },
435
+ saturn: {
436
+ id: "saturn",
437
+ name: "Saturn Surface",
438
+ urls: [
439
+ "https://upload.wikimedia.org/wikipedia/commons/e/ea/Solarsystemscope_texture_8k_saturn.jpg"
440
+ ],
441
+ credit: "NASA/JPL-Caltech (Cassini)",
442
+ license: "public-domain",
443
+ width: 8192,
444
+ height: 4096
445
+ },
446
+ saturn_ring: {
447
+ id: "saturn_ring",
448
+ name: "Saturn Ring",
449
+ urls: [
450
+ "https://upload.wikimedia.org/wikipedia/commons/1/1e/Solarsystemscope_texture_2k_saturn_ring_alpha.png"
451
+ ],
452
+ credit: "NASA/JPL-Caltech (Cassini)",
453
+ license: "public-domain",
454
+ width: 2048,
455
+ height: 64
456
+ },
457
+ uranus: {
458
+ id: "uranus",
459
+ name: "Uranus Surface",
460
+ urls: [
461
+ "https://upload.wikimedia.org/wikipedia/commons/9/95/Solarsystemscope_texture_2k_uranus.jpg"
462
+ ],
463
+ credit: "NASA/JPL-Caltech (Voyager)",
464
+ license: "public-domain",
465
+ width: 2048,
466
+ height: 1024
467
+ },
468
+ neptune: {
469
+ id: "neptune",
470
+ name: "Neptune Surface",
471
+ urls: [
472
+ "https://upload.wikimedia.org/wikipedia/commons/1/1e/Solarsystemscope_texture_2k_neptune.jpg"
473
+ ],
474
+ credit: "NASA/JPL-Caltech (Voyager)",
475
+ license: "public-domain",
476
+ width: 2048,
477
+ height: 1024
478
+ }
479
+ }, G = {
480
+ milky_way: {
481
+ id: "milky_way",
482
+ name: "Milky Way Panorama",
483
+ urls: [
484
+ "https://upload.wikimedia.org/wikipedia/commons/4/43/ESO_-_Milky_Way.jpg"
485
+ ],
486
+ credit: "ESO/S. Brunier",
487
+ license: "CC-BY",
488
+ width: 9e3,
489
+ height: 3600
490
+ },
491
+ star_field: {
492
+ id: "star_field",
493
+ name: "Star Field Background",
494
+ urls: [
495
+ "https://upload.wikimedia.org/wikipedia/commons/8/80/Solarsystemscope_texture_8k_stars.jpg"
496
+ ],
497
+ credit: "NASA/Goddard Space Flight Center",
498
+ license: "public-domain",
499
+ width: 8192,
500
+ height: 4096
501
+ }
502
+ };
503
+ async function E(e, a = {}) {
504
+ const { duration: i = 400, easing: s = "ease-in-out", signal: r } = a;
505
+ if (r != null && r.aborted) return;
506
+ if (!("startViewTransition" in document)) {
507
+ await e();
508
+ return;
509
+ }
510
+ document.documentElement.style.setProperty("--cosmos-vt-duration", `${i}ms`), document.documentElement.style.setProperty("--cosmos-vt-easing", s), await document.startViewTransition(e).finished;
511
+ }
512
+ function v(e, a = {}) {
513
+ const {
514
+ delay: i = 0,
515
+ stagger: s = 60,
516
+ duration: r = 500,
517
+ from: o = "bottom",
518
+ distance: t = "20px",
519
+ signal: n
520
+ } = a;
521
+ if (n != null && n.aborted) return Promise.resolve();
522
+ const d = {
523
+ top: `translateY(-${t})`,
524
+ bottom: `translateY(${t})`,
525
+ left: `translateX(-${t})`,
526
+ right: `translateX(${t})`
527
+ }[o], u = [...e.children];
528
+ return u.forEach((c) => {
529
+ c.style.opacity = "0", c.style.transform = d, c.style.transition = "none";
530
+ }), u.length === 0 ? Promise.resolve() : new Promise((c) => {
531
+ const y = performance.now() + i, m = () => {
532
+ u.forEach((f) => {
533
+ f.style.opacity = "1", f.style.transform = "none", f.style.transition = "";
534
+ }), c();
535
+ };
536
+ n == null || n.addEventListener("abort", m, { once: !0 });
537
+ const p = (f) => {
538
+ if (n != null && n.aborted) return;
539
+ let _ = !0;
540
+ for (let g = 0; g < u.length; g++) {
541
+ const S = y + g * s;
542
+ if (f >= S) {
543
+ const A = u[g];
544
+ A.style.opacity === "0" && (A.style.transition = `opacity ${r}ms ease, transform ${r}ms cubic-bezier(0.2,0,0,1)`, A.style.opacity = "1", A.style.transform = "none"), f < S + r && (_ = !1);
545
+ } else
546
+ _ = !1;
547
+ }
548
+ _ ? (n == null || n.removeEventListener("abort", m), c()) : requestAnimationFrame(p);
549
+ };
550
+ requestAnimationFrame(() => requestAnimationFrame(p));
551
+ });
552
+ }
553
+ function T(e, a = {}) {
554
+ const {
555
+ stagger: i = 40,
556
+ duration: s = 300,
557
+ from: r = "bottom",
558
+ distance: o = "12px",
559
+ signal: t
560
+ } = a;
561
+ if (t != null && t.aborted) return Promise.resolve();
562
+ const l = {
563
+ top: `translateY(-${o})`,
564
+ bottom: `translateY(${o})`,
565
+ left: `translateX(-${o})`,
566
+ right: `translateX(${o})`
567
+ }[r], d = [...e.children].reverse();
568
+ return d.length === 0 ? Promise.resolve() : new Promise((u) => {
569
+ const c = performance.now(), y = () => {
570
+ d.forEach((p) => {
571
+ p.style.opacity = "0", p.style.transform = l, p.style.transition = "";
572
+ }), u();
573
+ };
574
+ t == null || t.addEventListener("abort", y, { once: !0 });
575
+ const m = (p) => {
576
+ if (t != null && t.aborted) return;
577
+ let f = !0;
578
+ for (let _ = 0; _ < d.length; _++) {
579
+ const g = c + _ * i;
580
+ if (p >= g) {
581
+ const S = d[_];
582
+ S.style.opacity !== "0" && (S.style.transition = `opacity ${s}ms ease, transform ${s}ms ease`, S.style.opacity = "0", S.style.transform = l), p < g + s && (f = !1);
583
+ } else
584
+ f = !1;
585
+ }
586
+ f ? (t == null || t.removeEventListener("abort", y), u()) : requestAnimationFrame(m);
587
+ };
588
+ requestAnimationFrame(m);
589
+ });
590
+ }
591
+ function b(e, a, i = 300) {
592
+ return new Promise((s) => {
593
+ e.style.transition = `opacity ${i}ms ease`, e.style.opacity = a === "in" ? "1" : "0", e.style.pointerEvents = a === "in" ? "auto" : "none";
594
+ const r = () => {
595
+ e.removeEventListener("transitionend", r), s();
596
+ };
597
+ e.addEventListener("transitionend", r, { once: !0 }), setTimeout(s, i + 50);
598
+ });
599
+ }
600
+ async function M(e, a, i = 400) {
601
+ a.style.opacity = "0", a.style.pointerEvents = "none", a.style.display = "", await Promise.all([
602
+ b(e, "out", i),
603
+ b(a, "in", i)
604
+ ]), e.style.display = "none";
605
+ }
606
+ function L(e, a = {}) {
607
+ const { duration: i = 500, easing: s = "cubic-bezier(0.4,0,0.2,1)", onDone: r, signal: o } = a;
608
+ if (o != null && o.aborted) return;
609
+ const t = e.getBoundingClientRect(), n = window.innerWidth / t.width, l = window.innerHeight / t.height, d = window.innerWidth / 2 - (t.left + t.width / 2), u = window.innerHeight / 2 - (t.top + t.height / 2);
610
+ e.style.transformOrigin = "center center", e.style.transition = "none", e.style.transform = "translate(0,0) scale(1,1)", requestAnimationFrame(() => {
611
+ o != null && o.aborted || requestAnimationFrame(() => {
612
+ if (o != null && o.aborted) return;
613
+ e.style.transition = `transform ${i}ms ${s}`, e.style.transform = `translate(${d}px, ${u}px) scale(${n}, ${l})`;
614
+ const c = () => {
615
+ e.removeEventListener("transitionend", c), e.style.transform = "", e.style.transition = "", r == null || r();
616
+ };
617
+ e.addEventListener("transitionend", c, { once: !0 }), setTimeout(c, i + 100);
618
+ });
619
+ });
620
+ }
621
+ function O(e, a = {}, i) {
622
+ const { duration: s = 400, easing: r = "cubic-bezier(0.4,0,0.2,1)", onDone: o, signal: t } = a;
623
+ if (t != null && t.aborted) return;
624
+ const n = e.getBoundingClientRect(), l = n.width / window.innerWidth, d = n.height / window.innerHeight, u = n.left + n.width / 2 - window.innerWidth / 2, c = n.top + n.height / 2 - window.innerHeight / 2, y = !i, m = i ?? document.createElement("div");
625
+ y && (Object.assign(m.style, {
626
+ position: "fixed",
627
+ inset: "0",
628
+ pointerEvents: "none",
629
+ zIndex: "9999",
630
+ transformOrigin: "center center"
631
+ }), document.body.appendChild(m)), m.style.transition = `transform ${s}ms ${r}, opacity ${s * 0.6}ms ease ${s * 0.4}ms`;
632
+ const p = () => {
633
+ m.removeEventListener("transitionend", p), y && m.remove(), o == null || o();
634
+ };
635
+ requestAnimationFrame(() => {
636
+ if (t != null && t.aborted) {
637
+ p();
638
+ return;
639
+ }
640
+ m.style.transform = `translate(${u}px, ${c}px) scale(${l}, ${d})`, m.style.opacity = "0", m.addEventListener("transitionend", p, { once: !0 }), setTimeout(p, s + 100);
641
+ });
642
+ }
643
+ const W = {
644
+ morph: E,
645
+ staggerIn: v,
646
+ staggerOut: T,
647
+ fade: b,
648
+ crossfade: M,
649
+ heroExpand: L,
650
+ heroCollapse: O
651
+ }, z = {
652
+ CONSTANTS: h,
653
+ Units: J,
654
+ Math: k,
655
+ Sun: K,
656
+ Moon: w,
657
+ Eclipse: B,
658
+ Planner: X,
659
+ AstroClock: Y,
660
+ Data: F,
661
+ Media: q,
662
+ API: { NASA: j, ESA: D, resolveSimbad: R },
663
+ SkyMap: { render: I, stereographic: N, mollweide: C, gnomonic: x, Interactive: $, create: P },
664
+ Transitions: { morph: E, staggerIn: v, staggerOut: T, fade: b, crossfade: M, heroExpand: L, heroCollapse: O }
665
+ };
666
+ export {
667
+ Y as AstroClock,
668
+ k as AstroMath,
669
+ ee as BRIGHT_STARS,
670
+ h as CONSTANTS,
671
+ te as CONSTELLATIONS,
672
+ ie as DEEP_SKY_EXTRAS,
673
+ F as Data,
674
+ D as ESA,
675
+ B as Eclipse,
676
+ ne as IMAGE_FALLBACKS,
677
+ $ as InteractiveSkyMap,
678
+ ae as MESSIER_CATALOG,
679
+ se as METEOR_SHOWERS,
680
+ q as Media,
681
+ w as Moon,
682
+ j as NASA,
683
+ V as PLANET_TEXTURES,
684
+ X as Planner,
685
+ re as SOLAR_SYSTEM,
686
+ G as STAR_TEXTURES,
687
+ oe as SkyMap,
688
+ K as Sun,
689
+ W as Transitions,
690
+ J as Units,
691
+ ce as canvasToEquatorial,
692
+ le as computeFov,
693
+ P as createInteractiveSkyMap,
694
+ M as crossfade,
695
+ z as default,
696
+ b as fade,
697
+ ue as getObjectImage,
698
+ x as gnomonic,
699
+ O as heroCollapse,
700
+ L as heroExpand,
701
+ C as mollweide,
702
+ E as morph,
703
+ de as prefetchImages,
704
+ I as renderSkyMap,
705
+ me as resolveImages,
706
+ R as resolveSimbad,
707
+ pe as spectralColor,
708
+ v as staggerIn,
709
+ T as staggerOut,
710
+ N as stereographic,
711
+ he as tryDSS,
712
+ fe as tryPanSTARRS
713
+ };