@museumwnf/viewer-layout 2.12.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/LICENSE.md +44 -0
- package/README.md +433 -0
- package/dist/PageShell-CbJ9lQoQ.js +961 -0
- package/dist/TimelineEventList-59g_1ksf.js +1174 -0
- package/dist/components.js +154 -0
- package/dist/content-BvhCFMQ9.js +446 -0
- package/dist/content.js +3 -0
- package/dist/index.js +4 -0
- package/dist/viewer-layout.css +2 -0
- package/dist/views.js +1740 -0
- package/package.json +51 -0
- package/src/tokens.reference.css +684 -0
package/dist/views.js
ADDED
|
@@ -0,0 +1,1740 @@
|
|
|
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 A, normalizeProps as j, openBlock as M, reactive as N, ref as P, renderList as F, renderSlot as I, resolveDynamicComponent as L, toDisplayString as R, unref as z, useSlots as B, vModelCheckbox as V, vModelRadio as ee, vModelSelect as H, vModelText as U, watch as te, withCtx as W, withDirectives as G } from "vue";
|
|
3
|
+
import { I18nText as ne, NotFoundView as K, byId as re, centuryPresets as q, citation as ie, dateRange as J, entityRef as ae, eventDateLabel as oe, glossaryEntries as Y, glossaryTermsForText as se, groupByCountry as X, languageLabels as Z, md as Q, mdInline as ce, 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, useRecordLanguage as Te, useRecordSheet as Ee, useRelatedRecords as De, useSearchLanguage as Oe, useSiteConfig as ke, useTimelineEvents as Ae, yearBuckets as je } from "@museumwnf/viewer-core";
|
|
4
|
+
import { useRoute as Me, useRouter as Ne } from "vue-router";
|
|
5
|
+
//#region src/views/HomeView.vue
|
|
6
|
+
var Pe = { class: "mwnf-home" }, Fe = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "mwnf-home__welcome"
|
|
9
|
+
}, Ie = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "mwnf-home__title"
|
|
12
|
+
}, Le = {
|
|
13
|
+
__name: "HomeView",
|
|
14
|
+
props: {
|
|
15
|
+
title: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
intro: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
cards: {
|
|
24
|
+
type: Array,
|
|
25
|
+
default: null
|
|
26
|
+
},
|
|
27
|
+
featured: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default: null
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
setup(t) {
|
|
33
|
+
let n = t, { t: r, locale: i } = xe(), o = ke(), s = y(() => ({
|
|
34
|
+
...o.home ?? {},
|
|
35
|
+
...c(n)
|
|
36
|
+
}));
|
|
37
|
+
function c(e) {
|
|
38
|
+
let t = {};
|
|
39
|
+
for (let n of [
|
|
40
|
+
"title",
|
|
41
|
+
"intro",
|
|
42
|
+
"cards",
|
|
43
|
+
"featured"
|
|
44
|
+
]) e[n] != null && e[n] !== "" && (t[n] = e[n]);
|
|
45
|
+
return t;
|
|
46
|
+
}
|
|
47
|
+
let l = y(() => (s.value.cards ?? []).map((e) => ({
|
|
48
|
+
...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) {
|
|
59
|
+
return typeof e == "function" ? e(t, n) : typeof e != "string" || !e ? "" : n[e] ?? t[e] ?? "";
|
|
60
|
+
}
|
|
61
|
+
let g = y(() => {
|
|
62
|
+
let e = p.value, t = u.value;
|
|
63
|
+
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
|
+
return {
|
|
66
|
+
heading: t.heading ? r(t.heading) : "",
|
|
67
|
+
image: e[a]?.[0]?.url ?? "",
|
|
68
|
+
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) : "",
|
|
73
|
+
to: typeof t.to == "function" ? t.to(e) : {
|
|
74
|
+
name: t.route ?? "item",
|
|
75
|
+
params: { id: e.id }
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
return (t, n) => (M(), S("section", Pe, [
|
|
80
|
+
s.value.title || s.value.intro ? (M(), S("header", Fe, [s.value.title ? (M(), S("h1", Ie, R(z(r)(s.value.title)), 1)) : x("", !0), s.value.intro ? (M(), b(z(ne), {
|
|
81
|
+
key: 1,
|
|
82
|
+
tag: "div",
|
|
83
|
+
class: "mwnf-home__intro",
|
|
84
|
+
keypath: s.value.intro
|
|
85
|
+
}, null, 8, ["keypath"])) : x("", !0)])) : x("", !0),
|
|
86
|
+
I(t.$slots, "before"),
|
|
87
|
+
E(e, { cards: l.value }, null, 8, ["cards"]),
|
|
88
|
+
I(t.$slots, "default"),
|
|
89
|
+
g.value ? (M(), b(a, j(k({ key: 1 }, g.value)), null, 16)) : x("", !0),
|
|
90
|
+
I(t.$slots, "after")
|
|
91
|
+
]));
|
|
92
|
+
}
|
|
93
|
+
}, Re = { class: "mwnf-catalogue" }, ze = {
|
|
94
|
+
key: 0,
|
|
95
|
+
class: "mwnf-catalogue__title"
|
|
96
|
+
}, Be = {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: "mwnf-facet"
|
|
99
|
+
}, Ve = {
|
|
100
|
+
key: 0,
|
|
101
|
+
class: "mwnf-facet__label"
|
|
102
|
+
}, He = [
|
|
103
|
+
"value",
|
|
104
|
+
"placeholder",
|
|
105
|
+
"onInput"
|
|
106
|
+
], Ue = {
|
|
107
|
+
key: 1,
|
|
108
|
+
class: "mwnf-facet"
|
|
109
|
+
}, We = {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: "mwnf-facet__label"
|
|
112
|
+
}, Ge = [
|
|
113
|
+
"value",
|
|
114
|
+
"placeholder",
|
|
115
|
+
"onInput"
|
|
116
|
+
], Ke = {
|
|
117
|
+
key: 2,
|
|
118
|
+
class: "mwnf-facet mwnf-facet--checkbox"
|
|
119
|
+
}, qe = ["checked", "onChange"], Je = {
|
|
120
|
+
key: 0,
|
|
121
|
+
class: "mwnf-facet__label"
|
|
122
|
+
}, Ye = { class: "mwnf-catalogue__body" }, Xe = { class: "mwnf-catalogue__results" }, Ze = {
|
|
123
|
+
key: 0,
|
|
124
|
+
class: "mwnf-catalogue__aside"
|
|
125
|
+
}, Qe = {
|
|
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 = ae(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: A, goToPage: N } = Se({ keys: p.value }), P = {
|
|
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 B(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 V = y(() => {
|
|
158
|
+
let e = u.value, t = d.value ?? [];
|
|
159
|
+
e.scope && (t = t.filter((t) => e.scope(t, h, P)));
|
|
160
|
+
for (let [n, r] of Object.entries(e.facets ?? {})) {
|
|
161
|
+
let e = h[n];
|
|
162
|
+
e && (t = t.filter((t) => B(t, r).map(String).includes(String(e))));
|
|
163
|
+
}
|
|
164
|
+
e.match && (t = t.filter((t) => e.match(t, h, P))), e.narrow && (t = e.narrow(t, h, P)), e.dates && (t = J(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
|
+
}), ee = y(() => u.value.facetScope === "matching" ? V.value : d.value ?? []), H = ve(ee, () => u.value.facets ?? {}), U = we(V, {
|
|
173
|
+
page: _,
|
|
174
|
+
size: () => u.value.pageSize ?? 20
|
|
175
|
+
}), te = y(() => u.value.recordRoute ?? (t.entity ? `${t.entity}-detail` : "item"));
|
|
176
|
+
function G(e) {
|
|
177
|
+
let t = P.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: te.value,
|
|
187
|
+
params: { id: e.id }
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
let ne = y(() => U.value.rows.map((e) => (u.value.record ?? G)(e, P))), K = y(() => ({
|
|
192
|
+
filters: h,
|
|
193
|
+
active: O.value,
|
|
194
|
+
apply: k,
|
|
195
|
+
reset: A,
|
|
196
|
+
goToPage: N,
|
|
197
|
+
matching: V.value,
|
|
198
|
+
pageInfo: U.value,
|
|
199
|
+
options: H.value
|
|
200
|
+
})), re = y(() => {
|
|
201
|
+
let e = u.value;
|
|
202
|
+
return e.summary ? e.summary({
|
|
203
|
+
...K.value,
|
|
204
|
+
t: n,
|
|
205
|
+
total: (d.value ?? []).length
|
|
206
|
+
}) : [{
|
|
207
|
+
label: n(e.summaryLabel ?? "catalogue.results.itemsFound"),
|
|
208
|
+
count: U.value.total
|
|
209
|
+
}];
|
|
210
|
+
}), q = y(() => u.value.filterMode ?? "apply"), ie = y(() => u.value.controls ?? []), oe = y(() => ie.value.length > 0 || !!u.value.panel);
|
|
211
|
+
function Y(e, t) {
|
|
212
|
+
q.value === "immediate" ? k({ [e]: t }) : h[e] = t;
|
|
213
|
+
}
|
|
214
|
+
let se = y(() => n(u.value.empty ?? "catalogue.results.noResultsFilter")), X = y(() => u.value.variant === "grid"), Z = y(() => ({
|
|
215
|
+
window: 5,
|
|
216
|
+
jump: !1,
|
|
217
|
+
ends: !0,
|
|
218
|
+
...u.value.pagination ?? {}
|
|
219
|
+
}));
|
|
220
|
+
return (e, t) => (M(), S("section", Re, [
|
|
221
|
+
I(e.$slots, "before", j(D(K.value))),
|
|
222
|
+
u.value.title ? (M(), S("h1", ze, R(z(n)(u.value.title)), 1)) : x("", !0),
|
|
223
|
+
oe.value || e.$slots.filters ? (M(), b(r, {
|
|
224
|
+
key: 1,
|
|
225
|
+
class: "mwnf-catalogue__filters",
|
|
226
|
+
mode: q.value,
|
|
227
|
+
title: u.value.filterTitle ? z(n)(u.value.filterTitle) : "",
|
|
228
|
+
"reset-label": u.value.resetLabel ? z(n)(u.value.resetLabel) : "",
|
|
229
|
+
onApply: t[2] ||= (e) => z(k)(),
|
|
230
|
+
onReset: t[3] ||= (e) => z(A)()
|
|
231
|
+
}, {
|
|
232
|
+
default: W(() => [(M(!0), S(v, null, F(ie.value, (e) => (M(), S(v, { key: e.key }, [e.type === "year" ? (M(), S("label", Be, [e.label ? (M(), S("span", Ve, R(z(n)(e.label)), 1)) : x("", !0), C("input", {
|
|
233
|
+
type: "number",
|
|
234
|
+
class: "mwnf-facet__select",
|
|
235
|
+
value: z(h)[e.key],
|
|
236
|
+
placeholder: e.placeholder ? z(n)(e.placeholder) : "",
|
|
237
|
+
onInput: (t) => z(h)[e.key] = t.target.value,
|
|
238
|
+
onChange: t[0] ||= (e) => q.value === "immediate" ? z(k)() : null
|
|
239
|
+
}, null, 40, He)])) : e.type === "query" ? (M(), S("label", Ue, [e.label ? (M(), S("span", We, R(z(n)(e.label)), 1)) : x("", !0), C("input", {
|
|
240
|
+
type: "text",
|
|
241
|
+
class: "mwnf-facet__select",
|
|
242
|
+
value: z(h)[e.key],
|
|
243
|
+
placeholder: e.placeholder ? z(n)(e.placeholder) : "",
|
|
244
|
+
onInput: (t) => z(h)[e.key] = t.target.value,
|
|
245
|
+
onChange: t[1] ||= (e) => q.value === "immediate" ? z(k)() : null
|
|
246
|
+
}, null, 40, Ge)])) : e.type === "checkbox" ? (M(), S("label", Ke, [C("input", {
|
|
247
|
+
type: "checkbox",
|
|
248
|
+
class: "mwnf-facet__checkbox",
|
|
249
|
+
checked: z(h)[e.key] === "1",
|
|
250
|
+
onChange: (t) => Y(e.key, t.target.checked ? "1" : "")
|
|
251
|
+
}, null, 40, qe), e.label ? (M(), S("span", Je, R(z(n)(e.label)), 1)) : x("", !0)])) : (M(), b(i, {
|
|
252
|
+
key: 3,
|
|
253
|
+
"model-value": z(h)[e.key],
|
|
254
|
+
label: e.label ? z(n)(e.label) : "",
|
|
255
|
+
options: z(H)[e.key] ?? [],
|
|
256
|
+
placeholder: e.placeholder ? z(n)(e.placeholder) : "",
|
|
257
|
+
"any-label": e.anyLabel ? z(n)(e.anyLabel) : "",
|
|
258
|
+
"hide-empty": !!e.hideEmpty,
|
|
259
|
+
"onUpdate:modelValue": (t) => Y(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)), I(e.$slots, "filters", j(D(K.value)))]),
|
|
269
|
+
_: 3
|
|
270
|
+
}, 8, [
|
|
271
|
+
"mode",
|
|
272
|
+
"title",
|
|
273
|
+
"reset-label"
|
|
274
|
+
])) : x("", !0),
|
|
275
|
+
E(g, { parts: re.value }, w({ _: 2 }, [e.$slots.actions ? {
|
|
276
|
+
name: "actions",
|
|
277
|
+
fn: W(() => [I(e.$slots, "actions", j(D(K.value)))]),
|
|
278
|
+
key: "0"
|
|
279
|
+
} : void 0]), 1032, ["parts"]),
|
|
280
|
+
C("div", Ye, [C("div", Xe, [(M(), b(L(X.value ? l : o), {
|
|
281
|
+
records: ne.value,
|
|
282
|
+
"action-label": u.value.actionLabel ? z(n)(u.value.actionLabel) : ""
|
|
283
|
+
}, {
|
|
284
|
+
empty: W(() => [I(e.$slots, "empty", j(D(K.value)), () => [T(R(se.value), 1)])]),
|
|
285
|
+
_: 3
|
|
286
|
+
}, 8, ["records", "action-label"])), E(f, {
|
|
287
|
+
"page-info": z(U),
|
|
288
|
+
window: Z.value.window,
|
|
289
|
+
jump: Z.value.jump,
|
|
290
|
+
ends: Z.value.ends,
|
|
291
|
+
onNavigate: z(N)
|
|
292
|
+
}, null, 8, [
|
|
293
|
+
"page-info",
|
|
294
|
+
"window",
|
|
295
|
+
"jump",
|
|
296
|
+
"ends",
|
|
297
|
+
"onNavigate"
|
|
298
|
+
])]), e.$slots.aside ? (M(), S("aside", Ze, [I(e.$slots, "aside", j(D(K.value)))])) : x("", !0)]),
|
|
299
|
+
I(e.$slots, "after", j(D(K.value)))
|
|
300
|
+
]));
|
|
301
|
+
}
|
|
302
|
+
}, $e = ["dir", "innerHTML"], et = { class: "mwnf-record__body" }, tt = { class: "mwnf-record__main" }, nt = {
|
|
303
|
+
key: 1,
|
|
304
|
+
class: "mwnf-record__status"
|
|
305
|
+
}, rt = {
|
|
306
|
+
key: 0,
|
|
307
|
+
class: "mwnf-record__aside"
|
|
308
|
+
}, it = {
|
|
309
|
+
key: 2,
|
|
310
|
+
class: "mwnf-record__status"
|
|
311
|
+
}, at = {
|
|
312
|
+
__name: "RecordView",
|
|
313
|
+
props: {
|
|
314
|
+
spec: {
|
|
315
|
+
type: Object,
|
|
316
|
+
required: !0
|
|
317
|
+
},
|
|
318
|
+
id: {
|
|
319
|
+
type: String,
|
|
320
|
+
required: !0
|
|
321
|
+
},
|
|
322
|
+
entity: {
|
|
323
|
+
type: String,
|
|
324
|
+
default: ""
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
setup(e) {
|
|
328
|
+
let r = e, { t: i, locale: a } = xe(), o = _e(), l = B(), f = Me(), h = r.spec.entity ?? r.entity, g = y(() => r.spec), O = ae(h), k = re(h), A = y(() => k.value.get(r.id) ?? null), N = y(() => O.value !== null), { language: P, languages: L, dir: V, select: ee, text: H, ready: U, terms: te, glossary: G, attribution: ne } = Ee(A, {
|
|
329
|
+
entity: h,
|
|
330
|
+
translations: r.spec.translations ?? [],
|
|
331
|
+
attribution: r.spec.attribution ?? []
|
|
332
|
+
}), q = y(() => Z(L.value)), { active: J, onClick: oe, close: Y } = be(te), se = y(() => J.value ? de(J.value.definition, { breaks: !0 }) : ""), X = (e, t) => o.tr(e, t, P.value, "en"), Q = y(() => ({
|
|
333
|
+
record: A.value,
|
|
334
|
+
text: H.value,
|
|
335
|
+
language: P.value,
|
|
336
|
+
languages: q.value,
|
|
337
|
+
select: ee,
|
|
338
|
+
dir: V.value,
|
|
339
|
+
glossary: G.value,
|
|
340
|
+
ready: U.value,
|
|
341
|
+
attribution: ne.value,
|
|
342
|
+
t: i,
|
|
343
|
+
tr: X
|
|
344
|
+
}));
|
|
345
|
+
function ce(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 le = y(() => A.value ? pe(ce(g.value.fields), Q.value) : []), me = y(() => A.value ? pe(ce(g.value.sections).map((e) => ({
|
|
352
|
+
render: "block",
|
|
353
|
+
...e
|
|
354
|
+
})), Q.value) : []), ge = y(() => g.value.shortDescription === !1 ? "" : g.value.shortDescription ?? "short_description"), ve = y(() => {
|
|
355
|
+
let e = ge.value ? H.value[ge.value] : "";
|
|
356
|
+
return e ? { html: de(String(e), {
|
|
357
|
+
breaks: !0,
|
|
358
|
+
glossary: G.value
|
|
359
|
+
}) } : null;
|
|
360
|
+
}), ye = y(() => {
|
|
361
|
+
if (!A.value) return "";
|
|
362
|
+
if (g.value.title) return g.value.title(Q.value);
|
|
363
|
+
let e = H.value.name ?? A.value.internal_name ?? A.value.id;
|
|
364
|
+
return $(String(e), { glossary: G.value });
|
|
365
|
+
}), Se = y(() => {
|
|
366
|
+
if (!A.value) return [];
|
|
367
|
+
if (g.value.media) return g.value.media(A.value, Q.value);
|
|
368
|
+
let e = fe(String(H.value.name ?? A.value.internal_name ?? ""));
|
|
369
|
+
return (A.value.images ?? []).map((t) => ({
|
|
370
|
+
url: t.url,
|
|
371
|
+
alt: t.captions?.[P.value] ?? e,
|
|
372
|
+
caption: t.captions?.[P.value] ?? t.captions?.en ?? "",
|
|
373
|
+
photographer: t.photographer ?? "",
|
|
374
|
+
copyright: t.copyright ?? ""
|
|
375
|
+
}));
|
|
376
|
+
}), Ce = [
|
|
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"
|
|
392
|
+
}
|
|
393
|
+
], we = y(() => (g.value.credits ?? Ce).map(({ field: e, label: t }) => ({
|
|
394
|
+
label: i(t),
|
|
395
|
+
value: H.value[e] ?? ne.value[e] ?? ""
|
|
396
|
+
})).filter((e) => e.value)), Te = y(() => String(A.value?.[g.value.workingNumber ?? "mwnf_reference"] ?? "")), Oe = y(() => {
|
|
397
|
+
let e = g.value.citation;
|
|
398
|
+
if (!A.value || e === !1) return "";
|
|
399
|
+
let t = typeof e?.project == "function" ? e.project(A.value, Q.value) : ue(e?.project ?? A.value.project_key, i), n = e?.permalink === !1 ? void 0 : typeof e?.permalink == "string" ? e.permalink : he(f) ?? void 0;
|
|
400
|
+
return ie({
|
|
401
|
+
author: H.value.author ?? ne.value.author,
|
|
402
|
+
name: H.value.name ?? A.value.internal_name ?? "",
|
|
403
|
+
project: t,
|
|
404
|
+
permalink: n,
|
|
405
|
+
inWord: i("record.citation.in")
|
|
406
|
+
});
|
|
407
|
+
}), ke = De(A, {
|
|
408
|
+
entity: h,
|
|
409
|
+
language: P
|
|
410
|
+
}), Ae = y(() => g.value.related === !1 ? null : g.value.related ?? {}), je = y(() => {
|
|
411
|
+
if (!Ae.value) return [];
|
|
412
|
+
let e = Ae.value.record ?? Ne;
|
|
413
|
+
return ke.value.inPackage.map((t) => e(t, Q.value));
|
|
414
|
+
});
|
|
415
|
+
function Ne({ record: e, justification: t }) {
|
|
416
|
+
let n = X(h, e.id).name ?? e.internal_name ?? e.id;
|
|
417
|
+
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: g.value.route ?? (r.entity ? `${r.entity}-detail` : "item"),
|
|
426
|
+
params: { id: e.id }
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
let Pe = /* @__PURE__ */ new Set([
|
|
431
|
+
"header",
|
|
432
|
+
"before-sheet",
|
|
433
|
+
"after-sheet",
|
|
434
|
+
"aside",
|
|
435
|
+
"source",
|
|
436
|
+
"related",
|
|
437
|
+
"after",
|
|
438
|
+
"default"
|
|
439
|
+
]), Fe = y(() => Object.keys(l).filter((e) => !Pe.has(e)));
|
|
440
|
+
return (e, r) => N.value && !A.value ? (M(), b(z(K), { key: 0 })) : A.value ? (M(), S("article", {
|
|
441
|
+
key: 1,
|
|
442
|
+
class: "mwnf-record",
|
|
443
|
+
onClick: r[0] ||= (...e) => z(oe) && z(oe)(...e)
|
|
444
|
+
}, [
|
|
445
|
+
I(e.$slots, "header", j(D(Q.value)), () => [
|
|
446
|
+
g.value.back ? (M(), b(_, {
|
|
447
|
+
key: 0,
|
|
448
|
+
class: "mwnf-record__back",
|
|
449
|
+
to: g.value.back.to,
|
|
450
|
+
href: g.value.back.href
|
|
451
|
+
}, {
|
|
452
|
+
default: W(() => [T("← " + R(z(i)(g.value.back.label)), 1)]),
|
|
453
|
+
_: 1
|
|
454
|
+
}, 8, ["to", "href"])) : x("", !0),
|
|
455
|
+
E(c, {
|
|
456
|
+
languages: q.value,
|
|
457
|
+
language: z(P),
|
|
458
|
+
onSelect: z(ee)
|
|
459
|
+
}, null, 8, [
|
|
460
|
+
"languages",
|
|
461
|
+
"language",
|
|
462
|
+
"onSelect"
|
|
463
|
+
]),
|
|
464
|
+
C("h1", {
|
|
465
|
+
class: "mwnf-record__title",
|
|
466
|
+
dir: z(V) || void 0,
|
|
467
|
+
innerHTML: ye.value
|
|
468
|
+
}, null, 8, $e)
|
|
469
|
+
]),
|
|
470
|
+
C("div", et, [C("div", tt, [
|
|
471
|
+
Se.value.length ? (M(), b(p, {
|
|
472
|
+
key: 0,
|
|
473
|
+
images: Se.value,
|
|
474
|
+
variant: g.value.mediaVariant ?? ""
|
|
475
|
+
}, null, 8, ["images", "variant"])) : x("", !0),
|
|
476
|
+
z(U) ? x("", !0) : (M(), S("p", nt, R(z(i)("core.status.loading")), 1)),
|
|
477
|
+
I(e.$slots, "before-sheet", j(D(Q.value))),
|
|
478
|
+
E(n, {
|
|
479
|
+
rows: le.value,
|
|
480
|
+
layout: g.value.layout ?? "table",
|
|
481
|
+
dir: z(V),
|
|
482
|
+
"short-description": ve.value,
|
|
483
|
+
"short-description-after": g.value.shortDescriptionAfter ?? "description"
|
|
484
|
+
}, w({ _: 2 }, [F(Fe.value, (t) => ({
|
|
485
|
+
name: t,
|
|
486
|
+
fn: W((n) => [I(e.$slots, t, j(D({
|
|
487
|
+
...n,
|
|
488
|
+
...Q.value
|
|
489
|
+
})))])
|
|
490
|
+
}))]), 1032, [
|
|
491
|
+
"rows",
|
|
492
|
+
"layout",
|
|
493
|
+
"dir",
|
|
494
|
+
"short-description",
|
|
495
|
+
"short-description-after"
|
|
496
|
+
]),
|
|
497
|
+
(M(!0), S(v, null, F(me.value, (e) => (M(), b(m, {
|
|
498
|
+
key: e.key,
|
|
499
|
+
heading: e.label,
|
|
500
|
+
html: e.html,
|
|
501
|
+
dir: z(V)
|
|
502
|
+
}, null, 8, [
|
|
503
|
+
"heading",
|
|
504
|
+
"html",
|
|
505
|
+
"dir"
|
|
506
|
+
]))), 128)),
|
|
507
|
+
I(e.$slots, "after-sheet", j(D(Q.value))),
|
|
508
|
+
E(d, {
|
|
509
|
+
credits: we.value,
|
|
510
|
+
"working-number": Te.value,
|
|
511
|
+
"working-number-label": z(i)("sheet.field.workingNumber"),
|
|
512
|
+
citation: Oe.value,
|
|
513
|
+
"citation-heading": g.value.citation?.heading ? z(i)(g.value.citation.heading) : ""
|
|
514
|
+
}, null, 8, [
|
|
515
|
+
"credits",
|
|
516
|
+
"working-number",
|
|
517
|
+
"working-number-label",
|
|
518
|
+
"citation",
|
|
519
|
+
"citation-heading"
|
|
520
|
+
]),
|
|
521
|
+
I(e.$slots, "source", j(D(Q.value)), () => [E(t)]),
|
|
522
|
+
I(e.$slots, "related", j(D({
|
|
523
|
+
...Q.value,
|
|
524
|
+
records: je.value,
|
|
525
|
+
outside: z(ke).outside
|
|
526
|
+
})), () => [Ae.value ? (M(), b(s, {
|
|
527
|
+
key: 0,
|
|
528
|
+
heading: z(i)(Ae.value.heading ?? "record.related.items"),
|
|
529
|
+
records: je.value,
|
|
530
|
+
variant: Ae.value.variant ?? "list",
|
|
531
|
+
"action-label": Ae.value.actionLabel ? z(i)(Ae.value.actionLabel) : ""
|
|
532
|
+
}, null, 8, [
|
|
533
|
+
"heading",
|
|
534
|
+
"records",
|
|
535
|
+
"variant",
|
|
536
|
+
"action-label"
|
|
537
|
+
])) : x("", !0)])
|
|
538
|
+
]), e.$slots.aside ? (M(), S("aside", rt, [I(e.$slots, "aside", j(D(Q.value)))])) : x("", !0)]),
|
|
539
|
+
I(e.$slots, "after", j(D(Q.value))),
|
|
540
|
+
E(u, {
|
|
541
|
+
term: z(J),
|
|
542
|
+
html: se.value,
|
|
543
|
+
dir: z(V),
|
|
544
|
+
onClose: z(Y)
|
|
545
|
+
}, null, 8, [
|
|
546
|
+
"term",
|
|
547
|
+
"html",
|
|
548
|
+
"dir",
|
|
549
|
+
"onClose"
|
|
550
|
+
])
|
|
551
|
+
])) : (M(), S("p", it, R(z(i)("core.status.loading")), 1));
|
|
552
|
+
}
|
|
553
|
+
}, ot = ["dir"], st = {
|
|
554
|
+
key: 0,
|
|
555
|
+
class: "mwnf-essay__breadcrumb"
|
|
556
|
+
}, ct = { class: "mwnf-essay__breadcrumb-label" }, lt = {
|
|
557
|
+
key: 1,
|
|
558
|
+
class: "mwnf-essay__breadcrumb-link"
|
|
559
|
+
}, ut = ["aria-label"], dt = { class: "mwnf-essay__title" }, ft = {
|
|
560
|
+
key: 0,
|
|
561
|
+
class: "mwnf-essay__number"
|
|
562
|
+
}, pt = ["innerHTML"], mt = { class: "mwnf-essay__body" }, ht = { class: "mwnf-essay__main" }, gt = {
|
|
563
|
+
key: 0,
|
|
564
|
+
class: "mwnf-essay__status"
|
|
565
|
+
}, _t = ["innerHTML"], vt = ["innerHTML"], yt = {
|
|
566
|
+
key: 4,
|
|
567
|
+
class: "mwnf-essay__nav"
|
|
568
|
+
}, bt = {
|
|
569
|
+
key: 1,
|
|
570
|
+
class: "mwnf-essay__nav-spacer"
|
|
571
|
+
}, xt = {
|
|
572
|
+
key: 0,
|
|
573
|
+
class: "mwnf-essay__side"
|
|
574
|
+
}, St = {
|
|
575
|
+
key: 0,
|
|
576
|
+
class: "mwnf-essay__panel"
|
|
577
|
+
}, Ct = {
|
|
578
|
+
key: 0,
|
|
579
|
+
class: "mwnf-essay__variants"
|
|
580
|
+
}, wt = ["aria-pressed", "onClick"], Tt = ["src", "alt"], Et = ["innerHTML"], Dt = {
|
|
581
|
+
key: 0,
|
|
582
|
+
class: "mwnf-essay__panel-label"
|
|
583
|
+
}, Ot = ["innerHTML"], kt = ["innerHTML"], At = {
|
|
584
|
+
key: 0,
|
|
585
|
+
class: "mwnf-essay__thumbs"
|
|
586
|
+
}, jt = ["onClick"], Mt = ["src"], Nt = {
|
|
587
|
+
key: 2,
|
|
588
|
+
class: "mwnf-essay__status"
|
|
589
|
+
}, Pt = {
|
|
590
|
+
__name: "EssayView",
|
|
591
|
+
props: {
|
|
592
|
+
spec: {
|
|
593
|
+
type: Object,
|
|
594
|
+
required: !0
|
|
595
|
+
},
|
|
596
|
+
id: {
|
|
597
|
+
type: String,
|
|
598
|
+
required: !0
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
setup(e) {
|
|
602
|
+
let n = e, { t: r } = xe(), i = _e(), a = B();
|
|
603
|
+
function o(e) {
|
|
604
|
+
return !!e && typeof e.walk == "function" && typeof e.children == "function";
|
|
605
|
+
}
|
|
606
|
+
function s(e) {
|
|
607
|
+
return typeof e == "string" ? e : "themes";
|
|
608
|
+
}
|
|
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({
|
|
610
|
+
source: "themes",
|
|
611
|
+
entity: f,
|
|
612
|
+
childType: d.childType
|
|
613
|
+
}) : ge({
|
|
614
|
+
purpose: d?.purpose,
|
|
615
|
+
rootId: d?.rootId,
|
|
616
|
+
childType: d?.childType,
|
|
617
|
+
entity: f,
|
|
618
|
+
order: d?.order
|
|
619
|
+
}), h = ae(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), N = 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
|
+
}), L = y(() => N.value.findIndex((e) => e.id === n.id)), V = y(() => w.value.navigation || !1), ee = y(() => V.value === "siblings" ? L.value > 0 ? N.value[L.value - 1] : null : V.value === "tree" ? m.previous(n.id) : null), H = y(() => V.value === "siblings" ? L.value !== -1 && L.value < N.value.length - 1 ? N.value[L.value + 1] : null : V.value === "tree" ? m.next(n.id) : null), { language: U, dir: G } = Te(O, { entity: f }), ne = y(() => O.value ? i.tr(f, O.value.id, U.value, "en") : {}), q = P(!1);
|
|
624
|
+
te(() => [O.value?.id, U.value], async () => {
|
|
625
|
+
if (q.value = !1, !O.value) {
|
|
626
|
+
q.value = !0;
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
let e = U.value === "en" ? ["en"] : [U.value, "en"];
|
|
630
|
+
await Promise.all([f, c].flatMap((t) => e.map((e) => i.loadTranslations(t, e)))), q.value = !0;
|
|
631
|
+
}, { immediate: !0 });
|
|
632
|
+
function ie(e) {
|
|
633
|
+
if (!e) return "";
|
|
634
|
+
let t = w.value.placeholder, n = (e) => !!e && !!t && t.test(e), r = i.tr(f, e.id, U.value, "en");
|
|
635
|
+
if (r.title && !n(r.title)) return r.title;
|
|
636
|
+
let a = i.tr(f, e.id, "en").title;
|
|
637
|
+
return a && !n(a) ? a : e.internal_name ?? e.id;
|
|
638
|
+
}
|
|
639
|
+
let J = y(() => ({
|
|
640
|
+
node: O.value,
|
|
641
|
+
text: ne.value,
|
|
642
|
+
language: U.value,
|
|
643
|
+
tree: m,
|
|
644
|
+
select: Ie,
|
|
645
|
+
t: r,
|
|
646
|
+
tr: (e, t) => i.tr(e, t, U.value, "en")
|
|
647
|
+
}));
|
|
648
|
+
function oe(e, t) {
|
|
649
|
+
return t.split(".").reduce((e, t) => e?.[t], e);
|
|
650
|
+
}
|
|
651
|
+
function X(e, t) {
|
|
652
|
+
return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : oe(t.text, e) ?? "";
|
|
653
|
+
}
|
|
654
|
+
let Z = y(() => X(w.value.quote ?? "quote", J.value)), Q = y(() => X(w.value.body ?? "description", J.value)), ce = y(() => {
|
|
655
|
+
if (!w.value.glossary || !O.value) return [];
|
|
656
|
+
let e = [Z.value, Q.value].filter(Boolean);
|
|
657
|
+
return se(e.join("\n\n"), U.value);
|
|
658
|
+
}), le = y(() => Y(ce.value)), { active: ue, onClick: pe, close: me } = be(ce), he = y(() => ue.value ? de(ue.value.definition, { breaks: !0 }) : ""), ve = y(() => O.value ? w.value.heading ? w.value.heading(J.value) : $(String(ie(O.value)), { glossary: le.value }) : ""), ye = y(() => Z.value ? $(String(Z.value), { glossary: le.value }) : ""), Se = y(() => Q.value ? de(String(Q.value), {
|
|
659
|
+
breaks: !0,
|
|
660
|
+
glossary: le.value
|
|
661
|
+
}) : ""), Ce = y(() => O.value ? w.value.about?.(O.value) ?? !1 : !1), we = y(() => !!Ce.value);
|
|
662
|
+
function Ee(e) {
|
|
663
|
+
let t = Ce.value;
|
|
664
|
+
return t && typeof t == "object" ? !!t[e] : !!w.value.aboutKeeps?.includes(e);
|
|
665
|
+
}
|
|
666
|
+
let De = [
|
|
667
|
+
[1e3, "M"],
|
|
668
|
+
[900, "CM"],
|
|
669
|
+
[500, "D"],
|
|
670
|
+
[400, "CD"],
|
|
671
|
+
[100, "C"],
|
|
672
|
+
[90, "XC"],
|
|
673
|
+
[50, "L"],
|
|
674
|
+
[40, "XL"],
|
|
675
|
+
[10, "X"],
|
|
676
|
+
[9, "IX"],
|
|
677
|
+
[5, "V"],
|
|
678
|
+
[4, "IV"],
|
|
679
|
+
[1, "I"]
|
|
680
|
+
];
|
|
681
|
+
function Oe(e) {
|
|
682
|
+
let t = e, n = "";
|
|
683
|
+
for (let [e, r] of De) for (; t >= e;) n += r, t -= e;
|
|
684
|
+
return n;
|
|
685
|
+
}
|
|
686
|
+
let ke = y(() => {
|
|
687
|
+
let e = w.value.numbering;
|
|
688
|
+
if (!e || !O.value) return "";
|
|
689
|
+
let t = (N.value.length ? N.value : [O.value]).findIndex((e) => e.id === n.id), r = t >= 0 ? t + 1 : 1;
|
|
690
|
+
return e === "roman" ? Oe(r) : String(r);
|
|
691
|
+
});
|
|
692
|
+
function Ae(e) {
|
|
693
|
+
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
|
+
}
|
|
695
|
+
let je = re(c), Me = y(() => {
|
|
696
|
+
let e = w.value.items?.of ?? Ae;
|
|
697
|
+
return O.value ? e(O.value, J.value) : [];
|
|
698
|
+
}), Ne = y(() => Me.value.map((e) => je.value.get(e)).filter(Boolean)), Pe = P(null);
|
|
699
|
+
te(Ne, (e) => {
|
|
700
|
+
e.some((e) => e.id === Pe.value) || (Pe.value = e[0]?.id ?? null);
|
|
701
|
+
}, { 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;
|
|
705
|
+
}
|
|
706
|
+
function Le(e) {
|
|
707
|
+
let t = w.value.items?.route;
|
|
708
|
+
return !t || !e ? null : typeof t == "function" ? t(e, J.value) : {
|
|
709
|
+
name: t,
|
|
710
|
+
params: { id: e.id }
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
function Re(e) {
|
|
714
|
+
let t = w.value.route;
|
|
715
|
+
return !t || !e ? null : typeof t == "function" ? t(e, J.value) : {
|
|
716
|
+
name: t,
|
|
717
|
+
params: { id: e.id }
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function ze(e) {
|
|
721
|
+
if (!e) return null;
|
|
722
|
+
let t = i.tr(c, e.id, U.value, "en").name ?? e.internal_name ?? e.id;
|
|
723
|
+
return {
|
|
724
|
+
name: $(String(t)),
|
|
725
|
+
image: e.images?.[0]?.url ?? "",
|
|
726
|
+
imageAlt: fe(String(t))
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
let Be = y(() => {
|
|
730
|
+
let e = Fe.value;
|
|
731
|
+
if (!e) return null;
|
|
732
|
+
let t = ze(e), n = w.value.items?.caption?.(e, O.value, J.value);
|
|
733
|
+
return {
|
|
734
|
+
...t,
|
|
735
|
+
...n
|
|
736
|
+
};
|
|
737
|
+
}), Ve = y(() => !!w.value.panel), He = y(() => {
|
|
738
|
+
let e = Fe.value;
|
|
739
|
+
if (!e) return [];
|
|
740
|
+
let t = Be.value, n = e.images?.[0]?.url ? [{
|
|
741
|
+
id: "__primary",
|
|
742
|
+
image: e.images[0].url,
|
|
743
|
+
alt: t?.imageAlt ?? "",
|
|
744
|
+
caption: {
|
|
745
|
+
title: t?.name ?? "",
|
|
746
|
+
justification: "",
|
|
747
|
+
fields: null
|
|
748
|
+
}
|
|
749
|
+
}] : [], r = w.value.panel?.variants?.(e, J.value) ?? [];
|
|
750
|
+
return [...n, ...r.map((e, t) => ({
|
|
751
|
+
id: e.id ?? `variant-${t}`,
|
|
752
|
+
...e
|
|
753
|
+
}))];
|
|
754
|
+
}), Ue = P(null);
|
|
755
|
+
te(He, (e) => {
|
|
756
|
+
e.some((e) => e.id === Ue.value) || (Ue.value = e[0]?.id ?? null);
|
|
757
|
+
}, { 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;
|
|
761
|
+
}
|
|
762
|
+
let Ke = y(() => {
|
|
763
|
+
let e = We.value;
|
|
764
|
+
return e?.image ? [{
|
|
765
|
+
url: e.image,
|
|
766
|
+
alt: e.alt ?? ""
|
|
767
|
+
}] : [];
|
|
768
|
+
}), qe = y(() => {
|
|
769
|
+
let e = Fe.value;
|
|
770
|
+
return !e || !w.value.panel?.fields ? [] : w.value.panel.fields(e, O.value, J.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) : "",
|
|
775
|
+
value: e.value
|
|
776
|
+
}));
|
|
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, J.value) ?? [], r = w.value.items?.badge?.(e, J.value) ?? "";
|
|
782
|
+
return {
|
|
783
|
+
id: e.id,
|
|
784
|
+
image: t.image,
|
|
785
|
+
imageAlt: t.imageAlt,
|
|
786
|
+
name: t.name,
|
|
787
|
+
meta: n,
|
|
788
|
+
badge: r,
|
|
789
|
+
to: Le(e)
|
|
790
|
+
};
|
|
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) : [] : N.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
|
+
...J.value,
|
|
796
|
+
items: Ne.value,
|
|
797
|
+
selected: Fe.value,
|
|
798
|
+
selectedVariant: We.value,
|
|
799
|
+
selectVariant: Ge,
|
|
800
|
+
breadcrumb: Ze.value,
|
|
801
|
+
previous: ee.value,
|
|
802
|
+
next: H.value
|
|
803
|
+
})), at = y(() => we.value && !Ee("panel") ? !1 : Ve.value || Ne.value.length > 0 || !!a.aside), Pt = y(() => (!we.value || Ee("navigation")) && !!V.value && !!(ee.value || H.value));
|
|
804
|
+
return (n, i) => g.value && !O.value ? (M(), b(z(K), { key: 0 })) : O.value ? (M(), S("article", {
|
|
805
|
+
key: 1,
|
|
806
|
+
class: A(["mwnf-essay", { "mwnf-essay--about": we.value }]),
|
|
807
|
+
dir: z(G) || void 0,
|
|
808
|
+
onClick: i[0] ||= (...e) => z(pe) && z(pe)(...e)
|
|
809
|
+
}, [
|
|
810
|
+
I(n.$slots, "header", j(D(it.value)), () => [
|
|
811
|
+
Ze.value.length ? (M(), S("p", st, [C("span", ct, R(z(r)(tt.value)), 1), (M(!0), S(v, null, F(Ze.value, (e) => (M(), S(v, { key: e.id }, [Re(e) ? (M(), b(_, {
|
|
812
|
+
key: 0,
|
|
813
|
+
to: Re(e),
|
|
814
|
+
class: "mwnf-essay__breadcrumb-link"
|
|
815
|
+
}, {
|
|
816
|
+
default: W(() => [T(R(ie(e)), 1)]),
|
|
817
|
+
_: 2
|
|
818
|
+
}, 1032, ["to"])) : (M(), S("span", lt, R(ie(e)), 1))], 64))), 128))])) : x("", !0),
|
|
819
|
+
Qe.value.length > 1 ? (M(), S("div", {
|
|
820
|
+
key: 1,
|
|
821
|
+
class: "mwnf-essay__tabs",
|
|
822
|
+
role: "tablist",
|
|
823
|
+
"aria-label": z(r)(nt.value)
|
|
824
|
+
}, [(M(!0), S(v, null, F(Qe.value, (t) => (M(), b(_, {
|
|
825
|
+
key: t.id,
|
|
826
|
+
to: Re(t),
|
|
827
|
+
class: A(["mwnf-essay__tab", { "mwnf-essay__tab--active": t.id === e.id }])
|
|
828
|
+
}, {
|
|
829
|
+
default: W(() => [T(R(ie(t)), 1)]),
|
|
830
|
+
_: 2
|
|
831
|
+
}, 1032, ["to", "class"]))), 128))], 8, ut)) : x("", !0),
|
|
832
|
+
C("h1", dt, [ke.value ? (M(), S("span", ft, R(ke.value), 1)) : x("", !0), C("span", { innerHTML: ve.value }, null, 8, pt)])
|
|
833
|
+
]),
|
|
834
|
+
C("div", mt, [C("div", ht, [
|
|
835
|
+
q.value ? x("", !0) : (M(), S("p", gt, R(z(r)("core.status.loading")), 1)),
|
|
836
|
+
ye.value ? (M(), S("p", {
|
|
837
|
+
key: 1,
|
|
838
|
+
class: "mwnf-essay__quote",
|
|
839
|
+
innerHTML: ye.value
|
|
840
|
+
}, null, 8, _t)) : x("", !0),
|
|
841
|
+
I(n.$slots, "before-body", j(D(it.value))),
|
|
842
|
+
Se.value ? (M(), S("div", {
|
|
843
|
+
key: 2,
|
|
844
|
+
class: "mwnf-essay__prose mwnf-sheet__block",
|
|
845
|
+
innerHTML: Se.value
|
|
846
|
+
}, null, 8, vt)) : x("", !0),
|
|
847
|
+
I(n.$slots, "after-body", j(D(it.value))),
|
|
848
|
+
we.value ? x("", !0) : I(n.$slots, "justifications", j(D(it.value)), void 0, void 0, 3),
|
|
849
|
+
Pt.value ? (M(), S("div", yt, [I(n.$slots, "navigation", j(D(it.value)), () => [ee.value ? (M(), b(_, {
|
|
850
|
+
key: 0,
|
|
851
|
+
to: Re(ee.value),
|
|
852
|
+
class: "mwnf-essay__nav-link mwnf-essay__nav-link--previous"
|
|
853
|
+
}, {
|
|
854
|
+
default: W(() => [T("← " + R(z(r)($e.value)), 1)]),
|
|
855
|
+
_: 1
|
|
856
|
+
}, 8, ["to"])) : (M(), S("span", bt)), H.value ? (M(), b(_, {
|
|
857
|
+
key: 2,
|
|
858
|
+
to: Re(H.value),
|
|
859
|
+
class: "mwnf-essay__nav-link mwnf-essay__nav-link--next"
|
|
860
|
+
}, {
|
|
861
|
+
default: W(() => [T(R(z(r)(et.value)) + " →", 1)]),
|
|
862
|
+
_: 1
|
|
863
|
+
}, 8, ["to"])) : x("", !0)])])) : x("", !0)
|
|
864
|
+
]), at.value ? (M(), S("div", xt, [
|
|
865
|
+
I(n.$slots, "panel", j(D(it.value)), () => [Ve.value && Be.value ? (M(), S("div", St, [
|
|
866
|
+
E(p, { images: Ke.value }, null, 8, ["images"]),
|
|
867
|
+
He.value.length > 1 ? (M(), S("ul", Ct, [(M(!0), S(v, null, F(He.value, (e) => (M(), S("li", { key: e.id }, [C("button", {
|
|
868
|
+
type: "button",
|
|
869
|
+
class: A(["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 ? (M(), S("img", {
|
|
873
|
+
key: 0,
|
|
874
|
+
src: e.image,
|
|
875
|
+
alt: e.alt ?? "",
|
|
876
|
+
loading: "lazy"
|
|
877
|
+
}, null, 8, Tt)) : x("", !0)], 10, wt)]))), 128))])) : x("", !0),
|
|
878
|
+
C("h3", {
|
|
879
|
+
class: "mwnf-essay__panel-name",
|
|
880
|
+
innerHTML: We.value?.caption?.title || Be.value.name
|
|
881
|
+
}, null, 8, Et),
|
|
882
|
+
(M(!0), S(v, null, F(Je.value, (e, t) => (M(), S("p", {
|
|
883
|
+
key: t,
|
|
884
|
+
class: "mwnf-essay__panel-field"
|
|
885
|
+
}, [e.label ? (M(), S("span", Dt, R(e.label), 1)) : x("", !0), C("span", { innerHTML: e.value }, null, 8, Ot)]))), 128)),
|
|
886
|
+
Ye.value ? (M(), S("p", {
|
|
887
|
+
key: 1,
|
|
888
|
+
class: "mwnf-essay__panel-justification mwnf-sheet__block",
|
|
889
|
+
innerHTML: Ye.value
|
|
890
|
+
}, null, 8, kt)) : x("", !0),
|
|
891
|
+
Le(Fe.value) ? (M(), b(_, {
|
|
892
|
+
key: 2,
|
|
893
|
+
to: Le(Fe.value),
|
|
894
|
+
class: "mwnf-essay__panel-link"
|
|
895
|
+
}, {
|
|
896
|
+
default: W(() => [T(R(z(r)(rt.value)) + " →", 1)]),
|
|
897
|
+
_: 1
|
|
898
|
+
}, 8, ["to"])) : x("", !0)
|
|
899
|
+
])) : x("", !0)]),
|
|
900
|
+
I(n.$slots, "thumbnails", j(D(it.value)), () => [Ve.value && Ne.value.length > 1 ? (M(), S("ul", At, [(M(!0), S(v, null, F(Ne.value, (e) => (M(), S("li", { key: e.id }, [C("button", {
|
|
901
|
+
type: "button",
|
|
902
|
+
class: A(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === Fe.value?.id }]),
|
|
903
|
+
onClick: (t) => Ie(e.id)
|
|
904
|
+
}, [e.images?.[0]?.url ? (M(), S("img", {
|
|
905
|
+
key: 0,
|
|
906
|
+
src: e.images[0].url,
|
|
907
|
+
alt: "",
|
|
908
|
+
loading: "lazy"
|
|
909
|
+
}, null, 8, Mt)) : x("", !0)], 10, jt)]))), 128))])) : !Ve.value && Xe.value.length ? (M(), b(l, {
|
|
910
|
+
key: 1,
|
|
911
|
+
records: Xe.value
|
|
912
|
+
}, null, 8, ["records"])) : x("", !0)]),
|
|
913
|
+
I(n.$slots, "aside", j(D(it.value)))
|
|
914
|
+
])) : x("", !0)]),
|
|
915
|
+
I(n.$slots, "after", j(D(it.value)), () => [E(t)]),
|
|
916
|
+
E(u, {
|
|
917
|
+
term: z(ue),
|
|
918
|
+
html: he.value,
|
|
919
|
+
dir: z(G),
|
|
920
|
+
onClose: z(me)
|
|
921
|
+
}, null, 8, [
|
|
922
|
+
"term",
|
|
923
|
+
"html",
|
|
924
|
+
"dir",
|
|
925
|
+
"onClose"
|
|
926
|
+
])
|
|
927
|
+
], 10, ot)) : (M(), S("p", Nt, R(z(r)("core.status.loading")), 1));
|
|
928
|
+
}
|
|
929
|
+
}, Ft = { class: "mwnf-link-list" }, It = {
|
|
930
|
+
key: 0,
|
|
931
|
+
class: "mwnf-link-list__back"
|
|
932
|
+
}, Lt = {
|
|
933
|
+
key: 1,
|
|
934
|
+
class: "mwnf-link-list__title"
|
|
935
|
+
}, Rt = {
|
|
936
|
+
key: 2,
|
|
937
|
+
class: "mwnf-link-list__groups"
|
|
938
|
+
}, zt = {
|
|
939
|
+
key: 0,
|
|
940
|
+
class: "mwnf-link-list__heading"
|
|
941
|
+
}, Bt = {
|
|
942
|
+
key: 1,
|
|
943
|
+
class: "mwnf-link-list__links"
|
|
944
|
+
}, Vt = ["innerHTML"], Ht = ["innerHTML"], Ut = {
|
|
945
|
+
key: 3,
|
|
946
|
+
class: "mwnf-link-list__empty"
|
|
947
|
+
}, Wt = {
|
|
948
|
+
__name: "LinkListView",
|
|
949
|
+
props: { spec: {
|
|
950
|
+
type: Object,
|
|
951
|
+
required: !0
|
|
952
|
+
} },
|
|
953
|
+
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) => (M(), S("div", Ft, [
|
|
956
|
+
t.spec.back && a.value ? (M(), S("div", It, [E(_, {
|
|
957
|
+
to: t.spec.back.to,
|
|
958
|
+
href: t.spec.back.href
|
|
959
|
+
}, {
|
|
960
|
+
default: W(() => [T(" ← " + R(a.value), 1)]),
|
|
961
|
+
_: 1
|
|
962
|
+
}, 8, ["to", "href"])])) : x("", !0),
|
|
963
|
+
i.value ? (M(), S("h1", Lt, R(i.value), 1)) : x("", !0),
|
|
964
|
+
I(e.$slots, "before"),
|
|
965
|
+
r.value.length ? (M(), S("div", Rt, [(M(!0), S(v, null, F(r.value, (t, r) => (M(), S("section", {
|
|
966
|
+
key: r,
|
|
967
|
+
class: "mwnf-link-list__group"
|
|
968
|
+
}, [I(e.$slots, "group", { group: t }, () => [t.heading ? (M(), S("h2", zt, R(z(n)(t.heading)), 1)) : x("", !0), t.links?.length ? (M(), S("ul", Bt, [(M(!0), S(v, null, F(t.links, (e, t) => (M(), S("li", {
|
|
969
|
+
key: t,
|
|
970
|
+
class: "mwnf-link-list__item"
|
|
971
|
+
}, [E(_, {
|
|
972
|
+
class: "mwnf-link-list__link",
|
|
973
|
+
to: e.to,
|
|
974
|
+
href: e.href
|
|
975
|
+
}, {
|
|
976
|
+
default: W(() => [C("span", { innerHTML: z(ce)(e.label) }, null, 8, Vt)]),
|
|
977
|
+
_: 2
|
|
978
|
+
}, 1032, ["to", "href"]), e.note ? (M(), S("div", {
|
|
979
|
+
key: 0,
|
|
980
|
+
class: "mwnf-link-list__note",
|
|
981
|
+
innerHTML: z(ce)(e.note)
|
|
982
|
+
}, null, 8, Ht)) : x("", !0)]))), 128))])) : x("", !0)])]))), 128))])) : (M(), S("div", Ut, R(o.value), 1)),
|
|
983
|
+
I(e.$slots, "after")
|
|
984
|
+
]));
|
|
985
|
+
}
|
|
986
|
+
}, Gt = { class: "mwnf-partner-list" }, Kt = {
|
|
987
|
+
key: 0,
|
|
988
|
+
class: "mwnf-partner-list__title"
|
|
989
|
+
}, qt = {
|
|
990
|
+
key: 1,
|
|
991
|
+
class: "mwnf-partner-list__count"
|
|
992
|
+
}, Jt = {
|
|
993
|
+
key: 2,
|
|
994
|
+
class: "mwnf-partner-list__toggle"
|
|
995
|
+
}, Yt = {
|
|
996
|
+
key: 3,
|
|
997
|
+
class: "mwnf-partner-list__groups"
|
|
998
|
+
}, Xt = {
|
|
999
|
+
key: 0,
|
|
1000
|
+
class: "mwnf-partner-list__group-title"
|
|
1001
|
+
}, Zt = { class: "mwnf-partner-list__tier" }, Qt = { class: "mwnf-partner-list__row" }, $t = ["src", "alt"], en = ["innerHTML"], tn = { key: 0 }, nn = {
|
|
1002
|
+
key: 1,
|
|
1003
|
+
class: "mwnf-partner-list__meta"
|
|
1004
|
+
}, rn = {
|
|
1005
|
+
key: 0,
|
|
1006
|
+
class: "mwnf-partner-list__children"
|
|
1007
|
+
}, an = ["src", "alt"], on = ["innerHTML"], sn = { key: 0 }, cn = {
|
|
1008
|
+
key: 1,
|
|
1009
|
+
class: "mwnf-partner-list__meta"
|
|
1010
|
+
}, ln = {
|
|
1011
|
+
key: 0,
|
|
1012
|
+
class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
|
|
1013
|
+
}, un = { class: "mwnf-partner-list__tier-label" }, dn = ["src", "alt"], fn = ["innerHTML"], pn = { key: 0 }, mn = {
|
|
1014
|
+
key: 1,
|
|
1015
|
+
class: "mwnf-partner-list__meta"
|
|
1016
|
+
}, hn = {
|
|
1017
|
+
key: 4,
|
|
1018
|
+
class: "mwnf-partner-list__empty"
|
|
1019
|
+
}, gn = {
|
|
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 = ae(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 = X(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
|
+
}), A = y(() => O.value.some((e) => e.main.length > 0 || e.associated.length > 0)), N = y(() => n(a.value.associatedLabel ?? "partner.list.associated")), P = y(() => n(a.value.objectsLabel ?? "partner.item.objectsInSite")), z = y(() => n(a.value.foundLabel ?? "partner.list.partnersFound")), B = y(() => n(a.value.sortAscendingLabel ?? "partner.list.sortAscending")), V = y(() => n(a.value.sortDescendingLabel ?? "partner.list.sortDescending")), ee = y(() => n(a.value.empty ?? "catalogue.results.noResults")), H = y(() => a.value.title ? n(a.value.title) : ""), U = y(() => O.value.reduce((e, t) => e + t.main.length + t.associated.length, 0)), te = y(() => a.value.variant ?? "accordion"), G = y(() => ({
|
|
1107
|
+
t: n,
|
|
1108
|
+
locale: r,
|
|
1109
|
+
groups: O.value,
|
|
1110
|
+
orderDir: d.value,
|
|
1111
|
+
toggleOrder: f
|
|
1112
|
+
}));
|
|
1113
|
+
return (e, t) => (M(), S("section", Gt, [
|
|
1114
|
+
H.value ? (M(), S("h1", Kt, R(H.value), 1)) : x("", !0),
|
|
1115
|
+
a.value.count ? (M(), S("div", qt, R(z.value) + ": " + R(U.value), 1)) : x("", !0),
|
|
1116
|
+
I(e.$slots, "before", j(D(G.value))),
|
|
1117
|
+
a.value.orderToggle ? (M(), S("div", Jt, [C("button", {
|
|
1118
|
+
type: "button",
|
|
1119
|
+
class: "mwnf-partner-list__toggle-button",
|
|
1120
|
+
onClick: f
|
|
1121
|
+
}, R(d.value === "asc" ? V.value : B.value), 1)])) : x("", !0),
|
|
1122
|
+
A.value ? (M(), S("div", Yt, [(M(!0), S(v, null, F(O.value, (t) => (M(), b(L(te.value === "accordion" ? "details" : "section"), k({
|
|
1123
|
+
key: t.country ?? "",
|
|
1124
|
+
class: "mwnf-partner-list__group"
|
|
1125
|
+
}, { ref_for: !0 }, te.value === "accordion" ? { open: !0 } : {}), {
|
|
1126
|
+
default: W(() => [
|
|
1127
|
+
(M(), b(L(te.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
|
|
1128
|
+
default: W(() => [I(e.$slots, "group-heading", k({ group: t }, { ref_for: !0 }, G.value), () => [t.label ? (M(), S("h2", Xt, R(t.label), 1)) : x("", !0)])]),
|
|
1129
|
+
_: 2
|
|
1130
|
+
}, 1024)),
|
|
1131
|
+
C("div", Zt, [(M(!0), S(v, null, F(t.main, (n) => (M(), S("div", {
|
|
1132
|
+
key: n.partner.id,
|
|
1133
|
+
class: "mwnf-partner-list__row-block"
|
|
1134
|
+
}, [C("div", Qt, [I(e.$slots, "row", k({
|
|
1135
|
+
group: t,
|
|
1136
|
+
partner: n.partner,
|
|
1137
|
+
row: n.row
|
|
1138
|
+
}, { ref_for: !0 }, G.value), () => [
|
|
1139
|
+
n.row.logo ? (M(), 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, $t)) : x("", !0),
|
|
1146
|
+
(M(), b(L(n.row.route ? _ : "span"), {
|
|
1147
|
+
class: "mwnf-partner-list__name",
|
|
1148
|
+
to: n.row.route
|
|
1149
|
+
}, {
|
|
1150
|
+
default: W(() => [C("span", { innerHTML: n.row.name }, null, 8, en), n.row.city ? (M(), S("span", tn, ", " + R(n.row.city), 1)) : x("", !0)]),
|
|
1151
|
+
_: 2
|
|
1152
|
+
}, 1032, ["to"])),
|
|
1153
|
+
n.row.count ? (M(), S("span", nn, R(n.row.count) + " " + R(P.value), 1)) : x("", !0)
|
|
1154
|
+
])]), n.children?.length ? (M(), S("div", rn, [(M(!0), S(v, null, F(n.children, (n) => (M(), S("div", {
|
|
1155
|
+
key: n.partner.id,
|
|
1156
|
+
class: "mwnf-partner-list__row mwnf-partner-list__row--child"
|
|
1157
|
+
}, [I(e.$slots, "row", k({
|
|
1158
|
+
group: t,
|
|
1159
|
+
partner: n.partner,
|
|
1160
|
+
row: n.row
|
|
1161
|
+
}, { ref_for: !0 }, G.value), () => [
|
|
1162
|
+
n.row.logo ? (M(), 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, an)) : x("", !0),
|
|
1169
|
+
(M(), b(L(n.row.route ? _ : "span"), {
|
|
1170
|
+
class: "mwnf-partner-list__name",
|
|
1171
|
+
to: n.row.route
|
|
1172
|
+
}, {
|
|
1173
|
+
default: W(() => [C("span", { innerHTML: n.row.name }, null, 8, on), n.row.city ? (M(), S("span", sn, ", " + R(n.row.city), 1)) : x("", !0)]),
|
|
1174
|
+
_: 2
|
|
1175
|
+
}, 1032, ["to"])),
|
|
1176
|
+
n.row.count ? (M(), S("span", cn, R(n.row.count) + " " + R(P.value), 1)) : x("", !0)
|
|
1177
|
+
])]))), 128))])) : x("", !0)]))), 128))]),
|
|
1178
|
+
t.associated.length ? (M(), S("div", ln, [C("p", un, R(N.value), 1), (M(!0), S(v, null, F(t.associated, (n) => (M(), S("div", {
|
|
1179
|
+
key: n.partner.id,
|
|
1180
|
+
class: "mwnf-partner-list__row"
|
|
1181
|
+
}, [I(e.$slots, "row", k({
|
|
1182
|
+
group: t,
|
|
1183
|
+
partner: n.partner,
|
|
1184
|
+
row: n.row
|
|
1185
|
+
}, { ref_for: !0 }, G.value), () => [
|
|
1186
|
+
n.row.logo ? (M(), 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, dn)) : x("", !0),
|
|
1193
|
+
(M(), b(L(n.row.route ? _ : "span"), {
|
|
1194
|
+
class: "mwnf-partner-list__name",
|
|
1195
|
+
to: n.row.route
|
|
1196
|
+
}, {
|
|
1197
|
+
default: W(() => [C("span", { innerHTML: n.row.name }, null, 8, fn), n.row.city ? (M(), S("span", pn, ", " + R(n.row.city), 1)) : x("", !0)]),
|
|
1198
|
+
_: 2
|
|
1199
|
+
}, 1032, ["to"])),
|
|
1200
|
+
n.row.count ? (M(), S("span", mn, R(n.row.count) + " " + R(P.value), 1)) : x("", !0)
|
|
1201
|
+
])]))), 128))])) : x("", !0)
|
|
1202
|
+
]),
|
|
1203
|
+
_: 2
|
|
1204
|
+
}, 1040))), 128))])) : (M(), S("p", hn, R(ee.value), 1)),
|
|
1205
|
+
I(e.$slots, "after", j(D(G.value)))
|
|
1206
|
+
]));
|
|
1207
|
+
}
|
|
1208
|
+
}, _n = { class: "mwnf-text-page" }, vn = {
|
|
1209
|
+
key: 0,
|
|
1210
|
+
class: "mwnf-text-page__back"
|
|
1211
|
+
}, yn = {
|
|
1212
|
+
key: 1,
|
|
1213
|
+
class: "mwnf-text-page__heading"
|
|
1214
|
+
}, bn = { class: "mwnf-prose" }, xn = ["innerHTML"], Sn = {
|
|
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" ? Q(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) => (M(), S("div", _n, [
|
|
1227
|
+
u.value && (t.spec.back === !0 || t.spec.back?.to || t.spec.back?.href) ? (M(), S("div", vn, [E(_, {
|
|
1228
|
+
to: t.spec.back === !0 ? {} : t.spec.back?.to,
|
|
1229
|
+
href: t.spec.back === !0 ? "#" : t.spec.back?.href
|
|
1230
|
+
}, {
|
|
1231
|
+
default: W(() => [T(" ← " + R(u.value), 1)]),
|
|
1232
|
+
_: 1
|
|
1233
|
+
}, 8, ["to", "href"])])) : x("", !0),
|
|
1234
|
+
a.value ? (M(), S("h1", yn, R(a.value), 1)) : x("", !0),
|
|
1235
|
+
C("div", bn, [o.value ? (M(), b(z(ne), {
|
|
1236
|
+
key: 0,
|
|
1237
|
+
keypath: s.value
|
|
1238
|
+
}, null, 8, ["keypath"])) : l.value ? (M(), S("div", {
|
|
1239
|
+
key: 1,
|
|
1240
|
+
innerHTML: l.value
|
|
1241
|
+
}, null, 8, xn)) : x("", !0)])
|
|
1242
|
+
]));
|
|
1243
|
+
}
|
|
1244
|
+
}, Cn = { class: "mwnf-search-form__row-label" }, wn = ["onUpdate:modelValue"], Tn = ["value"], En = ["onUpdate:modelValue"], Dn = ["value"], On = ["onUpdate:modelValue", "placeholder"], kn = {
|
|
1245
|
+
key: 0,
|
|
1246
|
+
class: "mwnf-search-form__dates"
|
|
1247
|
+
}, An = {
|
|
1248
|
+
key: 1,
|
|
1249
|
+
class: "mwnf-facet"
|
|
1250
|
+
}, jn = { class: "mwnf-facet__label" }, Mn = { value: "" }, Nn = ["value"], Pn = {
|
|
1251
|
+
key: 0,
|
|
1252
|
+
class: "mwnf-search-form__dates"
|
|
1253
|
+
}, Fn = { class: "mwnf-search-form__radio-choice" }, In = ["value"], Ln = ["onUpdate:modelValue", "disabled"], Rn = ["onUpdate:modelValue"], zn = { class: "mwnf-facet__label" }, Bn = {
|
|
1254
|
+
key: 0,
|
|
1255
|
+
class: "mwnf-search-form__how-to"
|
|
1256
|
+
}, Vn = {
|
|
1257
|
+
__name: "SearchFormView",
|
|
1258
|
+
props: { spec: {
|
|
1259
|
+
type: Object,
|
|
1260
|
+
required: !0
|
|
1261
|
+
} },
|
|
1262
|
+
setup(e) {
|
|
1263
|
+
let t = e, { t: n } = xe(), a = Ne(), o = y(() => t.spec), s = y(() => o.value.mode), c = y(() => o.value.entity ? ae(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 ?? q();
|
|
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 ? je(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 = P(""), w = P(""), k = o.value.language ? Oe(o.value.language) : null, L = y(() => k?.languages.value ?? []), B = k?.language ?? P(""), te = y(() => Object.fromEntries((o.value.facets ?? []).filter((e) => !e.options && e.type !== "year").map((e) => [e.key, { field: e.field ?? e.key }]))), ne = ve(c, te), K = y(() => {
|
|
1276
|
+
let e = {};
|
|
1277
|
+
for (let t of o.value.facets ?? []) e[t.key] = t.options ?? ne.value[t.key] ?? [];
|
|
1278
|
+
return e;
|
|
1279
|
+
}), re = [{
|
|
1280
|
+
key: "AND",
|
|
1281
|
+
label: "catalogue.search.and"
|
|
1282
|
+
}, {
|
|
1283
|
+
key: "OR",
|
|
1284
|
+
label: "catalogue.search.or"
|
|
1285
|
+
}], ie = [
|
|
1286
|
+
"catalogue.search.keywordOne",
|
|
1287
|
+
"catalogue.search.keywordTwo",
|
|
1288
|
+
"catalogue.search.keywordThree"
|
|
1289
|
+
], J = y(() => o.value.operators ?? re), oe = P(Array.from({ length: o.value.rows ?? 3 }, () => ({
|
|
1290
|
+
keyword: "",
|
|
1291
|
+
field: o.value.fields?.[0]?.key ?? "",
|
|
1292
|
+
cond: (o.value.operators ?? re)[0].key
|
|
1293
|
+
})));
|
|
1294
|
+
function Y(e) {
|
|
1295
|
+
return ie[e] ? n(ie[e]) : "";
|
|
1296
|
+
}
|
|
1297
|
+
let se = P(o.value.facets?.[0]?.key ?? ""), X = N(Object.fromEntries((o.value.facets ?? []).map((e) => [e.key, ""]))), Z = N(Object.fromEntries((o.value.extras ?? []).map((e) => [e.key, !1])));
|
|
1298
|
+
function Q() {
|
|
1299
|
+
let e = {};
|
|
1300
|
+
for (let t of o.value.extras ?? []) Z[t.key] && (e[t.key] = "1");
|
|
1301
|
+
return e;
|
|
1302
|
+
}
|
|
1303
|
+
function ce(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") oe.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)), B.value && (e.lang = B.value);
|
|
1320
|
+
else if (s.value === "radio") {
|
|
1321
|
+
let t = se.value, n = t ? X[t] : "";
|
|
1322
|
+
n && (e[t] = String(n));
|
|
1323
|
+
}
|
|
1324
|
+
return Object.assign(e, Q()), ce(e);
|
|
1325
|
+
}
|
|
1326
|
+
function ue(e, t) {
|
|
1327
|
+
if (t !== "" && t != null) return ce({
|
|
1328
|
+
[e]: String(t),
|
|
1329
|
+
...Q()
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
function de() {
|
|
1333
|
+
return ce(Q());
|
|
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) => (M(), S("section", { class: A(["mwnf-search-form", `mwnf-search-form--${s.value}`]) }, [
|
|
1341
|
+
I(e.$slots, "intro", j(D(he.value))),
|
|
1342
|
+
I(e.$slots, "before", j(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: W(() => [
|
|
1352
|
+
s.value === "rows" ? (M(), S(v, { key: 0 }, [
|
|
1353
|
+
(M(!0), S(v, null, F(oe.value, (e, t) => (M(), S("div", {
|
|
1354
|
+
key: t,
|
|
1355
|
+
class: "mwnf-search-form__row"
|
|
1356
|
+
}, [
|
|
1357
|
+
C("span", Cn, R(Y(t)), 1),
|
|
1358
|
+
t > 0 ? G((M(), S("select", {
|
|
1359
|
+
key: 0,
|
|
1360
|
+
"onUpdate:modelValue": (t) => e.cond = t,
|
|
1361
|
+
class: "mwnf-facet__select mwnf-search-form__operator"
|
|
1362
|
+
}, [(M(!0), S(v, null, F(J.value, (e) => (M(), S("option", {
|
|
1363
|
+
key: e.key,
|
|
1364
|
+
value: e.key
|
|
1365
|
+
}, R(z(n)(e.label)), 9, Tn))), 128))], 8, wn)), [[H, e.cond]]) : x("", !0),
|
|
1366
|
+
G(C("select", {
|
|
1367
|
+
"onUpdate:modelValue": (t) => e.field = t,
|
|
1368
|
+
class: "mwnf-facet__select mwnf-search-form__field"
|
|
1369
|
+
}, [(M(!0), S(v, null, F(o.value.fields ?? [], (e) => (M(), S("option", {
|
|
1370
|
+
key: e.key,
|
|
1371
|
+
value: e.key
|
|
1372
|
+
}, R(z(n)(e.label)), 9, Dn))), 128))], 8, En), [[H, e.field]]),
|
|
1373
|
+
G(C("input", {
|
|
1374
|
+
"onUpdate:modelValue": (t) => e.keyword = t,
|
|
1375
|
+
type: "text",
|
|
1376
|
+
class: "mwnf-search-form__keyword",
|
|
1377
|
+
placeholder: z(n)("catalogue.search.keywordPlaceholder")
|
|
1378
|
+
}, null, 8, On), [[U, e.keyword]])
|
|
1379
|
+
]))), 128)),
|
|
1380
|
+
h.value ? (M(), S("div", kn, [E(i, {
|
|
1381
|
+
modelValue: g.value,
|
|
1382
|
+
"onUpdate:modelValue": t[0] ||= (e) => g.value = e,
|
|
1383
|
+
label: z(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: z(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 ? (M(), S("label", An, [C("span", jn, R(z(n)("catalogue.search.language")), 1), G(C("select", {
|
|
1402
|
+
"onUpdate:modelValue": t[2] ||= (e) => O(B) ? B.value = e : null,
|
|
1403
|
+
class: "mwnf-facet__select mwnf-search-form__language"
|
|
1404
|
+
}, [C("option", Mn, R(z(n)("catalogue.search.anyLanguage")), 1), (M(!0), S(v, null, F(L.value, (e) => (M(), S("option", {
|
|
1405
|
+
key: e,
|
|
1406
|
+
value: e
|
|
1407
|
+
}, R(e.toUpperCase()), 9, Nn))), 128))], 512), [[H, z(B)]])])) : x("", !0)
|
|
1408
|
+
], 64)) : s.value === "facets" ? (M(), S(v, { key: 1 }, [(M(!0), S(v, null, F(o.value.facets ?? [], (e) => (M(), b(i, {
|
|
1409
|
+
key: e.key,
|
|
1410
|
+
label: e.label ? z(n)(e.label) : "",
|
|
1411
|
+
options: K.value[e.key] ?? [],
|
|
1412
|
+
"model-value": X[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 ? (M(), S("div", Pn, [E(i, {
|
|
1420
|
+
"model-value": g.value,
|
|
1421
|
+
label: z(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: z(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" ? (M(!0), S(v, { key: 2 }, F(o.value.facets ?? [], (e) => (M(), S("div", {
|
|
1442
|
+
key: e.key,
|
|
1443
|
+
class: "mwnf-search-form__radio-row"
|
|
1444
|
+
}, [C("label", Fn, [G(C("input", {
|
|
1445
|
+
"onUpdate:modelValue": t[5] ||= (e) => se.value = e,
|
|
1446
|
+
type: "radio",
|
|
1447
|
+
name: "mwnf-search-form-filter",
|
|
1448
|
+
value: e.key
|
|
1449
|
+
}, null, 8, In), [[ee, se.value]]), T(" " + R(e.label ? z(n)(e.label) : ""), 1)]), e.type === "year" ? G((M(), S("input", {
|
|
1450
|
+
key: 1,
|
|
1451
|
+
"onUpdate:modelValue": (t) => X[e.key] = t,
|
|
1452
|
+
type: "number",
|
|
1453
|
+
class: "mwnf-search-form__year",
|
|
1454
|
+
disabled: se.value !== e.key
|
|
1455
|
+
}, null, 8, Ln)), [[U, X[e.key]]]) : (M(), b(i, {
|
|
1456
|
+
key: 0,
|
|
1457
|
+
modelValue: X[e.key],
|
|
1458
|
+
"onUpdate:modelValue": (t) => X[e.key] = t,
|
|
1459
|
+
options: K.value[e.key] ?? [],
|
|
1460
|
+
disabled: se.value !== e.key
|
|
1461
|
+
}, null, 8, [
|
|
1462
|
+
"modelValue",
|
|
1463
|
+
"onUpdate:modelValue",
|
|
1464
|
+
"options",
|
|
1465
|
+
"disabled"
|
|
1466
|
+
]))]))), 128)) : x("", !0),
|
|
1467
|
+
(M(!0), S(v, null, F(o.value.extras ?? [], (e) => (M(), S("label", {
|
|
1468
|
+
key: e.key,
|
|
1469
|
+
class: "mwnf-facet mwnf-facet--checkbox"
|
|
1470
|
+
}, [G(C("input", {
|
|
1471
|
+
"onUpdate:modelValue": (t) => Z[e.key] = t,
|
|
1472
|
+
type: "checkbox",
|
|
1473
|
+
class: "mwnf-facet__checkbox"
|
|
1474
|
+
}, null, 8, Rn), [[V, Z[e.key]]]), C("span", zn, R(z(n)(e.label)), 1)]))), 128)),
|
|
1475
|
+
I(e.$slots, "extras", j(D(he.value)))
|
|
1476
|
+
]),
|
|
1477
|
+
_: 3
|
|
1478
|
+
}, 8, [
|
|
1479
|
+
"mode",
|
|
1480
|
+
"apply-label",
|
|
1481
|
+
"reset-label"
|
|
1482
|
+
]),
|
|
1483
|
+
o.value.howTo ? (M(), S("p", Bn, [E(_, { to: { name: o.value.howTo } }, {
|
|
1484
|
+
default: W(() => [T(R(z(n)("catalogue.search.howTo")), 1)]),
|
|
1485
|
+
_: 1
|
|
1486
|
+
}, 8, ["to"])])) : x("", !0),
|
|
1487
|
+
I(e.$slots, "actions", j(D(he.value)))
|
|
1488
|
+
], 2));
|
|
1489
|
+
}
|
|
1490
|
+
}, Hn = { class: "mwnf-timeline" }, Un = {
|
|
1491
|
+
key: 0,
|
|
1492
|
+
class: "mwnf-timeline__title"
|
|
1493
|
+
}, Wn = {
|
|
1494
|
+
key: 3,
|
|
1495
|
+
class: "mwnf-facet"
|
|
1496
|
+
}, Gn = { class: "mwnf-facet__label" }, Kn = [
|
|
1497
|
+
"value",
|
|
1498
|
+
"placeholder",
|
|
1499
|
+
"onInput"
|
|
1500
|
+
], qn = {
|
|
1501
|
+
key: 1,
|
|
1502
|
+
class: "mwnf-timeline__error"
|
|
1503
|
+
}, Jn = {
|
|
1504
|
+
__name: "TimelineResultsView",
|
|
1505
|
+
props: { spec: {
|
|
1506
|
+
type: Object,
|
|
1507
|
+
required: !0
|
|
1508
|
+
} },
|
|
1509
|
+
setup(e) {
|
|
1510
|
+
let t = e, { t: n } = xe(), a = Ne(), o = y(() => t.spec), s = y(() => !!o.value.entrance), c = Ae({
|
|
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: ee.value[0],
|
|
1522
|
+
max: ee.value[1]
|
|
1523
|
+
}
|
|
1524
|
+
})), m = N(Object.fromEntries(u.value.map((e) => [e, ""]))), w = P(""), O = s.value ? null : Se({ keys: u.value }), k = s.value ? m : O.filters;
|
|
1525
|
+
function A(e) {
|
|
1526
|
+
if (d("collection") && e !== "" && e != null) return e === "pc" ? null : e;
|
|
1527
|
+
}
|
|
1528
|
+
function L() {
|
|
1529
|
+
for (let e of u.value) m[e] = "";
|
|
1530
|
+
w.value = "";
|
|
1531
|
+
}
|
|
1532
|
+
function B() {
|
|
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 V = y(() => {
|
|
1551
|
+
if (s.value) return [];
|
|
1552
|
+
let e = k;
|
|
1553
|
+
return c.findEvents({
|
|
1554
|
+
country: e.country || void 0,
|
|
1555
|
+
collection: A(e.collection),
|
|
1556
|
+
begin: e.begin,
|
|
1557
|
+
end: e.end
|
|
1558
|
+
});
|
|
1559
|
+
}), ee = 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
|
+
}), H = we(V, {
|
|
1566
|
+
page: () => O ? O.page.value : 1,
|
|
1567
|
+
size: () => o.value.pageSize ?? 15
|
|
1568
|
+
});
|
|
1569
|
+
function U(e) {
|
|
1570
|
+
let t = o.value.countryLabel && e.country_id ? o.value.countryLabel(e.country_id) : "";
|
|
1571
|
+
return {
|
|
1572
|
+
id: e.id,
|
|
1573
|
+
date: oe(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 te = y(() => H.value.rows.map((e) => (o.value.event ?? U)(e, p.value))), G = y(() => (c.countries.value ?? []).map((e) => ({
|
|
1579
|
+
value: e.value,
|
|
1580
|
+
label: e.value === "all" ? n("timeline.form.allCountries") : e.label
|
|
1581
|
+
}))), ne = y(() => o.value.collections?.(p.value) ?? []), K = 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
|
+
}), re = y(() => ({
|
|
1586
|
+
filters: k,
|
|
1587
|
+
active: u.value.some((e) => k[e]),
|
|
1588
|
+
apply: s.value ? B : (e) => O.apply(e),
|
|
1589
|
+
reset: s.value ? L : O.reset,
|
|
1590
|
+
goToPage: s.value ? () => {} : O.goToPage,
|
|
1591
|
+
events: V.value,
|
|
1592
|
+
pageInfo: H.value,
|
|
1593
|
+
countries: G.value,
|
|
1594
|
+
collections: ne.value,
|
|
1595
|
+
t: n,
|
|
1596
|
+
tr: o.value.tr
|
|
1597
|
+
})), q = y(() => {
|
|
1598
|
+
let e = o.value.gallery;
|
|
1599
|
+
return !e || s.value ? null : !e.items || e.items(re.value);
|
|
1600
|
+
}), ie = y(() => {
|
|
1601
|
+
let e = q.value;
|
|
1602
|
+
return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
|
|
1603
|
+
}), J = y(() => {
|
|
1604
|
+
let e = q.value;
|
|
1605
|
+
return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
|
|
1606
|
+
}), ae = y(() => {
|
|
1607
|
+
if (!ie.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: J.value,
|
|
1616
|
+
label: n(o.value.gallery.label ?? "timeline.nav.seeGallery")
|
|
1617
|
+
};
|
|
1618
|
+
}), Y = y(() => ({
|
|
1619
|
+
...re.value,
|
|
1620
|
+
gallery: ae.value
|
|
1621
|
+
})), se = y(() => o.value.summary ? o.value.summary(Y.value) : [{
|
|
1622
|
+
label: n(o.value.summaryLabel ?? "timeline.results.eventsFound"),
|
|
1623
|
+
count: H.value.total
|
|
1624
|
+
}]), X = y(() => n(o.value.empty ?? "timeline.results.noResults")), Z = y(() => ({
|
|
1625
|
+
window: 5,
|
|
1626
|
+
jump: !1,
|
|
1627
|
+
ends: !0,
|
|
1628
|
+
...o.value.pagination ?? {}
|
|
1629
|
+
}));
|
|
1630
|
+
function Q(e, t) {
|
|
1631
|
+
return e.label ? n(e.label) : t ? n(t) : "";
|
|
1632
|
+
}
|
|
1633
|
+
return (e, t) => (M(), S("section", Hn, [
|
|
1634
|
+
I(e.$slots, "before", j(D(Y.value))),
|
|
1635
|
+
o.value.title ? (M(), S("h1", Un, R(z(n)(o.value.title)), 1)) : x("", !0),
|
|
1636
|
+
E(r, {
|
|
1637
|
+
class: "mwnf-timeline__filters",
|
|
1638
|
+
title: o.value.filterTitle ? z(n)(o.value.filterTitle) : "",
|
|
1639
|
+
"apply-label": s.value ? z(n)(o.value.submitLabel ?? "core.action.search") : o.value.applyLabel ? z(n)(o.value.applyLabel) : "",
|
|
1640
|
+
"reset-label": o.value.resetLabel ? z(n)(o.value.resetLabel) : "",
|
|
1641
|
+
onApply: t[2] ||= (e) => s.value ? B() : z(O).apply(),
|
|
1642
|
+
onReset: t[3] ||= (e) => s.value ? L() : z(O).reset()
|
|
1643
|
+
}, {
|
|
1644
|
+
default: W(() => [(M(!0), S(v, null, F(l.value, (e) => (M(), S(v, { key: e.key }, [e.key === "country" ? (M(), b(i, {
|
|
1645
|
+
key: 0,
|
|
1646
|
+
"model-value": z(k).country,
|
|
1647
|
+
label: Q(e, "catalogue.facet.country"),
|
|
1648
|
+
options: G.value,
|
|
1649
|
+
placeholder: e.placeholder ? z(n)(e.placeholder) : z(n)("timeline.form.selectCountry"),
|
|
1650
|
+
"any-label": e.anyLabel ? z(n)(e.anyLabel) : "",
|
|
1651
|
+
"hide-empty": !!e.hideEmpty,
|
|
1652
|
+
"onUpdate:modelValue": t[0] ||= (e) => z(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" ? (M(), b(i, {
|
|
1661
|
+
key: 1,
|
|
1662
|
+
"model-value": z(k).collection,
|
|
1663
|
+
label: Q(e),
|
|
1664
|
+
options: ne.value,
|
|
1665
|
+
placeholder: e.placeholder ? z(n)(e.placeholder) : "",
|
|
1666
|
+
"any-label": e.anyLabel ? z(n)(e.anyLabel) : "",
|
|
1667
|
+
"hide-empty": !!e.hideEmpty,
|
|
1668
|
+
"onUpdate:modelValue": t[1] ||= (e) => z(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") && K.value[e.key] ? (M(), b(i, {
|
|
1677
|
+
key: 2,
|
|
1678
|
+
"model-value": z(k)[e.key],
|
|
1679
|
+
label: Q(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate"),
|
|
1680
|
+
options: K.value[e.key],
|
|
1681
|
+
placeholder: e.placeholder ? z(n)(e.placeholder) : z(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
|
|
1682
|
+
"any-label": e.anyLabel ? z(n)(e.anyLabel) : "",
|
|
1683
|
+
"hide-empty": !!e.hideEmpty,
|
|
1684
|
+
"onUpdate:modelValue": (t) => z(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
|
+
])) : (M(), S("label", Wn, [C("span", Gn, R(Q(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate")), 1), C("input", {
|
|
1694
|
+
type: "number",
|
|
1695
|
+
class: "mwnf-facet__select",
|
|
1696
|
+
value: z(k)[e.key],
|
|
1697
|
+
placeholder: e.placeholder ? z(n)(e.placeholder) : z(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
|
|
1698
|
+
onInput: (t) => z(k)[e.key] = t.target.value
|
|
1699
|
+
}, null, 40, Kn)]))], 64))), 128))]),
|
|
1700
|
+
_: 1
|
|
1701
|
+
}, 8, [
|
|
1702
|
+
"title",
|
|
1703
|
+
"apply-label",
|
|
1704
|
+
"reset-label"
|
|
1705
|
+
]),
|
|
1706
|
+
s.value && w.value ? (M(), S("p", qn, R(w.value), 1)) : x("", !0),
|
|
1707
|
+
s.value ? x("", !0) : (M(), S(v, { key: 2 }, [
|
|
1708
|
+
I(e.$slots, "summary", j(D(Y.value)), () => [E(g, { parts: se.value }, null, 8, ["parts"])]),
|
|
1709
|
+
ae.value ? (M(), b(_, {
|
|
1710
|
+
key: 0,
|
|
1711
|
+
class: "mwnf-timeline__gallery",
|
|
1712
|
+
to: ae.value.to
|
|
1713
|
+
}, {
|
|
1714
|
+
default: W(() => [I(e.$slots, "cross-link", j(D(Y.value)), () => [T(R(ae.value.label), 1), ae.value.count == null ? x("", !0) : (M(), S(v, { key: 0 }, [T(" (" + R(ae.value.count) + ")", 1)], 64))])]),
|
|
1715
|
+
_: 3
|
|
1716
|
+
}, 8, ["to"])) : x("", !0),
|
|
1717
|
+
I(e.$slots, "event", j(D(Y.value)), () => [E(h, { events: te.value }, {
|
|
1718
|
+
empty: W(() => [I(e.$slots, "empty", j(D(Y.value)), () => [T(R(X.value), 1)])]),
|
|
1719
|
+
_: 3
|
|
1720
|
+
}, 8, ["events"])]),
|
|
1721
|
+
E(f, {
|
|
1722
|
+
"page-info": z(H),
|
|
1723
|
+
window: Z.value.window,
|
|
1724
|
+
jump: Z.value.jump,
|
|
1725
|
+
ends: Z.value.ends,
|
|
1726
|
+
onNavigate: z(O).goToPage
|
|
1727
|
+
}, null, 8, [
|
|
1728
|
+
"page-info",
|
|
1729
|
+
"window",
|
|
1730
|
+
"jump",
|
|
1731
|
+
"ends",
|
|
1732
|
+
"onNavigate"
|
|
1733
|
+
])
|
|
1734
|
+
], 64)),
|
|
1735
|
+
I(e.$slots, "after", j(D(Y.value)))
|
|
1736
|
+
]));
|
|
1737
|
+
}
|
|
1738
|
+
};
|
|
1739
|
+
//#endregion
|
|
1740
|
+
export { Qe as CatalogueResultsView, Pt as EssayView, Le as HomeView, Wt as LinkListView, gn as PartnerListView, at as RecordView, Vn as SearchFormView, Sn as TextPageView, Jn as TimelineResultsView };
|