@museumwnf/viewer-layout 3.10.0 → 3.11.1
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/README.md +63 -0
- package/dist/{FeaturedRecord-DJfyvfqt.js → FeaturedRecord-DGZ1dpyc.js} +1 -1
- package/dist/GlossaryPopover-B7E6BsjS.js +55 -0
- package/dist/{ItemDetailView-CzIquvf7.js → ItemDetailView-BAoP3CHx.js} +5 -5
- package/dist/{GlossaryPopover-DcptyNWI.js → MediaGallery-CHhf9xUZ.js} +11 -60
- package/dist/{OnDisplayIn-2ctLMfvw.js → OnDisplayIn-BCjxYjO7.js} +38 -38
- package/dist/{chrome-Co3f_Shw.js → PageShell-BT9SnXav.js} +123 -153
- package/dist/{RecordView-BvKoAB2j.js → RecordView-C23v0iYh.js} +13 -12
- package/dist/{SiteShell-DmKiH3jM.js → SiteShell-DPdTxtJ5.js} +2 -1
- package/dist/{Theme-pxrmYfo-.js → Theme-Dn5MBpQG.js} +26 -26
- package/dist/{TimelineEventList-gsoc-SBx.js → TimelineEventList-C5cbF_an.js} +40 -40
- package/dist/TimelineResultsView-xA0Wu7zv.js +1387 -0
- package/dist/chrome-DNsZQXrL.js +34 -0
- package/dist/components.js +1 -1
- package/dist/{content-Cu_44di8.js → content-DCtsRrwx.js} +13 -13
- package/dist/content.js +7 -6
- package/dist/{data-d30zAska.js → data-BINc9QjV.js} +1 -1
- package/dist/{data-Dz9REf19.js → data-CXRsGwLQ.js} +1 -1
- package/dist/dxa.js +14 -13
- package/dist/index.js +9 -7
- package/dist/minisite.js +934 -0
- package/dist/standalone.js +55 -55
- package/dist/{themeSpecs-CXVCN8UV.js → themeSpecs-DP9xWiVJ.js} +1 -1
- package/dist/viewer-layout.css +1 -1
- package/dist/views.js +4 -4
- package/package.json +2 -1
- package/dist/TimelineResultsView-C2-TnM71.js +0 -1386
|
@@ -0,0 +1,1387 @@
|
|
|
1
|
+
import { c as e, l as t, r as n, t as r, u as i } from "./MediaGallery-CHhf9xUZ.js";
|
|
2
|
+
import { a, i as o, n as s, o as c, s as l, t as u } from "./TimelineEventList-C5cbF_an.js";
|
|
3
|
+
import { t as d } from "./GlossaryPopover-B7E6BsjS.js";
|
|
4
|
+
import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, guardReactiveProps as x, isRef as S, mergeProps as C, normalizeClass as ee, normalizeProps as w, openBlock as T, reactive as E, ref as D, renderList as O, renderSlot as k, resolveDynamicComponent as te, toDisplayString as A, unref as j, useSlots as M, vModelCheckbox as N, vModelRadio as P, vModelSelect as F, vModelText as ne, watch as I, withCtx as L, withDirectives as R } from "vue";
|
|
5
|
+
import { I18nText as z, NotFoundView as B, byId as V, centuryPresets as H, dateRange as re, entityRef as ie, eventDateLabel as U, glossaryEntries as ae, glossaryTermsForText as W, groupByCountry as G, md as K, mdInline as oe, partnerHierarchy as q, partnerView as J, renderBlock as se, renderInline as Y, renderPlain as X, sortChronological as Z, useCollectionTree as ce, useDataPackage as Q, useFacets as le, useGlossaryPopup as ue, useI18n as de, useListQuery as fe, useLocale as pe, usePagination as me, useRecordLanguage as he, useSearchLanguage as ge, useTimelineEvents as _e, yearBuckets as ve } from "@museumwnf/viewer-core";
|
|
6
|
+
import { useRouter as ye } from "vue-router";
|
|
7
|
+
//#region src/views/CatalogueResultsView.vue
|
|
8
|
+
var be = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "mwnf-catalogue__title"
|
|
11
|
+
}, xe = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "mwnf-facet"
|
|
14
|
+
}, Se = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "mwnf-facet__label"
|
|
17
|
+
}, Ce = [
|
|
18
|
+
"value",
|
|
19
|
+
"placeholder",
|
|
20
|
+
"onInput"
|
|
21
|
+
], we = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "mwnf-facet"
|
|
24
|
+
}, Te = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "mwnf-facet__label"
|
|
27
|
+
}, Ee = [
|
|
28
|
+
"value",
|
|
29
|
+
"placeholder",
|
|
30
|
+
"onInput"
|
|
31
|
+
], De = {
|
|
32
|
+
key: 2,
|
|
33
|
+
class: "mwnf-facet mwnf-facet--checkbox"
|
|
34
|
+
}, Oe = ["checked", "onChange"], ke = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "mwnf-facet__label"
|
|
37
|
+
}, Ae = { class: "mwnf-catalogue__body" }, je = { class: "mwnf-catalogue__results" }, Me = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "mwnf-catalogue__aside"
|
|
40
|
+
}, Ne = {
|
|
41
|
+
__name: "CatalogueResultsView",
|
|
42
|
+
props: {
|
|
43
|
+
spec: {
|
|
44
|
+
type: Object,
|
|
45
|
+
required: !0
|
|
46
|
+
},
|
|
47
|
+
entity: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: ""
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
setup(n) {
|
|
53
|
+
let r = n, { t: i, locale: s } = de(), u = Q(), d = r.spec.entity ?? r.entity, S = p(() => r.spec), C = ie(d);
|
|
54
|
+
d && u.loadTranslations(d, "en");
|
|
55
|
+
let E = p(() => S.value.keys ?? [...Object.keys(S.value.facets ?? {}), ...D()]);
|
|
56
|
+
function D() {
|
|
57
|
+
let e = S.value.dates;
|
|
58
|
+
return e ? [e.begin ?? "begin", e.end ?? "end"] : [];
|
|
59
|
+
}
|
|
60
|
+
let { filters: M, page: N, active: P, apply: F, reset: ne, goToPage: I } = fe({ keys: E.value }), R = {
|
|
61
|
+
t: i,
|
|
62
|
+
locale: s,
|
|
63
|
+
tr: (e, t) => u.tr(e, t, s.value, "en"),
|
|
64
|
+
renderInline: Y,
|
|
65
|
+
renderPlain: X
|
|
66
|
+
};
|
|
67
|
+
function z(e, t) {
|
|
68
|
+
if (typeof t.values == "function") return [t.values(e)].flat();
|
|
69
|
+
let n = e?.[t.field];
|
|
70
|
+
return Array.isArray(n) ? n : [n];
|
|
71
|
+
}
|
|
72
|
+
let B = p(() => {
|
|
73
|
+
let e = S.value, t = C.value ?? [];
|
|
74
|
+
e.scope && (t = t.filter((t) => e.scope(t, M, R)));
|
|
75
|
+
for (let [n, r] of Object.entries(e.facets ?? {})) {
|
|
76
|
+
let e = M[n];
|
|
77
|
+
e && (t = t.filter((t) => z(t, r).map(String).includes(String(e))));
|
|
78
|
+
}
|
|
79
|
+
e.match && (t = t.filter((t) => e.match(t, M, R))), e.narrow && (t = e.narrow(t, M, R)), e.dates && (t = re(t, {
|
|
80
|
+
begin: M[e.dates.begin ?? "begin"],
|
|
81
|
+
end: M[e.dates.end ?? "end"],
|
|
82
|
+
mode: e.dates.mode ?? "overlap",
|
|
83
|
+
fields: e.dates.fields
|
|
84
|
+
}));
|
|
85
|
+
let n = e.sort ?? "chronological";
|
|
86
|
+
return typeof n == "function" ? n(t) : n === "chronological" ? Z(t) : n && typeof n == "object" ? Z(t, n) : t;
|
|
87
|
+
}), V = p(() => S.value.facetScope === "matching" ? B.value : C.value ?? []), H = le(V, () => S.value.facets ?? {}), U = me(B, {
|
|
88
|
+
page: N,
|
|
89
|
+
size: () => S.value.pageSize ?? 20
|
|
90
|
+
}), ae = p(() => S.value.recordRoute ?? (r.entity ? `${r.entity}-detail` : "item"));
|
|
91
|
+
function W(e) {
|
|
92
|
+
let t = R.tr(d, e.id).name ?? e.internal_name ?? e.id;
|
|
93
|
+
return {
|
|
94
|
+
id: e.id,
|
|
95
|
+
image: e.images?.[0]?.url ?? "",
|
|
96
|
+
imageAlt: X(String(t)),
|
|
97
|
+
name: Y(String(t)),
|
|
98
|
+
meta: [],
|
|
99
|
+
badge: e.type ?? "",
|
|
100
|
+
to: {
|
|
101
|
+
name: ae.value,
|
|
102
|
+
params: { id: e.id }
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
let G = p(() => U.value.rows.map((e) => (S.value.record ?? W)(e, R))), K = p(() => ({
|
|
107
|
+
filters: M,
|
|
108
|
+
active: P.value,
|
|
109
|
+
apply: F,
|
|
110
|
+
reset: ne,
|
|
111
|
+
goToPage: I,
|
|
112
|
+
matching: B.value,
|
|
113
|
+
pageInfo: U.value,
|
|
114
|
+
options: H.value
|
|
115
|
+
})), oe = p(() => {
|
|
116
|
+
let e = S.value;
|
|
117
|
+
return e.summary ? e.summary({
|
|
118
|
+
...K.value,
|
|
119
|
+
t: i,
|
|
120
|
+
total: (C.value ?? []).length
|
|
121
|
+
}) : [{
|
|
122
|
+
label: i(e.summaryLabel ?? "catalogue.results.itemsFound"),
|
|
123
|
+
count: U.value.total
|
|
124
|
+
}];
|
|
125
|
+
}), q = p(() => S.value.filterMode ?? "apply"), J = p(() => S.value.controls ?? []), se = p(() => J.value.length > 0 || !!S.value.panel);
|
|
126
|
+
function ce(e, t) {
|
|
127
|
+
q.value === "immediate" ? F({ [e]: t }) : M[e] = t;
|
|
128
|
+
}
|
|
129
|
+
let ue = p(() => i(S.value.empty ?? "catalogue.results.noResultsFilter")), pe = p(() => S.value.variant === "grid"), he = p(() => ({
|
|
130
|
+
window: 5,
|
|
131
|
+
jump: !1,
|
|
132
|
+
ends: !0,
|
|
133
|
+
...S.value.pagination ?? {}
|
|
134
|
+
}));
|
|
135
|
+
return (n, r) => (T(), g("section", { class: ee(["mwnf-catalogue", { "mwnf-catalogue--boxed": S.value.boxed }]) }, [
|
|
136
|
+
k(n.$slots, "before", w(x(K.value))),
|
|
137
|
+
S.value.title ? (T(), g("h1", be, A(j(i)(S.value.title)), 1)) : h("", !0),
|
|
138
|
+
se.value || n.$slots.filters ? (T(), m(a, {
|
|
139
|
+
key: 1,
|
|
140
|
+
class: "mwnf-catalogue__filters",
|
|
141
|
+
mode: q.value,
|
|
142
|
+
title: S.value.filterTitle ? j(i)(S.value.filterTitle) : "",
|
|
143
|
+
"reset-label": S.value.resetLabel ? j(i)(S.value.resetLabel) : "",
|
|
144
|
+
onApply: r[2] ||= (e) => j(F)(),
|
|
145
|
+
onReset: r[3] ||= (e) => j(ne)()
|
|
146
|
+
}, {
|
|
147
|
+
default: L(() => [(T(!0), g(f, null, O(J.value, (e) => (T(), g(f, { key: e.key }, [e.type === "year" ? (T(), g("label", xe, [e.label ? (T(), g("span", Se, A(j(i)(e.label)), 1)) : h("", !0), _("input", {
|
|
148
|
+
type: "number",
|
|
149
|
+
class: "mwnf-facet__select",
|
|
150
|
+
value: j(M)[e.key],
|
|
151
|
+
placeholder: e.placeholder ? j(i)(e.placeholder) : "",
|
|
152
|
+
onInput: (t) => j(M)[e.key] = t.target.value,
|
|
153
|
+
onChange: r[0] ||= (e) => q.value === "immediate" ? j(F)() : null
|
|
154
|
+
}, null, 40, Ce)])) : e.type === "query" ? (T(), g("label", we, [e.label ? (T(), g("span", Te, A(j(i)(e.label)), 1)) : h("", !0), _("input", {
|
|
155
|
+
type: "text",
|
|
156
|
+
class: "mwnf-facet__select",
|
|
157
|
+
value: j(M)[e.key],
|
|
158
|
+
placeholder: e.placeholder ? j(i)(e.placeholder) : "",
|
|
159
|
+
onInput: (t) => j(M)[e.key] = t.target.value,
|
|
160
|
+
onChange: r[1] ||= (e) => q.value === "immediate" ? j(F)() : null
|
|
161
|
+
}, null, 40, Ee)])) : e.type === "checkbox" ? (T(), g("label", De, [_("input", {
|
|
162
|
+
type: "checkbox",
|
|
163
|
+
class: "mwnf-facet__checkbox",
|
|
164
|
+
checked: j(M)[e.key] === "1",
|
|
165
|
+
onChange: (t) => ce(e.key, t.target.checked ? "1" : "")
|
|
166
|
+
}, null, 40, Oe), e.label ? (T(), g("span", ke, A(j(i)(e.label)), 1)) : h("", !0)])) : (T(), m(c, {
|
|
167
|
+
key: 3,
|
|
168
|
+
"model-value": j(M)[e.key],
|
|
169
|
+
label: e.label ? j(i)(e.label) : "",
|
|
170
|
+
options: j(H)[e.key] ?? [],
|
|
171
|
+
placeholder: e.placeholder ? j(i)(e.placeholder) : "",
|
|
172
|
+
"any-label": e.anyLabel ? j(i)(e.anyLabel) : "",
|
|
173
|
+
"hide-empty": !!e.hideEmpty,
|
|
174
|
+
"onUpdate:modelValue": (t) => ce(e.key, t)
|
|
175
|
+
}, null, 8, [
|
|
176
|
+
"model-value",
|
|
177
|
+
"label",
|
|
178
|
+
"options",
|
|
179
|
+
"placeholder",
|
|
180
|
+
"any-label",
|
|
181
|
+
"hide-empty",
|
|
182
|
+
"onUpdate:modelValue"
|
|
183
|
+
]))], 64))), 128)), k(n.$slots, "filters", w(x(K.value)))]),
|
|
184
|
+
_: 3
|
|
185
|
+
}, 8, [
|
|
186
|
+
"mode",
|
|
187
|
+
"title",
|
|
188
|
+
"reset-label"
|
|
189
|
+
])) : h("", !0),
|
|
190
|
+
b(o, { parts: oe.value }, v({ _: 2 }, [n.$slots.actions ? {
|
|
191
|
+
name: "actions",
|
|
192
|
+
fn: L(() => [k(n.$slots, "actions", w(x(K.value)))]),
|
|
193
|
+
key: "0"
|
|
194
|
+
} : void 0]), 1032, ["parts"]),
|
|
195
|
+
_("div", Ae, [_("div", je, [(T(), m(te(pe.value ? e : t), {
|
|
196
|
+
records: G.value,
|
|
197
|
+
"action-label": S.value.actionLabel ? j(i)(S.value.actionLabel) : ""
|
|
198
|
+
}, {
|
|
199
|
+
empty: L(() => [k(n.$slots, "empty", w(x(K.value)), () => [y(A(ue.value), 1)])]),
|
|
200
|
+
_: 3
|
|
201
|
+
}, 8, ["records", "action-label"])), b(l, {
|
|
202
|
+
"page-info": j(U),
|
|
203
|
+
window: he.value.window,
|
|
204
|
+
jump: he.value.jump,
|
|
205
|
+
ends: he.value.ends,
|
|
206
|
+
onNavigate: j(I)
|
|
207
|
+
}, null, 8, [
|
|
208
|
+
"page-info",
|
|
209
|
+
"window",
|
|
210
|
+
"jump",
|
|
211
|
+
"ends",
|
|
212
|
+
"onNavigate"
|
|
213
|
+
])]), n.$slots.aside ? (T(), g("aside", Me, [k(n.$slots, "aside", w(x(K.value)))])) : h("", !0)]),
|
|
214
|
+
k(n.$slots, "after", w(x(K.value)))
|
|
215
|
+
], 2));
|
|
216
|
+
}
|
|
217
|
+
}, Pe = ["dir"], Fe = {
|
|
218
|
+
key: 0,
|
|
219
|
+
class: "mwnf-essay__breadcrumb"
|
|
220
|
+
}, Ie = { class: "mwnf-essay__breadcrumb-label" }, Le = {
|
|
221
|
+
key: 1,
|
|
222
|
+
class: "mwnf-essay__breadcrumb-link"
|
|
223
|
+
}, Re = ["aria-label"], ze = { class: "mwnf-essay__title" }, Be = {
|
|
224
|
+
key: 0,
|
|
225
|
+
class: "mwnf-essay__number"
|
|
226
|
+
}, Ve = ["innerHTML"], He = { class: "mwnf-essay__body" }, Ue = { class: "mwnf-essay__main" }, We = {
|
|
227
|
+
key: 0,
|
|
228
|
+
class: "mwnf-essay__status"
|
|
229
|
+
}, Ge = ["innerHTML"], Ke = ["innerHTML"], qe = {
|
|
230
|
+
key: 4,
|
|
231
|
+
class: "mwnf-essay__nav"
|
|
232
|
+
}, Je = {
|
|
233
|
+
key: 1,
|
|
234
|
+
class: "mwnf-essay__nav-spacer"
|
|
235
|
+
}, Ye = {
|
|
236
|
+
key: 0,
|
|
237
|
+
class: "mwnf-essay__side"
|
|
238
|
+
}, Xe = {
|
|
239
|
+
key: 0,
|
|
240
|
+
class: "mwnf-essay__panel"
|
|
241
|
+
}, Ze = {
|
|
242
|
+
key: 0,
|
|
243
|
+
class: "mwnf-essay__variants"
|
|
244
|
+
}, Qe = ["aria-pressed", "onClick"], $e = ["src", "alt"], et = ["innerHTML"], tt = {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "mwnf-essay__panel-label"
|
|
247
|
+
}, nt = ["innerHTML"], rt = ["innerHTML"], it = {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: "mwnf-essay__thumbs"
|
|
250
|
+
}, at = ["onClick"], ot = ["src"], st = {
|
|
251
|
+
key: 2,
|
|
252
|
+
class: "mwnf-essay__status"
|
|
253
|
+
}, ct = {
|
|
254
|
+
__name: "EssayView",
|
|
255
|
+
props: {
|
|
256
|
+
spec: {
|
|
257
|
+
type: Object,
|
|
258
|
+
required: !0
|
|
259
|
+
},
|
|
260
|
+
id: {
|
|
261
|
+
type: String,
|
|
262
|
+
required: !0
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
setup(t) {
|
|
266
|
+
let a = t, { t: o } = de(), s = Q(), c = M();
|
|
267
|
+
function l(e) {
|
|
268
|
+
return !!e && typeof e.walk == "function" && typeof e.children == "function";
|
|
269
|
+
}
|
|
270
|
+
function u(e) {
|
|
271
|
+
return typeof e == "string" ? e : "themes";
|
|
272
|
+
}
|
|
273
|
+
let v = a.spec.entity ?? "items", S = a.spec.tree, C = S?.entity ?? (S?.themes ? u(S.themes) : a.spec.entity ?? "collections"), E = l(S) ? S : S?.themes ? ce({
|
|
274
|
+
source: "themes",
|
|
275
|
+
entity: C,
|
|
276
|
+
childType: S.childType
|
|
277
|
+
}) : ce({
|
|
278
|
+
purpose: S?.purpose,
|
|
279
|
+
rootId: S?.rootId,
|
|
280
|
+
childType: S?.childType,
|
|
281
|
+
entity: C,
|
|
282
|
+
order: S?.order
|
|
283
|
+
}), te = ie(C), N = p(() => te.value !== null), P = p(() => a.spec), F = p(() => E.byId.value.get(a.id) ?? null), ne = p(() => E.parents(a.id).at(-1) ?? null), R = p(() => {
|
|
284
|
+
if (ne.value) return E.children(ne.value.id);
|
|
285
|
+
let e = E.root.value;
|
|
286
|
+
return e ? E.children(e.id) : E.walk().filter((e) => E.parents(e.id).length === 0);
|
|
287
|
+
}), z = p(() => R.value.findIndex((e) => e.id === a.id)), H = p(() => P.value.navigation || !1), re = p(() => H.value === "siblings" ? z.value > 0 ? R.value[z.value - 1] : null : H.value === "tree" ? E.previous(a.id) : null), U = p(() => H.value === "siblings" ? z.value !== -1 && z.value < R.value.length - 1 ? R.value[z.value + 1] : null : H.value === "tree" ? E.next(a.id) : null), { language: G, dir: K } = he(F, { entity: C }), oe = p(() => F.value ? s.tr(C, F.value.id, G.value, "en") : {}), q = D(!1);
|
|
288
|
+
I(() => [F.value?.id, G.value], async () => {
|
|
289
|
+
if (q.value = !1, !F.value) {
|
|
290
|
+
q.value = !0;
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
let e = G.value === "en" ? ["en"] : [G.value, "en"];
|
|
294
|
+
await Promise.all([C, v].flatMap((t) => e.map((e) => s.loadTranslations(t, e)))), q.value = !0;
|
|
295
|
+
}, { immediate: !0 });
|
|
296
|
+
function J(e) {
|
|
297
|
+
if (!e) return "";
|
|
298
|
+
let t = P.value.placeholder, n = (e) => !!e && !!t && t.test(e), r = s.tr(C, e.id, G.value, "en");
|
|
299
|
+
if (r.title && !n(r.title)) return r.title;
|
|
300
|
+
let i = s.tr(C, e.id, "en").title;
|
|
301
|
+
return i && !n(i) ? i : e.internal_name ?? e.id;
|
|
302
|
+
}
|
|
303
|
+
let Z = p(() => ({
|
|
304
|
+
node: F.value,
|
|
305
|
+
text: oe.value,
|
|
306
|
+
language: G.value,
|
|
307
|
+
tree: E,
|
|
308
|
+
select: dt,
|
|
309
|
+
t: o,
|
|
310
|
+
tr: (e, t) => s.tr(e, t, G.value, "en")
|
|
311
|
+
}));
|
|
312
|
+
function le(e, t) {
|
|
313
|
+
return t.split(".").reduce((e, t) => e?.[t], e);
|
|
314
|
+
}
|
|
315
|
+
function fe(e, t) {
|
|
316
|
+
return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : le(t.text, e) ?? "";
|
|
317
|
+
}
|
|
318
|
+
let pe = p(() => fe(P.value.quote ?? "quote", Z.value)), me = p(() => fe(P.value.body ?? "description", Z.value)), ge = p(() => {
|
|
319
|
+
if (!P.value.glossary || !F.value) return [];
|
|
320
|
+
let e = [pe.value, me.value].filter(Boolean);
|
|
321
|
+
return W(e.join("\n\n"), G.value);
|
|
322
|
+
}), _e = p(() => ae(ge.value)), { active: ve, onClick: ye, close: be } = ue(ge), xe = p(() => ve.value ? se(ve.value.definition, { breaks: !0 }) : ""), Se = p(() => F.value ? P.value.heading ? P.value.heading(Z.value) : Y(String(J(F.value)), { glossary: _e.value }) : ""), Ce = p(() => pe.value ? Y(String(pe.value), { glossary: _e.value }) : ""), we = p(() => me.value ? se(String(me.value), {
|
|
323
|
+
breaks: !0,
|
|
324
|
+
glossary: _e.value
|
|
325
|
+
}) : ""), Te = p(() => F.value ? P.value.about?.(F.value) ?? !1 : !1), Ee = p(() => !!Te.value);
|
|
326
|
+
function De(e) {
|
|
327
|
+
let t = Te.value;
|
|
328
|
+
return t && typeof t == "object" ? !!t[e] : !!P.value.aboutKeeps?.includes(e);
|
|
329
|
+
}
|
|
330
|
+
let Oe = [
|
|
331
|
+
[1e3, "M"],
|
|
332
|
+
[900, "CM"],
|
|
333
|
+
[500, "D"],
|
|
334
|
+
[400, "CD"],
|
|
335
|
+
[100, "C"],
|
|
336
|
+
[90, "XC"],
|
|
337
|
+
[50, "L"],
|
|
338
|
+
[40, "XL"],
|
|
339
|
+
[10, "X"],
|
|
340
|
+
[9, "IX"],
|
|
341
|
+
[5, "V"],
|
|
342
|
+
[4, "IV"],
|
|
343
|
+
[1, "I"]
|
|
344
|
+
];
|
|
345
|
+
function ke(e) {
|
|
346
|
+
let t = e, n = "";
|
|
347
|
+
for (let [e, r] of Oe) for (; t >= e;) n += r, t -= e;
|
|
348
|
+
return n;
|
|
349
|
+
}
|
|
350
|
+
let Ae = p(() => {
|
|
351
|
+
let e = P.value.numbering;
|
|
352
|
+
if (!e || !F.value) return "";
|
|
353
|
+
let t = (R.value.length ? R.value : [F.value]).findIndex((e) => e.id === a.id), n = t >= 0 ? t + 1 : 1;
|
|
354
|
+
return e === "roman" ? ke(n) : String(n);
|
|
355
|
+
});
|
|
356
|
+
function je(e) {
|
|
357
|
+
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) : [] : [];
|
|
358
|
+
}
|
|
359
|
+
let Me = V(v), Ne = p(() => {
|
|
360
|
+
let e = P.value.items?.of ?? je;
|
|
361
|
+
return F.value ? e(F.value, Z.value) : [];
|
|
362
|
+
}), ct = p(() => Ne.value.map((e) => Me.value.get(e)).filter(Boolean)), lt = D(null);
|
|
363
|
+
I(ct, (e) => {
|
|
364
|
+
e.some((e) => e.id === lt.value) || (lt.value = e[0]?.id ?? null);
|
|
365
|
+
}, { immediate: !0 });
|
|
366
|
+
let ut = p(() => ct.value.find((e) => e.id === lt.value) ?? ct.value[0] ?? null);
|
|
367
|
+
function dt(e) {
|
|
368
|
+
lt.value = e;
|
|
369
|
+
}
|
|
370
|
+
function ft(e) {
|
|
371
|
+
let t = P.value.items?.route;
|
|
372
|
+
return !t || !e ? null : typeof t == "function" ? t(e, Z.value) : {
|
|
373
|
+
name: t,
|
|
374
|
+
params: { id: e.id }
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function pt(e) {
|
|
378
|
+
let t = P.value.route;
|
|
379
|
+
return !t || !e ? null : typeof t == "function" ? t(e, Z.value) : {
|
|
380
|
+
name: t,
|
|
381
|
+
params: { id: e.id }
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
function mt(e) {
|
|
385
|
+
if (!e) return null;
|
|
386
|
+
let t = s.tr(v, e.id, G.value, "en").name ?? e.internal_name ?? e.id;
|
|
387
|
+
return {
|
|
388
|
+
name: Y(String(t)),
|
|
389
|
+
image: e.images?.[0]?.url ?? "",
|
|
390
|
+
imageAlt: X(String(t))
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
let ht = p(() => {
|
|
394
|
+
let e = ut.value;
|
|
395
|
+
if (!e) return null;
|
|
396
|
+
let t = mt(e), n = P.value.items?.caption?.(e, F.value, Z.value);
|
|
397
|
+
return {
|
|
398
|
+
...t,
|
|
399
|
+
...n
|
|
400
|
+
};
|
|
401
|
+
}), gt = p(() => !!P.value.panel), _t = p(() => {
|
|
402
|
+
let e = ut.value;
|
|
403
|
+
if (!e) return [];
|
|
404
|
+
let t = ht.value, n = e.images?.[0]?.url ? [{
|
|
405
|
+
id: "__primary",
|
|
406
|
+
image: e.images[0].url,
|
|
407
|
+
alt: t?.imageAlt ?? "",
|
|
408
|
+
caption: {
|
|
409
|
+
title: t?.name ?? "",
|
|
410
|
+
justification: "",
|
|
411
|
+
fields: null
|
|
412
|
+
}
|
|
413
|
+
}] : [], r = P.value.panel?.variants?.(e, Z.value) ?? [];
|
|
414
|
+
return [...n, ...r.map((e, t) => ({
|
|
415
|
+
id: e.id ?? `variant-${t}`,
|
|
416
|
+
...e
|
|
417
|
+
}))];
|
|
418
|
+
}), vt = D(null);
|
|
419
|
+
I(_t, (e) => {
|
|
420
|
+
e.some((e) => e.id === vt.value) || (vt.value = e[0]?.id ?? null);
|
|
421
|
+
}, { immediate: !0 });
|
|
422
|
+
let yt = p(() => _t.value.find((e) => e.id === vt.value) ?? _t.value[0] ?? null);
|
|
423
|
+
function bt(e) {
|
|
424
|
+
vt.value = e;
|
|
425
|
+
}
|
|
426
|
+
let xt = p(() => {
|
|
427
|
+
let e = yt.value;
|
|
428
|
+
return e?.image ? [{
|
|
429
|
+
url: e.image,
|
|
430
|
+
alt: e.alt ?? ""
|
|
431
|
+
}] : [];
|
|
432
|
+
}), St = p(() => {
|
|
433
|
+
let e = ut.value;
|
|
434
|
+
return !e || !P.value.panel?.fields ? [] : P.value.panel.fields(e, F.value, Z.value) ?? [];
|
|
435
|
+
}), Ct = p(() => {
|
|
436
|
+
let e = yt.value?.caption?.fields;
|
|
437
|
+
return e == null ? St.value : e.map((e) => ({
|
|
438
|
+
label: e.label ? o(e.label) : "",
|
|
439
|
+
value: e.value
|
|
440
|
+
}));
|
|
441
|
+
}), wt = p(() => {
|
|
442
|
+
let e = yt.value?.caption?.justification;
|
|
443
|
+
return e ? Y(String(e)) : "";
|
|
444
|
+
}), Tt = p(() => ct.value.map((e) => {
|
|
445
|
+
let t = mt(e), n = P.value.items?.meta?.(e, Z.value) ?? [], r = P.value.items?.badge?.(e, Z.value) ?? "";
|
|
446
|
+
return {
|
|
447
|
+
id: e.id,
|
|
448
|
+
image: t.image,
|
|
449
|
+
imageAlt: t.imageAlt,
|
|
450
|
+
name: t.name,
|
|
451
|
+
meta: n,
|
|
452
|
+
badge: r,
|
|
453
|
+
to: ft(e)
|
|
454
|
+
};
|
|
455
|
+
})), Et = p(() => P.value.breadcrumb && F.value ? E.parents(a.id) : []), Dt = p(() => {
|
|
456
|
+
let e = P.value.tabs;
|
|
457
|
+
return e ? e === "children" ? F.value ? E.children(F.value.id) : [] : R.value : [];
|
|
458
|
+
}), Ot = p(() => P.value.previous ?? "core.pagination.previous"), kt = p(() => P.value.next ?? "core.pagination.next"), At = p(() => P.value.backTo ?? "record.action.backToResults"), jt = p(() => P.value.inThisTheme ?? "core.nav.inThisSection"), Mt = p(() => P.value.seeAll ?? "catalogue.results.seeDatabaseEntry"), $ = p(() => ({
|
|
459
|
+
...Z.value,
|
|
460
|
+
items: ct.value,
|
|
461
|
+
selected: ut.value,
|
|
462
|
+
selectedVariant: yt.value,
|
|
463
|
+
selectVariant: bt,
|
|
464
|
+
breadcrumb: Et.value,
|
|
465
|
+
previous: re.value,
|
|
466
|
+
next: U.value
|
|
467
|
+
})), Nt = p(() => Ee.value && !De("panel") ? !1 : gt.value || ct.value.length > 0 || !!c.aside), Pt = p(() => (!Ee.value || De("navigation")) && !!H.value && !!(re.value || U.value));
|
|
468
|
+
return (a, s) => N.value && !F.value ? (T(), m(j(B), { key: 0 })) : F.value ? (T(), g("article", {
|
|
469
|
+
key: 1,
|
|
470
|
+
class: ee(["mwnf-essay", { "mwnf-essay--about": Ee.value }]),
|
|
471
|
+
dir: j(K) || void 0,
|
|
472
|
+
onClick: s[0] ||= (...e) => j(ye) && j(ye)(...e)
|
|
473
|
+
}, [
|
|
474
|
+
k(a.$slots, "header", w(x($.value)), () => [
|
|
475
|
+
Et.value.length ? (T(), g("p", Fe, [_("span", Ie, A(j(o)(At.value)), 1), (T(!0), g(f, null, O(Et.value, (e) => (T(), g(f, { key: e.id }, [pt(e) ? (T(), m(i, {
|
|
476
|
+
key: 0,
|
|
477
|
+
to: pt(e),
|
|
478
|
+
class: "mwnf-essay__breadcrumb-link"
|
|
479
|
+
}, {
|
|
480
|
+
default: L(() => [y(A(J(e)), 1)]),
|
|
481
|
+
_: 2
|
|
482
|
+
}, 1032, ["to"])) : (T(), g("span", Le, A(J(e)), 1))], 64))), 128))])) : h("", !0),
|
|
483
|
+
Dt.value.length > 1 ? (T(), g("div", {
|
|
484
|
+
key: 1,
|
|
485
|
+
class: "mwnf-essay__tabs",
|
|
486
|
+
role: "tablist",
|
|
487
|
+
"aria-label": j(o)(jt.value)
|
|
488
|
+
}, [(T(!0), g(f, null, O(Dt.value, (e) => (T(), m(i, {
|
|
489
|
+
key: e.id,
|
|
490
|
+
to: pt(e),
|
|
491
|
+
class: ee(["mwnf-essay__tab", { "mwnf-essay__tab--active": e.id === t.id }])
|
|
492
|
+
}, {
|
|
493
|
+
default: L(() => [y(A(J(e)), 1)]),
|
|
494
|
+
_: 2
|
|
495
|
+
}, 1032, ["to", "class"]))), 128))], 8, Re)) : h("", !0),
|
|
496
|
+
_("h1", ze, [Ae.value ? (T(), g("span", Be, A(Ae.value), 1)) : h("", !0), _("span", { innerHTML: Se.value }, null, 8, Ve)])
|
|
497
|
+
]),
|
|
498
|
+
_("div", He, [_("div", Ue, [
|
|
499
|
+
q.value ? h("", !0) : (T(), g("p", We, A(j(o)("core.status.loading")), 1)),
|
|
500
|
+
Ce.value ? (T(), g("p", {
|
|
501
|
+
key: 1,
|
|
502
|
+
class: "mwnf-essay__quote",
|
|
503
|
+
innerHTML: Ce.value
|
|
504
|
+
}, null, 8, Ge)) : h("", !0),
|
|
505
|
+
k(a.$slots, "before-body", w(x($.value))),
|
|
506
|
+
we.value ? (T(), g("div", {
|
|
507
|
+
key: 2,
|
|
508
|
+
class: "mwnf-essay__prose mwnf-sheet__block",
|
|
509
|
+
innerHTML: we.value
|
|
510
|
+
}, null, 8, Ke)) : h("", !0),
|
|
511
|
+
k(a.$slots, "after-body", w(x($.value))),
|
|
512
|
+
Ee.value ? h("", !0) : k(a.$slots, "justifications", w(x($.value)), void 0, void 0, 3),
|
|
513
|
+
Pt.value ? (T(), g("div", qe, [k(a.$slots, "navigation", w(x($.value)), () => [re.value ? (T(), m(i, {
|
|
514
|
+
key: 0,
|
|
515
|
+
to: pt(re.value),
|
|
516
|
+
class: "mwnf-essay__nav-link mwnf-essay__nav-link--previous"
|
|
517
|
+
}, {
|
|
518
|
+
default: L(() => [y("← " + A(j(o)(Ot.value)), 1)]),
|
|
519
|
+
_: 1
|
|
520
|
+
}, 8, ["to"])) : (T(), g("span", Je)), U.value ? (T(), m(i, {
|
|
521
|
+
key: 2,
|
|
522
|
+
to: pt(U.value),
|
|
523
|
+
class: "mwnf-essay__nav-link mwnf-essay__nav-link--next"
|
|
524
|
+
}, {
|
|
525
|
+
default: L(() => [y(A(j(o)(kt.value)) + " →", 1)]),
|
|
526
|
+
_: 1
|
|
527
|
+
}, 8, ["to"])) : h("", !0)])])) : h("", !0)
|
|
528
|
+
]), Nt.value ? (T(), g("div", Ye, [
|
|
529
|
+
k(a.$slots, "panel", w(x($.value)), () => [gt.value && ht.value ? (T(), g("div", Xe, [
|
|
530
|
+
b(r, { images: xt.value }, null, 8, ["images"]),
|
|
531
|
+
_t.value.length > 1 ? (T(), g("ul", Ze, [(T(!0), g(f, null, O(_t.value, (e) => (T(), g("li", { key: e.id }, [_("button", {
|
|
532
|
+
type: "button",
|
|
533
|
+
class: ee(["mwnf-essay__variant", { "mwnf-essay__variant--active": e.id === yt.value?.id }]),
|
|
534
|
+
"aria-pressed": e.id === yt.value?.id ? "true" : "false",
|
|
535
|
+
onClick: (t) => bt(e.id)
|
|
536
|
+
}, [e.image ? (T(), g("img", {
|
|
537
|
+
key: 0,
|
|
538
|
+
src: e.image,
|
|
539
|
+
alt: e.alt ?? "",
|
|
540
|
+
loading: "lazy"
|
|
541
|
+
}, null, 8, $e)) : h("", !0)], 10, Qe)]))), 128))])) : h("", !0),
|
|
542
|
+
_("h3", {
|
|
543
|
+
class: "mwnf-essay__panel-name",
|
|
544
|
+
innerHTML: yt.value?.caption?.title || ht.value.name
|
|
545
|
+
}, null, 8, et),
|
|
546
|
+
(T(!0), g(f, null, O(Ct.value, (e, t) => (T(), g("p", {
|
|
547
|
+
key: t,
|
|
548
|
+
class: "mwnf-essay__panel-field"
|
|
549
|
+
}, [e.label ? (T(), g("span", tt, A(e.label), 1)) : h("", !0), _("span", { innerHTML: e.value }, null, 8, nt)]))), 128)),
|
|
550
|
+
wt.value ? (T(), g("p", {
|
|
551
|
+
key: 1,
|
|
552
|
+
class: "mwnf-essay__panel-justification mwnf-sheet__block",
|
|
553
|
+
innerHTML: wt.value
|
|
554
|
+
}, null, 8, rt)) : h("", !0),
|
|
555
|
+
ft(ut.value) ? (T(), m(i, {
|
|
556
|
+
key: 2,
|
|
557
|
+
to: ft(ut.value),
|
|
558
|
+
class: "mwnf-essay__panel-link"
|
|
559
|
+
}, {
|
|
560
|
+
default: L(() => [y(A(j(o)(Mt.value)) + " →", 1)]),
|
|
561
|
+
_: 1
|
|
562
|
+
}, 8, ["to"])) : h("", !0)
|
|
563
|
+
])) : h("", !0)]),
|
|
564
|
+
k(a.$slots, "thumbnails", w(x($.value)), () => [gt.value && ct.value.length > 1 ? (T(), g("ul", it, [(T(!0), g(f, null, O(ct.value, (e) => (T(), g("li", { key: e.id }, [_("button", {
|
|
565
|
+
type: "button",
|
|
566
|
+
class: ee(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === ut.value?.id }]),
|
|
567
|
+
onClick: (t) => dt(e.id)
|
|
568
|
+
}, [e.images?.[0]?.url ? (T(), g("img", {
|
|
569
|
+
key: 0,
|
|
570
|
+
src: e.images[0].url,
|
|
571
|
+
alt: "",
|
|
572
|
+
loading: "lazy"
|
|
573
|
+
}, null, 8, ot)) : h("", !0)], 10, at)]))), 128))])) : !gt.value && Tt.value.length ? (T(), m(e, {
|
|
574
|
+
key: 1,
|
|
575
|
+
records: Tt.value
|
|
576
|
+
}, null, 8, ["records"])) : h("", !0)]),
|
|
577
|
+
k(a.$slots, "aside", w(x($.value)))
|
|
578
|
+
])) : h("", !0)]),
|
|
579
|
+
k(a.$slots, "after", w(x($.value)), () => [b(n)]),
|
|
580
|
+
b(d, {
|
|
581
|
+
term: j(ve),
|
|
582
|
+
html: xe.value,
|
|
583
|
+
dir: j(K),
|
|
584
|
+
onClose: j(be)
|
|
585
|
+
}, null, 8, [
|
|
586
|
+
"term",
|
|
587
|
+
"html",
|
|
588
|
+
"dir",
|
|
589
|
+
"onClose"
|
|
590
|
+
])
|
|
591
|
+
], 10, Pe)) : (T(), g("p", st, A(j(o)("core.status.loading")), 1));
|
|
592
|
+
}
|
|
593
|
+
}, lt = { class: "mwnf-link-list" }, ut = {
|
|
594
|
+
key: 0,
|
|
595
|
+
class: "mwnf-link-list__back"
|
|
596
|
+
}, dt = {
|
|
597
|
+
key: 1,
|
|
598
|
+
class: "mwnf-link-list__title"
|
|
599
|
+
}, ft = {
|
|
600
|
+
key: 2,
|
|
601
|
+
class: "mwnf-link-list__groups"
|
|
602
|
+
}, pt = {
|
|
603
|
+
key: 0,
|
|
604
|
+
class: "mwnf-link-list__heading"
|
|
605
|
+
}, mt = {
|
|
606
|
+
key: 1,
|
|
607
|
+
class: "mwnf-link-list__links"
|
|
608
|
+
}, ht = ["innerHTML"], gt = ["innerHTML"], _t = {
|
|
609
|
+
key: 3,
|
|
610
|
+
class: "mwnf-link-list__empty"
|
|
611
|
+
}, vt = {
|
|
612
|
+
__name: "LinkListView",
|
|
613
|
+
props: { spec: {
|
|
614
|
+
type: Object,
|
|
615
|
+
required: !0
|
|
616
|
+
} },
|
|
617
|
+
setup(e) {
|
|
618
|
+
let t = e, { t: n } = de(), r = p(() => ((typeof t.spec.groups == "function" ? t.spec.groups({}) : t.spec.groups ?? []) ?? []).filter((e) => e.links?.length > 0)), a = p(() => t.spec.title ? n(t.spec.title) : ""), o = p(() => t.spec.back?.label ? n(t.spec.back.label) : ""), s = p(() => n(t.spec.empty ?? "catalogue.results.noResults"));
|
|
619
|
+
return (e, c) => (T(), g("div", lt, [
|
|
620
|
+
t.spec.back && o.value ? (T(), g("div", ut, [b(i, {
|
|
621
|
+
to: t.spec.back.to,
|
|
622
|
+
href: t.spec.back.href
|
|
623
|
+
}, {
|
|
624
|
+
default: L(() => [y(" ← " + A(o.value), 1)]),
|
|
625
|
+
_: 1
|
|
626
|
+
}, 8, ["to", "href"])])) : h("", !0),
|
|
627
|
+
a.value ? (T(), g("h1", dt, A(a.value), 1)) : h("", !0),
|
|
628
|
+
k(e.$slots, "before"),
|
|
629
|
+
r.value.length ? (T(), g("div", ft, [(T(!0), g(f, null, O(r.value, (t, r) => (T(), g("section", {
|
|
630
|
+
key: r,
|
|
631
|
+
class: "mwnf-link-list__group"
|
|
632
|
+
}, [k(e.$slots, "group", { group: t }, () => [t.heading ? (T(), g("h2", pt, A(j(n)(t.heading)), 1)) : h("", !0), t.links?.length ? (T(), g("ul", mt, [(T(!0), g(f, null, O(t.links, (e, t) => (T(), g("li", {
|
|
633
|
+
key: t,
|
|
634
|
+
class: "mwnf-link-list__item"
|
|
635
|
+
}, [b(i, {
|
|
636
|
+
class: "mwnf-link-list__link",
|
|
637
|
+
to: e.to,
|
|
638
|
+
href: e.href
|
|
639
|
+
}, {
|
|
640
|
+
default: L(() => [_("span", { innerHTML: j(oe)(e.label) }, null, 8, ht)]),
|
|
641
|
+
_: 2
|
|
642
|
+
}, 1032, ["to", "href"]), e.note ? (T(), g("div", {
|
|
643
|
+
key: 0,
|
|
644
|
+
class: "mwnf-link-list__note",
|
|
645
|
+
innerHTML: j(oe)(e.note)
|
|
646
|
+
}, null, 8, gt)) : h("", !0)]))), 128))])) : h("", !0)])]))), 128))])) : (T(), g("div", _t, A(s.value), 1)),
|
|
647
|
+
k(e.$slots, "after")
|
|
648
|
+
]));
|
|
649
|
+
}
|
|
650
|
+
}, yt = { class: "mwnf-partner-list" }, bt = {
|
|
651
|
+
key: 0,
|
|
652
|
+
class: "mwnf-partner-list__title"
|
|
653
|
+
}, xt = {
|
|
654
|
+
key: 1,
|
|
655
|
+
class: "mwnf-partner-list__count"
|
|
656
|
+
}, St = {
|
|
657
|
+
key: 2,
|
|
658
|
+
class: "mwnf-partner-list__toggle"
|
|
659
|
+
}, Ct = {
|
|
660
|
+
key: 3,
|
|
661
|
+
class: "mwnf-partner-list__groups"
|
|
662
|
+
}, wt = {
|
|
663
|
+
key: 0,
|
|
664
|
+
class: "mwnf-partner-list__group-title"
|
|
665
|
+
}, Tt = { class: "mwnf-partner-list__tier" }, Et = { class: "mwnf-partner-list__row" }, Dt = {
|
|
666
|
+
key: 0,
|
|
667
|
+
class: "mwnf-partner-list__children"
|
|
668
|
+
}, Ot = {
|
|
669
|
+
key: 0,
|
|
670
|
+
class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
|
|
671
|
+
}, kt = { class: "mwnf-partner-list__tier-label" }, At = {
|
|
672
|
+
key: 4,
|
|
673
|
+
class: "mwnf-partner-list__empty"
|
|
674
|
+
}, jt = {
|
|
675
|
+
__name: "PartnerListView",
|
|
676
|
+
props: { spec: {
|
|
677
|
+
type: Object,
|
|
678
|
+
required: !0
|
|
679
|
+
} },
|
|
680
|
+
setup(e) {
|
|
681
|
+
let t = e, { t: n, locale: r } = de(), i = Q(), a = p(() => t.spec), o = p(() => a.value.entity ?? "partners"), c = ie(o.value);
|
|
682
|
+
o.value && i.loadTranslations(o.value, "en");
|
|
683
|
+
let l = {
|
|
684
|
+
t: n,
|
|
685
|
+
locale: r,
|
|
686
|
+
tr: (e) => i.tr(o.value, e, r.value, "en"),
|
|
687
|
+
renderInline: Y,
|
|
688
|
+
renderPlain: X
|
|
689
|
+
}, { filters: u, apply: d } = fe({
|
|
690
|
+
keys: ["order"],
|
|
691
|
+
page: !1
|
|
692
|
+
}), v = p(() => u.order === "desc" ? "desc" : "asc");
|
|
693
|
+
function y() {
|
|
694
|
+
d({ order: v.value === "asc" ? "desc" : "asc" });
|
|
695
|
+
}
|
|
696
|
+
let S = p(() => {
|
|
697
|
+
let e = a.value, t = c.value ?? [];
|
|
698
|
+
return e.scope ? t.filter((t) => e.scope(t, l)) : t;
|
|
699
|
+
}), ee = p(() => a.value.route);
|
|
700
|
+
function E(e) {
|
|
701
|
+
let t = ee.value;
|
|
702
|
+
return t ? typeof t == "function" ? t(e, l) : {
|
|
703
|
+
name: t,
|
|
704
|
+
params: { id: e.id }
|
|
705
|
+
} : null;
|
|
706
|
+
}
|
|
707
|
+
function D(e) {
|
|
708
|
+
let t = a.value.objectsRoute;
|
|
709
|
+
return J(e, l.tr(e.id), {
|
|
710
|
+
route: E,
|
|
711
|
+
objectsRoute: t ? (e) => t(e, l) : null
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
function j(e, t) {
|
|
715
|
+
let n = t.name ?? "";
|
|
716
|
+
return {
|
|
717
|
+
...J(e, {}, {}),
|
|
718
|
+
name: n,
|
|
719
|
+
plainName: N(n),
|
|
720
|
+
city: t.city ?? "",
|
|
721
|
+
location: t.city ?? "",
|
|
722
|
+
logos: t.logo ? [{
|
|
723
|
+
url: t.logo,
|
|
724
|
+
alt: N(n),
|
|
725
|
+
type: ""
|
|
726
|
+
}] : [],
|
|
727
|
+
itemCount: t.count ?? 0,
|
|
728
|
+
route: t.route ?? null
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
function M(e) {
|
|
732
|
+
if (a.value.record) {
|
|
733
|
+
let t = a.value.record(e, l);
|
|
734
|
+
return {
|
|
735
|
+
partner: e,
|
|
736
|
+
row: t,
|
|
737
|
+
view: j(e, t)
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
let t = D(e);
|
|
741
|
+
return {
|
|
742
|
+
partner: e,
|
|
743
|
+
row: {
|
|
744
|
+
name: t.name,
|
|
745
|
+
city: t.city,
|
|
746
|
+
logo: t.logos[0]?.url ?? "",
|
|
747
|
+
count: t.itemCount,
|
|
748
|
+
route: t.route
|
|
749
|
+
},
|
|
750
|
+
view: t
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
function N(e) {
|
|
754
|
+
return String(e ?? "").replace(/<[^>]*>/g, "");
|
|
755
|
+
}
|
|
756
|
+
let P = p(() => a.value.nested ? q(S.value) : null), F = p(() => {
|
|
757
|
+
let e = a.value, t = e.group?.tier ?? !1, n = (e.group?.order ?? "country") === "name", r = n ? S.value.map((e) => ({
|
|
758
|
+
...e,
|
|
759
|
+
country_id: "\0"
|
|
760
|
+
})) : S.value, i = G(r, {
|
|
761
|
+
label: n ? () => "" : (t) => e.label ? e.label(t, l) : t,
|
|
762
|
+
tier: t,
|
|
763
|
+
order: v.value
|
|
764
|
+
}), o = (e, t) => N(e.row.name).localeCompare(N(t.row.name));
|
|
765
|
+
return i.map((t) => {
|
|
766
|
+
let r = t.main.map(M).sort(o), i = t.associated.map(M).sort(o);
|
|
767
|
+
if (n && v.value === "desc" && (r.reverse(), i.reverse()), e.nested && P.value) {
|
|
768
|
+
let e = new Set(i.map((e) => e.partner.id));
|
|
769
|
+
r = r.map((t) => {
|
|
770
|
+
let n = P.value.children(t.partner.id).filter((t) => e.has(t.id));
|
|
771
|
+
for (let t of n) e.delete(t.id);
|
|
772
|
+
return {
|
|
773
|
+
...t,
|
|
774
|
+
children: n.map(M)
|
|
775
|
+
};
|
|
776
|
+
}), i = i.filter((t) => e.has(t.partner.id));
|
|
777
|
+
}
|
|
778
|
+
return {
|
|
779
|
+
country: t.country,
|
|
780
|
+
label: t.label,
|
|
781
|
+
main: r,
|
|
782
|
+
associated: i
|
|
783
|
+
};
|
|
784
|
+
});
|
|
785
|
+
}), ne = p(() => F.value.some((e) => e.main.length > 0 || e.associated.length > 0)), I = p(() => n(a.value.associatedLabel ?? "partner.list.associated")), R = p(() => ({
|
|
786
|
+
objectsLabel: a.value.objectsLabel ?? "partner.item.objectsInSite",
|
|
787
|
+
emptyLabel: a.value.emptyLabel ?? "",
|
|
788
|
+
show: { actions: !!a.value.actions }
|
|
789
|
+
})), z = p(() => n(a.value.foundLabel ?? "partner.list.partnersFound")), B = p(() => n(a.value.sortAscendingLabel ?? "partner.list.sortAscending")), V = p(() => n(a.value.sortDescendingLabel ?? "partner.list.sortDescending")), H = p(() => n(a.value.empty ?? "catalogue.results.noResults")), re = p(() => a.value.title ? n(a.value.title) : ""), U = p(() => F.value.reduce((e, t) => e + t.main.length + t.associated.length, 0)), ae = p(() => a.value.variant ?? "accordion"), W = p(() => ({
|
|
790
|
+
t: n,
|
|
791
|
+
locale: r,
|
|
792
|
+
groups: F.value,
|
|
793
|
+
orderDir: v.value,
|
|
794
|
+
toggleOrder: y
|
|
795
|
+
}));
|
|
796
|
+
return (e, t) => (T(), g("section", yt, [
|
|
797
|
+
re.value ? (T(), g("h1", bt, A(re.value), 1)) : h("", !0),
|
|
798
|
+
a.value.count ? (T(), g("div", xt, A(z.value) + ": " + A(U.value), 1)) : h("", !0),
|
|
799
|
+
k(e.$slots, "before", w(x(W.value))),
|
|
800
|
+
a.value.orderToggle ? (T(), g("div", St, [_("button", {
|
|
801
|
+
type: "button",
|
|
802
|
+
class: "mwnf-partner-list__toggle-button",
|
|
803
|
+
onClick: y
|
|
804
|
+
}, A(v.value === "asc" ? V.value : B.value), 1)])) : h("", !0),
|
|
805
|
+
ne.value ? (T(), g("div", Ct, [(T(!0), g(f, null, O(F.value, (t) => (T(), m(te(ae.value === "accordion" ? "details" : "section"), C({
|
|
806
|
+
key: t.country ?? "",
|
|
807
|
+
class: "mwnf-partner-list__group"
|
|
808
|
+
}, { ref_for: !0 }, ae.value === "accordion" ? { open: !0 } : {}), {
|
|
809
|
+
default: L(() => [
|
|
810
|
+
(T(), m(te(ae.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
|
|
811
|
+
default: L(() => [k(e.$slots, "group-heading", C({ group: t }, { ref_for: !0 }, W.value), () => [t.label ? (T(), g("h2", wt, A(t.label), 1)) : h("", !0)])]),
|
|
812
|
+
_: 2
|
|
813
|
+
}, 1024)),
|
|
814
|
+
_("div", Tt, [(T(!0), g(f, null, O(t.main, (n) => (T(), g("div", {
|
|
815
|
+
key: n.partner.id,
|
|
816
|
+
class: "mwnf-partner-list__row-block"
|
|
817
|
+
}, [_("div", Et, [k(e.$slots, "row", C({
|
|
818
|
+
group: t,
|
|
819
|
+
partner: n.partner,
|
|
820
|
+
row: n.row,
|
|
821
|
+
view: n.view
|
|
822
|
+
}, { ref_for: !0 }, W.value), () => [b(s, C({
|
|
823
|
+
variant: "line",
|
|
824
|
+
partner: n.view
|
|
825
|
+
}, { ref_for: !0 }, R.value), null, 16, ["partner"])])]), n.children?.length ? (T(), g("div", Dt, [(T(!0), g(f, null, O(n.children, (n) => (T(), g("div", {
|
|
826
|
+
key: n.partner.id,
|
|
827
|
+
class: "mwnf-partner-list__row mwnf-partner-list__row--child"
|
|
828
|
+
}, [k(e.$slots, "row", C({
|
|
829
|
+
group: t,
|
|
830
|
+
partner: n.partner,
|
|
831
|
+
row: n.row,
|
|
832
|
+
view: n.view
|
|
833
|
+
}, { ref_for: !0 }, W.value), () => [b(s, C({
|
|
834
|
+
variant: "line",
|
|
835
|
+
partner: n.view
|
|
836
|
+
}, { ref_for: !0 }, R.value), null, 16, ["partner"])])]))), 128))])) : h("", !0)]))), 128))]),
|
|
837
|
+
t.associated.length ? (T(), g("div", Ot, [_("p", kt, A(I.value), 1), (T(!0), g(f, null, O(t.associated, (n) => (T(), g("div", {
|
|
838
|
+
key: n.partner.id,
|
|
839
|
+
class: "mwnf-partner-list__row"
|
|
840
|
+
}, [k(e.$slots, "row", C({
|
|
841
|
+
group: t,
|
|
842
|
+
partner: n.partner,
|
|
843
|
+
row: n.row,
|
|
844
|
+
view: n.view
|
|
845
|
+
}, { ref_for: !0 }, W.value), () => [b(s, C({
|
|
846
|
+
variant: "line",
|
|
847
|
+
partner: n.view
|
|
848
|
+
}, { ref_for: !0 }, R.value), null, 16, ["partner"])])]))), 128))])) : h("", !0)
|
|
849
|
+
]),
|
|
850
|
+
_: 2
|
|
851
|
+
}, 1040))), 128))])) : (T(), g("p", At, A(H.value), 1)),
|
|
852
|
+
k(e.$slots, "after", w(x(W.value)))
|
|
853
|
+
]));
|
|
854
|
+
}
|
|
855
|
+
}, Mt = { class: "mwnf-text-page" }, $ = {
|
|
856
|
+
key: 0,
|
|
857
|
+
class: "mwnf-text-page__back"
|
|
858
|
+
}, Nt = {
|
|
859
|
+
key: 1,
|
|
860
|
+
class: "mwnf-text-page__heading"
|
|
861
|
+
}, Pt = { class: "mwnf-prose" }, Ft = ["innerHTML"], It = {
|
|
862
|
+
__name: "TextPageView",
|
|
863
|
+
props: { spec: {
|
|
864
|
+
type: Object,
|
|
865
|
+
required: !0
|
|
866
|
+
} },
|
|
867
|
+
setup(e) {
|
|
868
|
+
let t = e, { t: n } = de(), r = Q(), a = pe(), o = p(() => t.spec.heading ? n(t.spec.heading) : ""), s = p(() => typeof t.spec.body == "string"), c = p(() => s.value ? t.spec.body : null), l = p(() => ({
|
|
869
|
+
t: n,
|
|
870
|
+
tr: (e, t) => r.tr(e, t, a.value, "en"),
|
|
871
|
+
language: a.value
|
|
872
|
+
})), u = p(() => s.value ? null : typeof t.spec.body == "function" ? K(t.spec.body(l.value)) : null), d = p(() => t.spec.back === !1 ? null : t.spec.back === !0 ? n("core.action.back") : t.spec.back?.label ? n(t.spec.back.label) : null);
|
|
873
|
+
return (e, n) => (T(), g("div", Mt, [
|
|
874
|
+
d.value && (t.spec.back === !0 || t.spec.back?.to || t.spec.back?.href) ? (T(), g("div", $, [b(i, {
|
|
875
|
+
to: t.spec.back === !0 ? {} : t.spec.back?.to,
|
|
876
|
+
href: t.spec.back === !0 ? "#" : t.spec.back?.href
|
|
877
|
+
}, {
|
|
878
|
+
default: L(() => [y(" ← " + A(d.value), 1)]),
|
|
879
|
+
_: 1
|
|
880
|
+
}, 8, ["to", "href"])])) : h("", !0),
|
|
881
|
+
o.value ? (T(), g("h1", Nt, A(o.value), 1)) : h("", !0),
|
|
882
|
+
_("div", Pt, [s.value ? (T(), m(j(z), {
|
|
883
|
+
key: 0,
|
|
884
|
+
keypath: c.value
|
|
885
|
+
}, null, 8, ["keypath"])) : u.value ? (T(), g("div", {
|
|
886
|
+
key: 1,
|
|
887
|
+
innerHTML: u.value
|
|
888
|
+
}, null, 8, Ft)) : h("", !0)])
|
|
889
|
+
]));
|
|
890
|
+
}
|
|
891
|
+
}, Lt = { class: "mwnf-search-form__row-label" }, Rt = ["onUpdate:modelValue"], zt = ["value"], Bt = ["onUpdate:modelValue"], Vt = ["value"], Ht = ["onUpdate:modelValue", "placeholder"], Ut = {
|
|
892
|
+
key: 0,
|
|
893
|
+
class: "mwnf-search-form__dates"
|
|
894
|
+
}, Wt = {
|
|
895
|
+
key: 1,
|
|
896
|
+
class: "mwnf-facet"
|
|
897
|
+
}, Gt = { class: "mwnf-facet__label" }, Kt = { value: "" }, qt = ["value"], Jt = {
|
|
898
|
+
key: 0,
|
|
899
|
+
class: "mwnf-search-form__dates"
|
|
900
|
+
}, Yt = { class: "mwnf-search-form__radio-choice" }, Xt = ["value"], Zt = ["onUpdate:modelValue", "disabled"], Qt = ["onUpdate:modelValue"], $t = { class: "mwnf-facet__label" }, en = {
|
|
901
|
+
key: 0,
|
|
902
|
+
class: "mwnf-search-form__how-to"
|
|
903
|
+
}, tn = {
|
|
904
|
+
__name: "SearchFormView",
|
|
905
|
+
props: { spec: {
|
|
906
|
+
type: Object,
|
|
907
|
+
required: !0
|
|
908
|
+
} },
|
|
909
|
+
setup(e) {
|
|
910
|
+
let t = e, { t: n } = de(), r = ye(), o = p(() => t.spec), s = p(() => o.value.mode), l = p(() => o.value.entity ? ie(o.value.entity).value ?? [] : []), u = p(() => o.value.dates === "buckets"), d = p(() => {
|
|
911
|
+
let e = o.value.dates;
|
|
912
|
+
if (!e || e === "buckets") return null;
|
|
913
|
+
let t = e.presets;
|
|
914
|
+
return typeof t == "function" ? t() : t ?? H();
|
|
915
|
+
});
|
|
916
|
+
function v(e) {
|
|
917
|
+
return (e ?? []).map((e) => ({
|
|
918
|
+
value: e,
|
|
919
|
+
label: String(e)
|
|
920
|
+
}));
|
|
921
|
+
}
|
|
922
|
+
let C = p(() => u.value ? ve(l.value, n) : []), te = p(() => u.value ? C.value : v(d.value?.from)), M = p(() => u.value ? C.value : v(d.value?.to)), I = p(() => !!o.value.dates), z = D(""), B = D(""), V = o.value.language ? ge(o.value.language) : null, re = p(() => V?.languages.value ?? []), U = V?.language ?? D(""), ae = p(() => Object.fromEntries((o.value.facets ?? []).filter((e) => !e.options && e.type !== "year").map((e) => [e.key, { field: e.field ?? e.key }]))), W = le(l, ae), G = p(() => {
|
|
923
|
+
let e = {};
|
|
924
|
+
for (let t of o.value.facets ?? []) e[t.key] = t.options ?? W.value[t.key] ?? [];
|
|
925
|
+
return e;
|
|
926
|
+
}), K = [{
|
|
927
|
+
key: "AND",
|
|
928
|
+
label: "catalogue.search.and"
|
|
929
|
+
}, {
|
|
930
|
+
key: "OR",
|
|
931
|
+
label: "catalogue.search.or"
|
|
932
|
+
}], oe = [
|
|
933
|
+
"catalogue.search.keywordOne",
|
|
934
|
+
"catalogue.search.keywordTwo",
|
|
935
|
+
"catalogue.search.keywordThree"
|
|
936
|
+
], q = p(() => o.value.operators ?? K), J = D(Array.from({ length: o.value.rows ?? 3 }, () => ({
|
|
937
|
+
keyword: "",
|
|
938
|
+
field: o.value.fields?.[0]?.key ?? "",
|
|
939
|
+
cond: (o.value.operators ?? K)[0].key
|
|
940
|
+
})));
|
|
941
|
+
function se(e) {
|
|
942
|
+
return oe[e] ? n(oe[e]) : "";
|
|
943
|
+
}
|
|
944
|
+
let Y = D(o.value.facets?.[0]?.key ?? ""), X = E(Object.fromEntries((o.value.facets ?? []).map((e) => [e.key, ""]))), Z = E(Object.fromEntries((o.value.extras ?? []).map((e) => [e.key, !1])));
|
|
945
|
+
function ce() {
|
|
946
|
+
let e = {};
|
|
947
|
+
for (let t of o.value.extras ?? []) Z[t.key] && (e[t.key] = "1");
|
|
948
|
+
return e;
|
|
949
|
+
}
|
|
950
|
+
function Q(e) {
|
|
951
|
+
return r.push({
|
|
952
|
+
name: o.value.target,
|
|
953
|
+
query: e
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
function ue() {
|
|
957
|
+
let e = {};
|
|
958
|
+
if (s.value === "rows") J.value.forEach((t, n) => {
|
|
959
|
+
if (t.keyword) {
|
|
960
|
+
if (n === 0) e.q = t.keyword, t.field && (e.field = t.field);
|
|
961
|
+
else {
|
|
962
|
+
let r = n + 1;
|
|
963
|
+
e[`q${r}`] = t.keyword, t.field && (e[`field${r}`] = t.field), e[`op${r}`] = t.cond;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}), z.value && (e.from = String(z.value)), B.value && (e.to = String(B.value)), U.value && (e.lang = U.value);
|
|
967
|
+
else if (s.value === "radio") {
|
|
968
|
+
let t = Y.value, n = t ? X[t] : "";
|
|
969
|
+
n && (e[t] = String(n));
|
|
970
|
+
}
|
|
971
|
+
return Object.assign(e, ce()), Q(e);
|
|
972
|
+
}
|
|
973
|
+
function fe(e, t) {
|
|
974
|
+
if (t !== "" && t != null) return Q({
|
|
975
|
+
[e]: String(t),
|
|
976
|
+
...ce()
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
function pe() {
|
|
980
|
+
return Q(ce());
|
|
981
|
+
}
|
|
982
|
+
let me = p(() => s.value === "facets" ? "immediate" : "apply"), he = p(() => s.value === "radio" ? "core.action.browse" : "core.action.search"), _e = p(() => n(o.value.submitLabel ?? he.value)), be = p(() => n(o.value.showAllLabel ?? "core.action.reset")), xe = p(() => ({
|
|
983
|
+
mode: s.value,
|
|
984
|
+
submit: ue,
|
|
985
|
+
showAll: pe
|
|
986
|
+
}));
|
|
987
|
+
return (e, t) => (T(), g("section", { class: ee(["mwnf-search-form", `mwnf-search-form--${s.value}`]) }, [
|
|
988
|
+
k(e.$slots, "intro", w(x(xe.value))),
|
|
989
|
+
k(e.$slots, "before", w(x(xe.value))),
|
|
990
|
+
b(a, {
|
|
991
|
+
class: "mwnf-search-form__panel",
|
|
992
|
+
mode: me.value,
|
|
993
|
+
"apply-label": _e.value,
|
|
994
|
+
"reset-label": be.value,
|
|
995
|
+
onApply: ue,
|
|
996
|
+
onReset: pe
|
|
997
|
+
}, {
|
|
998
|
+
default: L(() => [
|
|
999
|
+
s.value === "rows" ? (T(), g(f, { key: 0 }, [
|
|
1000
|
+
(T(!0), g(f, null, O(J.value, (e, t) => (T(), g("div", {
|
|
1001
|
+
key: t,
|
|
1002
|
+
class: "mwnf-search-form__row"
|
|
1003
|
+
}, [
|
|
1004
|
+
_("span", Lt, A(se(t)), 1),
|
|
1005
|
+
t > 0 ? R((T(), g("select", {
|
|
1006
|
+
key: 0,
|
|
1007
|
+
"onUpdate:modelValue": (t) => e.cond = t,
|
|
1008
|
+
class: "mwnf-facet__select mwnf-search-form__operator"
|
|
1009
|
+
}, [(T(!0), g(f, null, O(q.value, (e) => (T(), g("option", {
|
|
1010
|
+
key: e.key,
|
|
1011
|
+
value: e.key
|
|
1012
|
+
}, A(j(n)(e.label)), 9, zt))), 128))], 8, Rt)), [[F, e.cond]]) : h("", !0),
|
|
1013
|
+
R(_("select", {
|
|
1014
|
+
"onUpdate:modelValue": (t) => e.field = t,
|
|
1015
|
+
class: "mwnf-facet__select mwnf-search-form__field"
|
|
1016
|
+
}, [(T(!0), g(f, null, O(o.value.fields ?? [], (e) => (T(), g("option", {
|
|
1017
|
+
key: e.key,
|
|
1018
|
+
value: e.key
|
|
1019
|
+
}, A(j(n)(e.label)), 9, Vt))), 128))], 8, Bt), [[F, e.field]]),
|
|
1020
|
+
R(_("input", {
|
|
1021
|
+
"onUpdate:modelValue": (t) => e.keyword = t,
|
|
1022
|
+
type: "text",
|
|
1023
|
+
class: "mwnf-search-form__keyword",
|
|
1024
|
+
placeholder: j(n)("catalogue.search.keywordPlaceholder")
|
|
1025
|
+
}, null, 8, Ht), [[ne, e.keyword]])
|
|
1026
|
+
]))), 128)),
|
|
1027
|
+
I.value ? (T(), g("div", Ut, [b(c, {
|
|
1028
|
+
modelValue: z.value,
|
|
1029
|
+
"onUpdate:modelValue": t[0] ||= (e) => z.value = e,
|
|
1030
|
+
label: j(n)("catalogue.facet.dateFrom"),
|
|
1031
|
+
options: te.value,
|
|
1032
|
+
"any-label": "—"
|
|
1033
|
+
}, null, 8, [
|
|
1034
|
+
"modelValue",
|
|
1035
|
+
"label",
|
|
1036
|
+
"options"
|
|
1037
|
+
]), b(c, {
|
|
1038
|
+
modelValue: B.value,
|
|
1039
|
+
"onUpdate:modelValue": t[1] ||= (e) => B.value = e,
|
|
1040
|
+
label: j(n)("catalogue.facet.dateTo"),
|
|
1041
|
+
options: M.value,
|
|
1042
|
+
"any-label": "—"
|
|
1043
|
+
}, null, 8, [
|
|
1044
|
+
"modelValue",
|
|
1045
|
+
"label",
|
|
1046
|
+
"options"
|
|
1047
|
+
])])) : h("", !0),
|
|
1048
|
+
o.value.language ? (T(), g("label", Wt, [_("span", Gt, A(j(n)("catalogue.search.language")), 1), R(_("select", {
|
|
1049
|
+
"onUpdate:modelValue": t[2] ||= (e) => S(U) ? U.value = e : null,
|
|
1050
|
+
class: "mwnf-facet__select mwnf-search-form__language"
|
|
1051
|
+
}, [_("option", Kt, A(j(n)("catalogue.search.anyLanguage")), 1), (T(!0), g(f, null, O(re.value, (e) => (T(), g("option", {
|
|
1052
|
+
key: e,
|
|
1053
|
+
value: e
|
|
1054
|
+
}, A(e.toUpperCase()), 9, qt))), 128))], 512), [[F, j(U)]])])) : h("", !0)
|
|
1055
|
+
], 64)) : s.value === "facets" ? (T(), g(f, { key: 1 }, [(T(!0), g(f, null, O(o.value.facets ?? [], (e) => (T(), m(c, {
|
|
1056
|
+
key: e.key,
|
|
1057
|
+
label: e.label ? j(n)(e.label) : "",
|
|
1058
|
+
options: G.value[e.key] ?? [],
|
|
1059
|
+
"model-value": X[e.key],
|
|
1060
|
+
"onUpdate:modelValue": (t) => fe(e.key, t)
|
|
1061
|
+
}, null, 8, [
|
|
1062
|
+
"label",
|
|
1063
|
+
"options",
|
|
1064
|
+
"model-value",
|
|
1065
|
+
"onUpdate:modelValue"
|
|
1066
|
+
]))), 128)), I.value ? (T(), g("div", Jt, [b(c, {
|
|
1067
|
+
"model-value": z.value,
|
|
1068
|
+
label: j(n)("catalogue.facet.startDate"),
|
|
1069
|
+
options: te.value,
|
|
1070
|
+
"onUpdate:modelValue": t[3] ||= (e) => {
|
|
1071
|
+
z.value = e, fe("from", e);
|
|
1072
|
+
}
|
|
1073
|
+
}, null, 8, [
|
|
1074
|
+
"model-value",
|
|
1075
|
+
"label",
|
|
1076
|
+
"options"
|
|
1077
|
+
]), b(c, {
|
|
1078
|
+
"model-value": B.value,
|
|
1079
|
+
label: j(n)("catalogue.facet.endDate"),
|
|
1080
|
+
options: M.value,
|
|
1081
|
+
"onUpdate:modelValue": t[4] ||= (e) => {
|
|
1082
|
+
B.value = e, fe("to", e);
|
|
1083
|
+
}
|
|
1084
|
+
}, null, 8, [
|
|
1085
|
+
"model-value",
|
|
1086
|
+
"label",
|
|
1087
|
+
"options"
|
|
1088
|
+
])])) : h("", !0)], 64)) : s.value === "radio" ? (T(!0), g(f, { key: 2 }, O(o.value.facets ?? [], (e) => (T(), g("div", {
|
|
1089
|
+
key: e.key,
|
|
1090
|
+
class: "mwnf-search-form__radio-row"
|
|
1091
|
+
}, [_("label", Yt, [R(_("input", {
|
|
1092
|
+
"onUpdate:modelValue": t[5] ||= (e) => Y.value = e,
|
|
1093
|
+
type: "radio",
|
|
1094
|
+
name: "mwnf-search-form-filter",
|
|
1095
|
+
value: e.key
|
|
1096
|
+
}, null, 8, Xt), [[P, Y.value]]), y(" " + A(e.label ? j(n)(e.label) : ""), 1)]), e.type === "year" ? R((T(), g("input", {
|
|
1097
|
+
key: 1,
|
|
1098
|
+
"onUpdate:modelValue": (t) => X[e.key] = t,
|
|
1099
|
+
type: "number",
|
|
1100
|
+
class: "mwnf-search-form__year",
|
|
1101
|
+
disabled: Y.value !== e.key
|
|
1102
|
+
}, null, 8, Zt)), [[ne, X[e.key]]]) : (T(), m(c, {
|
|
1103
|
+
key: 0,
|
|
1104
|
+
modelValue: X[e.key],
|
|
1105
|
+
"onUpdate:modelValue": (t) => X[e.key] = t,
|
|
1106
|
+
options: G.value[e.key] ?? [],
|
|
1107
|
+
disabled: Y.value !== e.key
|
|
1108
|
+
}, null, 8, [
|
|
1109
|
+
"modelValue",
|
|
1110
|
+
"onUpdate:modelValue",
|
|
1111
|
+
"options",
|
|
1112
|
+
"disabled"
|
|
1113
|
+
]))]))), 128)) : h("", !0),
|
|
1114
|
+
(T(!0), g(f, null, O(o.value.extras ?? [], (e) => (T(), g("label", {
|
|
1115
|
+
key: e.key,
|
|
1116
|
+
class: "mwnf-facet mwnf-facet--checkbox"
|
|
1117
|
+
}, [R(_("input", {
|
|
1118
|
+
"onUpdate:modelValue": (t) => Z[e.key] = t,
|
|
1119
|
+
type: "checkbox",
|
|
1120
|
+
class: "mwnf-facet__checkbox"
|
|
1121
|
+
}, null, 8, Qt), [[N, Z[e.key]]]), _("span", $t, A(j(n)(e.label)), 1)]))), 128)),
|
|
1122
|
+
k(e.$slots, "extras", w(x(xe.value)))
|
|
1123
|
+
]),
|
|
1124
|
+
_: 3
|
|
1125
|
+
}, 8, [
|
|
1126
|
+
"mode",
|
|
1127
|
+
"apply-label",
|
|
1128
|
+
"reset-label"
|
|
1129
|
+
]),
|
|
1130
|
+
o.value.howTo ? (T(), g("p", en, [b(i, { to: { name: o.value.howTo } }, {
|
|
1131
|
+
default: L(() => [y(A(j(n)("catalogue.search.howTo")), 1)]),
|
|
1132
|
+
_: 1
|
|
1133
|
+
}, 8, ["to"])])) : h("", !0),
|
|
1134
|
+
k(e.$slots, "actions", w(x(xe.value)))
|
|
1135
|
+
], 2));
|
|
1136
|
+
}
|
|
1137
|
+
}, nn = { class: "mwnf-timeline" }, rn = {
|
|
1138
|
+
key: 0,
|
|
1139
|
+
class: "mwnf-timeline__title"
|
|
1140
|
+
}, an = {
|
|
1141
|
+
key: 3,
|
|
1142
|
+
class: "mwnf-facet"
|
|
1143
|
+
}, on = { class: "mwnf-facet__label" }, sn = [
|
|
1144
|
+
"value",
|
|
1145
|
+
"placeholder",
|
|
1146
|
+
"onInput"
|
|
1147
|
+
], cn = {
|
|
1148
|
+
key: 1,
|
|
1149
|
+
class: "mwnf-timeline__error"
|
|
1150
|
+
}, ln = {
|
|
1151
|
+
__name: "TimelineResultsView",
|
|
1152
|
+
props: { spec: {
|
|
1153
|
+
type: Object,
|
|
1154
|
+
required: !0
|
|
1155
|
+
} },
|
|
1156
|
+
setup(e) {
|
|
1157
|
+
let t = e, { t: n } = de(), r = ye(), s = p(() => t.spec), d = p(() => !!s.value.entrance), v = _e({
|
|
1158
|
+
scope: t.spec.scope ?? "country",
|
|
1159
|
+
countryLabel: t.spec.countryLabel,
|
|
1160
|
+
countryIdForCode: t.spec.countryIdForCode,
|
|
1161
|
+
tr: t.spec.tr,
|
|
1162
|
+
timelinesEntity: t.spec.timelinesEntity,
|
|
1163
|
+
eventsEntity: t.spec.eventsEntity
|
|
1164
|
+
}), S = p(() => s.value.controls ?? []), C = p(() => s.value.keys ?? S.value.map((e) => e.key)), ee = (e) => S.value.some((t) => t.key === e), te = p(() => ({
|
|
1165
|
+
t: n,
|
|
1166
|
+
tr: t.spec.tr,
|
|
1167
|
+
years: {
|
|
1168
|
+
min: B.value[0],
|
|
1169
|
+
max: B.value[1]
|
|
1170
|
+
}
|
|
1171
|
+
})), M = E(Object.fromEntries(C.value.map((e) => [e, ""]))), N = D(""), P = d.value ? null : fe({ keys: C.value }), F = d.value ? M : P.filters;
|
|
1172
|
+
function ne(e) {
|
|
1173
|
+
if (ee("collection") && e !== "" && e != null) return e === "pc" ? null : e;
|
|
1174
|
+
}
|
|
1175
|
+
function I() {
|
|
1176
|
+
for (let e of C.value) M[e] = "";
|
|
1177
|
+
N.value = "";
|
|
1178
|
+
}
|
|
1179
|
+
function R() {
|
|
1180
|
+
N.value = "";
|
|
1181
|
+
let e = !!F.begin && !!F.end;
|
|
1182
|
+
if (e && Number(F.begin) >= Number(F.end)) {
|
|
1183
|
+
N.value = n(s.value.errorPeriod ?? "timeline.form.errorPeriod");
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
if (!F.country && !e) {
|
|
1187
|
+
N.value = n(s.value.errorSelect ?? "timeline.form.errorSelect");
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
let t = {};
|
|
1191
|
+
for (let e of C.value) F[e] && (t[e] = F[e]);
|
|
1192
|
+
r.push({
|
|
1193
|
+
name: s.value.route,
|
|
1194
|
+
query: t
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
let z = p(() => {
|
|
1198
|
+
if (d.value) return [];
|
|
1199
|
+
let e = F;
|
|
1200
|
+
return v.findEvents({
|
|
1201
|
+
country: e.country || void 0,
|
|
1202
|
+
collection: ne(e.collection),
|
|
1203
|
+
begin: e.begin,
|
|
1204
|
+
end: e.end
|
|
1205
|
+
});
|
|
1206
|
+
}), B = p(() => {
|
|
1207
|
+
let e = v.findEvents({
|
|
1208
|
+
country: void 0,
|
|
1209
|
+
collection: void 0
|
|
1210
|
+
}).map((e) => e.year_from).filter((e) => Number.isFinite(e) && e !== 0);
|
|
1211
|
+
return e.length ? [Math.min(...e), Math.max(...e)] : [null, null];
|
|
1212
|
+
}), V = me(z, {
|
|
1213
|
+
page: () => P ? P.page.value : 1,
|
|
1214
|
+
size: () => s.value.pageSize ?? 15
|
|
1215
|
+
});
|
|
1216
|
+
function H(e) {
|
|
1217
|
+
let t = s.value.countryLabel && e.country_id ? s.value.countryLabel(e.country_id) : "";
|
|
1218
|
+
return {
|
|
1219
|
+
id: e.id,
|
|
1220
|
+
date: U(e, e.text, n),
|
|
1221
|
+
caption: t ? Y(String(t)) : "",
|
|
1222
|
+
description: e.text?.description ? se(String(e.text.description), { breaks: !0 }) : ""
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
let re = p(() => V.value.rows.map((e) => (s.value.event ?? H)(e, te.value))), ie = p(() => (v.countries.value ?? []).map((e) => ({
|
|
1226
|
+
value: e.value,
|
|
1227
|
+
label: e.value === "all" ? n("timeline.form.allCountries") : e.label
|
|
1228
|
+
}))), ae = p(() => s.value.collections?.(te.value) ?? []), W = p(() => {
|
|
1229
|
+
let e = {};
|
|
1230
|
+
for (let t of S.value) (t.key === "begin" || t.key === "end") && t.options && (typeof t.options == "function" ? e[t.key] = t.options(te.value) : e[t.key] = t.options);
|
|
1231
|
+
return e;
|
|
1232
|
+
}), G = p(() => ({
|
|
1233
|
+
filters: F,
|
|
1234
|
+
active: C.value.some((e) => F[e]),
|
|
1235
|
+
apply: d.value ? R : (e) => P.apply(e),
|
|
1236
|
+
reset: d.value ? I : P.reset,
|
|
1237
|
+
goToPage: d.value ? () => {} : P.goToPage,
|
|
1238
|
+
events: z.value,
|
|
1239
|
+
pageInfo: V.value,
|
|
1240
|
+
countries: ie.value,
|
|
1241
|
+
collections: ae.value,
|
|
1242
|
+
t: n,
|
|
1243
|
+
tr: s.value.tr
|
|
1244
|
+
})), K = p(() => {
|
|
1245
|
+
let e = s.value.gallery;
|
|
1246
|
+
return !e || d.value ? null : !e.items || e.items(G.value);
|
|
1247
|
+
}), oe = p(() => {
|
|
1248
|
+
let e = K.value;
|
|
1249
|
+
return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
|
|
1250
|
+
}), q = p(() => {
|
|
1251
|
+
let e = K.value;
|
|
1252
|
+
return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
|
|
1253
|
+
}), J = p(() => {
|
|
1254
|
+
if (!oe.value) return null;
|
|
1255
|
+
let e = {};
|
|
1256
|
+
for (let t of C.value) F[t] && (e[t] = F[t]);
|
|
1257
|
+
return {
|
|
1258
|
+
to: {
|
|
1259
|
+
name: s.value.gallery.route,
|
|
1260
|
+
query: e
|
|
1261
|
+
},
|
|
1262
|
+
count: q.value,
|
|
1263
|
+
label: n(s.value.gallery.label ?? "timeline.nav.seeGallery")
|
|
1264
|
+
};
|
|
1265
|
+
}), X = p(() => ({
|
|
1266
|
+
...G.value,
|
|
1267
|
+
gallery: J.value
|
|
1268
|
+
})), Z = p(() => s.value.summary ? s.value.summary(X.value) : [{
|
|
1269
|
+
label: n(s.value.summaryLabel ?? "timeline.results.eventsFound"),
|
|
1270
|
+
count: V.value.total
|
|
1271
|
+
}]), ce = p(() => n(s.value.empty ?? "timeline.results.noResults")), Q = p(() => ({
|
|
1272
|
+
window: 5,
|
|
1273
|
+
jump: !1,
|
|
1274
|
+
ends: !0,
|
|
1275
|
+
...s.value.pagination ?? {}
|
|
1276
|
+
}));
|
|
1277
|
+
function le(e, t) {
|
|
1278
|
+
return e.label ? n(e.label) : t ? n(t) : "";
|
|
1279
|
+
}
|
|
1280
|
+
return (e, t) => (T(), g("section", nn, [
|
|
1281
|
+
k(e.$slots, "before", w(x(X.value))),
|
|
1282
|
+
s.value.title ? (T(), g("h1", rn, A(j(n)(s.value.title)), 1)) : h("", !0),
|
|
1283
|
+
b(a, {
|
|
1284
|
+
class: "mwnf-timeline__filters",
|
|
1285
|
+
title: s.value.filterTitle ? j(n)(s.value.filterTitle) : "",
|
|
1286
|
+
"apply-label": d.value ? j(n)(s.value.submitLabel ?? "core.action.search") : s.value.applyLabel ? j(n)(s.value.applyLabel) : "",
|
|
1287
|
+
"reset-label": s.value.resetLabel ? j(n)(s.value.resetLabel) : "",
|
|
1288
|
+
onApply: t[2] ||= (e) => d.value ? R() : j(P).apply(),
|
|
1289
|
+
onReset: t[3] ||= (e) => d.value ? I() : j(P).reset()
|
|
1290
|
+
}, {
|
|
1291
|
+
default: L(() => [(T(!0), g(f, null, O(S.value, (e) => (T(), g(f, { key: e.key }, [e.key === "country" ? (T(), m(c, {
|
|
1292
|
+
key: 0,
|
|
1293
|
+
"model-value": j(F).country,
|
|
1294
|
+
label: le(e, "catalogue.facet.country"),
|
|
1295
|
+
options: ie.value,
|
|
1296
|
+
placeholder: e.placeholder ? j(n)(e.placeholder) : j(n)("catalogue.facet.selectCountry"),
|
|
1297
|
+
"any-label": e.anyLabel ? j(n)(e.anyLabel) : "",
|
|
1298
|
+
"hide-empty": !!e.hideEmpty,
|
|
1299
|
+
"onUpdate:modelValue": t[0] ||= (e) => j(F).country = e
|
|
1300
|
+
}, null, 8, [
|
|
1301
|
+
"model-value",
|
|
1302
|
+
"label",
|
|
1303
|
+
"options",
|
|
1304
|
+
"placeholder",
|
|
1305
|
+
"any-label",
|
|
1306
|
+
"hide-empty"
|
|
1307
|
+
])) : e.key === "collection" ? (T(), m(c, {
|
|
1308
|
+
key: 1,
|
|
1309
|
+
"model-value": j(F).collection,
|
|
1310
|
+
label: le(e),
|
|
1311
|
+
options: ae.value,
|
|
1312
|
+
placeholder: e.placeholder ? j(n)(e.placeholder) : "",
|
|
1313
|
+
"any-label": e.anyLabel ? j(n)(e.anyLabel) : "",
|
|
1314
|
+
"hide-empty": !!e.hideEmpty,
|
|
1315
|
+
"onUpdate:modelValue": t[1] ||= (e) => j(F).collection = e
|
|
1316
|
+
}, null, 8, [
|
|
1317
|
+
"model-value",
|
|
1318
|
+
"label",
|
|
1319
|
+
"options",
|
|
1320
|
+
"placeholder",
|
|
1321
|
+
"any-label",
|
|
1322
|
+
"hide-empty"
|
|
1323
|
+
])) : (e.key === "begin" || e.key === "end") && W.value[e.key] ? (T(), m(c, {
|
|
1324
|
+
key: 2,
|
|
1325
|
+
"model-value": j(F)[e.key],
|
|
1326
|
+
label: le(e, e.key === "begin" ? "catalogue.facet.startDate" : "catalogue.facet.endDate"),
|
|
1327
|
+
options: W.value[e.key],
|
|
1328
|
+
placeholder: e.placeholder ? j(n)(e.placeholder) : j(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
|
|
1329
|
+
"any-label": e.anyLabel ? j(n)(e.anyLabel) : "",
|
|
1330
|
+
"hide-empty": !!e.hideEmpty,
|
|
1331
|
+
"onUpdate:modelValue": (t) => j(F)[e.key] = t
|
|
1332
|
+
}, null, 8, [
|
|
1333
|
+
"model-value",
|
|
1334
|
+
"label",
|
|
1335
|
+
"options",
|
|
1336
|
+
"placeholder",
|
|
1337
|
+
"any-label",
|
|
1338
|
+
"hide-empty",
|
|
1339
|
+
"onUpdate:modelValue"
|
|
1340
|
+
])) : (T(), g("label", an, [_("span", on, A(le(e, e.key === "begin" ? "catalogue.facet.startDate" : "catalogue.facet.endDate")), 1), _("input", {
|
|
1341
|
+
type: "number",
|
|
1342
|
+
class: "mwnf-facet__select",
|
|
1343
|
+
value: j(F)[e.key],
|
|
1344
|
+
placeholder: e.placeholder ? j(n)(e.placeholder) : j(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
|
|
1345
|
+
onInput: (t) => j(F)[e.key] = t.target.value
|
|
1346
|
+
}, null, 40, sn)]))], 64))), 128))]),
|
|
1347
|
+
_: 1
|
|
1348
|
+
}, 8, [
|
|
1349
|
+
"title",
|
|
1350
|
+
"apply-label",
|
|
1351
|
+
"reset-label"
|
|
1352
|
+
]),
|
|
1353
|
+
d.value && N.value ? (T(), g("p", cn, A(N.value), 1)) : h("", !0),
|
|
1354
|
+
d.value ? h("", !0) : (T(), g(f, { key: 2 }, [
|
|
1355
|
+
k(e.$slots, "summary", w(x(X.value)), () => [b(o, { parts: Z.value }, null, 8, ["parts"])]),
|
|
1356
|
+
J.value ? (T(), m(i, {
|
|
1357
|
+
key: 0,
|
|
1358
|
+
class: "mwnf-timeline__gallery",
|
|
1359
|
+
to: J.value.to
|
|
1360
|
+
}, {
|
|
1361
|
+
default: L(() => [k(e.$slots, "cross-link", w(x(X.value)), () => [y(A(J.value.label), 1), J.value.count == null ? h("", !0) : (T(), g(f, { key: 0 }, [y(" (" + A(J.value.count) + ")", 1)], 64))])]),
|
|
1362
|
+
_: 3
|
|
1363
|
+
}, 8, ["to"])) : h("", !0),
|
|
1364
|
+
k(e.$slots, "event", w(x(X.value)), () => [b(u, { events: re.value }, {
|
|
1365
|
+
empty: L(() => [k(e.$slots, "empty", w(x(X.value)), () => [y(A(ce.value), 1)])]),
|
|
1366
|
+
_: 3
|
|
1367
|
+
}, 8, ["events"])]),
|
|
1368
|
+
b(l, {
|
|
1369
|
+
"page-info": j(V),
|
|
1370
|
+
window: Q.value.window,
|
|
1371
|
+
jump: Q.value.jump,
|
|
1372
|
+
ends: Q.value.ends,
|
|
1373
|
+
onNavigate: j(P).goToPage
|
|
1374
|
+
}, null, 8, [
|
|
1375
|
+
"page-info",
|
|
1376
|
+
"window",
|
|
1377
|
+
"jump",
|
|
1378
|
+
"ends",
|
|
1379
|
+
"onNavigate"
|
|
1380
|
+
])
|
|
1381
|
+
], 64)),
|
|
1382
|
+
k(e.$slots, "after", w(x(X.value)))
|
|
1383
|
+
]));
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
//#endregion
|
|
1387
|
+
export { vt as a, jt as i, tn as n, ct as o, It as r, Ne as s, ln as t };
|