kaabalah 6.2.1 → 6.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -1
- package/dist/{chunk-SDSFI577.mjs → chunk-2RGUI5FG.mjs} +345 -10
- package/dist/chunk-2RGUI5FG.mjs.map +1 -0
- package/dist/{chunk-L3HJSZML.js → chunk-3KJSW6ZP.js} +6 -6
- package/dist/{chunk-L3HJSZML.js.map → chunk-3KJSW6ZP.js.map} +1 -1
- package/dist/{chunk-BOGH5XQA.mjs → chunk-RWX6HFS5.mjs} +3 -3
- package/dist/{chunk-BOGH5XQA.mjs.map → chunk-RWX6HFS5.mjs.map} +1 -1
- package/dist/{chunk-Y62OU26O.js → chunk-WSSELKIB.js} +351 -9
- package/dist/chunk-WSSELKIB.js.map +1 -0
- package/dist/cli.js +61 -2
- package/dist/cli.js.map +1 -1
- package/dist/core/index.d.mts +2 -4
- package/dist/core/index.d.ts +2 -4
- package/dist/{constants-C0XjrYIG.d.mts → correspondence-model-DWXbAjC-.d.mts} +279 -1
- package/dist/{constants-C0XjrYIG.d.ts → correspondence-model-DWXbAjC-.d.ts} +279 -1
- package/dist/gematria/index.d.mts +1 -2
- package/dist/gematria/index.d.ts +1 -2
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +49 -21
- package/dist/index.mjs +2 -2
- package/dist/semantic/index.d.mts +1 -1
- package/dist/semantic/index.d.ts +1 -1
- package/dist/semantic/index.js +8 -8
- package/dist/semantic/index.mjs +2 -2
- package/dist/tarot/index.d.mts +65 -3
- package/dist/tarot/index.d.ts +65 -3
- package/dist/tarot/index.js +42 -14
- package/dist/tarot/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-SDSFI577.mjs.map +0 -1
- package/dist/chunk-Y62OU26O.js.map +0 -1
- package/dist/correspondence-model-BrtIu5tW.d.mts +0 -281
- package/dist/correspondence-model-CpFOWeBr.d.ts +0 -281
package/README.md
CHANGED
|
@@ -81,7 +81,12 @@ const spread = getRandomSpread(3, true);
|
|
|
81
81
|
import { id, KaabalahTypes } from "kaabalah/core";
|
|
82
82
|
import {
|
|
83
83
|
getTarotArchetype,
|
|
84
|
+
getTarotCardByNumber,
|
|
85
|
+
getTarotCardNumber,
|
|
86
|
+
getTarotCorrespondenceProfile,
|
|
87
|
+
getTarotCardProfile,
|
|
84
88
|
getTarotRepresentation,
|
|
89
|
+
listTarotTrees,
|
|
85
90
|
resolveTarotImageUrl
|
|
86
91
|
} from "kaabalah/tarot";
|
|
87
92
|
|
|
@@ -95,9 +100,17 @@ const queenOfCups = getTarotRepresentation(
|
|
|
95
100
|
"rider-waite"
|
|
96
101
|
);
|
|
97
102
|
const tenOfSwords = getTarotRepresentation(
|
|
98
|
-
{ tarotCardNumber:
|
|
103
|
+
{ tarotCardNumber: 55 },
|
|
99
104
|
"mythic"
|
|
100
105
|
);
|
|
106
|
+
const aceOfPentacles = getTarotCardProfile({
|
|
107
|
+
tarotCardName: "Ace of Pentacles"
|
|
108
|
+
});
|
|
109
|
+
const aceOfPentaclesNumber = getTarotCardNumber({
|
|
110
|
+
tarotCardName: "Ace of Pentacles"
|
|
111
|
+
});
|
|
112
|
+
const kingOfSwords = getTarotCardByNumber(51);
|
|
113
|
+
const tarotTrees = listTarotTrees();
|
|
101
114
|
const papusImageUrl = resolveTarotImageUrl(
|
|
102
115
|
{ tarotCardFilename: "02_the_high_priestess" },
|
|
103
116
|
"papus_pt"
|
|
@@ -118,6 +131,37 @@ const aceOfWandsUrl = resolveTarotImageUrl(
|
|
|
118
131
|
|
|
119
132
|
Downstream apps should consume the returned `imageUrl` (or `assetPath`) from the library instead of reconstructing S3 paths locally.
|
|
120
133
|
|
|
134
|
+
Tarot numbering is tree-scoped. In the current library release the canonical default tree is `kaabalah`, and `getTarotCardProfile()` resolves its `tarotCardNumber` from the direct `tarotArkAnnu ↔ number` correspondence in that tree. Use `getTarotCardNumber()` / `getTarotCardByNumber()` for forward and reverse numbering lookups, and treat raw `ARKANNUS` entries as compatibility data rather than the source of truth.
|
|
135
|
+
|
|
136
|
+
For display-facing correspondences, use `getTarotCorrespondenceProfile()` instead of rebuilding card bundles in the app:
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
const pageOfWands = getTarotCorrespondenceProfile({
|
|
140
|
+
tarotCardName: "Page of Wands"
|
|
141
|
+
});
|
|
142
|
+
// {
|
|
143
|
+
// kind: "court",
|
|
144
|
+
// courtRank: "page",
|
|
145
|
+
// correspondences: {
|
|
146
|
+
// element: { id: "westernElement:Fire", label: "Fire" }
|
|
147
|
+
// }
|
|
148
|
+
// }
|
|
149
|
+
|
|
150
|
+
const magician = getTarotCorrespondenceProfile({
|
|
151
|
+
tarotCardName: "The Magician"
|
|
152
|
+
});
|
|
153
|
+
// includes typed astrology correspondences plus path metadata
|
|
154
|
+
// { pathId, pathNumber, pathSlug, hebrewLetter, fromSphere, toSphere, meaning }
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Downstream apps no longer need to parse card-name prefixes like `Page of ...` to determine court rank, or rebuild the same major/court/minor correspondence collapsing logic from raw tree traversals.
|
|
158
|
+
|
|
159
|
+
Observable kaabalah-default renumbering:
|
|
160
|
+
|
|
161
|
+
- `Ten of Swords` is `55` and `Ace of Swords` is `64`
|
|
162
|
+
- `Ten of Pentacles` is `69` and `Ace of Pentacles` is `78`
|
|
163
|
+
- court/minor suit blocks run `King → Queen → Knight → Page → Ten → ... → Ace`
|
|
164
|
+
|
|
121
165
|
### Canonical Semantic Profiles
|
|
122
166
|
|
|
123
167
|
```typescript
|
|
@@ -2,6 +2,12 @@ import { getCanonicalTree } from './chunk-NBP75BAH.mjs';
|
|
|
2
2
|
import { id, parseId } from './chunk-RZBVUDBM.mjs';
|
|
3
3
|
|
|
4
4
|
// src/tarot/index.ts
|
|
5
|
+
var DEFAULT_TAROT_TREE_ID = "kaabalah";
|
|
6
|
+
var TAROT_TREE_IDS = [
|
|
7
|
+
"kaabalah",
|
|
8
|
+
"hermetic-qabalah",
|
|
9
|
+
"lurianic-kabbalah"
|
|
10
|
+
];
|
|
5
11
|
var majorArcana = [
|
|
6
12
|
"01_the_magician",
|
|
7
13
|
"02_the_high_priestess",
|
|
@@ -26,7 +32,7 @@ var majorArcana = [
|
|
|
26
32
|
"21_the_fool",
|
|
27
33
|
"22_the_world"
|
|
28
34
|
];
|
|
29
|
-
var
|
|
35
|
+
var RAW_ARKANNUS = [
|
|
30
36
|
// Major Arcana (1-22)
|
|
31
37
|
{
|
|
32
38
|
number: 1,
|
|
@@ -901,9 +907,6 @@ var TAROT_DECK_METADATA = [
|
|
|
901
907
|
label: "Rider Waite"
|
|
902
908
|
}
|
|
903
909
|
];
|
|
904
|
-
var MAJOR_ARCANA_CARDS = ARKANNUS.filter(
|
|
905
|
-
(card) => card.type === "major" && majorArcana.includes(card.tarotCardFilename)
|
|
906
|
-
);
|
|
907
910
|
var tarotArchetypeCache;
|
|
908
911
|
var tarotCardProfileCache;
|
|
909
912
|
function normalizePathSlug(pathSlug) {
|
|
@@ -912,12 +915,98 @@ function normalizePathSlug(pathSlug) {
|
|
|
912
915
|
function normalizeTarotLookupKey(value) {
|
|
913
916
|
return value.trim().toLowerCase();
|
|
914
917
|
}
|
|
918
|
+
var TAROT_TREE_PARTS = {
|
|
919
|
+
kaabalah: ["tarot"]
|
|
920
|
+
};
|
|
921
|
+
var TAROT_ARK_ANNU_ID_BY_NAME = new Map(
|
|
922
|
+
RAW_ARKANNUS.map((card) => [
|
|
923
|
+
normalizeTarotLookupKey(card.tarotCard),
|
|
924
|
+
id("tarotArkAnnu" /* TAROT_ARK_ANNU */, card.tarotCard)
|
|
925
|
+
])
|
|
926
|
+
);
|
|
927
|
+
var TAROT_ARK_ANNU_ID_BY_FILENAME = new Map(
|
|
928
|
+
RAW_ARKANNUS.map((card) => [
|
|
929
|
+
normalizeTarotLookupKey(card.tarotCardFilename),
|
|
930
|
+
id("tarotArkAnnu" /* TAROT_ARK_ANNU */, card.tarotCard)
|
|
931
|
+
])
|
|
932
|
+
);
|
|
933
|
+
function getTarotTreeWorkspace(treeId = DEFAULT_TAROT_TREE_ID) {
|
|
934
|
+
const parts = TAROT_TREE_PARTS[treeId];
|
|
935
|
+
if (!parts) {
|
|
936
|
+
return void 0;
|
|
937
|
+
}
|
|
938
|
+
return getCanonicalTree({
|
|
939
|
+
system: treeId,
|
|
940
|
+
parts: [...parts]
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
function getDirectTarotCardNumber(tarotArkAnnuId, treeId = DEFAULT_TAROT_TREE_ID) {
|
|
944
|
+
const tree = getTarotTreeWorkspace(treeId);
|
|
945
|
+
if (!tree) {
|
|
946
|
+
return void 0;
|
|
947
|
+
}
|
|
948
|
+
const match = tree.getCorrespondences(tarotArkAnnuId, {
|
|
949
|
+
type: "number" /* NUMBER */,
|
|
950
|
+
depth: 1,
|
|
951
|
+
limit: 1
|
|
952
|
+
})[0];
|
|
953
|
+
if (!match) {
|
|
954
|
+
return void 0;
|
|
955
|
+
}
|
|
956
|
+
return Number.parseInt(parseId(match.node.id), 10);
|
|
957
|
+
}
|
|
958
|
+
function buildDefaultArkannus(cards) {
|
|
959
|
+
const tree = getTarotTreeWorkspace(DEFAULT_TAROT_TREE_ID);
|
|
960
|
+
const resolveNumber = (tarotCardName) => {
|
|
961
|
+
if (!tree) {
|
|
962
|
+
return void 0;
|
|
963
|
+
}
|
|
964
|
+
const match = tree.getCorrespondences(
|
|
965
|
+
id("tarotArkAnnu" /* TAROT_ARK_ANNU */, tarotCardName),
|
|
966
|
+
{
|
|
967
|
+
type: "number" /* NUMBER */,
|
|
968
|
+
depth: 1,
|
|
969
|
+
limit: 1
|
|
970
|
+
}
|
|
971
|
+
)[0];
|
|
972
|
+
if (!match) {
|
|
973
|
+
return void 0;
|
|
974
|
+
}
|
|
975
|
+
return Number.parseInt(parseId(match.node.id), 10);
|
|
976
|
+
};
|
|
977
|
+
return [...cards].map((card) => ({
|
|
978
|
+
...card,
|
|
979
|
+
number: resolveNumber(card.tarotCard) ?? card.number
|
|
980
|
+
})).sort((left, right) => {
|
|
981
|
+
if (left.number !== right.number) {
|
|
982
|
+
return left.number - right.number;
|
|
983
|
+
}
|
|
984
|
+
return left.tarotCard.localeCompare(right.tarotCard);
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
var ARKANNUS = buildDefaultArkannus(RAW_ARKANNUS);
|
|
988
|
+
var TAROT_COURT_RANKS = [
|
|
989
|
+
"king",
|
|
990
|
+
"queen",
|
|
991
|
+
"knight",
|
|
992
|
+
"page"
|
|
993
|
+
];
|
|
994
|
+
var MAJOR_ARCANA_CARDS = ARKANNUS.filter(
|
|
995
|
+
(card) => card.type === "major" && majorArcana.includes(card.tarotCardFilename)
|
|
996
|
+
);
|
|
915
997
|
function toTarotCardKind(card) {
|
|
916
998
|
if (card.type === "major") {
|
|
917
999
|
return "major";
|
|
918
1000
|
}
|
|
919
1001
|
return card.type === "minor" ? "minor" : "court";
|
|
920
1002
|
}
|
|
1003
|
+
function toTarotCourtRank(card) {
|
|
1004
|
+
if (card.type !== "daat+royalship") {
|
|
1005
|
+
return void 0;
|
|
1006
|
+
}
|
|
1007
|
+
const [rank] = card.tarotCardFilename.split("_");
|
|
1008
|
+
return TAROT_COURT_RANKS.includes(rank) ? rank : void 0;
|
|
1009
|
+
}
|
|
921
1010
|
function toTarotAssetPathType(card) {
|
|
922
1011
|
return card.type;
|
|
923
1012
|
}
|
|
@@ -939,6 +1028,180 @@ function toAstrologyCorrespondence(node) {
|
|
|
939
1028
|
label: parseId(node.id)
|
|
940
1029
|
};
|
|
941
1030
|
}
|
|
1031
|
+
function getTarotCorrespondenceTree(treeId = DEFAULT_TAROT_TREE_ID) {
|
|
1032
|
+
return getCanonicalTree({
|
|
1033
|
+
system: treeId,
|
|
1034
|
+
parts: ["westernAstrology", "tarot"]
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
function getCorrespondenceNodes(tree, sourceId, type, depth = 1, limit) {
|
|
1038
|
+
return tree.getCorrespondences(sourceId, {
|
|
1039
|
+
type,
|
|
1040
|
+
depth,
|
|
1041
|
+
limit
|
|
1042
|
+
}).map(({ node }) => node);
|
|
1043
|
+
}
|
|
1044
|
+
function getFirstCorrespondenceNode(tree, sourceId, type, depth = 1) {
|
|
1045
|
+
return getCorrespondenceNodes(tree, sourceId, type, depth, 1)[0];
|
|
1046
|
+
}
|
|
1047
|
+
function toCorrespondenceNode(node) {
|
|
1048
|
+
if (!node) {
|
|
1049
|
+
return void 0;
|
|
1050
|
+
}
|
|
1051
|
+
return {
|
|
1052
|
+
id: node.id,
|
|
1053
|
+
label: parseId(node.id)
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
function toUniqueCorrespondenceNodes(nodes) {
|
|
1057
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1058
|
+
return nodes.flatMap((node) => {
|
|
1059
|
+
const key = String(node.id);
|
|
1060
|
+
if (seen.has(key)) {
|
|
1061
|
+
return [];
|
|
1062
|
+
}
|
|
1063
|
+
seen.add(key);
|
|
1064
|
+
return [toCorrespondenceNode(node)];
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
function toTarotCorrespondenceProfileBase(card) {
|
|
1068
|
+
return {
|
|
1069
|
+
tarotArkAnnuId: card.tarotArkAnnuId,
|
|
1070
|
+
tarotCardNumber: card.tarotCardNumber,
|
|
1071
|
+
tarotCardName: card.tarotCardName,
|
|
1072
|
+
tarotCardFilename: card.tarotCardFilename,
|
|
1073
|
+
tarotMeaning: card.tarotMeaning,
|
|
1074
|
+
suit: card.suit
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
function resolveTarotCardProfileForTree(lookup, treeId = DEFAULT_TAROT_TREE_ID) {
|
|
1078
|
+
if ("tarotCardNumber" in lookup) {
|
|
1079
|
+
return getTarotCardByNumber(lookup.tarotCardNumber, treeId);
|
|
1080
|
+
}
|
|
1081
|
+
return getTarotCardProfile(lookup);
|
|
1082
|
+
}
|
|
1083
|
+
function buildMajorCorrespondenceProfile(card, tree) {
|
|
1084
|
+
const pathNode = getFirstCorrespondenceNode(
|
|
1085
|
+
tree,
|
|
1086
|
+
card.tarotArkAnnuId,
|
|
1087
|
+
"path" /* PATH */
|
|
1088
|
+
);
|
|
1089
|
+
const hebrewLetterNode = pathNode ? getFirstCorrespondenceNode(
|
|
1090
|
+
tree,
|
|
1091
|
+
pathNode.id,
|
|
1092
|
+
"hebrewLetter" /* HEBREW_LETTER */
|
|
1093
|
+
) : void 0;
|
|
1094
|
+
const pathNumberNode = pathNode ? getFirstCorrespondenceNode(tree, pathNode.id, "number" /* NUMBER */) : void 0;
|
|
1095
|
+
const pathNumber = pathNumberNode ? Number.parseInt(parseId(pathNumberNode.id), 10) : Number.NaN;
|
|
1096
|
+
const fromSphereNode = pathNode?.data?.from ? tree.getNode(pathNode.data.from) : void 0;
|
|
1097
|
+
const toSphereNode = pathNode?.data?.to ? tree.getNode(pathNode.data.to) : void 0;
|
|
1098
|
+
if (!pathNode || !hebrewLetterNode || !fromSphereNode || !toSphereNode || !Number.isFinite(pathNumber)) {
|
|
1099
|
+
return void 0;
|
|
1100
|
+
}
|
|
1101
|
+
return {
|
|
1102
|
+
...toTarotCorrespondenceProfileBase(card),
|
|
1103
|
+
kind: "major",
|
|
1104
|
+
correspondences: {
|
|
1105
|
+
astrology: getCorrespondenceNodes(
|
|
1106
|
+
tree,
|
|
1107
|
+
pathNode.id,
|
|
1108
|
+
[
|
|
1109
|
+
"westernElement" /* WESTERN_ELEMENT */,
|
|
1110
|
+
"planet" /* PLANET */,
|
|
1111
|
+
"westernZodiacSign" /* WESTERN_ZODIAC_SIGN */
|
|
1112
|
+
]
|
|
1113
|
+
).map(
|
|
1114
|
+
(node) => toAstrologyCorrespondence(
|
|
1115
|
+
node
|
|
1116
|
+
)
|
|
1117
|
+
),
|
|
1118
|
+
path: {
|
|
1119
|
+
pathId: pathNode.id,
|
|
1120
|
+
pathNumber,
|
|
1121
|
+
pathSlug: parseId(hebrewLetterNode.id).toLowerCase(),
|
|
1122
|
+
meaning: pathNode.data?.meaning,
|
|
1123
|
+
hebrewLetter: toCorrespondenceNode(hebrewLetterNode),
|
|
1124
|
+
fromSphere: toCorrespondenceNode(
|
|
1125
|
+
fromSphereNode
|
|
1126
|
+
),
|
|
1127
|
+
toSphere: toCorrespondenceNode(
|
|
1128
|
+
toSphereNode
|
|
1129
|
+
)
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
function buildCourtCorrespondenceProfile(card, tree) {
|
|
1135
|
+
const suitNode = getFirstCorrespondenceNode(
|
|
1136
|
+
tree,
|
|
1137
|
+
card.tarotArkAnnuId,
|
|
1138
|
+
"tarotSuit" /* TAROT_SUIT */
|
|
1139
|
+
);
|
|
1140
|
+
if (!card.courtRank) {
|
|
1141
|
+
return void 0;
|
|
1142
|
+
}
|
|
1143
|
+
if (card.courtRank === "page") {
|
|
1144
|
+
const elementNode = suitNode ? getFirstCorrespondenceNode(
|
|
1145
|
+
tree,
|
|
1146
|
+
suitNode.id,
|
|
1147
|
+
"westernElement" /* WESTERN_ELEMENT */
|
|
1148
|
+
) : void 0;
|
|
1149
|
+
if (!elementNode) {
|
|
1150
|
+
return void 0;
|
|
1151
|
+
}
|
|
1152
|
+
return {
|
|
1153
|
+
...toTarotCorrespondenceProfileBase(card),
|
|
1154
|
+
kind: "court",
|
|
1155
|
+
courtRank: "page",
|
|
1156
|
+
correspondences: {
|
|
1157
|
+
element: toCorrespondenceNode(elementNode)
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
const signNode = getFirstCorrespondenceNode(
|
|
1162
|
+
tree,
|
|
1163
|
+
card.tarotArkAnnuId,
|
|
1164
|
+
"westernZodiacSign" /* WESTERN_ZODIAC_SIGN */
|
|
1165
|
+
);
|
|
1166
|
+
if (!signNode) {
|
|
1167
|
+
return void 0;
|
|
1168
|
+
}
|
|
1169
|
+
return {
|
|
1170
|
+
...toTarotCorrespondenceProfileBase(card),
|
|
1171
|
+
kind: "court",
|
|
1172
|
+
courtRank: card.courtRank,
|
|
1173
|
+
correspondences: {
|
|
1174
|
+
sign: toCorrespondenceNode(signNode),
|
|
1175
|
+
planets: toUniqueCorrespondenceNodes(
|
|
1176
|
+
getCorrespondenceNodes(
|
|
1177
|
+
tree,
|
|
1178
|
+
signNode.id,
|
|
1179
|
+
"planet" /* PLANET */
|
|
1180
|
+
)
|
|
1181
|
+
)
|
|
1182
|
+
}
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
function buildMinorCorrespondenceProfile(card, tree) {
|
|
1186
|
+
const sphereNode = getFirstCorrespondenceNode(
|
|
1187
|
+
tree,
|
|
1188
|
+
card.tarotArkAnnuId,
|
|
1189
|
+
"sphere" /* SPHERE */
|
|
1190
|
+
);
|
|
1191
|
+
if (!sphereNode) {
|
|
1192
|
+
return void 0;
|
|
1193
|
+
}
|
|
1194
|
+
return {
|
|
1195
|
+
...toTarotCorrespondenceProfileBase(card),
|
|
1196
|
+
kind: "minor",
|
|
1197
|
+
correspondences: {
|
|
1198
|
+
sphere: toCorrespondenceNode(sphereNode),
|
|
1199
|
+
planets: toUniqueCorrespondenceNodes(
|
|
1200
|
+
getCorrespondenceNodes(tree, sphereNode.id, "planet" /* PLANET */)
|
|
1201
|
+
)
|
|
1202
|
+
}
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
942
1205
|
function buildDescriptionsByDeck(tarotArkAnnu) {
|
|
943
1206
|
const descriptions = {};
|
|
944
1207
|
for (const deck of TAROT_DECK_METADATA) {
|
|
@@ -1048,6 +1311,7 @@ function getTarotCardProfileCache() {
|
|
|
1048
1311
|
kind: toTarotCardKind(card),
|
|
1049
1312
|
assetPathType: toTarotAssetPathType(card),
|
|
1050
1313
|
suit: card.suit,
|
|
1314
|
+
courtRank: toTarotCourtRank(card),
|
|
1051
1315
|
availableDeckIds,
|
|
1052
1316
|
descriptionsByDeck
|
|
1053
1317
|
};
|
|
@@ -1091,6 +1355,25 @@ function buildTarotRepresentation(card, deck) {
|
|
|
1091
1355
|
description
|
|
1092
1356
|
};
|
|
1093
1357
|
}
|
|
1358
|
+
function resolveTarotArkAnnuId(lookup) {
|
|
1359
|
+
if ("pathSlug" in lookup || "pathId" in lookup) {
|
|
1360
|
+
return getTarotArchetype(lookup)?.tarotArkAnnuId;
|
|
1361
|
+
}
|
|
1362
|
+
if ("tarotArkAnnuId" in lookup) {
|
|
1363
|
+
return lookup.tarotArkAnnuId;
|
|
1364
|
+
}
|
|
1365
|
+
if ("tarotCardName" in lookup) {
|
|
1366
|
+
return TAROT_ARK_ANNU_ID_BY_NAME.get(
|
|
1367
|
+
normalizeTarotLookupKey(lookup.tarotCardName)
|
|
1368
|
+
);
|
|
1369
|
+
}
|
|
1370
|
+
if ("tarotCardFilename" in lookup) {
|
|
1371
|
+
return TAROT_ARK_ANNU_ID_BY_FILENAME.get(
|
|
1372
|
+
normalizeTarotLookupKey(lookup.tarotCardFilename)
|
|
1373
|
+
);
|
|
1374
|
+
}
|
|
1375
|
+
return void 0;
|
|
1376
|
+
}
|
|
1094
1377
|
function getTarotCardProfile(lookup) {
|
|
1095
1378
|
const cache = getTarotCardProfileCache();
|
|
1096
1379
|
if ("pathSlug" in lookup || "pathId" in lookup) {
|
|
@@ -1110,11 +1393,48 @@ function getTarotCardProfile(lookup) {
|
|
|
1110
1393
|
normalizeTarotLookupKey(lookup.tarotCardFilename)
|
|
1111
1394
|
);
|
|
1112
1395
|
}
|
|
1113
|
-
return
|
|
1396
|
+
return getTarotCardByNumber(lookup.tarotCardNumber);
|
|
1114
1397
|
}
|
|
1115
1398
|
function listTarotDecks() {
|
|
1116
1399
|
return TAROT_DECK_METADATA.map(({ id: id2, label }) => ({ id: id2, label }));
|
|
1117
1400
|
}
|
|
1401
|
+
function listTarotTrees() {
|
|
1402
|
+
return [...TAROT_TREE_IDS];
|
|
1403
|
+
}
|
|
1404
|
+
function getTarotCardNumber(lookup, treeId = DEFAULT_TAROT_TREE_ID) {
|
|
1405
|
+
if ("tarotCardNumber" in lookup) {
|
|
1406
|
+
return getTarotCardByNumber(lookup.tarotCardNumber, treeId)?.tarotCardNumber;
|
|
1407
|
+
}
|
|
1408
|
+
const tarotArkAnnuId = resolveTarotArkAnnuId(lookup);
|
|
1409
|
+
if (!tarotArkAnnuId) {
|
|
1410
|
+
return void 0;
|
|
1411
|
+
}
|
|
1412
|
+
return getDirectTarotCardNumber(tarotArkAnnuId, treeId);
|
|
1413
|
+
}
|
|
1414
|
+
function getTarotCardByNumber(cardNumber, treeId = DEFAULT_TAROT_TREE_ID) {
|
|
1415
|
+
const tree = getTarotTreeWorkspace(treeId);
|
|
1416
|
+
if (!tree) {
|
|
1417
|
+
return void 0;
|
|
1418
|
+
}
|
|
1419
|
+
const match = tree.getCorrespondences(id("number" /* NUMBER */, cardNumber), {
|
|
1420
|
+
type: "tarotArkAnnu" /* TAROT_ARK_ANNU */,
|
|
1421
|
+
depth: 1,
|
|
1422
|
+
limit: 1
|
|
1423
|
+
})[0];
|
|
1424
|
+
if (!match) {
|
|
1425
|
+
return void 0;
|
|
1426
|
+
}
|
|
1427
|
+
const profile = getTarotCardProfile({
|
|
1428
|
+
tarotArkAnnuId: match.node.id
|
|
1429
|
+
});
|
|
1430
|
+
if (!profile || profile.tarotCardNumber === cardNumber) {
|
|
1431
|
+
return profile;
|
|
1432
|
+
}
|
|
1433
|
+
return {
|
|
1434
|
+
...profile,
|
|
1435
|
+
tarotCardNumber: cardNumber
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1118
1438
|
function getTarotArchetype(lookup) {
|
|
1119
1439
|
const cache = getTarotArchetypeCache();
|
|
1120
1440
|
if ("pathSlug" in lookup) {
|
|
@@ -1130,6 +1450,21 @@ function getTarotArchetype(lookup) {
|
|
|
1130
1450
|
}
|
|
1131
1451
|
return cache.byTarotCardNumber.get(lookup.tarotCardNumber);
|
|
1132
1452
|
}
|
|
1453
|
+
function getTarotCorrespondenceProfile(lookup, treeId = DEFAULT_TAROT_TREE_ID) {
|
|
1454
|
+
const card = resolveTarotCardProfileForTree(lookup, treeId);
|
|
1455
|
+
if (!card) {
|
|
1456
|
+
return void 0;
|
|
1457
|
+
}
|
|
1458
|
+
const tree = getTarotCorrespondenceTree(treeId);
|
|
1459
|
+
switch (card.kind) {
|
|
1460
|
+
case "major":
|
|
1461
|
+
return buildMajorCorrespondenceProfile(card, tree);
|
|
1462
|
+
case "court":
|
|
1463
|
+
return buildCourtCorrespondenceProfile(card, tree);
|
|
1464
|
+
case "minor":
|
|
1465
|
+
return buildMinorCorrespondenceProfile(card, tree);
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1133
1468
|
function getTarotRepresentations(lookup) {
|
|
1134
1469
|
const card = getTarotCardProfile(lookup);
|
|
1135
1470
|
if (!card) {
|
|
@@ -1847,7 +2182,7 @@ function cloneSpreadDefinition(spread) {
|
|
|
1847
2182
|
} : void 0
|
|
1848
2183
|
};
|
|
1849
2184
|
}
|
|
1850
|
-
function
|
|
2185
|
+
function getTarotDeckCardByNumber(cardNumber) {
|
|
1851
2186
|
return TAROT_CARD_BY_NUMBER.get(cardNumber);
|
|
1852
2187
|
}
|
|
1853
2188
|
function getTarotSpreadRuleForValidation(slot) {
|
|
@@ -2096,7 +2431,7 @@ function validateTarotSpreadSelection(input) {
|
|
|
2096
2431
|
});
|
|
2097
2432
|
continue;
|
|
2098
2433
|
}
|
|
2099
|
-
const tarotCard =
|
|
2434
|
+
const tarotCard = getTarotDeckCardByNumber(selectedCard.cardNumber);
|
|
2100
2435
|
if (!tarotCard) {
|
|
2101
2436
|
errors.push({
|
|
2102
2437
|
code: "CARD_NOT_FOUND",
|
|
@@ -2226,6 +2561,6 @@ function drawTarotSpread(options) {
|
|
|
2226
2561
|
};
|
|
2227
2562
|
}
|
|
2228
2563
|
|
|
2229
|
-
export { ARKANNUS, TAROT_IMAGE_BASE_URL, drawTarotSpread, getTarotArchetype, getTarotRepresentation, getTarotRepresentations, getTarotSpread, listTarotDecks, listTarotSpreads, majorArcana, resolveTarotImageUrl, shuffleTarotDeck, validateTarotSpreadSelection };
|
|
2230
|
-
//# sourceMappingURL=chunk-
|
|
2231
|
-
//# sourceMappingURL=chunk-
|
|
2564
|
+
export { ARKANNUS, DEFAULT_TAROT_TREE_ID, TAROT_IMAGE_BASE_URL, TAROT_TREE_IDS, drawTarotSpread, getTarotArchetype, getTarotCardByNumber, getTarotCardNumber, getTarotCardProfile, getTarotCorrespondenceProfile, getTarotRepresentation, getTarotRepresentations, getTarotSpread, listTarotDecks, listTarotSpreads, listTarotTrees, majorArcana, resolveTarotImageUrl, shuffleTarotDeck, validateTarotSpreadSelection };
|
|
2565
|
+
//# sourceMappingURL=chunk-2RGUI5FG.mjs.map
|
|
2566
|
+
//# sourceMappingURL=chunk-2RGUI5FG.mjs.map
|