@museumwnf/viewer-layout 2.13.0 → 2.15.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.
package/dist/views.js CHANGED
@@ -1,15 +1,16 @@
1
- import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _ } from "./TimelineEventList-59g_1ksf.js";
2
- import { Fragment as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as w, createTextVNode as T, createVNode as E, guardReactiveProps as D, isRef as O, mergeProps as k, normalizeClass as ee, normalizeProps as A, openBlock as j, reactive as M, ref as N, renderList as P, renderSlot as F, resolveDynamicComponent as I, toDisplayString as L, unref as R, useSlots as te, vModelCheckbox as z, vModelRadio as B, vModelSelect as V, vModelText as H, watch as ne, withCtx as U, withDirectives as W } from "vue";
3
- import { I18nText as re, NotFoundView as G, byId as ie, centuryPresets as K, citation as ae, dateRange as q, entityRef as oe, eventDateLabel as se, glossaryEntries as J, glossaryTermsForText as ce, groupByCountry as Y, languageLabels as X, md as Z, mdInline as Q, partnerHierarchy as le, projectName as ue, renderBlock as de, renderInline as $, renderPlain as fe, sheetRows as pe, sortChronological as me, sourceUrl as he, useCollectionTree as ge, useDataPackage as _e, useFacets as ve, useFeaturedRecord as ye, useGlossaryPopup as be, useI18n as xe, useListQuery as Se, useLocale as Ce, usePagination as we, useProjects as Te, useRecordLanguage as Ee, useRecordSheet as De, useRelatedRecords as Oe, useSearchLanguage as ke, useSiteConfig as Ae, useTimelineEvents as je, yearBuckets as Me } from "@museumwnf/viewer-core";
4
- import { useRoute as Ne, useRouter as Pe } from "vue-router";
1
+ import { a as e, i as t, n, o as r, t as i } from "./TimelineLookup-DRc43FkL.js";
2
+ import { a, g as o, i as s, m as ee, n as te, r as c, s as l } from "./TimelineEventList-BmfLBaTT.js";
3
+ import { a as u, i as d, n as f, o as p, r as m, t as ne } from "./TimelineResultsView-D78PPWk-.js";
4
+ import { Fragment as h, computed as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createSlots as x, createTextVNode as S, createVNode as C, guardReactiveProps as w, mergeProps as T, normalizeClass as E, normalizeProps as D, openBlock as O, ref as k, renderList as A, renderSlot as j, toDisplayString as M, unref as N, useSlots as re, watch as P, withCtx as F } from "vue";
5
+ import { I18nText as ie, NotFoundView as ae, byId as oe, entityRef as se, glossaryEntries as ce, glossaryTermsForText as le, mdInline as I, mwnfLinks as L, renderBlock as ue, renderInline as de, renderPlain as fe, useCollectionTree as pe, useDataPackage as me, useFeaturedRecord as R, useGlossaryPopup as he, useI18n as ge, useProjects as z, useRecordLanguage as _e, useSiteConfig as B } from "@museumwnf/viewer-core";
5
6
  //#region src/views/HomeView.vue
6
- var Fe = { class: "mwnf-home" }, Ie = {
7
+ var V = { class: "mwnf-home" }, ve = {
7
8
  key: 0,
8
9
  class: "mwnf-home__welcome"
9
- }, Le = {
10
+ }, ye = {
10
11
  key: 0,
11
12
  class: "mwnf-home__title"
12
- }, Re = {
13
+ }, H = {
13
14
  __name: "HomeView",
14
15
  props: {
15
16
  title: {
@@ -30,11 +31,11 @@ var Fe = { class: "mwnf-home" }, Ie = {
30
31
  }
31
32
  },
32
33
  setup(t) {
33
- let n = t, { t: r, locale: i } = xe(), o = Ae(), s = y(() => ({
34
+ let n = t, { t: i, locale: a } = ge(), o = B(), s = g(() => ({
34
35
  ...o.home ?? {},
35
- ...c(n)
36
+ ...ee(n)
36
37
  }));
37
- function c(e) {
38
+ function ee(e) {
38
39
  let t = {};
39
40
  for (let n of [
40
41
  "title",
@@ -44,272 +45,87 @@ var Fe = { class: "mwnf-home" }, Ie = {
44
45
  ]) e[n] != null && e[n] !== "" && (t[n] = e[n]);
45
46
  return t;
46
47
  }
47
- let l = y(() => (s.value.cards ?? []).map((e) => ({
48
+ let te = g(() => (s.value.cards ?? []).map((e) => ({
48
49
  ...e,
49
- title: e.title ? r(e.title) : "",
50
- description: e.description ? r(e.description) : "",
51
- action: e.action ? r(e.action) : ""
52
- }))), u = y(() => s.value.featured ?? null), d = u.value?.entity ?? "", f = _e();
53
- d && f.loadTranslations(d, "en");
54
- let p = d ? ye(d, {
55
- seed: u.value?.seed,
56
- images: u.value?.images ?? "images"
57
- }) : y(() => null), m = y(() => p.value ? f.tr(d, p.value.id, i.value, "en") : {});
58
- function h(e, t, n) {
50
+ title: e.title ? i(e.title) : "",
51
+ description: e.description ? i(e.description) : "",
52
+ action: e.action ? i(e.action) : ""
53
+ }))), c = g(() => s.value.featured ?? null), l = c.value?.entity ?? "", u = me();
54
+ l && u.loadTranslations(l, "en");
55
+ let d = l ? R(l, {
56
+ seed: c.value?.seed,
57
+ images: c.value?.images ?? "images"
58
+ }) : g(() => null), f = g(() => d.value ? u.tr(l, d.value.id, a.value, "en") : {});
59
+ function p(e, t, n) {
59
60
  return typeof e == "function" ? e(t, n) : typeof e != "string" || !e ? "" : n[e] ?? t[e] ?? "";
60
61
  }
61
- let g = y(() => {
62
- let e = p.value, t = u.value;
62
+ let m = g(() => {
63
+ let e = d.value, t = c.value;
63
64
  if (!e || !t) return null;
64
- let n = m.value.name ?? e.internal_name ?? e.id, i = typeof t.meta == "function" ? t.meta(e, m.value) : (t.meta ?? []).map((t) => h(t, e, m.value)), a = t.images ?? "images";
65
+ let n = f.value.name ?? e.internal_name ?? e.id, r = typeof t.meta == "function" ? t.meta(e, f.value) : (t.meta ?? []).map((t) => p(t, e, f.value)), a = t.images ?? "images";
65
66
  return {
66
- heading: t.heading ? r(t.heading) : "",
67
+ heading: t.heading ? i(t.heading) : "",
67
68
  image: e[a]?.[0]?.url ?? "",
68
69
  imageAlt: fe(String(n)),
69
- eyebrow: String(h(t.eyebrow, e, m.value) ?? ""),
70
- name: $(String(n)),
71
- meta: i.filter(Boolean).map(String),
72
- action: t.action ? r(t.action) : "",
70
+ eyebrow: String(p(t.eyebrow, e, f.value) ?? ""),
71
+ name: de(String(n)),
72
+ meta: r.filter(Boolean).map(String),
73
+ action: t.action ? i(t.action) : "",
73
74
  to: typeof t.to == "function" ? t.to(e) : {
74
75
  name: t.route ?? "item",
75
76
  params: { id: e.id }
76
77
  }
77
78
  };
78
79
  });
79
- return (t, n) => (j(), S("section", Fe, [
80
- s.value.title || s.value.intro ? (j(), S("header", Ie, [s.value.title ? (j(), S("h1", Le, L(R(r)(s.value.title)), 1)) : x("", !0), s.value.intro ? (j(), b(R(re), {
80
+ return (t, n) => (O(), y("section", V, [
81
+ s.value.title || s.value.intro ? (O(), y("header", ve, [s.value.title ? (O(), y("h1", ye, M(N(i)(s.value.title)), 1)) : v("", !0), s.value.intro ? (O(), _(N(ie), {
81
82
  key: 1,
82
83
  tag: "div",
83
84
  class: "mwnf-home__intro",
84
85
  keypath: s.value.intro
85
- }, null, 8, ["keypath"])) : x("", !0)])) : x("", !0),
86
- F(t.$slots, "before"),
87
- E(e, { cards: l.value }, null, 8, ["cards"]),
88
- F(t.$slots, "default"),
89
- g.value ? (j(), b(a, A(k({ key: 1 }, g.value)), null, 16)) : x("", !0),
90
- F(t.$slots, "after")
86
+ }, null, 8, ["keypath"])) : v("", !0)])) : v("", !0),
87
+ j(t.$slots, "before"),
88
+ C(r, { cards: te.value }, null, 8, ["cards"]),
89
+ j(t.$slots, "default"),
90
+ m.value ? (O(), _(e, D(T({ key: 1 }, m.value)), null, 16)) : v("", !0),
91
+ j(t.$slots, "after")
91
92
  ]));
92
93
  }
93
- }, ze = { class: "mwnf-catalogue" }, Be = {
94
- key: 0,
95
- class: "mwnf-catalogue__title"
96
- }, Ve = {
94
+ }, U = {
97
95
  key: 0,
98
- class: "mwnf-facet"
99
- }, He = {
96
+ class: "mwnf-sheet-source"
97
+ }, W = {
100
98
  key: 0,
101
- class: "mwnf-facet__label"
102
- }, Ue = [
103
- "value",
104
- "placeholder",
105
- "onInput"
106
- ], We = {
99
+ class: "mwnf-sheet-source__line"
100
+ }, be = {
107
101
  key: 1,
108
- class: "mwnf-facet"
109
- }, Ge = {
110
- key: 0,
111
- class: "mwnf-facet__label"
112
- }, Ke = [
113
- "value",
114
- "placeholder",
115
- "onInput"
116
- ], qe = {
102
+ class: "mwnf-sheet-source__uid"
103
+ }, xe = {
117
104
  key: 2,
118
- class: "mwnf-facet mwnf-facet--checkbox"
119
- }, Je = ["checked", "onChange"], Ye = {
105
+ class: "mwnf-sheet-source__collection"
106
+ }, Se = ["href"], Ce = {
107
+ key: 1,
108
+ class: "mwnf-sheet-notice"
109
+ }, we = { key: 1 }, Te = {
120
110
  key: 0,
121
- class: "mwnf-facet__label"
122
- }, Xe = { class: "mwnf-catalogue__body" }, Ze = { class: "mwnf-catalogue__results" }, Qe = {
111
+ class: "mwnf-sheet-related"
112
+ }, Ee = {
123
113
  key: 0,
124
- class: "mwnf-catalogue__aside"
125
- }, $e = {
126
- __name: "CatalogueResultsView",
127
- props: {
128
- spec: {
129
- type: Object,
130
- required: !0
131
- },
132
- entity: {
133
- type: String,
134
- default: ""
135
- }
136
- },
137
- setup(e) {
138
- let t = e, { t: n, locale: a } = xe(), s = _e(), c = t.spec.entity ?? t.entity, u = y(() => t.spec), d = oe(c);
139
- c && s.loadTranslations(c, "en");
140
- let p = y(() => u.value.keys ?? [...Object.keys(u.value.facets ?? {}), ...m()]);
141
- function m() {
142
- let e = u.value.dates;
143
- return e ? [e.begin ?? "begin", e.end ?? "end"] : [];
144
- }
145
- let { filters: h, page: _, active: O, apply: k, reset: ee, goToPage: M } = Se({ keys: p.value }), N = {
146
- t: n,
147
- locale: a,
148
- tr: (e, t) => s.tr(e, t, a.value, "en"),
149
- renderInline: $,
150
- renderPlain: fe
151
- };
152
- function te(e, t) {
153
- if (typeof t.values == "function") return [t.values(e)].flat();
154
- let n = e?.[t.field];
155
- return Array.isArray(n) ? n : [n];
156
- }
157
- let z = y(() => {
158
- let e = u.value, t = d.value ?? [];
159
- e.scope && (t = t.filter((t) => e.scope(t, h, N)));
160
- for (let [n, r] of Object.entries(e.facets ?? {})) {
161
- let e = h[n];
162
- e && (t = t.filter((t) => te(t, r).map(String).includes(String(e))));
163
- }
164
- e.match && (t = t.filter((t) => e.match(t, h, N))), e.narrow && (t = e.narrow(t, h, N)), e.dates && (t = q(t, {
165
- begin: h[e.dates.begin ?? "begin"],
166
- end: h[e.dates.end ?? "end"],
167
- mode: e.dates.mode ?? "overlap",
168
- fields: e.dates.fields
169
- }));
170
- let n = e.sort ?? "chronological";
171
- return typeof n == "function" ? n(t) : n === "chronological" ? me(t) : n && typeof n == "object" ? me(t, n) : t;
172
- }), B = y(() => u.value.facetScope === "matching" ? z.value : d.value ?? []), V = ve(B, () => u.value.facets ?? {}), H = we(z, {
173
- page: _,
174
- size: () => u.value.pageSize ?? 20
175
- }), ne = y(() => u.value.recordRoute ?? (t.entity ? `${t.entity}-detail` : "item"));
176
- function W(e) {
177
- let t = N.tr(c, e.id).name ?? e.internal_name ?? e.id;
178
- return {
179
- id: e.id,
180
- image: e.images?.[0]?.url ?? "",
181
- imageAlt: fe(String(t)),
182
- name: $(String(t)),
183
- meta: [],
184
- badge: e.type ?? "",
185
- to: {
186
- name: ne.value,
187
- params: { id: e.id }
188
- }
189
- };
190
- }
191
- let re = y(() => H.value.rows.map((e) => (u.value.record ?? W)(e, N))), G = y(() => ({
192
- filters: h,
193
- active: O.value,
194
- apply: k,
195
- reset: ee,
196
- goToPage: M,
197
- matching: z.value,
198
- pageInfo: H.value,
199
- options: V.value
200
- })), ie = y(() => {
201
- let e = u.value;
202
- return e.summary ? e.summary({
203
- ...G.value,
204
- t: n,
205
- total: (d.value ?? []).length
206
- }) : [{
207
- label: n(e.summaryLabel ?? "catalogue.results.itemsFound"),
208
- count: H.value.total
209
- }];
210
- }), K = y(() => u.value.filterMode ?? "apply"), ae = y(() => u.value.controls ?? []), se = y(() => ae.value.length > 0 || !!u.value.panel);
211
- function J(e, t) {
212
- K.value === "immediate" ? k({ [e]: t }) : h[e] = t;
213
- }
214
- let ce = y(() => n(u.value.empty ?? "catalogue.results.noResultsFilter")), Y = y(() => u.value.variant === "grid"), X = y(() => ({
215
- window: 5,
216
- jump: !1,
217
- ends: !0,
218
- ...u.value.pagination ?? {}
219
- }));
220
- return (e, t) => (j(), S("section", ze, [
221
- F(e.$slots, "before", A(D(G.value))),
222
- u.value.title ? (j(), S("h1", Be, L(R(n)(u.value.title)), 1)) : x("", !0),
223
- se.value || e.$slots.filters ? (j(), b(r, {
224
- key: 1,
225
- class: "mwnf-catalogue__filters",
226
- mode: K.value,
227
- title: u.value.filterTitle ? R(n)(u.value.filterTitle) : "",
228
- "reset-label": u.value.resetLabel ? R(n)(u.value.resetLabel) : "",
229
- onApply: t[2] ||= (e) => R(k)(),
230
- onReset: t[3] ||= (e) => R(ee)()
231
- }, {
232
- default: U(() => [(j(!0), S(v, null, P(ae.value, (e) => (j(), S(v, { key: e.key }, [e.type === "year" ? (j(), S("label", Ve, [e.label ? (j(), S("span", He, L(R(n)(e.label)), 1)) : x("", !0), C("input", {
233
- type: "number",
234
- class: "mwnf-facet__select",
235
- value: R(h)[e.key],
236
- placeholder: e.placeholder ? R(n)(e.placeholder) : "",
237
- onInput: (t) => R(h)[e.key] = t.target.value,
238
- onChange: t[0] ||= (e) => K.value === "immediate" ? R(k)() : null
239
- }, null, 40, Ue)])) : e.type === "query" ? (j(), S("label", We, [e.label ? (j(), S("span", Ge, L(R(n)(e.label)), 1)) : x("", !0), C("input", {
240
- type: "text",
241
- class: "mwnf-facet__select",
242
- value: R(h)[e.key],
243
- placeholder: e.placeholder ? R(n)(e.placeholder) : "",
244
- onInput: (t) => R(h)[e.key] = t.target.value,
245
- onChange: t[1] ||= (e) => K.value === "immediate" ? R(k)() : null
246
- }, null, 40, Ke)])) : e.type === "checkbox" ? (j(), S("label", qe, [C("input", {
247
- type: "checkbox",
248
- class: "mwnf-facet__checkbox",
249
- checked: R(h)[e.key] === "1",
250
- onChange: (t) => J(e.key, t.target.checked ? "1" : "")
251
- }, null, 40, Je), e.label ? (j(), S("span", Ye, L(R(n)(e.label)), 1)) : x("", !0)])) : (j(), b(i, {
252
- key: 3,
253
- "model-value": R(h)[e.key],
254
- label: e.label ? R(n)(e.label) : "",
255
- options: R(V)[e.key] ?? [],
256
- placeholder: e.placeholder ? R(n)(e.placeholder) : "",
257
- "any-label": e.anyLabel ? R(n)(e.anyLabel) : "",
258
- "hide-empty": !!e.hideEmpty,
259
- "onUpdate:modelValue": (t) => J(e.key, t)
260
- }, null, 8, [
261
- "model-value",
262
- "label",
263
- "options",
264
- "placeholder",
265
- "any-label",
266
- "hide-empty",
267
- "onUpdate:modelValue"
268
- ]))], 64))), 128)), F(e.$slots, "filters", A(D(G.value)))]),
269
- _: 3
270
- }, 8, [
271
- "mode",
272
- "title",
273
- "reset-label"
274
- ])) : x("", !0),
275
- E(g, { parts: ie.value }, w({ _: 2 }, [e.$slots.actions ? {
276
- name: "actions",
277
- fn: U(() => [F(e.$slots, "actions", A(D(G.value)))]),
278
- key: "0"
279
- } : void 0]), 1032, ["parts"]),
280
- C("div", Xe, [C("div", Ze, [(j(), b(I(Y.value ? l : o), {
281
- records: re.value,
282
- "action-label": u.value.actionLabel ? R(n)(u.value.actionLabel) : ""
283
- }, {
284
- empty: U(() => [F(e.$slots, "empty", A(D(G.value)), () => [T(L(ce.value), 1)])]),
285
- _: 3
286
- }, 8, ["records", "action-label"])), E(f, {
287
- "page-info": R(H),
288
- window: X.value.window,
289
- jump: X.value.jump,
290
- ends: X.value.ends,
291
- onNavigate: R(M)
292
- }, null, 8, [
293
- "page-info",
294
- "window",
295
- "jump",
296
- "ends",
297
- "onNavigate"
298
- ])]), e.$slots.aside ? (j(), S("aside", Qe, [F(e.$slots, "aside", A(D(G.value)))])) : x("", !0)]),
299
- F(e.$slots, "after", A(D(G.value)))
300
- ]));
301
- }
302
- }, et = ["dir", "innerHTML"], tt = { class: "mwnf-record__body" }, nt = { class: "mwnf-record__main" }, rt = {
114
+ class: "mwnf-sheet-related__heading mwnf-sheet-related__heading--caps"
115
+ }, De = {
303
116
  key: 1,
304
- class: "mwnf-record__status"
305
- }, it = {
117
+ class: "mwnf-sheet-related__description"
118
+ }, Oe = {
306
119
  key: 0,
307
- class: "mwnf-record__aside"
308
- }, at = {
120
+ class: "mwnf-sheet-related__references"
121
+ }, ke = { key: 2 }, Ae = {
122
+ key: 3,
123
+ class: "mwnf-sheet-related__unresolved"
124
+ }, je = {
309
125
  key: 2,
310
- class: "mwnf-record__status"
311
- }, ot = {
312
- __name: "RecordView",
126
+ class: "mwnf-sheet-related__line"
127
+ }, Me = ["href"], Ne = ["href"], G = { key: 7 }, Pe = { class: "mwnf-sheet-related__heading" }, Fe = { key: 0 }, Ie = { class: "mwnf-sheet-related__subheading" }, Le = ["href"], Re = { key: 1 }, ze = { class: "mwnf-sheet-related__unresolved" }, Be = { key: 1 }, K = { class: "mwnf-sheet-related__subheading" }, q = ["href"], J = { key: 1 }, Ve = { class: "mwnf-sheet-related__unresolved" }, He = { key: 8 }, Y = { class: "mwnf-sheet-related__heading" }, Ue = { class: "mwnf-sheet-related__line" }, We = ["href"], X = { key: 9 }, Z = { class: "mwnf-sheet-related__heading" }, Ge = { class: "mwnf-sheet-related__line" }, Q = ["href"], Ke = { key: 10 }, qe = { class: "mwnf-sheet-related__heading" }, Je = {
128
+ __name: "RecordSheetView",
313
129
  props: {
314
130
  spec: {
315
131
  type: Object,
@@ -322,271 +138,265 @@ var Fe = { class: "mwnf-home" }, Ie = {
322
138
  entity: {
323
139
  type: String,
324
140
  default: ""
141
+ },
142
+ dataGetter: {
143
+ type: Function,
144
+ default: null
325
145
  }
326
146
  },
327
147
  setup(e) {
328
- let r = e, { t: i, locale: a } = xe(), o = _e(), l = Te(), f = te(), h = Ne(), g = r.spec.entity ?? r.entity, O = y(() => r.spec), k = oe(g), ee = ie(g), M = y(() => ee.value.get(r.id) ?? null), N = y(() => k.value !== null), { language: I, languages: z, dir: B, select: V, text: H, ready: ne, terms: W, glossary: re, attribution: K } = De(M, {
329
- entity: g,
330
- translations: r.spec.translations ?? [],
331
- attribution: r.spec.attribution ?? []
332
- }), q = y(() => X(z.value)), { active: se, onClick: J, close: ce } = be(W), Y = y(() => se.value ? de(se.value.definition, { breaks: !0 }) : ""), Z = (e, t) => o.tr(e, t, I.value, "en"), Q = y(() => ({
333
- record: M.value,
334
- text: H.value,
335
- language: I.value,
336
- languages: q.value,
337
- select: V,
338
- dir: B.value,
339
- glossary: re.value,
340
- ready: ne.value,
341
- attribution: K.value,
342
- t: i,
343
- tr: Z
344
- }));
345
- function le(e) {
346
- return ((typeof e == "function" ? e(Q.value) : e) ?? []).map((e) => ({
347
- ...e,
348
- label: e.label ? i(e.label) : ""
349
- }));
350
- }
351
- let me = y(() => M.value ? pe(le(O.value.fields), Q.value) : []), ge = y(() => M.value ? pe(le(O.value.sections).map((e) => ({
352
- render: "block",
353
- ...e
354
- })), Q.value) : []), ve = y(() => O.value.shortDescription === !1 ? "" : O.value.shortDescription ?? "short_description"), ye = y(() => {
355
- let e = ve.value ? H.value[ve.value] : "";
356
- return e ? { html: de(String(e), {
357
- breaks: !0,
358
- glossary: re.value
359
- }) } : null;
360
- }), Se = y(() => {
361
- if (!M.value) return "";
362
- if (O.value.title) return O.value.title(Q.value);
363
- let e = H.value.name ?? M.value.internal_name ?? M.value.id;
364
- return $(String(e), { glossary: re.value });
365
- }), Ce = y(() => {
366
- if (!M.value) return [];
367
- if (O.value.media) return O.value.media(M.value, Q.value);
368
- let e = fe(String(H.value.name ?? M.value.internal_name ?? ""));
369
- return (M.value.images ?? []).map((t) => ({
370
- url: t.url,
371
- alt: t.captions?.[I.value] ?? e,
372
- caption: t.captions?.[I.value] ?? t.captions?.en ?? "",
373
- photographer: t.photographer ?? "",
374
- copyright: t.copyright ?? ""
375
- }));
376
- }), we = [
377
- {
378
- field: "author",
379
- label: "sheet.field.preparedBy"
380
- },
381
- {
382
- field: "copy_editor",
383
- label: "sheet.field.copyeditedBy"
384
- },
385
- {
386
- field: "translator",
387
- label: "sheet.field.translationBy"
388
- },
389
- {
390
- field: "translation_copy_editor",
391
- label: "sheet.field.translationCopyeditedBy"
148
+ let r = e, a = re(), ee = /* @__PURE__ */ new Set([
149
+ "before-sheet",
150
+ "museum",
151
+ "related"
152
+ ]), te = g(() => Object.keys(a).filter((e) => !ee.has(e))), c = g(() => !r.dataGetter || r.dataGetter(r.id) != null), { t: d } = ge(), f = g(() => r.spec), p = z(), m = (e, t) => (e.name ?? "").localeCompare(t.name ?? ""), ne = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "gallery").sort(m), T = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "exhibition").sort(m), k = (e) => p.links(e.project_id)?.artisticIntroductionUrl ?? null, P = (e) => p.links(e.project_id)?.relatedDatabaseUrl ?? null;
153
+ function ie(e, t) {
154
+ if (!e) return null;
155
+ let n = f.value.sourceDatabase === !1 ? null : f.value.sourceDatabase ?? null, r = null;
156
+ if (n) {
157
+ let i = n.chipClass ? n.chipClass(e, t) : null, a = p.label(e.project_id);
158
+ (i || a) && (r = {
159
+ chipClass: i,
160
+ name: a,
161
+ label: d(n.label ?? "record.sheet.sourceDatabase")
162
+ });
392
163
  }
393
- ], Ee = y(() => (O.value.credits ?? we).map(({ field: e, label: t }) => ({
394
- label: i(t),
395
- value: H.value[e] ?? K.value[e] ?? ""
396
- })).filter((e) => e.value)), ke = y(() => String(M.value?.[O.value.workingNumber ?? "mwnf_reference"] ?? "")), Ae = y(() => {
397
- let e = O.value.citation;
398
- if (!M.value || e === !1) return "";
399
- let t = typeof e?.project == "function" ? null : e?.project ?? M.value.project_id, n = typeof e?.project == "function" ? e.project(M.value, Q.value) : l.label(t) ?? ue(e?.project ?? M.value.project_key, i), r = e?.permalink === !1 ? void 0 : typeof e?.permalink == "string" ? e.permalink : he(h) ?? void 0;
400
- return ae({
401
- author: H.value.author ?? K.value.author,
402
- name: H.value.name ?? M.value.internal_name ?? "",
403
- project: n,
404
- permalink: r,
405
- inWord: i("record.citation.in")
406
- });
407
- }), je = Oe(M, {
408
- entity: g,
409
- language: I
410
- }), Me = y(() => O.value.related === !1 ? null : O.value.related ?? {}), Pe = y(() => {
411
- if (!Me.value) return [];
412
- let e = Me.value.record ?? Fe;
413
- return je.value.inPackage.map((t) => e(t, Q.value));
414
- });
415
- function Fe({ record: e, justification: t }) {
416
- let n = Z(g, e.id).name ?? e.internal_name ?? e.id;
164
+ let i = n && n.addToCollection !== !1 ? d(n.addToCollection?.label ?? "record.action.addToCollection") : null, a = n ? e.backward_compatibility ?? "" : "", o = f.value.notice === !1 ? null : f.value.notice ?? null, s = o && o.show(e, t) ? d(o.label) : null;
417
165
  return {
418
- id: e.id,
419
- image: e.images?.[0]?.url ?? "",
420
- imageAlt: fe(String(n)),
421
- name: $(String(n)),
422
- meta: t ? [t] : [],
423
- badge: e.type ?? "",
424
- to: {
425
- name: O.value.route ?? (r.entity ? `${r.entity}-detail` : "item"),
426
- params: { id: e.id }
166
+ source: r,
167
+ addToCollectionLabel: i,
168
+ notice: s,
169
+ backwardCompatibility: a
170
+ };
171
+ }
172
+ function oe(e, t) {
173
+ let n = f.value.museum === !1 ? null : f.value.museum ?? null;
174
+ return !n || !e ? null : {
175
+ to: n.route ? n.route(e, t) : null,
176
+ label: n.label ? n.label(e, t) : ""
177
+ };
178
+ }
179
+ function se(e, t) {
180
+ if (!e) return null;
181
+ let n = f.value.related ?? {}, i = t.records ?? [], a = t.outside ?? [], o = r.dataGetter ? i.filter((e) => r.dataGetter(e.id) != null) : i, s = r.dataGetter ? i.filter((e) => r.dataGetter(e.id) == null).map((t) => (e.related_items ?? []).find((e) => e.id === t.id)).filter(Boolean) : [], ee = [...a, ...s].map((e) => ({
182
+ ...e,
183
+ name: e.project_id ? p.label(e.project_id) : null,
184
+ chipClass: n.outsideChip ? n.outsideChip(e, t) : null
185
+ })), te = n.onDisplayIn && n.onDisplayIn !== !1 ? {
186
+ linkPendingLabel: d(n.onDisplayIn.linkPendingLabel),
187
+ galleries: ne(e),
188
+ exhibitions: T(e)
189
+ } : null, c = n.databaseLabel && P(e) ? {
190
+ url: P(e),
191
+ label: d(n.databaseLabel),
192
+ name: p.label(e.project_id)
193
+ } : null, l = n.overallDatabase && n.overallDatabase !== !1 ? {
194
+ label: d(n.overallDatabase.label),
195
+ linkLabel: d(n.overallDatabase.linkLabel)
196
+ } : null;
197
+ return {
198
+ title: n.title ? d(n.title) : "",
199
+ description: n.description ? d(n.description) : "",
200
+ heading: d(n.heading ?? "record.related.items"),
201
+ variant: n.variant ?? "grid",
202
+ actionLabel: n.actionLabel ? d(n.actionLabel) : "",
203
+ inPackage: o,
204
+ references: ee,
205
+ notInPackageLabel: n.notInPackageLabel ? d(n.notInPackageLabel) : "",
206
+ artisticIntroduction: n.artisticIntroductionLabel && k(e) ? {
207
+ url: k(e),
208
+ label: d(n.artisticIntroductionLabel)
209
+ } : null,
210
+ timeline: n.timeline ? n.timeline(e, t) : null,
211
+ glossary: n.glossary !== !1,
212
+ dynasties: n.dynasties ? n.dynasties(e, t.language, t) : null,
213
+ media: n.media === !1 ? [] : e.media ?? [],
214
+ onDisplayIn: te,
215
+ database: c,
216
+ overallDatabase: l,
217
+ download: n.download === !1 ? null : {
218
+ label: d("record.action.download"),
219
+ pdfLabel: d("record.action.downloadPdf")
427
220
  }
428
221
  };
429
222
  }
430
- let Ie = /* @__PURE__ */ new Set([
431
- "header",
432
- "before-sheet",
433
- "after-sheet",
434
- "aside",
435
- "source",
436
- "related",
437
- "after",
438
- "default"
439
- ]), Le = y(() => Object.keys(f).filter((e) => !Ie.has(e)));
440
- return (e, r) => N.value && !M.value ? (j(), b(R(G), { key: 0 })) : M.value ? (j(), S("article", {
441
- key: 1,
442
- class: "mwnf-record",
443
- onClick: r[0] ||= (...e) => R(J) && R(J)(...e)
444
- }, [
445
- F(e.$slots, "header", A(D(Q.value)), () => [
446
- O.value.back ? (j(), b(_, {
223
+ function ce() {
224
+ window.print();
225
+ }
226
+ return (r, a) => c.value ? (O(), _(u, {
227
+ key: 0,
228
+ spec: f.value,
229
+ id: e.id,
230
+ entity: e.entity
231
+ }, x({
232
+ "before-sheet": F((e) => [j(r.$slots, "before-sheet", D(w(e)), () => [(O(!0), y(h, null, A([ie(e.record, e)], (t) => (O(), y(h, { key: "before-sheet" }, [t?.source || t?.backwardCompatibility || t?.addToCollectionLabel ? (O(), y("div", U, [
233
+ t.source ? (O(), y("p", W, [t.source.chipClass ? (O(), y("span", {
447
234
  key: 0,
448
- class: "mwnf-record__back",
449
- to: O.value.back.to,
450
- href: O.value.back.href
235
+ class: E(["mwnf-chip", t.source.chipClass]),
236
+ "aria-hidden": "true"
237
+ }, null, 2)) : v("", !0), t.source.name ? (O(), y(h, { key: 1 }, [S(M(t.source.label) + ": " + M(t.source.name), 1)], 64)) : v("", !0)])) : v("", !0),
238
+ t.backwardCompatibility ? (O(), y("p", be, [b("code", null, M(t.backwardCompatibility), 1)])) : v("", !0),
239
+ t.addToCollectionLabel ? (O(), y("p", xe, [b("a", {
240
+ href: N(L).myCollection,
241
+ target: "_blank",
242
+ rel: "noopener"
243
+ }, "↗ " + M(t.addToCollectionLabel), 9, Se)])) : v("", !0)
244
+ ])) : v("", !0), t?.notice ? (O(), y("div", Ce, [S(M(t.notice) + " ", 1), b("strong", null, [b("em", null, M(e.languages.map((e) => e.label).join(", ")), 1)])])) : v("", !0)], 64))), 128))])]),
245
+ museum: F((e) => [j(r.$slots, "museum", D(w(e)), () => [(O(!0), y(h, null, A([oe(e.row?.value, e)], (e) => (O(), y(h, { key: "museum" }, [e?.to ? (O(), _(o, {
246
+ key: 0,
247
+ to: e.to
248
+ }, {
249
+ default: F(() => [S(M(e.label), 1)]),
250
+ _: 2
251
+ }, 1032, ["to"])) : e ? (O(), y("span", we, M(e.label), 1)) : v("", !0)], 64))), 128))])]),
252
+ related: F((e) => [j(r.$slots, "related", D(w(e)), () => [(O(!0), y(h, null, A([se(e.record, e)], (r) => (O(), y(h, { key: e.record?.id ?? "related" }, [r ? (O(), y("div", Te, [
253
+ r.title ? (O(), y("p", Ee, M(r.title), 1)) : v("", !0),
254
+ r.description ? (O(), y("p", De, M(r.description), 1)) : v("", !0),
255
+ C(s, {
256
+ heading: r.heading,
257
+ records: r.inPackage,
258
+ variant: r.variant,
259
+ "action-label": r.actionLabel
451
260
  }, {
452
- default: U(() => [T("← " + L(R(i)(O.value.back.label)), 1)]),
453
- _: 1
454
- }, 8, ["to", "href"])) : x("", !0),
455
- E(c, {
456
- languages: q.value,
457
- language: R(I),
458
- onSelect: R(V)
459
- }, null, 8, [
460
- "languages",
461
- "language",
462
- "onSelect"
463
- ]),
464
- C("h1", {
465
- class: "mwnf-record__title",
466
- dir: R(B) || void 0,
467
- innerHTML: Se.value
468
- }, null, 8, et)
469
- ]),
470
- C("div", tt, [C("div", nt, [
471
- Ce.value.length ? (j(), b(p, {
472
- key: 0,
473
- images: Ce.value,
474
- variant: O.value.mediaVariant ?? ""
475
- }, null, 8, ["images", "variant"])) : x("", !0),
476
- R(ne) ? x("", !0) : (j(), S("p", rt, L(R(i)("core.status.loading")), 1)),
477
- F(e.$slots, "before-sheet", A(D(Q.value))),
478
- E(n, {
479
- rows: me.value,
480
- layout: O.value.layout ?? "table",
481
- dir: R(B),
482
- "short-description": ye.value,
483
- "short-description-after": O.value.shortDescriptionAfter ?? "description"
484
- }, w({ _: 2 }, [P(Le.value, (t) => ({
485
- name: t,
486
- fn: U((n) => [F(e.$slots, t, A(D({
487
- ...n,
488
- ...Q.value
489
- })))])
490
- }))]), 1032, [
491
- "rows",
492
- "layout",
493
- "dir",
494
- "short-description",
495
- "short-description-after"
496
- ]),
497
- (j(!0), S(v, null, P(ge.value, (e) => (j(), b(m, {
498
- key: e.key,
499
- heading: e.label,
500
- html: e.html,
501
- dir: R(B)
502
- }, null, 8, [
503
- "heading",
504
- "html",
505
- "dir"
506
- ]))), 128)),
507
- F(e.$slots, "after-sheet", A(D(Q.value))),
508
- E(d, {
509
- credits: Ee.value,
510
- "working-number": ke.value,
511
- "working-number-label": R(i)("sheet.field.workingNumber"),
512
- citation: Ae.value,
513
- "citation-heading": O.value.citation?.heading ? R(i)(O.value.citation.heading) : ""
514
- }, null, 8, [
515
- "credits",
516
- "working-number",
517
- "working-number-label",
518
- "citation",
519
- "citation-heading"
520
- ]),
521
- F(e.$slots, "source", A(D(Q.value)), () => [E(t)]),
522
- F(e.$slots, "related", A(D({
523
- ...Q.value,
524
- records: Pe.value,
525
- outside: R(je).outside
526
- })), () => [Me.value ? (j(), b(s, {
527
- key: 0,
528
- heading: R(i)(Me.value.heading ?? "record.related.items"),
529
- records: Pe.value,
530
- variant: Me.value.variant ?? "list",
531
- "action-label": Me.value.actionLabel ? R(i)(Me.value.actionLabel) : ""
532
- }, null, 8, [
261
+ default: F(() => [r.references.length ? (O(), y("ul", Oe, [(O(!0), y(h, null, A(r.references, (e) => (O(), y("li", { key: e.id }, [
262
+ e.chipClass ? (O(), y("span", {
263
+ key: 0,
264
+ class: E(["mwnf-chip", e.chipClass]),
265
+ "aria-hidden": "true"
266
+ }, null, 2)) : v("", !0),
267
+ e.name ? (O(), y(h, { key: 1 }, [S(M(e.name), 1)], 64)) : (O(), y("code", ke, M(e.backward_compatibility), 1)),
268
+ r.notInPackageLabel ? (O(), y("span", Ae, M(r.notInPackageLabel), 1)) : v("", !0)
269
+ ]))), 128))])) : v("", !0)]),
270
+ _: 2
271
+ }, 1032, [
533
272
  "heading",
534
273
  "records",
535
274
  "variant",
536
275
  "action-label"
537
- ])) : x("", !0)])
538
- ]), e.$slots.aside ? (j(), S("aside", it, [F(e.$slots, "aside", A(D(Q.value)))])) : x("", !0)]),
539
- F(e.$slots, "after", A(D(Q.value))),
540
- E(u, {
541
- term: R(se),
542
- html: Y.value,
543
- dir: R(B),
544
- onClose: R(ce)
545
- }, null, 8, [
546
- "term",
547
- "html",
548
- "dir",
549
- "onClose"
550
- ])
551
- ])) : (j(), S("p", at, L(R(i)("core.status.loading")), 1));
276
+ ]),
277
+ r.artisticIntroduction ? (O(), y("p", je, [b("a", {
278
+ href: r.artisticIntroduction.url,
279
+ target: "_blank",
280
+ rel: "noopener"
281
+ }, "↗ " + M(r.artisticIntroduction.label), 9, Me)])) : v("", !0),
282
+ r.timeline ? (O(), _(i, {
283
+ key: e.record.id,
284
+ info: r.timeline
285
+ }, null, 8, ["info"])) : v("", !0),
286
+ r.glossary ? (O(), _(t, {
287
+ key: 4,
288
+ language: e.language,
289
+ dir: e.dir
290
+ }, null, 8, ["language", "dir"])) : v("", !0),
291
+ r.dynasties?.records?.length ? (O(), _(n, {
292
+ key: 5,
293
+ heading: N(d)("record.dynasty.list"),
294
+ dynasties: r.dynasties.records,
295
+ tr: r.dynasties.tr,
296
+ dir: e.dir
297
+ }, null, 8, [
298
+ "heading",
299
+ "dynasties",
300
+ "tr",
301
+ "dir"
302
+ ])) : v("", !0),
303
+ r.media.length ? (O(), _(l, {
304
+ key: 6,
305
+ heading: N(d)("record.related.audioVideo")
306
+ }, {
307
+ default: F(() => [(O(!0), y(h, null, A(r.media, (e) => (O(), y("p", {
308
+ key: e.url,
309
+ class: "mwnf-sheet-related__line"
310
+ }, [b("a", {
311
+ href: e.url,
312
+ target: "_blank",
313
+ rel: "noopener"
314
+ }, "↗ " + M(e.title ?? e.url), 9, Ne)]))), 128))]),
315
+ _: 2
316
+ }, 1032, ["heading"])) : v("", !0),
317
+ r.onDisplayIn && (r.onDisplayIn.galleries.length || r.onDisplayIn.exhibitions.length) ? (O(), y("div", G, [
318
+ b("p", Pe, M(N(d)("record.related.onDisplayIn")), 1),
319
+ r.onDisplayIn.exhibitions.length ? (O(), y("div", Fe, [b("p", Ie, M(N(d)("record.related.exhibitions")), 1), (O(!0), y(h, null, A(r.onDisplayIn.exhibitions, (e) => (O(), y("p", {
320
+ key: e.id,
321
+ class: "mwnf-sheet-related__line"
322
+ }, [e.legacy_host ? (O(), y("a", {
323
+ key: 0,
324
+ href: e.legacy_host,
325
+ target: "_blank",
326
+ rel: "noopener"
327
+ }, "↗ " + M(e.name), 9, Le)) : (O(), y("span", Re, [S(M(e.name) + " ", 1), b("span", ze, M(r.onDisplayIn.linkPendingLabel), 1)]))]))), 128))])) : v("", !0),
328
+ r.onDisplayIn.galleries.length ? (O(), y("div", Be, [b("p", K, M(N(d)("record.related.galleries")), 1), (O(!0), y(h, null, A(r.onDisplayIn.galleries, (e) => (O(), y("p", {
329
+ key: e.id,
330
+ class: "mwnf-sheet-related__line"
331
+ }, [e.legacy_host ? (O(), y("a", {
332
+ key: 0,
333
+ href: e.legacy_host,
334
+ target: "_blank",
335
+ rel: "noopener"
336
+ }, "↗ " + M(e.name), 9, q)) : (O(), y("span", J, [S(M(e.name) + " ", 1), b("span", Ve, M(r.onDisplayIn.linkPendingLabel), 1)]))]))), 128))])) : v("", !0)
337
+ ])) : v("", !0),
338
+ r.database ? (O(), y("div", He, [b("p", Y, M(r.database.label), 1), b("p", Ue, [b("a", {
339
+ href: r.database.url,
340
+ target: "_blank",
341
+ rel: "noopener"
342
+ }, "↗ " + M(r.database.name), 9, We)])])) : v("", !0),
343
+ r.overallDatabase ? (O(), y("div", X, [b("p", Z, M(r.overallDatabase.label), 1), b("p", Ge, [b("a", {
344
+ href: N(L).overallDatabase,
345
+ target: "_blank",
346
+ rel: "noopener"
347
+ }, "↗ " + M(r.overallDatabase.linkLabel), 9, Q)])])) : v("", !0),
348
+ r.download ? (O(), y("div", Ke, [b("p", qe, M(r.download.label), 1), b("p", {
349
+ class: "mwnf-sheet-related__line mwnf-sheet-related__line--action",
350
+ onClick: ce
351
+ }, "➤ " + M(r.download.pdfLabel), 1)])) : v("", !0)
352
+ ])) : v("", !0)], 64))), 128))])]),
353
+ _: 2
354
+ }, [A(te.value, (e) => ({
355
+ name: e,
356
+ fn: F((t) => [j(r.$slots, e, D(w(t)))])
357
+ }))]), 1032, [
358
+ "spec",
359
+ "id",
360
+ "entity"
361
+ ])) : (O(), _(N(ae), { key: 1 }));
552
362
  }
553
- }, st = ["dir"], ct = {
363
+ }, Ye = ["dir"], Xe = {
554
364
  key: 0,
555
365
  class: "mwnf-essay__breadcrumb"
556
- }, lt = { class: "mwnf-essay__breadcrumb-label" }, ut = {
366
+ }, Ze = { class: "mwnf-essay__breadcrumb-label" }, Qe = {
557
367
  key: 1,
558
368
  class: "mwnf-essay__breadcrumb-link"
559
- }, dt = ["aria-label"], ft = { class: "mwnf-essay__title" }, pt = {
369
+ }, $e = ["aria-label"], et = { class: "mwnf-essay__title" }, tt = {
560
370
  key: 0,
561
371
  class: "mwnf-essay__number"
562
- }, mt = ["innerHTML"], ht = { class: "mwnf-essay__body" }, gt = { class: "mwnf-essay__main" }, _t = {
372
+ }, nt = ["innerHTML"], rt = { class: "mwnf-essay__body" }, it = { class: "mwnf-essay__main" }, at = {
563
373
  key: 0,
564
374
  class: "mwnf-essay__status"
565
- }, vt = ["innerHTML"], yt = ["innerHTML"], bt = {
375
+ }, ot = ["innerHTML"], st = ["innerHTML"], ct = {
566
376
  key: 4,
567
377
  class: "mwnf-essay__nav"
568
- }, xt = {
378
+ }, lt = {
569
379
  key: 1,
570
380
  class: "mwnf-essay__nav-spacer"
571
- }, St = {
381
+ }, ut = {
572
382
  key: 0,
573
383
  class: "mwnf-essay__side"
574
- }, Ct = {
384
+ }, dt = {
575
385
  key: 0,
576
386
  class: "mwnf-essay__panel"
577
- }, wt = {
387
+ }, ft = {
578
388
  key: 0,
579
389
  class: "mwnf-essay__variants"
580
- }, Tt = ["aria-pressed", "onClick"], Et = ["src", "alt"], Dt = ["innerHTML"], Ot = {
390
+ }, pt = ["aria-pressed", "onClick"], mt = ["src", "alt"], ht = ["innerHTML"], gt = {
581
391
  key: 0,
582
392
  class: "mwnf-essay__panel-label"
583
- }, kt = ["innerHTML"], At = ["innerHTML"], jt = {
393
+ }, _t = ["innerHTML"], vt = ["innerHTML"], yt = {
584
394
  key: 0,
585
395
  class: "mwnf-essay__thumbs"
586
- }, Mt = ["onClick"], Nt = ["src"], Pt = {
396
+ }, bt = ["onClick"], xt = ["src"], St = {
587
397
  key: 2,
588
398
  class: "mwnf-essay__status"
589
- }, Ft = {
399
+ }, Ct = {
590
400
  __name: "EssayView",
591
401
  props: {
592
402
  spec: {
@@ -599,71 +409,71 @@ var Fe = { class: "mwnf-home" }, Ie = {
599
409
  }
600
410
  },
601
411
  setup(e) {
602
- let n = e, { t: r } = xe(), i = _e(), a = te();
603
- function o(e) {
412
+ let t = e, { t: n } = ge(), r = me(), i = re();
413
+ function s(e) {
604
414
  return !!e && typeof e.walk == "function" && typeof e.children == "function";
605
415
  }
606
- function s(e) {
416
+ function l(e) {
607
417
  return typeof e == "string" ? e : "themes";
608
418
  }
609
- let c = n.spec.entity ?? "items", d = n.spec.tree, f = d?.entity ?? (d?.themes ? s(d.themes) : n.spec.entity ?? "collections"), m = o(d) ? d : d?.themes ? ge({
419
+ let u = t.spec.entity ?? "items", d = t.spec.tree, f = d?.entity ?? (d?.themes ? l(d.themes) : t.spec.entity ?? "collections"), p = s(d) ? d : d?.themes ? pe({
610
420
  source: "themes",
611
421
  entity: f,
612
422
  childType: d.childType
613
- }) : ge({
423
+ }) : pe({
614
424
  purpose: d?.purpose,
615
425
  rootId: d?.rootId,
616
426
  childType: d?.childType,
617
427
  entity: f,
618
428
  order: d?.order
619
- }), h = oe(f), g = y(() => h.value !== null), w = y(() => n.spec), O = y(() => m.byId.value.get(n.id) ?? null), k = y(() => m.parents(n.id).at(-1) ?? null), M = y(() => {
620
- if (k.value) return m.children(k.value.id);
621
- let e = m.root.value;
622
- return e ? m.children(e.id) : m.walk().filter((e) => m.parents(e.id).length === 0);
623
- }), I = y(() => M.value.findIndex((e) => e.id === n.id)), z = y(() => w.value.navigation || !1), B = y(() => z.value === "siblings" ? I.value > 0 ? M.value[I.value - 1] : null : z.value === "tree" ? m.previous(n.id) : null), V = y(() => z.value === "siblings" ? I.value !== -1 && I.value < M.value.length - 1 ? M.value[I.value + 1] : null : z.value === "tree" ? m.next(n.id) : null), { language: H, dir: W } = Ee(O, { entity: f }), re = y(() => O.value ? i.tr(f, O.value.id, H.value, "en") : {}), K = N(!1);
624
- ne(() => [O.value?.id, H.value], async () => {
625
- if (K.value = !1, !O.value) {
626
- K.value = !0;
429
+ }), m = se(f), ne = g(() => m.value !== null), x = g(() => t.spec), T = g(() => p.byId.value.get(t.id) ?? null), ie = g(() => p.parents(t.id).at(-1) ?? null), I = g(() => {
430
+ if (ie.value) return p.children(ie.value.id);
431
+ let e = p.root.value;
432
+ return e ? p.children(e.id) : p.walk().filter((e) => p.parents(e.id).length === 0);
433
+ }), L = g(() => I.value.findIndex((e) => e.id === t.id)), R = g(() => x.value.navigation || !1), z = g(() => R.value === "siblings" ? L.value > 0 ? I.value[L.value - 1] : null : R.value === "tree" ? p.previous(t.id) : null), B = g(() => R.value === "siblings" ? L.value !== -1 && L.value < I.value.length - 1 ? I.value[L.value + 1] : null : R.value === "tree" ? p.next(t.id) : null), { language: V, dir: ve } = _e(T, { entity: f }), ye = g(() => T.value ? r.tr(f, T.value.id, V.value, "en") : {}), H = k(!1);
434
+ P(() => [T.value?.id, V.value], async () => {
435
+ if (H.value = !1, !T.value) {
436
+ H.value = !0;
627
437
  return;
628
438
  }
629
- let e = H.value === "en" ? ["en"] : [H.value, "en"];
630
- await Promise.all([f, c].flatMap((t) => e.map((e) => i.loadTranslations(t, e)))), K.value = !0;
439
+ let e = V.value === "en" ? ["en"] : [V.value, "en"];
440
+ await Promise.all([f, u].flatMap((t) => e.map((e) => r.loadTranslations(t, e)))), H.value = !0;
631
441
  }, { immediate: !0 });
632
- function ae(e) {
442
+ function U(e) {
633
443
  if (!e) return "";
634
- let t = w.value.placeholder, n = (e) => !!e && !!t && t.test(e), r = i.tr(f, e.id, H.value, "en");
635
- if (r.title && !n(r.title)) return r.title;
636
- let a = i.tr(f, e.id, "en").title;
444
+ let t = x.value.placeholder, n = (e) => !!e && !!t && t.test(e), i = r.tr(f, e.id, V.value, "en");
445
+ if (i.title && !n(i.title)) return i.title;
446
+ let a = r.tr(f, e.id, "en").title;
637
447
  return a && !n(a) ? a : e.internal_name ?? e.id;
638
448
  }
639
- let q = y(() => ({
640
- node: O.value,
641
- text: re.value,
642
- language: H.value,
643
- tree: m,
644
- select: Ie,
645
- t: r,
646
- tr: (e, t) => i.tr(e, t, H.value, "en")
449
+ let W = g(() => ({
450
+ node: T.value,
451
+ text: ye.value,
452
+ language: V.value,
453
+ tree: p,
454
+ select: Ve,
455
+ t: n,
456
+ tr: (e, t) => r.tr(e, t, V.value, "en")
647
457
  }));
648
- function se(e, t) {
458
+ function be(e, t) {
649
459
  return t.split(".").reduce((e, t) => e?.[t], e);
650
460
  }
651
- function Y(e, t) {
652
- return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : se(t.text, e) ?? "";
461
+ function xe(e, t) {
462
+ return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : be(t.text, e) ?? "";
653
463
  }
654
- let X = y(() => Y(w.value.quote ?? "quote", q.value)), Z = y(() => Y(w.value.body ?? "description", q.value)), Q = y(() => {
655
- if (!w.value.glossary || !O.value) return [];
656
- let e = [X.value, Z.value].filter(Boolean);
657
- return ce(e.join("\n\n"), H.value);
658
- }), le = y(() => J(Q.value)), { active: ue, onClick: pe, close: me } = be(Q), he = y(() => ue.value ? de(ue.value.definition, { breaks: !0 }) : ""), ve = y(() => O.value ? w.value.heading ? w.value.heading(q.value) : $(String(ae(O.value)), { glossary: le.value }) : ""), ye = y(() => X.value ? $(String(X.value), { glossary: le.value }) : ""), Se = y(() => Z.value ? de(String(Z.value), {
464
+ let Se = g(() => xe(x.value.quote ?? "quote", W.value)), Ce = g(() => xe(x.value.body ?? "description", W.value)), we = g(() => {
465
+ if (!x.value.glossary || !T.value) return [];
466
+ let e = [Se.value, Ce.value].filter(Boolean);
467
+ return le(e.join("\n\n"), V.value);
468
+ }), Te = g(() => ce(we.value)), { active: Ee, onClick: De, close: Oe } = he(we), ke = g(() => Ee.value ? ue(Ee.value.definition, { breaks: !0 }) : ""), Ae = g(() => T.value ? x.value.heading ? x.value.heading(W.value) : de(String(U(T.value)), { glossary: Te.value }) : ""), je = g(() => Se.value ? de(String(Se.value), { glossary: Te.value }) : ""), Me = g(() => Ce.value ? ue(String(Ce.value), {
659
469
  breaks: !0,
660
- glossary: le.value
661
- }) : ""), Ce = y(() => O.value ? w.value.about?.(O.value) ?? !1 : !1), we = y(() => !!Ce.value);
662
- function Te(e) {
663
- let t = Ce.value;
664
- return t && typeof t == "object" ? !!t[e] : !!w.value.aboutKeeps?.includes(e);
470
+ glossary: Te.value
471
+ }) : ""), Ne = g(() => T.value ? x.value.about?.(T.value) ?? !1 : !1), G = g(() => !!Ne.value);
472
+ function Pe(e) {
473
+ let t = Ne.value;
474
+ return t && typeof t == "object" ? !!t[e] : !!x.value.aboutKeeps?.includes(e);
665
475
  }
666
- let De = [
476
+ let Fe = [
667
477
  [1e3, "M"],
668
478
  [900, "CM"],
669
479
  [500, "D"],
@@ -678,66 +488,66 @@ var Fe = { class: "mwnf-home" }, Ie = {
678
488
  [4, "IV"],
679
489
  [1, "I"]
680
490
  ];
681
- function Oe(e) {
491
+ function Ie(e) {
682
492
  let t = e, n = "";
683
- for (let [e, r] of De) for (; t >= e;) n += r, t -= e;
493
+ for (let [e, r] of Fe) for (; t >= e;) n += r, t -= e;
684
494
  return n;
685
495
  }
686
- let ke = y(() => {
687
- let e = w.value.numbering;
688
- if (!e || !O.value) return "";
689
- let t = (M.value.length ? M.value : [O.value]).findIndex((e) => e.id === n.id), r = t >= 0 ? t + 1 : 1;
690
- return e === "roman" ? Oe(r) : String(r);
496
+ let Le = g(() => {
497
+ let e = x.value.numbering;
498
+ if (!e || !T.value) return "";
499
+ let n = (I.value.length ? I.value : [T.value]).findIndex((e) => e.id === t.id), r = n >= 0 ? n + 1 : 1;
500
+ return e === "roman" ? Ie(r) : String(r);
691
501
  });
692
- function Ae(e) {
502
+ function Re(e) {
693
503
  return e ? Array.isArray(e.items) ? e.items.map((e) => e && typeof e == "object" ? e.id : e).filter((e) => e != null) : Array.isArray(e.item_ids) ? e.item_ids.filter((e) => e != null) : Array.isArray(e.pictures) ? e.pictures.map((e) => e?.picture_item_id).filter((e) => e != null) : [] : [];
694
504
  }
695
- let je = ie(c), Me = y(() => {
696
- let e = w.value.items?.of ?? Ae;
697
- return O.value ? e(O.value, q.value) : [];
698
- }), Ne = y(() => Me.value.map((e) => je.value.get(e)).filter(Boolean)), Pe = N(null);
699
- ne(Ne, (e) => {
700
- e.some((e) => e.id === Pe.value) || (Pe.value = e[0]?.id ?? null);
505
+ let ze = oe(u), Be = g(() => {
506
+ let e = x.value.items?.of ?? Re;
507
+ return T.value ? e(T.value, W.value) : [];
508
+ }), K = g(() => Be.value.map((e) => ze.value.get(e)).filter(Boolean)), q = k(null);
509
+ P(K, (e) => {
510
+ e.some((e) => e.id === q.value) || (q.value = e[0]?.id ?? null);
701
511
  }, { immediate: !0 });
702
- let Fe = y(() => Ne.value.find((e) => e.id === Pe.value) ?? Ne.value[0] ?? null);
703
- function Ie(e) {
704
- Pe.value = e;
512
+ let J = g(() => K.value.find((e) => e.id === q.value) ?? K.value[0] ?? null);
513
+ function Ve(e) {
514
+ q.value = e;
705
515
  }
706
- function Le(e) {
707
- let t = w.value.items?.route;
708
- return !t || !e ? null : typeof t == "function" ? t(e, q.value) : {
516
+ function He(e) {
517
+ let t = x.value.items?.route;
518
+ return !t || !e ? null : typeof t == "function" ? t(e, W.value) : {
709
519
  name: t,
710
520
  params: { id: e.id }
711
521
  };
712
522
  }
713
- function Re(e) {
714
- let t = w.value.route;
715
- return !t || !e ? null : typeof t == "function" ? t(e, q.value) : {
523
+ function Y(e) {
524
+ let t = x.value.route;
525
+ return !t || !e ? null : typeof t == "function" ? t(e, W.value) : {
716
526
  name: t,
717
527
  params: { id: e.id }
718
528
  };
719
529
  }
720
- function ze(e) {
530
+ function Ue(e) {
721
531
  if (!e) return null;
722
- let t = i.tr(c, e.id, H.value, "en").name ?? e.internal_name ?? e.id;
532
+ let t = r.tr(u, e.id, V.value, "en").name ?? e.internal_name ?? e.id;
723
533
  return {
724
- name: $(String(t)),
534
+ name: de(String(t)),
725
535
  image: e.images?.[0]?.url ?? "",
726
536
  imageAlt: fe(String(t))
727
537
  };
728
538
  }
729
- let Be = y(() => {
730
- let e = Fe.value;
539
+ let We = g(() => {
540
+ let e = J.value;
731
541
  if (!e) return null;
732
- let t = ze(e), n = w.value.items?.caption?.(e, O.value, q.value);
542
+ let t = Ue(e), n = x.value.items?.caption?.(e, T.value, W.value);
733
543
  return {
734
544
  ...t,
735
545
  ...n
736
546
  };
737
- }), Ve = y(() => !!w.value.panel), He = y(() => {
738
- let e = Fe.value;
547
+ }), X = g(() => !!x.value.panel), Z = g(() => {
548
+ let e = J.value;
739
549
  if (!e) return [];
740
- let t = Be.value, n = e.images?.[0]?.url ? [{
550
+ let t = We.value, n = e.images?.[0]?.url ? [{
741
551
  id: "__primary",
742
552
  image: e.images[0].url,
743
553
  alt: t?.imageAlt ?? "",
@@ -746,39 +556,39 @@ var Fe = { class: "mwnf-home" }, Ie = {
746
556
  justification: "",
747
557
  fields: null
748
558
  }
749
- }] : [], r = w.value.panel?.variants?.(e, q.value) ?? [];
559
+ }] : [], r = x.value.panel?.variants?.(e, W.value) ?? [];
750
560
  return [...n, ...r.map((e, t) => ({
751
561
  id: e.id ?? `variant-${t}`,
752
562
  ...e
753
563
  }))];
754
- }), Ue = N(null);
755
- ne(He, (e) => {
756
- e.some((e) => e.id === Ue.value) || (Ue.value = e[0]?.id ?? null);
564
+ }), Ge = k(null);
565
+ P(Z, (e) => {
566
+ e.some((e) => e.id === Ge.value) || (Ge.value = e[0]?.id ?? null);
757
567
  }, { immediate: !0 });
758
- let We = y(() => He.value.find((e) => e.id === Ue.value) ?? He.value[0] ?? null);
759
- function Ge(e) {
760
- Ue.value = e;
568
+ let Q = g(() => Z.value.find((e) => e.id === Ge.value) ?? Z.value[0] ?? null);
569
+ function Ke(e) {
570
+ Ge.value = e;
761
571
  }
762
- let Ke = y(() => {
763
- let e = We.value;
572
+ let qe = g(() => {
573
+ let e = Q.value;
764
574
  return e?.image ? [{
765
575
  url: e.image,
766
576
  alt: e.alt ?? ""
767
577
  }] : [];
768
- }), qe = y(() => {
769
- let e = Fe.value;
770
- return !e || !w.value.panel?.fields ? [] : w.value.panel.fields(e, O.value, q.value) ?? [];
771
- }), Je = y(() => {
772
- let e = We.value?.caption?.fields;
773
- return e == null ? qe.value : e.map((e) => ({
774
- label: e.label ? r(e.label) : "",
578
+ }), Je = g(() => {
579
+ let e = J.value;
580
+ return !e || !x.value.panel?.fields ? [] : x.value.panel.fields(e, T.value, W.value) ?? [];
581
+ }), Ct = g(() => {
582
+ let e = Q.value?.caption?.fields;
583
+ return e == null ? Je.value : e.map((e) => ({
584
+ label: e.label ? n(e.label) : "",
775
585
  value: e.value
776
586
  }));
777
- }), Ye = y(() => {
778
- let e = We.value?.caption?.justification;
779
- return e ? $(String(e)) : "";
780
- }), Xe = y(() => Ne.value.map((e) => {
781
- let t = ze(e), n = w.value.items?.meta?.(e, q.value) ?? [], r = w.value.items?.badge?.(e, q.value) ?? "";
587
+ }), wt = g(() => {
588
+ let e = Q.value?.caption?.justification;
589
+ return e ? de(String(e)) : "";
590
+ }), Tt = g(() => K.value.map((e) => {
591
+ let t = Ue(e), n = x.value.items?.meta?.(e, W.value) ?? [], r = x.value.items?.badge?.(e, W.value) ?? "";
782
592
  return {
783
593
  id: e.id,
784
594
  image: t.image,
@@ -786,955 +596,203 @@ var Fe = { class: "mwnf-home" }, Ie = {
786
596
  name: t.name,
787
597
  meta: n,
788
598
  badge: r,
789
- to: Le(e)
599
+ to: He(e)
790
600
  };
791
- })), Ze = y(() => w.value.breadcrumb && O.value ? m.parents(n.id) : []), Qe = y(() => {
792
- let e = w.value.tabs;
793
- return e ? e === "children" ? O.value ? m.children(O.value.id) : [] : M.value : [];
794
- }), $e = y(() => w.value.previous ?? "exhibition.theme.previous"), et = y(() => w.value.next ?? "exhibition.theme.next"), tt = y(() => w.value.backTo ?? "record.action.backToResults"), nt = y(() => w.value.inThisTheme ?? "exhibition.theme.inThisTheme"), rt = y(() => w.value.seeAll ?? "exhibition.theme.seeAllInTheme"), it = y(() => ({
795
- ...q.value,
796
- items: Ne.value,
797
- selected: Fe.value,
798
- selectedVariant: We.value,
799
- selectVariant: Ge,
800
- breadcrumb: Ze.value,
801
- previous: B.value,
802
- next: V.value
803
- })), at = y(() => we.value && !Te("panel") ? !1 : Ve.value || Ne.value.length > 0 || !!a.aside), ot = y(() => (!we.value || Te("navigation")) && !!z.value && !!(B.value || V.value));
804
- return (n, i) => g.value && !O.value ? (j(), b(R(G), { key: 0 })) : O.value ? (j(), S("article", {
601
+ })), Et = g(() => x.value.breadcrumb && T.value ? p.parents(t.id) : []), Dt = g(() => {
602
+ let e = x.value.tabs;
603
+ return e ? e === "children" ? T.value ? p.children(T.value.id) : [] : I.value : [];
604
+ }), Ot = g(() => x.value.previous ?? "exhibition.theme.previous"), kt = g(() => x.value.next ?? "exhibition.theme.next"), At = g(() => x.value.backTo ?? "record.action.backToResults"), jt = g(() => x.value.inThisTheme ?? "exhibition.theme.inThisTheme"), Mt = g(() => x.value.seeAll ?? "exhibition.theme.seeAllInTheme"), $ = g(() => ({
605
+ ...W.value,
606
+ items: K.value,
607
+ selected: J.value,
608
+ selectedVariant: Q.value,
609
+ selectVariant: Ke,
610
+ breadcrumb: Et.value,
611
+ previous: z.value,
612
+ next: B.value
613
+ })), Nt = g(() => G.value && !Pe("panel") ? !1 : X.value || K.value.length > 0 || !!i.aside), Pt = g(() => (!G.value || Pe("navigation")) && !!R.value && !!(z.value || B.value));
614
+ return (t, r) => ne.value && !T.value ? (O(), _(N(ae), { key: 0 })) : T.value ? (O(), y("article", {
805
615
  key: 1,
806
- class: ee(["mwnf-essay", { "mwnf-essay--about": we.value }]),
807
- dir: R(W) || void 0,
808
- onClick: i[0] ||= (...e) => R(pe) && R(pe)(...e)
616
+ class: E(["mwnf-essay", { "mwnf-essay--about": G.value }]),
617
+ dir: N(ve) || void 0,
618
+ onClick: r[0] ||= (...e) => N(De) && N(De)(...e)
809
619
  }, [
810
- F(n.$slots, "header", A(D(it.value)), () => [
811
- Ze.value.length ? (j(), S("p", ct, [C("span", lt, L(R(r)(tt.value)), 1), (j(!0), S(v, null, P(Ze.value, (e) => (j(), S(v, { key: e.id }, [Re(e) ? (j(), b(_, {
620
+ j(t.$slots, "header", D(w($.value)), () => [
621
+ Et.value.length ? (O(), y("p", Xe, [b("span", Ze, M(N(n)(At.value)), 1), (O(!0), y(h, null, A(Et.value, (e) => (O(), y(h, { key: e.id }, [Y(e) ? (O(), _(o, {
812
622
  key: 0,
813
- to: Re(e),
623
+ to: Y(e),
814
624
  class: "mwnf-essay__breadcrumb-link"
815
625
  }, {
816
- default: U(() => [T(L(ae(e)), 1)]),
626
+ default: F(() => [S(M(U(e)), 1)]),
817
627
  _: 2
818
- }, 1032, ["to"])) : (j(), S("span", ut, L(ae(e)), 1))], 64))), 128))])) : x("", !0),
819
- Qe.value.length > 1 ? (j(), S("div", {
628
+ }, 1032, ["to"])) : (O(), y("span", Qe, M(U(e)), 1))], 64))), 128))])) : v("", !0),
629
+ Dt.value.length > 1 ? (O(), y("div", {
820
630
  key: 1,
821
631
  class: "mwnf-essay__tabs",
822
632
  role: "tablist",
823
- "aria-label": R(r)(nt.value)
824
- }, [(j(!0), S(v, null, P(Qe.value, (t) => (j(), b(_, {
633
+ "aria-label": N(n)(jt.value)
634
+ }, [(O(!0), y(h, null, A(Dt.value, (t) => (O(), _(o, {
825
635
  key: t.id,
826
- to: Re(t),
827
- class: ee(["mwnf-essay__tab", { "mwnf-essay__tab--active": t.id === e.id }])
636
+ to: Y(t),
637
+ class: E(["mwnf-essay__tab", { "mwnf-essay__tab--active": t.id === e.id }])
828
638
  }, {
829
- default: U(() => [T(L(ae(t)), 1)]),
639
+ default: F(() => [S(M(U(t)), 1)]),
830
640
  _: 2
831
- }, 1032, ["to", "class"]))), 128))], 8, dt)) : x("", !0),
832
- C("h1", ft, [ke.value ? (j(), S("span", pt, L(ke.value), 1)) : x("", !0), C("span", { innerHTML: ve.value }, null, 8, mt)])
641
+ }, 1032, ["to", "class"]))), 128))], 8, $e)) : v("", !0),
642
+ b("h1", et, [Le.value ? (O(), y("span", tt, M(Le.value), 1)) : v("", !0), b("span", { innerHTML: Ae.value }, null, 8, nt)])
833
643
  ]),
834
- C("div", ht, [C("div", gt, [
835
- K.value ? x("", !0) : (j(), S("p", _t, L(R(r)("core.status.loading")), 1)),
836
- ye.value ? (j(), S("p", {
644
+ b("div", rt, [b("div", it, [
645
+ H.value ? v("", !0) : (O(), y("p", at, M(N(n)("core.status.loading")), 1)),
646
+ je.value ? (O(), y("p", {
837
647
  key: 1,
838
648
  class: "mwnf-essay__quote",
839
- innerHTML: ye.value
840
- }, null, 8, vt)) : x("", !0),
841
- F(n.$slots, "before-body", A(D(it.value))),
842
- Se.value ? (j(), S("div", {
649
+ innerHTML: je.value
650
+ }, null, 8, ot)) : v("", !0),
651
+ j(t.$slots, "before-body", D(w($.value))),
652
+ Me.value ? (O(), y("div", {
843
653
  key: 2,
844
654
  class: "mwnf-essay__prose mwnf-sheet__block",
845
- innerHTML: Se.value
846
- }, null, 8, yt)) : x("", !0),
847
- F(n.$slots, "after-body", A(D(it.value))),
848
- we.value ? x("", !0) : F(n.$slots, "justifications", A(D(it.value)), void 0, void 0, 3),
849
- ot.value ? (j(), S("div", bt, [F(n.$slots, "navigation", A(D(it.value)), () => [B.value ? (j(), b(_, {
655
+ innerHTML: Me.value
656
+ }, null, 8, st)) : v("", !0),
657
+ j(t.$slots, "after-body", D(w($.value))),
658
+ G.value ? v("", !0) : j(t.$slots, "justifications", D(w($.value)), void 0, void 0, 3),
659
+ Pt.value ? (O(), y("div", ct, [j(t.$slots, "navigation", D(w($.value)), () => [z.value ? (O(), _(o, {
850
660
  key: 0,
851
- to: Re(B.value),
661
+ to: Y(z.value),
852
662
  class: "mwnf-essay__nav-link mwnf-essay__nav-link--previous"
853
663
  }, {
854
- default: U(() => [T("← " + L(R(r)($e.value)), 1)]),
664
+ default: F(() => [S("← " + M(N(n)(Ot.value)), 1)]),
855
665
  _: 1
856
- }, 8, ["to"])) : (j(), S("span", xt)), V.value ? (j(), b(_, {
666
+ }, 8, ["to"])) : (O(), y("span", lt)), B.value ? (O(), _(o, {
857
667
  key: 2,
858
- to: Re(V.value),
668
+ to: Y(B.value),
859
669
  class: "mwnf-essay__nav-link mwnf-essay__nav-link--next"
860
670
  }, {
861
- default: U(() => [T(L(R(r)(et.value)) + " →", 1)]),
671
+ default: F(() => [S(M(N(n)(kt.value)) + " →", 1)]),
862
672
  _: 1
863
- }, 8, ["to"])) : x("", !0)])])) : x("", !0)
864
- ]), at.value ? (j(), S("div", St, [
865
- F(n.$slots, "panel", A(D(it.value)), () => [Ve.value && Be.value ? (j(), S("div", Ct, [
866
- E(p, { images: Ke.value }, null, 8, ["images"]),
867
- He.value.length > 1 ? (j(), S("ul", wt, [(j(!0), S(v, null, P(He.value, (e) => (j(), S("li", { key: e.id }, [C("button", {
673
+ }, 8, ["to"])) : v("", !0)])])) : v("", !0)
674
+ ]), Nt.value ? (O(), y("div", ut, [
675
+ j(t.$slots, "panel", D(w($.value)), () => [X.value && We.value ? (O(), y("div", dt, [
676
+ C(c, { images: qe.value }, null, 8, ["images"]),
677
+ Z.value.length > 1 ? (O(), y("ul", ft, [(O(!0), y(h, null, A(Z.value, (e) => (O(), y("li", { key: e.id }, [b("button", {
868
678
  type: "button",
869
- class: ee(["mwnf-essay__variant", { "mwnf-essay__variant--active": e.id === We.value?.id }]),
870
- "aria-pressed": e.id === We.value?.id ? "true" : "false",
871
- onClick: (t) => Ge(e.id)
872
- }, [e.image ? (j(), S("img", {
679
+ class: E(["mwnf-essay__variant", { "mwnf-essay__variant--active": e.id === Q.value?.id }]),
680
+ "aria-pressed": e.id === Q.value?.id ? "true" : "false",
681
+ onClick: (t) => Ke(e.id)
682
+ }, [e.image ? (O(), y("img", {
873
683
  key: 0,
874
684
  src: e.image,
875
685
  alt: e.alt ?? "",
876
686
  loading: "lazy"
877
- }, null, 8, Et)) : x("", !0)], 10, Tt)]))), 128))])) : x("", !0),
878
- C("h3", {
687
+ }, null, 8, mt)) : v("", !0)], 10, pt)]))), 128))])) : v("", !0),
688
+ b("h3", {
879
689
  class: "mwnf-essay__panel-name",
880
- innerHTML: We.value?.caption?.title || Be.value.name
881
- }, null, 8, Dt),
882
- (j(!0), S(v, null, P(Je.value, (e, t) => (j(), S("p", {
690
+ innerHTML: Q.value?.caption?.title || We.value.name
691
+ }, null, 8, ht),
692
+ (O(!0), y(h, null, A(Ct.value, (e, t) => (O(), y("p", {
883
693
  key: t,
884
694
  class: "mwnf-essay__panel-field"
885
- }, [e.label ? (j(), S("span", Ot, L(e.label), 1)) : x("", !0), C("span", { innerHTML: e.value }, null, 8, kt)]))), 128)),
886
- Ye.value ? (j(), S("p", {
695
+ }, [e.label ? (O(), y("span", gt, M(e.label), 1)) : v("", !0), b("span", { innerHTML: e.value }, null, 8, _t)]))), 128)),
696
+ wt.value ? (O(), y("p", {
887
697
  key: 1,
888
698
  class: "mwnf-essay__panel-justification mwnf-sheet__block",
889
- innerHTML: Ye.value
890
- }, null, 8, At)) : x("", !0),
891
- Le(Fe.value) ? (j(), b(_, {
699
+ innerHTML: wt.value
700
+ }, null, 8, vt)) : v("", !0),
701
+ He(J.value) ? (O(), _(o, {
892
702
  key: 2,
893
- to: Le(Fe.value),
703
+ to: He(J.value),
894
704
  class: "mwnf-essay__panel-link"
895
705
  }, {
896
- default: U(() => [T(L(R(r)(rt.value)) + " →", 1)]),
706
+ default: F(() => [S(M(N(n)(Mt.value)) + " →", 1)]),
897
707
  _: 1
898
- }, 8, ["to"])) : x("", !0)
899
- ])) : x("", !0)]),
900
- F(n.$slots, "thumbnails", A(D(it.value)), () => [Ve.value && Ne.value.length > 1 ? (j(), S("ul", jt, [(j(!0), S(v, null, P(Ne.value, (e) => (j(), S("li", { key: e.id }, [C("button", {
708
+ }, 8, ["to"])) : v("", !0)
709
+ ])) : v("", !0)]),
710
+ j(t.$slots, "thumbnails", D(w($.value)), () => [X.value && K.value.length > 1 ? (O(), y("ul", yt, [(O(!0), y(h, null, A(K.value, (e) => (O(), y("li", { key: e.id }, [b("button", {
901
711
  type: "button",
902
- class: ee(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === Fe.value?.id }]),
903
- onClick: (t) => Ie(e.id)
904
- }, [e.images?.[0]?.url ? (j(), S("img", {
712
+ class: E(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === J.value?.id }]),
713
+ onClick: (t) => Ve(e.id)
714
+ }, [e.images?.[0]?.url ? (O(), y("img", {
905
715
  key: 0,
906
716
  src: e.images[0].url,
907
717
  alt: "",
908
718
  loading: "lazy"
909
- }, null, 8, Nt)) : x("", !0)], 10, Mt)]))), 128))])) : !Ve.value && Xe.value.length ? (j(), b(l, {
719
+ }, null, 8, xt)) : v("", !0)], 10, bt)]))), 128))])) : !X.value && Tt.value.length ? (O(), _(ee, {
910
720
  key: 1,
911
- records: Xe.value
912
- }, null, 8, ["records"])) : x("", !0)]),
913
- F(n.$slots, "aside", A(D(it.value)))
914
- ])) : x("", !0)]),
915
- F(n.$slots, "after", A(D(it.value)), () => [E(t)]),
916
- E(u, {
917
- term: R(ue),
918
- html: he.value,
919
- dir: R(W),
920
- onClose: R(me)
721
+ records: Tt.value
722
+ }, null, 8, ["records"])) : v("", !0)]),
723
+ j(t.$slots, "aside", D(w($.value)))
724
+ ])) : v("", !0)]),
725
+ j(t.$slots, "after", D(w($.value)), () => [C(a)]),
726
+ C(te, {
727
+ term: N(Ee),
728
+ html: ke.value,
729
+ dir: N(ve),
730
+ onClose: N(Oe)
921
731
  }, null, 8, [
922
732
  "term",
923
733
  "html",
924
734
  "dir",
925
735
  "onClose"
926
736
  ])
927
- ], 10, st)) : (j(), S("p", Pt, L(R(r)("core.status.loading")), 1));
737
+ ], 10, Ye)) : (O(), y("p", St, M(N(n)("core.status.loading")), 1));
928
738
  }
929
- }, It = { class: "mwnf-link-list" }, Lt = {
739
+ }, wt = { class: "mwnf-link-list" }, Tt = {
930
740
  key: 0,
931
741
  class: "mwnf-link-list__back"
932
- }, Rt = {
742
+ }, Et = {
933
743
  key: 1,
934
744
  class: "mwnf-link-list__title"
935
- }, zt = {
745
+ }, Dt = {
936
746
  key: 2,
937
747
  class: "mwnf-link-list__groups"
938
- }, Bt = {
748
+ }, Ot = {
939
749
  key: 0,
940
750
  class: "mwnf-link-list__heading"
941
- }, Vt = {
751
+ }, kt = {
942
752
  key: 1,
943
753
  class: "mwnf-link-list__links"
944
- }, Ht = ["innerHTML"], Ut = ["innerHTML"], Wt = {
754
+ }, At = ["innerHTML"], jt = ["innerHTML"], Mt = {
945
755
  key: 3,
946
756
  class: "mwnf-link-list__empty"
947
- }, Gt = {
757
+ }, $ = {
948
758
  __name: "LinkListView",
949
759
  props: { spec: {
950
760
  type: Object,
951
761
  required: !0
952
762
  } },
953
763
  setup(e) {
954
- let t = e, { t: n } = xe(), r = y(() => ((typeof t.spec.groups == "function" ? t.spec.groups({}) : t.spec.groups ?? []) ?? []).filter((e) => e.links?.length > 0)), i = y(() => t.spec.title ? n(t.spec.title) : ""), a = y(() => t.spec.back?.label ? n(t.spec.back.label) : ""), o = y(() => n(t.spec.empty ?? "catalogue.results.noResults"));
955
- return (e, s) => (j(), S("div", It, [
956
- t.spec.back && a.value ? (j(), S("div", Lt, [E(_, {
764
+ let t = e, { t: n } = ge(), r = g(() => ((typeof t.spec.groups == "function" ? t.spec.groups({}) : t.spec.groups ?? []) ?? []).filter((e) => e.links?.length > 0)), i = g(() => t.spec.title ? n(t.spec.title) : ""), a = g(() => t.spec.back?.label ? n(t.spec.back.label) : ""), s = g(() => n(t.spec.empty ?? "catalogue.results.noResults"));
765
+ return (e, ee) => (O(), y("div", wt, [
766
+ t.spec.back && a.value ? (O(), y("div", Tt, [C(o, {
957
767
  to: t.spec.back.to,
958
768
  href: t.spec.back.href
959
769
  }, {
960
- default: U(() => [T(" ← " + L(a.value), 1)]),
770
+ default: F(() => [S(" ← " + M(a.value), 1)]),
961
771
  _: 1
962
- }, 8, ["to", "href"])])) : x("", !0),
963
- i.value ? (j(), S("h1", Rt, L(i.value), 1)) : x("", !0),
964
- F(e.$slots, "before"),
965
- r.value.length ? (j(), S("div", zt, [(j(!0), S(v, null, P(r.value, (t, r) => (j(), S("section", {
772
+ }, 8, ["to", "href"])])) : v("", !0),
773
+ i.value ? (O(), y("h1", Et, M(i.value), 1)) : v("", !0),
774
+ j(e.$slots, "before"),
775
+ r.value.length ? (O(), y("div", Dt, [(O(!0), y(h, null, A(r.value, (t, r) => (O(), y("section", {
966
776
  key: r,
967
777
  class: "mwnf-link-list__group"
968
- }, [F(e.$slots, "group", { group: t }, () => [t.heading ? (j(), S("h2", Bt, L(R(n)(t.heading)), 1)) : x("", !0), t.links?.length ? (j(), S("ul", Vt, [(j(!0), S(v, null, P(t.links, (e, t) => (j(), S("li", {
778
+ }, [j(e.$slots, "group", { group: t }, () => [t.heading ? (O(), y("h2", Ot, M(N(n)(t.heading)), 1)) : v("", !0), t.links?.length ? (O(), y("ul", kt, [(O(!0), y(h, null, A(t.links, (e, t) => (O(), y("li", {
969
779
  key: t,
970
780
  class: "mwnf-link-list__item"
971
- }, [E(_, {
781
+ }, [C(o, {
972
782
  class: "mwnf-link-list__link",
973
783
  to: e.to,
974
784
  href: e.href
975
785
  }, {
976
- default: U(() => [C("span", { innerHTML: R(Q)(e.label) }, null, 8, Ht)]),
786
+ default: F(() => [b("span", { innerHTML: N(I)(e.label) }, null, 8, At)]),
977
787
  _: 2
978
- }, 1032, ["to", "href"]), e.note ? (j(), S("div", {
788
+ }, 1032, ["to", "href"]), e.note ? (O(), y("div", {
979
789
  key: 0,
980
790
  class: "mwnf-link-list__note",
981
- innerHTML: R(Q)(e.note)
982
- }, null, 8, Ut)) : x("", !0)]))), 128))])) : x("", !0)])]))), 128))])) : (j(), S("div", Wt, L(o.value), 1)),
983
- F(e.$slots, "after")
984
- ]));
985
- }
986
- }, Kt = { class: "mwnf-partner-list" }, qt = {
987
- key: 0,
988
- class: "mwnf-partner-list__title"
989
- }, Jt = {
990
- key: 1,
991
- class: "mwnf-partner-list__count"
992
- }, Yt = {
993
- key: 2,
994
- class: "mwnf-partner-list__toggle"
995
- }, Xt = {
996
- key: 3,
997
- class: "mwnf-partner-list__groups"
998
- }, Zt = {
999
- key: 0,
1000
- class: "mwnf-partner-list__group-title"
1001
- }, Qt = { class: "mwnf-partner-list__tier" }, $t = { class: "mwnf-partner-list__row" }, en = ["src", "alt"], tn = ["innerHTML"], nn = { key: 0 }, rn = {
1002
- key: 1,
1003
- class: "mwnf-partner-list__meta"
1004
- }, an = {
1005
- key: 0,
1006
- class: "mwnf-partner-list__children"
1007
- }, on = ["src", "alt"], sn = ["innerHTML"], cn = { key: 0 }, ln = {
1008
- key: 1,
1009
- class: "mwnf-partner-list__meta"
1010
- }, un = {
1011
- key: 0,
1012
- class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
1013
- }, dn = { class: "mwnf-partner-list__tier-label" }, fn = ["src", "alt"], pn = ["innerHTML"], mn = { key: 0 }, hn = {
1014
- key: 1,
1015
- class: "mwnf-partner-list__meta"
1016
- }, gn = {
1017
- key: 4,
1018
- class: "mwnf-partner-list__empty"
1019
- }, _n = {
1020
- __name: "PartnerListView",
1021
- props: { spec: {
1022
- type: Object,
1023
- required: !0
1024
- } },
1025
- setup(e) {
1026
- let t = e, { t: n, locale: r } = xe(), i = _e(), a = y(() => t.spec), o = y(() => a.value.entity ?? "partners"), s = oe(o.value);
1027
- o.value && i.loadTranslations(o.value, "en");
1028
- let c = {
1029
- t: n,
1030
- locale: r,
1031
- tr: (e) => i.tr(o.value, e, r.value, "en"),
1032
- renderInline: $,
1033
- renderPlain: fe
1034
- }, { filters: l, apply: u } = Se({
1035
- keys: ["order"],
1036
- page: !1
1037
- }), d = y(() => l.order === "desc" ? "desc" : "asc");
1038
- function f() {
1039
- u({ order: d.value === "asc" ? "desc" : "asc" });
1040
- }
1041
- let p = y(() => {
1042
- let e = a.value, t = s.value ?? [];
1043
- return e.scope ? t.filter((t) => e.scope(t, c)) : t;
1044
- }), m = y(() => a.value.route);
1045
- function h(e) {
1046
- let t = m.value;
1047
- return t ? typeof t == "function" ? t(e, c) : {
1048
- name: t,
1049
- params: { id: e.id }
1050
- } : null;
1051
- }
1052
- function g(e, t) {
1053
- let n = t.tr(e.id), r = n.name ?? e.internal_name ?? e.id;
1054
- return {
1055
- name: t.renderInline(String(r)),
1056
- city: n.city ?? "",
1057
- logo: e.logos?.[0]?.url ?? "",
1058
- count: e.item_count ?? 0,
1059
- route: h(e)
1060
- };
1061
- }
1062
- function w(e) {
1063
- return (a.value.record ?? g)(e, c);
1064
- }
1065
- function T(e) {
1066
- return String(e ?? "").replace(/<[^>]*>/g, "");
1067
- }
1068
- let E = y(() => a.value.nested ? le(p.value) : null), O = y(() => {
1069
- let e = a.value, t = e.group?.tier ?? !1, n = (e.group?.order ?? "country") === "name", r = n ? p.value.map((e) => ({
1070
- ...e,
1071
- country_id: "\0"
1072
- })) : p.value, i = Y(r, {
1073
- label: n ? () => "" : (t) => e.label ? e.label(t, c) : t,
1074
- tier: t,
1075
- order: d.value
1076
- }), o = (e, t) => T(e.row.name).localeCompare(T(t.row.name));
1077
- return i.map((t) => {
1078
- let r = t.main.map((e) => ({
1079
- partner: e,
1080
- row: w(e)
1081
- })).sort(o), i = t.associated.map((e) => ({
1082
- partner: e,
1083
- row: w(e)
1084
- })).sort(o);
1085
- if (n && d.value === "desc" && (r.reverse(), i.reverse()), e.nested && E.value) {
1086
- let e = new Set(i.map((e) => e.partner.id));
1087
- r = r.map((t) => {
1088
- let n = E.value.children(t.partner.id).filter((t) => e.has(t.id));
1089
- for (let t of n) e.delete(t.id);
1090
- return {
1091
- ...t,
1092
- children: n.map((e) => ({
1093
- partner: e,
1094
- row: w(e)
1095
- }))
1096
- };
1097
- }), i = i.filter((t) => e.has(t.partner.id));
1098
- }
1099
- return {
1100
- country: t.country,
1101
- label: t.label,
1102
- main: r,
1103
- associated: i
1104
- };
1105
- });
1106
- }), ee = y(() => O.value.some((e) => e.main.length > 0 || e.associated.length > 0)), M = y(() => n(a.value.associatedLabel ?? "partner.list.associated")), N = y(() => n(a.value.objectsLabel ?? "partner.item.objectsInSite")), R = y(() => n(a.value.foundLabel ?? "partner.list.partnersFound")), te = y(() => n(a.value.sortAscendingLabel ?? "partner.list.sortAscending")), z = y(() => n(a.value.sortDescendingLabel ?? "partner.list.sortDescending")), B = y(() => n(a.value.empty ?? "catalogue.results.noResults")), V = y(() => a.value.title ? n(a.value.title) : ""), H = y(() => O.value.reduce((e, t) => e + t.main.length + t.associated.length, 0)), ne = y(() => a.value.variant ?? "accordion"), W = y(() => ({
1107
- t: n,
1108
- locale: r,
1109
- groups: O.value,
1110
- orderDir: d.value,
1111
- toggleOrder: f
1112
- }));
1113
- return (e, t) => (j(), S("section", Kt, [
1114
- V.value ? (j(), S("h1", qt, L(V.value), 1)) : x("", !0),
1115
- a.value.count ? (j(), S("div", Jt, L(R.value) + ": " + L(H.value), 1)) : x("", !0),
1116
- F(e.$slots, "before", A(D(W.value))),
1117
- a.value.orderToggle ? (j(), S("div", Yt, [C("button", {
1118
- type: "button",
1119
- class: "mwnf-partner-list__toggle-button",
1120
- onClick: f
1121
- }, L(d.value === "asc" ? z.value : te.value), 1)])) : x("", !0),
1122
- ee.value ? (j(), S("div", Xt, [(j(!0), S(v, null, P(O.value, (t) => (j(), b(I(ne.value === "accordion" ? "details" : "section"), k({
1123
- key: t.country ?? "",
1124
- class: "mwnf-partner-list__group"
1125
- }, { ref_for: !0 }, ne.value === "accordion" ? { open: !0 } : {}), {
1126
- default: U(() => [
1127
- (j(), b(I(ne.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
1128
- default: U(() => [F(e.$slots, "group-heading", k({ group: t }, { ref_for: !0 }, W.value), () => [t.label ? (j(), S("h2", Zt, L(t.label), 1)) : x("", !0)])]),
1129
- _: 2
1130
- }, 1024)),
1131
- C("div", Qt, [(j(!0), S(v, null, P(t.main, (n) => (j(), S("div", {
1132
- key: n.partner.id,
1133
- class: "mwnf-partner-list__row-block"
1134
- }, [C("div", $t, [F(e.$slots, "row", k({
1135
- group: t,
1136
- partner: n.partner,
1137
- row: n.row
1138
- }, { ref_for: !0 }, W.value), () => [
1139
- n.row.logo ? (j(), S("img", {
1140
- key: 0,
1141
- class: "mwnf-partner-list__logo",
1142
- src: n.row.logo,
1143
- alt: T(n.row.name),
1144
- loading: "lazy"
1145
- }, null, 8, en)) : x("", !0),
1146
- (j(), b(I(n.row.route ? _ : "span"), {
1147
- class: "mwnf-partner-list__name",
1148
- to: n.row.route
1149
- }, {
1150
- default: U(() => [C("span", { innerHTML: n.row.name }, null, 8, tn), n.row.city ? (j(), S("span", nn, ", " + L(n.row.city), 1)) : x("", !0)]),
1151
- _: 2
1152
- }, 1032, ["to"])),
1153
- n.row.count ? (j(), S("span", rn, L(n.row.count) + " " + L(N.value), 1)) : x("", !0)
1154
- ])]), n.children?.length ? (j(), S("div", an, [(j(!0), S(v, null, P(n.children, (n) => (j(), S("div", {
1155
- key: n.partner.id,
1156
- class: "mwnf-partner-list__row mwnf-partner-list__row--child"
1157
- }, [F(e.$slots, "row", k({
1158
- group: t,
1159
- partner: n.partner,
1160
- row: n.row
1161
- }, { ref_for: !0 }, W.value), () => [
1162
- n.row.logo ? (j(), S("img", {
1163
- key: 0,
1164
- class: "mwnf-partner-list__logo",
1165
- src: n.row.logo,
1166
- alt: T(n.row.name),
1167
- loading: "lazy"
1168
- }, null, 8, on)) : x("", !0),
1169
- (j(), b(I(n.row.route ? _ : "span"), {
1170
- class: "mwnf-partner-list__name",
1171
- to: n.row.route
1172
- }, {
1173
- default: U(() => [C("span", { innerHTML: n.row.name }, null, 8, sn), n.row.city ? (j(), S("span", cn, ", " + L(n.row.city), 1)) : x("", !0)]),
1174
- _: 2
1175
- }, 1032, ["to"])),
1176
- n.row.count ? (j(), S("span", ln, L(n.row.count) + " " + L(N.value), 1)) : x("", !0)
1177
- ])]))), 128))])) : x("", !0)]))), 128))]),
1178
- t.associated.length ? (j(), S("div", un, [C("p", dn, L(M.value), 1), (j(!0), S(v, null, P(t.associated, (n) => (j(), S("div", {
1179
- key: n.partner.id,
1180
- class: "mwnf-partner-list__row"
1181
- }, [F(e.$slots, "row", k({
1182
- group: t,
1183
- partner: n.partner,
1184
- row: n.row
1185
- }, { ref_for: !0 }, W.value), () => [
1186
- n.row.logo ? (j(), S("img", {
1187
- key: 0,
1188
- class: "mwnf-partner-list__logo",
1189
- src: n.row.logo,
1190
- alt: T(n.row.name),
1191
- loading: "lazy"
1192
- }, null, 8, fn)) : x("", !0),
1193
- (j(), b(I(n.row.route ? _ : "span"), {
1194
- class: "mwnf-partner-list__name",
1195
- to: n.row.route
1196
- }, {
1197
- default: U(() => [C("span", { innerHTML: n.row.name }, null, 8, pn), n.row.city ? (j(), S("span", mn, ", " + L(n.row.city), 1)) : x("", !0)]),
1198
- _: 2
1199
- }, 1032, ["to"])),
1200
- n.row.count ? (j(), S("span", hn, L(n.row.count) + " " + L(N.value), 1)) : x("", !0)
1201
- ])]))), 128))])) : x("", !0)
1202
- ]),
1203
- _: 2
1204
- }, 1040))), 128))])) : (j(), S("p", gn, L(B.value), 1)),
1205
- F(e.$slots, "after", A(D(W.value)))
1206
- ]));
1207
- }
1208
- }, vn = { class: "mwnf-text-page" }, yn = {
1209
- key: 0,
1210
- class: "mwnf-text-page__back"
1211
- }, bn = {
1212
- key: 1,
1213
- class: "mwnf-text-page__heading"
1214
- }, xn = { class: "mwnf-prose" }, Sn = ["innerHTML"], Cn = {
1215
- __name: "TextPageView",
1216
- props: { spec: {
1217
- type: Object,
1218
- required: !0
1219
- } },
1220
- setup(e) {
1221
- let t = e, { t: n } = xe(), r = _e(), i = Ce(), a = y(() => t.spec.heading ? n(t.spec.heading) : ""), o = y(() => typeof t.spec.body == "string"), s = y(() => o.value ? t.spec.body : null), c = y(() => ({
1222
- t: n,
1223
- tr: (e, t) => r.tr(e, t, i.value, "en"),
1224
- language: i.value
1225
- })), l = y(() => o.value ? null : typeof t.spec.body == "function" ? Z(t.spec.body(c.value)) : null), u = y(() => t.spec.back === !1 ? null : t.spec.back === !0 ? n("core.action.back") : t.spec.back?.label ? n(t.spec.back.label) : null);
1226
- return (e, n) => (j(), S("div", vn, [
1227
- u.value && (t.spec.back === !0 || t.spec.back?.to || t.spec.back?.href) ? (j(), S("div", yn, [E(_, {
1228
- to: t.spec.back === !0 ? {} : t.spec.back?.to,
1229
- href: t.spec.back === !0 ? "#" : t.spec.back?.href
1230
- }, {
1231
- default: U(() => [T(" ← " + L(u.value), 1)]),
1232
- _: 1
1233
- }, 8, ["to", "href"])])) : x("", !0),
1234
- a.value ? (j(), S("h1", bn, L(a.value), 1)) : x("", !0),
1235
- C("div", xn, [o.value ? (j(), b(R(re), {
1236
- key: 0,
1237
- keypath: s.value
1238
- }, null, 8, ["keypath"])) : l.value ? (j(), S("div", {
1239
- key: 1,
1240
- innerHTML: l.value
1241
- }, null, 8, Sn)) : x("", !0)])
1242
- ]));
1243
- }
1244
- }, wn = { class: "mwnf-search-form__row-label" }, Tn = ["onUpdate:modelValue"], En = ["value"], Dn = ["onUpdate:modelValue"], On = ["value"], kn = ["onUpdate:modelValue", "placeholder"], An = {
1245
- key: 0,
1246
- class: "mwnf-search-form__dates"
1247
- }, jn = {
1248
- key: 1,
1249
- class: "mwnf-facet"
1250
- }, Mn = { class: "mwnf-facet__label" }, Nn = { value: "" }, Pn = ["value"], Fn = {
1251
- key: 0,
1252
- class: "mwnf-search-form__dates"
1253
- }, In = { class: "mwnf-search-form__radio-choice" }, Ln = ["value"], Rn = ["onUpdate:modelValue", "disabled"], zn = ["onUpdate:modelValue"], Bn = { class: "mwnf-facet__label" }, Vn = {
1254
- key: 0,
1255
- class: "mwnf-search-form__how-to"
1256
- }, Hn = {
1257
- __name: "SearchFormView",
1258
- props: { spec: {
1259
- type: Object,
1260
- required: !0
1261
- } },
1262
- setup(e) {
1263
- let t = e, { t: n } = xe(), a = Pe(), o = y(() => t.spec), s = y(() => o.value.mode), c = y(() => o.value.entity ? oe(o.value.entity).value ?? [] : []), l = y(() => o.value.dates === "buckets"), u = y(() => {
1264
- let e = o.value.dates;
1265
- if (!e || e === "buckets") return null;
1266
- let t = e.presets;
1267
- return typeof t == "function" ? t() : t ?? K();
1268
- });
1269
- function d(e) {
1270
- return (e ?? []).map((e) => ({
1271
- value: e,
1272
- label: String(e)
1273
- }));
1274
- }
1275
- let f = y(() => l.value ? Me(c.value, n) : []), p = y(() => l.value ? f.value : d(u.value?.from)), m = y(() => l.value ? f.value : d(u.value?.to)), h = y(() => !!o.value.dates), g = N(""), w = N(""), k = o.value.language ? ke(o.value.language) : null, I = y(() => k?.languages.value ?? []), te = k?.language ?? N(""), ne = y(() => Object.fromEntries((o.value.facets ?? []).filter((e) => !e.options && e.type !== "year").map((e) => [e.key, { field: e.field ?? e.key }]))), re = ve(c, ne), G = y(() => {
1276
- let e = {};
1277
- for (let t of o.value.facets ?? []) e[t.key] = t.options ?? re.value[t.key] ?? [];
1278
- return e;
1279
- }), ie = [{
1280
- key: "AND",
1281
- label: "catalogue.search.and"
1282
- }, {
1283
- key: "OR",
1284
- label: "catalogue.search.or"
1285
- }], ae = [
1286
- "catalogue.search.keywordOne",
1287
- "catalogue.search.keywordTwo",
1288
- "catalogue.search.keywordThree"
1289
- ], q = y(() => o.value.operators ?? ie), se = N(Array.from({ length: o.value.rows ?? 3 }, () => ({
1290
- keyword: "",
1291
- field: o.value.fields?.[0]?.key ?? "",
1292
- cond: (o.value.operators ?? ie)[0].key
1293
- })));
1294
- function J(e) {
1295
- return ae[e] ? n(ae[e]) : "";
1296
- }
1297
- let ce = N(o.value.facets?.[0]?.key ?? ""), Y = M(Object.fromEntries((o.value.facets ?? []).map((e) => [e.key, ""]))), X = M(Object.fromEntries((o.value.extras ?? []).map((e) => [e.key, !1])));
1298
- function Z() {
1299
- let e = {};
1300
- for (let t of o.value.extras ?? []) X[t.key] && (e[t.key] = "1");
1301
- return e;
1302
- }
1303
- function Q(e) {
1304
- return a.push({
1305
- name: o.value.target,
1306
- query: e
1307
- });
1308
- }
1309
- function le() {
1310
- let e = {};
1311
- if (s.value === "rows") se.value.forEach((t, n) => {
1312
- if (t.keyword) {
1313
- if (n === 0) e.q = t.keyword, t.field && (e.field = t.field);
1314
- else {
1315
- let r = n + 1;
1316
- e[`q${r}`] = t.keyword, t.field && (e[`field${r}`] = t.field), e[`op${r}`] = t.cond;
1317
- }
1318
- }
1319
- }), g.value && (e.from = String(g.value)), w.value && (e.to = String(w.value)), te.value && (e.lang = te.value);
1320
- else if (s.value === "radio") {
1321
- let t = ce.value, n = t ? Y[t] : "";
1322
- n && (e[t] = String(n));
1323
- }
1324
- return Object.assign(e, Z()), Q(e);
1325
- }
1326
- function ue(e, t) {
1327
- if (t !== "" && t != null) return Q({
1328
- [e]: String(t),
1329
- ...Z()
1330
- });
1331
- }
1332
- function de() {
1333
- return Q(Z());
1334
- }
1335
- let $ = y(() => s.value === "facets" ? "immediate" : "apply"), fe = y(() => s.value === "radio" ? "core.action.browse" : "core.action.search"), pe = y(() => n(o.value.submitLabel ?? fe.value)), me = y(() => n(o.value.showAllLabel ?? "core.action.reset")), he = y(() => ({
1336
- mode: s.value,
1337
- submit: le,
1338
- showAll: de
1339
- }));
1340
- return (e, t) => (j(), S("section", { class: ee(["mwnf-search-form", `mwnf-search-form--${s.value}`]) }, [
1341
- F(e.$slots, "intro", A(D(he.value))),
1342
- F(e.$slots, "before", A(D(he.value))),
1343
- E(r, {
1344
- class: "mwnf-search-form__panel",
1345
- mode: $.value,
1346
- "apply-label": pe.value,
1347
- "reset-label": me.value,
1348
- onApply: le,
1349
- onReset: de
1350
- }, {
1351
- default: U(() => [
1352
- s.value === "rows" ? (j(), S(v, { key: 0 }, [
1353
- (j(!0), S(v, null, P(se.value, (e, t) => (j(), S("div", {
1354
- key: t,
1355
- class: "mwnf-search-form__row"
1356
- }, [
1357
- C("span", wn, L(J(t)), 1),
1358
- t > 0 ? W((j(), S("select", {
1359
- key: 0,
1360
- "onUpdate:modelValue": (t) => e.cond = t,
1361
- class: "mwnf-facet__select mwnf-search-form__operator"
1362
- }, [(j(!0), S(v, null, P(q.value, (e) => (j(), S("option", {
1363
- key: e.key,
1364
- value: e.key
1365
- }, L(R(n)(e.label)), 9, En))), 128))], 8, Tn)), [[V, e.cond]]) : x("", !0),
1366
- W(C("select", {
1367
- "onUpdate:modelValue": (t) => e.field = t,
1368
- class: "mwnf-facet__select mwnf-search-form__field"
1369
- }, [(j(!0), S(v, null, P(o.value.fields ?? [], (e) => (j(), S("option", {
1370
- key: e.key,
1371
- value: e.key
1372
- }, L(R(n)(e.label)), 9, On))), 128))], 8, Dn), [[V, e.field]]),
1373
- W(C("input", {
1374
- "onUpdate:modelValue": (t) => e.keyword = t,
1375
- type: "text",
1376
- class: "mwnf-search-form__keyword",
1377
- placeholder: R(n)("catalogue.search.keywordPlaceholder")
1378
- }, null, 8, kn), [[H, e.keyword]])
1379
- ]))), 128)),
1380
- h.value ? (j(), S("div", An, [E(i, {
1381
- modelValue: g.value,
1382
- "onUpdate:modelValue": t[0] ||= (e) => g.value = e,
1383
- label: R(n)("catalogue.facet.dateFrom"),
1384
- options: p.value,
1385
- "any-label": "—"
1386
- }, null, 8, [
1387
- "modelValue",
1388
- "label",
1389
- "options"
1390
- ]), E(i, {
1391
- modelValue: w.value,
1392
- "onUpdate:modelValue": t[1] ||= (e) => w.value = e,
1393
- label: R(n)("catalogue.facet.dateTo"),
1394
- options: m.value,
1395
- "any-label": "—"
1396
- }, null, 8, [
1397
- "modelValue",
1398
- "label",
1399
- "options"
1400
- ])])) : x("", !0),
1401
- o.value.language ? (j(), S("label", jn, [C("span", Mn, L(R(n)("catalogue.search.language")), 1), W(C("select", {
1402
- "onUpdate:modelValue": t[2] ||= (e) => O(te) ? te.value = e : null,
1403
- class: "mwnf-facet__select mwnf-search-form__language"
1404
- }, [C("option", Nn, L(R(n)("catalogue.search.anyLanguage")), 1), (j(!0), S(v, null, P(I.value, (e) => (j(), S("option", {
1405
- key: e,
1406
- value: e
1407
- }, L(e.toUpperCase()), 9, Pn))), 128))], 512), [[V, R(te)]])])) : x("", !0)
1408
- ], 64)) : s.value === "facets" ? (j(), S(v, { key: 1 }, [(j(!0), S(v, null, P(o.value.facets ?? [], (e) => (j(), b(i, {
1409
- key: e.key,
1410
- label: e.label ? R(n)(e.label) : "",
1411
- options: G.value[e.key] ?? [],
1412
- "model-value": Y[e.key],
1413
- "onUpdate:modelValue": (t) => ue(e.key, t)
1414
- }, null, 8, [
1415
- "label",
1416
- "options",
1417
- "model-value",
1418
- "onUpdate:modelValue"
1419
- ]))), 128)), h.value ? (j(), S("div", Fn, [E(i, {
1420
- "model-value": g.value,
1421
- label: R(n)("catalogue.facet.startDate"),
1422
- options: p.value,
1423
- "onUpdate:modelValue": t[3] ||= (e) => {
1424
- g.value = e, ue("from", e);
1425
- }
1426
- }, null, 8, [
1427
- "model-value",
1428
- "label",
1429
- "options"
1430
- ]), E(i, {
1431
- "model-value": w.value,
1432
- label: R(n)("catalogue.facet.endDate"),
1433
- options: m.value,
1434
- "onUpdate:modelValue": t[4] ||= (e) => {
1435
- w.value = e, ue("to", e);
1436
- }
1437
- }, null, 8, [
1438
- "model-value",
1439
- "label",
1440
- "options"
1441
- ])])) : x("", !0)], 64)) : s.value === "radio" ? (j(!0), S(v, { key: 2 }, P(o.value.facets ?? [], (e) => (j(), S("div", {
1442
- key: e.key,
1443
- class: "mwnf-search-form__radio-row"
1444
- }, [C("label", In, [W(C("input", {
1445
- "onUpdate:modelValue": t[5] ||= (e) => ce.value = e,
1446
- type: "radio",
1447
- name: "mwnf-search-form-filter",
1448
- value: e.key
1449
- }, null, 8, Ln), [[B, ce.value]]), T(" " + L(e.label ? R(n)(e.label) : ""), 1)]), e.type === "year" ? W((j(), S("input", {
1450
- key: 1,
1451
- "onUpdate:modelValue": (t) => Y[e.key] = t,
1452
- type: "number",
1453
- class: "mwnf-search-form__year",
1454
- disabled: ce.value !== e.key
1455
- }, null, 8, Rn)), [[H, Y[e.key]]]) : (j(), b(i, {
1456
- key: 0,
1457
- modelValue: Y[e.key],
1458
- "onUpdate:modelValue": (t) => Y[e.key] = t,
1459
- options: G.value[e.key] ?? [],
1460
- disabled: ce.value !== e.key
1461
- }, null, 8, [
1462
- "modelValue",
1463
- "onUpdate:modelValue",
1464
- "options",
1465
- "disabled"
1466
- ]))]))), 128)) : x("", !0),
1467
- (j(!0), S(v, null, P(o.value.extras ?? [], (e) => (j(), S("label", {
1468
- key: e.key,
1469
- class: "mwnf-facet mwnf-facet--checkbox"
1470
- }, [W(C("input", {
1471
- "onUpdate:modelValue": (t) => X[e.key] = t,
1472
- type: "checkbox",
1473
- class: "mwnf-facet__checkbox"
1474
- }, null, 8, zn), [[z, X[e.key]]]), C("span", Bn, L(R(n)(e.label)), 1)]))), 128)),
1475
- F(e.$slots, "extras", A(D(he.value)))
1476
- ]),
1477
- _: 3
1478
- }, 8, [
1479
- "mode",
1480
- "apply-label",
1481
- "reset-label"
1482
- ]),
1483
- o.value.howTo ? (j(), S("p", Vn, [E(_, { to: { name: o.value.howTo } }, {
1484
- default: U(() => [T(L(R(n)("catalogue.search.howTo")), 1)]),
1485
- _: 1
1486
- }, 8, ["to"])])) : x("", !0),
1487
- F(e.$slots, "actions", A(D(he.value)))
1488
- ], 2));
1489
- }
1490
- }, Un = { class: "mwnf-timeline" }, Wn = {
1491
- key: 0,
1492
- class: "mwnf-timeline__title"
1493
- }, Gn = {
1494
- key: 3,
1495
- class: "mwnf-facet"
1496
- }, Kn = { class: "mwnf-facet__label" }, qn = [
1497
- "value",
1498
- "placeholder",
1499
- "onInput"
1500
- ], Jn = {
1501
- key: 1,
1502
- class: "mwnf-timeline__error"
1503
- }, Yn = {
1504
- __name: "TimelineResultsView",
1505
- props: { spec: {
1506
- type: Object,
1507
- required: !0
1508
- } },
1509
- setup(e) {
1510
- let t = e, { t: n } = xe(), a = Pe(), o = y(() => t.spec), s = y(() => !!o.value.entrance), c = je({
1511
- scope: t.spec.scope ?? "country",
1512
- countryLabel: t.spec.countryLabel,
1513
- countryIdForCode: t.spec.countryIdForCode,
1514
- tr: t.spec.tr,
1515
- timelinesEntity: t.spec.timelinesEntity,
1516
- eventsEntity: t.spec.eventsEntity
1517
- }), l = y(() => o.value.controls ?? []), u = y(() => o.value.keys ?? l.value.map((e) => e.key)), d = (e) => l.value.some((t) => t.key === e), p = y(() => ({
1518
- t: n,
1519
- tr: t.spec.tr,
1520
- years: {
1521
- min: B.value[0],
1522
- max: B.value[1]
1523
- }
1524
- })), m = M(Object.fromEntries(u.value.map((e) => [e, ""]))), w = N(""), O = s.value ? null : Se({ keys: u.value }), k = s.value ? m : O.filters;
1525
- function ee(e) {
1526
- if (d("collection") && e !== "" && e != null) return e === "pc" ? null : e;
1527
- }
1528
- function I() {
1529
- for (let e of u.value) m[e] = "";
1530
- w.value = "";
1531
- }
1532
- function te() {
1533
- w.value = "";
1534
- let e = !!k.begin && !!k.end;
1535
- if (e && Number(k.begin) >= Number(k.end)) {
1536
- w.value = n(o.value.errorPeriod ?? "timeline.form.errorPeriod");
1537
- return;
1538
- }
1539
- if (!k.country && !e) {
1540
- w.value = n(o.value.errorSelect ?? "timeline.form.errorSelect");
1541
- return;
1542
- }
1543
- let t = {};
1544
- for (let e of u.value) k[e] && (t[e] = k[e]);
1545
- a.push({
1546
- name: o.value.route,
1547
- query: t
1548
- });
1549
- }
1550
- let z = y(() => {
1551
- if (s.value) return [];
1552
- let e = k;
1553
- return c.findEvents({
1554
- country: e.country || void 0,
1555
- collection: ee(e.collection),
1556
- begin: e.begin,
1557
- end: e.end
1558
- });
1559
- }), B = y(() => {
1560
- let e = c.findEvents({
1561
- country: void 0,
1562
- collection: void 0
1563
- }).map((e) => e.year_from).filter((e) => Number.isFinite(e) && e !== 0);
1564
- return e.length ? [Math.min(...e), Math.max(...e)] : [null, null];
1565
- }), V = we(z, {
1566
- page: () => O ? O.page.value : 1,
1567
- size: () => o.value.pageSize ?? 15
1568
- });
1569
- function H(e) {
1570
- let t = o.value.countryLabel && e.country_id ? o.value.countryLabel(e.country_id) : "";
1571
- return {
1572
- id: e.id,
1573
- date: se(e, e.text, n),
1574
- caption: t ? $(String(t)) : "",
1575
- description: e.text?.description ? de(String(e.text.description), { breaks: !0 }) : ""
1576
- };
1577
- }
1578
- let ne = y(() => V.value.rows.map((e) => (o.value.event ?? H)(e, p.value))), W = y(() => (c.countries.value ?? []).map((e) => ({
1579
- value: e.value,
1580
- label: e.value === "all" ? n("timeline.form.allCountries") : e.label
1581
- }))), re = y(() => o.value.collections?.(p.value) ?? []), G = y(() => {
1582
- let e = {};
1583
- for (let t of l.value) (t.key === "begin" || t.key === "end") && t.options && (typeof t.options == "function" ? e[t.key] = t.options(p.value) : e[t.key] = t.options);
1584
- return e;
1585
- }), ie = y(() => ({
1586
- filters: k,
1587
- active: u.value.some((e) => k[e]),
1588
- apply: s.value ? te : (e) => O.apply(e),
1589
- reset: s.value ? I : O.reset,
1590
- goToPage: s.value ? () => {} : O.goToPage,
1591
- events: z.value,
1592
- pageInfo: V.value,
1593
- countries: W.value,
1594
- collections: re.value,
1595
- t: n,
1596
- tr: o.value.tr
1597
- })), K = y(() => {
1598
- let e = o.value.gallery;
1599
- return !e || s.value ? null : !e.items || e.items(ie.value);
1600
- }), ae = y(() => {
1601
- let e = K.value;
1602
- return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
1603
- }), q = y(() => {
1604
- let e = K.value;
1605
- return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
1606
- }), oe = y(() => {
1607
- if (!ae.value) return null;
1608
- let e = {};
1609
- for (let t of u.value) k[t] && (e[t] = k[t]);
1610
- return {
1611
- to: {
1612
- name: o.value.gallery.route,
1613
- query: e
1614
- },
1615
- count: q.value,
1616
- label: n(o.value.gallery.label ?? "timeline.nav.seeGallery")
1617
- };
1618
- }), J = y(() => ({
1619
- ...ie.value,
1620
- gallery: oe.value
1621
- })), ce = y(() => o.value.summary ? o.value.summary(J.value) : [{
1622
- label: n(o.value.summaryLabel ?? "timeline.results.eventsFound"),
1623
- count: V.value.total
1624
- }]), Y = y(() => n(o.value.empty ?? "timeline.results.noResults")), X = y(() => ({
1625
- window: 5,
1626
- jump: !1,
1627
- ends: !0,
1628
- ...o.value.pagination ?? {}
1629
- }));
1630
- function Z(e, t) {
1631
- return e.label ? n(e.label) : t ? n(t) : "";
1632
- }
1633
- return (e, t) => (j(), S("section", Un, [
1634
- F(e.$slots, "before", A(D(J.value))),
1635
- o.value.title ? (j(), S("h1", Wn, L(R(n)(o.value.title)), 1)) : x("", !0),
1636
- E(r, {
1637
- class: "mwnf-timeline__filters",
1638
- title: o.value.filterTitle ? R(n)(o.value.filterTitle) : "",
1639
- "apply-label": s.value ? R(n)(o.value.submitLabel ?? "core.action.search") : o.value.applyLabel ? R(n)(o.value.applyLabel) : "",
1640
- "reset-label": o.value.resetLabel ? R(n)(o.value.resetLabel) : "",
1641
- onApply: t[2] ||= (e) => s.value ? te() : R(O).apply(),
1642
- onReset: t[3] ||= (e) => s.value ? I() : R(O).reset()
1643
- }, {
1644
- default: U(() => [(j(!0), S(v, null, P(l.value, (e) => (j(), S(v, { key: e.key }, [e.key === "country" ? (j(), b(i, {
1645
- key: 0,
1646
- "model-value": R(k).country,
1647
- label: Z(e, "catalogue.facet.country"),
1648
- options: W.value,
1649
- placeholder: e.placeholder ? R(n)(e.placeholder) : R(n)("timeline.form.selectCountry"),
1650
- "any-label": e.anyLabel ? R(n)(e.anyLabel) : "",
1651
- "hide-empty": !!e.hideEmpty,
1652
- "onUpdate:modelValue": t[0] ||= (e) => R(k).country = e
1653
- }, null, 8, [
1654
- "model-value",
1655
- "label",
1656
- "options",
1657
- "placeholder",
1658
- "any-label",
1659
- "hide-empty"
1660
- ])) : e.key === "collection" ? (j(), b(i, {
1661
- key: 1,
1662
- "model-value": R(k).collection,
1663
- label: Z(e),
1664
- options: re.value,
1665
- placeholder: e.placeholder ? R(n)(e.placeholder) : "",
1666
- "any-label": e.anyLabel ? R(n)(e.anyLabel) : "",
1667
- "hide-empty": !!e.hideEmpty,
1668
- "onUpdate:modelValue": t[1] ||= (e) => R(k).collection = e
1669
- }, null, 8, [
1670
- "model-value",
1671
- "label",
1672
- "options",
1673
- "placeholder",
1674
- "any-label",
1675
- "hide-empty"
1676
- ])) : (e.key === "begin" || e.key === "end") && G.value[e.key] ? (j(), b(i, {
1677
- key: 2,
1678
- "model-value": R(k)[e.key],
1679
- label: Z(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate"),
1680
- options: G.value[e.key],
1681
- placeholder: e.placeholder ? R(n)(e.placeholder) : R(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1682
- "any-label": e.anyLabel ? R(n)(e.anyLabel) : "",
1683
- "hide-empty": !!e.hideEmpty,
1684
- "onUpdate:modelValue": (t) => R(k)[e.key] = t
1685
- }, null, 8, [
1686
- "model-value",
1687
- "label",
1688
- "options",
1689
- "placeholder",
1690
- "any-label",
1691
- "hide-empty",
1692
- "onUpdate:modelValue"
1693
- ])) : (j(), S("label", Gn, [C("span", Kn, L(Z(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate")), 1), C("input", {
1694
- type: "number",
1695
- class: "mwnf-facet__select",
1696
- value: R(k)[e.key],
1697
- placeholder: e.placeholder ? R(n)(e.placeholder) : R(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1698
- onInput: (t) => R(k)[e.key] = t.target.value
1699
- }, null, 40, qn)]))], 64))), 128))]),
1700
- _: 1
1701
- }, 8, [
1702
- "title",
1703
- "apply-label",
1704
- "reset-label"
1705
- ]),
1706
- s.value && w.value ? (j(), S("p", Jn, L(w.value), 1)) : x("", !0),
1707
- s.value ? x("", !0) : (j(), S(v, { key: 2 }, [
1708
- F(e.$slots, "summary", A(D(J.value)), () => [E(g, { parts: ce.value }, null, 8, ["parts"])]),
1709
- oe.value ? (j(), b(_, {
1710
- key: 0,
1711
- class: "mwnf-timeline__gallery",
1712
- to: oe.value.to
1713
- }, {
1714
- default: U(() => [F(e.$slots, "cross-link", A(D(J.value)), () => [T(L(oe.value.label), 1), oe.value.count == null ? x("", !0) : (j(), S(v, { key: 0 }, [T(" (" + L(oe.value.count) + ")", 1)], 64))])]),
1715
- _: 3
1716
- }, 8, ["to"])) : x("", !0),
1717
- F(e.$slots, "event", A(D(J.value)), () => [E(h, { events: ne.value }, {
1718
- empty: U(() => [F(e.$slots, "empty", A(D(J.value)), () => [T(L(Y.value), 1)])]),
1719
- _: 3
1720
- }, 8, ["events"])]),
1721
- E(f, {
1722
- "page-info": R(V),
1723
- window: X.value.window,
1724
- jump: X.value.jump,
1725
- ends: X.value.ends,
1726
- onNavigate: R(O).goToPage
1727
- }, null, 8, [
1728
- "page-info",
1729
- "window",
1730
- "jump",
1731
- "ends",
1732
- "onNavigate"
1733
- ])
1734
- ], 64)),
1735
- F(e.$slots, "after", A(D(J.value)))
791
+ innerHTML: N(I)(e.note)
792
+ }, null, 8, jt)) : v("", !0)]))), 128))])) : v("", !0)])]))), 128))])) : (O(), y("div", Mt, M(s.value), 1)),
793
+ j(e.$slots, "after")
1736
794
  ]));
1737
795
  }
1738
796
  };
1739
797
  //#endregion
1740
- export { $e as CatalogueResultsView, Ft as EssayView, Re as HomeView, Gt as LinkListView, _n as PartnerListView, ot as RecordView, Hn as SearchFormView, Cn as TextPageView, Yn as TimelineResultsView };
798
+ export { p as CatalogueResultsView, Ct as EssayView, H as HomeView, $ as LinkListView, d as PartnerListView, Je as RecordSheetView, u as RecordView, f as SearchFormView, m as TextPageView, ne as TimelineResultsView };