@museumwnf/viewer-layout 3.80.1 → 3.80.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@museumwnf/viewer-layout",
3
- "version": "3.80.1",
3
+ "version": "3.80.2",
4
4
  "description": "Page structure for MWNF websites: PageShell composing seven optional, token-styled sections, the content components a page is made of, and the composed views a website names instead of writing a page.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -54,10 +54,15 @@
54
54
  "@museumwnf/viewer-core": "^2.24.0",
55
55
  "@vitejs/plugin-vue": "^6.0.10",
56
56
  "@vue/test-utils": "^2.5.1",
57
- "jsdom": "^30.1.3",
58
- "vite": "^8.3.5",
57
+ "jsdom": "^31.0.1",
58
+ "vite": "^8.4.0",
59
59
  "vitest": "^5.1.0",
60
- "vue": "^3.5.44",
60
+ "vue": "^3.5.46",
61
61
  "vue-router": "^5.4.0"
62
+ },
63
+ "overrides": {
64
+ "glob": "^14.0.7",
65
+ "editorconfig": "^4.0.2",
66
+ "minimatch": "^11.0.10"
62
67
  }
63
68
  }
@@ -1,662 +0,0 @@
1
- import { i as e, n as t, o as n, r, s as i, t as a } from "./OnDisplayIn-BH3Bqope.js";
2
- import { c as o, d as s, r as c } from "./PartnerMap-DdyMLtgH.js";
3
- import { n as l } from "./TimelineEventList-CIkKxyQu.js";
4
- import { t as u } from "./RecordView-CBC7tBCX.js";
5
- import { t as d } from "./chrome-Bv_mLlHM.js";
6
- import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, guardReactiveProps as x, normalizeClass as S, normalizeProps as C, normalizeStyle as w, openBlock as T, renderList as E, renderSlot as D, toDisplayString as O, unref as k, useSlots as A, withCtx as j } from "vue";
7
- import { NotFoundView as ee, byId as te, loadEntities as ne, mdInline as M, mdStrip as re, mwnfLinks as N, partnerView as ie, renderInline as P, siblingSiteUrl as F, sourceUrl as I, useCatalogue as L, useDataPackage as R, useI18n as z, useProjects as B, useSiteConfig as V } from "@museumwnf/viewer-core";
8
- import { RouterLink as H, useRoute as U } from "vue-router";
9
- // src/dxa/RelatedObjects.vue
10
- var W = {
11
- key: 0,
12
- class: "mwnf-related-objects"
13
- }, G = {
14
- key: 0,
15
- class: "mwnf-related-objects__heading"
16
- }, ae = { class: "mwnf-related-objects__tiles" }, oe = ["src"], K = {
17
- key: 1,
18
- class: "mwnf-related-objects__empty",
19
- "aria-hidden": "true"
20
- }, q = ["innerHTML"], se = {
21
- class: "mwnf-related-objects__tooltip",
22
- "aria-hidden": "true"
23
- }, ce = ["innerHTML"], le = { key: 0 }, ue = {
24
- __name: "RelatedObjects",
25
- props: {
26
- heading: {
27
- type: String,
28
- default: ""
29
- },
30
- tiles: {
31
- type: Array,
32
- default: () => []
33
- }
34
- },
35
- setup(e) {
36
- return (t, n) => e.tiles.length ? (T(), g("div", W, [e.heading ? (T(), g("p", G, O(e.heading), 1)) : h("", !0), _("ul", ae, [(T(!0), g(f, null, E(e.tiles, (e) => (T(), g("li", {
37
- key: e.id,
38
- class: "mwnf-related-objects__tile"
39
- }, [b(s, {
40
- to: e.to,
41
- href: e.href,
42
- external: !!e.href,
43
- class: "mwnf-related-objects__link"
44
- }, {
45
- default: j(() => [e.image ? (T(), g("img", {
46
- key: 0,
47
- src: e.image,
48
- alt: "",
49
- loading: "lazy"
50
- }, null, 8, oe)) : (T(), g("span", K)), _("span", {
51
- class: "mwnf-related-objects__name-sr",
52
- innerHTML: e.name
53
- }, null, 8, q)]),
54
- _: 2
55
- }, 1032, [
56
- "to",
57
- "href",
58
- "external"
59
- ]), _("div", se, [_("div", null, [_("span", { innerHTML: e.name }, null, 8, ce), e.country ? (T(), g(f, { key: 0 }, [y(", " + O(e.country), 1)], 64)) : h("", !0)]), e.justification ? (T(), g("div", le, O(e.justification), 1)) : h("", !0)])]))), 128))])])) : h("", !0);
60
- }
61
- }, de = {
62
- key: 0,
63
- class: "mwnf-sheet-source"
64
- }, fe = {
65
- key: 0,
66
- class: "mwnf-sheet-source__line"
67
- }, pe = {
68
- key: 1,
69
- class: "mwnf-sheet-source__collection"
70
- }, me = ["href"], he = {
71
- key: 1,
72
- class: "mwnf-sheet-notice"
73
- }, ge = {
74
- key: "museum",
75
- class: "mwnf-sheet-museum"
76
- }, _e = ["innerHTML"], ve = {
77
- key: 0,
78
- class: "mwnf-sheet-related"
79
- }, ye = {
80
- key: 0,
81
- class: "mwnf-sheet-related__heading mwnf-sheet-related__heading--caps"
82
- }, be = {
83
- key: 1,
84
- class: "mwnf-sheet-related__description"
85
- }, xe = {
86
- key: 0,
87
- class: "mwnf-sheet-related__references"
88
- }, Se = {
89
- key: 2,
90
- class: "mwnf-sheet-related__unresolved"
91
- }, Ce = {
92
- key: 5,
93
- class: "mwnf-sheet-related__line"
94
- }, we = ["href"], Te = { class: "mwnf-sheet-related__heading" }, Ee = ["href"], De = { key: 11 }, Oe = { class: "mwnf-sheet-related__heading" }, ke = { key: 12 }, Ae = { class: "mwnf-sheet-related__heading" }, je = { class: "mwnf-sheet-related__line" }, Me = ["href"], Ne = { key: 13 }, Pe = { class: "mwnf-sheet-related__heading" }, Fe = { class: "mwnf-sheet-related__line" }, Ie = ["href"], Le = { key: 14 }, Re = { class: "mwnf-sheet-related__heading" }, ze = "sheet.field.", J = {
95
- __name: "ItemDetailView",
96
- props: {
97
- spec: {
98
- type: Object,
99
- required: !0
100
- },
101
- id: {
102
- type: String,
103
- required: !0
104
- },
105
- entity: {
106
- type: String,
107
- default: ""
108
- },
109
- dataGetter: {
110
- type: Function,
111
- default: null
112
- }
113
- },
114
- setup(i) {
115
- let o = i, s = A(), P = /* @__PURE__ */ new Set([
116
- "before-sheet",
117
- "museum",
118
- "related",
119
- "aside"
120
- ]), F = p(() => Object.keys(s).filter((e) => !P.has(e))), I = p(() => !o.dataGetter || o.dataGetter(o.id) != null), { t: L } = z();
121
- function H(e) {
122
- if (typeof e != "string" || !e.startsWith(ze)) return e;
123
- let t = `sheet.dxa.${e.slice(12)}`;
124
- return L(t) === t ? e : t;
125
- }
126
- let U = p(() => {
127
- let e = Array.isArray(o.spec.fields) ? {
128
- ...o.spec,
129
- fields: o.spec.fields.map((e) => ({
130
- ...e,
131
- label: H(e.label)
132
- }))
133
- } : o.spec;
134
- return e.related === !1 ? e : {
135
- ...e,
136
- related: {
137
- ...e.related,
138
- inline: !1
139
- }
140
- };
141
- }), W = B(), G = (e, t) => (e.name ?? "").localeCompare(t.name ?? ""), ae = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "gallery").sort(G), oe = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "exhibition").sort(G), K = (e) => W.links(e.project_id)?.artisticIntroductionUrl ?? null, q = (e) => W.links(e.project_id)?.relatedDatabaseUrl ?? null, se = {
142
- "islamicart.museumwnf.org": "core.project.islamicArt",
143
- "baroqueart.museumwnf.org": "core.project.baroqueArt",
144
- "sharinghistory.museumwnf.org": "core.project.sharingHistory"
145
- };
146
- function ce(e) {
147
- try {
148
- let t = se[new URL(q(e)).host];
149
- if (t) return L(t);
150
- } catch {}
151
- return W.label(e.project_id);
152
- }
153
- function le(e, t) {
154
- if (!e) return null;
155
- let n = U.value.sourceDatabase === !1 ? null : U.value.sourceDatabase ?? null, r = null;
156
- if (n) {
157
- let i = n.chipClass ? n.chipClass(e, t) : null, a = W.label(e.project_id);
158
- (i || a) && (r = {
159
- chipClass: i,
160
- name: a,
161
- label: L(n.label ?? "record.sheet.sourceDatabase")
162
- });
163
- }
164
- let i = n && n.addToCollection !== !1 ? L(n.addToCollection?.label ?? "record.action.addToCollection") : null, a = U.value.notice === !1 ? null : U.value.notice ?? null, o = a && a.show(e, t) ? L(a.label) : null;
165
- return {
166
- source: r,
167
- addToCollectionLabel: i,
168
- notice: o
169
- };
170
- }
171
- let J = R(), Be = te("partners"), Y = te("countries");
172
- ne(["partners", "countries"]), J.loadTranslations("countries", "en");
173
- function X(e, t) {
174
- let n = J.tr("countries", e, t, "en");
175
- return re(n.name ?? Y.value?.get(e)?.internal_name ?? "");
176
- }
177
- function Z(e) {
178
- let t = e.text?.holder ? M(String(e.text.holder)) : "", n = U.value.museum === !1 ? null : U.value.museum ?? null, r = n ? Be.value?.get(e.record?.partner_id) : null;
179
- return {
180
- holder: t,
181
- view: r ? ie(r, J.tr("partners", r.id, e.language, "en"), {
182
- countryLabel: (t) => X(t, e.language),
183
- route: (t) => n.route ? n.route(t.id, e) : null
184
- }) : null
185
- };
186
- }
187
- function Q(e, t) {
188
- if (!e) return null;
189
- let n = U.value.related ?? {}, r = t.records ?? [], i = t.outside ?? [], a = o.dataGetter ? r.filter((e) => o.dataGetter(e.id) != null) : r, s = o.dataGetter ? r.filter((e) => o.dataGetter(e.id) == null).map((t) => (e.related_items ?? []).find((e) => e.id === t.id)).filter(Boolean) : [], c = [...i, ...s].map((e) => ({
190
- ...e,
191
- name: e.project_id ? W.label(e.project_id) : null,
192
- chipClass: n.outsideChip ? n.outsideChip(e, t) : null
193
- })), l = (t) => (n.onDisplayIn?.href ? n.onDisplayIn.href(t, e) : t.legacy_host) || "", u = (e) => ({
194
- id: e.id,
195
- label: M(e.name ?? ""),
196
- href: l(e),
197
- external: !!l(e)
198
- }), d = n.onDisplayIn && n.onDisplayIn !== !1 ? {
199
- pendingLabel: n.onDisplayIn.linkPendingLabel ?? "",
200
- groups: [n.onDisplayIn.exhibitions ? {
201
- heading: n.onDisplayIn.exhibitionsHeading ?? "record.related.exhibitions",
202
- sections: n.onDisplayIn.exhibitions(e, t)
203
- } : {
204
- heading: n.onDisplayIn.exhibitionsHeading ?? "record.related.exhibitions",
205
- links: oe(e).map(u)
206
- }, {
207
- heading: n.onDisplayIn.galleriesHeading ?? "record.related.galleries",
208
- links: ae(e).map(u)
209
- }].filter((e) => (e.sections ?? [e]).some((e) => e.links?.length))
210
- } : null, f = n.databaseLabel && q(e) ? {
211
- url: q(e),
212
- label: L(n.databaseLabel),
213
- name: ce(e)
214
- } : null, p = n.overallDatabase && n.overallDatabase !== !1 ? {
215
- label: L(n.overallDatabase.label),
216
- linkLabel: L(n.overallDatabase.linkLabel)
217
- } : null, m = n.objectTiles ? n.objectTiles({
218
- record: e,
219
- inPackage: a,
220
- references: c,
221
- ctx: t
222
- }) : null, h = !!(m && n.monumentsHeading);
223
- return {
224
- title: n.title ? L(n.title) : "",
225
- description: n.description ? L(n.description) : "",
226
- heading: L(n.heading ?? "record.related.items"),
227
- tiles: h ? m.filter((e) => e.kind !== "monument") : m,
228
- monumentsHeading: h ? L(n.monumentsHeading) : "",
229
- monumentTiles: h ? m.filter((e) => e.kind === "monument") : [],
230
- variant: n.variant ?? "grid",
231
- actionLabel: n.actionLabel ? L(n.actionLabel) : "",
232
- inPackage: a,
233
- references: c,
234
- notInPackageLabel: n.notInPackageLabel ? L(n.notInPackageLabel) : "",
235
- artisticIntroduction: n.artisticIntroductionLabel && K(e) ? {
236
- url: K(e),
237
- label: L(n.artisticIntroductionLabel)
238
- } : null,
239
- timeline: n.timeline ? n.timeline(e, t) : null,
240
- glossary: n.glossary !== !1,
241
- glossaryLabels: n.glossaryLabels ?? {},
242
- dynasties: n.dynasties ? n.dynasties(e, t.language, t) : null,
243
- dynastiesHeading: L(n.dynastiesHeading ?? "record.dynasty.list"),
244
- media: n.media === !1 ? [] : e.media ?? [],
245
- mediaGroups: n.mediaHeadings && n.media !== !1 ? ["audio", "video"].map((r) => ({
246
- type: r,
247
- heading: L(n.mediaHeadings[r]),
248
- entries: (e.media ?? []).filter((e) => e?.url && e.type === r && (!e.language || !t.language || e.language === t.language))
249
- })).filter((e) => e.entries.length) : null,
250
- onDisplayIn: d,
251
- database: f,
252
- overallDatabase: p,
253
- download: n.download === !1 ? null : {
254
- label: L("record.action.download"),
255
- pdfLabel: L("record.action.downloadPdf")
256
- }
257
- };
258
- }
259
- let $ = V(), Ve = p(() => {
260
- let e = d($.chrome, "world.png");
261
- return e ? { "--mwnf-dxa-glossary-image": `url("${e}")` } : null;
262
- });
263
- function He() {
264
- window.print();
265
- }
266
- return (o, s) => I.value ? (T(), m(u, {
267
- key: 0,
268
- spec: U.value,
269
- id: i.id,
270
- entity: i.entity,
271
- style: w(Ve.value)
272
- }, v({
273
- "before-sheet": j((e) => [D(o.$slots, "before-sheet", C(x(e)), () => [(T(!0), g(f, null, E([le(e.record, e)], (t) => (T(), g(f, { key: "before-sheet" }, [t?.source || t?.addToCollectionLabel ? (T(), g("div", de, [t.source ? (T(), g("p", fe, [t.source.chipClass ? (T(), g("span", {
274
- key: 0,
275
- class: S(["mwnf-chip", t.source.chipClass]),
276
- "aria-hidden": "true"
277
- }, null, 2)) : h("", !0), t.source.name ? (T(), g(f, { key: 1 }, [y(O(t.source.label) + ": " + O(t.source.name), 1)], 64)) : h("", !0)])) : h("", !0), t.addToCollectionLabel ? (T(), g("p", pe, [_("a", {
278
- href: k(N).myCollection,
279
- target: "_blank",
280
- rel: "noopener"
281
- }, "↗ " + O(t.addToCollectionLabel), 9, me)])) : h("", !0)])) : h("", !0), t?.notice ? (T(), g("div", he, [y(O(t.notice) + " ", 1), _("strong", null, [_("em", null, O(e.languages.map((e) => e.label).join(", ")), 1)])])) : h("", !0)], 64))), 128))])]),
282
- museum: j((e) => [D(o.$slots, "museum", C(x(e)), () => [(T(!0), g(f, null, E([Z(e)], (t) => (T(), g("div", ge, [t.holder ? (T(), g("p", {
283
- key: 0,
284
- class: "mwnf-sheet-museum__holder",
285
- innerHTML: t.holder
286
- }, null, 8, _e)) : h("", !0), t.view ? (T(), m(l, {
287
- key: 1,
288
- variant: "summary",
289
- partner: t.view,
290
- label: "partner.info.about",
291
- dir: e.dir
292
- }, null, 8, ["partner", "dir"])) : h("", !0)]))), 128))])]),
293
- aside: j((i) => [D(o.$slots, "related", C(x(i)), () => [(T(!0), g(f, null, E([Q(i.record, i)], (o) => (T(), g(f, { key: i.record?.id ?? "related" }, [o ? (T(), g("div", ve, [
294
- o.title ? (T(), g("p", ye, O(o.title), 1)) : h("", !0),
295
- o.description ? (T(), g("p", be, O(o.description), 1)) : h("", !0),
296
- o.tiles ? (T(), m(ue, {
297
- key: 2,
298
- heading: o.heading,
299
- tiles: o.tiles
300
- }, null, 8, ["heading", "tiles"])) : o.inPackage.length || o.references.length ? (T(), m(c, {
301
- key: 3,
302
- heading: o.heading,
303
- records: o.inPackage,
304
- variant: o.variant,
305
- "action-label": o.actionLabel
306
- }, {
307
- default: j(() => [o.references.length ? (T(), g("ul", xe, [(T(!0), g(f, null, E(o.references, (e) => (T(), g("li", { key: e.id }, [
308
- e.chipClass ? (T(), g("span", {
309
- key: 0,
310
- class: S(["mwnf-chip", e.chipClass]),
311
- "aria-hidden": "true"
312
- }, null, 2)) : h("", !0),
313
- e.name ? (T(), g(f, { key: 1 }, [y(O(e.name), 1)], 64)) : h("", !0),
314
- o.notInPackageLabel ? (T(), g("span", Se, O(o.notInPackageLabel), 1)) : h("", !0)
315
- ]))), 128))])) : h("", !0)]),
316
- _: 2
317
- }, 1032, [
318
- "heading",
319
- "records",
320
- "variant",
321
- "action-label"
322
- ])) : h("", !0),
323
- o.monumentTiles.length ? (T(), m(ue, {
324
- key: 4,
325
- heading: o.monumentsHeading,
326
- tiles: o.monumentTiles,
327
- class: "mwnf-related-objects--monuments"
328
- }, null, 8, ["heading", "tiles"])) : h("", !0),
329
- o.artisticIntroduction ? (T(), g("p", Ce, [_("a", {
330
- href: o.artisticIntroduction.url,
331
- target: "_blank",
332
- rel: "noopener"
333
- }, "↗ " + O(o.artisticIntroduction.label), 9, we)])) : h("", !0),
334
- o.timeline ? (T(), m(r, {
335
- key: i.record.id,
336
- info: o.timeline
337
- }, null, 8, ["info"])) : h("", !0),
338
- o.glossary ? (T(), m(n, {
339
- key: 7,
340
- language: i.language,
341
- labels: o.glossaryLabels,
342
- dir: i.dir
343
- }, null, 8, [
344
- "language",
345
- "labels",
346
- "dir"
347
- ])) : h("", !0),
348
- o.dynasties?.records?.length ? (T(), m(e, {
349
- key: 8,
350
- heading: o.dynastiesHeading,
351
- dynasties: o.dynasties.records,
352
- tr: o.dynasties.tr,
353
- dir: i.dir
354
- }, null, 8, [
355
- "heading",
356
- "dynasties",
357
- "tr",
358
- "dir"
359
- ])) : h("", !0),
360
- o.mediaGroups ? (T(!0), g(f, { key: 9 }, E(o.mediaGroups, (e) => (T(), g("div", {
361
- key: e.type,
362
- class: S(["mwnf-sheet-related__media", `mwnf-sheet-related__media--${e.type}`])
363
- }, [_("p", Te, O(e.heading), 1), (T(!0), g(f, null, E(e.entries, (e) => (T(), g("p", {
364
- key: e.url,
365
- class: "mwnf-sheet-related__line"
366
- }, [_("a", {
367
- href: e.url,
368
- target: "_blank",
369
- rel: "noopener"
370
- }, "↗ " + O(e.title || e.url), 9, Ee)]))), 128))], 2))), 128)) : (T(), m(t, {
371
- key: 10,
372
- media: o.media,
373
- language: i.language,
374
- descriptions: !1,
375
- dir: i.dir
376
- }, null, 8, [
377
- "media",
378
- "language",
379
- "dir"
380
- ])),
381
- o.onDisplayIn?.groups.length ? (T(), g("div", De, [_("p", Oe, O(k(L)("record.related.onDisplayIn")), 1), b(a, {
382
- heading: "",
383
- groups: o.onDisplayIn.groups,
384
- "pending-label": o.onDisplayIn.pendingLabel,
385
- dir: i.dir
386
- }, null, 8, [
387
- "groups",
388
- "pending-label",
389
- "dir"
390
- ])])) : h("", !0),
391
- o.database ? (T(), g("div", ke, [_("p", Ae, O(o.database.label), 1), _("p", je, [_("a", {
392
- href: o.database.url,
393
- target: "_blank",
394
- rel: "noopener"
395
- }, "↗ " + O(o.database.name), 9, Me)])])) : h("", !0),
396
- o.overallDatabase ? (T(), g("div", Ne, [_("p", Pe, O(o.overallDatabase.label), 1), _("p", Fe, [_("a", {
397
- href: k(N).overallDatabase,
398
- target: "_blank",
399
- rel: "noopener"
400
- }, "↗ " + O(o.overallDatabase.linkLabel), 9, Ie)])])) : h("", !0),
401
- o.download ? (T(), g("div", Le, [_("p", Re, O(o.download.label), 1), _("p", {
402
- class: "mwnf-sheet-related__line mwnf-sheet-related__line--action",
403
- onClick: He
404
- }, "➤ " + O(o.download.pdfLabel), 1)])) : h("", !0)
405
- ])) : h("", !0)], 64))), 128))])]),
406
- _: 2
407
- }, [E(F.value, (e) => ({
408
- name: e,
409
- fn: j((t) => [D(o.$slots, e, C(x(t)))])
410
- }))]), 1032, [
411
- "spec",
412
- "id",
413
- "entity",
414
- "style"
415
- ])) : (T(), m(k(ee), { key: 1 }));
416
- }
417
- }, Be = "mwnf-on-display__theme", Y = (e) => P(e ?? ""), X = (e) => e?.titles?.en ?? Object.values(e?.titles ?? {})[0] ?? "", Z = (e) => `<span class="${Be}">${e}</span>`;
418
- function Q(e, t, n) {
419
- return n && e.site === n ? {
420
- id: e.path,
421
- label: t,
422
- to: e.path
423
- } : {
424
- id: `${e.site}${e.path}`,
425
- label: t,
426
- href: F(e.site, e.path),
427
- external: !0
428
- };
429
- }
430
- function $(e) {
431
- return e.toLowerCase().split(" ").filter((e) => ![
432
- "a",
433
- "an",
434
- "the"
435
- ].includes(e)).join(" ");
436
- }
437
- function Ve(e, t, n = null) {
438
- let r = e?.exhibition_references ?? [], i = [], a = r.filter((e) => e.list === "virtual" || e.list === "sharing_history");
439
- a.length && i.push({
440
- caption: a[0].project ? Y(a[0].project.name) : "",
441
- links: a.map((e) => Q(e, [
442
- Y(X(e.exhibition)),
443
- Z(Y(X(e.theme))),
444
- ...e.subtheme ? [Z(Y(X(e.subtheme)))] : []
445
- ].join(" | "), n))
446
- });
447
- let o = r.filter((e) => e.list === "exhibition"), s = o.filter((e) => e.exhibition?.titles?.[t]), c = s.length ? {
448
- refs: s,
449
- lang: t
450
- } : {
451
- refs: o.filter((e) => e.exhibition?.titles?.en),
452
- lang: "en"
453
- }, l = (e) => e?.titles?.[c.lang] ?? e?.titles?.en ?? "", u = [...c.refs].sort((e, t) => $(l(e.exhibition)).localeCompare($(l(t.exhibition)), "en", { sensitivity: "base" }) || (e.legacy_order?.[0] ?? 0) - (t.legacy_order?.[0] ?? 0));
454
- for (let e of u) {
455
- let t = Y(l(e.exhibition)), r = Q(e, `${Y(l(e.theme))} | ${Z(Y(l(e.subtheme)))}`, n), a = i[i.length - 1];
456
- a?.exhibition === e.exhibition.id ? a.links.push(r) : i.push({
457
- exhibition: e.exhibition.id,
458
- caption: t,
459
- links: [r]
460
- });
461
- }
462
- return i;
463
- }
464
- // src/dxa/relatedKind.js
465
- function He(e, t) {
466
- return (e?.type ?? t?.get(e?.id)?.type) === "monument" ? "monument" : "object";
467
- }
468
- // src/dxa/LegacyItemSheet.vue
469
- var Ue = { class: "mwnf-dxa-item__languages" }, We = ["dir"], Ge = ["href"], Ke = ["href"], qe = ["innerHTML"], Je = ["innerHTML"], Ye = ["dir"], Xe = { class: "mwnf-dxa-gallery-item__label" }, Ze = {
470
- key: "citation",
471
- class: "mwnf-dxa-gallery-item__citation"
472
- }, Qe = { class: "mwnf-dxa-gallery-item__project" }, $e = { class: "mwnf-dxa-gallery-item__address" }, et = { class: "mwnf-dxa-gallery-item__credit-label" }, tt = {
473
- key: 1,
474
- class: "mwnf-dxa-gallery-item__number"
475
- }, nt = { class: "mwnf-dxa-gallery-item__number-label" }, rt = ["href"], it = {
476
- __name: "LegacyItemSheet",
477
- props: {
478
- id: {
479
- type: String,
480
- required: !0
481
- },
482
- itemDetail: {
483
- type: Object,
484
- required: !0
485
- },
486
- dataGetter: {
487
- type: Function,
488
- default: null
489
- },
490
- words: {
491
- type: Object,
492
- required: !0
493
- }
494
- },
495
- setup(e) {
496
- let t = e, { t: n } = z(), r = U(), a = B(), s = R(), c = V(), l = L(), u = (e, t) => e?.[t] ?? e?.en ?? Object.values(e ?? {})[0] ?? "";
497
- function d({ record: e, inPackage: t, references: n, ctx: r }) {
498
- let i = r.language, o = new Map((e.related_items ?? []).map((e) => [e.id, e])), s = (e) => re(u(o.get(e)?.justifications, i)), c = (e) => He(o.get(e) ?? { id: e }, l.itemById.value), d = (e) => (e ?? "").replace(/\.$/, ""), f = t.map((e) => ({
499
- id: e.id,
500
- kind: c(e.id),
501
- image: e.image,
502
- name: d(e.name),
503
- country: l.countryLabel(l.itemById.value.get(e.id)?.country_id),
504
- justification: s(e.id),
505
- to: e.to
506
- })), p = n.map((e) => {
507
- let t = a.links(e.project_id)?.homeSite;
508
- return {
509
- id: e.id,
510
- kind: c(e.id),
511
- image: e.image ?? "",
512
- name: d(M(u(e.names, i))),
513
- country: l.countryLabel(e.country_id),
514
- justification: s(e.id),
515
- href: t ? F(t, `/item/${e.id}`) : ""
516
- };
517
- }), m = (e.related_items ?? []).map((e) => e.id);
518
- return [...f, ...p].sort((e, t) => m.indexOf(e.id) - m.indexOf(t.id));
519
- }
520
- let v = p(() => ({
521
- ...t.itemDetail,
522
- sourceDatabase: !1,
523
- sourceCredit: !1,
524
- mediaThumbsFrom: 1,
525
- mediaCreditCaption: !1,
526
- shortDescriptionLabels: {
527
- view: t.words.viewShortDescription,
528
- hide: t.words.hideShortDescription
529
- },
530
- related: {
531
- ...t.itemDetail.related,
532
- glossaryLabels: { tool: t.words.glossary },
533
- dynastiesHeading: t.words.dynasties,
534
- mediaHeadings: {
535
- audio: t.words.relatedAudio,
536
- video: t.words.relatedVideos
537
- },
538
- ...t.words.relatedObjects ? {
539
- heading: t.words.relatedObjects,
540
- objectTiles: d
541
- } : {},
542
- ...t.words.relatedMonuments ? { monumentsHeading: t.words.relatedMonuments } : {},
543
- onDisplayIn: {
544
- ...t.itemDetail.related?.onDisplayIn,
545
- exhibitionsHeading: t.words.exhibitions,
546
- galleriesHeading: "core.project.galleries",
547
- href: (e, t) => e.site ? F(e.site, `/item/${t.id}`) : e.legacy_host,
548
- exhibitions: (e, t) => Ve(e, t.language, s.manifest?.site?.key)
549
- }
550
- }
551
- }));
552
- function x(e) {
553
- let t = a.links(e?.project_id)?.homeSite;
554
- return (t && t !== s.manifest?.site?.key ? F(t, `/item/${e.id}`) : null) ?? I(r);
555
- }
556
- function C(e) {
557
- try {
558
- let { host: t, pathname: n } = new URL(e), r = n.split("/").find(Boolean);
559
- return r ? `${t}/${r}` : t;
560
- } catch {
561
- return e;
562
- }
563
- }
564
- let w = (e) => c.projectColors?.[e?.project_id] ?? "";
565
- function D(e, t) {
566
- let n = a.label(t?.project_id) ?? "", r = n ? e.indexOf(` ${n},`) : -1;
567
- return r < 0 ? {
568
- before: e,
569
- project: "",
570
- after: ""
571
- } : {
572
- before: e.slice(0, r + 1),
573
- project: n,
574
- after: e.slice(r + 1 + n.length)
575
- };
576
- }
577
- function A(e) {
578
- return {
579
- to: t.itemDetail.museum?.route?.(e.record?.partner_id) ?? null,
580
- holder: e.text?.holder ? M(String(e.text.holder)) : ""
581
- };
582
- }
583
- return (t, r) => (T(), m(J, {
584
- spec: v.value,
585
- id: e.id,
586
- "data-getter": e.dataGetter,
587
- class: "mwnf-dxa-item mwnf-dxa-gallery-item"
588
- }, {
589
- header: j(({ languages: e, language: t, select: n }) => [_("div", Ue, [b(o, {
590
- languages: e,
591
- language: t,
592
- from: 1,
593
- onSelect: n
594
- }, null, 8, [
595
- "languages",
596
- "language",
597
- "onSelect"
598
- ])]), b(i)]),
599
- "after-media": j(({ record: e, dir: t }) => [e ? (T(), g("div", {
600
- key: 0,
601
- class: "mwnf-dxa-gallery-item__links",
602
- dir: t || void 0
603
- }, [_("p", null, [_("a", {
604
- href: x(e),
605
- target: "_blank",
606
- rel: "noopener"
607
- }, [r[0] ||= _("span", {
608
- class: "mwnf-dxa-gallery-item__icon",
609
- "aria-hidden": "true"
610
- }, "↗", -1), _("bdi", null, [y(O(k(n)("record.source.label")) + " ", 1), _("span", null, "(" + O(C(x(e))) + ")", 1)])], 8, Ge)]), _("p", null, [_("a", {
611
- href: k(N).myCollection,
612
- target: "_blank",
613
- rel: "noopener"
614
- }, [r[1] ||= _("span", {
615
- class: "mwnf-dxa-gallery-item__icon",
616
- "aria-hidden": "true"
617
- }, "↗", -1), y(O(k(n)("record.action.addToCollection")), 1)], 8, Ke)])], 8, We)) : h("", !0)]),
618
- museum: j((e) => [(T(!0), g(f, null, E([A(e)], (e) => (T(), g(f, { key: "museum" }, [e.to && e.holder ? (T(), m(k(H), {
619
- key: 0,
620
- to: e.to,
621
- class: "mwnf-dxa-gallery-item__museum"
622
- }, {
623
- default: j(() => [r[2] ||= _("span", {
624
- class: "mwnf-dxa-gallery-item__icon",
625
- "aria-hidden": "true"
626
- }, "↗", -1), _("span", { innerHTML: e.holder }, null, 8, qe)]),
627
- _: 2
628
- }, 1032, ["to"])) : e.holder ? (T(), g("span", {
629
- key: 1,
630
- innerHTML: e.holder
631
- }, null, 8, Je)) : h("", !0)], 64))), 128))]),
632
- credits: j(({ record: t, credits: r, workingNumber: i, citation: a, dir: o }) => [t ? (T(), g("div", {
633
- key: 0,
634
- class: "mwnf-dxa-gallery-item__credits",
635
- dir: o || void 0
636
- }, [
637
- a ? (T(), g(f, { key: 0 }, [_("p", Xe, O(k(n)("record.citation.ofThisPage")), 1), (T(!0), g(f, null, E([D(a, t)], (e) => (T(), g("p", Ze, [
638
- y(O(e.before), 1),
639
- _("span", Qe, O(e.project), 1),
640
- y(O(e.after) + " ", 1),
641
- _("span", $e, O(x(t)), 1)
642
- ]))), 128))], 64)) : h("", !0),
643
- (T(!0), g(f, null, E(r, (e) => (T(), g("p", {
644
- key: e.label,
645
- class: "mwnf-dxa-gallery-item__credit"
646
- }, [_("span", et, O(e.label), 1), _("span", null, O(e.value), 1)]))), 128)),
647
- i ? (T(), g("p", tt, [_("span", nt, O(k(n)(e.words.workingNumber)), 1), y(O(" ") + O(i), 1)])) : h("", !0),
648
- _("div", { class: S(["mwnf-dxa-gallery-item__source", w(t)]) }, [_("p", null, O(k(n)("record.source.label")), 1), _("p", null, [_("a", {
649
- href: x(t),
650
- target: "_blank",
651
- rel: "noopener"
652
- }, O(x(t)), 9, rt)])], 2)
653
- ], 8, Ye)) : h("", !0)]),
654
- _: 1
655
- }, 8, [
656
- "spec",
657
- "id",
658
- "data-getter"
659
- ]));
660
- }
661
- };
662
- export { J as n, it as t };