@treeviz/gedcom-parser 1.0.19 → 1.0.21
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/dist/classes/index.d.ts +1 -1
- package/dist/classes/index.js +151 -45
- package/dist/cli/index.js +151 -45
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +150 -44
- package/dist/factories/index.d.ts +2 -2
- package/dist/factories/index.js +150 -44
- package/dist/{index-BnFjCzJz.d.ts → index-BPEVN_DY.d.ts} +19 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +151 -45
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/kinship-translator/index.d.ts +2 -2
- package/dist/kinship-translator/index.js +150 -44
- package/dist/{place-parser-ChkPI4pQ.d.ts → place-parser-CM0TJFj8.d.ts} +1 -1
- package/dist/place-translator-CRiaOO9v.d.ts +88 -0
- package/dist/structures/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.d.ts +14 -86
- package/dist/utils/index.js +152 -46
- package/package.json +1 -1
package/dist/classes/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ao as Common, az as CommonDate,
|
|
1
|
+
export { ao as Common, az as CommonDate, aR as CommonName, aT as CommonNote, an as CustomTags, am as Existed, aC as Fam, aj as FamType, aE as Families, aL as FamilySearchMatch, aM as FamilySearchSource, aF as GedCom, ak as GedComType, a3 as GenealogyMember, aa as GenerationIndiType, a9 as GenerationSpouseType, aK as Indi, a5 as IndiGenealogy, ab as IndiGenealogyGenerations, ac as IndiGenealogyResult, a6 as IndiMarker, a4 as IndiTree, a1 as IndiType, aP as Individuals, aQ as List, a8 as MemberMain, a7 as MemberSide, ad as NonNullIndiGenealogyResult, aV as Obje, al as ObjeType, aX as Objects, af as Path, ae as PathItem, aN as ProfilePicture, Z as ProxyOriginal, ai as Queue, ah as QueueItem, ag as ReducedPath, aY as Repo, $ as RepoType, a_ as Repositories, a$ as Sour, _ as SourType, b1 as Sources, b2 as Subm, a0 as SubmType, b4 as Submitters, a2 as TreeMember, aq as createCommon, aA as createCommonDate, aS as createCommonName, aU as createCommonNote, aD as createFam, aG as createGedCom, aO as createIndi, aW as createObje, ap as createProxy, aZ as createRepo, b0 as createSour, b3 as createSubm, av as getListTag, aw as getValidKey, at as getValidKeys, au as getValidTag, ay as idGetter, aB as isCommonDate, aH as isGedcomString, ax as isId, ar as isOnlyMainProp, as as isValidKey, aJ as mergeGedcoms, aI as validateGedcomContent } from '../index-BPEVN_DY.js';
|
|
2
2
|
import 'date-fns';
|
package/dist/classes/index.js
CHANGED
|
@@ -3158,6 +3158,27 @@ var getPlaces = (common, type = ["ALL" /* All */], maxLevel = 1, level = 0, main
|
|
|
3158
3158
|
};
|
|
3159
3159
|
var implemented = (type, ...args) => {
|
|
3160
3160
|
};
|
|
3161
|
+
|
|
3162
|
+
// src/utils/media-utils.ts
|
|
3163
|
+
var getFileExtension = (filename) => {
|
|
3164
|
+
const match = filename.match(/\.([^.]+)$/);
|
|
3165
|
+
return match ? match[1] : "";
|
|
3166
|
+
};
|
|
3167
|
+
var isImageFormat = (format2) => {
|
|
3168
|
+
if (!format2) return false;
|
|
3169
|
+
const imageFormats = [
|
|
3170
|
+
"jpg",
|
|
3171
|
+
"jpeg",
|
|
3172
|
+
"png",
|
|
3173
|
+
"gif",
|
|
3174
|
+
"bmp",
|
|
3175
|
+
"webp",
|
|
3176
|
+
"svg",
|
|
3177
|
+
"tiff",
|
|
3178
|
+
"tif"
|
|
3179
|
+
];
|
|
3180
|
+
return imageFormats.includes(format2.toLowerCase());
|
|
3181
|
+
};
|
|
3161
3182
|
var uniqueItemsCache = /* @__PURE__ */ new WeakMap();
|
|
3162
3183
|
var setNestedGroup = (obj, key, value, uniqueCounting = true) => {
|
|
3163
3184
|
const parts = Array.isArray(key) ? key : key.split(/,\s*/);
|
|
@@ -4340,54 +4361,62 @@ var Indi = class extends Common {
|
|
|
4340
4361
|
}
|
|
4341
4362
|
async ancestryMedia(namespace) {
|
|
4342
4363
|
const list = {};
|
|
4343
|
-
const
|
|
4364
|
+
const objeList = this.get("OBJE")?.toList();
|
|
4344
4365
|
const www = this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
|
|
4345
4366
|
const tree = this.getAncestryTreeId();
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
let url = obje?.get("FILE")?.toValue();
|
|
4356
|
-
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
4357
|
-
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
4358
|
-
const imgId = clone || mser;
|
|
4359
|
-
if (!www || !tree || !this.id) {
|
|
4360
|
-
return;
|
|
4361
|
-
}
|
|
4362
|
-
if (!namespace && !url) {
|
|
4363
|
-
try {
|
|
4364
|
-
const mediaDetailsResponse = await fetch(
|
|
4365
|
-
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
4366
|
-
);
|
|
4367
|
-
const mediaDetails = await mediaDetailsResponse.json();
|
|
4368
|
-
if (mediaDetails.url) {
|
|
4369
|
-
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
4367
|
+
if (objeList) {
|
|
4368
|
+
await Promise.all(
|
|
4369
|
+
objeList.map(async (objeRef) => {
|
|
4370
|
+
const key = objeRef?.id;
|
|
4371
|
+
const obje = objeRef?.standardizeMedia(
|
|
4372
|
+
namespace,
|
|
4373
|
+
true,
|
|
4374
|
+
(ns, iId) => {
|
|
4375
|
+
return ns && iId ? `https://mediasvc.ancestry.com/v2/image/namespaces/${ns}/media/${iId}?client=trees-mediaservice&imageQuality=hq` : void 0;
|
|
4370
4376
|
}
|
|
4371
|
-
|
|
4377
|
+
);
|
|
4378
|
+
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
4379
|
+
const media = obje?.RIN?.value;
|
|
4380
|
+
const clone = obje?.get("_CLON._OID")?.toValue();
|
|
4381
|
+
const mser = obje?.get("_MSER._LKID")?.toValue();
|
|
4382
|
+
let url = obje?.get("FILE")?.toValue();
|
|
4383
|
+
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
4384
|
+
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
4385
|
+
const imgId = clone || mser;
|
|
4386
|
+
if (!www || !tree || !this.id) {
|
|
4387
|
+
return;
|
|
4372
4388
|
}
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
url
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4389
|
+
if (!namespace && !url) {
|
|
4390
|
+
try {
|
|
4391
|
+
const mediaDetailsResponse = await fetch(
|
|
4392
|
+
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
4393
|
+
);
|
|
4394
|
+
const mediaDetails = await mediaDetailsResponse.json();
|
|
4395
|
+
if (mediaDetails.url) {
|
|
4396
|
+
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
4397
|
+
}
|
|
4398
|
+
} catch (_e) {
|
|
4399
|
+
}
|
|
4400
|
+
url = url || `https://${www}/mediaui-viewer/tree/${tree}/media/${media}`;
|
|
4401
|
+
}
|
|
4402
|
+
if (url && imgId) {
|
|
4403
|
+
const id = `${tree}-${this.id}-${imgId}`;
|
|
4404
|
+
list[id] = {
|
|
4405
|
+
key,
|
|
4406
|
+
isPrimary,
|
|
4407
|
+
id,
|
|
4408
|
+
tree,
|
|
4409
|
+
imgId,
|
|
4410
|
+
person: this.id,
|
|
4411
|
+
title,
|
|
4412
|
+
url,
|
|
4413
|
+
contentType: type,
|
|
4414
|
+
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName().replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
4415
|
+
};
|
|
4416
|
+
}
|
|
4417
|
+
})
|
|
4418
|
+
);
|
|
4419
|
+
}
|
|
4391
4420
|
return list;
|
|
4392
4421
|
}
|
|
4393
4422
|
myheritageLink(poolId = 0) {
|
|
@@ -4425,6 +4454,7 @@ var Indi = class extends Common {
|
|
|
4425
4454
|
if (url && imgId) {
|
|
4426
4455
|
const id = `${tree}-${this.id}-${imgId}`;
|
|
4427
4456
|
list[id] = {
|
|
4457
|
+
isPrimary: false,
|
|
4428
4458
|
key,
|
|
4429
4459
|
id,
|
|
4430
4460
|
tree,
|
|
@@ -4534,6 +4564,36 @@ var Indi = class extends Common {
|
|
|
4534
4564
|
}
|
|
4535
4565
|
return void 0;
|
|
4536
4566
|
}
|
|
4567
|
+
async getProfilePicture(namespace) {
|
|
4568
|
+
const mediaList = await this.multimedia(namespace);
|
|
4569
|
+
if (!mediaList) {
|
|
4570
|
+
return void 0;
|
|
4571
|
+
}
|
|
4572
|
+
const mediaArray = Object.values(mediaList);
|
|
4573
|
+
const primaryMedia = mediaArray.find(
|
|
4574
|
+
(media) => media.isPrimary && isImageFormat(media.contentType || getFileExtension(media.url))
|
|
4575
|
+
);
|
|
4576
|
+
if (primaryMedia) {
|
|
4577
|
+
return {
|
|
4578
|
+
file: primaryMedia.url,
|
|
4579
|
+
form: primaryMedia.contentType,
|
|
4580
|
+
title: primaryMedia.title,
|
|
4581
|
+
isPrimary: true
|
|
4582
|
+
};
|
|
4583
|
+
}
|
|
4584
|
+
const secondaryMedia = mediaArray.find(
|
|
4585
|
+
(media) => isImageFormat(media.contentType || getFileExtension(media.url))
|
|
4586
|
+
);
|
|
4587
|
+
if (secondaryMedia) {
|
|
4588
|
+
return {
|
|
4589
|
+
file: secondaryMedia.url,
|
|
4590
|
+
form: secondaryMedia.contentType,
|
|
4591
|
+
title: secondaryMedia.title,
|
|
4592
|
+
isPrimary: false
|
|
4593
|
+
};
|
|
4594
|
+
}
|
|
4595
|
+
return void 0;
|
|
4596
|
+
}
|
|
4537
4597
|
link(poolId) {
|
|
4538
4598
|
if (this?.isAncestry()) {
|
|
4539
4599
|
return this.ancestryLink();
|
|
@@ -4626,6 +4686,52 @@ var Indi = class extends Common {
|
|
|
4626
4686
|
const deathEvent = this.get("DEAT")?.index(0);
|
|
4627
4687
|
return deathEvent?.PLAC?.value;
|
|
4628
4688
|
}
|
|
4689
|
+
/**
|
|
4690
|
+
* Get all marriage places for this individual
|
|
4691
|
+
* @returns Array of marriage place strings (may include undefined for marriages without place)
|
|
4692
|
+
*/
|
|
4693
|
+
getMarriagePlaces() {
|
|
4694
|
+
const marriagePlaces = [];
|
|
4695
|
+
const families = this.getFamilies("FAMS");
|
|
4696
|
+
families.forEach((family) => {
|
|
4697
|
+
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(
|
|
4698
|
+
Boolean
|
|
4699
|
+
);
|
|
4700
|
+
if (marrEvents.length === 0) {
|
|
4701
|
+
marriagePlaces.push(void 0);
|
|
4702
|
+
} else {
|
|
4703
|
+
marrEvents.forEach((marrEvent) => {
|
|
4704
|
+
const marriageEventDetail = marrEvent;
|
|
4705
|
+
const marriagePlace = marriageEventDetail?.PLAC?.value;
|
|
4706
|
+
marriagePlaces.push(marriagePlace);
|
|
4707
|
+
});
|
|
4708
|
+
}
|
|
4709
|
+
});
|
|
4710
|
+
return marriagePlaces;
|
|
4711
|
+
}
|
|
4712
|
+
/**
|
|
4713
|
+
* Get all marriage dates for this individual
|
|
4714
|
+
* @returns Array of marriage date strings (may include undefined for marriages without date)
|
|
4715
|
+
*/
|
|
4716
|
+
getMarriageDates() {
|
|
4717
|
+
const marriageDates = [];
|
|
4718
|
+
const families = this.getFamilies("FAMS");
|
|
4719
|
+
families.forEach((family) => {
|
|
4720
|
+
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(
|
|
4721
|
+
Boolean
|
|
4722
|
+
);
|
|
4723
|
+
if (marrEvents.length === 0) {
|
|
4724
|
+
marriageDates.push(void 0);
|
|
4725
|
+
} else {
|
|
4726
|
+
marrEvents.forEach((marrEvent) => {
|
|
4727
|
+
const marriageEventDetail = marrEvent;
|
|
4728
|
+
const marriageDate = marriageEventDetail?.DATE?.value;
|
|
4729
|
+
marriageDates.push(marriageDate);
|
|
4730
|
+
});
|
|
4731
|
+
}
|
|
4732
|
+
});
|
|
4733
|
+
return marriageDates;
|
|
4734
|
+
}
|
|
4629
4735
|
isDead() {
|
|
4630
4736
|
return this.get("DEAT.DATE")?.toValue() !== void 0 || this.get("DEAT.PLAC")?.toValue() !== void 0;
|
|
4631
4737
|
}
|
|
@@ -5777,7 +5883,7 @@ var createIndi = (gedcom, id, main, parent) => {
|
|
|
5777
5883
|
|
|
5778
5884
|
// package.json
|
|
5779
5885
|
var package_default = {
|
|
5780
|
-
version: "1.0.
|
|
5886
|
+
version: "1.0.21"};
|
|
5781
5887
|
|
|
5782
5888
|
// src/utils/get-product-details.ts
|
|
5783
5889
|
var getVersion = () => package_default.version;
|
package/dist/cli/index.js
CHANGED
|
@@ -1287,6 +1287,27 @@ var getPlaces = (common, type = ["ALL" /* All */], maxLevel = 1, level = 0, main
|
|
|
1287
1287
|
var implemented = (type, ...args) => {
|
|
1288
1288
|
};
|
|
1289
1289
|
|
|
1290
|
+
// src/utils/media-utils.ts
|
|
1291
|
+
var getFileExtension = (filename) => {
|
|
1292
|
+
const match = filename.match(/\.([^.]+)$/);
|
|
1293
|
+
return match ? match[1] : "";
|
|
1294
|
+
};
|
|
1295
|
+
var isImageFormat = (format2) => {
|
|
1296
|
+
if (!format2) return false;
|
|
1297
|
+
const imageFormats = [
|
|
1298
|
+
"jpg",
|
|
1299
|
+
"jpeg",
|
|
1300
|
+
"png",
|
|
1301
|
+
"gif",
|
|
1302
|
+
"bmp",
|
|
1303
|
+
"webp",
|
|
1304
|
+
"svg",
|
|
1305
|
+
"tiff",
|
|
1306
|
+
"tif"
|
|
1307
|
+
];
|
|
1308
|
+
return imageFormats.includes(format2.toLowerCase());
|
|
1309
|
+
};
|
|
1310
|
+
|
|
1290
1311
|
// src/classes/name.ts
|
|
1291
1312
|
var CommonName = class extends Common {
|
|
1292
1313
|
constructor(gedcom, id, main, parent) {
|
|
@@ -1906,54 +1927,62 @@ var Indi = class extends Common {
|
|
|
1906
1927
|
}
|
|
1907
1928
|
async ancestryMedia(namespace) {
|
|
1908
1929
|
const list = {};
|
|
1909
|
-
const
|
|
1930
|
+
const objeList = this.get("OBJE")?.toList();
|
|
1910
1931
|
const www = this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
|
|
1911
1932
|
const tree = this.getAncestryTreeId();
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
let url = obje?.get("FILE")?.toValue();
|
|
1922
|
-
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
1923
|
-
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
1924
|
-
const imgId = clone || mser;
|
|
1925
|
-
if (!www || !tree || !this.id) {
|
|
1926
|
-
return;
|
|
1927
|
-
}
|
|
1928
|
-
if (!namespace && !url) {
|
|
1929
|
-
try {
|
|
1930
|
-
const mediaDetailsResponse = await fetch(
|
|
1931
|
-
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
1932
|
-
);
|
|
1933
|
-
const mediaDetails = await mediaDetailsResponse.json();
|
|
1934
|
-
if (mediaDetails.url) {
|
|
1935
|
-
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
1933
|
+
if (objeList) {
|
|
1934
|
+
await Promise.all(
|
|
1935
|
+
objeList.map(async (objeRef) => {
|
|
1936
|
+
const key = objeRef?.id;
|
|
1937
|
+
const obje = objeRef?.standardizeMedia(
|
|
1938
|
+
namespace,
|
|
1939
|
+
true,
|
|
1940
|
+
(ns, iId) => {
|
|
1941
|
+
return ns && iId ? `https://mediasvc.ancestry.com/v2/image/namespaces/${ns}/media/${iId}?client=trees-mediaservice&imageQuality=hq` : void 0;
|
|
1936
1942
|
}
|
|
1937
|
-
|
|
1943
|
+
);
|
|
1944
|
+
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
1945
|
+
const media = obje?.RIN?.value;
|
|
1946
|
+
const clone = obje?.get("_CLON._OID")?.toValue();
|
|
1947
|
+
const mser = obje?.get("_MSER._LKID")?.toValue();
|
|
1948
|
+
let url = obje?.get("FILE")?.toValue();
|
|
1949
|
+
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
1950
|
+
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
1951
|
+
const imgId = clone || mser;
|
|
1952
|
+
if (!www || !tree || !this.id) {
|
|
1953
|
+
return;
|
|
1938
1954
|
}
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
url
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1955
|
+
if (!namespace && !url) {
|
|
1956
|
+
try {
|
|
1957
|
+
const mediaDetailsResponse = await fetch(
|
|
1958
|
+
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
1959
|
+
);
|
|
1960
|
+
const mediaDetails = await mediaDetailsResponse.json();
|
|
1961
|
+
if (mediaDetails.url) {
|
|
1962
|
+
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
1963
|
+
}
|
|
1964
|
+
} catch (_e) {
|
|
1965
|
+
}
|
|
1966
|
+
url = url || `https://${www}/mediaui-viewer/tree/${tree}/media/${media}`;
|
|
1967
|
+
}
|
|
1968
|
+
if (url && imgId) {
|
|
1969
|
+
const id = `${tree}-${this.id}-${imgId}`;
|
|
1970
|
+
list[id] = {
|
|
1971
|
+
key,
|
|
1972
|
+
isPrimary,
|
|
1973
|
+
id,
|
|
1974
|
+
tree,
|
|
1975
|
+
imgId,
|
|
1976
|
+
person: this.id,
|
|
1977
|
+
title,
|
|
1978
|
+
url,
|
|
1979
|
+
contentType: type,
|
|
1980
|
+
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName().replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1983
|
+
})
|
|
1984
|
+
);
|
|
1985
|
+
}
|
|
1957
1986
|
return list;
|
|
1958
1987
|
}
|
|
1959
1988
|
myheritageLink(poolId = 0) {
|
|
@@ -1991,6 +2020,7 @@ var Indi = class extends Common {
|
|
|
1991
2020
|
if (url && imgId) {
|
|
1992
2021
|
const id = `${tree}-${this.id}-${imgId}`;
|
|
1993
2022
|
list[id] = {
|
|
2023
|
+
isPrimary: false,
|
|
1994
2024
|
key,
|
|
1995
2025
|
id,
|
|
1996
2026
|
tree,
|
|
@@ -2100,6 +2130,36 @@ var Indi = class extends Common {
|
|
|
2100
2130
|
}
|
|
2101
2131
|
return void 0;
|
|
2102
2132
|
}
|
|
2133
|
+
async getProfilePicture(namespace) {
|
|
2134
|
+
const mediaList = await this.multimedia(namespace);
|
|
2135
|
+
if (!mediaList) {
|
|
2136
|
+
return void 0;
|
|
2137
|
+
}
|
|
2138
|
+
const mediaArray = Object.values(mediaList);
|
|
2139
|
+
const primaryMedia = mediaArray.find(
|
|
2140
|
+
(media) => media.isPrimary && isImageFormat(media.contentType || getFileExtension(media.url))
|
|
2141
|
+
);
|
|
2142
|
+
if (primaryMedia) {
|
|
2143
|
+
return {
|
|
2144
|
+
file: primaryMedia.url,
|
|
2145
|
+
form: primaryMedia.contentType,
|
|
2146
|
+
title: primaryMedia.title,
|
|
2147
|
+
isPrimary: true
|
|
2148
|
+
};
|
|
2149
|
+
}
|
|
2150
|
+
const secondaryMedia = mediaArray.find(
|
|
2151
|
+
(media) => isImageFormat(media.contentType || getFileExtension(media.url))
|
|
2152
|
+
);
|
|
2153
|
+
if (secondaryMedia) {
|
|
2154
|
+
return {
|
|
2155
|
+
file: secondaryMedia.url,
|
|
2156
|
+
form: secondaryMedia.contentType,
|
|
2157
|
+
title: secondaryMedia.title,
|
|
2158
|
+
isPrimary: false
|
|
2159
|
+
};
|
|
2160
|
+
}
|
|
2161
|
+
return void 0;
|
|
2162
|
+
}
|
|
2103
2163
|
link(poolId) {
|
|
2104
2164
|
if (this?.isAncestry()) {
|
|
2105
2165
|
return this.ancestryLink();
|
|
@@ -2192,6 +2252,52 @@ var Indi = class extends Common {
|
|
|
2192
2252
|
const deathEvent = this.get("DEAT")?.index(0);
|
|
2193
2253
|
return deathEvent?.PLAC?.value;
|
|
2194
2254
|
}
|
|
2255
|
+
/**
|
|
2256
|
+
* Get all marriage places for this individual
|
|
2257
|
+
* @returns Array of marriage place strings (may include undefined for marriages without place)
|
|
2258
|
+
*/
|
|
2259
|
+
getMarriagePlaces() {
|
|
2260
|
+
const marriagePlaces = [];
|
|
2261
|
+
const families = this.getFamilies("FAMS");
|
|
2262
|
+
families.forEach((family) => {
|
|
2263
|
+
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(
|
|
2264
|
+
Boolean
|
|
2265
|
+
);
|
|
2266
|
+
if (marrEvents.length === 0) {
|
|
2267
|
+
marriagePlaces.push(void 0);
|
|
2268
|
+
} else {
|
|
2269
|
+
marrEvents.forEach((marrEvent) => {
|
|
2270
|
+
const marriageEventDetail = marrEvent;
|
|
2271
|
+
const marriagePlace = marriageEventDetail?.PLAC?.value;
|
|
2272
|
+
marriagePlaces.push(marriagePlace);
|
|
2273
|
+
});
|
|
2274
|
+
}
|
|
2275
|
+
});
|
|
2276
|
+
return marriagePlaces;
|
|
2277
|
+
}
|
|
2278
|
+
/**
|
|
2279
|
+
* Get all marriage dates for this individual
|
|
2280
|
+
* @returns Array of marriage date strings (may include undefined for marriages without date)
|
|
2281
|
+
*/
|
|
2282
|
+
getMarriageDates() {
|
|
2283
|
+
const marriageDates = [];
|
|
2284
|
+
const families = this.getFamilies("FAMS");
|
|
2285
|
+
families.forEach((family) => {
|
|
2286
|
+
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(
|
|
2287
|
+
Boolean
|
|
2288
|
+
);
|
|
2289
|
+
if (marrEvents.length === 0) {
|
|
2290
|
+
marriageDates.push(void 0);
|
|
2291
|
+
} else {
|
|
2292
|
+
marrEvents.forEach((marrEvent) => {
|
|
2293
|
+
const marriageEventDetail = marrEvent;
|
|
2294
|
+
const marriageDate = marriageEventDetail?.DATE?.value;
|
|
2295
|
+
marriageDates.push(marriageDate);
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
});
|
|
2299
|
+
return marriageDates;
|
|
2300
|
+
}
|
|
2195
2301
|
isDead() {
|
|
2196
2302
|
return this.get("DEAT.DATE")?.toValue() !== void 0 || this.get("DEAT.PLAC")?.toValue() !== void 0;
|
|
2197
2303
|
}
|
|
@@ -5770,7 +5876,7 @@ var Families = class _Families extends List {
|
|
|
5770
5876
|
|
|
5771
5877
|
// package.json
|
|
5772
5878
|
var package_default = {
|
|
5773
|
-
version: "1.0.
|
|
5879
|
+
version: "1.0.21"};
|
|
5774
5880
|
|
|
5775
5881
|
// src/utils/get-product-details.ts
|
|
5776
5882
|
var isDevelopment = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as Filter, y as RequiredFilter, W as RelationType, X as PartnerType, A as Order, K as NameOrder, B as OrderIterator, a1 as IndiType, n as IndiKey } from '../index-
|
|
1
|
+
import { x as Filter, y as RequiredFilter, W as RelationType, X as PartnerType, A as Order, K as NameOrder, B as OrderIterator, a1 as IndiType, n as IndiKey } from '../index-BPEVN_DY.js';
|
|
2
2
|
import 'date-fns';
|
|
3
3
|
|
|
4
4
|
/**
|