coh-content-db 1.4.1 → 2.0.0-rc.10

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 (101) hide show
  1. package/.editorconfig +24 -0
  2. package/.github/workflows/build.yml +38 -0
  3. package/.github/workflows/pull-request.yml +32 -0
  4. package/.github/workflows/release.yml +52 -0
  5. package/CHANGELOG.md +42 -0
  6. package/LICENSE +24 -674
  7. package/README.md +101 -16
  8. package/dist/coh-content-db.d.ts +988 -22
  9. package/dist/coh-content-db.js +1044 -2
  10. package/dist/coh-content-db.js.map +1 -0
  11. package/dist/coh-content-db.mjs +1009 -0
  12. package/dist/coh-content-db.mjs.map +1 -0
  13. package/eslint.config.mjs +31 -0
  14. package/jest.config.mjs +7 -0
  15. package/package.json +31 -23
  16. package/rollup.config.mjs +27 -0
  17. package/src/main/api/alignment.ts +19 -0
  18. package/src/main/api/alternate-data.ts +22 -0
  19. package/src/main/api/archetype-data.ts +5 -0
  20. package/src/main/api/badge-data.ts +81 -0
  21. package/src/main/api/badge-requirement-data.ts +64 -0
  22. package/src/main/api/badge-requirement-type.ts +32 -0
  23. package/src/main/api/badge-type.ts +19 -0
  24. package/src/main/api/bundle-data.ts +47 -0
  25. package/src/main/api/bundle-header-data.ts +37 -0
  26. package/src/main/api/contact-data.ts +48 -0
  27. package/src/main/api/enhancement-category.ts +30 -0
  28. package/src/main/api/link.ts +4 -0
  29. package/src/main/api/location-data.ts +28 -0
  30. package/src/main/api/markdown-string.ts +4 -0
  31. package/src/main/api/mission-data.ts +83 -0
  32. package/src/main/api/mission-type.ts +2 -0
  33. package/src/main/api/morality.ts +31 -0
  34. package/src/main/api/sex.ts +10 -0
  35. package/src/main/api/zone-data.ts +20 -0
  36. package/src/main/db/abstract-index.ts +37 -0
  37. package/src/main/db/alignment-list.ts +54 -0
  38. package/src/main/db/alternates.ts +67 -0
  39. package/src/main/db/archetype.ts +14 -0
  40. package/src/main/db/badge-index.ts +57 -0
  41. package/src/main/db/badge-requirement.ts +81 -0
  42. package/src/main/db/badge-search-options.ts +51 -0
  43. package/src/main/db/badge.ts +147 -0
  44. package/src/main/db/bundle-header.ts +44 -0
  45. package/src/main/db/coh-content-database.ts +138 -0
  46. package/src/main/db/contact.ts +62 -0
  47. package/src/main/db/key.ts +18 -0
  48. package/src/main/db/location.ts +30 -0
  49. package/src/main/db/mission.ts +107 -0
  50. package/src/main/db/morality-list.ts +99 -0
  51. package/src/main/db/paged.ts +7 -0
  52. package/src/main/db/zone.ts +28 -0
  53. package/src/main/index.ts +41 -0
  54. package/src/main/util.ts +118 -0
  55. package/src/test/api/alignment.test.ts +65 -0
  56. package/src/test/api/archetype-data.fixture.ts +8 -0
  57. package/src/test/api/badge-data.fixture.ts +8 -0
  58. package/src/test/api/badge-data.test.ts +15 -0
  59. package/src/test/api/badge-requirement-data.fixture.ts +7 -0
  60. package/src/test/api/badge-requirement-type.test.ts +31 -0
  61. package/src/test/api/badge-type.test.ts +35 -0
  62. package/src/test/api/bundle-data.fixture.ts +6 -0
  63. package/src/test/api/bundle-header-data.fixture.ts +6 -0
  64. package/src/test/api/contact-data.fixture.ts +7 -0
  65. package/src/test/api/enhancement-category.test.ts +35 -0
  66. package/src/test/api/mission-data.fixture.ts +12 -0
  67. package/src/test/api/sex.test.ts +63 -0
  68. package/src/test/api/zone-data.fixture.ts +8 -0
  69. package/src/test/db/abstract-index.test.ts +55 -0
  70. package/src/test/db/alignment-list.test.ts +200 -0
  71. package/src/test/db/alternates.test.ts +188 -0
  72. package/src/test/db/archetype.test.ts +38 -0
  73. package/src/test/db/badge-index.test.ts +519 -0
  74. package/src/test/db/badge-requirement.test.ts +145 -0
  75. package/src/test/db/badge.test.ts +337 -0
  76. package/src/test/db/bundle-header.test.ts +76 -0
  77. package/src/test/db/coh-content-database.test.ts +282 -0
  78. package/src/test/db/contact.test.ts +97 -0
  79. package/src/test/db/key.test.ts +22 -0
  80. package/src/test/db/location.test.ts +51 -0
  81. package/src/test/db/mission.test.ts +171 -0
  82. package/src/test/db/morality-list.test.ts +457 -0
  83. package/src/test/db/zone.test.ts +36 -0
  84. package/src/test/integration.test.ts +16 -0
  85. package/src/test/util.test.ts +165 -0
  86. package/tsconfig.json +117 -0
  87. package/dist/_changelog.d.ts +0 -3
  88. package/dist/coh-content-db.nomin.js +0 -635
  89. package/dist/content-refence-utils.d.ts +0 -4
  90. package/dist/index.d.ts +0 -8
  91. package/dist/internal/_common.d.ts +0 -4
  92. package/dist/internal/archetype.d.ts +0 -10
  93. package/dist/internal/badge.d.ts +0 -44
  94. package/dist/internal/game-map.d.ts +0 -33
  95. package/dist/internal/server-group.d.ts +0 -24
  96. package/dist/types/archetype.d.ts +0 -9
  97. package/dist/types/badge.d.ts +0 -192
  98. package/dist/types/enhancement.d.ts +0 -28
  99. package/dist/types/game-map.d.ts +0 -47
  100. package/dist/types/link.d.ts +0 -4
  101. package/dist/types/server-group.d.ts +0 -75
@@ -0,0 +1,1009 @@
1
+ const ALIGNMENT = ["hero", "villain", "praetorian"];
2
+ const ALIGNMENT_ORDER = Object.fromEntries(ALIGNMENT.map((x, index) => [x, index]));
3
+ function compareAlignment(a, b) {
4
+ const orderA = a ? ALIGNMENT_ORDER[a] : -1;
5
+ const orderB = b ? ALIGNMENT_ORDER[b] : -1;
6
+ return orderA - orderB;
7
+ }
8
+
9
+ const BADGE_REQUIREMENT_TYPE = [
10
+ /**
11
+ * Collect a badge.
12
+ */
13
+ "badge",
14
+ /**
15
+ * Craft an invention.
16
+ */
17
+ "invention",
18
+ /**
19
+ * Some invention badges require you to build x of two different invention levels, 'plus one of either level'.
20
+ */
21
+ "invention-plus-one",
22
+ /**
23
+ * Visit a location.
24
+ */
25
+ "location",
26
+ /**
27
+ * Click on a monument.
28
+ */
29
+ "monument",
30
+ /**
31
+ * Complete a mission.
32
+ */
33
+ "mission",
34
+ /**
35
+ * Complete an arbitrary task.
36
+ */
37
+ "task"
38
+ ];
39
+
40
+ const BADGE_TYPE = [
41
+ "exploration",
42
+ "history",
43
+ "accomplishment",
44
+ "achievement",
45
+ "accolade",
46
+ "gladiator",
47
+ "veteran",
48
+ "pvp",
49
+ "invention",
50
+ "defeat",
51
+ "event",
52
+ "ouroboros",
53
+ "consignment",
54
+ "day-job",
55
+ "architect-entertainment"
56
+ ];
57
+
58
+ const ENHANCEMENT_CATEGORY = [
59
+ "defense-debuff",
60
+ "to-hit-debuff",
61
+ "taunt",
62
+ "confuse",
63
+ "healing",
64
+ "defense-buff",
65
+ "resist-damage",
66
+ "intangibility",
67
+ "sleep",
68
+ "slow",
69
+ "hold",
70
+ "stun",
71
+ "immobilize",
72
+ "fear",
73
+ "endurance-modification",
74
+ "endurance-reduction",
75
+ "recharge-reduction",
76
+ "interrupt-duration",
77
+ "accuracy",
78
+ "to-hit-buff",
79
+ "damage",
80
+ "knockback",
81
+ "run-speed",
82
+ "jump",
83
+ "fly-speed",
84
+ "range"
85
+ ];
86
+
87
+ const MISSION_TYPE = ["story-arc", "mission", "task-force", "strike-force", "trial", "personal-story"];
88
+
89
+ const MORALITY = ["hero", "vigilante", "villain", "rogue", "resistance", "loyalist"];
90
+
91
+ const SEX = ["M", "F"];
92
+ const SEX_ORDER = Object.fromEntries(SEX.map((x, index) => [x, index]));
93
+ function compareSex(a, b) {
94
+ const orderA = a ? SEX_ORDER[a] : -1;
95
+ const orderB = b ? SEX_ORDER[b] : -1;
96
+ return orderA - orderB;
97
+ }
98
+
99
+ var __defProp$a = Object.defineProperty;
100
+ var __typeError$6 = (msg) => {
101
+ throw TypeError(msg);
102
+ };
103
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
104
+ var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
105
+ var __accessCheck$6 = (obj, member, msg) => member.has(obj) || __typeError$6("Cannot " + msg);
106
+ var __privateGet$5 = (obj, member, getter) => (__accessCheck$6(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
107
+ var __privateAdd$6 = (obj, member, value) => member.has(obj) ? __typeError$6("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
108
+ var __privateSet$4 = (obj, member, value, setter) => (__accessCheck$6(obj, member, "write to private field"), member.set(obj, value), value);
109
+ var _items$1;
110
+ class AlignmentList {
111
+ constructor(items) {
112
+ __privateAdd$6(this, _items$1);
113
+ __publicField$a(this, "hero");
114
+ __publicField$a(this, "villain");
115
+ __publicField$a(this, "praetorian");
116
+ __publicField$a(this, "primal");
117
+ __publicField$a(this, "all");
118
+ const set = new Set(items ?? [...ALIGNMENT]);
119
+ this.hero = set.has("hero") || set.has("primal") || set.has("all");
120
+ this.villain = set.has("villain") || set.has("primal") || set.has("all");
121
+ this.praetorian = set.has("praetorian") || set.has("all");
122
+ this.primal = this.hero && this.villain;
123
+ this.all = this.hero && this.villain && this.praetorian;
124
+ __privateSet$4(this, _items$1, /* @__PURE__ */ new Set());
125
+ if (this.hero) __privateGet$5(this, _items$1).add("hero");
126
+ if (this.villain) __privateGet$5(this, _items$1).add("villain");
127
+ if (this.praetorian) __privateGet$5(this, _items$1).add("praetorian");
128
+ }
129
+ get items() {
130
+ return [...__privateGet$5(this, _items$1)];
131
+ }
132
+ has(alignment) {
133
+ switch (alignment) {
134
+ case "hero": {
135
+ return this.hero;
136
+ }
137
+ case "villain": {
138
+ return this.villain;
139
+ }
140
+ case "praetorian": {
141
+ return this.praetorian;
142
+ }
143
+ case "primal": {
144
+ return this.primal;
145
+ }
146
+ case "all": {
147
+ return this.all;
148
+ }
149
+ default: {
150
+ return false;
151
+ }
152
+ }
153
+ }
154
+ }
155
+ _items$1 = new WeakMap();
156
+
157
+ var __typeError$5 = (msg) => {
158
+ throw TypeError(msg);
159
+ };
160
+ var __accessCheck$5 = (obj, member, msg) => member.has(obj) || __typeError$5("Cannot " + msg);
161
+ var __privateGet$4 = (obj, member, getter) => (__accessCheck$5(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
162
+ var __privateAdd$5 = (obj, member, value) => member.has(obj) ? __typeError$5("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
163
+ var __privateSet$3 = (obj, member, value, setter) => (__accessCheck$5(obj, member, "write to private field"), member.set(obj, value), value);
164
+ var __privateMethod$2 = (obj, member, method) => (__accessCheck$5(obj, member, "access private method"), method);
165
+ var _sortedValues, _Alternates_instances, compareAlternates_fn;
166
+ class Alternates {
167
+ /**
168
+ * Create an alternate set from either a list of categorized values, or a single value when there are no alternates.
169
+ * @param value List of alternates, or a single value.
170
+ */
171
+ constructor(value) {
172
+ __privateAdd$5(this, _Alternates_instances);
173
+ __privateAdd$5(this, _sortedValues, []);
174
+ if (Array.isArray(value)) {
175
+ __privateSet$3(this, _sortedValues, value.sort());
176
+ __privateGet$4(this, _sortedValues).sort((a, b) => __privateMethod$2(this, _Alternates_instances, compareAlternates_fn).call(this, a, b));
177
+ } else {
178
+ __privateSet$3(this, _sortedValues, [{ value }]);
179
+ }
180
+ }
181
+ getValue(alignment, sex) {
182
+ for (let index = __privateGet$4(this, _sortedValues).length; index--; ) {
183
+ const entry = __privateGet$4(this, _sortedValues)[index];
184
+ if ((entry.alignment === void 0 || entry.alignment === alignment) && (entry.sex === void 0 || entry.sex === sex)) return entry.value;
185
+ }
186
+ return this.default?.value;
187
+ }
188
+ /**
189
+ * Get the default value for this list of alternates, the value with the highest priority and lowest specificity.
190
+ */
191
+ get default() {
192
+ return __privateGet$4(this, _sortedValues)[0];
193
+ }
194
+ /**
195
+ * Get the list of alternates sorted in canonical order (alignment then sex, low to high specificity).
196
+ */
197
+ get canonical() {
198
+ return __privateGet$4(this, _sortedValues);
199
+ }
200
+ /**
201
+ * Create a joined string from the alternate values in canonical order.
202
+ * @param separator Separator to use. Default is ' / '
203
+ */
204
+ toString(separator) {
205
+ return this.canonical.map((x) => x.value).join(separator);
206
+ }
207
+ }
208
+ _sortedValues = new WeakMap();
209
+ _Alternates_instances = new WeakSet();
210
+ compareAlternates_fn = function(a, b) {
211
+ const aSpecificity = (a.alignment ? 2 : 0) + (a.sex ? 1 : 0);
212
+ const bSpecificity = (b.alignment ? 2 : 0) + (b.sex ? 1 : 0);
213
+ if (aSpecificity !== bSpecificity) return aSpecificity - bSpecificity;
214
+ const alignmentComparison = compareAlignment(a.alignment, b.alignment);
215
+ if (alignmentComparison !== 0) return alignmentComparison;
216
+ const sexComparison = compareSex(a.sex, b.sex);
217
+ if (sexComparison !== 0) return sexComparison;
218
+ return String(a.value).localeCompare(String(b.value));
219
+ };
220
+
221
+ var __typeError$4 = (msg) => {
222
+ throw TypeError(msg);
223
+ };
224
+ var __accessCheck$4 = (obj, member, msg) => member.has(obj) || __typeError$4("Cannot " + msg);
225
+ var __privateGet$3 = (obj, member, getter) => (__accessCheck$4(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
226
+ var __privateAdd$4 = (obj, member, value) => member.has(obj) ? __typeError$4("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
227
+ var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$4(obj, member, "write to private field"), member.set(obj, value), value);
228
+ var __privateMethod$1 = (obj, member, method) => (__accessCheck$4(obj, member, "access private method"), method);
229
+ var _value, _Key_instances, validateKey_fn;
230
+ const INVALID_KEY_PATTERN = /[^a-z0-9-]/;
231
+ class Key {
232
+ constructor(value) {
233
+ __privateAdd$4(this, _Key_instances);
234
+ __privateAdd$4(this, _value);
235
+ __privateMethod$1(this, _Key_instances, validateKey_fn).call(this, value);
236
+ __privateSet$2(this, _value, value);
237
+ }
238
+ get value() {
239
+ return __privateGet$3(this, _value);
240
+ }
241
+ }
242
+ _value = new WeakMap();
243
+ _Key_instances = new WeakSet();
244
+ validateKey_fn = function(key) {
245
+ if (INVALID_KEY_PATTERN.test(key)) throw new Error(`Invalid key: [${key}]; Keys can only contain lowercase characters, numbers and dashes.`);
246
+ };
247
+
248
+ var __defProp$9 = Object.defineProperty;
249
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
250
+ var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
251
+ class Archetype {
252
+ constructor(data) {
253
+ __publicField$9(this, "key");
254
+ __publicField$9(this, "name");
255
+ __publicField$9(this, "description");
256
+ this.key = new Key(data.key).value;
257
+ this.name = data.name;
258
+ this.description = data.description;
259
+ }
260
+ }
261
+
262
+ function badgeUri(target) {
263
+ const key = typeof target === "string" ? target : target.key;
264
+ return `badge://${key}`;
265
+ }
266
+ function badgeLink(target) {
267
+ const key = typeof target === "string" ? target : target.key;
268
+ return `[${key}](${badgeUri(target)})`;
269
+ }
270
+ function contactUri(target) {
271
+ const key = typeof target === "string" ? target : target.key;
272
+ return `contact://${key}`;
273
+ }
274
+ function contactLink(target) {
275
+ const key = typeof target === "string" ? target : target.key;
276
+ return `[${key}](${contactUri(target)})`;
277
+ }
278
+ function missionUri(target) {
279
+ const key = typeof target === "string" ? target : target.key;
280
+ return `mission://${key}`;
281
+ }
282
+ function missionLink(target) {
283
+ const key = typeof target === "string" ? target : target.key;
284
+ return `[${key}](${missionUri(target)})`;
285
+ }
286
+ function zoneUri(target) {
287
+ const key = typeof target === "string" ? target : target.key;
288
+ return `zone://${key}`;
289
+ }
290
+ function zoneLink(target) {
291
+ const key = typeof target === "string" ? target : target.key;
292
+ return `[${key}](${zoneUri(target)})`;
293
+ }
294
+ function coalesceToArray(value) {
295
+ if (!value) return void 0;
296
+ return Array.isArray(value) ? value : [value];
297
+ }
298
+
299
+ var __defProp$8 = Object.defineProperty;
300
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
301
+ var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
302
+ class BadgeRequirement {
303
+ constructor(data) {
304
+ /**
305
+ * Unique key used to reference this badge requirement.
306
+ *
307
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
308
+ */
309
+ __publicField$8(this, "key");
310
+ /**
311
+ * The requirement type.
312
+ */
313
+ __publicField$8(this, "type");
314
+ /**
315
+ * If the requirement involves a location, where it is.
316
+ */
317
+ __publicField$8(this, "location");
318
+ /**
319
+ * If the requirement involves a badge, the badge key.
320
+ */
321
+ __publicField$8(this, "badgeKey");
322
+ /**
323
+ * If the requirement involves a mission, the mission key.
324
+ */
325
+ __publicField$8(this, "missionKey");
326
+ /**
327
+ * If the requirement involves a monument, the text that is displayed thereon.
328
+ */
329
+ __publicField$8(this, "monumentText");
330
+ /**
331
+ * If the requirement involves crafting an invention, the Level of the invention required.
332
+ */
333
+ __publicField$8(this, "inventionLevel");
334
+ /**
335
+ * If the requirement involves crafting an invention, the types of enhancements that will qualify.
336
+ */
337
+ __publicField$8(this, "inventionTypes");
338
+ /**
339
+ * Number of times the task needs to be repeated.
340
+ */
341
+ __publicField$8(this, "count");
342
+ /**
343
+ * Additional information about the requirement.
344
+ */
345
+ __publicField$8(this, "notes");
346
+ /**
347
+ * List of external links. Wiki, forums, etc.
348
+ */
349
+ __publicField$8(this, "links");
350
+ this.key = new Key(data.key).value;
351
+ this.type = data.type;
352
+ this.location = coalesceToArray(data.location);
353
+ this.badgeKey = data.badgeKey;
354
+ this.missionKey = data.missionKey;
355
+ this.monumentText = data.monumentText;
356
+ this.inventionLevel = data.inventionLevel;
357
+ this.inventionTypes = data.inventionTypes;
358
+ this.count = data.count;
359
+ this.notes = data.notes;
360
+ this.links = data.links ?? [];
361
+ }
362
+ }
363
+
364
+ var __defProp$7 = Object.defineProperty;
365
+ var __typeError$3 = (msg) => {
366
+ throw TypeError(msg);
367
+ };
368
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
369
+ var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
370
+ var __accessCheck$3 = (obj, member, msg) => member.has(obj) || __typeError$3("Cannot " + msg);
371
+ var __privateGet$2 = (obj, member, getter) => (__accessCheck$3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
372
+ var __privateAdd$3 = (obj, member, value) => member.has(obj) ? __typeError$3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
373
+ var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$3(obj, member, "write to private field"), member.set(obj, value), value);
374
+ var _items;
375
+ class MoralityList {
376
+ constructor(items) {
377
+ __privateAdd$3(this, _items);
378
+ __publicField$7(this, "hero");
379
+ __publicField$7(this, "vigilante");
380
+ __publicField$7(this, "villain");
381
+ __publicField$7(this, "rogue");
382
+ __publicField$7(this, "resistance");
383
+ __publicField$7(this, "loyalist");
384
+ __publicField$7(this, "primal");
385
+ __publicField$7(this, "praetorian");
386
+ __publicField$7(this, "heroic");
387
+ __publicField$7(this, "villainous");
388
+ __publicField$7(this, "paragonCityAccess");
389
+ __publicField$7(this, "rogueIslesAccess");
390
+ __publicField$7(this, "all");
391
+ const set = new Set(items ?? [...MORALITY]);
392
+ this.hero = set.has("hero") || set.has("primal") || set.has("heroic") || set.has("paragon-city-access") || set.has("all");
393
+ this.vigilante = set.has("vigilante") || set.has("primal") || set.has("heroic") || set.has("paragon-city-access") || set.has("rogue-isles-access") || set.has("all");
394
+ this.villain = set.has("villain") || set.has("primal") || set.has("villainous") || set.has("rogue-isles-access") || set.has("all");
395
+ this.rogue = set.has("rogue") || set.has("primal") || set.has("villainous") || set.has("paragon-city-access") || set.has("rogue-isles-access") || set.has("all");
396
+ this.resistance = set.has("resistance") || set.has("praetorian") || set.has("all");
397
+ this.loyalist = set.has("loyalist") || set.has("praetorian") || set.has("all");
398
+ this.primal = this.hero && this.vigilante && this.villain && this.rogue;
399
+ this.praetorian = this.loyalist && this.resistance;
400
+ this.heroic = this.hero && this.vigilante;
401
+ this.villainous = this.villain && this.rogue;
402
+ this.paragonCityAccess = this.heroic && this.rogue;
403
+ this.rogueIslesAccess = this.villainous && this.vigilante;
404
+ this.all = this.primal && this.praetorian;
405
+ __privateSet$1(this, _items, /* @__PURE__ */ new Set());
406
+ if (this.hero) __privateGet$2(this, _items).add("hero");
407
+ if (this.vigilante) __privateGet$2(this, _items).add("vigilante");
408
+ if (this.villain) __privateGet$2(this, _items).add("villain");
409
+ if (this.rogue) __privateGet$2(this, _items).add("rogue");
410
+ if (this.resistance) __privateGet$2(this, _items).add("resistance");
411
+ if (this.loyalist) __privateGet$2(this, _items).add("loyalist");
412
+ }
413
+ get items() {
414
+ return [...__privateGet$2(this, _items)];
415
+ }
416
+ has(morality) {
417
+ switch (morality) {
418
+ case "hero": {
419
+ return this.hero;
420
+ }
421
+ case "vigilante": {
422
+ return this.vigilante;
423
+ }
424
+ case "villain": {
425
+ return this.villain;
426
+ }
427
+ case "rogue": {
428
+ return this.rogue;
429
+ }
430
+ case "resistance": {
431
+ return this.resistance;
432
+ }
433
+ case "loyalist": {
434
+ return this.loyalist;
435
+ }
436
+ case "primal": {
437
+ return this.primal;
438
+ }
439
+ case "praetorian": {
440
+ return this.praetorian;
441
+ }
442
+ case "heroic": {
443
+ return this.hero;
444
+ }
445
+ case "paragon-city-access": {
446
+ return this.paragonCityAccess;
447
+ }
448
+ case "rogue-isles-access": {
449
+ return this.rogueIslesAccess;
450
+ }
451
+ case "villainous": {
452
+ return this.villainous;
453
+ }
454
+ case "all": {
455
+ return this.all;
456
+ }
457
+ default: {
458
+ return false;
459
+ }
460
+ }
461
+ }
462
+ }
463
+ _items = new WeakMap();
464
+
465
+ var __defProp$6 = Object.defineProperty;
466
+ var __typeError$2 = (msg) => {
467
+ throw TypeError(msg);
468
+ };
469
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
470
+ var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
471
+ var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
472
+ var __privateGet$1 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
473
+ var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
474
+ var _requirementsIndex, _zoneKeys;
475
+ class Badge {
476
+ constructor(badgeData) {
477
+ __privateAdd$2(this, _requirementsIndex, {});
478
+ __privateAdd$2(this, _zoneKeys, /* @__PURE__ */ new Set());
479
+ /**
480
+ * The database key for this badge.
481
+ */
482
+ __publicField$6(this, "key");
483
+ /**
484
+ * The type of badge.
485
+ */
486
+ __publicField$6(this, "type");
487
+ /**
488
+ * The name of this badge.
489
+ *
490
+ * May vary by character sex or alignment.
491
+ */
492
+ __publicField$6(this, "name");
493
+ /**
494
+ * The character moralities that this badge is available to.
495
+ */
496
+ __publicField$6(this, "morality");
497
+ /**
498
+ * The badge text as it appears in-game. May vary by character sex or alignment.
499
+ */
500
+ __publicField$6(this, "badgeText");
501
+ /**
502
+ * Short description of how to acquire the badge. Detailed instructions will be in the notes field.
503
+ */
504
+ __publicField$6(this, "acquisition");
505
+ /**
506
+ * Absolute URL to this badge's icon.
507
+ *
508
+ * May vary by character sex or alignment.
509
+ */
510
+ __publicField$6(this, "icon");
511
+ /**
512
+ * Freeform notes or tips about the badge.
513
+ */
514
+ __publicField$6(this, "notes");
515
+ /**
516
+ * List of external links. Wiki, forums, etc.
517
+ */
518
+ __publicField$6(this, "links");
519
+ /**
520
+ * The id used with the in-game `/settitle` command to apply the badge.
521
+ * The first value is the id for primal characters and the (optional) second number is the id for praetorian characters.
522
+ */
523
+ __publicField$6(this, "setTitleId");
524
+ /**
525
+ * A description of the effect the badge will have, such as a buff or granting a temporary power.
526
+ */
527
+ __publicField$6(this, "effect");
528
+ /**
529
+ * Represents the requirements for badges with multiple fulfillment steps, such as visiting monuments for history badges, completing missions, or collecting other badges.
530
+ */
531
+ __publicField$6(this, "requirements");
532
+ /**
533
+ * Some badges are not included in the badge total count... such as Flames of Prometheus, which can be removed by redeeming it for a Notice of the Well.
534
+ */
535
+ __publicField$6(this, "ignoreInTotals");
536
+ this.key = new Key(badgeData.key).value;
537
+ this.type = badgeData.type;
538
+ this.name = new Alternates(badgeData.name);
539
+ this.morality = new MoralityList(coalesceToArray(badgeData.morality));
540
+ this.badgeText = new Alternates(badgeData.badgeText ?? []);
541
+ this.acquisition = badgeData.acquisition;
542
+ this.icon = new Alternates(badgeData.icon ?? []);
543
+ this.notes = badgeData.notes;
544
+ this.links = badgeData.links ?? [];
545
+ this.effect = badgeData.effect;
546
+ this.setTitleId = badgeData.setTitleId;
547
+ this.ignoreInTotals = badgeData.ignoreInTotals ?? false;
548
+ this.requirements = badgeData.requirements?.map((requirementData) => {
549
+ if (__privateGet$1(this, _requirementsIndex)[requirementData.key]) throw new Error(`Duplicate badge requirement key [${badgeData.key}:${requirementData.key}]`);
550
+ const requirement = new BadgeRequirement(requirementData);
551
+ __privateGet$1(this, _requirementsIndex)[requirement.key] = requirement;
552
+ if (requirement.location) for (const location of requirement.location) {
553
+ if (location.zoneKey) __privateGet$1(this, _zoneKeys).add(location.zoneKey);
554
+ }
555
+ return requirement;
556
+ });
557
+ }
558
+ getRequirement(key) {
559
+ const result = __privateGet$1(this, _requirementsIndex)[key];
560
+ if (result === void 0) throw new Error(`Unknown badge requirement key [${key}]`);
561
+ return result;
562
+ }
563
+ /**
564
+ * Return a list of all the zone keys referenced by this badge.
565
+ */
566
+ get zoneKeys() {
567
+ return [...__privateGet$1(this, _zoneKeys)];
568
+ }
569
+ /**
570
+ * The zone key if this badge relates to a single zone.
571
+ */
572
+ get zoneKey() {
573
+ return __privateGet$1(this, _zoneKeys).size === 1 ? __privateGet$1(this, _zoneKeys).values().next().value : void 0;
574
+ }
575
+ }
576
+ _requirementsIndex = new WeakMap();
577
+ _zoneKeys = new WeakMap();
578
+ function compareByDefaultName(a, b) {
579
+ const aName = a?.name.default?.value;
580
+ const bName = b?.name.default?.value;
581
+ if (!aName && !bName) return 0;
582
+ if (!aName) return 1;
583
+ if (!bName) return -1;
584
+ return aName.localeCompare(bName);
585
+ }
586
+ function compareByZoneKey(a, b) {
587
+ const aZone = a?.zoneKey;
588
+ const bZone = b?.zoneKey;
589
+ if (!aZone && !bZone) return 0;
590
+ if (!aZone) return 1;
591
+ if (!bZone) return -1;
592
+ return aZone.localeCompare(bZone);
593
+ }
594
+
595
+ var __defProp$5 = Object.defineProperty;
596
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
597
+ var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
598
+ class AbstractIndex {
599
+ /**
600
+ * Create a new index.
601
+ * @param keyField The field of the values that will act as the key.
602
+ * @param values Values to index.
603
+ */
604
+ constructor(keyField, values) {
605
+ __publicField$5(this, "_values", []);
606
+ __publicField$5(this, "_hashTable", {});
607
+ this._values = values ?? [];
608
+ this._hashTable = {};
609
+ for (const value of this.values) {
610
+ const key = value[keyField];
611
+ if (this._hashTable[key] !== void 0) throw new Error(`Duplicate key [${key}]`);
612
+ this._hashTable[key] = value;
613
+ }
614
+ }
615
+ /**
616
+ * Return all indexed values
617
+ */
618
+ get values() {
619
+ return this._values;
620
+ }
621
+ /**
622
+ * Get a value from the index
623
+ * @param key Key string
624
+ */
625
+ get(key) {
626
+ if (!key) return void 0;
627
+ return this._hashTable[key];
628
+ }
629
+ }
630
+
631
+ var __typeError$1 = (msg) => {
632
+ throw TypeError(msg);
633
+ };
634
+ var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
635
+ var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
636
+ var __privateMethod = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
637
+ var _BadgeIndex_instances, satisfiesQueryPredicate_fn, satisfiesFilterPredicate_fn, sort_fn;
638
+ class BadgeIndex extends AbstractIndex {
639
+ constructor(values) {
640
+ super("key", values);
641
+ __privateAdd$1(this, _BadgeIndex_instances);
642
+ }
643
+ search(options) {
644
+ const filtered = options?.query || options?.filter ? this._values.filter((badge) => __privateMethod(this, _BadgeIndex_instances, satisfiesQueryPredicate_fn).call(this, badge, options?.query) && __privateMethod(this, _BadgeIndex_instances, satisfiesFilterPredicate_fn).call(this, badge, options?.filter)) : this._values;
645
+ const totalPages = options?.pageSize ? Math.ceil(filtered.length / options?.pageSize) : 1;
646
+ const page = Math.max(1, Math.min(totalPages, options?.page ?? 1));
647
+ const paged = options?.pageSize ? filtered.slice((page - 1) * options.pageSize, page * options?.pageSize) : filtered;
648
+ const sorted = __privateMethod(this, _BadgeIndex_instances, sort_fn).call(this, paged, options?.sort);
649
+ return {
650
+ items: sorted,
651
+ page,
652
+ pageSize: options?.pageSize,
653
+ totalItems: filtered.length,
654
+ totalPages
655
+ };
656
+ }
657
+ }
658
+ _BadgeIndex_instances = new WeakSet();
659
+ satisfiesQueryPredicate_fn = function(badge, query) {
660
+ const queryString = query?.str?.toLowerCase() ?? "";
661
+ return !!((query?.on?.name ?? true) && badge.name.canonical.some((x) => x.value.toLowerCase().includes(queryString)) || query?.on?.badgeText && badge.badgeText.canonical.some((x) => x.value.toLowerCase().includes(queryString)) || query?.on?.acquisition && badge.acquisition?.toLowerCase().includes(queryString) || query?.on?.effect && badge.effect?.toLowerCase().includes(queryString) || query?.on?.notes && badge.notes?.toLowerCase().includes(queryString) || query?.on?.setTitle && badge.setTitleId?.some((x) => x?.toString().includes(queryString)));
662
+ };
663
+ satisfiesFilterPredicate_fn = function(badge, filter) {
664
+ return (!filter?.type || badge.type === filter.type) && (!filter?.zoneKey || badge.zoneKey === filter.zoneKey) && (!filter?.morality || badge.morality.has(filter.morality));
665
+ };
666
+ sort_fn = function(badges, sort) {
667
+ if (!sort) return badges;
668
+ const ascending = sort.dir !== "desc";
669
+ if (sort.by === "badge-name") return badges.sort((a, b) => ascending ? compareByDefaultName(a, b) : compareByDefaultName(b, a));
670
+ if (sort.by === "zone-key") return badges.sort((a, b) => ascending ? compareByZoneKey(a, b) : compareByZoneKey(b, a));
671
+ return sort.dir === "desc" ? badges.reverse() : badges;
672
+ };
673
+
674
+ var __defProp$4 = Object.defineProperty;
675
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
676
+ var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
677
+ class BundleHeader {
678
+ constructor(data) {
679
+ /**
680
+ * Name of the content bundle.
681
+ */
682
+ __publicField$4(this, "name");
683
+ /**
684
+ * Description of the fork.
685
+ */
686
+ __publicField$4(this, "description");
687
+ /**
688
+ * Url for the repository where the bundle is maintained.
689
+ */
690
+ __publicField$4(this, "repositoryUrl");
691
+ /**
692
+ * Url for the location of the changelog.
693
+ */
694
+ __publicField$4(this, "changelogUrl");
695
+ /**
696
+ * List of external links. Wiki, forums, etc.
697
+ */
698
+ __publicField$4(this, "links");
699
+ /**
700
+ * The current version of the data package.
701
+ */
702
+ __publicField$4(this, "version");
703
+ this.name = data?.name;
704
+ this.description = data?.description;
705
+ this.repositoryUrl = data?.repositoryUrl;
706
+ this.changelogUrl = data?.changelogUrl;
707
+ this.links = data?.links ?? [];
708
+ this.version = data?.version;
709
+ }
710
+ }
711
+
712
+ var __defProp$3 = Object.defineProperty;
713
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
714
+ var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
715
+ class Zone {
716
+ constructor(data) {
717
+ /**
718
+ * Unique key used to reference this zone.
719
+ *
720
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
721
+ */
722
+ __publicField$3(this, "key");
723
+ /**
724
+ * The name of the zone as it appears in-game.
725
+ */
726
+ __publicField$3(this, "name");
727
+ /**
728
+ * List of external links. Wiki, forums, etc.
729
+ */
730
+ __publicField$3(this, "links");
731
+ this.key = new Key(data.key).value;
732
+ this.name = data.name;
733
+ this.links = data.links ?? [];
734
+ }
735
+ }
736
+
737
+ var __defProp$2 = Object.defineProperty;
738
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
739
+ var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
740
+ class Contact {
741
+ constructor(data) {
742
+ /**
743
+ * Unique key used to reference this contact.
744
+ *
745
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
746
+ */
747
+ __publicField$2(this, "key");
748
+ /**
749
+ * The name of this contact.
750
+ */
751
+ __publicField$2(this, "name");
752
+ /**
753
+ * The contact's title.
754
+ */
755
+ __publicField$2(this, "title");
756
+ /**
757
+ * The character moralities that this contact will interact with.
758
+ */
759
+ __publicField$2(this, "morality");
760
+ /**
761
+ * The location of this contact.
762
+ */
763
+ __publicField$2(this, "location");
764
+ /**
765
+ * The level range this contact will offer missions for.
766
+ */
767
+ __publicField$2(this, "levelRange");
768
+ /**
769
+ * Freeform notes or tips about the contact.
770
+ */
771
+ __publicField$2(this, "notes");
772
+ /**
773
+ * List of external links. Wiki, forums, etc.
774
+ */
775
+ __publicField$2(this, "links");
776
+ this.key = new Key(data.key).value;
777
+ this.name = data.name;
778
+ this.title = data.title;
779
+ this.morality = new MoralityList(coalesceToArray(data.morality));
780
+ this.location = data.location;
781
+ this.levelRange = data.levelRange;
782
+ this.notes = data.notes;
783
+ this.links = data.links ?? [];
784
+ }
785
+ }
786
+
787
+ var __defProp$1 = Object.defineProperty;
788
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
789
+ var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
790
+ class Mission {
791
+ constructor(data) {
792
+ /**
793
+ * Unique key used to reference this mission.
794
+ *
795
+ * Keys must be unique and can only contain lowercase letters, numbers and hyphens (`-`).
796
+ */
797
+ __publicField$1(this, "key");
798
+ /**
799
+ * The name of the mission as it appears from the contact.
800
+ *
801
+ * The name may be different when viewed in Ouroboros as a Flashback.
802
+ */
803
+ __publicField$1(this, "name");
804
+ /**
805
+ * The type of mission... Story arc, task force, trial, etc.
806
+ */
807
+ __publicField$1(this, "type");
808
+ /**
809
+ * The character moralities that may accept the mission.
810
+ */
811
+ __publicField$1(this, "morality");
812
+ /**
813
+ * The keys of any contacts that provide this mission.
814
+ */
815
+ __publicField$1(this, "contactKeys");
816
+ /**
817
+ * The level range this mission is available for.
818
+ */
819
+ __publicField$1(this, "levelRange");
820
+ /**
821
+ * Freeform notes or tips about the mission.
822
+ */
823
+ __publicField$1(this, "notes");
824
+ /**
825
+ * List of external links. Wiki, forums, etc.
826
+ */
827
+ __publicField$1(this, "links");
828
+ /**
829
+ * If the mission is available in Ouroboros as a Flashback.
830
+ */
831
+ __publicField$1(this, "flashback");
832
+ this.key = new Key(data.key).value;
833
+ this.name = data.name;
834
+ this.type = data.type;
835
+ this.morality = new MoralityList(coalesceToArray(data.morality));
836
+ this.contactKeys = coalesceToArray(data.contactKeys);
837
+ this.levelRange = data.levelRange;
838
+ this.notes = data.notes;
839
+ this.links = data.links ?? [];
840
+ this.flashback = createFlashback(data);
841
+ }
842
+ }
843
+ function createFlashback(data) {
844
+ if (!data.flashback) return void 0;
845
+ return {
846
+ id: data.flashback.id,
847
+ levelRange: data.flashback.levelRange ?? data.levelRange,
848
+ name: data.flashback.name ?? data.name,
849
+ morality: new MoralityList(coalesceToArray(data.flashback.morality ?? data.morality)),
850
+ notes: data.flashback.notes
851
+ };
852
+ }
853
+
854
+ var __typeError = (msg) => {
855
+ throw TypeError(msg);
856
+ };
857
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
858
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
859
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
860
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
861
+ var _archetypeIndex, _zoneIndex, _contactIndex, _missionIndex, _badgeIndex, _header, _servers;
862
+ class CohContentDatabase {
863
+ /**
864
+ * Create a db instance from the given content bundle.
865
+ * @param bundle The bundle to load.
866
+ */
867
+ constructor(bundle) {
868
+ __privateAdd(this, _archetypeIndex);
869
+ __privateAdd(this, _zoneIndex);
870
+ __privateAdd(this, _contactIndex);
871
+ __privateAdd(this, _missionIndex);
872
+ __privateAdd(this, _badgeIndex);
873
+ __privateAdd(this, _header);
874
+ __privateAdd(this, _servers);
875
+ __privateSet(this, _header, new BundleHeader(bundle.header));
876
+ __privateSet(this, _servers, bundle.servers ?? []);
877
+ __privateSet(this, _archetypeIndex, new AbstractIndex("key", bundle.archetypes?.map((x) => new Archetype(x))));
878
+ __privateSet(this, _zoneIndex, new AbstractIndex("key", bundle.zones?.map((x) => new Zone(x))));
879
+ __privateSet(this, _contactIndex, new AbstractIndex("key", bundle.contacts?.map((x) => new Contact(x))));
880
+ __privateSet(this, _missionIndex, new AbstractIndex("key", bundle.missions?.map((x) => new Mission(x))));
881
+ __privateSet(this, _badgeIndex, new BadgeIndex(bundle.badges?.map((x) => new Badge(x))));
882
+ }
883
+ /**
884
+ * Header information about the content bundle.
885
+ */
886
+ get header() {
887
+ return __privateGet(this, _header);
888
+ }
889
+ /**
890
+ * List of the game server names.
891
+ *
892
+ * Torchbearer, Excelsior, etc.
893
+ */
894
+ get servers() {
895
+ return __privateGet(this, _servers);
896
+ }
897
+ /**
898
+ * List of archetypes.
899
+ */
900
+ get archetypes() {
901
+ return __privateGet(this, _archetypeIndex).values;
902
+ }
903
+ /**
904
+ * Get archetype by key.
905
+ * @param key The key.
906
+ */
907
+ getArchetype(key) {
908
+ return __privateGet(this, _archetypeIndex).get(key);
909
+ }
910
+ /**
911
+ * List of game zones.
912
+ */
913
+ get zones() {
914
+ return __privateGet(this, _zoneIndex).values;
915
+ }
916
+ /**
917
+ * Get zone by key.
918
+ * @param key The key.
919
+ */
920
+ getZone(key) {
921
+ return __privateGet(this, _zoneIndex).get(key);
922
+ }
923
+ /**
924
+ * List of contacts.
925
+ */
926
+ get contacts() {
927
+ return __privateGet(this, _contactIndex).values;
928
+ }
929
+ /**
930
+ * Get contact by key.
931
+ * @param key The key.
932
+ */
933
+ getContact(key) {
934
+ return __privateGet(this, _contactIndex).get(key);
935
+ }
936
+ /**
937
+ * List of missions.
938
+ */
939
+ get missions() {
940
+ return __privateGet(this, _missionIndex).values;
941
+ }
942
+ /**
943
+ * Get mission by key.
944
+ * @param key The key.
945
+ */
946
+ getMission(key) {
947
+ return __privateGet(this, _missionIndex).get(key);
948
+ }
949
+ /**
950
+ * List of badges.
951
+ */
952
+ get badges() {
953
+ return __privateGet(this, _badgeIndex).values;
954
+ }
955
+ /**
956
+ * Get badge by key.
957
+ * @param key The key.
958
+ */
959
+ getBadge(key) {
960
+ return __privateGet(this, _badgeIndex).get(key);
961
+ }
962
+ /**
963
+ * Search, sort and filter the badge list.
964
+ * This is a fairly brute-forced approach and will not be as performant as loading the badge data into a traditional
965
+ * database engine, but is sufficient for most operations.
966
+ * @param options {@link BadgeSearchOptions}
967
+ */
968
+ searchBadges(options) {
969
+ return __privateGet(this, _badgeIndex).search(options);
970
+ }
971
+ }
972
+ _archetypeIndex = new WeakMap();
973
+ _zoneIndex = new WeakMap();
974
+ _contactIndex = new WeakMap();
975
+ _missionIndex = new WeakMap();
976
+ _badgeIndex = new WeakMap();
977
+ _header = new WeakMap();
978
+ _servers = new WeakMap();
979
+
980
+ var __defProp = Object.defineProperty;
981
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
982
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
983
+ class Location {
984
+ constructor(data) {
985
+ /**
986
+ * Key of the {@link Zone} that the location references.
987
+ */
988
+ __publicField(this, "zoneKey");
989
+ /**
990
+ * In-game `/loc` coordinates of the location.
991
+ */
992
+ __publicField(this, "coords");
993
+ /**
994
+ * The type of icon to use if the location appears on a map. (Typically the Vidiot map icon).
995
+ */
996
+ __publicField(this, "icon");
997
+ /**
998
+ * The text that should appear in the location icon. (Typically a number or symbol from the Vidiot map).
999
+ */
1000
+ __publicField(this, "iconText");
1001
+ this.zoneKey = data.zoneKey;
1002
+ this.coords = data.coords;
1003
+ this.icon = data.icon;
1004
+ this.iconText = data.iconText;
1005
+ }
1006
+ }
1007
+
1008
+ export { ALIGNMENT, AlignmentList, Alternates, Archetype, BADGE_REQUIREMENT_TYPE, BADGE_TYPE, Badge, BadgeIndex, BadgeRequirement, BundleHeader, CohContentDatabase, Contact, ENHANCEMENT_CATEGORY, Key, Location, MISSION_TYPE, MORALITY, Mission, MoralityList, SEX, Zone, badgeLink, badgeUri, coalesceToArray, compareAlignment, compareByDefaultName, compareByZoneKey, compareSex, contactLink, contactUri, missionLink, missionUri, zoneLink, zoneUri };
1009
+ //# sourceMappingURL=coh-content-db.mjs.map