@museumwnf/viewer-layout 2.14.0 → 2.15.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.
@@ -1,1403 +0,0 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, getCurrentInstance as c, mergeProps as l, normalizeClass as u, onBeforeUnmount as d, openBlock as f, ref as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useId as y, useSlots as b, vModelSelect as x, vModelText as S, watch as C, withCtx as w, withDirectives as T, withKeys as E, withModifiers as D } from "vue";
2
- import { useI18n as O } from "@museumwnf/viewer-core/i18n";
3
- import { md as k, mdInline as A, searchGlossary as ee, sourceUrl as te } from "@museumwnf/viewer-core";
4
- import { useRoute as ne } from "vue-router";
5
- //#region src/content/SmartLink.vue
6
- var re = [
7
- "href",
8
- "target",
9
- "rel"
10
- ], j = {
11
- __name: "SmartLink",
12
- props: {
13
- to: {
14
- type: [String, Object],
15
- default: null
16
- },
17
- href: {
18
- type: String,
19
- default: ""
20
- },
21
- external: {
22
- type: Boolean,
23
- default: !1
24
- }
25
- },
26
- setup(e) {
27
- let r = e, a = c()?.appContext.components.RouterLink ?? null, o = t(() => !!(r.to && a)), s = t(() => r.href || (typeof r.to == "string" ? r.to : ""));
28
- return (t, r) => o.value ? (f(), n(g(v(a)), l({
29
- key: 0,
30
- to: e.to
31
- }, t.$attrs), {
32
- default: w(() => [h(t.$slots, "default")]),
33
- _: 3
34
- }, 16, ["to"])) : (f(), i("a", l({
35
- key: 1,
36
- href: s.value || void 0,
37
- target: e.external ? "_blank" : void 0,
38
- rel: e.external ? "noopener" : void 0
39
- }, t.$attrs), [h(t.$slots, "default")], 16, re));
40
- }
41
- }, ie = ["innerHTML"], M = ["innerHTML"], N = {
42
- key: 1,
43
- class: "mwnf-cards__action"
44
- }, P = {
45
- key: 0,
46
- class: "mwnf-cards__image-container"
47
- }, F = ["src", "alt"], I = { class: "mwnf-cards__content" }, L = {
48
- key: 0,
49
- class: "mwnf-cards__number"
50
- }, R = ["innerHTML"], z = ["innerHTML"], B = {
51
- key: 0,
52
- class: "mwnf-cards__image-container"
53
- }, V = ["src", "alt"], H = {
54
- key: 1,
55
- class: "mwnf-cards__number"
56
- }, U = ["innerHTML"], W = {
57
- key: 3,
58
- class: "mwnf-cards__details"
59
- }, G = { class: "mwnf-cards__summary" }, K = {
60
- key: 0,
61
- class: "mwnf-cards__number"
62
- }, q = ["innerHTML"], J = {
63
- key: 0,
64
- class: "mwnf-cards__children"
65
- }, Y = {
66
- __name: "SectionCards",
67
- props: {
68
- cards: {
69
- type: Array,
70
- default: () => []
71
- },
72
- variant: {
73
- type: String,
74
- default: "cards",
75
- validate: (e) => [
76
- "cards",
77
- "rows",
78
- "covers",
79
- "accordion"
80
- ].includes(e)
81
- }
82
- },
83
- setup(t) {
84
- return (c, l) => t.cards.length ? (f(), i("ul", {
85
- key: 0,
86
- class: u(["mwnf-cards", `mwnf-cards--${t.variant}`])
87
- }, [(f(!0), i(e, null, m(t.cards, (c) => (f(), i("li", {
88
- key: c.href ?? c.title,
89
- class: u(["mwnf-cards__card"])
90
- }, [t.variant === "cards" ? (f(), n(j, {
91
- key: 0,
92
- class: "mwnf-cards__link",
93
- to: c.to,
94
- href: c.href
95
- }, {
96
- default: w(() => [
97
- a("span", {
98
- class: "mwnf-cards__title",
99
- innerHTML: v(A)(c.title)
100
- }, null, 8, ie),
101
- c.description ? (f(), i("span", {
102
- key: 0,
103
- class: "mwnf-cards__text",
104
- innerHTML: v(A)(c.description)
105
- }, null, 8, M)) : r("", !0),
106
- c.action ? (f(), i("span", N, _(c.action) + " →", 1)) : r("", !0)
107
- ]),
108
- _: 2
109
- }, 1032, ["to", "href"])) : t.variant === "rows" ? (f(), n(j, {
110
- key: 1,
111
- class: "mwnf-cards__link",
112
- to: c.to,
113
- href: c.href
114
- }, {
115
- default: w(() => [c.image ? (f(), i("div", P, [a("img", {
116
- class: "mwnf-cards__image",
117
- src: c.image,
118
- alt: c.alt || ""
119
- }, null, 8, F)])) : r("", !0), a("div", I, [
120
- c.number ? (f(), i("span", L, _(c.number), 1)) : r("", !0),
121
- a("span", {
122
- class: "mwnf-cards__title",
123
- innerHTML: v(A)(c.title)
124
- }, null, 8, R),
125
- c.description ? (f(), i("span", {
126
- key: 1,
127
- class: "mwnf-cards__text",
128
- innerHTML: v(A)(c.description)
129
- }, null, 8, z)) : r("", !0)
130
- ])]),
131
- _: 2
132
- }, 1032, ["to", "href"])) : t.variant === "covers" ? (f(), n(j, {
133
- key: 2,
134
- class: "mwnf-cards__link",
135
- to: c.to,
136
- href: c.href
137
- }, {
138
- default: w(() => [
139
- c.image ? (f(), i("div", B, [a("img", {
140
- class: "mwnf-cards__image",
141
- src: c.image,
142
- alt: c.alt || ""
143
- }, null, 8, V)])) : r("", !0),
144
- c.number ? (f(), i("span", H, _(c.number), 1)) : r("", !0),
145
- a("span", {
146
- class: "mwnf-cards__title",
147
- innerHTML: v(A)(c.title)
148
- }, null, 8, U)
149
- ]),
150
- _: 2
151
- }, 1032, ["to", "href"])) : t.variant === "accordion" ? (f(), i("details", W, [a("summary", G, [c.number ? (f(), i("span", K, _(c.number), 1)) : r("", !0), a("span", {
152
- class: "mwnf-cards__title",
153
- innerHTML: v(A)(c.title)
154
- }, null, 8, q)]), c.children?.length ? (f(), i("ul", J, [(f(!0), i(e, null, m(c.children, (e) => (f(), i("li", {
155
- key: e.href ?? e.title,
156
- class: "mwnf-cards__child"
157
- }, [s(j, {
158
- class: "mwnf-cards__child-link",
159
- to: e.to,
160
- href: e.href
161
- }, {
162
- default: w(() => [o(_(e.title), 1)]),
163
- _: 2
164
- }, 1032, ["to", "href"])]))), 128))])) : r("", !0)])) : r("", !0)]))), 128))], 2)) : r("", !0);
165
- }
166
- }, ae = {
167
- key: 0,
168
- class: "mwnf-featured"
169
- }, oe = {
170
- key: 0,
171
- class: "mwnf-featured__heading"
172
- }, se = {
173
- key: 0,
174
- class: "mwnf-featured__media"
175
- }, ce = ["src", "alt"], le = { class: "mwnf-featured__body" }, ue = {
176
- key: 0,
177
- class: "mwnf-featured__eyebrow"
178
- }, de = ["innerHTML"], fe = {
179
- key: 1,
180
- class: "mwnf-featured__action"
181
- }, pe = {
182
- __name: "FeaturedRecord",
183
- props: {
184
- image: {
185
- type: String,
186
- default: ""
187
- },
188
- imageAlt: {
189
- type: String,
190
- default: ""
191
- },
192
- eyebrow: {
193
- type: String,
194
- default: ""
195
- },
196
- name: {
197
- type: String,
198
- default: ""
199
- },
200
- meta: {
201
- type: Array,
202
- default: () => []
203
- },
204
- action: {
205
- type: String,
206
- default: ""
207
- },
208
- to: {
209
- type: [String, Object],
210
- default: null
211
- },
212
- href: {
213
- type: String,
214
- default: ""
215
- },
216
- heading: {
217
- type: String,
218
- default: ""
219
- }
220
- },
221
- setup(n) {
222
- let o = n, c = b(), l = t(() => !!(o.name || o.image || c.default));
223
- return (t, o) => l.value ? (f(), i("section", ae, [n.heading ? (f(), i("h2", oe, _(n.heading), 1)) : r("", !0), h(t.$slots, "default", {}, () => [s(j, {
224
- class: "mwnf-featured__link",
225
- to: n.to,
226
- href: n.href
227
- }, {
228
- default: w(() => [n.image ? (f(), i("span", se, [a("img", {
229
- class: "mwnf-featured__image",
230
- src: n.image,
231
- alt: n.imageAlt,
232
- loading: "eager"
233
- }, null, 8, ce)])) : r("", !0), a("span", le, [
234
- n.eyebrow ? (f(), i("span", ue, _(n.eyebrow), 1)) : r("", !0),
235
- a("span", {
236
- class: "mwnf-featured__name",
237
- innerHTML: n.name
238
- }, null, 8, de),
239
- (f(!0), i(e, null, m(n.meta, (e, t) => (f(), i("span", {
240
- key: t,
241
- class: "mwnf-featured__meta"
242
- }, _(e), 1))), 128)),
243
- n.action ? (f(), i("span", fe, _(n.action) + " →", 1)) : r("", !0)
244
- ])]),
245
- _: 1
246
- }, 8, ["to", "href"])])])) : r("", !0);
247
- }
248
- }, me = ["aria-busy"], he = {
249
- key: 0,
250
- class: "mwnf-list__status"
251
- }, ge = {
252
- key: 1,
253
- class: "mwnf-list__rows"
254
- }, _e = { class: "mwnf-list__thumb" }, ve = ["src", "alt"], ye = { class: "mwnf-list__body" }, be = ["innerHTML"], xe = {
255
- key: 0,
256
- class: "mwnf-list__meta"
257
- }, Se = {
258
- key: 0,
259
- class: "mwnf-list__badge"
260
- }, Ce = {
261
- key: 2,
262
- class: "mwnf-list__empty"
263
- }, X = {
264
- __name: "RecordList",
265
- props: {
266
- records: {
267
- type: Array,
268
- default: () => []
269
- },
270
- loading: {
271
- type: Boolean,
272
- default: !1
273
- },
274
- loadingText: {
275
- type: String,
276
- default: ""
277
- }
278
- },
279
- setup(t) {
280
- let n = !!b().empty;
281
- return (o, c) => (f(), i("div", {
282
- class: u(["mwnf-list", { "mwnf-list--loading": t.loading }]),
283
- "aria-busy": t.loading ? "true" : void 0
284
- }, [t.loading && t.loadingText ? (f(), i("p", he, _(t.loadingText), 1)) : t.records.length ? (f(), i("ul", ge, [(f(!0), i(e, null, m(t.records, (t) => (f(), i("li", {
285
- key: t.id,
286
- class: "mwnf-list__row"
287
- }, [s(j, {
288
- class: "mwnf-list__link",
289
- to: t.to,
290
- href: t.href
291
- }, {
292
- default: w(() => [a("span", _e, [t.image ? (f(), i("img", {
293
- key: 0,
294
- src: t.image,
295
- alt: t.imageAlt ?? "",
296
- loading: "lazy"
297
- }, null, 8, ve)) : r("", !0)]), a("span", ye, [a("span", {
298
- class: "mwnf-list__name",
299
- innerHTML: t.name
300
- }, null, 8, be), t.meta?.length || t.badge ? (f(), i("span", xe, [(f(!0), i(e, null, m(t.meta ?? [], (e, t) => (f(), i("span", {
301
- key: t,
302
- class: "mwnf-list__meta-item"
303
- }, _(e), 1))), 128)), t.badge ? (f(), i("span", Se, _(t.badge), 1)) : r("", !0)])) : r("", !0)])]),
304
- _: 2
305
- }, 1032, ["to", "href"])]))), 128))])) : v(n) ? (f(), i("div", Ce, [h(o.$slots, "empty")])) : r("", !0)], 10, me));
306
- }
307
- }, we = ["aria-busy"], Te = {
308
- key: 0,
309
- class: "mwnf-grid__status"
310
- }, Ee = {
311
- key: 1,
312
- class: "mwnf-grid__tiles"
313
- }, De = ["onMouseenter", "onFocusin"], Oe = { class: "mwnf-grid__media" }, ke = ["src", "alt"], Ae = {
314
- key: 1,
315
- class: "mwnf-grid__image mwnf-grid__image--empty",
316
- "aria-hidden": "true"
317
- }, je = { class: "mwnf-grid__card" }, Me = ["src"], Ne = { class: "mwnf-grid__card-body" }, Pe = ["innerHTML"], Fe = {
318
- key: 0,
319
- class: "mwnf-grid__badge"
320
- }, Ie = {
321
- key: 2,
322
- class: "mwnf-grid__empty"
323
- }, Z = {
324
- __name: "RecordGrid",
325
- props: {
326
- records: {
327
- type: Array,
328
- default: () => []
329
- },
330
- loading: {
331
- type: Boolean,
332
- default: !1
333
- },
334
- loadingText: {
335
- type: String,
336
- default: ""
337
- },
338
- actionLabel: {
339
- type: String,
340
- default: ""
341
- },
342
- dateCutoff: {
343
- type: Number,
344
- default: 80
345
- }
346
- },
347
- setup(t) {
348
- let n = t, c = !!b().empty, l = p(null);
349
- function d(e) {
350
- let t = String(e ?? "");
351
- return t.length > n.dateCutoff ? `${t.slice(0, n.dateCutoff - 1)}[...]` : t;
352
- }
353
- return (n, p) => (f(), i("div", {
354
- class: u(["mwnf-grid", { "mwnf-grid--loading": t.loading }]),
355
- "aria-busy": t.loading ? "true" : void 0
356
- }, [t.loading && t.loadingText ? (f(), i("p", Te, _(t.loadingText), 1)) : t.records.length ? (f(), i("ul", Ee, [(f(!0), i(e, null, m(t.records, (n) => (f(), i("li", {
357
- key: n.id,
358
- class: u(["mwnf-grid__tile", { "mwnf-grid__tile--hover": l.value === n.id }]),
359
- onMouseenter: (e) => l.value = n.id,
360
- onMouseleave: p[0] ||= (e) => l.value = null,
361
- onFocusin: (e) => l.value = n.id,
362
- onFocusout: p[1] ||= (e) => l.value = null
363
- }, [a("span", Oe, [n.image ? (f(), i("img", {
364
- key: 0,
365
- class: "mwnf-grid__image",
366
- src: n.image,
367
- alt: n.imageAlt ?? "",
368
- loading: "lazy"
369
- }, null, 8, ke)) : (f(), i("span", Ae))]), a("div", je, [s(j, {
370
- class: "mwnf-grid__card-media",
371
- to: n.to,
372
- href: n.href,
373
- tabindex: "-1",
374
- "aria-hidden": "true"
375
- }, {
376
- default: w(() => [n.image ? (f(), i("img", {
377
- key: 0,
378
- src: n.image,
379
- alt: ""
380
- }, null, 8, Me)) : r("", !0)]),
381
- _: 2
382
- }, 1032, ["to", "href"]), a("div", Ne, [
383
- a("p", {
384
- class: "mwnf-grid__name",
385
- innerHTML: n.name
386
- }, null, 8, Pe),
387
- (f(!0), i(e, null, m(n.meta ?? [], (e, t) => (f(), i("p", {
388
- key: t,
389
- class: "mwnf-grid__meta"
390
- }, _(d(e)), 1))), 128)),
391
- n.badge ? (f(), i("p", Fe, _(n.badge), 1)) : r("", !0),
392
- s(j, {
393
- class: "mwnf-grid__action",
394
- to: n.to,
395
- href: n.href
396
- }, {
397
- default: w(() => [o(_(t.actionLabel || n.name.replace(/<[^>]+>/g, "")) + " › ", 1)]),
398
- _: 2
399
- }, 1032, ["to", "href"])
400
- ])])], 42, De))), 128))])) : v(c) ? (f(), i("div", Ie, [h(n.$slots, "empty")])) : r("", !0)], 10, we));
401
- }
402
- }, Le = ["aria-label"], Re = ["disabled"], ze = ["disabled"], Be = ["aria-current", "onClick"], Ve = ["disabled"], He = ["disabled"], Ue = { class: "mwnf-pagination__position" }, We = { class: "mwnf-pagination__jump" }, Ge = ["max"], Ke = {
403
- __name: "Pagination",
404
- props: {
405
- pageInfo: {
406
- type: Object,
407
- required: !0
408
- },
409
- window: {
410
- type: Number,
411
- default: 5
412
- },
413
- jump: {
414
- type: Boolean,
415
- default: !1
416
- },
417
- ends: {
418
- type: Boolean,
419
- default: !0
420
- }
421
- },
422
- emits: ["navigate"],
423
- setup(n, { emit: s }) {
424
- let c = n, l = s, { t: d } = O(), h = t(() => c.pageInfo?.currentPage ?? 1), g = t(() => c.pageInfo?.lastPage ?? 1), y = t(() => {
425
- let e = Math.max(1, c.window), t = Math.max(1, h.value - Math.floor(e / 2)), n = Math.min(g.value, t + e - 1);
426
- t = Math.max(1, n - e + 1);
427
- let r = [];
428
- for (let e = t; e <= n; e++) r.push(e);
429
- return r;
430
- }), b = p(String(h.value));
431
- C(h, (e) => {
432
- b.value = String(e);
433
- });
434
- function x(e) {
435
- let t = Math.min(Math.max(1, Number.parseInt(e, 10) || 1), g.value);
436
- t !== h.value && l("navigate", t);
437
- }
438
- return (t, s) => g.value > 1 ? (f(), i("nav", {
439
- key: 0,
440
- class: "mwnf-pagination",
441
- "aria-label": v(d)("catalogue.pagination.page")
442
- }, [
443
- n.ends ? (f(), i("button", {
444
- key: 0,
445
- type: "button",
446
- class: "mwnf-pagination__button",
447
- disabled: h.value === 1,
448
- onClick: s[0] ||= (e) => x(1)
449
- }, " « " + _(v(d)("catalogue.pagination.first")), 9, Re)) : r("", !0),
450
- a("button", {
451
- type: "button",
452
- class: "mwnf-pagination__button",
453
- disabled: h.value === 1,
454
- onClick: s[1] ||= (e) => x(h.value - 1)
455
- }, " ‹ " + _(v(d)("core.pagination.previous")), 9, ze),
456
- (f(!0), i(e, null, m(y.value, (e) => (f(), i("button", {
457
- key: e,
458
- type: "button",
459
- class: u(["mwnf-pagination__button mwnf-pagination__number", { "mwnf-pagination__button--active": e === h.value }]),
460
- "aria-current": e === h.value ? "page" : void 0,
461
- onClick: (t) => x(e)
462
- }, _(e), 11, Be))), 128)),
463
- a("button", {
464
- type: "button",
465
- class: "mwnf-pagination__button",
466
- disabled: h.value === g.value,
467
- onClick: s[2] ||= (e) => x(h.value + 1)
468
- }, _(v(d)("core.pagination.next")) + " › ", 9, Ve),
469
- n.ends ? (f(), i("button", {
470
- key: 1,
471
- type: "button",
472
- class: "mwnf-pagination__button",
473
- disabled: h.value === g.value,
474
- onClick: s[3] ||= (e) => x(g.value)
475
- }, _(v(d)("catalogue.pagination.last")) + " » ", 9, He)) : r("", !0),
476
- a("span", Ue, [n.jump ? (f(), i(e, { key: 0 }, [
477
- a("label", We, [a("span", null, _(v(d)("catalogue.pagination.page")), 1), T(a("input", {
478
- "onUpdate:modelValue": s[4] ||= (e) => b.value = e,
479
- class: "mwnf-pagination__jump-field",
480
- type: "number",
481
- min: "1",
482
- max: g.value,
483
- onKeyup: s[5] ||= E((e) => x(b.value), ["enter"])
484
- }, null, 40, Ge), [[S, b.value]])]),
485
- a("span", null, "/ " + _(g.value), 1),
486
- a("button", {
487
- type: "button",
488
- class: "mwnf-pagination__button",
489
- onClick: s[6] ||= (e) => x(b.value)
490
- }, _(v(d)("catalogue.pagination.go")), 1)
491
- ], 64)) : (f(), i(e, { key: 1 }, [o(_(h.value) + " / " + _(g.value), 1)], 64))])
492
- ], 8, Le)) : r("", !0);
493
- }
494
- }, qe = ["for"], Je = {
495
- key: 0,
496
- class: "mwnf-facet__label"
497
- }, Ye = [
498
- "id",
499
- "value",
500
- "disabled"
501
- ], Xe = {
502
- key: 0,
503
- value: "",
504
- disabled: ""
505
- }, Ze = {
506
- key: 1,
507
- value: ""
508
- }, Qe = ["value"], $e = {
509
- __name: "FacetSelect",
510
- props: {
511
- label: {
512
- type: String,
513
- default: ""
514
- },
515
- options: {
516
- type: Array,
517
- default: () => []
518
- },
519
- modelValue: {
520
- type: [String, Number],
521
- default: ""
522
- },
523
- placeholder: {
524
- type: String,
525
- default: ""
526
- },
527
- anyLabel: {
528
- type: String,
529
- default: ""
530
- },
531
- disabled: {
532
- type: Boolean,
533
- default: !1
534
- },
535
- hideEmpty: {
536
- type: Boolean,
537
- default: !1
538
- }
539
- },
540
- emits: ["update:modelValue"],
541
- setup(n, { emit: o }) {
542
- let s = n, c = o, l = y(), u = t(() => !s.hideEmpty || s.options.length > 0);
543
- return (t, o) => u.value ? (f(), i("label", {
544
- key: 0,
545
- class: "mwnf-facet",
546
- for: v(l)
547
- }, [n.label ? (f(), i("span", Je, _(n.label), 1)) : r("", !0), a("select", {
548
- id: v(l),
549
- class: "mwnf-facet__select",
550
- value: String(n.modelValue ?? ""),
551
- disabled: n.disabled,
552
- onChange: o[0] ||= (e) => c("update:modelValue", e.target.value)
553
- }, [
554
- n.placeholder ? (f(), i("option", Xe, _(n.placeholder), 1)) : r("", !0),
555
- n.anyLabel ? (f(), i("option", Ze, _(n.anyLabel), 1)) : r("", !0),
556
- (f(!0), i(e, null, m(n.options, (e) => (f(), i("option", {
557
- key: e.value,
558
- value: String(e.value)
559
- }, _(e.label), 9, Qe))), 128))
560
- ], 40, Ye)], 8, qe)) : r("", !0);
561
- }
562
- }, et = {
563
- key: 0,
564
- class: "mwnf-filter__title"
565
- }, tt = ["disabled"], nt = { class: "mwnf-filter__actions" }, rt = {
566
- key: 0,
567
- type: "submit",
568
- class: "mwnf-filter__button mwnf-filter__button--apply"
569
- }, it = {
570
- __name: "FilterPanel",
571
- props: {
572
- title: {
573
- type: String,
574
- default: ""
575
- },
576
- mode: {
577
- type: String,
578
- default: "apply"
579
- },
580
- applyLabel: {
581
- type: String,
582
- default: ""
583
- },
584
- resetLabel: {
585
- type: String,
586
- default: ""
587
- },
588
- disabled: {
589
- type: Boolean,
590
- default: !1
591
- }
592
- },
593
- emits: ["apply", "reset"],
594
- setup(e, { emit: t }) {
595
- let n = t, { t: o } = O();
596
- return (t, s) => (f(), i("form", {
597
- class: u(["mwnf-filter", `mwnf-filter--${e.mode}`]),
598
- onSubmit: s[1] ||= D((e) => n("apply"), ["prevent"])
599
- }, [
600
- e.title ? (f(), i("p", et, _(e.title), 1)) : r("", !0),
601
- a("fieldset", {
602
- class: "mwnf-filter__controls",
603
- disabled: e.disabled
604
- }, [h(t.$slots, "default")], 8, tt),
605
- a("div", nt, [e.mode === "apply" ? (f(), i("button", rt, _(e.applyLabel || v(o)("core.action.apply")), 1)) : r("", !0), a("button", {
606
- type: "button",
607
- class: "mwnf-filter__button mwnf-filter__button--reset",
608
- onClick: s[0] ||= (e) => n("reset")
609
- }, _(e.resetLabel || v(o)("core.action.reset")), 1)])
610
- ], 34));
611
- }
612
- }, at = {
613
- key: 0,
614
- class: "mwnf-summary"
615
- }, ot = {
616
- key: 0,
617
- class: "mwnf-summary__parts"
618
- }, st = {
619
- key: 0,
620
- class: "mwnf-summary__label"
621
- }, ct = {
622
- key: 1,
623
- class: "mwnf-summary__count"
624
- }, lt = {
625
- key: 2,
626
- class: "mwnf-summary__value"
627
- }, ut = {
628
- key: 1,
629
- class: "mwnf-summary__actions"
630
- }, dt = {
631
- __name: "ResultsSummary",
632
- props: { parts: {
633
- type: Array,
634
- default: () => []
635
- } },
636
- setup(t) {
637
- let n = !!b().actions;
638
- return (a, s) => t.parts.length || a.$slots.default || v(n) ? (f(), i("div", at, [
639
- t.parts.length ? (f(), i("p", ot, [(f(!0), i(e, null, m(t.parts, (e, t) => (f(), i("span", {
640
- key: t,
641
- class: "mwnf-summary__part"
642
- }, [
643
- e.label ? (f(), i("span", st, _(e.label), 1)) : r("", !0),
644
- s[0] ||= o(_(" "), -1),
645
- e.count == null ? r("", !0) : (f(), i("span", ct, _(e.count), 1)),
646
- s[1] ||= o(_(" "), -1),
647
- e.value ? (f(), i("span", lt, _(e.value), 1)) : r("", !0)
648
- ]))), 128))])) : r("", !0),
649
- h(a.$slots, "default"),
650
- v(n) ? (f(), i("div", ut, [h(a.$slots, "actions")])) : r("", !0)
651
- ])) : r("", !0);
652
- }
653
- }, ft = ["aria-label"], pt = [
654
- "aria-pressed",
655
- "lang",
656
- "onClick"
657
- ], mt = {
658
- __name: "RecordLanguages",
659
- props: {
660
- languages: {
661
- type: Array,
662
- default: () => []
663
- },
664
- language: {
665
- type: String,
666
- default: ""
667
- }
668
- },
669
- emits: ["select"],
670
- setup(n, { emit: a }) {
671
- let o = n, s = a, { t: c } = O(), l = t(() => o.languages.map((e) => typeof e == "string" ? {
672
- code: e,
673
- label: e.toUpperCase()
674
- } : e));
675
- return (t, a) => l.value.length > 1 ? (f(), i("div", {
676
- key: 0,
677
- class: "mwnf-languages",
678
- role: "group",
679
- "aria-label": v(c)("record.sheet.languages")
680
- }, [(f(!0), i(e, null, m(l.value, (e) => (f(), i("button", {
681
- key: e.code,
682
- type: "button",
683
- class: u(["mwnf-languages__button", { "mwnf-languages__button--active": e.code === n.language }]),
684
- "aria-pressed": e.code === n.language ? "true" : "false",
685
- lang: e.code,
686
- onClick: (t) => s("select", e.code)
687
- }, _(e.label), 11, pt))), 128))], 8, ft)) : r("", !0);
688
- }
689
- }, ht = ["dir"], gt = { key: 0 }, _t = {
690
- class: "mwnf-sheet__label",
691
- scope: "row"
692
- }, vt = { class: "mwnf-sheet__value" }, yt = ["href"], bt = ["innerHTML"], xt = {
693
- key: 0,
694
- class: "mwnf-sheet__row mwnf-sheet__row--short"
695
- }, St = {
696
- class: "mwnf-sheet__label",
697
- scope: "row"
698
- }, Ct = ["aria-expanded"], wt = { class: "mwnf-sheet__value" }, Tt = ["innerHTML"], Et = { class: "mwnf-sheet__value" }, Dt = ["href"], Ot = ["innerHTML"], kt = { class: "mwnf-sheet__label mwnf-sheet__label--short" }, At = ["aria-expanded"], jt = { class: "mwnf-sheet__value" }, Mt = ["innerHTML"], Nt = {
699
- __name: "RecordSheet",
700
- props: {
701
- rows: {
702
- type: Array,
703
- default: () => []
704
- },
705
- layout: {
706
- type: String,
707
- default: "table"
708
- },
709
- dir: {
710
- type: String,
711
- default: ""
712
- },
713
- shortDescription: {
714
- type: Object,
715
- default: null
716
- },
717
- shortDescriptionAfter: {
718
- type: String,
719
- default: "description"
720
- },
721
- shortDescriptionOpen: {
722
- type: Boolean,
723
- default: !1
724
- }
725
- },
726
- setup(t) {
727
- let o = t, { t: s } = O(), c = p(o.shortDescriptionOpen);
728
- C(() => o.shortDescription, () => {
729
- c.value = o.shortDescriptionOpen;
730
- });
731
- let l = (e) => e.render === "custom" || e.render === "link";
732
- return (o, d) => (f(), i("div", {
733
- class: u(["mwnf-sheet", `mwnf-sheet--${t.layout}`]),
734
- dir: t.dir || void 0
735
- }, [(f(), n(g(t.layout === "list" ? "dl" : "table"), { class: "mwnf-sheet__rows" }, {
736
- default: w(() => [t.layout === "list" ? (f(!0), i(e, { key: 1 }, m(t.rows, (n) => (f(), i(e, { key: n.key }, [
737
- a("dt", { class: u(["mwnf-sheet__label", `mwnf-sheet__label--${n.key}`]) }, _(n.label), 3),
738
- a("dd", Et, [l(n) ? h(o.$slots, n.key, { row: n }, () => [n.render === "link" ? (f(), i("a", {
739
- key: 0,
740
- href: n.value,
741
- target: "_blank",
742
- rel: "noopener"
743
- }, _(n.value), 9, Dt)) : r("", !0)], void 0, 0) : (f(), i("span", {
744
- key: 1,
745
- class: u(`mwnf-sheet__${n.render}`),
746
- innerHTML: n.html
747
- }, null, 10, Ot))]),
748
- t.shortDescription && n.key === t.shortDescriptionAfter ? (f(), i(e, { key: 0 }, [a("dt", kt, [a("button", {
749
- type: "button",
750
- class: "mwnf-sheet__toggle",
751
- "aria-expanded": c.value ? "true" : "false",
752
- onClick: d[1] ||= (e) => c.value = !c.value
753
- }, _(c.value ? v(s)("record.action.hideShortDescription") : v(s)("record.action.viewShortDescription")), 9, At)]), a("dd", jt, [c.value ? (f(), i("div", {
754
- key: 0,
755
- class: "mwnf-sheet__block",
756
- innerHTML: t.shortDescription.html
757
- }, null, 8, Mt)) : r("", !0)])], 64)) : r("", !0)
758
- ], 64))), 128)) : (f(), i("tbody", gt, [(f(!0), i(e, null, m(t.rows, (n) => (f(), i(e, { key: n.key }, [a("tr", { class: u(["mwnf-sheet__row", `mwnf-sheet__row--${n.key}`]) }, [a("th", _t, _(n.label), 1), a("td", vt, [l(n) ? h(o.$slots, n.key, { row: n }, () => [n.render === "link" ? (f(), i("a", {
759
- key: 0,
760
- href: n.value,
761
- target: "_blank",
762
- rel: "noopener"
763
- }, _(n.value), 9, yt)) : r("", !0)], void 0, 0) : (f(), i("span", {
764
- key: 1,
765
- class: u(`mwnf-sheet__${n.render}`),
766
- innerHTML: n.html
767
- }, null, 10, bt))])], 2), t.shortDescription && n.key === t.shortDescriptionAfter ? (f(), i("tr", xt, [a("th", St, [a("button", {
768
- type: "button",
769
- class: "mwnf-sheet__toggle",
770
- "aria-expanded": c.value ? "true" : "false",
771
- onClick: d[0] ||= (e) => c.value = !c.value
772
- }, _(c.value ? v(s)("record.action.hideShortDescription") : v(s)("record.action.viewShortDescription")), 9, Ct)]), a("td", wt, [c.value ? (f(), i("div", {
773
- key: 0,
774
- class: "mwnf-sheet__block",
775
- innerHTML: t.shortDescription.html
776
- }, null, 8, Tt)) : r("", !0)])])) : r("", !0)], 64))), 128))]))]),
777
- _: 3
778
- }))], 10, ht));
779
- }
780
- }, Pt = ["dir"], Ft = {
781
- key: 0,
782
- class: "mwnf-sheet-section__heading"
783
- }, It = ["innerHTML"], Lt = {
784
- __name: "SheetSection",
785
- props: {
786
- heading: {
787
- type: String,
788
- default: ""
789
- },
790
- html: {
791
- type: String,
792
- default: ""
793
- },
794
- dir: {
795
- type: String,
796
- default: ""
797
- }
798
- },
799
- setup(e) {
800
- return (t, n) => (f(), i("section", {
801
- class: "mwnf-sheet-section",
802
- dir: e.dir || void 0
803
- }, [
804
- e.heading ? (f(), i("h2", Ft, _(e.heading), 1)) : r("", !0),
805
- e.html ? (f(), i("div", {
806
- key: 1,
807
- class: "mwnf-sheet-section__body mwnf-sheet__block",
808
- innerHTML: e.html
809
- }, null, 8, It)) : r("", !0),
810
- h(t.$slots, "default")
811
- ], 8, Pt));
812
- }
813
- }, Rt = {
814
- key: 0,
815
- class: "mwnf-credits"
816
- }, zt = {
817
- key: 0,
818
- class: "mwnf-credits__heading"
819
- }, Bt = {
820
- key: 1,
821
- class: "mwnf-credits__list"
822
- }, Vt = { class: "mwnf-credits__label" }, Ht = { class: "mwnf-credits__value" }, Ut = {
823
- key: 2,
824
- class: "mwnf-credits__number"
825
- }, Wt = {
826
- key: 0,
827
- class: "mwnf-credits__label"
828
- }, Gt = { class: "mwnf-credits__heading" }, Kt = { class: "mwnf-credits__citation" }, qt = {
829
- __name: "RecordCredits",
830
- props: {
831
- credits: {
832
- type: Array,
833
- default: () => []
834
- },
835
- workingNumber: {
836
- type: String,
837
- default: ""
838
- },
839
- workingNumberLabel: {
840
- type: String,
841
- default: ""
842
- },
843
- citation: {
844
- type: String,
845
- default: ""
846
- },
847
- heading: {
848
- type: String,
849
- default: ""
850
- },
851
- citationHeading: {
852
- type: String,
853
- default: ""
854
- }
855
- },
856
- setup(n) {
857
- let o = n, { t: s } = O(), c = t(() => o.credits.length > 0 || o.workingNumber || o.citation);
858
- return (t, o) => c.value ? (f(), i("section", Rt, [
859
- n.credits.length || n.workingNumber ? (f(), i("h2", zt, _(n.heading || v(s)("record.sheet.credits")), 1)) : r("", !0),
860
- n.credits.length ? (f(), i("dl", Bt, [(f(!0), i(e, null, m(n.credits, (t) => (f(), i(e, { key: t.label }, [a("dt", Vt, _(t.label), 1), a("dd", Ht, _(t.value), 1)], 64))), 128))])) : r("", !0),
861
- n.workingNumber ? (f(), i("p", Ut, [n.workingNumberLabel ? (f(), i("span", Wt, _(n.workingNumberLabel), 1)) : r("", !0), a("strong", null, _(n.workingNumber), 1)])) : r("", !0),
862
- n.citation ? (f(), i(e, { key: 3 }, [a("h2", Gt, _(n.citationHeading || v(s)("record.citation.heading")), 1), a("p", Kt, _(n.citation), 1)], 64)) : r("", !0)
863
- ])) : r("", !0);
864
- }
865
- }, Jt = {
866
- key: 0,
867
- class: "mwnf-source-credit"
868
- }, Yt = { class: "mwnf-source-credit__label" }, Xt = ["href"], Zt = {
869
- __name: "SourceCredit",
870
- props: {
871
- route: {
872
- type: [Object, String],
873
- default: null
874
- },
875
- labelEntry: {
876
- type: String,
877
- default: "record.source.label"
878
- }
879
- },
880
- setup(e) {
881
- let n = e, { t: s } = O(), c = ne(), l = t(() => te(n.route ?? c));
882
- return (t, n) => l.value ? (f(), i("p", Jt, [
883
- a("span", Yt, _(v(s)(e.labelEntry)), 1),
884
- n[0] ||= o(),
885
- a("a", { href: l.value }, _(l.value), 9, Xt)
886
- ])) : r("", !0);
887
- }
888
- }, Qt = {
889
- key: 0,
890
- class: "mwnf-related"
891
- }, $t = {
892
- key: 0,
893
- class: "mwnf-related__heading"
894
- }, en = {
895
- __name: "RelatedRecords",
896
- props: {
897
- heading: {
898
- type: String,
899
- default: ""
900
- },
901
- records: {
902
- type: Array,
903
- default: () => []
904
- },
905
- variant: {
906
- type: String,
907
- default: "list"
908
- },
909
- actionLabel: {
910
- type: String,
911
- default: ""
912
- }
913
- },
914
- setup(e) {
915
- return (t, a) => e.records.length || t.$slots.default ? (f(), i("section", Qt, [
916
- e.heading ? (f(), i("h2", $t, _(e.heading), 1)) : r("", !0),
917
- e.variant === "grid" ? (f(), n(Z, {
918
- key: 1,
919
- records: e.records,
920
- "action-label": e.actionLabel
921
- }, null, 8, ["records", "action-label"])) : (f(), n(X, {
922
- key: 2,
923
- records: e.records
924
- }, null, 8, ["records"])),
925
- h(t.$slots, "default")
926
- ])) : r("", !0);
927
- }
928
- }, tn = ["src", "alt"], nn = {
929
- key: 0,
930
- class: "mwnf-media__caption"
931
- }, rn = { key: 0 }, an = {
932
- key: 1,
933
- class: "mwnf-media__credit"
934
- }, on = {
935
- key: 2,
936
- class: "mwnf-media__credit"
937
- }, sn = ["src", "alt"], cn = {
938
- key: 0,
939
- class: "mwnf-media__thumbs"
940
- }, ln = [
941
- "aria-pressed",
942
- "title",
943
- "onClick"
944
- ], un = ["src", "alt"], dn = {
945
- key: 1,
946
- class: "mwnf-media__caption"
947
- }, fn = { key: 0 }, pn = {
948
- key: 1,
949
- class: "mwnf-media__credit"
950
- }, mn = ["aria-label"], hn = ["aria-label"], gn = ["src", "alt"], _n = ["aria-label"], vn = {
951
- __name: "MediaGallery",
952
- props: {
953
- images: {
954
- type: Array,
955
- default: () => []
956
- },
957
- start: {
958
- type: Number,
959
- default: 0
960
- },
961
- variant: {
962
- type: String,
963
- default: ""
964
- }
965
- },
966
- setup(n) {
967
- let o = n, { t: s } = O(), c = p(Math.min(o.start, Math.max(0, o.images.length - 1)));
968
- C(() => o.images, () => {
969
- c.value = 0;
970
- });
971
- let l = t(() => o.images[c.value] ?? null), h = t(() => {
972
- let e = [];
973
- return l.value?.photographer && e.push(`${s("record.media.photograph")}: ${l.value.photographer}`), l.value?.copyright && e.push(`© ${l.value.copyright}`), e.join(" — ");
974
- }), g = p(!1), y = null, b = p(null);
975
- function x(e) {
976
- c.value = (e + o.images.length) % o.images.length;
977
- }
978
- function S() {
979
- l.value && (y = document.activeElement, g.value = !0, document.addEventListener("keydown", T), requestAnimationFrame(() => b.value?.focus?.()));
980
- }
981
- function w() {
982
- g.value = !1, document.removeEventListener("keydown", T), y?.focus?.(), y = null;
983
- }
984
- function T(e) {
985
- e.key === "Escape" ? w() : e.key === "ArrowRight" ? x(c.value + 1) : e.key === "ArrowLeft" && x(c.value - 1);
986
- }
987
- return d(() => document.removeEventListener("keydown", T)), (t, o) => n.images.length ? (f(), i("div", {
988
- key: 0,
989
- class: u(["mwnf-media", n.variant ? `mwnf-media--${n.variant}` : ""])
990
- }, [n.variant === "row" ? (f(!0), i(e, { key: 0 }, m(n.images, (e, t) => (f(), i("figure", {
991
- key: e.url ?? t,
992
- class: "mwnf-media__figure"
993
- }, [a("img", {
994
- class: "mwnf-media__image",
995
- src: e.url,
996
- alt: e.alt ?? "",
997
- loading: "lazy"
998
- }, null, 8, tn), e.caption || e.photographer || e.copyright ? (f(), i("figcaption", nn, [
999
- e.caption ? (f(), i("span", rn, _(e.caption), 1)) : r("", !0),
1000
- e.photographer ? (f(), i("span", an, _(v(s)("record.media.photograph")) + ": " + _(e.photographer), 1)) : r("", !0),
1001
- e.copyright ? (f(), i("span", on, "© " + _(e.copyright), 1)) : r("", !0)
1002
- ])) : r("", !0)]))), 128)) : (f(), i(e, { key: 1 }, [
1003
- a("button", {
1004
- type: "button",
1005
- class: "mwnf-media__main",
1006
- onClick: S
1007
- }, [a("img", {
1008
- class: "mwnf-media__image",
1009
- src: l.value.url,
1010
- alt: l.value.alt ?? ""
1011
- }, null, 8, sn)]),
1012
- n.images.length > 1 ? (f(), i("ul", cn, [(f(!0), i(e, null, m(n.images, (e, t) => (f(), i("li", { key: e.url ?? t }, [a("button", {
1013
- type: "button",
1014
- class: u(["mwnf-media__thumb", { "mwnf-media__thumb--active": t === c.value }]),
1015
- "aria-pressed": t === c.value ? "true" : "false",
1016
- title: [e.photographer, e.copyright].filter(Boolean).join(" — ") || void 0,
1017
- onClick: (e) => x(t)
1018
- }, [a("img", {
1019
- src: e.url,
1020
- alt: e.alt ?? "",
1021
- loading: "lazy"
1022
- }, null, 8, un)], 10, ln)]))), 128))])) : r("", !0),
1023
- l.value.caption || h.value ? (f(), i("p", dn, [l.value.caption ? (f(), i("span", fn, _(l.value.caption), 1)) : r("", !0), h.value ? (f(), i("span", pn, _(h.value), 1)) : r("", !0)])) : r("", !0),
1024
- g.value ? (f(), i("div", {
1025
- key: 2,
1026
- class: "mwnf-lightbox",
1027
- role: "dialog",
1028
- "aria-modal": "true",
1029
- onClick: D(w, ["self"])
1030
- }, [
1031
- a("button", {
1032
- ref_key: "closeButton",
1033
- ref: b,
1034
- type: "button",
1035
- class: "mwnf-lightbox__close",
1036
- "aria-label": v(s)("core.action.close"),
1037
- onClick: w
1038
- }, "✕", 8, mn),
1039
- n.images.length > 1 ? (f(), i("button", {
1040
- key: 0,
1041
- type: "button",
1042
- class: "mwnf-lightbox__control mwnf-lightbox__control--previous",
1043
- "aria-label": v(s)("core.pagination.previous"),
1044
- onClick: o[0] ||= D((e) => x(c.value - 1), ["stop"])
1045
- }, "‹", 8, hn)) : r("", !0),
1046
- a("img", {
1047
- class: "mwnf-lightbox__image",
1048
- src: l.value.url,
1049
- alt: l.value.alt ?? ""
1050
- }, null, 8, gn),
1051
- n.images.length > 1 ? (f(), i("button", {
1052
- key: 1,
1053
- type: "button",
1054
- class: "mwnf-lightbox__control mwnf-lightbox__control--next",
1055
- "aria-label": v(s)("core.pagination.next"),
1056
- onClick: o[1] ||= D((e) => x(c.value + 1), ["stop"])
1057
- }, "›", 8, _n)) : r("", !0)
1058
- ])) : r("", !0)
1059
- ], 64))], 2)) : r("", !0);
1060
- }
1061
- }, yn = ["aria-label", "dir"], bn = { class: "mwnf-popover__title" }, xn = ["aria-label"], Sn = { class: "mwnf-popover__body" }, Cn = { class: "mwnf-popover__term" }, wn = ["innerHTML"], Tn = {
1062
- key: 1,
1063
- class: "mwnf-popover__definition"
1064
- }, En = {
1065
- __name: "GlossaryPopover",
1066
- props: {
1067
- term: {
1068
- type: Object,
1069
- default: null
1070
- },
1071
- html: {
1072
- type: String,
1073
- default: ""
1074
- },
1075
- dir: {
1076
- type: String,
1077
- default: ""
1078
- }
1079
- },
1080
- emits: ["close"],
1081
- setup(e, { emit: t }) {
1082
- let n = e, o = t, { t: s } = O(), c = p(null), l = null;
1083
- function u() {
1084
- o("close");
1085
- }
1086
- function m(e) {
1087
- e.key === "Escape" && u();
1088
- }
1089
- return C(() => n.term, (e, t) => {
1090
- e && !t ? (l = document.activeElement, document.addEventListener("keydown", m), requestAnimationFrame(() => c.value?.focus?.())) : !e && t && (document.removeEventListener("keydown", m), l?.focus?.(), l = null);
1091
- }, { immediate: !0 }), d(() => document.removeEventListener("keydown", m)), (t, n) => e.term ? (f(), i("aside", {
1092
- key: 0,
1093
- class: "mwnf-popover",
1094
- role: "dialog",
1095
- "aria-label": v(s)("record.glossary.heading"),
1096
- dir: e.dir || void 0
1097
- }, [a("div", bn, [a("span", null, _(v(s)("record.glossary.heading")), 1), a("button", {
1098
- ref_key: "closeButton",
1099
- ref: c,
1100
- type: "button",
1101
- class: "mwnf-popover__close",
1102
- "aria-label": v(s)("record.glossary.close"),
1103
- onClick: u
1104
- }, "✕", 8, xn)]), a("div", Sn, [a("p", Cn, _(e.term.spelling || e.term.word), 1), e.html ? (f(), i("div", {
1105
- key: 0,
1106
- class: "mwnf-popover__definition mwnf-sheet__block",
1107
- innerHTML: e.html
1108
- }, null, 8, wn)) : e.term.definition ? (f(), i("p", Tn, _(e.term.definition), 1)) : r("", !0)])], 8, yn)) : r("", !0);
1109
- }
1110
- }, Dn = ["dir"], On = { class: "mwnf-glossary-tool__toggle" }, kn = { class: "mwnf-glossary-tool__panel" }, An = { class: "mwnf-glossary-tool__heading" }, jn = { class: "mwnf-glossary-tool__instructions" }, Mn = ["aria-expanded", "aria-label"], Nn = {
1111
- key: 0,
1112
- class: "mwnf-glossary-tool__hits",
1113
- role: "listbox"
1114
- }, Pn = [
1115
- "aria-selected",
1116
- "onClick",
1117
- "onKeydown"
1118
- ], Fn = {
1119
- key: 1,
1120
- class: "mwnf-glossary-tool__no-results"
1121
- }, In = {
1122
- key: 2,
1123
- class: "mwnf-glossary-tool__definition"
1124
- }, Ln = { class: "mwnf-glossary-tool__definition-label" }, Rn = ["innerHTML"], zn = {
1125
- __name: "GlossaryTool",
1126
- props: {
1127
- language: {
1128
- type: String,
1129
- default: ""
1130
- },
1131
- entity: {
1132
- type: String,
1133
- default: "glossary"
1134
- },
1135
- labels: {
1136
- type: Object,
1137
- default: () => ({})
1138
- },
1139
- dir: {
1140
- type: String,
1141
- default: ""
1142
- }
1143
- },
1144
- setup(n) {
1145
- let o = n, s = {
1146
- tool: "record.glossary.tool",
1147
- heading: "record.glossary.heading",
1148
- instructions: "record.glossary.instructions",
1149
- definition: "record.glossary.definition",
1150
- close: "record.glossary.close",
1151
- ...o.labels
1152
- }, { t: c } = O(), l = p(""), d = p(null), h = p(-1), g = t(() => l.value.trim() ? ee(l.value, o.language, { entity: o.entity }) : []), y = t(() => g.value.length > 0 && !d.value), b = t(() => d.value ? k(d.value.definition) : ""), x = t(() => s.noResults ? c(s.noResults) : ""), C = t(() => !!x.value && l.value.trim() && !d.value && g.value.length === 0);
1153
- function w() {
1154
- d.value = null, h.value = -1;
1155
- }
1156
- function D(e) {
1157
- d.value = e, l.value = e.spelling, h.value = -1;
1158
- }
1159
- function A(e) {
1160
- y.value && (e.key === "ArrowDown" ? (e.preventDefault(), h.value = (h.value + 1) % g.value.length) : e.key === "ArrowUp" ? (e.preventDefault(), h.value = (h.value - 1 + g.value.length) % g.value.length) : e.key === "Enter" && h.value >= 0 ? (e.preventDefault(), D(g.value[h.value])) : e.key === "Escape" && (h.value = -1));
1161
- }
1162
- return (t, o) => (f(), i("details", {
1163
- class: "mwnf-glossary-tool",
1164
- dir: n.dir || void 0
1165
- }, [a("summary", On, _(v(c)(s.tool)), 1), a("div", kn, [
1166
- a("p", An, _(v(c)(s.heading)), 1),
1167
- a("p", jn, _(v(c)(s.instructions)), 1),
1168
- T(a("input", {
1169
- "onUpdate:modelValue": o[0] ||= (e) => l.value = e,
1170
- type: "text",
1171
- class: "mwnf-glossary-tool__input",
1172
- role: "combobox",
1173
- "aria-autocomplete": "list",
1174
- "aria-expanded": y.value,
1175
- "aria-label": v(c)(s.heading),
1176
- onInput: w,
1177
- onKeydown: A
1178
- }, null, 40, Mn), [[S, l.value]]),
1179
- y.value ? (f(), i("ul", Nn, [(f(!0), i(e, null, m(g.value, (e, t) => (f(), i("li", {
1180
- key: e.id,
1181
- role: "option",
1182
- "aria-selected": t === h.value,
1183
- tabindex: "0",
1184
- class: u(["mwnf-glossary-tool__hit", { "mwnf-glossary-tool__hit--active": t === h.value }]),
1185
- onClick: (t) => D(e),
1186
- onKeydown: E((t) => D(e), ["enter"])
1187
- }, _(e.spelling), 43, Pn))), 128))])) : C.value ? (f(), i("p", Fn, _(x.value), 1)) : r("", !0),
1188
- d.value ? (f(), i("div", In, [a("p", Ln, _(v(c)(s.definition)), 1), a("div", {
1189
- class: "mwnf-sheet__block",
1190
- innerHTML: b.value
1191
- }, null, 8, Rn)])) : r("", !0)
1192
- ])], 8, Dn));
1193
- }
1194
- }, Bn = ["dir"], Vn = ["innerHTML"], Hn = { class: "mwnf-dynasty__body" }, Un = { class: "mwnf-dynasty__eyebrow" }, Wn = {
1195
- key: 0,
1196
- class: "mwnf-dynasty__field"
1197
- }, Gn = { class: "mwnf-dynasty__label" }, Kn = {
1198
- key: 1,
1199
- class: "mwnf-dynasty__field"
1200
- }, qn = { class: "mwnf-dynasty__label" }, Jn = {
1201
- key: 2,
1202
- class: "mwnf-dynasty__dates"
1203
- }, Yn = {
1204
- key: 3,
1205
- class: "mwnf-dynasty__history"
1206
- }, Xn = { class: "mwnf-dynasty__label" }, Zn = ["innerHTML"], Q = {
1207
- __name: "DynastyPopout",
1208
- props: {
1209
- dynasty: {
1210
- type: Object,
1211
- required: !0
1212
- },
1213
- text: {
1214
- type: Object,
1215
- default: () => ({})
1216
- },
1217
- dir: {
1218
- type: String,
1219
- default: ""
1220
- }
1221
- },
1222
- setup(e) {
1223
- let n = e, { t: s } = O(), c = t(() => {
1224
- let { from_ad: e, to_ad: t, from_ah: r, to_ah: i } = n.dynasty ?? {};
1225
- return e == null && t == null ? "" : `${r != null || i != null ? `AH ${r ?? "?"}–${i ?? "?"} / ` : ""}AD ${e ?? "?"}–${t ?? "?"}`;
1226
- });
1227
- return (t, n) => (f(), i("details", {
1228
- class: "mwnf-dynasty",
1229
- dir: e.dir || void 0
1230
- }, [a("summary", {
1231
- class: "mwnf-dynasty__summary",
1232
- innerHTML: v(A)(e.text.name || e.dynasty.id)
1233
- }, null, 8, Vn), a("div", Hn, [
1234
- a("p", Un, _(v(s)("record.dynasty.heading")), 1),
1235
- e.text.also_known_as ? (f(), i("p", Wn, [a("span", Gn, _(v(s)("sheet.field.alsoKnownAs")) + ":", 1), o(" " + _(e.text.also_known_as), 1)])) : r("", !0),
1236
- e.text.area ? (f(), i("p", Kn, [a("span", qn, _(v(s)("sheet.field.area")) + ":", 1), o(" " + _(e.text.area), 1)])) : r("", !0),
1237
- c.value ? (f(), i("p", Jn, _(c.value), 1)) : r("", !0),
1238
- e.text.history ? (f(), i("div", Yn, [a("p", Xn, _(v(s)("sheet.field.history")), 1), a("div", {
1239
- class: "mwnf-sheet__block",
1240
- innerHTML: v(k)(e.text.history)
1241
- }, null, 8, Zn)])) : r("", !0)
1242
- ])], 8, Bn));
1243
- }
1244
- }, Qn = ["dir"], $n = {
1245
- key: 0,
1246
- class: "mwnf-dynasty-list__heading"
1247
- }, er = {
1248
- __name: "DynastyList",
1249
- props: {
1250
- heading: {
1251
- type: String,
1252
- default: ""
1253
- },
1254
- dynasties: {
1255
- type: Array,
1256
- default: () => []
1257
- },
1258
- tr: {
1259
- type: Function,
1260
- default: null
1261
- },
1262
- dir: {
1263
- type: String,
1264
- default: ""
1265
- }
1266
- },
1267
- setup(t) {
1268
- return (a, o) => t.dynasties.length ? (f(), i("section", {
1269
- key: 0,
1270
- class: "mwnf-dynasty-list",
1271
- dir: t.dir || void 0
1272
- }, [t.heading ? (f(), i("h2", $n, _(t.heading), 1)) : r("", !0), (f(!0), i(e, null, m(t.dynasties, (e) => (f(), n(Q, {
1273
- key: e.id,
1274
- dynasty: e,
1275
- text: t.tr ? t.tr(e) : e,
1276
- dir: t.dir
1277
- }, null, 8, [
1278
- "dynasty",
1279
- "text",
1280
- "dir"
1281
- ]))), 128))], 8, Qn)) : r("", !0);
1282
- }
1283
- }, $ = {
1284
- key: 0,
1285
- class: "mwnf-timeline__rows"
1286
- }, tr = { class: "mwnf-timeline__date" }, nr = { class: "mwnf-timeline__body" }, rr = {
1287
- key: 0,
1288
- class: "mwnf-timeline__caption"
1289
- }, ir = ["innerHTML"], ar = ["innerHTML"], or = {
1290
- key: 2,
1291
- class: "mwnf-timeline__media"
1292
- }, sr = ["src", "alt"], cr = ["innerHTML"], lr = {
1293
- key: 3,
1294
- class: "mwnf-timeline__actions"
1295
- }, ur = {
1296
- key: 1,
1297
- class: "mwnf-timeline__empty"
1298
- }, dr = {
1299
- __name: "TimelineEventList",
1300
- props: { events: {
1301
- type: Array,
1302
- default: () => []
1303
- } },
1304
- setup(t) {
1305
- let s = !!b().empty;
1306
- return (c, l) => t.events.length ? (f(), i("ul", $, [(f(!0), i(e, null, m(t.events, (t) => (f(), i("li", {
1307
- key: t.id,
1308
- class: "mwnf-timeline__row"
1309
- }, [a("div", tr, [h(c.$slots, "date", { event: t }, () => [o(_(t.date), 1)])]), a("div", nr, [
1310
- t.caption || c.$slots.caption ? (f(), i("div", rr, [h(c.$slots, "caption", { event: t }, () => [a("span", { innerHTML: t.caption }, null, 8, ir)])])) : r("", !0),
1311
- t.description ? (f(), i("div", {
1312
- key: 1,
1313
- class: "mwnf-timeline__description mwnf-sheet__block",
1314
- innerHTML: t.description
1315
- }, null, 8, ar)) : r("", !0),
1316
- t.media?.length || c.$slots.media ? (f(), i("div", or, [h(c.$slots, "media", { event: t }, () => [(f(!0), i(e, null, m(t.media ?? [], (e, t) => (f(), n(j, {
1317
- key: t,
1318
- class: "mwnf-timeline__media-item",
1319
- to: e.to,
1320
- href: e.href
1321
- }, {
1322
- default: w(() => [e.image ? (f(), i("img", {
1323
- key: 0,
1324
- src: e.image,
1325
- alt: e.alt ?? "",
1326
- loading: "lazy"
1327
- }, null, 8, sr)) : r("", !0), e.caption ? (f(), i("span", {
1328
- key: 1,
1329
- class: "mwnf-timeline__media-caption",
1330
- innerHTML: e.caption
1331
- }, null, 8, cr)) : r("", !0)]),
1332
- _: 2
1333
- }, 1032, ["to", "href"]))), 128))])])) : r("", !0),
1334
- t.actions?.length || c.$slots.actions ? (f(), i("div", lr, [h(c.$slots, "actions", { event: t }, () => [(f(!0), i(e, null, m(t.actions ?? [], (e, t) => (f(), n(j, {
1335
- key: t,
1336
- class: "mwnf-timeline__action",
1337
- to: e.to,
1338
- href: e.href
1339
- }, {
1340
- default: w(() => [o(_(e.label) + " →", 1)]),
1341
- _: 2
1342
- }, 1032, ["to", "href"]))), 128))])])) : r("", !0)
1343
- ])]))), 128))])) : v(s) ? (f(), i("div", ur, [h(c.$slots, "empty")])) : r("", !0);
1344
- }
1345
- }, fr = { class: "mwnf-sheet-timeline" }, pr = {
1346
- key: 0,
1347
- class: "mwnf-sheet-timeline__popout",
1348
- dir: "ltr"
1349
- }, mr = ["aria-label"], hr = { class: "mwnf-sheet-timeline__title" }, gr = { class: "mwnf-sheet-timeline__option" }, _r = ["value"], vr = { class: "mwnf-sheet-timeline__scroll" }, yr = { class: "mwnf-sheet-timeline__subheader" }, br = {
1350
- key: 0,
1351
- class: "mwnf-sheet-timeline__empty"
1352
- }, xr = { class: "mwnf-sheet-timeline__date" }, Sr = ["innerHTML"], Cr = {
1353
- __name: "TimelineLookup",
1354
- props: { info: {
1355
- type: Object,
1356
- required: !0
1357
- } },
1358
- setup(n) {
1359
- let c = n, { t: l } = O(), u = p(!1), d = p(c.info.defaultCountry ? c.info.defaultCountry() : "all");
1360
- C(() => c.info, (e) => {
1361
- d.value = e.defaultCountry ? e.defaultCountry() : "all";
1362
- });
1363
- let h = t(() => c.info.range ?? [null, null]), g = t(() => c.info.events(d.value)), y = t(() => c.info.countries.find((e) => e.value === d.value)?.label ?? ""), b = (e) => c.info.era ? c.info.era(e) : String(e ?? "");
1364
- return (t, c) => (f(), i("div", fr, [a("p", {
1365
- class: "mwnf-sheet-timeline__trigger",
1366
- onClick: c[0] ||= (e) => u.value = !u.value
1367
- }, "➤ " + _(v(l)(n.info.trigger ?? "record.related.timelineForItem")), 1), u.value ? (f(), i("div", pr, [
1368
- a("button", {
1369
- type: "button",
1370
- class: "mwnf-sheet-timeline__close",
1371
- "aria-label": v(l)("core.action.close"),
1372
- onClick: c[1] ||= (e) => u.value = !1
1373
- }, "✕", 8, mr),
1374
- a("p", hr, _(v(l)(n.info.heading)), 1),
1375
- a("div", gr, [T(a("select", {
1376
- "onUpdate:modelValue": c[2] ||= (e) => d.value = e,
1377
- class: "mwnf-sheet-timeline__select"
1378
- }, [(f(!0), i(e, null, m(n.info.countries, (e) => (f(), i("option", {
1379
- key: e.value,
1380
- value: e.value
1381
- }, _(e.label), 9, _r))), 128))], 512), [[x, d.value]]), s(j, {
1382
- class: "mwnf-sheet-timeline__link",
1383
- to: n.info.searchTo(d.value, h.value)
1384
- }, {
1385
- default: w(() => [o("➤ " + _(v(l)("timeline.action.beginFullSearch")), 1)]),
1386
- _: 1
1387
- }, 8, ["to"])]),
1388
- a("div", vr, [
1389
- a("p", yr, _(y.value) + ", " + _(b(h.value[0])) + " – " + _(b(h.value[1])), 1),
1390
- g.value.length ? r("", !0) : (f(), i("p", br, _(v(l)("timeline.results.noEvents")), 1)),
1391
- (f(!0), i(e, null, m(g.value, (e, t) => (f(), i("div", {
1392
- key: e.id ?? t,
1393
- class: "mwnf-sheet-timeline__event"
1394
- }, [a("div", xr, _(b(e.year_from)), 1), a("div", {
1395
- class: "mwnf-sheet-timeline__description",
1396
- innerHTML: v(k)(e.text.description)
1397
- }, null, 8, Sr)]))), 128))
1398
- ])
1399
- ])) : r("", !0)]));
1400
- }
1401
- };
1402
- //#endregion
1403
- export { j as S, Ke as _, zn as a, pe as b, en as c, Lt as d, Nt as f, $e as g, it as h, Q as i, Zt as l, dt as m, dr as n, En as o, mt as p, er as r, vn as s, Cr as t, qt as u, Z as v, Y as x, X as y };