dbf-mirador 4.2.4 → 4.3.0-testing1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,52 +1,36 @@
1
- # Mirador
2
- [![Node.js CI](https://github.com/ProjectMirador/mirador/workflows/Node.js%20CI/badge.svg)](https://github.com/ProjectMirador/mirador/actions/workflows/node.js.yml) [![codecov](https://codecov.io/gh/ProjectMirador/mirador/branch/main/graph/badge.svg)](https://codecov.io/gh/ProjectMirador/mirador)
1
+ # DBF Map Mirador
3
2
 
4
- ## For Mirador Users
5
- We recommend installing Mirador using a JavaScript package manager like [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/).
3
+ We forked the original Mirador project to create a version that is compatible with the DBF Map project. This version of Mirador is designed to work seamlessly with the DBF Map platform, providing users with an enhanced experience for viewing and interacting with digital content. More detail about the original Mirador project can be found [here](https://github.com/ProjectMirador/mirador). This readme will cover only minimal information about the original Mirador project and will focus on the changes made to support the DBF Map project.
6
4
 
7
- ```sh
8
- $ npm install dbf-mirador
5
+ ## Running Mirador locally for development
9
6
 
10
- # or
7
+ Mirador local development requires [nodejs](https://nodejs.org/en/download/) to be installed.
11
8
 
12
- $ yarn add dbf-mirador
13
9
  ```
10
+ git clone git@github.com:AlMadar-Digital/map-mirador.git
11
+ cd map-mirador
12
+ npm install
14
13
 
15
- If you are interested in integrating Mirador with plugins into your project, we recommend using vite to integrate the es version of the packages. Examples are here:
16
-
17
- [https://github.com/ProjectMirador/mirador-integration](https://github.com/ProjectMirador/mirador-integration)
18
-
19
- If you want to simply embed Mirador in an HTML page without further customization, include the Mirador UMD build:
20
-
21
- ```html
22
- <script src="https://unpkg.com/dbf-mirador@latest/dist/mirador.min.js"></script>
23
14
  ```
15
+ Then run the following command to start a local development server:
24
16
 
25
- Be aware that `latest` will at some point switch from version 3 to version 4. If you use Mirador via CDN in a production environment, consider pinning Mirador to version 3 to avoid sudden breaking changes:
26
-
27
- ```html
28
- <script src="https://unpkg.com/mirador@^3/dist/mirador.min.js"></script>
17
+ ```sh
18
+ $ npm start
29
19
  ```
30
20
 
21
+ Then navigate to [http://127.0.0.1:4444/](http://127.0.0.1:4444/)
31
22
 
32
- More examples of embedding Mirador can be found at [https://github.com/ProjectMirador/mirador/wiki/M3-Embedding-in-Another-Environment#in-an-html-document-with-javascript](https://github.com/ProjectMirador/mirador/wiki/Embedding-in-Another-Environment).
33
-
34
- ## Adding translations to Mirador
35
- For help with adding a translation, see [src/locales/README.md](src/locales/README.md)
36
-
37
- ## Running Mirador locally for development
38
-
39
- Mirador local development requires [nodejs](https://nodejs.org/en/download/) to be installed.
40
-
41
- 1. Run `npm install` to install the dependencies.
23
+ ## Install Mirador inside your project
42
24
 
43
- ### Starting the project
25
+ `dbf-mirador` is available through NPM
44
26
 
45
27
  ```sh
46
- $ npm start
28
+ $ npm install dbf-mirador
47
29
  ```
48
30
 
49
- Then navigate to [http://127.0.0.1:4444/](http://127.0.0.1:4444/)
31
+ ### Mirador
32
+
33
+ Check the demo folder TODO
50
34
 
51
35
  ### Instantiating Mirador
52
36
 
@@ -59,24 +43,6 @@ var miradorInstance = Mirador.viewer({
59
43
  { actions, store }
60
44
  ```
61
45
 
62
- ### Example Action
63
-
64
- Add a window:
65
- ```javascript
66
- store.dispatch(actions.addWindow());
67
- ```
68
-
69
- To focus a window run:
70
-
71
- ```javascript
72
- store.dispatch(actions.focusWindow('window-1'))
73
- ```
74
-
75
- ### Check current state
76
-
77
- ```javascript
78
- store.getState()
79
- ```
80
46
 
81
47
  ## Running the tests
82
48
  We use Vitest to run our test suite.
@@ -101,33 +67,4 @@ $ npx vitest __tests__/integration/tests/sequence-switching.test.js --ui
101
67
  ```sh
102
68
  $ npm run lint
103
69
  ```
104
- ## Image Fallback
105
-
106
- Mirador automatically displays a simple fallback placeholder when images fail to load. Customize the fallback image via configuration:
107
-
108
- ```javascript
109
- const config = {
110
- fallbackImage: 'https://example.com/custom-fallback.jpg',
111
- };
112
- ```
113
-
114
- The error message is translatable via the `imageFailedToLoad` translation key. Detailed error information is logged to the console for debugging.
115
-
116
- ## Debugging
117
-
118
- ### Local instance
119
-
120
- The following browser extensions are useful for debugging a local development instance of Mirador:
121
-
122
- - [React DevTools](https://github.com/facebook/react-devtools)
123
- - [Redux DevTools](https://github.com/zalmoxisus/redux-devtools-extension)
124
-
125
- ### Test suite
126
-
127
- To debug the test suite, run:
128
-
129
- ```sh
130
- $ npm run test:debug
131
- ```
132
70
 
133
- then spin up a [nodejs inspector client](https://nodejs.org/en/docs/guides/debugging-getting-started/#inspector-clients) and set some breakpoints. See [here](https://www.digitalocean.com/community/tutorials/how-to-debug-node-js-with-the-built-in-debugger-and-chrome-devtools#step-3-%E2%80%94-debugging-node-js-with-chrome-devtools) for a guide to debugging with Chrome DevTools.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbf-mirador",
3
- "version": "4.2.4",
3
+ "version": "4.3.0-testing1",
4
4
  "description": "An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.",
5
5
  "type": "module",
6
6
  "main": "./dist/mirador.min.js",
@@ -1,325 +0,0 @@
1
- import { U as e, at as t, ct as n, ft as r, g as i, st as a } from "./getters-COus7Mvg.js";
2
- import { B as o, dt as s, mt as c } from "./canvases-CKYPFdER.js";
3
- import { t as l } from "./FailedImageContext-BHWsZAMA.js";
4
- import { t as u } from "./createSvgIcon-Cwt8YPfm.js";
5
- import * as d from "react";
6
- import { createContext as f, useContext as p, useEffect as m, useMemo as h, useState as g } from "react";
7
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
8
- import { styled as y } from "@mui/material/styles";
9
- //#region src/hooks/useThumbnailService.js
10
- function b(e, t) {
11
- return n((n) => s(n, e, t), [e, t]);
12
- }
13
- //#endregion
14
- //#region ../node_modules/react-intersection-observer/dist/index.mjs
15
- var x = /* @__PURE__ */ r(t(), 1), S = Object.defineProperty, C = (e, t, n) => t in e ? S(e, t, {
16
- enumerable: !0,
17
- configurable: !0,
18
- writable: !0,
19
- value: n
20
- }) : e[t] = n, w = (e, t, n) => C(e, typeof t == "symbol" ? t : t + "", n), T = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new WeakMap(), D = 0, O;
21
- function k(e) {
22
- return e ? E.has(e) ? E.get(e) : (D += 1, E.set(e, D.toString()), E.get(e)) : "0";
23
- }
24
- function A(e) {
25
- return Object.keys(e).sort().filter((t) => e[t] !== void 0).map((t) => `${t}_${t === "root" ? k(e.root) : e[t]}`).toString();
26
- }
27
- function j(e) {
28
- let t = A(e), n = T.get(t);
29
- if (!n) {
30
- let r = /* @__PURE__ */ new Map(), i, a = new IntersectionObserver((t) => {
31
- t.forEach((t) => {
32
- let n = t.isIntersecting && i.some((e) => t.intersectionRatio >= e);
33
- e.trackVisibility && t.isVisible === void 0 && (t.isVisible = n), [...r.get(t.target) ?? []].forEach((e) => {
34
- e(n, t);
35
- });
36
- });
37
- }, e);
38
- i = a.thresholds || (Array.isArray(e.threshold) ? e.threshold : [e.threshold || 0]), n = {
39
- id: t,
40
- observer: a,
41
- elements: r
42
- }, T.set(t, n);
43
- }
44
- return n;
45
- }
46
- function M(e, t, n = {}, r = O) {
47
- if (window.IntersectionObserver === void 0 && r !== void 0) {
48
- let i = e.getBoundingClientRect();
49
- return t(r, {
50
- isIntersecting: r,
51
- target: e,
52
- intersectionRatio: typeof n.threshold == "number" ? n.threshold : 0,
53
- time: 0,
54
- boundingClientRect: i,
55
- intersectionRect: i,
56
- rootBounds: i
57
- }), () => {};
58
- }
59
- let { id: i, observer: a, elements: o } = j(n), s = o.get(e) || [];
60
- return o.has(e) || o.set(e, s), s.push(t), a.observe(e), function() {
61
- s.splice(s.indexOf(t), 1), s.length === 0 && (o.delete(e), a.unobserve(e)), o.size === 0 && (a.disconnect(), T.delete(i));
62
- };
63
- }
64
- function N(e) {
65
- return typeof e.children != "function";
66
- }
67
- var P = class extends d.Component {
68
- constructor(e) {
69
- super(e), w(this, "node", null), w(this, "_unobserveCb", null), w(this, "lastInView"), w(this, "handleNode", (e) => {
70
- this.node && (this.unobserve(), !e && !this.props.triggerOnce && !this.props.skip && (this.setState({
71
- inView: !!this.props.initialInView,
72
- entry: void 0
73
- }), this.lastInView = this.props.initialInView)), this.node = e || null, this.observeNode();
74
- }), w(this, "handleChange", (e, t) => {
75
- let n = this.lastInView;
76
- this.lastInView = e, !(n === void 0 && !e) && (e && this.props.triggerOnce && this.unobserve(), N(this.props) || this.setState({
77
- inView: e,
78
- entry: t
79
- }), this.props.onChange && this.props.onChange(e, t));
80
- }), this.state = {
81
- inView: !!e.initialInView,
82
- entry: void 0
83
- }, this.lastInView = e.initialInView;
84
- }
85
- componentDidMount() {
86
- this.unobserve(), this.observeNode();
87
- }
88
- componentDidUpdate(e) {
89
- (e.rootMargin !== this.props.rootMargin || e.scrollMargin !== this.props.scrollMargin || e.root !== this.props.root || e.threshold !== this.props.threshold || e.skip !== this.props.skip || e.trackVisibility !== this.props.trackVisibility || e.delay !== this.props.delay) && (this.unobserve(), this.observeNode());
90
- }
91
- componentWillUnmount() {
92
- this.unobserve();
93
- }
94
- observeNode() {
95
- if (!this.node || this.props.skip) return;
96
- let { threshold: e, root: t, rootMargin: n, scrollMargin: r, trackVisibility: i, delay: a, fallbackInView: o } = this.props;
97
- this.lastInView === void 0 && (this.lastInView = this.props.initialInView), this._unobserveCb = M(this.node, this.handleChange, {
98
- threshold: e,
99
- root: t,
100
- rootMargin: n,
101
- scrollMargin: r,
102
- trackVisibility: i,
103
- delay: a
104
- }, o);
105
- }
106
- unobserve() {
107
- this._unobserveCb &&= (this._unobserveCb(), null);
108
- }
109
- render() {
110
- let { children: e } = this.props;
111
- if (typeof e == "function") {
112
- let { inView: t, entry: n } = this.state;
113
- return e({
114
- inView: t,
115
- entry: n,
116
- ref: this.handleNode
117
- });
118
- }
119
- let { as: t, triggerOnce: n, threshold: r, root: i, rootMargin: a, scrollMargin: o, onChange: s, skip: c, trackVisibility: l, delay: u, initialInView: f, fallbackInView: p, ...m } = this.props;
120
- return d.createElement(t || "div", {
121
- ref: this.handleNode,
122
- ...m
123
- }, e);
124
- }
125
- };
126
- function F({ threshold: e, delay: t, trackVisibility: n, rootMargin: r, scrollMargin: i, root: a, triggerOnce: o, skip: s, initialInView: c, fallbackInView: l, onChange: u } = {}) {
127
- let [f, p] = d.useState(null), m = d.useRef(u), h = d.useRef(c), [g, _] = d.useState({
128
- inView: !!c,
129
- entry: void 0
130
- });
131
- m.current = u, d.useEffect(() => {
132
- if (h.current === void 0 && (h.current = c), s || !f) return;
133
- let u;
134
- return u = M(f, (e, t) => {
135
- let n = h.current;
136
- h.current = e, !(n === void 0 && !e) && (_({
137
- inView: e,
138
- entry: t
139
- }), m.current && m.current(e, t), t.isIntersecting && o && u && (u(), u = void 0));
140
- }, {
141
- root: a,
142
- rootMargin: r,
143
- scrollMargin: i,
144
- threshold: e,
145
- trackVisibility: n,
146
- delay: t
147
- }, l), () => {
148
- u && u();
149
- };
150
- }, [
151
- Array.isArray(e) ? e.toString() : e,
152
- f,
153
- a,
154
- r,
155
- i,
156
- o,
157
- s,
158
- n,
159
- l,
160
- t
161
- ]);
162
- let v = g.entry?.target, y = d.useRef(void 0);
163
- !f && v && !o && !s && y.current !== v && (y.current = v, _({
164
- inView: !!c,
165
- entry: void 0
166
- }), h.current = c);
167
- let b = [
168
- p,
169
- g.inView,
170
- g.entry
171
- ];
172
- return b.ref = b[0], b.inView = b[1], b.entry = b[2], b;
173
- }
174
- ("useInsertionEffect" in d ? d.useInsertionEffect : void 0) ?? d.useLayoutEffect ?? d.useEffect;
175
- //#endregion
176
- //#region src/contexts/LocaleContext.js
177
- var I = f();
178
- //#endregion
179
- //#region src/components/IIIFResourceLabel.jsx
180
- function L({ fallback: e, resource: t }) {
181
- let r = p(I), i = n((e) => o(e, {}));
182
- if (!t) return e;
183
- let a = t.getLabel();
184
- return a ? a.getValue(r || i || "") ?? (e || t.id) : e;
185
- }
186
- L.propTypes = {
187
- fallback: x.default.string,
188
- resource: x.default.object.isRequired
189
- };
190
- //#endregion
191
- //#region src/components/IIIFThumbnail.jsx
192
- var R = y("div", {
193
- name: "IIIFThumbnail",
194
- slot: "root"
195
- })({}), z = y("span", {
196
- name: "IIIFThumbnail",
197
- slot: "label"
198
- })(({ theme: e }) => ({ ...e.typography.caption })), B = y("img", {
199
- name: "IIIFThumbnail",
200
- slot: "image"
201
- })(() => ({
202
- height: "auto",
203
- width: "auto"
204
- })), V = ({ border: e = !1, placeholder: t, style: n = {}, thumbnail: r = null, resource: i, maxHeight: a = null, maxWidth: o = null, ...s }) => {
205
- let { ref: c, inView: u } = F(), [d, f] = g(!1), [v, y] = g(!1), x = b(a, o), { notifyFailure: S, fallbackImage: C } = p(l);
206
- m(() => {
207
- d || !u || f(!0);
208
- }, [u, d]);
209
- let w = h(() => {
210
- if (r) return r;
211
- let e = x.get(i);
212
- if (e && e.url) return e;
213
- }, [
214
- i,
215
- r,
216
- x
217
- ]), T = h(() => {
218
- let e = {
219
- height: void 0,
220
- maxHeight: void 0,
221
- maxWidth: void 0,
222
- width: void 0
223
- };
224
- if (v && C) return {
225
- ...e,
226
- ...n,
227
- maxWidth: o,
228
- maxHeight: a,
229
- objectFit: "contain"
230
- };
231
- if (!w) return {
232
- ...n,
233
- height: a,
234
- width: o
235
- };
236
- let { height: t, width: r } = w;
237
- if (t && r) {
238
- if (a && t > a || o && r > o) {
239
- let n = r / t;
240
- a && o ? o / a < n ? (e.height = Math.round(o / n), e.width = o) : (e.height = a, e.width = Math.round(a * n)) : a ? (e.height = a, e.maxWidth = Math.round(a * n)) : o && (e.width = o, e.maxHeight = Math.round(o / n));
241
- } else e.width = r, e.height = t;
242
- } else t && !r ? e.height = a : !t && r ? e.width = o : (e.width = o, e.height = a);
243
- return {
244
- ...e,
245
- ...n
246
- };
247
- }, [
248
- w,
249
- o,
250
- a,
251
- n,
252
- v,
253
- C
254
- ]), { url: E = t } = d && (r || w) || {}, D = v ? C || t : E;
255
- return /* @__PURE__ */ _(B, {
256
- ownerState: { border: e },
257
- ref: c,
258
- alt: v ? "Thumbnail image unavailable" : "",
259
- role: v ? void 0 : "presentation",
260
- src: D,
261
- style: T,
262
- onError: () => {
263
- y(!0), D && S(D);
264
- },
265
- ...s
266
- });
267
- };
268
- V.propTypes = {
269
- border: x.default.bool,
270
- maxHeight: x.default.number,
271
- maxWidth: x.default.number,
272
- placeholder: x.default.string.isRequired,
273
- resource: x.default.object.isRequired,
274
- style: x.default.object,
275
- thumbnail: x.default.shape({
276
- height: x.default.number,
277
- url: x.default.string.isRequired,
278
- width: x.default.number
279
- })
280
- };
281
- var H = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mMMDQmtBwADgwF/Op8FmAAAAABJRU5ErkJggg==";
282
- function U({ border: e = !1, children: t = null, imagePlaceholder: n = H, label: r = void 0, labelled: i = !1, maxHeight: a = null, maxWidth: o = null, resource: s, style: c = {}, thumbnail: l = null }) {
283
- let u = arguments[0];
284
- return /* @__PURE__ */ v(R, {
285
- ownerState: u,
286
- children: [
287
- /* @__PURE__ */ _(V, {
288
- placeholder: n,
289
- thumbnail: l,
290
- resource: s,
291
- maxHeight: a,
292
- maxWidth: o,
293
- style: c,
294
- border: e
295
- }),
296
- i && /* @__PURE__ */ _(z, {
297
- ownerState: u,
298
- children: r || /* @__PURE__ */ _(L, { resource: s })
299
- }),
300
- t
301
- ]
302
- });
303
- }
304
- U.propTypes = {
305
- border: x.default.bool,
306
- children: x.default.node,
307
- imagePlaceholder: x.default.string,
308
- label: x.default.string,
309
- labelled: x.default.bool,
310
- maxHeight: x.default.number,
311
- maxWidth: x.default.number,
312
- resource: x.default.object.isRequired,
313
- style: x.default.object,
314
- thumbnail: x.default.shape({
315
- height: x.default.number,
316
- url: x.default.string.isRequired,
317
- width: x.default.number
318
- }),
319
- variant: x.default.oneOf(["inside", "outside"])
320
- };
321
- var W = e(a((e) => ({ thumbnailsConfig: c(e).thumbnails })), i("IIIFThumbnail"))(U), G = u(/*#__PURE__*/ _("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14" }), "SearchSharp"), K = u(/*#__PURE__*/ _("path", { d: "M21.99 2H2v16h16l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z" }), "CommentSharp");
322
- //#endregion
323
- export { L as a, U as i, G as n, I as o, W as r, P as s, K as t };
324
-
325
- //# sourceMappingURL=CommentSharp-vA_xN68i.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommentSharp-vA_xN68i.js","names":["React","React2","React3","createSvgIcon","createSvgIcon"],"sources":["../src/hooks/useThumbnailService.js","../../node_modules/react-intersection-observer/dist/index.mjs","../src/contexts/LocaleContext.js","../src/components/IIIFResourceLabel.jsx","../src/components/IIIFThumbnail.jsx","../src/containers/IIIFThumbnail.js","../../node_modules/@mui/icons-material/esm/SearchSharp.js","../../node_modules/@mui/icons-material/esm/CommentSharp.js"],"sourcesContent":["import { useSelector } from 'react-redux';\n\nimport { getThumbnailFactory } from '../state/selectors/thumbnails';\n\n/** */\nexport default function useThumbnailService(maxHeight, maxWidth) {\n return useSelector((state) => getThumbnailFactory(state, maxHeight, maxWidth), [maxHeight, maxWidth]);\n}\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\nfunction getRootId(root) {\n if (!root) return \"0\";\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a2;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n [...(_a2 = elements.get(entry.target)) != null ? _a2 : []].forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === \"number\" ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"lastInView\");\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n this.lastInView = this.props.initialInView;\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n const previousInView = this.lastInView;\n this.lastInView = inView;\n if (previousInView === void 0 && !inView) {\n return;\n }\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n this.lastInView = props.initialInView;\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.scrollMargin !== this.props.scrollMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n scrollMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n if (this.lastInView === void 0) {\n this.lastInView = this.props.initialInView;\n }\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n scrollMargin,\n trackVisibility,\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n scrollMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n scrollMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a2;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const lastInViewRef = React2.useRef(initialInView);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (lastInViewRef.current === void 0) {\n lastInViewRef.current = initialInView;\n }\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n const previousInView = lastInViewRef.current;\n lastInViewRef.current = inView;\n if (previousInView === void 0 && !inView) {\n return;\n }\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n scrollMargin,\n threshold,\n trackVisibility,\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n },\n // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n scrollMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a2 = state.entry) == null ? void 0 : _a2.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n lastInViewRef.current = initialInView;\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\n// src/useOnInView.tsx\nimport * as React3 from \"react\";\nvar _a, _b;\nvar useSyncEffect = (_b = (_a = \"useInsertionEffect\" in React3 ? React3.useInsertionEffect : void 0) != null ? _a : React3.useLayoutEffect) != null ? _b : React3.useEffect;\nvar useOnInView = (onIntersectionChange, {\n threshold,\n root,\n rootMargin,\n scrollMargin,\n trackVisibility,\n delay,\n triggerOnce,\n skip\n} = {}) => {\n const onIntersectionChangeRef = React3.useRef(onIntersectionChange);\n const observedElementRef = React3.useRef(null);\n const observerCleanupRef = React3.useRef(void 0);\n const lastInViewRef = React3.useRef(void 0);\n useSyncEffect(() => {\n onIntersectionChangeRef.current = onIntersectionChange;\n }, [onIntersectionChange]);\n return React3.useCallback(\n (element) => {\n const cleanupExisting = () => {\n if (observerCleanupRef.current) {\n const cleanup = observerCleanupRef.current;\n observerCleanupRef.current = void 0;\n cleanup();\n }\n };\n if (element === observedElementRef.current) {\n return observerCleanupRef.current;\n }\n if (!element || skip) {\n cleanupExisting();\n observedElementRef.current = null;\n lastInViewRef.current = void 0;\n return;\n }\n cleanupExisting();\n observedElementRef.current = element;\n let destroyed = false;\n const destroyObserver = observe(\n element,\n (inView, entry) => {\n const previousInView = lastInViewRef.current;\n lastInViewRef.current = inView;\n if (previousInView === void 0 && !inView) {\n return;\n }\n onIntersectionChangeRef.current(\n inView,\n entry\n );\n if (triggerOnce && inView) {\n stopObserving();\n }\n },\n {\n threshold,\n root,\n rootMargin,\n scrollMargin,\n trackVisibility,\n delay\n }\n );\n function stopObserving() {\n if (destroyed) return;\n destroyed = true;\n destroyObserver();\n observedElementRef.current = null;\n observerCleanupRef.current = void 0;\n lastInViewRef.current = void 0;\n }\n observerCleanupRef.current = stopObserving;\n return observerCleanupRef.current;\n },\n [\n Array.isArray(threshold) ? threshold.toString() : threshold,\n root,\n rootMargin,\n scrollMargin,\n trackVisibility,\n delay,\n triggerOnce,\n skip\n ]\n );\n};\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView,\n useOnInView\n};\n//# sourceMappingURL=index.mjs.map","import { createContext } from 'react';\n\nconst LocaleContext = createContext();\n\nexport default LocaleContext;\n","import { useContext } from 'react';\nimport { useSelector } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { getLocale } from '../state/selectors';\nimport LocaleContext from '../contexts/LocaleContext';\n\n/**\n * Render the contextually appropriate label for the resource\n */\nexport function IIIFResourceLabel({ fallback, resource }) {\n const contextLocale = useContext(LocaleContext);\n const fallbackLocale = useSelector((state) => getLocale(state, {}));\n\n if (!resource) return fallback;\n\n const label = resource.getLabel();\n\n if (!label) return fallback;\n\n return label.getValue(contextLocale || fallbackLocale || '') ?? (fallback || resource.id);\n}\n\nIIIFResourceLabel.propTypes = {\n fallback: PropTypes.string,\n resource: PropTypes.object.isRequired,\n};\n","import { useMemo, useEffect, useState, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { useInView } from 'react-intersection-observer';\nimport { IIIFResourceLabel } from './IIIFResourceLabel';\nimport { useThumbnailService } from '../hooks';\nimport FailedImageContext from '../contexts/FailedImageContext';\n\nconst Root = styled('div', { name: 'IIIFThumbnail', slot: 'root' })({});\n\nconst Label = styled('span', { name: 'IIIFThumbnail', slot: 'label' })(({ theme }) => ({\n ...theme.typography.caption,\n}));\n\nconst Image = styled('img', { name: 'IIIFThumbnail', slot: 'image' })(() => ({\n height: 'auto',\n width: 'auto',\n}));\n\n/**\n * A lazy-loaded image that uses IntersectionObserver to determine when to\n * try to load the image (or even calculate that the image url/height/width are)\n */\nconst LazyLoadedImage = ({\n border = false,\n placeholder,\n style = {},\n thumbnail = null,\n resource,\n maxHeight = null,\n maxWidth = null,\n ...props\n}) => {\n const { ref, inView } = useInView();\n const [loaded, setLoaded] = useState(false);\n const [failed, setFailed] = useState(false);\n const thumbnailService = useThumbnailService(maxHeight, maxWidth);\n const { notifyFailure, fallbackImage } = useContext(FailedImageContext);\n\n /**\n * Handles the intersection (visibility) of a given thumbnail, by requesting\n * the image and then updating the state.\n */\n useEffect(() => {\n if (loaded || !inView) return;\n\n setLoaded(true);\n }, [inView, loaded]);\n\n const image = useMemo(() => {\n if (thumbnail) return thumbnail;\n\n const i = thumbnailService.get(resource);\n\n if (i && i.url) return i;\n\n return undefined;\n }, [resource, thumbnail, thumbnailService]);\n\n const imageStyles = useMemo(() => {\n const styleProps = {\n height: undefined,\n maxHeight: undefined,\n maxWidth: undefined,\n width: undefined,\n };\n\n // If we're using a fallback image due to failure, use object-fit to preserve aspect ratio\n if (failed && fallbackImage) {\n return {\n ...styleProps,\n ...style,\n maxWidth,\n maxHeight,\n objectFit: 'contain',\n };\n }\n\n if (!image) return { ...style, height: maxHeight, width: maxWidth };\n\n const { height: thumbHeight, width: thumbWidth } = image;\n if (thumbHeight && thumbWidth) {\n if ((maxHeight && thumbHeight > maxHeight) || (maxWidth && thumbWidth > maxWidth)) {\n const aspectRatio = thumbWidth / thumbHeight;\n\n if (maxHeight && maxWidth) {\n if (maxWidth / maxHeight < aspectRatio) {\n styleProps.height = Math.round(maxWidth / aspectRatio);\n styleProps.width = maxWidth;\n } else {\n styleProps.height = maxHeight;\n styleProps.width = Math.round(maxHeight * aspectRatio);\n }\n } else if (maxHeight) {\n styleProps.height = maxHeight;\n styleProps.maxWidth = Math.round(maxHeight * aspectRatio);\n } else if (maxWidth) {\n styleProps.width = maxWidth;\n styleProps.maxHeight = Math.round(maxWidth / aspectRatio);\n }\n } else {\n styleProps.width = thumbWidth;\n styleProps.height = thumbHeight;\n }\n } else if (thumbHeight && !thumbWidth) {\n styleProps.height = maxHeight;\n } else if (!thumbHeight && thumbWidth) {\n styleProps.width = maxWidth;\n } else {\n // The thumbnail wasn't retrieved via an Image API service,\n // and its dimensions are not specified in the JSON-LD\n // (note that this may result in a blurry image)\n styleProps.width = maxWidth;\n styleProps.height = maxHeight;\n }\n\n return {\n ...styleProps,\n ...style,\n };\n }, [image, maxWidth, maxHeight, style, failed, fallbackImage]);\n\n const { url: src = placeholder } = (loaded && (thumbnail || image)) || {};\n // Decide final image source: normal, failed fallback, or placeholder\n const finalSrc = failed ? fallbackImage || placeholder : src;\n\n return (\n <Image\n ownerState={{ border }}\n ref={ref}\n alt={failed ? 'Thumbnail image unavailable' : ''}\n role={failed ? undefined : 'presentation'}\n src={finalSrc}\n style={imageStyles}\n onError={() => {\n setFailed(true);\n if (finalSrc) notifyFailure(finalSrc);\n }}\n {...props}\n />\n );\n};\n\nLazyLoadedImage.propTypes = {\n border: PropTypes.bool,\n maxHeight: PropTypes.number,\n maxWidth: PropTypes.number,\n placeholder: PropTypes.string.isRequired,\n resource: PropTypes.object.isRequired,\n style: PropTypes.object,\n thumbnail: PropTypes.shape({\n height: PropTypes.number,\n url: PropTypes.string.isRequired,\n width: PropTypes.number,\n }),\n};\n\nconst defaultPlaceholder =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mMMDQmtBwADgwF/Op8FmAAAAABJRU5ErkJggg==';\n\n/**\n * Uses InteractionObserver to \"lazy\" load canvas thumbnails that are in view.\n */\nexport function IIIFThumbnail({\n border = false,\n children = null,\n imagePlaceholder = defaultPlaceholder,\n label = undefined,\n labelled = false,\n maxHeight = null,\n maxWidth = null,\n resource,\n style = {},\n thumbnail = null,\n}) {\n // eslint-disable-next-line prefer-rest-params\n const ownerState = arguments[0];\n\n return (\n <Root ownerState={ownerState}>\n <LazyLoadedImage\n placeholder={imagePlaceholder}\n thumbnail={thumbnail}\n resource={resource}\n maxHeight={maxHeight}\n maxWidth={maxWidth}\n style={style}\n border={border}\n />\n\n {labelled && <Label ownerState={ownerState}>{label || <IIIFResourceLabel resource={resource} />}</Label>}\n {children}\n </Root>\n );\n}\n\nIIIFThumbnail.propTypes = {\n border: PropTypes.bool,\n children: PropTypes.node,\n imagePlaceholder: PropTypes.string,\n label: PropTypes.string,\n labelled: PropTypes.bool,\n maxHeight: PropTypes.number,\n maxWidth: PropTypes.number,\n resource: PropTypes.object.isRequired,\n style: PropTypes.object,\n thumbnail: PropTypes.shape({\n height: PropTypes.number,\n url: PropTypes.string.isRequired,\n width: PropTypes.number,\n }),\n // eslint-disable-next-line react/no-unused-prop-types\n variant: PropTypes.oneOf(['inside', 'outside']),\n};\n","import { compose } from 'redux';\nimport { connect } from 'react-redux';\nimport { withPlugins } from '../extend/withPlugins';\nimport { getConfig } from '../state/selectors';\nimport { IIIFThumbnail } from '../components/IIIFThumbnail';\n\n/**\n * mapStateToProps - to hook up connect\n * @private\n */\nconst mapStateToProps = (state) => ({\n thumbnailsConfig: getConfig(state).thumbnails,\n});\n\nconst enhance = compose(connect(mapStateToProps), withPlugins('IIIFThumbnail'));\n\nexport default enhance(IIIFThumbnail);\n","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14\"\n}), 'SearchSharp');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M21.99 2H2v16h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