@museumwnf/viewer-layout 3.59.0 → 3.61.0

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 (30) hide show
  1. package/dist/{FeaturedRecord-CTqnQFox.js → FeaturedRecord-DaGLHyhD.js} +2 -3
  2. package/dist/{GlossaryPopover-B7E6BsjS.js → GlossaryPopover-DbQKXhx9.js} +1 -2
  3. package/dist/ItemDetailView-D7m2C1Mg.js +310 -0
  4. package/dist/{OnDisplayIn-DZHRKjL0.js → OnDisplayIn-DW4iC5BB.js} +10 -5
  5. package/dist/{PageShell-CcaLOuXI.js → PageShell-CPtgzcxv.js} +1 -2
  6. package/dist/{PartnerMap-BIKd-AGP.js → PartnerMap-U-Hi2FBi.js} +17 -14
  7. package/dist/RecordView-BE4mbj6G.js +363 -0
  8. package/dist/{SiteShell-CYQxXosD.js → SiteShell-qvsZO4Iz.js} +3 -4
  9. package/dist/{Theme-Co1bf81Z.js → Theme-4RmyRY0x.js} +29 -30
  10. package/dist/{TimelineEventList-CTJJOWGh.js → TimelineEventList-1feZA5t7.js} +3 -4
  11. package/dist/{TimelineResultsView-D15BMWZM.js → TimelineResultsView-CkH3NDqL.js} +264 -255
  12. package/dist/{chrome-DNsZQXrL.js → chrome-Bv_mLlHM.js} +1 -2
  13. package/dist/components.js +1 -2
  14. package/dist/{content-PQeMx8U5.js → content-BNS5U0Xv.js} +3 -4
  15. package/dist/content.js +6 -6
  16. package/dist/{data-CXRsGwLQ.js → data-EKYeMQcC.js} +16 -11
  17. package/dist/{data-BINc9QjV.js → data-kqAkoQvf.js} +2 -3
  18. package/dist/dxa.js +1006 -669
  19. package/dist/index.js +8 -8
  20. package/dist/minisite.js +14 -26
  21. package/dist/standalone.js +209 -217
  22. package/dist/{themeSpecs-DP9xWiVJ.js → themeSpecs-CsDpl4rR.js} +2 -3
  23. package/dist/viewer-layout.css +1 -1
  24. package/dist/views.js +5 -6
  25. package/package.json +10 -10
  26. package/src/dxa/testing.js +98 -57
  27. package/src/styles/dxa-gallery.css +32 -4
  28. package/src/tokens.reference.css +12 -1
  29. package/dist/ItemDetailView-Bbn-uNaR.js +0 -304
  30. package/dist/RecordView-DEKHp1A3.js +0 -348
@@ -1,304 +0,0 @@
1
- import { t as e } from "./chrome-DNsZQXrL.js";
2
- import { r as t } from "./PartnerMap-BIKd-AGP.js";
3
- import { n } from "./TimelineEventList-CTJJOWGh.js";
4
- import { i as r, n as i, o as a, r as o, t as s } from "./OnDisplayIn-DZHRKjL0.js";
5
- import { t as c } from "./RecordView-DEKHp1A3.js";
6
- import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as ee, createTextVNode as h, createVNode as g, guardReactiveProps as _, normalizeClass as v, normalizeProps as y, normalizeStyle as te, openBlock as b, renderList as x, renderSlot as S, toDisplayString as C, unref as w, useSlots as ne, withCtx as T } from "vue";
7
- import { NotFoundView as re, byId as E, loadEntities as ie, mdInline as D, mdStrip as ae, mwnfLinks as O, partnerView as oe, useDataPackage as se, useI18n as ce, useProjects as le, useSiteConfig as ue } from "@museumwnf/viewer-core";
8
- //#region src/dxa/ItemDetailView.vue
9
- var k = {
10
- key: 0,
11
- class: "mwnf-sheet-source"
12
- }, A = {
13
- key: 0,
14
- class: "mwnf-sheet-source__line"
15
- }, j = {
16
- key: 1,
17
- class: "mwnf-sheet-source__collection"
18
- }, M = ["href"], N = {
19
- key: 1,
20
- class: "mwnf-sheet-notice"
21
- }, P = {
22
- key: "museum",
23
- class: "mwnf-sheet-museum"
24
- }, F = ["innerHTML"], I = {
25
- key: 0,
26
- class: "mwnf-sheet-related"
27
- }, L = {
28
- key: 0,
29
- class: "mwnf-sheet-related__heading mwnf-sheet-related__heading--caps"
30
- }, R = {
31
- key: 1,
32
- class: "mwnf-sheet-related__description"
33
- }, z = {
34
- key: 0,
35
- class: "mwnf-sheet-related__references"
36
- }, B = {
37
- key: 2,
38
- class: "mwnf-sheet-related__unresolved"
39
- }, V = {
40
- key: 3,
41
- class: "mwnf-sheet-related__line"
42
- }, H = ["href"], U = { key: 7 }, de = { class: "mwnf-sheet-related__heading" }, fe = { key: 8 }, pe = { class: "mwnf-sheet-related__heading" }, me = { class: "mwnf-sheet-related__line" }, he = ["href"], ge = { key: 9 }, _e = { class: "mwnf-sheet-related__heading" }, ve = { class: "mwnf-sheet-related__line" }, ye = ["href"], be = { key: 10 }, xe = { class: "mwnf-sheet-related__heading" }, Se = "sheet.field.", W = {
43
- __name: "ItemDetailView",
44
- props: {
45
- spec: {
46
- type: Object,
47
- required: !0
48
- },
49
- id: {
50
- type: String,
51
- required: !0
52
- },
53
- entity: {
54
- type: String,
55
- default: ""
56
- },
57
- dataGetter: {
58
- type: Function,
59
- default: null
60
- }
61
- },
62
- setup(W) {
63
- let G = W, Ce = ne(), we = /* @__PURE__ */ new Set([
64
- "before-sheet",
65
- "museum",
66
- "related",
67
- "aside"
68
- ]), Te = u(() => Object.keys(Ce).filter((e) => !we.has(e))), Ee = u(() => !G.dataGetter || G.dataGetter(G.id) != null), { t: K } = ce();
69
- function De(e) {
70
- if (typeof e != "string" || !e.startsWith(Se)) return e;
71
- let t = `sheet.dxa.${e.slice(12)}`;
72
- return K(t) === t ? e : t;
73
- }
74
- let q = u(() => Array.isArray(G.spec.fields) ? {
75
- ...G.spec,
76
- fields: G.spec.fields.map((e) => ({
77
- ...e,
78
- label: De(e.label)
79
- }))
80
- } : G.spec), J = le(), Y = (e, t) => (e.name ?? "").localeCompare(t.name ?? ""), Oe = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "gallery").sort(Y), X = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "exhibition").sort(Y), Z = (e) => J.links(e.project_id)?.artisticIntroductionUrl ?? null, Q = (e) => J.links(e.project_id)?.relatedDatabaseUrl ?? null;
81
- function ke(e, t) {
82
- if (!e) return null;
83
- let n = q.value.sourceDatabase === !1 ? null : q.value.sourceDatabase ?? null, r = null;
84
- if (n) {
85
- let i = n.chipClass ? n.chipClass(e, t) : null, a = J.label(e.project_id);
86
- (i || a) && (r = {
87
- chipClass: i,
88
- name: a,
89
- label: K(n.label ?? "record.sheet.sourceDatabase")
90
- });
91
- }
92
- let i = n && n.addToCollection !== !1 ? K(n.addToCollection?.label ?? "record.action.addToCollection") : null, a = q.value.notice === !1 ? null : q.value.notice ?? null, o = a && a.show(e, t) ? K(a.label) : null;
93
- return {
94
- source: r,
95
- addToCollectionLabel: i,
96
- notice: o
97
- };
98
- }
99
- let $ = se(), Ae = E("partners"), je = E("countries");
100
- ie(["partners", "countries"]), $.loadTranslations("countries", "en");
101
- function Me(e, t) {
102
- let n = $.tr("countries", e, t, "en");
103
- return ae(n.name ?? je.value?.get(e)?.internal_name ?? "");
104
- }
105
- function Ne(e) {
106
- let t = e.text?.holder ? D(String(e.text.holder)) : "", n = q.value.museum === !1 ? null : q.value.museum ?? null, r = n ? Ae.value?.get(e.record?.partner_id) : null;
107
- return {
108
- holder: t,
109
- view: r ? oe(r, $.tr("partners", r.id, e.language, "en"), {
110
- countryLabel: (t) => Me(t, e.language),
111
- route: (t) => n.route ? n.route(t.id, e) : null
112
- }) : null
113
- };
114
- }
115
- function Pe(e, t) {
116
- if (!e) return null;
117
- let n = q.value.related ?? {}, r = t.records ?? [], i = t.outside ?? [], a = G.dataGetter ? r.filter((e) => G.dataGetter(e.id) != null) : r, o = G.dataGetter ? r.filter((e) => G.dataGetter(e.id) == null).map((t) => (e.related_items ?? []).find((e) => e.id === t.id)).filter(Boolean) : [], s = [...i, ...o].map((e) => ({
118
- ...e,
119
- name: e.project_id ? J.label(e.project_id) : null,
120
- chipClass: n.outsideChip ? n.outsideChip(e, t) : null
121
- })), c = (e) => ({
122
- id: e.id,
123
- label: D(e.name ?? ""),
124
- href: e.legacy_host || "",
125
- external: !!e.legacy_host
126
- }), l = n.onDisplayIn && n.onDisplayIn !== !1 ? {
127
- pendingLabel: n.onDisplayIn.linkPendingLabel ?? "",
128
- groups: [{
129
- heading: "record.related.exhibitions",
130
- links: X(e).map(c)
131
- }, {
132
- heading: "record.related.galleries",
133
- links: Oe(e).map(c)
134
- }].filter((e) => e.links.length)
135
- } : null, u = n.databaseLabel && Q(e) ? {
136
- url: Q(e),
137
- label: K(n.databaseLabel),
138
- name: J.label(e.project_id)
139
- } : null, d = n.overallDatabase && n.overallDatabase !== !1 ? {
140
- label: K(n.overallDatabase.label),
141
- linkLabel: K(n.overallDatabase.linkLabel)
142
- } : null;
143
- return {
144
- title: n.title ? K(n.title) : "",
145
- description: n.description ? K(n.description) : "",
146
- heading: K(n.heading ?? "record.related.items"),
147
- variant: n.variant ?? "grid",
148
- actionLabel: n.actionLabel ? K(n.actionLabel) : "",
149
- inPackage: a,
150
- references: s,
151
- notInPackageLabel: n.notInPackageLabel ? K(n.notInPackageLabel) : "",
152
- artisticIntroduction: n.artisticIntroductionLabel && Z(e) ? {
153
- url: Z(e),
154
- label: K(n.artisticIntroductionLabel)
155
- } : null,
156
- timeline: n.timeline ? n.timeline(e, t) : null,
157
- glossary: n.glossary !== !1,
158
- dynasties: n.dynasties ? n.dynasties(e, t.language, t) : null,
159
- media: n.media === !1 ? [] : e.media ?? [],
160
- onDisplayIn: l,
161
- database: u,
162
- overallDatabase: d,
163
- download: n.download === !1 ? null : {
164
- label: K("record.action.download"),
165
- pdfLabel: K("record.action.downloadPdf")
166
- }
167
- };
168
- }
169
- let Fe = ue(), Ie = u(() => {
170
- let t = e(Fe.chrome, "world.png");
171
- return t ? { "--mwnf-dxa-glossary-image": `url("${t}")` } : null;
172
- });
173
- function Le() {
174
- window.print();
175
- }
176
- return (e, u) => Ee.value ? (b(), d(c, {
177
- key: 0,
178
- spec: q.value,
179
- id: W.id,
180
- entity: W.entity,
181
- style: te(Ie.value)
182
- }, ee({
183
- "before-sheet": T((t) => [S(e.$slots, "before-sheet", y(_(t)), () => [(b(!0), p(l, null, x([ke(t.record, t)], (e) => (b(), p(l, { key: "before-sheet" }, [e?.source || e?.addToCollectionLabel ? (b(), p("div", k, [e.source ? (b(), p("p", A, [e.source.chipClass ? (b(), p("span", {
184
- key: 0,
185
- class: v(["mwnf-chip", e.source.chipClass]),
186
- "aria-hidden": "true"
187
- }, null, 2)) : f("", !0), e.source.name ? (b(), p(l, { key: 1 }, [h(C(e.source.label) + ": " + C(e.source.name), 1)], 64)) : f("", !0)])) : f("", !0), e.addToCollectionLabel ? (b(), p("p", j, [m("a", {
188
- href: w(O).myCollection,
189
- target: "_blank",
190
- rel: "noopener"
191
- }, "↗ " + C(e.addToCollectionLabel), 9, M)])) : f("", !0)])) : f("", !0), e?.notice ? (b(), p("div", N, [h(C(e.notice) + " ", 1), m("strong", null, [m("em", null, C(t.languages.map((e) => e.label).join(", ")), 1)])])) : f("", !0)], 64))), 128))])]),
192
- museum: T((t) => [S(e.$slots, "museum", y(_(t)), () => [(b(!0), p(l, null, x([Ne(t)], (e) => (b(), p("div", P, [e.holder ? (b(), p("p", {
193
- key: 0,
194
- class: "mwnf-sheet-museum__holder",
195
- innerHTML: e.holder
196
- }, null, 8, F)) : f("", !0), e.view ? (b(), d(n, {
197
- key: 1,
198
- variant: "summary",
199
- partner: e.view,
200
- label: "partner.info.about",
201
- dir: t.dir
202
- }, null, 8, ["partner", "dir"])) : f("", !0)]))), 128))])]),
203
- related: T(() => []),
204
- aside: T((n) => [S(e.$slots, "related", y(_(n)), () => [(b(!0), p(l, null, x([Pe(n.record, n)], (e) => (b(), p(l, { key: n.record?.id ?? "related" }, [e ? (b(), p("div", I, [
205
- e.title ? (b(), p("p", L, C(e.title), 1)) : f("", !0),
206
- e.description ? (b(), p("p", R, C(e.description), 1)) : f("", !0),
207
- e.inPackage.length || e.references.length ? (b(), d(t, {
208
- key: 2,
209
- heading: e.heading,
210
- records: e.inPackage,
211
- variant: e.variant,
212
- "action-label": e.actionLabel
213
- }, {
214
- default: T(() => [e.references.length ? (b(), p("ul", z, [(b(!0), p(l, null, x(e.references, (t) => (b(), p("li", { key: t.id }, [
215
- t.chipClass ? (b(), p("span", {
216
- key: 0,
217
- class: v(["mwnf-chip", t.chipClass]),
218
- "aria-hidden": "true"
219
- }, null, 2)) : f("", !0),
220
- t.name ? (b(), p(l, { key: 1 }, [h(C(t.name), 1)], 64)) : f("", !0),
221
- e.notInPackageLabel ? (b(), p("span", B, C(e.notInPackageLabel), 1)) : f("", !0)
222
- ]))), 128))])) : f("", !0)]),
223
- _: 2
224
- }, 1032, [
225
- "heading",
226
- "records",
227
- "variant",
228
- "action-label"
229
- ])) : f("", !0),
230
- e.artisticIntroduction ? (b(), p("p", V, [m("a", {
231
- href: e.artisticIntroduction.url,
232
- target: "_blank",
233
- rel: "noopener"
234
- }, "↗ " + C(e.artisticIntroduction.label), 9, H)])) : f("", !0),
235
- e.timeline ? (b(), d(o, {
236
- key: n.record.id,
237
- info: e.timeline
238
- }, null, 8, ["info"])) : f("", !0),
239
- e.glossary ? (b(), d(a, {
240
- key: 5,
241
- language: n.language,
242
- dir: n.dir
243
- }, null, 8, ["language", "dir"])) : f("", !0),
244
- e.dynasties?.records?.length ? (b(), d(r, {
245
- key: 6,
246
- heading: w(K)("record.dynasty.list"),
247
- dynasties: e.dynasties.records,
248
- tr: e.dynasties.tr,
249
- dir: n.dir
250
- }, null, 8, [
251
- "heading",
252
- "dynasties",
253
- "tr",
254
- "dir"
255
- ])) : f("", !0),
256
- g(i, {
257
- media: e.media,
258
- language: n.language,
259
- descriptions: !1,
260
- dir: n.dir
261
- }, null, 8, [
262
- "media",
263
- "language",
264
- "dir"
265
- ]),
266
- e.onDisplayIn?.groups.length ? (b(), p("div", U, [m("p", de, C(w(K)("record.related.onDisplayIn")), 1), g(s, {
267
- heading: "",
268
- groups: e.onDisplayIn.groups,
269
- "pending-label": e.onDisplayIn.pendingLabel,
270
- dir: n.dir
271
- }, null, 8, [
272
- "groups",
273
- "pending-label",
274
- "dir"
275
- ])])) : f("", !0),
276
- e.database ? (b(), p("div", fe, [m("p", pe, C(e.database.label), 1), m("p", me, [m("a", {
277
- href: e.database.url,
278
- target: "_blank",
279
- rel: "noopener"
280
- }, "↗ " + C(e.database.name), 9, he)])])) : f("", !0),
281
- e.overallDatabase ? (b(), p("div", ge, [m("p", _e, C(e.overallDatabase.label), 1), m("p", ve, [m("a", {
282
- href: w(O).overallDatabase,
283
- target: "_blank",
284
- rel: "noopener"
285
- }, "↗ " + C(e.overallDatabase.linkLabel), 9, ye)])])) : f("", !0),
286
- e.download ? (b(), p("div", be, [m("p", xe, C(e.download.label), 1), m("p", {
287
- class: "mwnf-sheet-related__line mwnf-sheet-related__line--action",
288
- onClick: Le
289
- }, "➤ " + C(e.download.pdfLabel), 1)])) : f("", !0)
290
- ])) : f("", !0)], 64))), 128))])]),
291
- _: 2
292
- }, [x(Te.value, (t) => ({
293
- name: t,
294
- fn: T((n) => [S(e.$slots, t, y(_(n)))])
295
- }))]), 1032, [
296
- "spec",
297
- "id",
298
- "entity",
299
- "style"
300
- ])) : (b(), d(w(re), { key: 1 }));
301
- }
302
- };
303
- //#endregion
304
- export { W as t };
@@ -1,348 +0,0 @@
1
- import { a as e, c as t, d as n, i as r, n as i, o as ee, r as te, s as ne } from "./PartnerMap-BIKd-AGP.js";
2
- import { t as re } from "./GlossaryPopover-B7E6BsjS.js";
3
- import { Fragment as ie, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as ae, createTextVNode as oe, createVNode as u, guardReactiveProps as d, mergeProps as se, normalizeClass as ce, normalizeProps as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, useSlots as le, watch as y, withCtx as ue } from "vue";
4
- import { useI18n as b } from "@museumwnf/viewer-core/i18n";
5
- import { NotFoundView as de, byId as x, citation as fe, creditLine as pe, entityRef as me, languageLabels as he, loadEntities as ge, pictureCredits as _e, picturesInLanguage as ve, renderBlock as S, renderInline as C, renderPlain as ye, sheetRows as be, sourceUrl as xe, useDataPackage as Se, useGlossaryPopup as Ce, useI18n as we, useProjects as Te, useRecordSheet as Ee, useRelatedRecords as De } from "@museumwnf/viewer-core";
6
- import { useRoute as Oe } from "vue-router";
7
- //#region src/content/ShortDescription.vue
8
- var w = ["dir"], ke = ["aria-expanded"], T = ["innerHTML"], Ae = {
9
- __name: "ShortDescription",
10
- props: {
11
- html: {
12
- type: String,
13
- required: !0
14
- },
15
- dir: {
16
- type: String,
17
- default: void 0
18
- }
19
- },
20
- setup(e) {
21
- let t = e, { t: n } = b(), r = m(!1);
22
- return y(() => t.html, () => {
23
- r.value = !1;
24
- }), (t, i) => (p(), c("div", {
25
- class: "mwnf-sheet__short",
26
- dir: e.dir
27
- }, [l("button", {
28
- type: "button",
29
- class: "mwnf-sheet__toggle",
30
- "aria-expanded": r.value ? "true" : "false",
31
- onClick: i[0] ||= (e) => r.value = !r.value
32
- }, _(r.value ? v(n)("record.action.hideShortDescription") : v(n)("record.action.viewShortDescription")), 9, ke), r.value ? (p(), c("div", {
33
- key: 0,
34
- class: "mwnf-sheet__block",
35
- innerHTML: e.html
36
- }, null, 8, T)) : s("", !0)], 8, w));
37
- }
38
- };
39
- //#endregion
40
- //#region src/views/pictureLimit.js
41
- function E(e, t, n) {
42
- let r = typeof t == "function" ? t(n) : t;
43
- return Number.isInteger(r) && r > 0 ? e.slice(0, r) : e;
44
- }
45
- //#endregion
46
- //#region src/views/RecordView.vue
47
- var je = ["dir", "innerHTML"], Me = { class: "mwnf-record__body" }, Ne = { class: "mwnf-record__main" }, Pe = {
48
- key: 1,
49
- class: "mwnf-record__status"
50
- }, Fe = {
51
- key: 0,
52
- class: "mwnf-record__aside"
53
- }, Ie = {
54
- key: 2,
55
- class: "mwnf-record__status"
56
- }, D = {
57
- __name: "RecordView",
58
- props: {
59
- spec: {
60
- type: Object,
61
- required: !0
62
- },
63
- id: {
64
- type: String,
65
- required: !0
66
- },
67
- entity: {
68
- type: String,
69
- default: ""
70
- }
71
- },
72
- setup(m) {
73
- let y = m, { t: b, tIn: w, locale: ke } = we(), T = Se(), D = Te(), Le = le(), Re = Oe(), O = y.spec.entity ?? y.entity, k = a(() => y.spec), ze = me(O), Be = x(O), A = a(() => Be.value.get(y.id) ?? null), Ve = a(() => ze.value !== null), j = y.spec.creditPeople ? y.spec.creditPeople.entity ?? "authors" : null;
74
- j && ge([j]).catch(() => {});
75
- let He = j ? x(j) : null, { language: M, languages: Ue, dir: N, select: P, text: F, ready: I, terms: We, glossary: L, attribution: R } = Ee(A, {
76
- entity: O,
77
- translations: [...y.spec.translations ?? [], ...j ? [j] : []],
78
- attribution: y.spec.attribution ?? []
79
- }), z = a(() => he(Ue.value)), { active: B, onClick: V, close: Ge } = Ce(We), Ke = a(() => B.value ? S(B.value.definition, { breaks: !0 }) : ""), H = (e, t) => T.tr(e, t, M.value, "en"), U = (e) => T.translations(e, M.value), W = a(() => ({
80
- record: A.value,
81
- text: F.value,
82
- language: M.value,
83
- languages: z.value,
84
- select: P,
85
- dir: N.value,
86
- glossary: L.value,
87
- ready: I.value,
88
- attribution: R.value,
89
- t: b,
90
- tIn: (e) => w ? w(M.value, e) : b(e),
91
- tr: H,
92
- translations: U
93
- })), G = (e) => k.value.labelsInRecordLanguage && w ? w(M.value, e) : b(e);
94
- function K(e) {
95
- return ((typeof e == "function" ? e(W.value) : e) ?? []).map((e) => ({
96
- ...e,
97
- label: e.label ? G(e.label) : ""
98
- }));
99
- }
100
- let q = a(() => A.value ? be(K(k.value.fields), W.value) : []), J = a(() => A.value ? be(K(k.value.sections).map((e) => ({
101
- render: "block",
102
- ...e
103
- })), W.value) : []), Y = a(() => k.value.shortDescriptionAfter ?? "description"), qe = a(() => !q.value.some((e) => e.key === Y.value) && J.value.some((e) => e.key === Y.value)), Je = a(() => k.value.shortDescription === !1 ? "" : k.value.shortDescription ?? "short_description"), X = a(() => {
104
- let e = Je.value ? F.value[Je.value] : "";
105
- return e ? { html: S(String(e), {
106
- breaks: !0,
107
- glossary: L.value
108
- }) } : null;
109
- }), Ye = a(() => {
110
- if (!A.value) return "";
111
- if (k.value.title) return k.value.title(W.value);
112
- let e = F.value.name ?? A.value.internal_name ?? A.value.id;
113
- return C(String(e), { glossary: L.value });
114
- }), Xe = a(() => A.value ? E(Ze(), k.value.pictureLimit, W.value) : []);
115
- function Ze() {
116
- if (k.value.media) return k.value.media(A.value, W.value);
117
- let e = ye(String(F.value.name ?? A.value.internal_name ?? ""));
118
- return ve(A.value.images, M.value).map((t) => ({
119
- url: t.url,
120
- alt: t.captions?.[M.value] ?? e,
121
- caption: t.captions?.[M.value] ?? "",
122
- ..._e(t, M.value)
123
- }));
124
- }
125
- let Qe = [
126
- {
127
- field: "author",
128
- label: "sheet.field.preparedBy"
129
- },
130
- {
131
- field: "copy_editor",
132
- label: "sheet.field.copyeditedBy"
133
- },
134
- {
135
- field: "translator",
136
- label: "sheet.field.translationBy"
137
- },
138
- {
139
- field: "translation_copy_editor",
140
- label: "sheet.field.translationCopyeditedBy"
141
- }
142
- ];
143
- function $e(e) {
144
- let t = k.value.creditNames ? F.value.credit_names?.[e] : null;
145
- return t?.length ? pe(t) : F.value[e] ?? R.value[e] ?? "";
146
- }
147
- function et(e) {
148
- let t = He ? F.value.credit_ids?.[e] : null;
149
- if (!t?.length) return null;
150
- let n = U(j), r = t.map((e) => {
151
- let t = He.value.get(e);
152
- if (!t) return null;
153
- let r = t.name ?? "";
154
- return {
155
- name: M.value === "ar" && t.originalname ? t.originalname : r,
156
- heading: [t.firstname, t.lastname].filter(Boolean).join(" ") || r,
157
- biography: n?.[e]?.curriculum ?? ""
158
- };
159
- });
160
- return r.every(Boolean) ? r : null;
161
- }
162
- let tt = a(() => (k.value.credits ?? Qe).map(({ field: e, label: t }) => ({
163
- label: G(t),
164
- value: $e(e),
165
- people: et(e)
166
- })).filter((e) => e.value)), nt = a(() => String(A.value?.[k.value.workingNumber ?? "mwnf_reference"] ?? ""));
167
- function rt(e) {
168
- if (e?.permalink !== !1) return typeof e?.permalink == "string" ? e.permalink : xe(Re) ?? void 0;
169
- }
170
- let it = a(() => {
171
- let e = k.value.citation;
172
- return !A.value || typeof e?.format != "function" ? "" : e.format(W.value, {
173
- permalink: rt(e),
174
- year: (/* @__PURE__ */ new Date()).getFullYear()
175
- });
176
- }), at = a(() => {
177
- let e = k.value.citation;
178
- if (!A.value || e === !1 || typeof e?.format == "function") return "";
179
- let t = typeof e?.project == "function" ? null : e?.project ?? A.value.project_id, n = typeof e?.project == "function" ? e.project(A.value, W.value) : D.label(t);
180
- return fe({
181
- author: $e("author") || void 0,
182
- name: F.value.name ?? A.value.internal_name ?? "",
183
- project: n,
184
- permalink: rt(e),
185
- inWord: b("record.citation.in")
186
- });
187
- }), Z = De(A, {
188
- entity: O,
189
- language: M
190
- }), Q = a(() => k.value.related === !1 ? null : k.value.related ?? {}), $ = a(() => {
191
- if (!Q.value) return [];
192
- let e = Q.value.record ?? ot;
193
- return Z.value.inPackage.map((t) => e(t, W.value));
194
- });
195
- function ot({ record: e, justification: t }) {
196
- let n = H(O, e.id).name ?? e.internal_name ?? e.id;
197
- return {
198
- id: e.id,
199
- image: e.images?.[0]?.url ?? "",
200
- imageAlt: ye(String(n)),
201
- name: C(String(n)),
202
- meta: t ? [t] : [],
203
- badge: e.type ?? "",
204
- to: {
205
- name: k.value.route ?? (y.entity ? `${y.entity}-detail` : "item"),
206
- params: { id: e.id }
207
- }
208
- };
209
- }
210
- let st = /* @__PURE__ */ new Set([
211
- "header",
212
- "before-sheet",
213
- "after-sheet",
214
- "aside",
215
- "source",
216
- "related",
217
- "after",
218
- "default"
219
- ]), ct = a(() => Object.keys(Le).filter((e) => !st.has(e)));
220
- return (a, m) => Ve.value && !A.value ? (p(), o(v(de), { key: 0 })) : A.value ? (p(), c("article", {
221
- key: 1,
222
- class: ce(["mwnf-record", { "mwnf-record--spaced": k.value.spaced }]),
223
- onClick: m[0] ||= (...e) => v(V) && v(V)(...e)
224
- }, [
225
- g(a.$slots, "header", f(d(W.value)), () => [
226
- k.value.back ? (p(), o(n, {
227
- key: 0,
228
- class: "mwnf-record__back",
229
- to: k.value.back.to,
230
- href: k.value.back.href
231
- }, {
232
- default: ue(() => [oe("← " + _(v(b)(k.value.back.label)), 1)]),
233
- _: 1
234
- }, 8, ["to", "href"])) : s("", !0),
235
- u(t, {
236
- languages: z.value,
237
- language: v(M),
238
- onSelect: v(P)
239
- }, null, 8, [
240
- "languages",
241
- "language",
242
- "onSelect"
243
- ]),
244
- l("h1", {
245
- class: "mwnf-record__title",
246
- dir: v(N) || void 0,
247
- innerHTML: Ye.value
248
- }, null, 8, je)
249
- ]),
250
- l("div", Me, [l("div", Ne, [
251
- Xe.value.length ? (p(), o(i, {
252
- key: 0,
253
- images: Xe.value,
254
- variant: k.value.mediaVariant ?? ""
255
- }, null, 8, ["images", "variant"])) : s("", !0),
256
- v(I) ? s("", !0) : (p(), c("p", Pe, _(v(b)("core.status.loading")), 1)),
257
- g(a.$slots, "before-sheet", f(d(W.value))),
258
- u(ne, {
259
- rows: q.value,
260
- layout: k.value.layout ?? "table",
261
- dir: v(N),
262
- "short-description": X.value,
263
- "short-description-after": Y.value
264
- }, ae({ _: 2 }, [h(ct.value, (e) => ({
265
- name: e,
266
- fn: ue((t) => [g(a.$slots, e, f(d({
267
- ...t,
268
- ...W.value
269
- })))])
270
- }))]), 1032, [
271
- "rows",
272
- "layout",
273
- "dir",
274
- "short-description",
275
- "short-description-after"
276
- ]),
277
- (p(!0), c(ie, null, h(J.value, (e) => (p(), c(ie, { key: e.key }, [
278
- u(ee, {
279
- heading: e.label,
280
- html: e.html,
281
- dir: v(N)
282
- }, null, 8, [
283
- "heading",
284
- "html",
285
- "dir"
286
- ]),
287
- X.value && qe.value && e.key === Y.value ? (p(), o(Ae, {
288
- key: 0,
289
- html: X.value.html,
290
- dir: v(N)
291
- }, null, 8, ["html", "dir"])) : s("", !0),
292
- g(a.$slots, `after-${e.key}`, se({ ref_for: !0 }, W.value))
293
- ], 64))), 128)),
294
- g(a.$slots, "after-sheet", f(d(W.value))),
295
- u(e, {
296
- credits: tt.value,
297
- "working-number": nt.value,
298
- "working-number-label": G(k.value.workingNumberLabel ?? "sheet.field.workingNumber"),
299
- citation: at.value,
300
- "citation-html": it.value,
301
- "citation-heading": k.value.citation?.heading ? G(k.value.citation.heading) : ""
302
- }, null, 8, [
303
- "credits",
304
- "working-number",
305
- "working-number-label",
306
- "citation",
307
- "citation-html",
308
- "citation-heading"
309
- ]),
310
- g(a.$slots, "source", f(d(W.value)), () => [u(r)]),
311
- g(a.$slots, "related", f(d({
312
- ...W.value,
313
- records: $.value,
314
- outside: v(Z).outside
315
- })), () => [Q.value ? (p(), o(te, {
316
- key: 0,
317
- heading: v(b)(Q.value.heading ?? "record.related.items"),
318
- records: $.value,
319
- variant: Q.value.variant ?? "list",
320
- "action-label": Q.value.actionLabel ? v(b)(Q.value.actionLabel) : ""
321
- }, null, 8, [
322
- "heading",
323
- "records",
324
- "variant",
325
- "action-label"
326
- ])) : s("", !0)])
327
- ]), a.$slots.aside ? (p(), c("aside", Fe, [g(a.$slots, "aside", f(d({
328
- ...W.value,
329
- records: $.value,
330
- outside: v(Z).outside
331
- })))])) : s("", !0)]),
332
- g(a.$slots, "after", f(d(W.value))),
333
- u(re, {
334
- term: v(B),
335
- html: Ke.value,
336
- dir: v(N),
337
- onClose: v(Ge)
338
- }, null, 8, [
339
- "term",
340
- "html",
341
- "dir",
342
- "onClose"
343
- ])
344
- ], 2)) : (p(), c("p", Ie, _(v(b)("core.status.loading")), 1));
345
- }
346
- };
347
- //#endregion
348
- export { E as n, D as t };