@museumwnf/viewer-layout 3.61.0 → 3.63.0

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