kaabalah 6.7.0 → 6.8.1

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 (129) hide show
  1. package/dist/astrology/index.js +54 -54
  2. package/dist/astrology/index.js.map +1 -1
  3. package/dist/astrology/index.mjs +3 -3
  4. package/dist/astrology/index.mjs.map +1 -1
  5. package/dist/chunk-2WCC2KCJ.js +1 -1
  6. package/dist/chunk-2WCC2KCJ.js.map +1 -1
  7. package/dist/{chunk-XTE5DSDO.js → chunk-36XZ5WR2.js} +23 -23
  8. package/dist/chunk-36XZ5WR2.js.map +1 -0
  9. package/dist/{chunk-6P2CJUTH.mjs → chunk-3UJPBUY4.mjs} +8 -6
  10. package/dist/chunk-3UJPBUY4.mjs.map +1 -0
  11. package/dist/{chunk-FM7WUVZV.js → chunk-4337NVKS.js} +8 -4
  12. package/dist/chunk-4337NVKS.js.map +1 -0
  13. package/dist/{chunk-SFUCT6I2.mjs → chunk-5HXSHALQ.mjs} +49 -43
  14. package/dist/chunk-5HXSHALQ.mjs.map +1 -0
  15. package/dist/{chunk-EFZUZI22.mjs → chunk-5K4OQ4UB.mjs} +5 -4
  16. package/dist/chunk-5K4OQ4UB.mjs.map +1 -0
  17. package/dist/{chunk-ZKIJAZ6B.mjs → chunk-6N5YC2WD.mjs} +338 -10
  18. package/dist/chunk-6N5YC2WD.mjs.map +1 -0
  19. package/dist/{chunk-PWYOHULD.mjs → chunk-7YU7TRCG.mjs} +80 -42
  20. package/dist/chunk-7YU7TRCG.mjs.map +1 -0
  21. package/dist/{chunk-6O7MTBZN.js → chunk-BEFGGHIJ.js} +84 -46
  22. package/dist/chunk-BEFGGHIJ.js.map +1 -0
  23. package/dist/{chunk-MTI2SOQ6.mjs → chunk-ITESL6GR.mjs} +4 -4
  24. package/dist/chunk-ITESL6GR.mjs.map +1 -0
  25. package/dist/{chunk-UG6HZK3Z.js → chunk-K33NFXSD.js} +109 -109
  26. package/dist/chunk-K33NFXSD.js.map +1 -0
  27. package/dist/{chunk-OKZUVGA3.js → chunk-LQX6PW35.js} +349 -15
  28. package/dist/chunk-LQX6PW35.js.map +1 -0
  29. package/dist/{chunk-WY6NIR2V.mjs → chunk-NPQZ2DOY.mjs} +8 -4
  30. package/dist/chunk-NPQZ2DOY.mjs.map +1 -0
  31. package/dist/{chunk-WIKUOEOB.mjs → chunk-QS5XAAAG.mjs} +31 -19
  32. package/dist/chunk-QS5XAAAG.mjs.map +1 -0
  33. package/dist/{chunk-UN7QMOMX.mjs → chunk-SHKAAZHT.mjs} +8 -8
  34. package/dist/chunk-SHKAAZHT.mjs.map +1 -0
  35. package/dist/{chunk-COPYH3O2.js → chunk-SYLFUBAB.js} +51 -39
  36. package/dist/chunk-SYLFUBAB.js.map +1 -0
  37. package/dist/chunk-URDMOQRN.mjs +1 -1
  38. package/dist/chunk-URDMOQRN.mjs.map +1 -1
  39. package/dist/{chunk-PAKYKIZH.js → chunk-UZ42PN5T.js} +10 -8
  40. package/dist/chunk-UZ42PN5T.js.map +1 -0
  41. package/dist/{chunk-S6KNERP7.js → chunk-VJ6RW5H4.js} +8 -7
  42. package/dist/chunk-VJ6RW5H4.js.map +1 -0
  43. package/dist/{chunk-WCOGJKT7.js → chunk-WLML6SVX.js} +53 -47
  44. package/dist/chunk-WLML6SVX.js.map +1 -0
  45. package/dist/cli.js +1703 -426
  46. package/dist/cli.js.map +1 -1
  47. package/dist/core/index.d.mts +1 -0
  48. package/dist/core/index.d.ts +1 -0
  49. package/dist/core/index.js +69 -45
  50. package/dist/core/index.js.map +1 -1
  51. package/dist/core/index.mjs +4 -4
  52. package/dist/core/index.mjs.map +1 -1
  53. package/dist/gematria/index.js +7 -7
  54. package/dist/gematria/index.js.map +1 -1
  55. package/dist/gematria/index.mjs +4 -4
  56. package/dist/gematria/index.mjs.map +1 -1
  57. package/dist/ifa/index.js +2 -2
  58. package/dist/ifa/index.js.map +1 -1
  59. package/dist/ifa/index.mjs +2 -2
  60. package/dist/ifa/index.mjs.map +1 -1
  61. package/dist/index.d.mts +1 -0
  62. package/dist/index.d.ts +1 -0
  63. package/dist/index.js +377 -353
  64. package/dist/index.js.map +1 -1
  65. package/dist/index.mjs +10 -10
  66. package/dist/index.mjs.map +1 -1
  67. package/dist/numerology/index.js +20 -20
  68. package/dist/numerology/index.js.map +1 -1
  69. package/dist/numerology/index.mjs +5 -5
  70. package/dist/numerology/index.mjs.map +1 -1
  71. package/dist/semantic/index.js +28 -28
  72. package/dist/semantic/index.js.map +1 -1
  73. package/dist/semantic/index.mjs +9 -9
  74. package/dist/semantic/index.mjs.map +1 -1
  75. package/dist/{swisseph.node-6H4ISR7M.mjs → swisseph.node-2PWBQLWG.mjs} +270 -156
  76. package/dist/swisseph.node-2PWBQLWG.mjs.map +1 -0
  77. package/dist/{wasm/build/swisseph.node-UD2JYYLE.js → swisseph.node-NWM75JF3.js} +283 -169
  78. package/dist/swisseph.node-NWM75JF3.js.map +1 -0
  79. package/dist/{swisseph.web-TSFJI7DQ.mjs → swisseph.web-CK57WSU3.mjs} +264 -153
  80. package/dist/swisseph.web-CK57WSU3.mjs.map +1 -0
  81. package/dist/{wasm/build/swisseph.web-MXYBWOOS.js → swisseph.web-GPTWPXKT.js} +277 -166
  82. package/dist/swisseph.web-GPTWPXKT.js.map +1 -0
  83. package/dist/tarot/index.js +25 -25
  84. package/dist/tarot/index.js.map +1 -1
  85. package/dist/tarot/index.mjs +5 -5
  86. package/dist/tarot/index.mjs.map +1 -1
  87. package/dist/topology-Bbgniegh.d.ts +102 -0
  88. package/dist/topology-CSSfYL2c.d.mts +102 -0
  89. package/dist/visual/index.d.mts +2 -1
  90. package/dist/visual/index.d.ts +2 -1
  91. package/dist/visual/index.js +46 -46
  92. package/dist/visual/index.js.map +1 -1
  93. package/dist/visual/index.mjs +5 -5
  94. package/dist/visual/index.mjs.map +1 -1
  95. package/dist/wasm/build/{swisseph.node-6H4ISR7M.mjs → swisseph.node-2PWBQLWG.mjs} +270 -156
  96. package/dist/wasm/build/swisseph.node-2PWBQLWG.mjs.map +1 -0
  97. package/dist/{swisseph.node-UD2JYYLE.js → wasm/build/swisseph.node-NWM75JF3.js} +283 -169
  98. package/dist/wasm/build/swisseph.node-NWM75JF3.js.map +1 -0
  99. package/dist/wasm/build/{swisseph.web-TSFJI7DQ.mjs → swisseph.web-CK57WSU3.mjs} +264 -153
  100. package/dist/wasm/build/swisseph.web-CK57WSU3.mjs.map +1 -0
  101. package/dist/{swisseph.web-MXYBWOOS.js → wasm/build/swisseph.web-GPTWPXKT.js} +277 -166
  102. package/dist/wasm/build/swisseph.web-GPTWPXKT.js.map +1 -0
  103. package/package.json +7 -7
  104. package/dist/chunk-6O7MTBZN.js.map +0 -1
  105. package/dist/chunk-6P2CJUTH.mjs.map +0 -1
  106. package/dist/chunk-COPYH3O2.js.map +0 -1
  107. package/dist/chunk-EFZUZI22.mjs.map +0 -1
  108. package/dist/chunk-FM7WUVZV.js.map +0 -1
  109. package/dist/chunk-MTI2SOQ6.mjs.map +0 -1
  110. package/dist/chunk-OKZUVGA3.js.map +0 -1
  111. package/dist/chunk-PAKYKIZH.js.map +0 -1
  112. package/dist/chunk-PWYOHULD.mjs.map +0 -1
  113. package/dist/chunk-S6KNERP7.js.map +0 -1
  114. package/dist/chunk-SFUCT6I2.mjs.map +0 -1
  115. package/dist/chunk-UG6HZK3Z.js.map +0 -1
  116. package/dist/chunk-UN7QMOMX.mjs.map +0 -1
  117. package/dist/chunk-WCOGJKT7.js.map +0 -1
  118. package/dist/chunk-WIKUOEOB.mjs.map +0 -1
  119. package/dist/chunk-WY6NIR2V.mjs.map +0 -1
  120. package/dist/chunk-XTE5DSDO.js.map +0 -1
  121. package/dist/chunk-ZKIJAZ6B.mjs.map +0 -1
  122. package/dist/swisseph.node-6H4ISR7M.mjs.map +0 -1
  123. package/dist/swisseph.node-UD2JYYLE.js.map +0 -1
  124. package/dist/swisseph.web-MXYBWOOS.js.map +0 -1
  125. package/dist/swisseph.web-TSFJI7DQ.mjs.map +0 -1
  126. package/dist/wasm/build/swisseph.node-6H4ISR7M.mjs.map +0 -1
  127. package/dist/wasm/build/swisseph.node-UD2JYYLE.js.map +0 -1
  128. package/dist/wasm/build/swisseph.web-MXYBWOOS.js.map +0 -1
  129. package/dist/wasm/build/swisseph.web-TSFJI7DQ.mjs.map +0 -1
package/dist/cli.js CHANGED
@@ -34,7 +34,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  mod
35
35
  ));
36
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
37
+ var __publicField = (obj, key, value) => {
38
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
39
+ return value;
40
+ };
38
41
 
39
42
  // wasm/build/swisseph.node.wasm?url
40
43
  var swisseph_node_default;
@@ -319,7 +322,8 @@ var init_swisseph = __esm({
319
322
  const BYTES_PER_F64 = 8;
320
323
  const totalBytes = (HOUSES_DOUBLES + ASCMC_DOUBLES) * BYTES_PER_F64;
321
324
  const memoryPtr = this.module._malloc(totalBytes);
322
- if (!memoryPtr) throw new Error("Memory allocation failed");
325
+ if (!memoryPtr)
326
+ throw new Error("Memory allocation failed");
323
327
  const housesPtr = memoryPtr;
324
328
  const ascmcPtr = memoryPtr + HOUSES_DOUBLES * BYTES_PER_F64;
325
329
  try {
@@ -443,9 +447,12 @@ var init_swisseph = __esm({
443
447
  const xinPtr = this.module._malloc(3 * BYTES);
444
448
  const xazPtr = this.module._malloc(3 * BYTES);
445
449
  if (!geoPtr || !xinPtr || !xazPtr) {
446
- if (geoPtr) this.module._free(geoPtr);
447
- if (xinPtr) this.module._free(xinPtr);
448
- if (xazPtr) this.module._free(xazPtr);
450
+ if (geoPtr)
451
+ this.module._free(geoPtr);
452
+ if (xinPtr)
453
+ this.module._free(xinPtr);
454
+ if (xazPtr)
455
+ this.module._free(xazPtr);
449
456
  throw new Error("Memory allocation failed for azalt");
450
457
  }
451
458
  try {
@@ -492,9 +499,12 @@ var init_swisseph = __esm({
492
499
  const ERR_BYTES = 512;
493
500
  const errPtr = this.module._malloc(ERR_BYTES);
494
501
  if (!geoPtr || !tretPtr || !errPtr) {
495
- if (geoPtr) this.module._free(geoPtr);
496
- if (tretPtr) this.module._free(tretPtr);
497
- if (errPtr) this.module._free(errPtr);
502
+ if (geoPtr)
503
+ this.module._free(geoPtr);
504
+ if (tretPtr)
505
+ this.module._free(tretPtr);
506
+ if (errPtr)
507
+ this.module._free(errPtr);
498
508
  throw new Error("Memory allocation failed for riseTransit");
499
509
  }
500
510
  this.module.HEAP8.fill(0, errPtr, errPtr + ERR_BYTES);
@@ -538,7 +548,8 @@ var require_swisseph_web = __commonJS({
538
548
  "use strict";
539
549
  var SwissEphemerisModule = (() => {
540
550
  var _scriptName = typeof document != "undefined" ? document.currentScript?.src : void 0;
541
- if (typeof __filename != "undefined") _scriptName = _scriptName || __filename;
551
+ if (typeof __filename != "undefined")
552
+ _scriptName = _scriptName || __filename;
542
553
  return async function(moduleArg = {}) {
543
554
  var moduleRtn;
544
555
  var Module = moduleArg;
@@ -568,7 +579,8 @@ var require_swisseph_web = __commonJS({
568
579
  }
569
580
  var readAsync, readBinary;
570
581
  if (ENVIRONMENT_IS_NODE) {
571
- if (typeof process == "undefined" || !process.release || process.release.name !== "node") throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
582
+ if (typeof process == "undefined" || !process.release || process.release.name !== "node")
583
+ throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
572
584
  var nodeVersion = process.versions.node;
573
585
  var numericVersion = nodeVersion.split(".").slice(0, 3);
574
586
  numericVersion = numericVersion[0] * 1e4 + numericVersion[1] * 100 + numericVersion[2].split("-")[0] * 1;
@@ -599,7 +611,8 @@ var require_swisseph_web = __commonJS({
599
611
  throw toThrow;
600
612
  };
601
613
  } else if (ENVIRONMENT_IS_SHELL) {
602
- if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof WorkerGlobalScope != "undefined") throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
614
+ if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof WorkerGlobalScope != "undefined")
615
+ throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
603
616
  } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
604
617
  if (ENVIRONMENT_IS_WORKER) {
605
618
  scriptDirectory = self.location.href;
@@ -614,7 +627,8 @@ var require_swisseph_web = __commonJS({
614
627
  } else {
615
628
  scriptDirectory = scriptDirectory.slice(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
616
629
  }
617
- if (!(typeof window == "object" || typeof WorkerGlobalScope != "undefined")) throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
630
+ if (!(typeof window == "object" || typeof WorkerGlobalScope != "undefined"))
631
+ throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
618
632
  {
619
633
  readAsync = async (url) => {
620
634
  assert(!isFileURI(url), "readAsync does not work with file:// URLs");
@@ -633,9 +647,11 @@ var require_swisseph_web = __commonJS({
633
647
  Object.assign(Module, moduleOverrides);
634
648
  moduleOverrides = null;
635
649
  checkIncomingModuleAPI();
636
- if (Module["arguments"]) arguments_ = Module["arguments"];
650
+ if (Module["arguments"])
651
+ arguments_ = Module["arguments"];
637
652
  legacyModuleProp("arguments", "arguments_");
638
- if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
653
+ if (Module["thisProgram"])
654
+ thisProgram = Module["thisProgram"];
639
655
  legacyModuleProp("thisProgram", "thisProgram");
640
656
  assert(typeof Module["memoryInitializerPrefixURL"] == "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");
641
657
  assert(typeof Module["pthreadMainPrefixURL"] == "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");
@@ -677,7 +693,8 @@ var require_swisseph_web = __commonJS({
677
693
  SAFE_HEAP_STORE((max + 4 >> 2) * 4, 2310721022, 4);
678
694
  }
679
695
  function checkStackCookie() {
680
- if (ABORT) return;
696
+ if (ABORT)
697
+ return;
681
698
  var max = _emscripten_stack_get_end();
682
699
  if (max == 0) {
683
700
  max += 4;
@@ -692,7 +709,8 @@ var require_swisseph_web = __commonJS({
692
709
  var h16 = new Int16Array(1);
693
710
  var h8 = new Int8Array(h16.buffer);
694
711
  h16[0] = 25459;
695
- if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
712
+ if (h8[0] !== 115 || h8[1] !== 99)
713
+ throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
696
714
  })();
697
715
  if (Module["ENVIRONMENT"]) {
698
716
  throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");
@@ -771,13 +789,18 @@ var require_swisseph_web = __commonJS({
771
789
  }
772
790
  }
773
791
  function SAFE_HEAP_STORE(dest, value, bytes, isFloat) {
774
- if (dest <= 0) abort(`segmentation fault storing ${bytes} bytes to address ${dest}`);
775
- if (dest % bytes !== 0) abort(`alignment error storing to address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
792
+ if (dest <= 0)
793
+ abort(`segmentation fault storing ${bytes} bytes to address ${dest}`);
794
+ if (dest % bytes !== 0)
795
+ abort(`alignment error storing to address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
776
796
  if (runtimeInitialized) {
777
797
  var brk = _sbrk(0);
778
- if (dest + bytes > brk) abort(`segmentation fault, exceeded the top of the available dynamic heap when storing ${bytes} bytes to address ${dest}. DYNAMICTOP=${brk}`);
779
- if (brk < _emscripten_stack_get_base()) abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
780
- if (brk > wasmMemory.buffer.byteLength) abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
798
+ if (dest + bytes > brk)
799
+ abort(`segmentation fault, exceeded the top of the available dynamic heap when storing ${bytes} bytes to address ${dest}. DYNAMICTOP=${brk}`);
800
+ if (brk < _emscripten_stack_get_base())
801
+ abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
802
+ if (brk > wasmMemory.buffer.byteLength)
803
+ abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
781
804
  }
782
805
  setValue_safe(dest, value, getSafeHeapType(bytes, isFloat));
783
806
  return value;
@@ -786,17 +809,23 @@ var require_swisseph_web = __commonJS({
786
809
  return SAFE_HEAP_STORE(dest, value, bytes, true);
787
810
  }
788
811
  function SAFE_HEAP_LOAD(dest, bytes, unsigned, isFloat) {
789
- if (dest <= 0) abort(`segmentation fault loading ${bytes} bytes from address ${dest}`);
790
- if (dest % bytes !== 0) abort(`alignment error loading from address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
812
+ if (dest <= 0)
813
+ abort(`segmentation fault loading ${bytes} bytes from address ${dest}`);
814
+ if (dest % bytes !== 0)
815
+ abort(`alignment error loading from address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
791
816
  if (runtimeInitialized) {
792
817
  var brk = _sbrk(0);
793
- if (dest + bytes > brk) abort(`segmentation fault, exceeded the top of the available dynamic heap when loading ${bytes} bytes from address ${dest}. DYNAMICTOP=${brk}`);
794
- if (brk < _emscripten_stack_get_base()) abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
795
- if (brk > wasmMemory.buffer.byteLength) abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
818
+ if (dest + bytes > brk)
819
+ abort(`segmentation fault, exceeded the top of the available dynamic heap when loading ${bytes} bytes from address ${dest}. DYNAMICTOP=${brk}`);
820
+ if (brk < _emscripten_stack_get_base())
821
+ abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
822
+ if (brk > wasmMemory.buffer.byteLength)
823
+ abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
796
824
  }
797
825
  var type = getSafeHeapType(bytes, isFloat);
798
826
  var ret = getValue_safe(dest, type);
799
- if (unsigned) ret = unSign(ret, parseInt(type.slice(1), 10));
827
+ if (unsigned)
828
+ ret = unSign(ret, parseInt(type.slice(1), 10));
800
829
  return ret;
801
830
  }
802
831
  function SAFE_HEAP_LOAD_D(dest, bytes, unsigned) {
@@ -827,7 +856,8 @@ var require_swisseph_web = __commonJS({
827
856
  assert(!Module["INITIAL_MEMORY"], "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");
828
857
  function preRun() {
829
858
  if (Module["preRun"]) {
830
- if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]];
859
+ if (typeof Module["preRun"] == "function")
860
+ Module["preRun"] = [Module["preRun"]];
831
861
  while (Module["preRun"].length) {
832
862
  addOnPreRun(Module["preRun"].shift());
833
863
  }
@@ -839,7 +869,8 @@ var require_swisseph_web = __commonJS({
839
869
  assert(!runtimeInitialized);
840
870
  runtimeInitialized = true;
841
871
  checkStackCookie();
842
- if (!Module["noFSInit"] && !FS.initialized) FS.init();
872
+ if (!Module["noFSInit"] && !FS.initialized)
873
+ FS.init();
843
874
  TTY.init();
844
875
  wasmExports["__wasm_call_ctors"]();
845
876
  FS.ignorePermissions = false;
@@ -847,7 +878,8 @@ var require_swisseph_web = __commonJS({
847
878
  function postRun() {
848
879
  checkStackCookie();
849
880
  if (Module["postRun"]) {
850
- if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]];
881
+ if (typeof Module["postRun"] == "function")
882
+ Module["postRun"] = [Module["postRun"]];
851
883
  while (Module["postRun"].length) {
852
884
  addOnPostRun(Module["postRun"].shift());
853
885
  }
@@ -862,7 +894,8 @@ var require_swisseph_web = __commonJS({
862
894
  function getUniqueRunDependency(id2) {
863
895
  var orig = id2;
864
896
  while (1) {
865
- if (!runDependencyTracking[id2]) return id2;
897
+ if (!runDependencyTracking[id2])
898
+ return id2;
866
899
  id2 = orig + Math.random();
867
900
  }
868
901
  }
@@ -1044,7 +1077,8 @@ var require_swisseph_web = __commonJS({
1044
1077
  var onPreRuns = [];
1045
1078
  var addOnPreRun = (cb) => onPreRuns.unshift(cb);
1046
1079
  function getValue(ptr, type = "i8") {
1047
- if (type.endsWith("*")) type = "*";
1080
+ if (type.endsWith("*"))
1081
+ type = "*";
1048
1082
  switch (type) {
1049
1083
  case "i1":
1050
1084
  return SAFE_HEAP_LOAD(ptr, 1, 0);
@@ -1067,7 +1101,8 @@ var require_swisseph_web = __commonJS({
1067
1101
  }
1068
1102
  }
1069
1103
  function getValue_safe(ptr, type = "i8") {
1070
- if (type.endsWith("*")) type = "*";
1104
+ if (type.endsWith("*"))
1105
+ type = "*";
1071
1106
  switch (type) {
1072
1107
  case "i1":
1073
1108
  return HEAP8[ptr];
@@ -1096,7 +1131,8 @@ var require_swisseph_web = __commonJS({
1096
1131
  return "0x" + ptr.toString(16).padStart(8, "0");
1097
1132
  };
1098
1133
  function setValue(ptr, value, type = "i8") {
1099
- if (type.endsWith("*")) type = "*";
1134
+ if (type.endsWith("*"))
1135
+ type = "*";
1100
1136
  switch (type) {
1101
1137
  case "i1":
1102
1138
  SAFE_HEAP_STORE(ptr, value, 1);
@@ -1127,7 +1163,8 @@ var require_swisseph_web = __commonJS({
1127
1163
  }
1128
1164
  }
1129
1165
  function setValue_safe(ptr, value, type = "i8") {
1130
- if (type.endsWith("*")) type = "*";
1166
+ if (type.endsWith("*"))
1167
+ type = "*";
1131
1168
  switch (type) {
1132
1169
  case "i1":
1133
1170
  HEAP8[ptr] = value;
@@ -1169,7 +1206,8 @@ var require_swisseph_web = __commonJS({
1169
1206
  warnOnce.shown || (warnOnce.shown = {});
1170
1207
  if (!warnOnce.shown[text]) {
1171
1208
  warnOnce.shown[text] = 1;
1172
- if (ENVIRONMENT_IS_NODE) text = "warning: " + text;
1209
+ if (ENVIRONMENT_IS_NODE)
1210
+ text = "warning: " + text;
1173
1211
  err(text);
1174
1212
  }
1175
1213
  };
@@ -1253,13 +1291,16 @@ var require_swisseph_web = __commonJS({
1253
1291
  function trim(arr) {
1254
1292
  var start = 0;
1255
1293
  for (; start < arr.length; start++) {
1256
- if (arr[start] !== "") break;
1294
+ if (arr[start] !== "")
1295
+ break;
1257
1296
  }
1258
1297
  var end = arr.length - 1;
1259
1298
  for (; end >= 0; end--) {
1260
- if (arr[end] !== "") break;
1299
+ if (arr[end] !== "")
1300
+ break;
1261
1301
  }
1262
- if (start > end) return [];
1302
+ if (start > end)
1303
+ return [];
1263
1304
  return arr.slice(start, end - start + 1);
1264
1305
  }
1265
1306
  var fromParts = trim(from.split("/"));
@@ -1283,7 +1324,8 @@ var require_swisseph_web = __commonJS({
1283
1324
  var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead = NaN) => {
1284
1325
  var endIdx = idx + maxBytesToRead;
1285
1326
  var endPtr = idx;
1286
- while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
1327
+ while (heapOrArray[endPtr] && !(endPtr >= endIdx))
1328
+ ++endPtr;
1287
1329
  if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
1288
1330
  return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
1289
1331
  }
@@ -1303,7 +1345,8 @@ var require_swisseph_web = __commonJS({
1303
1345
  if ((u0 & 240) == 224) {
1304
1346
  u0 = (u0 & 15) << 12 | u1 << 6 | u2;
1305
1347
  } else {
1306
- if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte " + ptrToString(u0) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");
1348
+ if ((u0 & 248) != 240)
1349
+ warnOnce("Invalid UTF-8 leading byte " + ptrToString(u0) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");
1307
1350
  u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
1308
1351
  }
1309
1352
  if (u0 < 65536) {
@@ -1335,7 +1378,8 @@ var require_swisseph_web = __commonJS({
1335
1378
  };
1336
1379
  var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {
1337
1380
  assert(typeof str === "string", `stringToUTF8Array expects a string (got ${typeof str})`);
1338
- if (!(maxBytesToWrite > 0)) return 0;
1381
+ if (!(maxBytesToWrite > 0))
1382
+ return 0;
1339
1383
  var startIdx = outIdx;
1340
1384
  var endIdx = outIdx + maxBytesToWrite - 1;
1341
1385
  for (var i = 0; i < str.length; ++i) {
@@ -1345,20 +1389,25 @@ var require_swisseph_web = __commonJS({
1345
1389
  u = 65536 + ((u & 1023) << 10) | u1 & 1023;
1346
1390
  }
1347
1391
  if (u <= 127) {
1348
- if (outIdx >= endIdx) break;
1392
+ if (outIdx >= endIdx)
1393
+ break;
1349
1394
  heap[outIdx++] = u;
1350
1395
  } else if (u <= 2047) {
1351
- if (outIdx + 1 >= endIdx) break;
1396
+ if (outIdx + 1 >= endIdx)
1397
+ break;
1352
1398
  heap[outIdx++] = 192 | u >> 6;
1353
1399
  heap[outIdx++] = 128 | u & 63;
1354
1400
  } else if (u <= 65535) {
1355
- if (outIdx + 2 >= endIdx) break;
1401
+ if (outIdx + 2 >= endIdx)
1402
+ break;
1356
1403
  heap[outIdx++] = 224 | u >> 12;
1357
1404
  heap[outIdx++] = 128 | u >> 6 & 63;
1358
1405
  heap[outIdx++] = 128 | u & 63;
1359
1406
  } else {
1360
- if (outIdx + 3 >= endIdx) break;
1361
- if (u > 1114111) warnOnce("Invalid Unicode code point " + ptrToString(u) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");
1407
+ if (outIdx + 3 >= endIdx)
1408
+ break;
1409
+ if (u > 1114111)
1410
+ warnOnce("Invalid Unicode code point " + ptrToString(u) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");
1362
1411
  heap[outIdx++] = 240 | u >> 18;
1363
1412
  heap[outIdx++] = 128 | u >> 12 & 63;
1364
1413
  heap[outIdx++] = 128 | u >> 6 & 63;
@@ -1372,7 +1421,8 @@ var require_swisseph_web = __commonJS({
1372
1421
  var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
1373
1422
  var u8array = new Array(len);
1374
1423
  var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
1375
- if (dontAddNull) u8array.length = numBytesWritten;
1424
+ if (dontAddNull)
1425
+ u8array.length = numBytesWritten;
1376
1426
  return u8array;
1377
1427
  };
1378
1428
  var FS_stdin_getChar = () => {
@@ -1386,8 +1436,10 @@ var require_swisseph_web = __commonJS({
1386
1436
  try {
1387
1437
  bytesRead = fs.readSync(fd, buf, 0, BUFSIZE);
1388
1438
  } catch (e) {
1389
- if (e.toString().includes("EOF")) bytesRead = 0;
1390
- else throw e;
1439
+ if (e.toString().includes("EOF"))
1440
+ bytesRead = 0;
1441
+ else
1442
+ throw e;
1391
1443
  }
1392
1444
  if (bytesRead > 0) {
1393
1445
  result = buf.slice(0, bytesRead).toString("utf-8");
@@ -1437,7 +1489,8 @@ var require_swisseph_web = __commonJS({
1437
1489
  if (result === void 0 && bytesRead === 0) {
1438
1490
  throw new FS.ErrnoError(6);
1439
1491
  }
1440
- if (result === null || result === void 0) break;
1492
+ if (result === null || result === void 0)
1493
+ break;
1441
1494
  bytesRead++;
1442
1495
  buffer[offset + i] = result;
1443
1496
  }
@@ -1467,7 +1520,8 @@ var require_swisseph_web = __commonJS({
1467
1520
  out(UTF8ArrayToString(tty.output));
1468
1521
  tty.output = [];
1469
1522
  } else {
1470
- if (val != 0) tty.output.push(val);
1523
+ if (val != 0)
1524
+ tty.output.push(val);
1471
1525
  }
1472
1526
  }, fsync(tty) {
1473
1527
  if (tty.output?.length > 0) {
@@ -1485,7 +1539,8 @@ var require_swisseph_web = __commonJS({
1485
1539
  err(UTF8ArrayToString(tty.output));
1486
1540
  tty.output = [];
1487
1541
  } else {
1488
- if (val != 0) tty.output.push(val);
1542
+ if (val != 0)
1543
+ tty.output.push(val);
1489
1544
  }
1490
1545
  }, fsync(tty) {
1491
1546
  if (tty.output?.length > 0) {
@@ -1531,20 +1586,26 @@ var require_swisseph_web = __commonJS({
1531
1586
  }
1532
1587
  return node;
1533
1588
  }, getFileDataAsTypedArray(node) {
1534
- if (!node.contents) return new Uint8Array(0);
1535
- if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes);
1589
+ if (!node.contents)
1590
+ return new Uint8Array(0);
1591
+ if (node.contents.subarray)
1592
+ return node.contents.subarray(0, node.usedBytes);
1536
1593
  return new Uint8Array(node.contents);
1537
1594
  }, expandFileStorage(node, newCapacity) {
1538
1595
  var prevCapacity = node.contents ? node.contents.length : 0;
1539
- if (prevCapacity >= newCapacity) return;
1596
+ if (prevCapacity >= newCapacity)
1597
+ return;
1540
1598
  var CAPACITY_DOUBLING_MAX = 1024 * 1024;
1541
1599
  newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0);
1542
- if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256);
1600
+ if (prevCapacity != 0)
1601
+ newCapacity = Math.max(newCapacity, 256);
1543
1602
  var oldContents = node.contents;
1544
1603
  node.contents = new Uint8Array(newCapacity);
1545
- if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0);
1604
+ if (node.usedBytes > 0)
1605
+ node.contents.set(oldContents.subarray(0, node.usedBytes), 0);
1546
1606
  }, resizeFileStorage(node, newSize) {
1547
- if (node.usedBytes == newSize) return;
1607
+ if (node.usedBytes == newSize)
1608
+ return;
1548
1609
  if (newSize == 0) {
1549
1610
  node.contents = null;
1550
1611
  node.usedBytes = 0;
@@ -1634,13 +1695,15 @@ var require_swisseph_web = __commonJS({
1634
1695
  return node.link;
1635
1696
  } }, stream_ops: { read(stream, buffer, offset, length, position) {
1636
1697
  var contents = stream.node.contents;
1637
- if (position >= stream.node.usedBytes) return 0;
1698
+ if (position >= stream.node.usedBytes)
1699
+ return 0;
1638
1700
  var size = Math.min(stream.node.usedBytes - position, length);
1639
1701
  assert(size >= 0);
1640
1702
  if (size > 8 && contents.subarray) {
1641
1703
  buffer.set(contents.subarray(position, position + size), offset);
1642
1704
  } else {
1643
- for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i];
1705
+ for (var i = 0; i < size; i++)
1706
+ buffer[offset + i] = contents[position + i];
1644
1707
  }
1645
1708
  return size;
1646
1709
  }, write(stream, buffer, offset, length, position, canOwn) {
@@ -1648,7 +1711,8 @@ var require_swisseph_web = __commonJS({
1648
1711
  if (buffer.buffer === HEAP8.buffer) {
1649
1712
  canOwn = false;
1650
1713
  }
1651
- if (!length) return 0;
1714
+ if (!length)
1715
+ return 0;
1652
1716
  var node = stream.node;
1653
1717
  node.mtime = node.ctime = Date.now();
1654
1718
  if (buffer.subarray && (!node.contents || node.contents.subarray)) {
@@ -1731,10 +1795,12 @@ var require_swisseph_web = __commonJS({
1731
1795
  };
1732
1796
  var preloadPlugins = Module["preloadPlugins"] || [];
1733
1797
  var FS_handledByPreloadPlugin = (byteArray, fullname, finish, onerror) => {
1734
- if (typeof Browser != "undefined") Browser.init();
1798
+ if (typeof Browser != "undefined")
1799
+ Browser.init();
1735
1800
  var handled = false;
1736
1801
  preloadPlugins.forEach((plugin) => {
1737
- if (handled) return;
1802
+ if (handled)
1803
+ return;
1738
1804
  if (plugin["canHandle"](fullname)) {
1739
1805
  plugin["handle"](byteArray, fullname, finish, onerror);
1740
1806
  handled = true;
@@ -1779,8 +1845,10 @@ var require_swisseph_web = __commonJS({
1779
1845
  };
1780
1846
  var FS_getMode = (canRead, canWrite) => {
1781
1847
  var mode = 0;
1782
- if (canRead) mode |= 292 | 73;
1783
- if (canWrite) mode |= 146;
1848
+ if (canRead)
1849
+ mode |= 292 | 73;
1850
+ if (canWrite)
1851
+ mode |= 146;
1784
1852
  return mode;
1785
1853
  };
1786
1854
  var UTF8ToString = (ptr, maxBytesToRead) => {
@@ -1876,56 +1944,58 @@ var require_swisseph_web = __commonJS({
1876
1944
  if (!PATH.isAbs(path)) {
1877
1945
  path = FS.cwd() + "/" + path;
1878
1946
  }
1879
- linkloop: for (var nlinks = 0; nlinks < 40; nlinks++) {
1880
- var parts = path.split("/").filter((p) => !!p);
1881
- var current = FS.root;
1882
- var current_path = "/";
1883
- for (var i = 0; i < parts.length; i++) {
1884
- var islast = i === parts.length - 1;
1885
- if (islast && opts.parent) {
1886
- break;
1887
- }
1888
- if (parts[i] === ".") {
1889
- continue;
1890
- }
1891
- if (parts[i] === "..") {
1892
- current_path = PATH.dirname(current_path);
1893
- current = current.parent;
1894
- continue;
1895
- }
1896
- current_path = PATH.join2(current_path, parts[i]);
1897
- try {
1898
- current = FS.lookupNode(current, parts[i]);
1899
- } catch (e) {
1900
- if (e?.errno === 44 && islast && opts.noent_okay) {
1901
- return { path: current_path };
1947
+ linkloop:
1948
+ for (var nlinks = 0; nlinks < 40; nlinks++) {
1949
+ var parts = path.split("/").filter((p) => !!p);
1950
+ var current = FS.root;
1951
+ var current_path = "/";
1952
+ for (var i = 0; i < parts.length; i++) {
1953
+ var islast = i === parts.length - 1;
1954
+ if (islast && opts.parent) {
1955
+ break;
1902
1956
  }
1903
- throw e;
1904
- }
1905
- if (FS.isMountpoint(current) && (!islast || opts.follow_mount)) {
1906
- current = current.mounted.root;
1907
- }
1908
- if (FS.isLink(current.mode) && (!islast || opts.follow)) {
1909
- if (!current.node_ops.readlink) {
1910
- throw new FS.ErrnoError(52);
1957
+ if (parts[i] === ".") {
1958
+ continue;
1911
1959
  }
1912
- var link = current.node_ops.readlink(current);
1913
- if (!PATH.isAbs(link)) {
1914
- link = PATH.dirname(current_path) + "/" + link;
1960
+ if (parts[i] === "..") {
1961
+ current_path = PATH.dirname(current_path);
1962
+ current = current.parent;
1963
+ continue;
1964
+ }
1965
+ current_path = PATH.join2(current_path, parts[i]);
1966
+ try {
1967
+ current = FS.lookupNode(current, parts[i]);
1968
+ } catch (e) {
1969
+ if (e?.errno === 44 && islast && opts.noent_okay) {
1970
+ return { path: current_path };
1971
+ }
1972
+ throw e;
1973
+ }
1974
+ if (FS.isMountpoint(current) && (!islast || opts.follow_mount)) {
1975
+ current = current.mounted.root;
1976
+ }
1977
+ if (FS.isLink(current.mode) && (!islast || opts.follow)) {
1978
+ if (!current.node_ops.readlink) {
1979
+ throw new FS.ErrnoError(52);
1980
+ }
1981
+ var link = current.node_ops.readlink(current);
1982
+ if (!PATH.isAbs(link)) {
1983
+ link = PATH.dirname(current_path) + "/" + link;
1984
+ }
1985
+ path = link + "/" + parts.slice(i + 1).join("/");
1986
+ continue linkloop;
1915
1987
  }
1916
- path = link + "/" + parts.slice(i + 1).join("/");
1917
- continue linkloop;
1918
1988
  }
1989
+ return { path: current_path, node: current };
1919
1990
  }
1920
- return { path: current_path, node: current };
1921
- }
1922
1991
  throw new FS.ErrnoError(32);
1923
1992
  }, getPath(node) {
1924
1993
  var path;
1925
1994
  while (true) {
1926
1995
  if (FS.isRoot(node)) {
1927
1996
  var mount = node.mount.mountpoint;
1928
- if (!path) return mount;
1997
+ if (!path)
1998
+ return mount;
1929
1999
  return mount[mount.length - 1] !== "/" ? `${mount}/${path}` : mount + path;
1930
2000
  }
1931
2001
  path = path ? `${node.name}/${path}` : node.name;
@@ -2012,10 +2082,13 @@ var require_swisseph_web = __commonJS({
2012
2082
  }
2013
2083
  return 0;
2014
2084
  }, mayLookup(dir) {
2015
- if (!FS.isDir(dir.mode)) return 54;
2085
+ if (!FS.isDir(dir.mode))
2086
+ return 54;
2016
2087
  var errCode = FS.nodePermissions(dir, "x");
2017
- if (errCode) return errCode;
2018
- if (!dir.node_ops.lookup) return 2;
2088
+ if (errCode)
2089
+ return errCode;
2090
+ if (!dir.node_ops.lookup)
2091
+ return 2;
2019
2092
  return 0;
2020
2093
  }, mayCreate(dir, name) {
2021
2094
  if (!FS.isDir(dir.mode)) {
@@ -2250,12 +2323,14 @@ var require_swisseph_web = __commonJS({
2250
2323
  var dirs = path.split("/");
2251
2324
  var d = "";
2252
2325
  for (var dir of dirs) {
2253
- if (!dir) continue;
2326
+ if (!dir)
2327
+ continue;
2254
2328
  d += "/" + dir;
2255
2329
  try {
2256
2330
  FS.mkdir(d, mode);
2257
2331
  } catch (e) {
2258
- if (e.errno != 20) throw e;
2332
+ if (e.errno != 20)
2333
+ throw e;
2259
2334
  }
2260
2335
  }
2261
2336
  }, mkdev(path, mode, dev) {
@@ -2293,7 +2368,8 @@ var require_swisseph_web = __commonJS({
2293
2368
  old_dir = lookup.node;
2294
2369
  lookup = FS.lookupPath(new_path, { parent: true });
2295
2370
  new_dir = lookup.node;
2296
- if (!old_dir || !new_dir) throw new FS.ErrnoError(44);
2371
+ if (!old_dir || !new_dir)
2372
+ throw new FS.ErrnoError(44);
2297
2373
  if (old_dir.mount !== new_dir.mount) {
2298
2374
  throw new FS.ErrnoError(75);
2299
2375
  }
@@ -2547,7 +2623,8 @@ var require_swisseph_web = __commonJS({
2547
2623
  if (FS.isClosed(stream)) {
2548
2624
  throw new FS.ErrnoError(8);
2549
2625
  }
2550
- if (stream.getdents) stream.getdents = null;
2626
+ if (stream.getdents)
2627
+ stream.getdents = null;
2551
2628
  try {
2552
2629
  if (stream.stream_ops.close) {
2553
2630
  stream.stream_ops.close(stream);
@@ -2597,7 +2674,8 @@ var require_swisseph_web = __commonJS({
2597
2674
  throw new FS.ErrnoError(70);
2598
2675
  }
2599
2676
  var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
2600
- if (!seeking) stream.position += bytesRead;
2677
+ if (!seeking)
2678
+ stream.position += bytesRead;
2601
2679
  return bytesRead;
2602
2680
  }, write(stream, buffer, offset, length, position, canOwn) {
2603
2681
  assert(offset >= 0);
@@ -2626,7 +2704,8 @@ var require_swisseph_web = __commonJS({
2626
2704
  throw new FS.ErrnoError(70);
2627
2705
  }
2628
2706
  var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
2629
- if (!seeking) stream.position += bytesWritten;
2707
+ if (!seeking)
2708
+ stream.position += bytesWritten;
2630
2709
  return bytesWritten;
2631
2710
  }, mmap(stream, length, position, prot, flags) {
2632
2711
  if ((prot & 2) !== 0 && (flags & 2) === 0 && (stream.flags & 2097155) !== 2) {
@@ -2818,12 +2897,14 @@ var require_swisseph_web = __commonJS({
2818
2897
  var parts = path.split("/").reverse();
2819
2898
  while (parts.length) {
2820
2899
  var part = parts.pop();
2821
- if (!part) continue;
2900
+ if (!part)
2901
+ continue;
2822
2902
  var current = PATH.join2(parent, part);
2823
2903
  try {
2824
2904
  FS.mkdir(current);
2825
2905
  } catch (e) {
2826
- if (e.errno != 20) throw e;
2906
+ if (e.errno != 20)
2907
+ throw e;
2827
2908
  }
2828
2909
  parent = current;
2829
2910
  }
@@ -2843,7 +2924,8 @@ var require_swisseph_web = __commonJS({
2843
2924
  if (data) {
2844
2925
  if (typeof data == "string") {
2845
2926
  var arr = new Array(data.length);
2846
- for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
2927
+ for (var i = 0, len = data.length; i < len; ++i)
2928
+ arr[i] = data.charCodeAt(i);
2847
2929
  data = arr;
2848
2930
  }
2849
2931
  FS.chmod(node, mode | 146);
@@ -2876,7 +2958,8 @@ var require_swisseph_web = __commonJS({
2876
2958
  if (result === void 0 && bytesRead === 0) {
2877
2959
  throw new FS.ErrnoError(6);
2878
2960
  }
2879
- if (result === null || result === void 0) break;
2961
+ if (result === null || result === void 0)
2962
+ break;
2880
2963
  bytesRead++;
2881
2964
  buffer[offset + i] = result;
2882
2965
  }
@@ -2899,7 +2982,8 @@ var require_swisseph_web = __commonJS({
2899
2982
  } });
2900
2983
  return FS.mkdev(path, mode, dev);
2901
2984
  }, forceLoadFile(obj) {
2902
- if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
2985
+ if (obj.isDevice || obj.isFolder || obj.link || obj.contents)
2986
+ return true;
2903
2987
  if (typeof XMLHttpRequest != "undefined") {
2904
2988
  throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
2905
2989
  } else {
@@ -2931,25 +3015,31 @@ var require_swisseph_web = __commonJS({
2931
3015
  var xhr = new XMLHttpRequest();
2932
3016
  xhr.open("HEAD", url, false);
2933
3017
  xhr.send(null);
2934
- if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
3018
+ if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304))
3019
+ throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
2935
3020
  var datalength = Number(xhr.getResponseHeader("Content-length"));
2936
3021
  var header;
2937
3022
  var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
2938
3023
  var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
2939
3024
  var chunkSize = 1024 * 1024;
2940
- if (!hasByteServing) chunkSize = datalength;
3025
+ if (!hasByteServing)
3026
+ chunkSize = datalength;
2941
3027
  var doXHR = (from, to) => {
2942
- if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
2943
- if (to > datalength - 1) throw new Error("only " + datalength + " bytes available! programmer error!");
3028
+ if (from > to)
3029
+ throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
3030
+ if (to > datalength - 1)
3031
+ throw new Error("only " + datalength + " bytes available! programmer error!");
2944
3032
  var xhr2 = new XMLHttpRequest();
2945
3033
  xhr2.open("GET", url, false);
2946
- if (datalength !== chunkSize) xhr2.setRequestHeader("Range", "bytes=" + from + "-" + to);
3034
+ if (datalength !== chunkSize)
3035
+ xhr2.setRequestHeader("Range", "bytes=" + from + "-" + to);
2947
3036
  xhr2.responseType = "arraybuffer";
2948
3037
  if (xhr2.overrideMimeType) {
2949
3038
  xhr2.overrideMimeType("text/plain; charset=x-user-defined");
2950
3039
  }
2951
3040
  xhr2.send(null);
2952
- if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr2.status);
3041
+ if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304))
3042
+ throw new Error("Couldn't load " + url + ". Status: " + xhr2.status);
2953
3043
  if (xhr2.response !== void 0) {
2954
3044
  return new Uint8Array(xhr2.response || []);
2955
3045
  }
@@ -2963,7 +3053,8 @@ var require_swisseph_web = __commonJS({
2963
3053
  if (typeof lazyArray2.chunks[chunkNum] == "undefined") {
2964
3054
  lazyArray2.chunks[chunkNum] = doXHR(start, end);
2965
3055
  }
2966
- if (typeof lazyArray2.chunks[chunkNum] == "undefined") throw new Error("doXHR failed!");
3056
+ if (typeof lazyArray2.chunks[chunkNum] == "undefined")
3057
+ throw new Error("doXHR failed!");
2967
3058
  return lazyArray2.chunks[chunkNum];
2968
3059
  });
2969
3060
  if (usesGzip || !datalength) {
@@ -2990,7 +3081,8 @@ var require_swisseph_web = __commonJS({
2990
3081
  }
2991
3082
  }
2992
3083
  if (typeof XMLHttpRequest != "undefined") {
2993
- if (!ENVIRONMENT_IS_WORKER) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
3084
+ if (!ENVIRONMENT_IS_WORKER)
3085
+ throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
2994
3086
  var lazyArray = new LazyUint8Array();
2995
3087
  var properties = { isDevice: false, contents: lazyArray };
2996
3088
  } else {
@@ -3017,7 +3109,8 @@ var require_swisseph_web = __commonJS({
3017
3109
  });
3018
3110
  function writeChunks(stream, buffer, offset, length, position) {
3019
3111
  var contents = stream.node.contents;
3020
- if (position >= contents.length) return 0;
3112
+ if (position >= contents.length)
3113
+ return 0;
3021
3114
  var size = Math.min(contents.length - position, length);
3022
3115
  assert(size >= 0);
3023
3116
  if (contents.slice) {
@@ -3164,7 +3257,8 @@ var require_swisseph_web = __commonJS({
3164
3257
  }
3165
3258
  return -28;
3166
3259
  } catch (e) {
3167
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
3260
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
3261
+ throw e;
3168
3262
  return -e.errno;
3169
3263
  }
3170
3264
  }
@@ -3174,11 +3268,13 @@ var require_swisseph_web = __commonJS({
3174
3268
  var stream = SYSCALLS.getStreamFromFD(fd);
3175
3269
  switch (op) {
3176
3270
  case 21509: {
3177
- if (!stream.tty) return -59;
3271
+ if (!stream.tty)
3272
+ return -59;
3178
3273
  return 0;
3179
3274
  }
3180
3275
  case 21505: {
3181
- if (!stream.tty) return -59;
3276
+ if (!stream.tty)
3277
+ return -59;
3182
3278
  if (stream.tty.ops.ioctl_tcgets) {
3183
3279
  var termios = stream.tty.ops.ioctl_tcgets(stream);
3184
3280
  var argp = syscallGetVarargP();
@@ -3196,13 +3292,15 @@ var require_swisseph_web = __commonJS({
3196
3292
  case 21510:
3197
3293
  case 21511:
3198
3294
  case 21512: {
3199
- if (!stream.tty) return -59;
3295
+ if (!stream.tty)
3296
+ return -59;
3200
3297
  return 0;
3201
3298
  }
3202
3299
  case 21506:
3203
3300
  case 21507:
3204
3301
  case 21508: {
3205
- if (!stream.tty) return -59;
3302
+ if (!stream.tty)
3303
+ return -59;
3206
3304
  if (stream.tty.ops.ioctl_tcsets) {
3207
3305
  var argp = syscallGetVarargP();
3208
3306
  var c_iflag = SAFE_HEAP_LOAD((argp >> 2) * 4, 4, 0);
@@ -3218,13 +3316,15 @@ var require_swisseph_web = __commonJS({
3218
3316
  return 0;
3219
3317
  }
3220
3318
  case 21519: {
3221
- if (!stream.tty) return -59;
3319
+ if (!stream.tty)
3320
+ return -59;
3222
3321
  var argp = syscallGetVarargP();
3223
3322
  SAFE_HEAP_STORE((argp >> 2) * 4, 0, 4);
3224
3323
  return 0;
3225
3324
  }
3226
3325
  case 21520: {
3227
- if (!stream.tty) return -59;
3326
+ if (!stream.tty)
3327
+ return -59;
3228
3328
  return -28;
3229
3329
  }
3230
3330
  case 21531: {
@@ -3232,7 +3332,8 @@ var require_swisseph_web = __commonJS({
3232
3332
  return FS.ioctl(stream, op, argp);
3233
3333
  }
3234
3334
  case 21523: {
3235
- if (!stream.tty) return -59;
3335
+ if (!stream.tty)
3336
+ return -59;
3236
3337
  if (stream.tty.ops.ioctl_tiocgwinsz) {
3237
3338
  var winsize = stream.tty.ops.ioctl_tiocgwinsz(stream.tty);
3238
3339
  var argp = syscallGetVarargP();
@@ -3242,18 +3343,21 @@ var require_swisseph_web = __commonJS({
3242
3343
  return 0;
3243
3344
  }
3244
3345
  case 21524: {
3245
- if (!stream.tty) return -59;
3346
+ if (!stream.tty)
3347
+ return -59;
3246
3348
  return 0;
3247
3349
  }
3248
3350
  case 21515: {
3249
- if (!stream.tty) return -59;
3351
+ if (!stream.tty)
3352
+ return -59;
3250
3353
  return 0;
3251
3354
  }
3252
3355
  default:
3253
3356
  return -28;
3254
3357
  }
3255
3358
  } catch (e) {
3256
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
3359
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
3360
+ throw e;
3257
3361
  return -e.errno;
3258
3362
  }
3259
3363
  }
@@ -3265,7 +3369,8 @@ var require_swisseph_web = __commonJS({
3265
3369
  var mode = varargs ? syscallGetVarargI() : 0;
3266
3370
  return FS.open(path, flags, mode).fd;
3267
3371
  } catch (e) {
3268
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
3372
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
3373
+ throw e;
3269
3374
  return -e.errno;
3270
3375
  }
3271
3376
  }
@@ -3310,8 +3415,10 @@ var require_swisseph_web = __commonJS({
3310
3415
  var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
3311
3416
  var env = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: lang, _: getExecutableName() };
3312
3417
  for (var x in ENV) {
3313
- if (ENV[x] === void 0) delete env[x];
3314
- else env[x] = ENV[x];
3418
+ if (ENV[x] === void 0)
3419
+ delete env[x];
3420
+ else
3421
+ env[x] = ENV[x];
3315
3422
  }
3316
3423
  var strings = [];
3317
3424
  for (var x in env) {
@@ -3352,7 +3459,8 @@ var require_swisseph_web = __commonJS({
3352
3459
  FS.close(stream);
3353
3460
  return 0;
3354
3461
  } catch (e) {
3355
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
3462
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
3463
+ throw e;
3356
3464
  return e.errno;
3357
3465
  }
3358
3466
  }
@@ -3363,9 +3471,11 @@ var require_swisseph_web = __commonJS({
3363
3471
  var len = SAFE_HEAP_LOAD((iov + 4 >> 2) * 4, 4, 1);
3364
3472
  iov += 8;
3365
3473
  var curr = FS.read(stream, HEAP8, ptr, len, offset);
3366
- if (curr < 0) return -1;
3474
+ if (curr < 0)
3475
+ return -1;
3367
3476
  ret += curr;
3368
- if (curr < len) break;
3477
+ if (curr < len)
3478
+ break;
3369
3479
  if (typeof offset != "undefined") {
3370
3480
  offset += curr;
3371
3481
  }
@@ -3379,7 +3489,8 @@ var require_swisseph_web = __commonJS({
3379
3489
  SAFE_HEAP_STORE((pnum >> 2) * 4, num, 4);
3380
3490
  return 0;
3381
3491
  } catch (e) {
3382
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
3492
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
3493
+ throw e;
3383
3494
  return e.errno;
3384
3495
  }
3385
3496
  }
@@ -3389,14 +3500,17 @@ var require_swisseph_web = __commonJS({
3389
3500
  function _fd_seek(fd, offset, whence, newOffset) {
3390
3501
  offset = bigintToI53Checked(offset);
3391
3502
  try {
3392
- if (isNaN(offset)) return 61;
3503
+ if (isNaN(offset))
3504
+ return 61;
3393
3505
  var stream = SYSCALLS.getStreamFromFD(fd);
3394
3506
  FS.llseek(stream, offset, whence);
3395
3507
  HEAP64[newOffset >> 3] = BigInt(stream.position);
3396
- if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null;
3508
+ if (stream.getdents && offset === 0 && whence === 0)
3509
+ stream.getdents = null;
3397
3510
  return 0;
3398
3511
  } catch (e) {
3399
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
3512
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
3513
+ throw e;
3400
3514
  return e.errno;
3401
3515
  }
3402
3516
  }
@@ -3407,7 +3521,8 @@ var require_swisseph_web = __commonJS({
3407
3521
  var len = SAFE_HEAP_LOAD((iov + 4 >> 2) * 4, 4, 1);
3408
3522
  iov += 8;
3409
3523
  var curr = FS.write(stream, HEAP8, ptr, len, offset);
3410
- if (curr < 0) return -1;
3524
+ if (curr < 0)
3525
+ return -1;
3411
3526
  ret += curr;
3412
3527
  if (curr < len) {
3413
3528
  break;
@@ -3425,7 +3540,8 @@ var require_swisseph_web = __commonJS({
3425
3540
  SAFE_HEAP_STORE((pnum >> 2) * 4, num, 4);
3426
3541
  return 0;
3427
3542
  } catch (e) {
3428
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
3543
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
3544
+ throw e;
3429
3545
  return e.errno;
3430
3546
  }
3431
3547
  }
@@ -3465,7 +3581,8 @@ var require_swisseph_web = __commonJS({
3465
3581
  if (returnType === "string") {
3466
3582
  return UTF8ToString(ret2);
3467
3583
  }
3468
- if (returnType === "boolean") return Boolean(ret2);
3584
+ if (returnType === "boolean")
3585
+ return Boolean(ret2);
3469
3586
  return ret2;
3470
3587
  }
3471
3588
  var func = getCFunc(ident);
@@ -3476,7 +3593,8 @@ var require_swisseph_web = __commonJS({
3476
3593
  for (var i = 0; i < args.length; i++) {
3477
3594
  var converter = toC[argTypes[i]];
3478
3595
  if (converter) {
3479
- if (stack === 0) stack = stackSave();
3596
+ if (stack === 0)
3597
+ stack = stackSave();
3480
3598
  cArgs[i] = converter(args[i]);
3481
3599
  } else {
3482
3600
  cArgs[i] = args[i];
@@ -3485,7 +3603,8 @@ var require_swisseph_web = __commonJS({
3485
3603
  }
3486
3604
  var ret = func(...cArgs);
3487
3605
  function onDone(ret2) {
3488
- if (stack !== 0) stackRestore(stack);
3606
+ if (stack !== 0)
3607
+ stackRestore(stack);
3489
3608
  return convertReturnValue(ret2);
3490
3609
  }
3491
3610
  ret = onDone(ret);
@@ -3576,7 +3695,8 @@ var require_swisseph_web = __commonJS({
3576
3695
  assert(!calledRun);
3577
3696
  calledRun = true;
3578
3697
  Module["calledRun"] = true;
3579
- if (ABORT) return;
3698
+ if (ABORT)
3699
+ return;
3580
3700
  initRuntime();
3581
3701
  readyPromiseResolve(Module);
3582
3702
  Module["onRuntimeInitialized"]?.();
@@ -3596,7 +3716,8 @@ var require_swisseph_web = __commonJS({
3596
3716
  checkStackCookie();
3597
3717
  }
3598
3718
  if (Module["preInit"]) {
3599
- if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
3719
+ if (typeof Module["preInit"] == "function")
3720
+ Module["preInit"] = [Module["preInit"]];
3600
3721
  while (Module["preInit"].length > 0) {
3601
3722
  Module["preInit"].pop()();
3602
3723
  }
@@ -3617,7 +3738,8 @@ var require_swisseph_web = __commonJS({
3617
3738
  (() => {
3618
3739
  var real_SwissEphemerisModule = SwissEphemerisModule;
3619
3740
  SwissEphemerisModule = function(arg) {
3620
- if (new.target) throw new Error("SwissEphemerisModule() should not be called with `new SwissEphemerisModule()`");
3741
+ if (new.target)
3742
+ throw new Error("SwissEphemerisModule() should not be called with `new SwissEphemerisModule()`");
3621
3743
  return real_SwissEphemerisModule(arg);
3622
3744
  };
3623
3745
  })();
@@ -3635,7 +3757,8 @@ var require_swisseph_node = __commonJS({
3635
3757
  "use strict";
3636
3758
  var SwissEphemerisModule = (() => {
3637
3759
  var _scriptName = typeof document != "undefined" ? document.currentScript?.src : void 0;
3638
- if (typeof __filename != "undefined") _scriptName = _scriptName || __filename;
3760
+ if (typeof __filename != "undefined")
3761
+ _scriptName = _scriptName || __filename;
3639
3762
  return async function(moduleArg = {}) {
3640
3763
  var moduleRtn;
3641
3764
  var Module = moduleArg;
@@ -3665,7 +3788,8 @@ var require_swisseph_node = __commonJS({
3665
3788
  }
3666
3789
  var readAsync, readBinary;
3667
3790
  if (ENVIRONMENT_IS_NODE) {
3668
- if (typeof process == "undefined" || !process.release || process.release.name !== "node") throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
3791
+ if (typeof process == "undefined" || !process.release || process.release.name !== "node")
3792
+ throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
3669
3793
  var nodeVersion = process.versions.node;
3670
3794
  var numericVersion = nodeVersion.split(".").slice(0, 3);
3671
3795
  numericVersion = numericVersion[0] * 1e4 + numericVersion[1] * 100 + numericVersion[2].split("-")[0] * 1;
@@ -3696,7 +3820,8 @@ var require_swisseph_node = __commonJS({
3696
3820
  throw toThrow;
3697
3821
  };
3698
3822
  } else if (ENVIRONMENT_IS_SHELL) {
3699
- if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof WorkerGlobalScope != "undefined") throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
3823
+ if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof WorkerGlobalScope != "undefined")
3824
+ throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
3700
3825
  } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
3701
3826
  if (ENVIRONMENT_IS_WORKER) {
3702
3827
  scriptDirectory = self.location.href;
@@ -3711,7 +3836,8 @@ var require_swisseph_node = __commonJS({
3711
3836
  } else {
3712
3837
  scriptDirectory = scriptDirectory.slice(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
3713
3838
  }
3714
- if (!(typeof window == "object" || typeof WorkerGlobalScope != "undefined")) throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
3839
+ if (!(typeof window == "object" || typeof WorkerGlobalScope != "undefined"))
3840
+ throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
3715
3841
  {
3716
3842
  readAsync = async (url) => {
3717
3843
  assert(!isFileURI(url), "readAsync does not work with file:// URLs");
@@ -3730,9 +3856,11 @@ var require_swisseph_node = __commonJS({
3730
3856
  Object.assign(Module, moduleOverrides);
3731
3857
  moduleOverrides = null;
3732
3858
  checkIncomingModuleAPI();
3733
- if (Module["arguments"]) arguments_ = Module["arguments"];
3859
+ if (Module["arguments"])
3860
+ arguments_ = Module["arguments"];
3734
3861
  legacyModuleProp("arguments", "arguments_");
3735
- if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
3862
+ if (Module["thisProgram"])
3863
+ thisProgram = Module["thisProgram"];
3736
3864
  legacyModuleProp("thisProgram", "thisProgram");
3737
3865
  assert(typeof Module["memoryInitializerPrefixURL"] == "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");
3738
3866
  assert(typeof Module["pthreadMainPrefixURL"] == "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");
@@ -3774,7 +3902,8 @@ var require_swisseph_node = __commonJS({
3774
3902
  SAFE_HEAP_STORE((max + 4 >> 2) * 4, 2310721022, 4);
3775
3903
  }
3776
3904
  function checkStackCookie() {
3777
- if (ABORT) return;
3905
+ if (ABORT)
3906
+ return;
3778
3907
  var max = _emscripten_stack_get_end();
3779
3908
  if (max == 0) {
3780
3909
  max += 4;
@@ -3789,7 +3918,8 @@ var require_swisseph_node = __commonJS({
3789
3918
  var h16 = new Int16Array(1);
3790
3919
  var h8 = new Int8Array(h16.buffer);
3791
3920
  h16[0] = 25459;
3792
- if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
3921
+ if (h8[0] !== 115 || h8[1] !== 99)
3922
+ throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
3793
3923
  })();
3794
3924
  if (Module["ENVIRONMENT"]) {
3795
3925
  throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");
@@ -3868,13 +3998,18 @@ var require_swisseph_node = __commonJS({
3868
3998
  }
3869
3999
  }
3870
4000
  function SAFE_HEAP_STORE(dest, value, bytes, isFloat) {
3871
- if (dest <= 0) abort(`segmentation fault storing ${bytes} bytes to address ${dest}`);
3872
- if (dest % bytes !== 0) abort(`alignment error storing to address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
4001
+ if (dest <= 0)
4002
+ abort(`segmentation fault storing ${bytes} bytes to address ${dest}`);
4003
+ if (dest % bytes !== 0)
4004
+ abort(`alignment error storing to address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
3873
4005
  if (runtimeInitialized) {
3874
4006
  var brk = _sbrk(0);
3875
- if (dest + bytes > brk) abort(`segmentation fault, exceeded the top of the available dynamic heap when storing ${bytes} bytes to address ${dest}. DYNAMICTOP=${brk}`);
3876
- if (brk < _emscripten_stack_get_base()) abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
3877
- if (brk > wasmMemory.buffer.byteLength) abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
4007
+ if (dest + bytes > brk)
4008
+ abort(`segmentation fault, exceeded the top of the available dynamic heap when storing ${bytes} bytes to address ${dest}. DYNAMICTOP=${brk}`);
4009
+ if (brk < _emscripten_stack_get_base())
4010
+ abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
4011
+ if (brk > wasmMemory.buffer.byteLength)
4012
+ abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
3878
4013
  }
3879
4014
  setValue_safe(dest, value, getSafeHeapType(bytes, isFloat));
3880
4015
  return value;
@@ -3883,17 +4018,23 @@ var require_swisseph_node = __commonJS({
3883
4018
  return SAFE_HEAP_STORE(dest, value, bytes, true);
3884
4019
  }
3885
4020
  function SAFE_HEAP_LOAD(dest, bytes, unsigned, isFloat) {
3886
- if (dest <= 0) abort(`segmentation fault loading ${bytes} bytes from address ${dest}`);
3887
- if (dest % bytes !== 0) abort(`alignment error loading from address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
4021
+ if (dest <= 0)
4022
+ abort(`segmentation fault loading ${bytes} bytes from address ${dest}`);
4023
+ if (dest % bytes !== 0)
4024
+ abort(`alignment error loading from address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
3888
4025
  if (runtimeInitialized) {
3889
4026
  var brk = _sbrk(0);
3890
- if (dest + bytes > brk) abort(`segmentation fault, exceeded the top of the available dynamic heap when loading ${bytes} bytes from address ${dest}. DYNAMICTOP=${brk}`);
3891
- if (brk < _emscripten_stack_get_base()) abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
3892
- if (brk > wasmMemory.buffer.byteLength) abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
4027
+ if (dest + bytes > brk)
4028
+ abort(`segmentation fault, exceeded the top of the available dynamic heap when loading ${bytes} bytes from address ${dest}. DYNAMICTOP=${brk}`);
4029
+ if (brk < _emscripten_stack_get_base())
4030
+ abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
4031
+ if (brk > wasmMemory.buffer.byteLength)
4032
+ abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
3893
4033
  }
3894
4034
  var type = getSafeHeapType(bytes, isFloat);
3895
4035
  var ret = getValue_safe(dest, type);
3896
- if (unsigned) ret = unSign(ret, parseInt(type.slice(1), 10));
4036
+ if (unsigned)
4037
+ ret = unSign(ret, parseInt(type.slice(1), 10));
3897
4038
  return ret;
3898
4039
  }
3899
4040
  function SAFE_HEAP_LOAD_D(dest, bytes, unsigned) {
@@ -3924,7 +4065,8 @@ var require_swisseph_node = __commonJS({
3924
4065
  assert(!Module["INITIAL_MEMORY"], "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");
3925
4066
  function preRun() {
3926
4067
  if (Module["preRun"]) {
3927
- if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]];
4068
+ if (typeof Module["preRun"] == "function")
4069
+ Module["preRun"] = [Module["preRun"]];
3928
4070
  while (Module["preRun"].length) {
3929
4071
  addOnPreRun(Module["preRun"].shift());
3930
4072
  }
@@ -3936,7 +4078,8 @@ var require_swisseph_node = __commonJS({
3936
4078
  assert(!runtimeInitialized);
3937
4079
  runtimeInitialized = true;
3938
4080
  checkStackCookie();
3939
- if (!Module["noFSInit"] && !FS.initialized) FS.init();
4081
+ if (!Module["noFSInit"] && !FS.initialized)
4082
+ FS.init();
3940
4083
  TTY.init();
3941
4084
  wasmExports["__wasm_call_ctors"]();
3942
4085
  FS.ignorePermissions = false;
@@ -3944,7 +4087,8 @@ var require_swisseph_node = __commonJS({
3944
4087
  function postRun() {
3945
4088
  checkStackCookie();
3946
4089
  if (Module["postRun"]) {
3947
- if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]];
4090
+ if (typeof Module["postRun"] == "function")
4091
+ Module["postRun"] = [Module["postRun"]];
3948
4092
  while (Module["postRun"].length) {
3949
4093
  addOnPostRun(Module["postRun"].shift());
3950
4094
  }
@@ -3959,7 +4103,8 @@ var require_swisseph_node = __commonJS({
3959
4103
  function getUniqueRunDependency(id2) {
3960
4104
  var orig = id2;
3961
4105
  while (1) {
3962
- if (!runDependencyTracking[id2]) return id2;
4106
+ if (!runDependencyTracking[id2])
4107
+ return id2;
3963
4108
  id2 = orig + Math.random();
3964
4109
  }
3965
4110
  }
@@ -4141,7 +4286,8 @@ var require_swisseph_node = __commonJS({
4141
4286
  var onPreRuns = [];
4142
4287
  var addOnPreRun = (cb) => onPreRuns.unshift(cb);
4143
4288
  function getValue(ptr, type = "i8") {
4144
- if (type.endsWith("*")) type = "*";
4289
+ if (type.endsWith("*"))
4290
+ type = "*";
4145
4291
  switch (type) {
4146
4292
  case "i1":
4147
4293
  return SAFE_HEAP_LOAD(ptr, 1, 0);
@@ -4164,7 +4310,8 @@ var require_swisseph_node = __commonJS({
4164
4310
  }
4165
4311
  }
4166
4312
  function getValue_safe(ptr, type = "i8") {
4167
- if (type.endsWith("*")) type = "*";
4313
+ if (type.endsWith("*"))
4314
+ type = "*";
4168
4315
  switch (type) {
4169
4316
  case "i1":
4170
4317
  return HEAP8[ptr];
@@ -4193,7 +4340,8 @@ var require_swisseph_node = __commonJS({
4193
4340
  return "0x" + ptr.toString(16).padStart(8, "0");
4194
4341
  };
4195
4342
  function setValue(ptr, value, type = "i8") {
4196
- if (type.endsWith("*")) type = "*";
4343
+ if (type.endsWith("*"))
4344
+ type = "*";
4197
4345
  switch (type) {
4198
4346
  case "i1":
4199
4347
  SAFE_HEAP_STORE(ptr, value, 1);
@@ -4224,7 +4372,8 @@ var require_swisseph_node = __commonJS({
4224
4372
  }
4225
4373
  }
4226
4374
  function setValue_safe(ptr, value, type = "i8") {
4227
- if (type.endsWith("*")) type = "*";
4375
+ if (type.endsWith("*"))
4376
+ type = "*";
4228
4377
  switch (type) {
4229
4378
  case "i1":
4230
4379
  HEAP8[ptr] = value;
@@ -4266,7 +4415,8 @@ var require_swisseph_node = __commonJS({
4266
4415
  warnOnce.shown || (warnOnce.shown = {});
4267
4416
  if (!warnOnce.shown[text]) {
4268
4417
  warnOnce.shown[text] = 1;
4269
- if (ENVIRONMENT_IS_NODE) text = "warning: " + text;
4418
+ if (ENVIRONMENT_IS_NODE)
4419
+ text = "warning: " + text;
4270
4420
  err(text);
4271
4421
  }
4272
4422
  };
@@ -4296,7 +4446,8 @@ var require_swisseph_node = __commonJS({
4296
4446
  var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead = NaN) => {
4297
4447
  var endIdx = idx + maxBytesToRead;
4298
4448
  var endPtr = idx;
4299
- while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
4449
+ while (heapOrArray[endPtr] && !(endPtr >= endIdx))
4450
+ ++endPtr;
4300
4451
  if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
4301
4452
  return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
4302
4453
  }
@@ -4316,7 +4467,8 @@ var require_swisseph_node = __commonJS({
4316
4467
  if ((u0 & 240) == 224) {
4317
4468
  u0 = (u0 & 15) << 12 | u1 << 6 | u2;
4318
4469
  } else {
4319
- if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte " + ptrToString(u0) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");
4470
+ if ((u0 & 248) != 240)
4471
+ warnOnce("Invalid UTF-8 leading byte " + ptrToString(u0) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");
4320
4472
  u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
4321
4473
  }
4322
4474
  if (u0 < 65536) {
@@ -4348,7 +4500,8 @@ var require_swisseph_node = __commonJS({
4348
4500
  };
4349
4501
  var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {
4350
4502
  assert(typeof str === "string", `stringToUTF8Array expects a string (got ${typeof str})`);
4351
- if (!(maxBytesToWrite > 0)) return 0;
4503
+ if (!(maxBytesToWrite > 0))
4504
+ return 0;
4352
4505
  var startIdx = outIdx;
4353
4506
  var endIdx = outIdx + maxBytesToWrite - 1;
4354
4507
  for (var i = 0; i < str.length; ++i) {
@@ -4358,20 +4511,25 @@ var require_swisseph_node = __commonJS({
4358
4511
  u = 65536 + ((u & 1023) << 10) | u1 & 1023;
4359
4512
  }
4360
4513
  if (u <= 127) {
4361
- if (outIdx >= endIdx) break;
4514
+ if (outIdx >= endIdx)
4515
+ break;
4362
4516
  heap[outIdx++] = u;
4363
4517
  } else if (u <= 2047) {
4364
- if (outIdx + 1 >= endIdx) break;
4518
+ if (outIdx + 1 >= endIdx)
4519
+ break;
4365
4520
  heap[outIdx++] = 192 | u >> 6;
4366
4521
  heap[outIdx++] = 128 | u & 63;
4367
4522
  } else if (u <= 65535) {
4368
- if (outIdx + 2 >= endIdx) break;
4523
+ if (outIdx + 2 >= endIdx)
4524
+ break;
4369
4525
  heap[outIdx++] = 224 | u >> 12;
4370
4526
  heap[outIdx++] = 128 | u >> 6 & 63;
4371
4527
  heap[outIdx++] = 128 | u & 63;
4372
4528
  } else {
4373
- if (outIdx + 3 >= endIdx) break;
4374
- if (u > 1114111) warnOnce("Invalid Unicode code point " + ptrToString(u) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");
4529
+ if (outIdx + 3 >= endIdx)
4530
+ break;
4531
+ if (u > 1114111)
4532
+ warnOnce("Invalid Unicode code point " + ptrToString(u) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");
4375
4533
  heap[outIdx++] = 240 | u >> 18;
4376
4534
  heap[outIdx++] = 128 | u >> 12 & 63;
4377
4535
  heap[outIdx++] = 128 | u >> 6 & 63;
@@ -4385,7 +4543,8 @@ var require_swisseph_node = __commonJS({
4385
4543
  var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
4386
4544
  var u8array = new Array(len);
4387
4545
  var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
4388
- if (dontAddNull) u8array.length = numBytesWritten;
4546
+ if (dontAddNull)
4547
+ u8array.length = numBytesWritten;
4389
4548
  return u8array;
4390
4549
  };
4391
4550
  var FS_stdin_getChar = () => {
@@ -4399,8 +4558,10 @@ var require_swisseph_node = __commonJS({
4399
4558
  try {
4400
4559
  bytesRead = fs.readSync(fd, buf, 0, BUFSIZE);
4401
4560
  } catch (e) {
4402
- if (e.toString().includes("EOF")) bytesRead = 0;
4403
- else throw e;
4561
+ if (e.toString().includes("EOF"))
4562
+ bytesRead = 0;
4563
+ else
4564
+ throw e;
4404
4565
  }
4405
4566
  if (bytesRead > 0) {
4406
4567
  result = buf.slice(0, bytesRead).toString("utf-8");
@@ -4450,7 +4611,8 @@ var require_swisseph_node = __commonJS({
4450
4611
  if (result === void 0 && bytesRead === 0) {
4451
4612
  throw new FS.ErrnoError(6);
4452
4613
  }
4453
- if (result === null || result === void 0) break;
4614
+ if (result === null || result === void 0)
4615
+ break;
4454
4616
  bytesRead++;
4455
4617
  buffer[offset + i] = result;
4456
4618
  }
@@ -4480,7 +4642,8 @@ var require_swisseph_node = __commonJS({
4480
4642
  out(UTF8ArrayToString(tty.output));
4481
4643
  tty.output = [];
4482
4644
  } else {
4483
- if (val != 0) tty.output.push(val);
4645
+ if (val != 0)
4646
+ tty.output.push(val);
4484
4647
  }
4485
4648
  }, fsync(tty) {
4486
4649
  if (tty.output?.length > 0) {
@@ -4498,7 +4661,8 @@ var require_swisseph_node = __commonJS({
4498
4661
  err(UTF8ArrayToString(tty.output));
4499
4662
  tty.output = [];
4500
4663
  } else {
4501
- if (val != 0) tty.output.push(val);
4664
+ if (val != 0)
4665
+ tty.output.push(val);
4502
4666
  }
4503
4667
  }, fsync(tty) {
4504
4668
  if (tty.output?.length > 0) {
@@ -4544,20 +4708,26 @@ var require_swisseph_node = __commonJS({
4544
4708
  }
4545
4709
  return node;
4546
4710
  }, getFileDataAsTypedArray(node) {
4547
- if (!node.contents) return new Uint8Array(0);
4548
- if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes);
4711
+ if (!node.contents)
4712
+ return new Uint8Array(0);
4713
+ if (node.contents.subarray)
4714
+ return node.contents.subarray(0, node.usedBytes);
4549
4715
  return new Uint8Array(node.contents);
4550
4716
  }, expandFileStorage(node, newCapacity) {
4551
4717
  var prevCapacity = node.contents ? node.contents.length : 0;
4552
- if (prevCapacity >= newCapacity) return;
4718
+ if (prevCapacity >= newCapacity)
4719
+ return;
4553
4720
  var CAPACITY_DOUBLING_MAX = 1024 * 1024;
4554
4721
  newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0);
4555
- if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256);
4722
+ if (prevCapacity != 0)
4723
+ newCapacity = Math.max(newCapacity, 256);
4556
4724
  var oldContents = node.contents;
4557
4725
  node.contents = new Uint8Array(newCapacity);
4558
- if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0);
4726
+ if (node.usedBytes > 0)
4727
+ node.contents.set(oldContents.subarray(0, node.usedBytes), 0);
4559
4728
  }, resizeFileStorage(node, newSize) {
4560
- if (node.usedBytes == newSize) return;
4729
+ if (node.usedBytes == newSize)
4730
+ return;
4561
4731
  if (newSize == 0) {
4562
4732
  node.contents = null;
4563
4733
  node.usedBytes = 0;
@@ -4647,13 +4817,15 @@ var require_swisseph_node = __commonJS({
4647
4817
  return node.link;
4648
4818
  } }, stream_ops: { read(stream, buffer, offset, length, position) {
4649
4819
  var contents = stream.node.contents;
4650
- if (position >= stream.node.usedBytes) return 0;
4820
+ if (position >= stream.node.usedBytes)
4821
+ return 0;
4651
4822
  var size = Math.min(stream.node.usedBytes - position, length);
4652
4823
  assert(size >= 0);
4653
4824
  if (size > 8 && contents.subarray) {
4654
4825
  buffer.set(contents.subarray(position, position + size), offset);
4655
4826
  } else {
4656
- for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i];
4827
+ for (var i = 0; i < size; i++)
4828
+ buffer[offset + i] = contents[position + i];
4657
4829
  }
4658
4830
  return size;
4659
4831
  }, write(stream, buffer, offset, length, position, canOwn) {
@@ -4661,7 +4833,8 @@ var require_swisseph_node = __commonJS({
4661
4833
  if (buffer.buffer === HEAP8.buffer) {
4662
4834
  canOwn = false;
4663
4835
  }
4664
- if (!length) return 0;
4836
+ if (!length)
4837
+ return 0;
4665
4838
  var node = stream.node;
4666
4839
  node.mtime = node.ctime = Date.now();
4667
4840
  if (buffer.subarray && (!node.contents || node.contents.subarray)) {
@@ -4744,10 +4917,12 @@ var require_swisseph_node = __commonJS({
4744
4917
  };
4745
4918
  var preloadPlugins = Module["preloadPlugins"] || [];
4746
4919
  var FS_handledByPreloadPlugin = (byteArray, fullname, finish, onerror) => {
4747
- if (typeof Browser != "undefined") Browser.init();
4920
+ if (typeof Browser != "undefined")
4921
+ Browser.init();
4748
4922
  var handled = false;
4749
4923
  preloadPlugins.forEach((plugin) => {
4750
- if (handled) return;
4924
+ if (handled)
4925
+ return;
4751
4926
  if (plugin["canHandle"](fullname)) {
4752
4927
  plugin["handle"](byteArray, fullname, finish, onerror);
4753
4928
  handled = true;
@@ -4792,8 +4967,10 @@ var require_swisseph_node = __commonJS({
4792
4967
  };
4793
4968
  var FS_getMode = (canRead, canWrite) => {
4794
4969
  var mode = 0;
4795
- if (canRead) mode |= 292 | 73;
4796
- if (canWrite) mode |= 146;
4970
+ if (canRead)
4971
+ mode |= 292 | 73;
4972
+ if (canWrite)
4973
+ mode |= 146;
4797
4974
  return mode;
4798
4975
  };
4799
4976
  var ERRNO_CODES = { EPERM: 63, ENOENT: 44, ESRCH: 71, EINTR: 27, EIO: 29, ENXIO: 60, E2BIG: 1, ENOEXEC: 45, EBADF: 8, ECHILD: 12, EAGAIN: 6, EWOULDBLOCK: 6, ENOMEM: 48, EACCES: 2, EFAULT: 21, ENOTBLK: 105, EBUSY: 10, EEXIST: 20, EXDEV: 75, ENODEV: 43, ENOTDIR: 54, EISDIR: 31, EINVAL: 28, ENFILE: 41, EMFILE: 33, ENOTTY: 59, ETXTBSY: 74, EFBIG: 22, ENOSPC: 51, ESPIPE: 70, EROFS: 69, EMLINK: 34, EPIPE: 64, EDOM: 18, ERANGE: 68, ENOMSG: 49, EIDRM: 24, ECHRNG: 106, EL2NSYNC: 156, EL3HLT: 107, EL3RST: 108, ELNRNG: 109, EUNATCH: 110, ENOCSI: 111, EL2HLT: 112, EDEADLK: 16, ENOLCK: 46, EBADE: 113, EBADR: 114, EXFULL: 115, ENOANO: 104, EBADRQC: 103, EBADSLT: 102, EDEADLOCK: 16, EBFONT: 101, ENOSTR: 100, ENODATA: 116, ETIME: 117, ENOSR: 118, ENONET: 119, ENOPKG: 120, EREMOTE: 121, ENOLINK: 47, EADV: 122, ESRMNT: 123, ECOMM: 124, EPROTO: 65, EMULTIHOP: 36, EDOTDOT: 125, EBADMSG: 9, ENOTUNIQ: 126, EBADFD: 127, EREMCHG: 128, ELIBACC: 129, ELIBBAD: 130, ELIBSCN: 131, ELIBMAX: 132, ELIBEXEC: 133, ENOSYS: 52, ENOTEMPTY: 55, ENAMETOOLONG: 37, ELOOP: 32, EOPNOTSUPP: 138, EPFNOSUPPORT: 139, ECONNRESET: 15, ENOBUFS: 42, EAFNOSUPPORT: 5, EPROTOTYPE: 67, ENOTSOCK: 57, ENOPROTOOPT: 50, ESHUTDOWN: 140, ECONNREFUSED: 14, EADDRINUSE: 3, ECONNABORTED: 13, ENETUNREACH: 40, ENETDOWN: 38, ETIMEDOUT: 73, EHOSTDOWN: 142, EHOSTUNREACH: 23, EINPROGRESS: 26, EALREADY: 7, EDESTADDRREQ: 17, EMSGSIZE: 35, EPROTONOSUPPORT: 66, ESOCKTNOSUPPORT: 137, EADDRNOTAVAIL: 4, ENETRESET: 39, EISCONN: 30, ENOTCONN: 53, ETOOMANYREFS: 141, EUSERS: 136, EDQUOT: 19, ESTALE: 72, ENOTSUP: 138, ENOMEDIUM: 148, EILSEQ: 25, EOVERFLOW: 61, ECANCELED: 11, ENOTRECOVERABLE: 56, EOWNERDEAD: 62, ESTRPIPE: 135 };
@@ -4810,8 +4987,10 @@ var require_swisseph_node = __commonJS({
4810
4987
  try {
4811
4988
  return f();
4812
4989
  } catch (e) {
4813
- if (!e.code) throw e;
4814
- if (e.code === "UNKNOWN") throw new FS.ErrnoError(28);
4990
+ if (!e.code)
4991
+ throw e;
4992
+ if (e.code === "UNKNOWN")
4993
+ throw new FS.ErrnoError(28);
4815
4994
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
4816
4995
  }
4817
4996
  }, mount(mount) {
@@ -5126,9 +5305,11 @@ var require_swisseph_node = __commonJS({
5126
5305
  return VFS.read(stream, buffer, offset, length, position);
5127
5306
  }
5128
5307
  var seeking = typeof position != "undefined";
5129
- if (!seeking && stream.seekable) position = stream.position;
5308
+ if (!seeking && stream.seekable)
5309
+ position = stream.position;
5130
5310
  var bytesRead = fs.readSync(stream.nfd, new Int8Array(buffer.buffer, offset, length), 0, length, position);
5131
- if (!seeking) stream.position += bytesRead;
5311
+ if (!seeking)
5312
+ stream.position += bytesRead;
5132
5313
  return bytesRead;
5133
5314
  }, write(stream, buffer, offset, length, position) {
5134
5315
  if (stream.stream_ops) {
@@ -5138,9 +5319,11 @@ var require_swisseph_node = __commonJS({
5138
5319
  FS.llseek(stream, 0, 2);
5139
5320
  }
5140
5321
  var seeking = typeof position != "undefined";
5141
- if (!seeking && stream.seekable) position = stream.position;
5322
+ if (!seeking && stream.seekable)
5323
+ position = stream.position;
5142
5324
  var bytesWritten = fs.writeSync(stream.nfd, new Int8Array(buffer.buffer, offset, length), 0, length, position);
5143
- if (!seeking) stream.position += bytesWritten;
5325
+ if (!seeking)
5326
+ stream.position += bytesWritten;
5144
5327
  return bytesWritten;
5145
5328
  }, mmap(stream, length, position, prot, flags) {
5146
5329
  if (!length) {
@@ -5253,56 +5436,58 @@ var require_swisseph_node = __commonJS({
5253
5436
  if (!PATH.isAbs(path)) {
5254
5437
  path = FS.cwd() + "/" + path;
5255
5438
  }
5256
- linkloop: for (var nlinks = 0; nlinks < 40; nlinks++) {
5257
- var parts = path.split("/").filter((p) => !!p);
5258
- var current = FS.root;
5259
- var current_path = "/";
5260
- for (var i = 0; i < parts.length; i++) {
5261
- var islast = i === parts.length - 1;
5262
- if (islast && opts.parent) {
5263
- break;
5264
- }
5265
- if (parts[i] === ".") {
5266
- continue;
5267
- }
5268
- if (parts[i] === "..") {
5269
- current_path = PATH.dirname(current_path);
5270
- current = current.parent;
5271
- continue;
5272
- }
5273
- current_path = PATH.join2(current_path, parts[i]);
5274
- try {
5275
- current = FS.lookupNode(current, parts[i]);
5276
- } catch (e) {
5277
- if (e?.errno === 44 && islast && opts.noent_okay) {
5278
- return { path: current_path };
5439
+ linkloop:
5440
+ for (var nlinks = 0; nlinks < 40; nlinks++) {
5441
+ var parts = path.split("/").filter((p) => !!p);
5442
+ var current = FS.root;
5443
+ var current_path = "/";
5444
+ for (var i = 0; i < parts.length; i++) {
5445
+ var islast = i === parts.length - 1;
5446
+ if (islast && opts.parent) {
5447
+ break;
5279
5448
  }
5280
- throw e;
5281
- }
5282
- if (FS.isMountpoint(current) && (!islast || opts.follow_mount)) {
5283
- current = current.mounted.root;
5284
- }
5285
- if (FS.isLink(current.mode) && (!islast || opts.follow)) {
5286
- if (!current.node_ops.readlink) {
5287
- throw new FS.ErrnoError(52);
5449
+ if (parts[i] === ".") {
5450
+ continue;
5451
+ }
5452
+ if (parts[i] === "..") {
5453
+ current_path = PATH.dirname(current_path);
5454
+ current = current.parent;
5455
+ continue;
5456
+ }
5457
+ current_path = PATH.join2(current_path, parts[i]);
5458
+ try {
5459
+ current = FS.lookupNode(current, parts[i]);
5460
+ } catch (e) {
5461
+ if (e?.errno === 44 && islast && opts.noent_okay) {
5462
+ return { path: current_path };
5463
+ }
5464
+ throw e;
5288
5465
  }
5289
- var link = current.node_ops.readlink(current);
5290
- if (!PATH.isAbs(link)) {
5291
- link = PATH.dirname(current_path) + "/" + link;
5466
+ if (FS.isMountpoint(current) && (!islast || opts.follow_mount)) {
5467
+ current = current.mounted.root;
5468
+ }
5469
+ if (FS.isLink(current.mode) && (!islast || opts.follow)) {
5470
+ if (!current.node_ops.readlink) {
5471
+ throw new FS.ErrnoError(52);
5472
+ }
5473
+ var link = current.node_ops.readlink(current);
5474
+ if (!PATH.isAbs(link)) {
5475
+ link = PATH.dirname(current_path) + "/" + link;
5476
+ }
5477
+ path = link + "/" + parts.slice(i + 1).join("/");
5478
+ continue linkloop;
5292
5479
  }
5293
- path = link + "/" + parts.slice(i + 1).join("/");
5294
- continue linkloop;
5295
5480
  }
5481
+ return { path: current_path, node: current };
5296
5482
  }
5297
- return { path: current_path, node: current };
5298
- }
5299
5483
  throw new FS.ErrnoError(32);
5300
5484
  }, getPath(node) {
5301
5485
  var path;
5302
5486
  while (true) {
5303
5487
  if (FS.isRoot(node)) {
5304
5488
  var mount = node.mount.mountpoint;
5305
- if (!path) return mount;
5489
+ if (!path)
5490
+ return mount;
5306
5491
  return mount[mount.length - 1] !== "/" ? `${mount}/${path}` : mount + path;
5307
5492
  }
5308
5493
  path = path ? `${node.name}/${path}` : node.name;
@@ -5389,10 +5574,13 @@ var require_swisseph_node = __commonJS({
5389
5574
  }
5390
5575
  return 0;
5391
5576
  }, mayLookup(dir) {
5392
- if (!FS.isDir(dir.mode)) return 54;
5577
+ if (!FS.isDir(dir.mode))
5578
+ return 54;
5393
5579
  var errCode = FS.nodePermissions(dir, "x");
5394
- if (errCode) return errCode;
5395
- if (!dir.node_ops.lookup) return 2;
5580
+ if (errCode)
5581
+ return errCode;
5582
+ if (!dir.node_ops.lookup)
5583
+ return 2;
5396
5584
  return 0;
5397
5585
  }, mayCreate(dir, name) {
5398
5586
  if (!FS.isDir(dir.mode)) {
@@ -5627,12 +5815,14 @@ var require_swisseph_node = __commonJS({
5627
5815
  var dirs = path.split("/");
5628
5816
  var d = "";
5629
5817
  for (var dir of dirs) {
5630
- if (!dir) continue;
5818
+ if (!dir)
5819
+ continue;
5631
5820
  d += "/" + dir;
5632
5821
  try {
5633
5822
  FS.mkdir(d, mode);
5634
5823
  } catch (e) {
5635
- if (e.errno != 20) throw e;
5824
+ if (e.errno != 20)
5825
+ throw e;
5636
5826
  }
5637
5827
  }
5638
5828
  }, mkdev(path, mode, dev) {
@@ -5670,7 +5860,8 @@ var require_swisseph_node = __commonJS({
5670
5860
  old_dir = lookup.node;
5671
5861
  lookup = FS.lookupPath(new_path, { parent: true });
5672
5862
  new_dir = lookup.node;
5673
- if (!old_dir || !new_dir) throw new FS.ErrnoError(44);
5863
+ if (!old_dir || !new_dir)
5864
+ throw new FS.ErrnoError(44);
5674
5865
  if (old_dir.mount !== new_dir.mount) {
5675
5866
  throw new FS.ErrnoError(75);
5676
5867
  }
@@ -5924,7 +6115,8 @@ var require_swisseph_node = __commonJS({
5924
6115
  if (FS.isClosed(stream)) {
5925
6116
  throw new FS.ErrnoError(8);
5926
6117
  }
5927
- if (stream.getdents) stream.getdents = null;
6118
+ if (stream.getdents)
6119
+ stream.getdents = null;
5928
6120
  try {
5929
6121
  if (stream.stream_ops.close) {
5930
6122
  stream.stream_ops.close(stream);
@@ -5974,7 +6166,8 @@ var require_swisseph_node = __commonJS({
5974
6166
  throw new FS.ErrnoError(70);
5975
6167
  }
5976
6168
  var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
5977
- if (!seeking) stream.position += bytesRead;
6169
+ if (!seeking)
6170
+ stream.position += bytesRead;
5978
6171
  return bytesRead;
5979
6172
  }, write(stream, buffer, offset, length, position, canOwn) {
5980
6173
  assert(offset >= 0);
@@ -6003,7 +6196,8 @@ var require_swisseph_node = __commonJS({
6003
6196
  throw new FS.ErrnoError(70);
6004
6197
  }
6005
6198
  var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
6006
- if (!seeking) stream.position += bytesWritten;
6199
+ if (!seeking)
6200
+ stream.position += bytesWritten;
6007
6201
  return bytesWritten;
6008
6202
  }, mmap(stream, length, position, prot, flags) {
6009
6203
  if ((prot & 2) !== 0 && (flags & 2) === 0 && (stream.flags & 2097155) !== 2) {
@@ -6195,12 +6389,14 @@ var require_swisseph_node = __commonJS({
6195
6389
  var parts = path.split("/").reverse();
6196
6390
  while (parts.length) {
6197
6391
  var part = parts.pop();
6198
- if (!part) continue;
6392
+ if (!part)
6393
+ continue;
6199
6394
  var current = PATH.join2(parent, part);
6200
6395
  try {
6201
6396
  FS.mkdir(current);
6202
6397
  } catch (e) {
6203
- if (e.errno != 20) throw e;
6398
+ if (e.errno != 20)
6399
+ throw e;
6204
6400
  }
6205
6401
  parent = current;
6206
6402
  }
@@ -6220,7 +6416,8 @@ var require_swisseph_node = __commonJS({
6220
6416
  if (data) {
6221
6417
  if (typeof data == "string") {
6222
6418
  var arr = new Array(data.length);
6223
- for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
6419
+ for (var i = 0, len = data.length; i < len; ++i)
6420
+ arr[i] = data.charCodeAt(i);
6224
6421
  data = arr;
6225
6422
  }
6226
6423
  FS.chmod(node, mode | 146);
@@ -6253,7 +6450,8 @@ var require_swisseph_node = __commonJS({
6253
6450
  if (result === void 0 && bytesRead === 0) {
6254
6451
  throw new FS.ErrnoError(6);
6255
6452
  }
6256
- if (result === null || result === void 0) break;
6453
+ if (result === null || result === void 0)
6454
+ break;
6257
6455
  bytesRead++;
6258
6456
  buffer[offset + i] = result;
6259
6457
  }
@@ -6276,7 +6474,8 @@ var require_swisseph_node = __commonJS({
6276
6474
  } });
6277
6475
  return FS.mkdev(path, mode, dev);
6278
6476
  }, forceLoadFile(obj) {
6279
- if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
6477
+ if (obj.isDevice || obj.isFolder || obj.link || obj.contents)
6478
+ return true;
6280
6479
  if (typeof XMLHttpRequest != "undefined") {
6281
6480
  throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
6282
6481
  } else {
@@ -6308,25 +6507,31 @@ var require_swisseph_node = __commonJS({
6308
6507
  var xhr = new XMLHttpRequest();
6309
6508
  xhr.open("HEAD", url, false);
6310
6509
  xhr.send(null);
6311
- if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
6510
+ if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304))
6511
+ throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
6312
6512
  var datalength = Number(xhr.getResponseHeader("Content-length"));
6313
6513
  var header;
6314
6514
  var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
6315
6515
  var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
6316
6516
  var chunkSize = 1024 * 1024;
6317
- if (!hasByteServing) chunkSize = datalength;
6517
+ if (!hasByteServing)
6518
+ chunkSize = datalength;
6318
6519
  var doXHR = (from, to) => {
6319
- if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
6320
- if (to > datalength - 1) throw new Error("only " + datalength + " bytes available! programmer error!");
6520
+ if (from > to)
6521
+ throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
6522
+ if (to > datalength - 1)
6523
+ throw new Error("only " + datalength + " bytes available! programmer error!");
6321
6524
  var xhr2 = new XMLHttpRequest();
6322
6525
  xhr2.open("GET", url, false);
6323
- if (datalength !== chunkSize) xhr2.setRequestHeader("Range", "bytes=" + from + "-" + to);
6526
+ if (datalength !== chunkSize)
6527
+ xhr2.setRequestHeader("Range", "bytes=" + from + "-" + to);
6324
6528
  xhr2.responseType = "arraybuffer";
6325
6529
  if (xhr2.overrideMimeType) {
6326
6530
  xhr2.overrideMimeType("text/plain; charset=x-user-defined");
6327
6531
  }
6328
6532
  xhr2.send(null);
6329
- if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr2.status);
6533
+ if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304))
6534
+ throw new Error("Couldn't load " + url + ". Status: " + xhr2.status);
6330
6535
  if (xhr2.response !== void 0) {
6331
6536
  return new Uint8Array(xhr2.response || []);
6332
6537
  }
@@ -6340,7 +6545,8 @@ var require_swisseph_node = __commonJS({
6340
6545
  if (typeof lazyArray2.chunks[chunkNum] == "undefined") {
6341
6546
  lazyArray2.chunks[chunkNum] = doXHR(start, end);
6342
6547
  }
6343
- if (typeof lazyArray2.chunks[chunkNum] == "undefined") throw new Error("doXHR failed!");
6548
+ if (typeof lazyArray2.chunks[chunkNum] == "undefined")
6549
+ throw new Error("doXHR failed!");
6344
6550
  return lazyArray2.chunks[chunkNum];
6345
6551
  });
6346
6552
  if (usesGzip || !datalength) {
@@ -6367,7 +6573,8 @@ var require_swisseph_node = __commonJS({
6367
6573
  }
6368
6574
  }
6369
6575
  if (typeof XMLHttpRequest != "undefined") {
6370
- if (!ENVIRONMENT_IS_WORKER) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
6576
+ if (!ENVIRONMENT_IS_WORKER)
6577
+ throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
6371
6578
  var lazyArray = new LazyUint8Array();
6372
6579
  var properties = { isDevice: false, contents: lazyArray };
6373
6580
  } else {
@@ -6394,7 +6601,8 @@ var require_swisseph_node = __commonJS({
6394
6601
  });
6395
6602
  function writeChunks(stream, buffer, offset, length, position) {
6396
6603
  var contents = stream.node.contents;
6397
- if (position >= contents.length) return 0;
6604
+ if (position >= contents.length)
6605
+ return 0;
6398
6606
  var size = Math.min(contents.length - position, length);
6399
6607
  assert(size >= 0);
6400
6608
  if (contents.slice) {
@@ -6541,7 +6749,8 @@ var require_swisseph_node = __commonJS({
6541
6749
  }
6542
6750
  return -28;
6543
6751
  } catch (e) {
6544
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
6752
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
6753
+ throw e;
6545
6754
  return -e.errno;
6546
6755
  }
6547
6756
  }
@@ -6551,11 +6760,13 @@ var require_swisseph_node = __commonJS({
6551
6760
  var stream = SYSCALLS.getStreamFromFD(fd);
6552
6761
  switch (op) {
6553
6762
  case 21509: {
6554
- if (!stream.tty) return -59;
6763
+ if (!stream.tty)
6764
+ return -59;
6555
6765
  return 0;
6556
6766
  }
6557
6767
  case 21505: {
6558
- if (!stream.tty) return -59;
6768
+ if (!stream.tty)
6769
+ return -59;
6559
6770
  if (stream.tty.ops.ioctl_tcgets) {
6560
6771
  var termios = stream.tty.ops.ioctl_tcgets(stream);
6561
6772
  var argp = syscallGetVarargP();
@@ -6573,13 +6784,15 @@ var require_swisseph_node = __commonJS({
6573
6784
  case 21510:
6574
6785
  case 21511:
6575
6786
  case 21512: {
6576
- if (!stream.tty) return -59;
6787
+ if (!stream.tty)
6788
+ return -59;
6577
6789
  return 0;
6578
6790
  }
6579
6791
  case 21506:
6580
6792
  case 21507:
6581
6793
  case 21508: {
6582
- if (!stream.tty) return -59;
6794
+ if (!stream.tty)
6795
+ return -59;
6583
6796
  if (stream.tty.ops.ioctl_tcsets) {
6584
6797
  var argp = syscallGetVarargP();
6585
6798
  var c_iflag = SAFE_HEAP_LOAD((argp >> 2) * 4, 4, 0);
@@ -6595,13 +6808,15 @@ var require_swisseph_node = __commonJS({
6595
6808
  return 0;
6596
6809
  }
6597
6810
  case 21519: {
6598
- if (!stream.tty) return -59;
6811
+ if (!stream.tty)
6812
+ return -59;
6599
6813
  var argp = syscallGetVarargP();
6600
6814
  SAFE_HEAP_STORE((argp >> 2) * 4, 0, 4);
6601
6815
  return 0;
6602
6816
  }
6603
6817
  case 21520: {
6604
- if (!stream.tty) return -59;
6818
+ if (!stream.tty)
6819
+ return -59;
6605
6820
  return -28;
6606
6821
  }
6607
6822
  case 21531: {
@@ -6609,7 +6824,8 @@ var require_swisseph_node = __commonJS({
6609
6824
  return FS.ioctl(stream, op, argp);
6610
6825
  }
6611
6826
  case 21523: {
6612
- if (!stream.tty) return -59;
6827
+ if (!stream.tty)
6828
+ return -59;
6613
6829
  if (stream.tty.ops.ioctl_tiocgwinsz) {
6614
6830
  var winsize = stream.tty.ops.ioctl_tiocgwinsz(stream.tty);
6615
6831
  var argp = syscallGetVarargP();
@@ -6619,18 +6835,21 @@ var require_swisseph_node = __commonJS({
6619
6835
  return 0;
6620
6836
  }
6621
6837
  case 21524: {
6622
- if (!stream.tty) return -59;
6838
+ if (!stream.tty)
6839
+ return -59;
6623
6840
  return 0;
6624
6841
  }
6625
6842
  case 21515: {
6626
- if (!stream.tty) return -59;
6843
+ if (!stream.tty)
6844
+ return -59;
6627
6845
  return 0;
6628
6846
  }
6629
6847
  default:
6630
6848
  return -28;
6631
6849
  }
6632
6850
  } catch (e) {
6633
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
6851
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
6852
+ throw e;
6634
6853
  return -e.errno;
6635
6854
  }
6636
6855
  }
@@ -6642,7 +6861,8 @@ var require_swisseph_node = __commonJS({
6642
6861
  var mode = varargs ? syscallGetVarargI() : 0;
6643
6862
  return FS.open(path, flags, mode).fd;
6644
6863
  } catch (e) {
6645
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
6864
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
6865
+ throw e;
6646
6866
  return -e.errno;
6647
6867
  }
6648
6868
  }
@@ -6687,8 +6907,10 @@ var require_swisseph_node = __commonJS({
6687
6907
  var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
6688
6908
  var env = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: lang, _: getExecutableName() };
6689
6909
  for (var x in ENV) {
6690
- if (ENV[x] === void 0) delete env[x];
6691
- else env[x] = ENV[x];
6910
+ if (ENV[x] === void 0)
6911
+ delete env[x];
6912
+ else
6913
+ env[x] = ENV[x];
6692
6914
  }
6693
6915
  var strings = [];
6694
6916
  for (var x in env) {
@@ -6729,7 +6951,8 @@ var require_swisseph_node = __commonJS({
6729
6951
  FS.close(stream);
6730
6952
  return 0;
6731
6953
  } catch (e) {
6732
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
6954
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
6955
+ throw e;
6733
6956
  return e.errno;
6734
6957
  }
6735
6958
  }
@@ -6740,9 +6963,11 @@ var require_swisseph_node = __commonJS({
6740
6963
  var len = SAFE_HEAP_LOAD((iov + 4 >> 2) * 4, 4, 1);
6741
6964
  iov += 8;
6742
6965
  var curr = FS.read(stream, HEAP8, ptr, len, offset);
6743
- if (curr < 0) return -1;
6966
+ if (curr < 0)
6967
+ return -1;
6744
6968
  ret += curr;
6745
- if (curr < len) break;
6969
+ if (curr < len)
6970
+ break;
6746
6971
  if (typeof offset != "undefined") {
6747
6972
  offset += curr;
6748
6973
  }
@@ -6756,7 +6981,8 @@ var require_swisseph_node = __commonJS({
6756
6981
  SAFE_HEAP_STORE((pnum >> 2) * 4, num, 4);
6757
6982
  return 0;
6758
6983
  } catch (e) {
6759
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
6984
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
6985
+ throw e;
6760
6986
  return e.errno;
6761
6987
  }
6762
6988
  }
@@ -6766,14 +6992,17 @@ var require_swisseph_node = __commonJS({
6766
6992
  function _fd_seek(fd, offset, whence, newOffset) {
6767
6993
  offset = bigintToI53Checked(offset);
6768
6994
  try {
6769
- if (isNaN(offset)) return 61;
6995
+ if (isNaN(offset))
6996
+ return 61;
6770
6997
  var stream = SYSCALLS.getStreamFromFD(fd);
6771
6998
  FS.llseek(stream, offset, whence);
6772
6999
  HEAP64[newOffset >> 3] = BigInt(stream.position);
6773
- if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null;
7000
+ if (stream.getdents && offset === 0 && whence === 0)
7001
+ stream.getdents = null;
6774
7002
  return 0;
6775
7003
  } catch (e) {
6776
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
7004
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
7005
+ throw e;
6777
7006
  return e.errno;
6778
7007
  }
6779
7008
  }
@@ -6784,7 +7013,8 @@ var require_swisseph_node = __commonJS({
6784
7013
  var len = SAFE_HEAP_LOAD((iov + 4 >> 2) * 4, 4, 1);
6785
7014
  iov += 8;
6786
7015
  var curr = FS.write(stream, HEAP8, ptr, len, offset);
6787
- if (curr < 0) return -1;
7016
+ if (curr < 0)
7017
+ return -1;
6788
7018
  ret += curr;
6789
7019
  if (curr < len) {
6790
7020
  break;
@@ -6802,7 +7032,8 @@ var require_swisseph_node = __commonJS({
6802
7032
  SAFE_HEAP_STORE((pnum >> 2) * 4, num, 4);
6803
7033
  return 0;
6804
7034
  } catch (e) {
6805
- if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
7035
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
7036
+ throw e;
6806
7037
  return e.errno;
6807
7038
  }
6808
7039
  }
@@ -6842,7 +7073,8 @@ var require_swisseph_node = __commonJS({
6842
7073
  if (returnType === "string") {
6843
7074
  return UTF8ToString(ret2);
6844
7075
  }
6845
- if (returnType === "boolean") return Boolean(ret2);
7076
+ if (returnType === "boolean")
7077
+ return Boolean(ret2);
6846
7078
  return ret2;
6847
7079
  }
6848
7080
  var func = getCFunc(ident);
@@ -6853,7 +7085,8 @@ var require_swisseph_node = __commonJS({
6853
7085
  for (var i = 0; i < args.length; i++) {
6854
7086
  var converter = toC[argTypes[i]];
6855
7087
  if (converter) {
6856
- if (stack === 0) stack = stackSave();
7088
+ if (stack === 0)
7089
+ stack = stackSave();
6857
7090
  cArgs[i] = converter(args[i]);
6858
7091
  } else {
6859
7092
  cArgs[i] = args[i];
@@ -6862,7 +7095,8 @@ var require_swisseph_node = __commonJS({
6862
7095
  }
6863
7096
  var ret = func(...cArgs);
6864
7097
  function onDone(ret2) {
6865
- if (stack !== 0) stackRestore(stack);
7098
+ if (stack !== 0)
7099
+ stackRestore(stack);
6866
7100
  return convertReturnValue(ret2);
6867
7101
  }
6868
7102
  ret = onDone(ret);
@@ -6976,7 +7210,8 @@ var require_swisseph_node = __commonJS({
6976
7210
  assert(!calledRun);
6977
7211
  calledRun = true;
6978
7212
  Module["calledRun"] = true;
6979
- if (ABORT) return;
7213
+ if (ABORT)
7214
+ return;
6980
7215
  initRuntime();
6981
7216
  readyPromiseResolve(Module);
6982
7217
  Module["onRuntimeInitialized"]?.();
@@ -6996,7 +7231,8 @@ var require_swisseph_node = __commonJS({
6996
7231
  checkStackCookie();
6997
7232
  }
6998
7233
  if (Module["preInit"]) {
6999
- if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
7234
+ if (typeof Module["preInit"] == "function")
7235
+ Module["preInit"] = [Module["preInit"]];
7000
7236
  while (Module["preInit"].length > 0) {
7001
7237
  Module["preInit"].pop()();
7002
7238
  }
@@ -7017,7 +7253,8 @@ var require_swisseph_node = __commonJS({
7017
7253
  (() => {
7018
7254
  var real_SwissEphemerisModule = SwissEphemerisModule;
7019
7255
  SwissEphemerisModule = function(arg) {
7020
- if (new.target) throw new Error("SwissEphemerisModule() should not be called with `new SwissEphemerisModule()`");
7256
+ if (new.target)
7257
+ throw new Error("SwissEphemerisModule() should not be called with `new SwissEphemerisModule()`");
7021
7258
  return real_SwissEphemerisModule(arg);
7022
7259
  };
7023
7260
  })();
@@ -7705,7 +7942,8 @@ function computeHorizonLongitude(gmst, ra, dec, latitude, angle) {
7705
7942
  const tanPhi = Math.tan(latitude * DEG);
7706
7943
  const tanDelta = Math.tan(dec * DEG);
7707
7944
  const cosH = -(tanPhi * tanDelta);
7708
- if (Math.abs(cosH) > 1) return null;
7945
+ if (Math.abs(cosH) > 1)
7946
+ return null;
7709
7947
  const H = Math.acos(cosH) / DEG;
7710
7948
  const lon = angle === "AC" ? normalizeAngle(gmst - ra - H) : normalizeAngle(gmst - ra + H);
7711
7949
  return toGeoLon(lon);
@@ -7737,9 +7975,12 @@ function findParansAtLatitude(equatorialPositions, gmst, latitude, paranOrb = 1)
7737
7975
  for (const [name, eq] of Object.entries(equatorialPositions)) {
7738
7976
  for (const angle of ANGLES) {
7739
7977
  let lon;
7740
- if (angle === "MC") lon = computeMCLongitude(gmst, eq.ra);
7741
- else if (angle === "IC") lon = computeICLongitude(gmst, eq.ra);
7742
- else lon = computeHorizonLongitude(gmst, eq.ra, eq.dec, latitude, angle);
7978
+ if (angle === "MC")
7979
+ lon = computeMCLongitude(gmst, eq.ra);
7980
+ else if (angle === "IC")
7981
+ lon = computeICLongitude(gmst, eq.ra);
7982
+ else
7983
+ lon = computeHorizonLongitude(gmst, eq.ra, eq.dec, latitude, angle);
7743
7984
  if (lon !== null) {
7744
7985
  lines.push({ planet: name, angle, longitude: lon });
7745
7986
  }
@@ -7750,8 +7991,10 @@ function findParansAtLatitude(equatorialPositions, gmst, latitude, paranOrb = 1)
7750
7991
  for (let j = i + 1; j < lines.length; j++) {
7751
7992
  const a = lines[i];
7752
7993
  const b = lines[j];
7753
- if (a.planet === b.planet) continue;
7754
- if (a.angle === b.angle) continue;
7994
+ if (a.planet === b.planet)
7995
+ continue;
7996
+ if (a.angle === b.angle)
7997
+ continue;
7755
7998
  const dist = geographicAngularDifference(a.longitude, b.longitude);
7756
7999
  if (dist <= paranOrb) {
7757
8000
  parans.push({
@@ -7784,8 +8027,10 @@ function queryAstrocartographyLocation(date, options) {
7784
8027
  for (const [name, eq] of Object.entries(positions)) {
7785
8028
  for (const angle of ANGLES) {
7786
8029
  let lineLon;
7787
- if (angle === "MC") lineLon = computeMCLongitude(gmst, eq.ra);
7788
- else if (angle === "IC") lineLon = computeICLongitude(gmst, eq.ra);
8030
+ if (angle === "MC")
8031
+ lineLon = computeMCLongitude(gmst, eq.ra);
8032
+ else if (angle === "IC")
8033
+ lineLon = computeICLongitude(gmst, eq.ra);
7789
8034
  else
7790
8035
  lineLon = computeHorizonLongitude(
7791
8036
  gmst,
@@ -7794,7 +8039,8 @@ function queryAstrocartographyLocation(date, options) {
7794
8039
  latitude,
7795
8040
  angle
7796
8041
  );
7797
- if (lineLon === null) continue;
8042
+ if (lineLon === null)
8043
+ continue;
7798
8044
  const dist = geographicAngularDifference(longitude, lineLon);
7799
8045
  lines.push({
7800
8046
  planet: name,
@@ -7938,14 +8184,17 @@ function computeSynastryAspects(planetsA, planetsB, specs = DEFAULT_ASPECT_SPECS
7938
8184
  }
7939
8185
  function shorterArcMidpoint(a, b) {
7940
8186
  let diff = b - a;
7941
- if (diff > 180) diff -= 360;
7942
- if (diff < -180) diff += 360;
8187
+ if (diff > 180)
8188
+ diff -= 360;
8189
+ if (diff < -180)
8190
+ diff += 360;
7943
8191
  return normalizeAngle(a + diff / 2);
7944
8192
  }
7945
8193
  function computeMidpoints(planetsA, planetsB) {
7946
8194
  const result = {};
7947
8195
  for (const key of Object.keys(planetsA)) {
7948
- if (!(key in planetsB)) continue;
8196
+ if (!(key in planetsB))
8197
+ continue;
7949
8198
  result[key] = shorterArcMidpoint(planetsA[key].longitude, planetsB[key].longitude);
7950
8199
  }
7951
8200
  return result;
@@ -7959,7 +8208,8 @@ function computeTransitAspects(transitPlanets, natalPlanets, specs = DEFAULT_ASP
7959
8208
  for (const kN of keysN) {
7960
8209
  const n = natalPlanets[kN];
7961
8210
  const match = getAspectMatch(t.longitude, n.longitude, specs);
7962
- if (!match) continue;
8211
+ if (!match)
8212
+ continue;
7963
8213
  const tSpeed = t.longitudeSpeed ?? 0;
7964
8214
  const nSpeed = n.longitudeSpeed ?? 0;
7965
8215
  const dt = 0.01;
@@ -8527,9 +8777,11 @@ function findHouseOf(longitude, housePositions) {
8527
8777
  for (let k = 0; k < H.length; k++) {
8528
8778
  const cur = H[k], nxt = H[(k + 1) % H.length];
8529
8779
  if (nxt.L < cur.L) {
8530
- if (L >= cur.L || L < nxt.L) return cur.i;
8780
+ if (L >= cur.L || L < nxt.L)
8781
+ return cur.i;
8531
8782
  } else {
8532
- if (L >= cur.L && L < nxt.L) return cur.i;
8783
+ if (L >= cur.L && L < nxt.L)
8784
+ return cur.i;
8533
8785
  }
8534
8786
  }
8535
8787
  return 1;
@@ -8597,11 +8849,13 @@ function getNatalAspectPoints(planets, ascLon, mcLon) {
8597
8849
  return points;
8598
8850
  }
8599
8851
  function filterByNames(points, names) {
8600
- if (!names || names.length === 0) return points;
8852
+ if (!names || names.length === 0)
8853
+ return points;
8601
8854
  const allowed = new Set(names.map((n) => n.toLowerCase()));
8602
8855
  const result = {};
8603
8856
  for (const [key, val] of Object.entries(points)) {
8604
- if (allowed.has(key)) result[key] = val;
8857
+ if (allowed.has(key))
8858
+ result[key] = val;
8605
8859
  }
8606
8860
  return result;
8607
8861
  }
@@ -8664,7 +8918,8 @@ async function getTransitRange(options) {
8664
8918
  );
8665
8919
  const natalKeys = Object.keys(nPoints);
8666
8920
  const rawStep = options.stepDays ?? 1;
8667
- if (rawStep <= 0) throw new Error("stepDays must be greater than 0");
8921
+ if (rawStep <= 0)
8922
+ throw new Error("stepDays must be greater than 0");
8668
8923
  const fromMs = options.from.getTime();
8669
8924
  const toMs = options.to.getTime();
8670
8925
  const specs = options.aspectSpecs;
@@ -8685,7 +8940,8 @@ async function getTransitRange(options) {
8685
8940
  const date = new Date(ms);
8686
8941
  const utcDate = await toUtcDate(date, transitLat, transitLon, transitTz ?? { autoTimeZone: true });
8687
8942
  const positions = await calculatePlanetaryPositions(utcDate);
8688
- if (!positions) continue;
8943
+ if (!positions)
8944
+ continue;
8689
8945
  const points = {};
8690
8946
  for (const [planetId, pos] of Object.entries(positions)) {
8691
8947
  const id2 = planetId;
@@ -8704,7 +8960,8 @@ async function getTransitRange(options) {
8704
8960
  for (const step of steps) {
8705
8961
  const tPos = step.positions[tKey];
8706
8962
  const nPos = nPoints[nKey];
8707
- if (!tPos || !nPos) continue;
8963
+ if (!tPos || !nPos)
8964
+ continue;
8708
8965
  const match = specs ? findClosestAspectOrb(tPos.longitude, nPos.longitude, specs) : findClosestAspectOrb(tPos.longitude, nPos.longitude);
8709
8966
  if (!match) {
8710
8967
  prevOrb = null;
@@ -8726,7 +8983,8 @@ async function getTransitRange(options) {
8726
8983
  transitLon,
8727
8984
  transitTz
8728
8985
  );
8729
- if (exactResult) perfections.push(exactResult);
8986
+ if (exactResult)
8987
+ perfections.push(exactResult);
8730
8988
  }
8731
8989
  prevDecreasing = wasDecreasing;
8732
8990
  } else {
@@ -8790,7 +9048,8 @@ async function getTransitLongitudeAt(ms, transitKey, transitLat, transitLon, tra
8790
9048
  }
8791
9049
  }
8792
9050
  const positions = await calculatePlanetaryPositions(utc);
8793
- if (!positions) return null;
9051
+ if (!positions)
9052
+ return null;
8794
9053
  return findPlanetByName(positions, transitKey) ?? null;
8795
9054
  }
8796
9055
  async function binarySearchPerfection(transitKey, natalKey, spec, startMs, endMs, natalPoint, transitLat, transitLon, transitTz) {
@@ -8799,12 +9058,14 @@ async function binarySearchPerfection(transitKey, natalKey, spec, startMs, endMs
8799
9058
  let lo = startMs;
8800
9059
  let hi = endMs;
8801
9060
  for (let i = 0; i < maxIterations; i++) {
8802
- if (hi - lo < 6e4) break;
9061
+ if (hi - lo < 6e4)
9062
+ break;
8803
9063
  const m1 = lo + Math.floor((hi - lo) / 3);
8804
9064
  const m2 = hi - Math.floor((hi - lo) / 3);
8805
9065
  const pos1 = await getTransitLongitudeAt(m1, transitKey, transitLat, transitLon, tz);
8806
9066
  const pos2 = await getTransitLongitudeAt(m2, transitKey, transitLat, transitLon, tz);
8807
- if (!pos1 || !pos2) break;
9067
+ if (!pos1 || !pos2)
9068
+ break;
8808
9069
  const orb1 = computeOrbForAspect(pos1.longitude, natalPoint.longitude, spec.angle);
8809
9070
  const orb2 = computeOrbForAspect(pos2.longitude, natalPoint.longitude, spec.angle);
8810
9071
  if (orb1 < orb2) {
@@ -8815,9 +9076,11 @@ async function binarySearchPerfection(transitKey, natalKey, spec, startMs, endMs
8815
9076
  }
8816
9077
  const finalMs = Math.floor((lo + hi) / 2);
8817
9078
  const finalPos = await getTransitLongitudeAt(finalMs, transitKey, transitLat, transitLon, tz);
8818
- if (!finalPos) return null;
9079
+ if (!finalPos)
9080
+ return null;
8819
9081
  const finalOrb = computeOrbForAspect(finalPos.longitude, natalPoint.longitude, spec.angle);
8820
- if (finalOrb > spec.orb) return null;
9082
+ if (finalOrb > spec.orb)
9083
+ return null;
8821
9084
  return {
8822
9085
  transitPlanet: transitKey,
8823
9086
  natalPlanet: natalKey,
@@ -8831,19 +9094,22 @@ async function binarySearchPerfection(transitKey, natalKey, spec, startMs, endMs
8831
9094
  function findPlanetByName(positions, name) {
8832
9095
  for (const [planetId, pos] of Object.entries(positions)) {
8833
9096
  const id2 = planetId;
8834
- if (PLANET_AND_NODE_NAMES[id2].toLowerCase() === name) return pos;
9097
+ if (PLANET_AND_NODE_NAMES[id2].toLowerCase() === name)
9098
+ return pos;
8835
9099
  }
8836
9100
  return void 0;
8837
9101
  }
8838
9102
  async function getSunLongitudeAtMs(ms) {
8839
9103
  const positions = await calculatePlanetaryPositions(new Date(ms));
8840
9104
  const sun = findPlanetByName(positions, "sun");
8841
- if (!sun) throw new Error("Failed to compute Sun position");
9105
+ if (!sun)
9106
+ throw new Error("Failed to compute Sun position");
8842
9107
  return sun.longitude;
8843
9108
  }
8844
9109
  function signedAngularDelta(current, target) {
8845
9110
  let d = normalizeAngle(current - target);
8846
- if (d > 180) d -= 360;
9111
+ if (d > 180)
9112
+ d -= 360;
8847
9113
  return d;
8848
9114
  }
8849
9115
  async function getSolarReturnChart(options) {
@@ -8861,7 +9127,8 @@ async function getSolarReturnChart(options) {
8861
9127
  let lo = approxReturn.getTime() - 2 * 864e5;
8862
9128
  let hi = approxReturn.getTime() + 2 * 864e5;
8863
9129
  for (let i = 0; i < 30; i++) {
8864
- if (hi - lo < 6e4) break;
9130
+ if (hi - lo < 6e4)
9131
+ break;
8865
9132
  const mid = Math.floor((lo + hi) / 2);
8866
9133
  const sunLon = await getSunLongitudeAtMs(mid);
8867
9134
  const delta = signedAngularDelta(sunLon, natalSunLongitude);
@@ -8921,7 +9188,8 @@ var init_astrology = __esm({
8921
9188
  NAME_TO_PLANET = {};
8922
9189
  for (const [id2, name] of Object.entries(PLANET_AND_NODE_NAMES)) {
8923
9190
  const numId = Number(id2);
8924
- if (!isNaN(numId)) NAME_TO_PLANET[name.toLowerCase()] = numId;
9191
+ if (!isNaN(numId))
9192
+ NAME_TO_PLANET[name.toLowerCase()] = numId;
8925
9193
  }
8926
9194
  }
8927
9195
  });
@@ -8979,15 +9247,24 @@ function generateArcheometerSvg(options = {}) {
8979
9247
  push(`<circle cx="${fmt(center.x)}" cy="${fmt(center.y)}" r="${fmt(outerRadius)}" fill="${escapeAttr(palette.paper)}"/>`);
8980
9248
  renderDefs(push, model);
8981
9249
  renderRingGrounds(push, model);
8982
- if (model.layers.chromicRays) renderChromicRays(push, model);
8983
- if (model.layers.planetaryUtterance) renderPlanetaryUtterance(push, model);
8984
- if (model.layers.zodiacUtterance) renderZodiacUtterance(push, model);
8985
- if (model.layers.cosmologicalMusic) renderCosmologicalMusic(push, model);
8986
- if (model.layers.astralZodiac) renderAstralZodiac(push, model);
8987
- if (model.layers.astralPlanetary) renderAstralPlanetary(push, model);
8988
- if (model.layers.solarCenter) renderSolarCenter(push, model);
8989
- if (model.layers.whiteRays) renderWhiteRays(push, model);
8990
- if (model.layers.degreeCrown) renderDegreeCrown(push, model);
9250
+ if (model.layers.chromicRays)
9251
+ renderChromicRays(push, model);
9252
+ if (model.layers.planetaryUtterance)
9253
+ renderPlanetaryUtterance(push, model);
9254
+ if (model.layers.zodiacUtterance)
9255
+ renderZodiacUtterance(push, model);
9256
+ if (model.layers.cosmologicalMusic)
9257
+ renderCosmologicalMusic(push, model);
9258
+ if (model.layers.astralZodiac)
9259
+ renderAstralZodiac(push, model);
9260
+ if (model.layers.astralPlanetary)
9261
+ renderAstralPlanetary(push, model);
9262
+ if (model.layers.solarCenter)
9263
+ renderSolarCenter(push, model);
9264
+ if (model.layers.whiteRays)
9265
+ renderWhiteRays(push, model);
9266
+ if (model.layers.degreeCrown)
9267
+ renderDegreeCrown(push, model);
8991
9268
  renderFrame(push, model);
8992
9269
  push(`</svg>`);
8993
9270
  return lines.join("\n");
@@ -9124,7 +9401,8 @@ function renderPlanetaryUtterance(push, model) {
9124
9401
  }
9125
9402
  push(`</g>`);
9126
9403
  for (const label of sortedByDegree(model.triangleLabels)) {
9127
- if (!label.label) continue;
9404
+ if (!label.label)
9405
+ continue;
9128
9406
  const a = angleOf(model, label.degree);
9129
9407
  const labelPoint = polarToXY(center, ring.r1 + (clipOuter - ring.r1) * 0.56, a);
9130
9408
  push(textSvg(label.label, labelPoint, 12 * scale, palette.ink, 0, "middle", 700));
@@ -9157,7 +9435,8 @@ function renderCosmologicalMusic(push, model) {
9157
9435
  }
9158
9436
  }
9159
9437
  for (const note of notes) {
9160
- if (!note.note) continue;
9438
+ if (!note.note)
9439
+ continue;
9161
9440
  const p = polarToXY(center, (ring.r1 + ring.r2) / 2, angleOf(model, note.degree));
9162
9441
  push(textSvg(note.note, p, 11.8 * scale, palette.ink, tangentRotation(angleOf(model, note.degree)), "middle", 700));
9163
9442
  }
@@ -9289,7 +9568,8 @@ function renderChromicTriangleCore(push, model) {
9289
9568
  push(`<path class="archeometer-chromic-foundation" data-triangle="divineFire" d="${path(move(272.7, 137.047), line(69.2251, 254.523), line(69.2251, 19.5703), "Z")}" fill="${escapeAttr(divineFire?.fill ?? "#CC58A1")}" stroke="${escapeAttr(palette.ink)}" stroke-width="${strokeWidth}"/>`);
9290
9569
  push(`<path class="archeometer-chromic-foundation" data-triangle="mary" d="${path(move(137.05, 272.702), line(19.5737, 69.2266), line(254.527, 69.2266), "Z")}" fill="${escapeAttr(mary?.fill ?? "#E25B61")}" stroke="${escapeAttr(palette.ink)}" stroke-width="${strokeWidth}"/>`);
9291
9570
  for (const triangle of [ether, divineFire, mary]) {
9292
- if (!triangle?.vertexFills) continue;
9571
+ if (!triangle?.vertexFills)
9572
+ continue;
9293
9573
  const vertices = triangle.vertices.map((degree) => polarToXY(center, chromicOuter, angleOf(model, degree)));
9294
9574
  const centroid = polygonCentroid(vertices);
9295
9575
  const midpoints = vertices.map((vertex, index) => midpoint(vertex, vertices[(index + 1) % vertices.length]));
@@ -9330,7 +9610,8 @@ function renderWhiteRays(push, model) {
9330
9610
  const sunCenterCircleRadiusWithPadding = 3 + 0.3;
9331
9611
  push(`<g id="archeometer-white-rays" aria-label="crown of white rays and musical staff">`);
9332
9612
  for (let degree = 0; degree < 180; degree += 30) {
9333
- if (degree === 90 || degree === 270) continue;
9613
+ if (degree === 90 || degree === 270)
9614
+ continue;
9334
9615
  push(lineSvg(lineFromPolar(center, solarRadius, sunCenterCircleRadiusWithPadding, angleOf(model, degree)), palette.whiteRay, 1.55 * scale, 0.92));
9335
9616
  push(lineSvg(lineFromPolar(center, solarRadius, sunCenterCircleRadiusWithPadding, angleOf(model, degree + 180)), palette.whiteRay, 1.55 * scale, 0.92));
9336
9617
  }
@@ -9376,7 +9657,8 @@ function renderFrame(push, model) {
9376
9657
  );
9377
9658
  push(`<g id="archeometer-frame" aria-hidden="true">`);
9378
9659
  for (const radius of radii) {
9379
- if (radius <= 0) continue;
9660
+ if (radius <= 0)
9661
+ continue;
9380
9662
  push(
9381
9663
  `<circle cx="${fmt(center.x)}" cy="${fmt(center.y)}" r="${fmt(radius)}" fill="none" stroke="${escapeAttr(
9382
9664
  palette.ringStroke
@@ -9513,7 +9795,8 @@ function arcSegmentPath(center, radius, startAngle, endAngle) {
9513
9795
  return `M ${fmt(start.x)} ${fmt(start.y)} A ${fmt(radius)} ${fmt(radius)} 0 0 1 ${fmt(end.x)} ${fmt(end.y)}`;
9514
9796
  }
9515
9797
  function polygonPath(points) {
9516
- if (points.length === 0) return "";
9798
+ if (points.length === 0)
9799
+ return "";
9517
9800
  const [first, ...rest] = points;
9518
9801
  return [`M ${fmt(first.x)} ${fmt(first.y)}`, ...rest.map((p) => `L ${fmt(p.x)} ${fmt(p.y)}`), "Z"].join(" ");
9519
9802
  }
@@ -9544,7 +9827,8 @@ function nearestUtterance(degree, utterance) {
9544
9827
  }
9545
9828
  function triangleVertexFillForDegree(model, degree) {
9546
9829
  for (const triangle of model.triangles) {
9547
- if (!triangle.vertexFills) continue;
9830
+ if (!triangle.vertexFills)
9831
+ continue;
9548
9832
  for (const [index, vertexDegree] of triangle.vertices.entries()) {
9549
9833
  if (Math.abs(shortestAngularDistance(degree, vertexDegree)) < 1e-3) {
9550
9834
  return triangle.vertexFills[index];
@@ -9556,7 +9840,8 @@ function triangleVertexFillForDegree(model, degree) {
9556
9840
  function tangentRotation(angleRad) {
9557
9841
  let degrees = rad2deg(angleRad) + 90;
9558
9842
  degrees = (degrees % 360 + 360) % 360;
9559
- if (degrees > 90 && degrees < 270) degrees += 180;
9843
+ if (degrees > 90 && degrees < 270)
9844
+ degrees += 180;
9560
9845
  return (degrees % 360 + 360) % 360;
9561
9846
  }
9562
9847
  function shortestAngularDistance(a, b) {
@@ -9575,7 +9860,8 @@ function round(value) {
9575
9860
  return Math.round(value * 1e3) / 1e3;
9576
9861
  }
9577
9862
  function fmt(value) {
9578
- if (!Number.isFinite(value)) return "0";
9863
+ if (!Number.isFinite(value))
9864
+ return "0";
9579
9865
  return Number.isInteger(value) ? String(value) : value.toFixed(3).replace(/0+$/, "").replace(/\.$/, "");
9580
9866
  }
9581
9867
  function escapeAttr(value) {
@@ -9881,7 +10167,8 @@ function listAstroGlyphs(category) {
9881
10167
  const seen = /* @__PURE__ */ new Set();
9882
10168
  return Object.values(ASTRO_GLYPHS).filter((glyph) => {
9883
10169
  const id2 = `${glyph.category}:${glyph.key}`;
9884
- if (seen.has(id2)) return false;
10170
+ if (seen.has(id2))
10171
+ return false;
9885
10172
  seen.add(id2);
9886
10173
  return category ? glyph.category === category : true;
9887
10174
  });
@@ -10445,8 +10732,10 @@ function renderAngleGlyph(push, marker, model) {
10445
10732
  push(`</g>`);
10446
10733
  }
10447
10734
  function angleDisplayLabel(key) {
10448
- if (key === "ASC") return "AC";
10449
- if (key === "DSC") return "DC";
10735
+ if (key === "ASC")
10736
+ return "AC";
10737
+ if (key === "DSC")
10738
+ return "DC";
10450
10739
  return key;
10451
10740
  }
10452
10741
  function renderPointLabelGroup(push, point, model) {
@@ -14812,13 +15101,13 @@ function loadHermeticQabalah(tree) {
14812
15101
  }
14813
15102
  ];
14814
15103
  for (const path of paths) {
14815
- const pathId2 = tree.addPath({
15104
+ const pathId = tree.addPath({
14816
15105
  leftSphere: path.leftSphere,
14817
15106
  rightSphere: path.rightSphere,
14818
15107
  relatedNumber: path.relatedNumber
14819
15108
  });
14820
15109
  tree.addLetters({
14821
- path: pathId2,
15110
+ path: pathId,
14822
15111
  letters: path.letters
14823
15112
  });
14824
15113
  }
@@ -16151,14 +16440,14 @@ var init_kaabalah = __esm({
16151
16440
  }
16152
16441
  ];
16153
16442
  for (const path of paths) {
16154
- const pathId2 = tree.addPath({
16443
+ const pathId = tree.addPath({
16155
16444
  leftSphere: path.leftSphere,
16156
16445
  rightSphere: path.rightSphere,
16157
16446
  relatedNumber: path.relatedNumber,
16158
16447
  data: path.data
16159
16448
  });
16160
16449
  tree.addLetters({
16161
- path: pathId2,
16450
+ path: pathId,
16162
16451
  letters: path.letters
16163
16452
  });
16164
16453
  }
@@ -18478,13 +18767,13 @@ function loadLurianicKabbalah(tree) {
18478
18767
  }
18479
18768
  ];
18480
18769
  for (const path of paths) {
18481
- const pathId2 = tree.addPath({
18770
+ const pathId = tree.addPath({
18482
18771
  leftSphere: path.leftSphere,
18483
18772
  rightSphere: path.rightSphere,
18484
18773
  relatedNumber: path.relatedNumber
18485
18774
  });
18486
18775
  tree.addLetters({
18487
- path: pathId2,
18776
+ path: pathId,
18488
18777
  letters: path.letters
18489
18778
  });
18490
18779
  }
@@ -18940,7 +19229,8 @@ var init_tree_of_life = __esm({
18940
19229
  * @param id - the id of the node to remove
18941
19230
  */
18942
19231
  removeNode(id2) {
18943
- if (!this.nodes.has(id2)) return;
19232
+ if (!this.nodes.has(id2))
19233
+ return;
18944
19234
  const neighbors = this.adjacent.get(id2);
18945
19235
  if (neighbors) {
18946
19236
  for (const neighbor of neighbors) {
@@ -19004,7 +19294,7 @@ var init_tree_of_life = __esm({
19004
19294
  relatedNumber,
19005
19295
  data
19006
19296
  }) {
19007
- const pathId2 = this.upsertNode(
19297
+ const pathId = this.upsertNode(
19008
19298
  new BaseNode({
19009
19299
  id: relatedNumber,
19010
19300
  type: "path" /* PATH */,
@@ -19017,11 +19307,11 @@ var init_tree_of_life = __esm({
19017
19307
  );
19018
19308
  const numberOfSpheres = 10;
19019
19309
  const pathNumber = relatedNumber + numberOfSpheres;
19020
- this.link(leftSphere, pathId2);
19021
- this.link(rightSphere, pathId2);
19022
- this.addNumber({ number: relatedNumber, nodeId: pathId2 });
19023
- this.addNumber({ number: pathNumber, nodeId: pathId2 });
19024
- return pathId2;
19310
+ this.link(leftSphere, pathId);
19311
+ this.link(rightSphere, pathId);
19312
+ this.addNumber({ number: relatedNumber, nodeId: pathId });
19313
+ this.addNumber({ number: pathNumber, nodeId: pathId });
19314
+ return pathId;
19025
19315
  }
19026
19316
  addLetters({
19027
19317
  path,
@@ -19131,6 +19421,343 @@ var init_factory = __esm({
19131
19421
  }
19132
19422
  });
19133
19423
 
19424
+ // src/core/topology.ts
19425
+ function isNodeType(node, type) {
19426
+ return node.type === type;
19427
+ }
19428
+ function cloneSphereData(data) {
19429
+ return data ? { ...data } : void 0;
19430
+ }
19431
+ function clonePathData(data) {
19432
+ return { ...data };
19433
+ }
19434
+ function parsePathNumber(pathId) {
19435
+ const parsed = Number.parseInt(parseId(pathId), 10);
19436
+ if (!Number.isInteger(parsed)) {
19437
+ throw new Error(`Invalid tree path id: ${pathId}`);
19438
+ }
19439
+ return parsed;
19440
+ }
19441
+ function normalizeName(value) {
19442
+ return value.trim().toLowerCase();
19443
+ }
19444
+ function pairKey(left, right) {
19445
+ return [String(left), String(right)].sort().join("|");
19446
+ }
19447
+ function routeNames() {
19448
+ return [...TREE_TOPOLOGY_LIGHTNING_SPHERE_NAMES];
19449
+ }
19450
+ function routeDescriptor(key) {
19451
+ return key === "lightning" ? {
19452
+ name: "Lightning Path",
19453
+ direction: "descending"
19454
+ } : {
19455
+ name: "Serpent Path",
19456
+ direction: "ascending"
19457
+ };
19458
+ }
19459
+ function routeTargetList(segments) {
19460
+ if (segments.length === 0) {
19461
+ return [];
19462
+ }
19463
+ const targets = [
19464
+ { targetId: segments[0].from.id, targetType: "sphere" }
19465
+ ];
19466
+ for (const segment of segments) {
19467
+ if (segment.path) {
19468
+ targets.push({ targetId: segment.path.id, targetType: "path" });
19469
+ }
19470
+ targets.push({ targetId: segment.to.id, targetType: "sphere" });
19471
+ }
19472
+ return targets;
19473
+ }
19474
+ function getTreeTopology(options = {}) {
19475
+ const system = options.system ?? options.tree?.activeSystem ?? "kaabalah";
19476
+ const tree = options.tree ?? createTree({ system });
19477
+ const spheres = [];
19478
+ for (const sphereId2 of TREE_TOPOLOGY_SPHERE_IDS) {
19479
+ const sphereNode = tree.getNode(sphereId2);
19480
+ if (!sphereNode) {
19481
+ continue;
19482
+ }
19483
+ const name = parseId(sphereId2);
19484
+ spheres.push({
19485
+ id: sphereId2,
19486
+ name,
19487
+ number: TREE_TOPOLOGY_SPHERE_NUMBERS[name],
19488
+ role: name === SPHERES.DAATH ? "hidden" : "sephirah",
19489
+ data: cloneSphereData(sphereNode.data)
19490
+ });
19491
+ }
19492
+ const spheresById = new Map(spheres.map((sphere) => [sphere.id, sphere]));
19493
+ const paths = tree.getNodes().filter(
19494
+ (node) => isNodeType(node, "path" /* PATH */)
19495
+ ).map((pathNode) => {
19496
+ if (!pathNode.data?.from || !pathNode.data?.to) {
19497
+ throw new Error(`Tree topology path ${pathNode.id} is missing endpoints.`);
19498
+ }
19499
+ const from = spheresById.get(pathNode.data.from);
19500
+ const to = spheresById.get(pathNode.data.to);
19501
+ if (!from || !to) {
19502
+ throw new Error(
19503
+ `Tree topology path ${pathNode.id} references unknown spheres.`
19504
+ );
19505
+ }
19506
+ return {
19507
+ id: pathNode.id,
19508
+ number: parsePathNumber(pathNode.id),
19509
+ from,
19510
+ to,
19511
+ data: clonePathData(pathNode.data)
19512
+ };
19513
+ }).sort((left, right) => left.number - right.number);
19514
+ return new TreeTopology({
19515
+ system,
19516
+ spheres,
19517
+ paths
19518
+ });
19519
+ }
19520
+ var TREE_TOPOLOGY_SPHERE_NAMES, TREE_TOPOLOGY_SPHERE_IDS, TREE_TOPOLOGY_PATH_IDS, TREE_TOPOLOGY_SPHERE_NUMBERS, TREE_TOPOLOGY_LIGHTNING_SPHERE_NAMES, TreeTopology;
19521
+ var init_topology = __esm({
19522
+ "src/core/topology.ts"() {
19523
+ "use strict";
19524
+ init_constants();
19525
+ init_factory();
19526
+ init_types();
19527
+ TREE_TOPOLOGY_SPHERE_NAMES = [
19528
+ SPHERES.KETHER,
19529
+ SPHERES.CHOKHMAH,
19530
+ SPHERES.BINAH,
19531
+ SPHERES.DAATH,
19532
+ SPHERES.CHESED,
19533
+ SPHERES.GEBURAH,
19534
+ SPHERES.TIPHARETH,
19535
+ SPHERES.NETZACH,
19536
+ SPHERES.HOD,
19537
+ SPHERES.YESOD,
19538
+ SPHERES.MALKUTH
19539
+ ];
19540
+ TREE_TOPOLOGY_SPHERE_IDS = TREE_TOPOLOGY_SPHERE_NAMES.map(
19541
+ (name) => id("sphere" /* SPHERE */, name)
19542
+ );
19543
+ TREE_TOPOLOGY_PATH_IDS = Array.from(
19544
+ { length: 22 },
19545
+ (_, index) => id("path" /* PATH */, index + 1)
19546
+ );
19547
+ TREE_TOPOLOGY_SPHERE_NUMBERS = {
19548
+ [SPHERES.KETHER]: 1,
19549
+ [SPHERES.CHOKHMAH]: 2,
19550
+ [SPHERES.BINAH]: 3,
19551
+ [SPHERES.DAATH]: 11,
19552
+ [SPHERES.CHESED]: 4,
19553
+ [SPHERES.GEBURAH]: 5,
19554
+ [SPHERES.TIPHARETH]: 6,
19555
+ [SPHERES.NETZACH]: 7,
19556
+ [SPHERES.HOD]: 8,
19557
+ [SPHERES.YESOD]: 9,
19558
+ [SPHERES.MALKUTH]: 10
19559
+ };
19560
+ TREE_TOPOLOGY_LIGHTNING_SPHERE_NAMES = [
19561
+ SPHERES.KETHER,
19562
+ SPHERES.CHOKHMAH,
19563
+ SPHERES.BINAH,
19564
+ SPHERES.CHESED,
19565
+ SPHERES.GEBURAH,
19566
+ SPHERES.TIPHARETH,
19567
+ SPHERES.NETZACH,
19568
+ SPHERES.HOD,
19569
+ SPHERES.YESOD,
19570
+ SPHERES.MALKUTH
19571
+ ];
19572
+ TreeTopology = class {
19573
+ constructor({
19574
+ system,
19575
+ spheres,
19576
+ paths
19577
+ }) {
19578
+ this.spheresById = /* @__PURE__ */ new Map();
19579
+ this.spheresByName = /* @__PURE__ */ new Map();
19580
+ this.spheresByNumber = /* @__PURE__ */ new Map();
19581
+ this.pathsById = /* @__PURE__ */ new Map();
19582
+ this.pathsByNumber = /* @__PURE__ */ new Map();
19583
+ this.pathsBySpherePair = /* @__PURE__ */ new Map();
19584
+ this.routesByKey = /* @__PURE__ */ new Map();
19585
+ this.system = system;
19586
+ this.spheres = spheres.map(
19587
+ (sphere) => Object.freeze({
19588
+ ...sphere,
19589
+ data: cloneSphereData(sphere.data)
19590
+ })
19591
+ );
19592
+ for (const sphere of this.spheres) {
19593
+ this.spheresById.set(sphere.id, sphere);
19594
+ this.spheresByName.set(normalizeName(sphere.name), sphere);
19595
+ this.spheresByNumber.set(sphere.number, sphere);
19596
+ }
19597
+ this.paths = paths.map((path) => {
19598
+ const from = this.spheresById.get(path.from.id);
19599
+ const to = this.spheresById.get(path.to.id);
19600
+ if (!from || !to) {
19601
+ throw new Error(
19602
+ `Tree topology path ${path.id} references unknown spheres.`
19603
+ );
19604
+ }
19605
+ return Object.freeze({
19606
+ ...path,
19607
+ from,
19608
+ to,
19609
+ data: clonePathData(path.data)
19610
+ });
19611
+ });
19612
+ for (const path of this.paths) {
19613
+ this.pathsById.set(path.id, path);
19614
+ this.pathsByNumber.set(path.number, path);
19615
+ this.pathsBySpherePair.set(pairKey(path.from.id, path.to.id), path);
19616
+ }
19617
+ for (const key of ["lightning", "serpent"]) {
19618
+ this.routesByKey.set(key, this.buildRoute(key));
19619
+ }
19620
+ }
19621
+ getSpheres(options = {}) {
19622
+ const includeDaath = options.includeDaath ?? true;
19623
+ return includeDaath ? [...this.spheres] : this.spheres.filter((sphere) => sphere.name !== SPHERES.DAATH);
19624
+ }
19625
+ getPrimarySpheres() {
19626
+ return this.getSpheres({ includeDaath: false });
19627
+ }
19628
+ getSphere(lookup) {
19629
+ if (typeof lookup === "string") {
19630
+ if (lookup.startsWith(`${"sphere" /* SPHERE */}:`)) {
19631
+ return this.spheresById.get(lookup);
19632
+ }
19633
+ return this.spheresByName.get(normalizeName(lookup));
19634
+ }
19635
+ if (lookup.id) {
19636
+ return this.spheresById.get(lookup.id);
19637
+ }
19638
+ if (lookup.number) {
19639
+ return this.spheresByNumber.get(lookup.number);
19640
+ }
19641
+ if (lookup.name) {
19642
+ return this.spheresByName.get(normalizeName(lookup.name));
19643
+ }
19644
+ return void 0;
19645
+ }
19646
+ getPaths() {
19647
+ return [...this.paths];
19648
+ }
19649
+ getPath(lookup) {
19650
+ if (typeof lookup === "number") {
19651
+ return this.pathsByNumber.get(lookup);
19652
+ }
19653
+ if (typeof lookup === "string") {
19654
+ return this.pathsById.get(lookup);
19655
+ }
19656
+ if (lookup.id) {
19657
+ return this.pathsById.get(lookup.id);
19658
+ }
19659
+ if (lookup.number) {
19660
+ return this.pathsByNumber.get(lookup.number);
19661
+ }
19662
+ if (lookup.between) {
19663
+ return this.getPathBetween(lookup.between[0], lookup.between[1]);
19664
+ }
19665
+ return void 0;
19666
+ }
19667
+ getPathBetween(first, second) {
19668
+ const firstSphere = this.getSphere(first);
19669
+ const secondSphere = this.getSphere(second);
19670
+ if (!firstSphere || !secondSphere) {
19671
+ return void 0;
19672
+ }
19673
+ return this.pathsBySpherePair.get(pairKey(firstSphere.id, secondSphere.id));
19674
+ }
19675
+ getAdjacentSpheres(sphereLookup) {
19676
+ const sphere = this.getSphere(sphereLookup);
19677
+ if (!sphere) {
19678
+ return [];
19679
+ }
19680
+ return this.paths.filter((path) => path.from.id === sphere.id || path.to.id === sphere.id).map((path) => {
19681
+ const isForward = path.from.id === sphere.id;
19682
+ return {
19683
+ sphere: isForward ? path.to : path.from,
19684
+ path,
19685
+ direction: isForward ? "forward" : "reverse"
19686
+ };
19687
+ });
19688
+ }
19689
+ getRoutes() {
19690
+ return [...this.routesByKey.values()];
19691
+ }
19692
+ getRoute(key) {
19693
+ return this.routesByKey.get(key);
19694
+ }
19695
+ nextInRoute(routeKey, sphereLookup) {
19696
+ const route = this.getRoute(routeKey);
19697
+ const sphere = this.getSphere(sphereLookup);
19698
+ if (!route || !sphere) {
19699
+ return void 0;
19700
+ }
19701
+ const index = route.spheres.findIndex(
19702
+ (routeSphere) => routeSphere.id === sphere.id
19703
+ );
19704
+ return index >= 0 ? route.spheres[index + 1] : void 0;
19705
+ }
19706
+ previousInRoute(routeKey, sphereLookup) {
19707
+ const route = this.getRoute(routeKey);
19708
+ const sphere = this.getSphere(sphereLookup);
19709
+ if (!route || !sphere) {
19710
+ return void 0;
19711
+ }
19712
+ const index = route.spheres.findIndex(
19713
+ (routeSphere) => routeSphere.id === sphere.id
19714
+ );
19715
+ return index > 0 ? route.spheres[index - 1] : void 0;
19716
+ }
19717
+ buildRoute(key) {
19718
+ const descriptor = routeDescriptor(key);
19719
+ const names = routeNames();
19720
+ const orderedNames = key === "serpent" ? names.reverse() : names;
19721
+ const spheres = orderedNames.map((name) => {
19722
+ const sphere = this.getSphere(name);
19723
+ if (!sphere) {
19724
+ throw new Error(
19725
+ `Tree topology route "${key}" references missing sphere "${name}" in ${this.system}.`
19726
+ );
19727
+ }
19728
+ return sphere;
19729
+ });
19730
+ const segments = [];
19731
+ for (let index = 0; index < spheres.length - 1; index++) {
19732
+ const from = spheres[index];
19733
+ const to = spheres[index + 1];
19734
+ const path = this.getPathBetween(from.name, to.name);
19735
+ segments.push({
19736
+ index,
19737
+ from,
19738
+ to,
19739
+ path,
19740
+ isConnected: Boolean(path)
19741
+ });
19742
+ }
19743
+ const targets = routeTargetList(segments);
19744
+ const missingSegments = segments.filter((segment) => !segment.isConnected);
19745
+ return Object.freeze({
19746
+ key,
19747
+ name: descriptor.name,
19748
+ direction: descriptor.direction,
19749
+ spheres: Object.freeze([...spheres]),
19750
+ segments: Object.freeze(segments),
19751
+ isFullyConnected: missingSegments.length === 0,
19752
+ missingSegments: Object.freeze(missingSegments),
19753
+ targets: Object.freeze(targets),
19754
+ targetIds: Object.freeze(targets.map((target) => target.targetId))
19755
+ });
19756
+ }
19757
+ };
19758
+ }
19759
+ });
19760
+
19134
19761
  // src/core/workspace.ts
19135
19762
  function cloneNode(node) {
19136
19763
  return Object.freeze({
@@ -19667,6 +20294,7 @@ var init_core = __esm({
19667
20294
  init_correspondence_model();
19668
20295
  init_factory();
19669
20296
  init_registry();
20297
+ init_topology();
19670
20298
  init_tree_of_life();
19671
20299
  init_types();
19672
20300
  init_workspace();
@@ -20547,7 +21175,7 @@ function resolveDualToneFill(fill) {
20547
21175
  function escapeAttr3(value) {
20548
21176
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
20549
21177
  }
20550
- var TREE_SVG_DEFAULT_VIEWBOX, TREE_SPHERE_NAMES, TREE_PATH_NUMBERS, CANONICAL_X_PERCENTAGES, CANONICAL_ROW_Y_PERCENTAGES, DEFAULT_SPHERE_RADIUS, DEFAULT_PATH_EDGE_WIDTH, DEFAULT_PATH_MAIN_WIDTH, DEFAULT_PATH_HIGHLIGHT_WIDTH, DEFAULT_SPHERE_HIT_RADIUS, DEFAULT_PATH_HIT_STROKE_WIDTH, MUTED_TARGET_COLOR, sphereId, pathId, TREE_SPHERE_IDS, TREE_PATH_IDS, CANONICAL_SPHERE_PERCENTAGES;
21178
+ var TREE_SVG_DEFAULT_VIEWBOX, TREE_SPHERE_NAMES, CANONICAL_X_PERCENTAGES, CANONICAL_ROW_Y_PERCENTAGES, DEFAULT_SPHERE_RADIUS, DEFAULT_PATH_EDGE_WIDTH, DEFAULT_PATH_MAIN_WIDTH, DEFAULT_PATH_HIGHLIGHT_WIDTH, DEFAULT_SPHERE_HIT_RADIUS, DEFAULT_PATH_HIT_STROKE_WIDTH, MUTED_TARGET_COLOR, sphereId, TREE_SPHERE_IDS, TREE_PATH_IDS, CANONICAL_SPHERE_PERCENTAGES;
20551
21179
  var init_tree = __esm({
20552
21180
  "src/visual/tree.ts"() {
20553
21181
  "use strict";
@@ -20559,19 +21187,8 @@ var init_tree = __esm({
20559
21187
  height: 561
20560
21188
  };
20561
21189
  TREE_SPHERE_NAMES = [
20562
- "Kether",
20563
- "Chokhmah",
20564
- "Binah",
20565
- "Daath",
20566
- "Chesed",
20567
- "Geburah",
20568
- "Tiphareth",
20569
- "Netzach",
20570
- "Hod",
20571
- "Yesod",
20572
- "Malkuth"
21190
+ ...TREE_TOPOLOGY_SPHERE_NAMES
20573
21191
  ];
20574
- TREE_PATH_NUMBERS = Array.from({ length: 22 }, (_, index) => index + 1);
20575
21192
  CANONICAL_X_PERCENTAGES = { left: 13.25, mid: 49.94, right: 86.66 };
20576
21193
  CANONICAL_ROW_Y_PERCENTAGES = [
20577
21194
  6.83,
@@ -20591,13 +21208,8 @@ var init_tree = __esm({
20591
21208
  DEFAULT_PATH_HIT_STROKE_WIDTH = DEFAULT_PATH_EDGE_WIDTH + 8;
20592
21209
  MUTED_TARGET_COLOR = "#AAA";
20593
21210
  sphereId = (name) => id("sphere" /* SPHERE */, name);
20594
- pathId = (pathNumber) => id("path" /* PATH */, String(pathNumber));
20595
- TREE_SPHERE_IDS = TREE_SPHERE_NAMES.map(
20596
- (name) => sphereId(name)
20597
- );
20598
- TREE_PATH_IDS = TREE_PATH_NUMBERS.map(
20599
- (pathNumber) => pathId(pathNumber)
20600
- );
21211
+ TREE_SPHERE_IDS = [...TREE_TOPOLOGY_SPHERE_IDS];
21212
+ TREE_PATH_IDS = [...TREE_TOPOLOGY_PATH_IDS];
20601
21213
  CANONICAL_SPHERE_PERCENTAGES = {
20602
21214
  [sphereId("Kether")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[0] },
20603
21215
  [sphereId("Chokhmah")]: { x: CANONICAL_X_PERCENTAGES.right, y: CANONICAL_ROW_Y_PERCENTAGES[1] },
@@ -20676,7 +21288,7 @@ var import_config3 = require("dotenv/config");
20676
21288
  // package.json
20677
21289
  var package_default = {
20678
21290
  name: "kaabalah",
20679
- version: "6.7.0",
21291
+ version: "6.8.1",
20680
21292
  description: "The de-facto library for any esoteric calculations and tooling",
20681
21293
  engines: {
20682
21294
  node: ">=18.18.0"
@@ -20795,12 +21407,12 @@ var package_default = {
20795
21407
  "tz-lookup": "^6.1.25"
20796
21408
  },
20797
21409
  devDependencies: {
20798
- "@types/node": "^20.11.5",
20799
- "@vitest/coverage-v8": "^1.3.1",
20800
- "ts-node": "^10.9.2",
20801
- tsup: "^8.0.1",
20802
- typescript: "^5.3.3",
20803
- vitest: "^1.3.1"
21410
+ "@types/node": "20.11.5",
21411
+ "@vitest/coverage-v8": "1.3.1",
21412
+ "ts-node": "10.9.2",
21413
+ tsup: "8.0.1",
21414
+ typescript: "5.3.3",
21415
+ vitest: "1.3.1"
20804
21416
  }
20805
21417
  };
20806
21418
 
@@ -20899,11 +21511,19 @@ var COMMANDS = [
20899
21511
  },
20900
21512
  {
20901
21513
  name: "tarot:spread",
20902
- description: "Look up multiple tarot cards by name or number",
20903
- args: [{ name: "cards", type: "string", required: true, description: "Card names or numbers, space-separated (quote multi-word names)" }],
20904
- flags: [],
21514
+ description: "Look up multiple tarot cards by name or number, or draw a named spread with --spread-id",
21515
+ args: [{ name: "cards", type: "string", required: false, description: "Card names or numbers, space-separated (quote multi-word names)" }],
21516
+ flags: [
21517
+ { name: "list", type: "boolean", default: false, description: "List built-in spread IDs and requirements" },
21518
+ { name: "spread-id", type: "string", description: "Draw a built-in spread by ID (e.g. quick-insight, celtic-cross, event-reading)" },
21519
+ { name: "inverted", type: "boolean", default: false, description: "Include inverted cards when drawing a named spread" },
21520
+ { name: "inquirer-gender", type: "string", description: 'Required by event-reading; must be "man" or "woman"' }
21521
+ ],
20905
21522
  examples: [
20906
21523
  'kaabalah tarot:spread "Two of Cups" "The Chariot" 7',
21524
+ "kaabalah tarot:spread --list",
21525
+ "kaabalah tarot:spread --spread-id=celtic-cross --json",
21526
+ "kaabalah tarot:spread --spread-id=event-reading --inquirer-gender=woman --json",
20907
21527
  "kaabalah tarot:spread --input-json=- --json --compact < cards.json"
20908
21528
  ]
20909
21529
  },
@@ -20979,6 +21599,20 @@ var COMMANDS = [
20979
21599
  "kaabalah tree:layout --render-model --activations=activations.json --json --compact"
20980
21600
  ]
20981
21601
  },
21602
+ {
21603
+ name: "tree:topology",
21604
+ description: "Return the structural Tree of Life topology, paths, and named routes",
21605
+ args: [],
21606
+ flags: [
21607
+ { name: "system", type: "string", default: "kaabalah", description: "Tree system: kaabalah, hermetic-qabalah, lurianic-kabbalah" },
21608
+ { name: "route", type: "string", default: "all", description: "Route filter: all, lightning, or serpent" }
21609
+ ],
21610
+ examples: [
21611
+ "kaabalah tree:topology --json --compact",
21612
+ "kaabalah tree:topology --route=lightning --json --compact",
21613
+ "kaabalah tree:topology --system=lurianic-kabbalah --route=lightning --json --compact"
21614
+ ]
21615
+ },
20982
21616
  {
20983
21617
  name: "tree:svg",
20984
21618
  description: "Generate a structural Tree of Life SVG from the canonical library renderer",
@@ -23668,13 +24302,16 @@ var reduceWithMasterNumbers = (num, masterNumbers = EXTENDED_MASTER_NUMBERS) =>
23668
24302
  };
23669
24303
  };
23670
24304
  var getLastArkAnnuStep = (steps) => {
23671
- if (steps.length === 0) return 0;
24305
+ if (steps.length === 0)
24306
+ return 0;
23672
24307
  const step = steps.sort((a, b) => b - a).find((step2) => step2 <= 22);
23673
24308
  return step ?? steps.at(-1) ?? 0;
23674
24309
  };
23675
24310
  function normalizeLetter(letter) {
23676
- if (letter.toUpperCase() === "\xC3") return "\xC3";
23677
- if (letter.toUpperCase() === "\xC7") return "\xC7";
24311
+ if (letter.toUpperCase() === "\xC3")
24312
+ return "\xC3";
24313
+ if (letter.toUpperCase() === "\xC7")
24314
+ return "\xC7";
23678
24315
  return letter.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
23679
24316
  }
23680
24317
  function getLetterMapping({
@@ -23791,7 +24428,8 @@ function getMissingGematriaValues(tree, includedGematriaValues) {
23791
24428
  for (const hebrewLetter of Object.values(HEBREW_LETTERS)) {
23792
24429
  const hebrewLetterId = id("hebrewLetter" /* HEBREW_LETTER */, hebrewLetter);
23793
24430
  const hebrewLetterNode = tree.getNode(hebrewLetterId);
23794
- if (!hebrewLetterNode?.data) continue;
24431
+ if (!hebrewLetterNode?.data)
24432
+ continue;
23795
24433
  if (!includedGematriaValues.has(hebrewLetterNode.data.gematriaValue)) {
23796
24434
  missingGematriaValues.push({
23797
24435
  value: hebrewLetterNode.data.gematriaValue,
@@ -23813,9 +24451,11 @@ function getMissingGematriaValues(tree, includedGematriaValues) {
23813
24451
  function buildLetterInfo(tree, letter, isStarting) {
23814
24452
  const latinLetterId = id("latinLetter" /* LATIN_LETTER */, letter);
23815
24453
  const latinLetterNode = tree.getNode(latinLetterId);
23816
- if (!latinLetterNode?.data) return void 0;
24454
+ if (!latinLetterNode?.data)
24455
+ return void 0;
23817
24456
  const mapping = getLetterMapping({ tree, letterId: latinLetterId, isStarting });
23818
- if (!mapping?.data) return void 0;
24457
+ if (!mapping?.data)
24458
+ return void 0;
23819
24459
  return {
23820
24460
  letter,
23821
24461
  normalValue: mapping.data.gematriaValue,
@@ -23999,7 +24639,8 @@ var reverseGematria = (options, tree) => {
23999
24639
  for (const letter of availableLetters) {
24000
24640
  const isStarting = currentLength === 0;
24001
24641
  const letterInfo = getLetterInfoCached(letter, isStarting);
24002
- if (!letterInfo) continue;
24642
+ if (!letterInfo)
24643
+ continue;
24003
24644
  if (maxLetterRepeat !== void 0) {
24004
24645
  const currentCount = letterCounts.get(letter) || 0;
24005
24646
  if (currentCount >= maxLetterRepeat) {
@@ -24176,7 +24817,8 @@ function reverseGematriaAnagram(options, tree) {
24176
24817
  }
24177
24818
  const isStarting = currentInfos.length === 0;
24178
24819
  const letterInfo = getLetterInfoCached(letter, isStarting);
24179
- if (!letterInfo) continue;
24820
+ if (!letterInfo)
24821
+ continue;
24180
24822
  const value = letterInfo.normalValue;
24181
24823
  const newVowelsSum = runningVowelsSum + (letterInfo.isVowel ? value : 0);
24182
24824
  const newConsonantsSum = runningConsonantsSum + (letterInfo.isVowel ? 0 : value);
@@ -24354,7 +24996,8 @@ function reverseGematriaFromSubsequence(options, tree) {
24354
24996
  }
24355
24997
  const isStarting = currentInfos.length === 0;
24356
24998
  const letterInfo = getLetterInfoCached(letter, isStarting);
24357
- if (!letterInfo) return;
24999
+ if (!letterInfo)
25000
+ return;
24358
25001
  const value = letterInfo.normalValue;
24359
25002
  const newVowelsSum = runningVowelsSum + (letterInfo.isVowel ? value : 0);
24360
25003
  const newConsonantsSum = runningConsonantsSum + (letterInfo.isVowel ? 0 : value);
@@ -24415,13 +25058,16 @@ function reverseGematriaFromSubsequence(options, tree) {
24415
25058
  totalFound
24416
25059
  };
24417
25060
  }
25061
+ function ensureTreeExists(tree) {
25062
+ if (!tree)
25063
+ return createTree({ system: SYSTEM2, parts: [] });
25064
+ return tree;
25065
+ }
24418
25066
  var calculateGematria = (phrase, options = {
24419
25067
  missing: false,
24420
25068
  percentages: false
24421
25069
  }, tree) => {
24422
- if (!tree) {
24423
- tree = createTree({ system: SYSTEM2, parts: [] });
24424
- }
25070
+ const treeForMappings = ensureTreeExists(tree);
24425
25071
  const words = phrase.toUpperCase().trim().split(" ");
24426
25072
  const initialState = {
24427
25073
  includedLetters: [],
@@ -24430,7 +25076,7 @@ var calculateGematria = (phrase, options = {
24430
25076
  includedGematriaValues: /* @__PURE__ */ new Set()
24431
25077
  };
24432
25078
  const finalState = words.reduce((state, word) => {
24433
- const wordResult = processWord(word, tree);
25079
+ const wordResult = processWord(word, treeForMappings);
24434
25080
  return {
24435
25081
  includedLetters: [...state.includedLetters, ...wordResult.letters],
24436
25082
  vowelsSum: state.vowelsSum + wordResult.vowelsSum,
@@ -24448,7 +25094,7 @@ var calculateGematria = (phrase, options = {
24448
25094
  };
24449
25095
  if (options?.percentages) {
24450
25096
  letterPercentages = words.reduce((acc, word) => {
24451
- return calculateLetterPercentages(word, tree, acc);
25097
+ return calculateLetterPercentages(word, treeForMappings, acc);
24452
25098
  }, letterPercentages);
24453
25099
  }
24454
25100
  const vowelsReduction = reduceToSingleDigitWithSteps(finalState.vowelsSum);
@@ -24458,7 +25104,7 @@ var calculateGematria = (phrase, options = {
24458
25104
  const synthesisReduction = reduceToSingleDigitWithSteps(
24459
25105
  getLastArkAnnuStep(vowelsReduction.steps) + getLastArkAnnuStep(consonantsReduction.steps)
24460
25106
  );
24461
- const missingGematriaValues = options?.missing ? getMissingGematriaValues(tree, finalState.includedGematriaValues) : void 0;
25107
+ const missingGematriaValues = options?.missing ? getMissingGematriaValues(treeForMappings, finalState.includedGematriaValues) : void 0;
24462
25108
  return {
24463
25109
  vowels: {
24464
25110
  originalSum: finalState.vowelsSum,
@@ -25265,8 +25911,10 @@ function diffInPersonalMonths(birthDate, today) {
25265
25911
  if (today.getDate() < birthDate.getDate()) {
25266
25912
  k -= 1;
25267
25913
  }
25268
- if (k < 0) k = 0;
25269
- if (k > 12) k = 12;
25914
+ if (k < 0)
25915
+ k = 0;
25916
+ if (k > 12)
25917
+ k = 12;
25270
25918
  return k;
25271
25919
  }
25272
25920
  function calculatePersonalMonths(birthDate, personalYear, today) {
@@ -26416,6 +27064,18 @@ var ARKANNUS = buildDefaultArkannus(RAW_ARKANNUS);
26416
27064
  var MAJOR_ARCANA_CARDS = ARKANNUS.filter(
26417
27065
  (card) => card.type === "major" && majorArcana.includes(card.tarotCardFilename)
26418
27066
  );
27067
+ var TAROT_SPREAD_MINOR_RANKS = [
27068
+ "ace",
27069
+ "2",
27070
+ "3",
27071
+ "4",
27072
+ "5",
27073
+ "6",
27074
+ "7",
27075
+ "8",
27076
+ "9",
27077
+ "10"
27078
+ ];
26419
27079
  var EVENT_INNER_SLOT_KEYS = [
26420
27080
  "inner-1",
26421
27081
  "inner-2",
@@ -27065,8 +27725,432 @@ var TAROT_SPREADS = [
27065
27725
  var TAROT_SPREAD_BY_ID = new Map(
27066
27726
  TAROT_SPREADS.map((spread) => [spread.spreadId, spread])
27067
27727
  );
27728
+ function cloneCardConstraint(constraint) {
27729
+ if (!constraint) {
27730
+ return void 0;
27731
+ }
27732
+ return {
27733
+ allowedTypes: constraint.allowedTypes ? [...constraint.allowedTypes] : void 0,
27734
+ requiredRank: constraint.requiredRank,
27735
+ allowedCardFilenames: constraint.allowedCardFilenames ? [...constraint.allowedCardFilenames] : void 0,
27736
+ excludedCardFilenames: constraint.excludedCardFilenames ? [...constraint.excludedCardFilenames] : void 0
27737
+ };
27738
+ }
27739
+ function cloneSlotDefinition(slot) {
27740
+ return {
27741
+ ...slot,
27742
+ validationRules: cloneCardConstraint(slot.validationRules),
27743
+ manualSelectionRules: cloneCardConstraint(slot.manualSelectionRules),
27744
+ drawRules: cloneCardConstraint(slot.drawRules),
27745
+ metadata: slot.metadata ? { ...slot.metadata } : void 0
27746
+ };
27747
+ }
27748
+ function cloneSpreadDefinition(spread) {
27749
+ return {
27750
+ ...spread,
27751
+ contextRequirements: spread.contextRequirements ? [...spread.contextRequirements] : void 0,
27752
+ slots: spread.slots.map(cloneSlotDefinition),
27753
+ specialRules: spread.specialRules?.inquirerCard ? {
27754
+ inquirerCard: {
27755
+ slotKey: spread.specialRules.inquirerCard.slotKey,
27756
+ sourceSlotKeys: [...spread.specialRules.inquirerCard.sourceSlotKeys],
27757
+ cardNumbersByGender: {
27758
+ ...spread.specialRules.inquirerCard.cardNumbersByGender
27759
+ }
27760
+ }
27761
+ } : void 0
27762
+ };
27763
+ }
27764
+ function getTarotDeckCardByNumber(cardNumber) {
27765
+ return TAROT_CARD_BY_NUMBER.get(cardNumber);
27766
+ }
27767
+ function getTarotSpreadRuleForValidation(slot) {
27768
+ return slot.validationRules ?? slot.drawRules ?? slot.manualSelectionRules;
27769
+ }
27770
+ function getTarotSpreadRuleForDraw(slot) {
27771
+ return slot.drawRules ?? slot.validationRules ?? slot.manualSelectionRules;
27772
+ }
27773
+ function getTarotMinorRank(card) {
27774
+ if (card.type !== "minor") {
27775
+ return void 0;
27776
+ }
27777
+ const rank = card.tarotCardFilename.split("_")[0];
27778
+ return TAROT_SPREAD_MINOR_RANKS.includes(rank) ? rank : void 0;
27779
+ }
27780
+ function matchesTarotSpreadConstraint(card, constraint) {
27781
+ if (!constraint) {
27782
+ return true;
27783
+ }
27784
+ if (constraint.allowedTypes && !constraint.allowedTypes.includes(card.type)) {
27785
+ return false;
27786
+ }
27787
+ if (constraint.allowedCardFilenames && !constraint.allowedCardFilenames.includes(card.tarotCardFilename)) {
27788
+ return false;
27789
+ }
27790
+ if (constraint.excludedCardFilenames && constraint.excludedCardFilenames.includes(card.tarotCardFilename)) {
27791
+ return false;
27792
+ }
27793
+ if (constraint.requiredRank) {
27794
+ return getTarotMinorRank(card) === constraint.requiredRank;
27795
+ }
27796
+ return true;
27797
+ }
27798
+ function randomIndex(length, rng) {
27799
+ if (length <= 0) {
27800
+ throw new Error("Cannot draw from an empty pool.");
27801
+ }
27802
+ const raw = rng();
27803
+ if (!Number.isFinite(raw)) {
27804
+ throw new Error("Tarot spread RNG must return a finite number.");
27805
+ }
27806
+ const normalized = Math.min(Math.max(raw, 0), 1 - Number.EPSILON);
27807
+ return Math.floor(normalized * length);
27808
+ }
27809
+ function withSpreadCardOrientation(card, includeInverted, rng) {
27810
+ return {
27811
+ ...card,
27812
+ isInverted: includeInverted ? rng() < 0.5 : false
27813
+ };
27814
+ }
27815
+ function resolveTarotSpreadSelectionCard(card, slot, tarotCard) {
27816
+ return {
27817
+ ...card,
27818
+ slot,
27819
+ card: {
27820
+ ...tarotCard,
27821
+ isInverted: card.isInverted ?? false
27822
+ }
27823
+ };
27824
+ }
27825
+ function sortResolvedTarotSpreadCards(resolvedCards) {
27826
+ return [...resolvedCards].sort((left, right) => {
27827
+ if (left.slot.order !== right.slot.order) {
27828
+ return left.slot.order - right.slot.order;
27829
+ }
27830
+ return left.card.number - right.card.number;
27831
+ });
27832
+ }
27833
+ function validateEventInquirerCard(spread, resolvedCards, context, errors) {
27834
+ const inquirerRule = spread.specialRules?.inquirerCard;
27835
+ if (!inquirerRule) {
27836
+ return;
27837
+ }
27838
+ if (!context?.inquirerGender) {
27839
+ return;
27840
+ }
27841
+ const inquirerCardNumber = inquirerRule.cardNumbersByGender[context.inquirerGender];
27842
+ const sourceCards = resolvedCards.filter(
27843
+ (card) => inquirerRule.sourceSlotKeys.includes(card.slotKey)
27844
+ );
27845
+ const inquirerCards = resolvedCards.filter(
27846
+ (card) => card.slotKey === inquirerRule.slotKey
27847
+ );
27848
+ if (inquirerCards.length !== 1) {
27849
+ return;
27850
+ }
27851
+ const sourceContainsGenderCard = sourceCards.some(
27852
+ (card) => card.card.number === inquirerCardNumber
27853
+ );
27854
+ const totalGenderCardCount = [...sourceCards, ...inquirerCards].filter(
27855
+ (card) => card.card.number === inquirerCardNumber
27856
+ ).length;
27857
+ if (totalGenderCardCount !== 1) {
27858
+ errors.push({
27859
+ code: "INVALID_INQUIRER_CARD",
27860
+ slotKey: inquirerRule.slotKey,
27861
+ cardNumber: inquirerCardNumber,
27862
+ message: "Event Reading must contain the gendered inquirer card exactly once across the major arcana band and inquirer slot."
27863
+ });
27864
+ return;
27865
+ }
27866
+ if (!sourceContainsGenderCard && inquirerCards[0].card.number !== inquirerCardNumber) {
27867
+ errors.push({
27868
+ code: "INVALID_INQUIRER_CARD",
27869
+ slotKey: inquirerRule.slotKey,
27870
+ cardNumber: inquirerCards[0].card.number,
27871
+ message: "When the inquirer card was not drawn in the seven major slots, it must occupy the Inquirer slot."
27872
+ });
27873
+ }
27874
+ }
27875
+ function pickTarotCardFromPool(pool, constraint, rng) {
27876
+ const candidateIndexes = pool.reduce((indexes, card, index) => {
27877
+ if (matchesTarotSpreadConstraint(card, constraint)) {
27878
+ indexes.push(index);
27879
+ }
27880
+ return indexes;
27881
+ }, []);
27882
+ if (candidateIndexes.length === 0) {
27883
+ throw new Error("Unable to draw a tarot card that satisfies the spread rule.");
27884
+ }
27885
+ const pickedIndex = candidateIndexes[randomIndex(candidateIndexes.length, rng)];
27886
+ const [pickedCard] = pool.splice(pickedIndex, 1);
27887
+ return pickedCard;
27888
+ }
27889
+ function buildResolvedDrawnCard(slot, card, includeInverted, rng) {
27890
+ const drawnCard = withSpreadCardOrientation(card, includeInverted, rng);
27891
+ return {
27892
+ slotKey: slot.slotKey,
27893
+ cardNumber: drawnCard.number,
27894
+ isInverted: drawnCard.isInverted ?? false,
27895
+ slot,
27896
+ card: drawnCard
27897
+ };
27898
+ }
27899
+ function drawDefaultTarotSpread(spread, includeInverted, rng) {
27900
+ const deckPool = [...ARKANNUS];
27901
+ const drawnCards = [];
27902
+ for (const slot of spread.slots.slice().sort((left, right) => left.order - right.order)) {
27903
+ const drawRule = getTarotSpreadRuleForDraw(slot);
27904
+ for (let index = 0; index < slot.maxCards; index += 1) {
27905
+ const card = pickTarotCardFromPool(deckPool, drawRule, rng);
27906
+ drawnCards.push(
27907
+ buildResolvedDrawnCard(slot, card, includeInverted, rng)
27908
+ );
27909
+ }
27910
+ }
27911
+ return drawnCards;
27912
+ }
27913
+ function drawEventReadingSpread(spread, includeInverted, rng, context) {
27914
+ const inquirerRule = spread.specialRules?.inquirerCard;
27915
+ if (!inquirerRule || !context?.inquirerGender) {
27916
+ throw new Error(
27917
+ "Event Reading draw requires `context.inquirerGender`."
27918
+ );
27919
+ }
27920
+ const slotsByKey = new Map(
27921
+ spread.slots.map((slot) => [slot.slotKey, slot])
27922
+ );
27923
+ const outerPool = ARKANNUS.filter(
27924
+ (card) => card.type === "minor" || card.type === "daat+royalship"
27925
+ );
27926
+ const majorPool = ARKANNUS.filter((card) => card.type === "major");
27927
+ const drawnCards = [];
27928
+ for (const slot of spread.slots.filter((candidate) => candidate.metadata?.groupKey === "outer").sort((left, right) => left.order - right.order)) {
27929
+ const card = pickTarotCardFromPool(outerPool, getTarotSpreadRuleForDraw(slot), rng);
27930
+ drawnCards.push(buildResolvedDrawnCard(slot, card, includeInverted, rng));
27931
+ }
27932
+ for (const slotKey of inquirerRule.sourceSlotKeys) {
27933
+ const slot = slotsByKey.get(slotKey);
27934
+ if (!slot) {
27935
+ throw new Error(`Missing Event Reading slot definition for ${slotKey}.`);
27936
+ }
27937
+ const card = pickTarotCardFromPool(majorPool, getTarotSpreadRuleForDraw(slot), rng);
27938
+ drawnCards.push(buildResolvedDrawnCard(slot, card, includeInverted, rng));
27939
+ }
27940
+ const genderedInquirerCardNumber = inquirerRule.cardNumbersByGender[context.inquirerGender];
27941
+ const sourceContainsGenderedCard = drawnCards.some(
27942
+ (card) => inquirerRule.sourceSlotKeys.includes(card.slotKey) && card.card.number === genderedInquirerCardNumber
27943
+ );
27944
+ const inquirerSlot = slotsByKey.get(inquirerRule.slotKey);
27945
+ if (!inquirerSlot) {
27946
+ throw new Error(
27947
+ `Missing Event Reading slot definition for ${inquirerRule.slotKey}.`
27948
+ );
27949
+ }
27950
+ if (!sourceContainsGenderedCard) {
27951
+ const genderedCardIndex = majorPool.findIndex(
27952
+ (card) => card.number === genderedInquirerCardNumber
27953
+ );
27954
+ if (genderedCardIndex < 0) {
27955
+ throw new Error(
27956
+ "Unable to assign the Event Reading inquirer card from the remaining major arcana."
27957
+ );
27958
+ }
27959
+ const [genderedCard] = majorPool.splice(genderedCardIndex, 1);
27960
+ drawnCards.push(
27961
+ buildResolvedDrawnCard(inquirerSlot, genderedCard, includeInverted, rng)
27962
+ );
27963
+ } else {
27964
+ const replacement = pickTarotCardFromPool(
27965
+ majorPool,
27966
+ getTarotSpreadRuleForDraw(inquirerSlot),
27967
+ rng
27968
+ );
27969
+ drawnCards.push(
27970
+ buildResolvedDrawnCard(inquirerSlot, replacement, includeInverted, rng)
27971
+ );
27972
+ }
27973
+ return drawnCards;
27974
+ }
27975
+ function listTarotSpreads() {
27976
+ return TAROT_SPREADS.map(cloneSpreadDefinition);
27977
+ }
27978
+ function getTarotSpread(spreadId) {
27979
+ const spread = TAROT_SPREAD_BY_ID.get(spreadId);
27980
+ return spread ? cloneSpreadDefinition(spread) : void 0;
27981
+ }
27982
+ function validateTarotSpreadSelection(input) {
27983
+ const spread = TAROT_SPREAD_BY_ID.get(input.spreadId);
27984
+ const errors = [];
27985
+ if (!spread) {
27986
+ return {
27987
+ ok: false,
27988
+ isComplete: false,
27989
+ errors: [
27990
+ {
27991
+ code: "UNKNOWN_SPREAD",
27992
+ message: `Unknown tarot spread: ${input.spreadId}.`
27993
+ }
27994
+ ],
27995
+ resolvedCards: []
27996
+ };
27997
+ }
27998
+ const slotsByKey = new Map(
27999
+ spread.slots.map((slot) => [slot.slotKey, slot])
28000
+ );
28001
+ const seenCardNumbers = /* @__PURE__ */ new Set();
28002
+ const resolvedCards = [];
28003
+ for (const selectedCard of input.cards) {
28004
+ const slot = slotsByKey.get(selectedCard.slotKey);
28005
+ if (!slot) {
28006
+ errors.push({
28007
+ code: "UNKNOWN_SLOT",
28008
+ slotKey: selectedCard.slotKey,
28009
+ message: `Unknown slot for ${spread.label}: ${selectedCard.slotKey}.`
28010
+ });
28011
+ continue;
28012
+ }
28013
+ const tarotCard = getTarotDeckCardByNumber(selectedCard.cardNumber);
28014
+ if (!tarotCard) {
28015
+ errors.push({
28016
+ code: "CARD_NOT_FOUND",
28017
+ slotKey: selectedCard.slotKey,
28018
+ cardNumber: selectedCard.cardNumber,
28019
+ message: `Unknown tarot card number: ${selectedCard.cardNumber}.`
28020
+ });
28021
+ continue;
28022
+ }
28023
+ if (seenCardNumbers.has(tarotCard.number)) {
28024
+ errors.push({
28025
+ code: "DUPLICATE_CARD",
28026
+ slotKey: selectedCard.slotKey,
28027
+ cardNumber: tarotCard.number,
28028
+ message: `Tarot card ${tarotCard.number} is duplicated across the spread.`
28029
+ });
28030
+ continue;
28031
+ }
28032
+ seenCardNumbers.add(tarotCard.number);
28033
+ resolvedCards.push(
28034
+ resolveTarotSpreadSelectionCard(selectedCard, slot, tarotCard)
28035
+ );
28036
+ }
28037
+ let isComplete = true;
28038
+ for (const slot of spread.slots) {
28039
+ const slotCards = resolvedCards.filter(
28040
+ (selectedCard) => selectedCard.slotKey === slot.slotKey
28041
+ );
28042
+ if (slotCards.length < slot.minCards) {
28043
+ isComplete = false;
28044
+ if (!input.allowPartial) {
28045
+ errors.push({
28046
+ code: "MISSING_REQUIRED_CARDS",
28047
+ slotKey: slot.slotKey,
28048
+ message: `${spread.label} requires ${slot.minCards} card(s) for ${slot.label}.`
28049
+ });
28050
+ }
28051
+ }
28052
+ if (slotCards.length > slot.maxCards) {
28053
+ isComplete = false;
28054
+ errors.push({
28055
+ code: "TOO_MANY_CARDS",
28056
+ slotKey: slot.slotKey,
28057
+ message: `${spread.label} allows at most ${slot.maxCards} card(s) for ${slot.label}.`
28058
+ });
28059
+ }
28060
+ const validationRule = getTarotSpreadRuleForValidation(slot);
28061
+ for (const slotCard of slotCards) {
28062
+ if (validationRule?.allowedTypes && !validationRule.allowedTypes.includes(slotCard.card.type)) {
28063
+ errors.push({
28064
+ code: "INVALID_CARD_TYPE",
28065
+ slotKey: slot.slotKey,
28066
+ cardNumber: slotCard.card.number,
28067
+ message: `${slot.label} does not accept ${slotCard.card.type} cards.`
28068
+ });
28069
+ }
28070
+ if (validationRule?.requiredRank && getTarotMinorRank(slotCard.card) !== validationRule.requiredRank) {
28071
+ errors.push({
28072
+ code: "INVALID_CARD_RANK",
28073
+ slotKey: slot.slotKey,
28074
+ cardNumber: slotCard.card.number,
28075
+ message: `${slot.label} requires a ${validationRule.requiredRank} minor arcana card.`
28076
+ });
28077
+ }
28078
+ if (validationRule?.allowedCardFilenames && !validationRule.allowedCardFilenames.includes(slotCard.card.tarotCardFilename)) {
28079
+ errors.push({
28080
+ code: "DISALLOWED_CARD",
28081
+ slotKey: slot.slotKey,
28082
+ cardNumber: slotCard.card.number,
28083
+ message: `${slotCard.card.tarotCard} is not allowed in ${slot.label}.`
28084
+ });
28085
+ }
28086
+ if (validationRule?.excludedCardFilenames && validationRule.excludedCardFilenames.includes(slotCard.card.tarotCardFilename)) {
28087
+ errors.push({
28088
+ code: "DISALLOWED_CARD",
28089
+ slotKey: slot.slotKey,
28090
+ cardNumber: slotCard.card.number,
28091
+ message: `${slotCard.card.tarotCard} is excluded from ${slot.label}.`
28092
+ });
28093
+ }
28094
+ }
28095
+ }
28096
+ if (spread.contextRequirements?.includes("inquirerGender") && !input.context?.inquirerGender) {
28097
+ isComplete = false;
28098
+ errors.push({
28099
+ code: "MISSING_CONTEXT",
28100
+ message: `${spread.label} requires \`context.inquirerGender\`.`
28101
+ });
28102
+ }
28103
+ validateEventInquirerCard(spread, resolvedCards, input.context, errors);
28104
+ const sortedResolvedCards = sortResolvedTarotSpreadCards(resolvedCards);
28105
+ return {
28106
+ ok: errors.length === 0,
28107
+ isComplete,
28108
+ spread: cloneSpreadDefinition(spread),
28109
+ resolvedCards: sortedResolvedCards,
28110
+ errors
28111
+ };
28112
+ }
28113
+ function drawTarotSpread(options) {
28114
+ const spread = TAROT_SPREAD_BY_ID.get(options.spreadId);
28115
+ if (!spread) {
28116
+ throw new Error(`Unknown tarot spread: ${options.spreadId}.`);
28117
+ }
28118
+ const rng = options.rng ?? Math.random;
28119
+ const includeInverted = options.includeInverted ?? false;
28120
+ const drawnCards = spread.spreadId === "event-reading" ? drawEventReadingSpread(spread, includeInverted, rng, options.context) : drawDefaultTarotSpread(spread, includeInverted, rng);
28121
+ const validation = validateTarotSpreadSelection({
28122
+ spreadId: spread.spreadId,
28123
+ cards: drawnCards.map((card) => ({
28124
+ slotKey: card.slotKey,
28125
+ cardNumber: card.cardNumber,
28126
+ isInverted: card.isInverted
28127
+ })),
28128
+ context: options.context
28129
+ });
28130
+ if (!validation.ok) {
28131
+ throw new Error(
28132
+ `Generated an invalid tarot spread selection for ${spread.label}: ${validation.errors.map((error) => error.message).join(" ")}`
28133
+ );
28134
+ }
28135
+ return {
28136
+ spread: cloneSpreadDefinition(spread),
28137
+ deckId: options.deckId ?? "rider-waite",
28138
+ context: options.context,
28139
+ cards: sortResolvedTarotSpreadCards(drawnCards)
28140
+ };
28141
+ }
27068
28142
 
27069
28143
  // src/cli/commands/tarot.ts
28144
+ var TAROT_INQUIRER_GENDERS = /* @__PURE__ */ new Set(["man", "woman"]);
28145
+ function summarizeTarotSpreads() {
28146
+ return listTarotSpreads().map((spread) => ({
28147
+ spreadId: spread.spreadId,
28148
+ label: spread.label,
28149
+ description: spread.description,
28150
+ slots: spread.slots.length,
28151
+ contextRequirements: spread.contextRequirements ?? []
28152
+ }));
28153
+ }
27070
28154
  function findCardsByQuery(query) {
27071
28155
  const num = Number.parseInt(query, 10);
27072
28156
  if (!Number.isNaN(num)) {
@@ -27137,7 +28221,79 @@ function cmdTarotCard(query, flags) {
27137
28221
  printCard(card);
27138
28222
  }
27139
28223
  }
27140
- function cmdTarotSpread(cardQueries, flags) {
28224
+ function parseTarotSpreadContext(flags, context) {
28225
+ const flagGender = getFlagString(flags, "inquirer-gender");
28226
+ const inputGender = context && typeof context === "object" && "inquirerGender" in context ? context.inquirerGender : void 0;
28227
+ const gender = flagGender ?? (typeof inputGender === "string" ? inputGender : void 0);
28228
+ if (!gender) {
28229
+ return void 0;
28230
+ }
28231
+ if (!TAROT_INQUIRER_GENDERS.has(gender)) {
28232
+ exitWithError("INVALID_ARGUMENT", 'Tarot spread context.inquirerGender must be "man" or "woman".', flags);
28233
+ }
28234
+ return { inquirerGender: gender };
28235
+ }
28236
+ function printSpreadDraw(result) {
28237
+ console.log(`
28238
+ ${result.spread.label}`);
28239
+ console.log(`Spread: ${result.spread.spreadId}`);
28240
+ if (result.context?.inquirerGender) {
28241
+ console.log(`Inquirer: ${result.context.inquirerGender}`);
28242
+ }
28243
+ console.log();
28244
+ for (const card of result.cards) {
28245
+ const inverted = card.isInverted ? " (INVERTED)" : "";
28246
+ console.log(
28247
+ ` ${card.slot.order}. ${card.slot.label}: #${String(card.card.number).padStart(2, "0")} ${card.card.tarotCard}${inverted}`
28248
+ );
28249
+ console.log(` ${card.card.meaning}`);
28250
+ }
28251
+ console.log();
28252
+ }
28253
+ function cmdTarotNamedSpread(spreadId, flags, options) {
28254
+ const spread = getTarotSpread(spreadId);
28255
+ if (!spread) {
28256
+ exitWithError("INVALID_ARGUMENT", `Unknown tarot spread: ${spreadId}.`, flags);
28257
+ }
28258
+ const context = parseTarotSpreadContext(flags, options.context);
28259
+ try {
28260
+ const result = drawTarotSpread({
28261
+ spreadId: spread.spreadId,
28262
+ includeInverted: getFlagBool(flags, "inverted"),
28263
+ context
28264
+ });
28265
+ if (isJsonMode(flags)) {
28266
+ outputJson(result, flags);
28267
+ return;
28268
+ }
28269
+ printSpreadDraw(result);
28270
+ } catch (err) {
28271
+ exitWithError("INVALID_ARGUMENT", err instanceof Error ? err.message : String(err), flags);
28272
+ }
28273
+ }
28274
+ function cmdTarotSpread(cardQueries, flags, options = {}) {
28275
+ if (getFlagBool(flags, "list")) {
28276
+ const spreads = summarizeTarotSpreads();
28277
+ if (isJsonMode(flags)) {
28278
+ outputJson(spreads, flags);
28279
+ return;
28280
+ }
28281
+ console.log("\nTarot spreads\n");
28282
+ for (const spread of spreads) {
28283
+ const requirements = spread.contextRequirements.length > 0 ? ` | requires: ${spread.contextRequirements.join(", ")}` : "";
28284
+ console.log(` ${spread.spreadId.padEnd(22)} ${spread.label} (${spread.slots} slots)${requirements}`);
28285
+ if (spread.description) {
28286
+ console.log(` ${spread.description}`);
28287
+ }
28288
+ }
28289
+ console.log();
28290
+ return;
28291
+ }
28292
+ const spreadId = getFlagString(flags, "spread-id") ?? options.spreadId;
28293
+ if (spreadId) {
28294
+ cmdTarotNamedSpread(spreadId, flags, options);
28295
+ return;
28296
+ }
27141
28297
  const results = [];
27142
28298
  for (const query of cardQueries) {
27143
28299
  const { cards } = findCardsByQuery(query);
@@ -27315,6 +28471,74 @@ function serializeRenderModel(model) {
27315
28471
  pathById: model.pathById
27316
28472
  };
27317
28473
  }
28474
+ function serializeTopologySphere(sphere) {
28475
+ const result = {
28476
+ id: sphere.id,
28477
+ name: sphere.name,
28478
+ number: sphere.number,
28479
+ role: sphere.role
28480
+ };
28481
+ if (sphere.data && Object.keys(sphere.data).length > 0) {
28482
+ result.data = sphere.data;
28483
+ }
28484
+ return result;
28485
+ }
28486
+ function serializeTopologyPath(path) {
28487
+ const result = {
28488
+ id: path.id,
28489
+ number: path.number,
28490
+ fromId: path.from.id,
28491
+ fromName: path.from.name,
28492
+ toId: path.to.id,
28493
+ toName: path.to.name
28494
+ };
28495
+ if (path.data && Object.keys(path.data).length > 0) {
28496
+ result.data = path.data;
28497
+ }
28498
+ return result;
28499
+ }
28500
+ function serializeTopologySegment(segment) {
28501
+ return {
28502
+ index: segment.index,
28503
+ fromId: segment.from.id,
28504
+ fromName: segment.from.name,
28505
+ toId: segment.to.id,
28506
+ toName: segment.to.name,
28507
+ isConnected: segment.isConnected,
28508
+ ...segment.path ? {
28509
+ pathId: segment.path.id,
28510
+ pathNumber: segment.path.number
28511
+ } : {}
28512
+ };
28513
+ }
28514
+ function serializeTopologyRoute(route) {
28515
+ return {
28516
+ key: route.key,
28517
+ name: route.name,
28518
+ direction: route.direction,
28519
+ isFullyConnected: route.isFullyConnected,
28520
+ sphereOrder: route.spheres.map((sphere) => sphere.id),
28521
+ sphereNames: route.spheres.map((sphere) => sphere.name),
28522
+ segments: route.segments.map(serializeTopologySegment),
28523
+ missingSegments: route.missingSegments.map(serializeTopologySegment),
28524
+ targets: route.targets,
28525
+ targetIds: route.targetIds
28526
+ };
28527
+ }
28528
+ function resolveTopologyRouteKey(flags) {
28529
+ const route = getFlagString(flags, "route");
28530
+ if (!route || route === "all") {
28531
+ return void 0;
28532
+ }
28533
+ if (route === "lightning" || route === "serpent") {
28534
+ return route;
28535
+ }
28536
+ exitWithError(
28537
+ "INVALID_ARGUMENT",
28538
+ `Unknown topology route "${route}". Expected one of: lightning, serpent, all.`,
28539
+ flags
28540
+ );
28541
+ }
27318
28542
  function buildViewBox(flags) {
27319
28543
  const width = getFlagNumber(flags, "viewbox-width");
27320
28544
  const height = getFlagNumber(flags, "viewbox-height");
@@ -27542,8 +28766,8 @@ function renderAsciiTree(layout, columns, rows) {
27542
28766
  }
27543
28767
  plot(x1, y1, lineChar);
27544
28768
  };
27545
- for (const pathId2 of layout.pathOrder) {
27546
- const path = layout.percentages.paths[pathId2];
28769
+ for (const pathId of layout.pathOrder) {
28770
+ const path = layout.percentages.paths[pathId];
27547
28771
  drawLine(
27548
28772
  toGridX(path.from.x),
27549
28773
  toGridY(path.from.y),
@@ -27809,6 +29033,50 @@ Tree layout (${system})
27809
29033
  }
27810
29034
  console.log();
27811
29035
  }
29036
+ function cmdTreeTopology(flags) {
29037
+ const system = resolveSystem(flags);
29038
+ const routeKey = resolveTopologyRouteKey(flags);
29039
+ const topology = getTreeTopology({ system });
29040
+ const spheres = topology.getSpheres();
29041
+ const paths = topology.getPaths();
29042
+ const routes = routeKey ? [topology.getRoute(routeKey)].filter(
29043
+ (route) => Boolean(route)
29044
+ ) : topology.getRoutes();
29045
+ if (isJsonMode(flags)) {
29046
+ outputJson(
29047
+ {
29048
+ system,
29049
+ sphereOrder: spheres.map((sphere) => sphere.id),
29050
+ pathOrder: paths.map((path) => path.id),
29051
+ spheres: spheres.map(serializeTopologySphere),
29052
+ paths: paths.map(serializeTopologyPath),
29053
+ routes: routes.map(serializeTopologyRoute)
29054
+ },
29055
+ flags
29056
+ );
29057
+ return;
29058
+ }
29059
+ console.log(`
29060
+ Tree topology (${system})
29061
+ `);
29062
+ console.log(` Spheres: ${spheres.length}`);
29063
+ console.log(` Paths: ${paths.length}`);
29064
+ for (const route of routes) {
29065
+ const serialized = serializeTopologyRoute(route);
29066
+ console.log(
29067
+ `
29068
+ ${route.name} (${route.direction}, ${route.isFullyConnected ? "fully connected" : "has missing path segments"}):`
29069
+ );
29070
+ console.log(` ${serialized.sphereNames.join(" -> ")}`);
29071
+ if (route.missingSegments.length > 0) {
29072
+ console.log(" Missing direct paths:");
29073
+ for (const segment of route.missingSegments) {
29074
+ console.log(` ${segment.from.name} -> ${segment.to.name}`);
29075
+ }
29076
+ }
29077
+ }
29078
+ console.log();
29079
+ }
27812
29080
  function cmdTreeSvg(flags) {
27813
29081
  const svgOptions = buildSvgOptions(flags);
27814
29082
  const svg = generateTreeSvg(svgOptions);
@@ -28019,11 +29287,17 @@ async function runCli(argv) {
28019
29287
  cmdTarotCard((inputPayload?.query != null ? String(inputPayload.query) : void 0) ?? args.slice(1).join(" "), flags);
28020
29288
  return;
28021
29289
  case "tarot:spread": {
29290
+ const spreadId = inputPayload?.spreadId != null ? String(inputPayload.spreadId) : void 0;
29291
+ const hasSpreadIdFlag = typeof flags["spread-id"] === "string" && flags["spread-id"].length > 0;
29292
+ const shouldListSpreads = flags.list === true;
28022
29293
  const cardQueries = Array.isArray(inputPayload?.cards) ? inputPayload.cards.map(String) : args.slice(1);
28023
- if (cardQueries.length === 0) {
29294
+ if (cardQueries.length === 0 && !hasSpreadIdFlag && !spreadId && !shouldListSpreads) {
28024
29295
  exitWithError("MISSING_ARGUMENT", "Usage: kaabalah tarot:spread <card1> [card2] ...", flags);
28025
29296
  }
28026
- cmdTarotSpread(cardQueries, flags);
29297
+ cmdTarotSpread(cardQueries, flags, {
29298
+ spreadId,
29299
+ context: inputPayload?.context
29300
+ });
28027
29301
  return;
28028
29302
  }
28029
29303
  case "ifa":
@@ -28053,6 +29327,9 @@ async function runCli(argv) {
28053
29327
  case "tree:layout":
28054
29328
  cmdTreeLayout(flags);
28055
29329
  return;
29330
+ case "tree:topology":
29331
+ cmdTreeTopology(flags);
29332
+ return;
28056
29333
  case "tree:svg":
28057
29334
  cmdTreeSvg(flags);
28058
29335
  return;