dbf-mirador 4.3.0-testing1 → 4.3.0-testing3
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/dist/AudioViewer-tRH73pbt.js +40 -0
- package/dist/AudioViewer-tRH73pbt.js.map +1 -0
- package/dist/CommentSharp-BJ6oQAe3.js +322 -0
- package/dist/CommentSharp-BJ6oQAe3.js.map +1 -0
- package/dist/FailedImageContext-BhA0TpVp.js +339 -0
- package/dist/FailedImageContext-BhA0TpVp.js.map +1 -0
- package/dist/GalleryView-rCx0Q4f3.js +176 -0
- package/dist/GalleryView-rCx0Q4f3.js.map +1 -0
- package/dist/OpenSeadragonViewer-B_KV5sbU.js +7889 -0
- package/dist/OpenSeadragonViewer-B_KV5sbU.js.map +1 -0
- package/dist/PluginHook-DWFCXIIp.js +54 -0
- package/dist/PluginHook-DWFCXIIp.js.map +1 -0
- package/dist/SelectCollection-BK9ZDkK3.js +67 -0
- package/dist/SelectCollection-BK9ZDkK3.js.map +1 -0
- package/dist/TextViewer-D_1qzQE4.js +38 -0
- package/dist/TextViewer-D_1qzQE4.js.map +1 -0
- package/dist/VideoViewer-DzNjgLWE.js +42 -0
- package/dist/VideoViewer-DzNjgLWE.js.map +1 -0
- package/dist/WindowCanvasNavigationControls-D2uLtL_A.js +242 -0
- package/dist/WindowCanvasNavigationControls-D2uLtL_A.js.map +1 -0
- package/dist/WindowViewer-DMNeTH1_.js +27 -0
- package/dist/WindowViewer-DMNeTH1_.js.map +1 -0
- package/dist/WorkspaceArea-CzKnpSim.js +22222 -0
- package/dist/WorkspaceArea-CzKnpSim.js.map +1 -0
- package/dist/action-types-DjIbTE-A.js +74 -0
- package/dist/action-types-DjIbTE-A.js.map +1 -0
- package/dist/canvas-2ACcnS9Y.js +41 -0
- package/dist/canvas-2ACcnS9Y.js.map +1 -0
- package/dist/canvases-DTR37lo-.js +3270 -0
- package/dist/canvases-DTR37lo-.js.map +1 -0
- package/dist/createSvgIcon-Cwt8YPfm.js +2 -0
- package/dist/getters-B4oepJRC.js +2043 -0
- package/dist/getters-B4oepJRC.js.map +1 -0
- package/dist/index.module-CgUBfaXx.js +403 -0
- package/dist/index.module-CgUBfaXx.js.map +1 -0
- package/dist/mirador.es.js +9222 -0
- package/dist/mirador.es.js.map +1 -0
- package/dist/mirador.min.js +335 -0
- package/dist/mirador.min.js.map +1 -0
- package/dist/react-error-boundary.esm-ByHqCaxk.js +67 -0
- package/dist/react-error-boundary.esm-ByHqCaxk.js.map +1 -0
- package/dist/visuallyHidden-C4mhQkB0.js +98 -0
- package/dist/visuallyHidden-C4mhQkB0.js.map +1 -0
- package/dist/window-COQOIAli.js +138 -0
- package/dist/window-COQOIAli.js.map +1 -0
- package/package.json +3 -2
- package/src/components/AnnotationsOverlay.jsx +21 -6
- package/src/lib/AnnotationItem.js +18 -0
- package/src/lib/AnnotationResource.js +14 -0
- package/src/lib/CanvasAnnotationDisplay.js +76 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { $ as e, E as t, F as n, G as r, L as i, N as a, R as o, S as s, b as c, f as l, m as u, rt as d, tt as f, u as p, ut as m, w as h } from "./getters-B4oepJRC.js";
|
|
2
|
+
import { $t as g, Bt as _, It as v, Qt as y, Xt as b, Yt as x, p as S, t as C, un as w } from "./canvases-DTR37lo-.js";
|
|
3
|
+
import { useEffect as T, useMemo as E, useRef as D } from "react";
|
|
4
|
+
//#region node_modules/lodash/_isFlattenable.js
|
|
5
|
+
var O = /* @__PURE__ */ m(((e, t) => {
|
|
6
|
+
var n = f(), r = h(), i = d(), a = n ? n.isConcatSpreadable : void 0;
|
|
7
|
+
function o(e) {
|
|
8
|
+
return i(e) || r(e) || !!(a && e && e[a]);
|
|
9
|
+
}
|
|
10
|
+
t.exports = o;
|
|
11
|
+
})), ee = /* @__PURE__ */ m(((e, t) => {
|
|
12
|
+
var n = x(), r = O();
|
|
13
|
+
function i(e, t, a, o, s) {
|
|
14
|
+
var c = -1, l = e.length;
|
|
15
|
+
for (a ||= r, s ||= []; ++c < l;) {
|
|
16
|
+
var u = e[c];
|
|
17
|
+
t > 0 && a(u) ? t > 1 ? i(u, t - 1, a, o, s) : n(s, u) : o || (s[s.length] = u);
|
|
18
|
+
}
|
|
19
|
+
return s;
|
|
20
|
+
}
|
|
21
|
+
t.exports = i;
|
|
22
|
+
})), k = /* @__PURE__ */ m(((e, t) => {
|
|
23
|
+
var n = o(), r = Math.max;
|
|
24
|
+
function i(e, t, i) {
|
|
25
|
+
return t = r(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
26
|
+
for (var a = arguments, o = -1, s = r(a.length - t, 0), c = Array(s); ++o < s;) c[o] = a[t + o];
|
|
27
|
+
o = -1;
|
|
28
|
+
for (var l = Array(t + 1); ++o < t;) l[o] = a[o];
|
|
29
|
+
return l[t] = i(c), n(e, this, l);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
t.exports = i;
|
|
33
|
+
})), A = /* @__PURE__ */ m(((e, t) => {
|
|
34
|
+
var i = r(), a = k(), o = n();
|
|
35
|
+
function s(e, t) {
|
|
36
|
+
return o(a(e, t, i), e + "");
|
|
37
|
+
}
|
|
38
|
+
t.exports = s;
|
|
39
|
+
})), j = /* @__PURE__ */ m(((e, t) => {
|
|
40
|
+
function n(e, t, n) {
|
|
41
|
+
for (var r = -1, i = e == null ? 0 : e.length; ++r < i;) if (n(t, e[r])) return !0;
|
|
42
|
+
return !1;
|
|
43
|
+
}
|
|
44
|
+
t.exports = n;
|
|
45
|
+
})), te = /* @__PURE__ */ m(((e, n) => {
|
|
46
|
+
var r = t(), a = i(), o = b();
|
|
47
|
+
n.exports = r && 1 / o(new r([, -0]))[1] == 1 / 0 ? function(e) {
|
|
48
|
+
return new r(e);
|
|
49
|
+
} : a;
|
|
50
|
+
})), M = /* @__PURE__ */ m(((e, t) => {
|
|
51
|
+
var n = g(), r = a(), i = j(), o = y(), s = te(), c = b(), l = 200;
|
|
52
|
+
function u(e, t, a) {
|
|
53
|
+
var u = -1, d = r, f = e.length, p = !0, m = [], h = m;
|
|
54
|
+
if (a) p = !1, d = i;
|
|
55
|
+
else if (f >= l) {
|
|
56
|
+
var g = t ? null : s(e);
|
|
57
|
+
if (g) return c(g);
|
|
58
|
+
p = !1, d = o, h = new n();
|
|
59
|
+
} else h = t ? [] : m;
|
|
60
|
+
outer: for (; ++u < f;) {
|
|
61
|
+
var _ = e[u], v = t ? t(_) : _;
|
|
62
|
+
if (_ = a || _ !== 0 ? _ : 0, p && v === v) {
|
|
63
|
+
for (var y = h.length; y--;) if (h[y] === v) continue outer;
|
|
64
|
+
t && h.push(v), m.push(_);
|
|
65
|
+
} else d(h, v, a) || (h !== m && h.push(v), m.push(_));
|
|
66
|
+
}
|
|
67
|
+
return m;
|
|
68
|
+
}
|
|
69
|
+
t.exports = u;
|
|
70
|
+
})), N = /* @__PURE__ */ m(((t, n) => {
|
|
71
|
+
var r = s(), i = e();
|
|
72
|
+
function a(e) {
|
|
73
|
+
return i(e) && r(e);
|
|
74
|
+
}
|
|
75
|
+
n.exports = a;
|
|
76
|
+
})), P = /* @__PURE__ */ m(((e, t) => {
|
|
77
|
+
var n = g(), r = a(), i = j(), o = w(), s = c(), l = y(), u = 200;
|
|
78
|
+
function d(e, t, a, c) {
|
|
79
|
+
var d = -1, f = r, p = !0, m = e.length, h = [], g = t.length;
|
|
80
|
+
if (!m) return h;
|
|
81
|
+
a && (t = o(t, s(a))), c ? (f = i, p = !1) : t.length >= u && (f = l, p = !1, t = new n(t));
|
|
82
|
+
outer: for (; ++d < m;) {
|
|
83
|
+
var _ = e[d], v = a == null ? _ : a(_);
|
|
84
|
+
if (_ = c || _ !== 0 ? _ : 0, p && v === v) {
|
|
85
|
+
for (var y = g; y--;) if (t[y] === v) continue outer;
|
|
86
|
+
h.push(_);
|
|
87
|
+
} else f(t, v, c) || h.push(_);
|
|
88
|
+
}
|
|
89
|
+
return h;
|
|
90
|
+
}
|
|
91
|
+
t.exports = d;
|
|
92
|
+
})), F = u([C, v], (e, t) => e ? t(e).imageResources : []), I = u([(e) => l(e).layers, (e, { windowId: t }) => t], (e, t) => e && e[t] || p), L = u([I, (e, { canvasId: t }) => t], (e, t) => e[t]), R = u([F, L], (e, t) => t ? e.sort((e, n) => t[e.id] && t[e.id].index !== void 0 && t[n.id] && t[n.id].index !== void 0 ? t[e.id].index - t[n.id].index : t[e.id] && t[e.id].index !== void 0 ? -1 : t[n.id] && t[n.id].index !== void 0 ? 1 : 0) : e), z = u([S, I], (e, t) => e.reduce((e, n) => (e[n] = t[n], e), {})), B = "text/plain", V = "us-ascii", H = "%(?:3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)", U = "__normalize_url_encoded_reserved__", W = /__normalize_url_encoded_reserved__(\d+)__/g, G = new RegExp(H, "i"), K = new RegExp(H, "gi"), q = (e, t) => Array.isArray(t) && t.some((t) => t instanceof RegExp ? t.flags.includes("g") || t.flags.includes("y") ? new RegExp(t.source, t.flags.replaceAll(/[gy]/g, "")).test(e) : t.test(e) : t === e), J = /* @__PURE__ */ new Set([
|
|
93
|
+
"https:",
|
|
94
|
+
"http:",
|
|
95
|
+
"file:"
|
|
96
|
+
]), Y = (e) => {
|
|
97
|
+
if (typeof e != "string") return;
|
|
98
|
+
let t = e.trim().toLowerCase().replace(/:$/, "");
|
|
99
|
+
return t === "" ? void 0 : `${t}:`;
|
|
100
|
+
}, X = (e) => {
|
|
101
|
+
try {
|
|
102
|
+
let { protocol: t } = new URL(e), n = e.slice(0, t.length + 2).toLowerCase() === `${t}//`;
|
|
103
|
+
if (t === "localhost:" && !n && /^\d{1,5}([/?#]|$)/.test(e.slice(t.length))) return;
|
|
104
|
+
if (t.endsWith(":") && (!t.includes(".") || n) && !J.has(t)) return t;
|
|
105
|
+
} catch {}
|
|
106
|
+
}, Z = (e) => {
|
|
107
|
+
try {
|
|
108
|
+
return decodeURIComponent(e.replaceAll("+", "%20"));
|
|
109
|
+
} catch {
|
|
110
|
+
return new URLSearchParams(`${e}=`).keys().next().value;
|
|
111
|
+
}
|
|
112
|
+
}, ne = (e) => {
|
|
113
|
+
let t = /* @__PURE__ */ new Set();
|
|
114
|
+
if (!e) return t;
|
|
115
|
+
for (let n of e.slice(1).split("&")) n && !n.includes("=") && t.add(Z(n));
|
|
116
|
+
return t;
|
|
117
|
+
}, re = (e) => {
|
|
118
|
+
let t = e;
|
|
119
|
+
try {
|
|
120
|
+
t = decodeURIComponent(e);
|
|
121
|
+
} catch {
|
|
122
|
+
t = new URLSearchParams(e).toString();
|
|
123
|
+
}
|
|
124
|
+
let n = (e) => {
|
|
125
|
+
let t = /* @__PURE__ */ new Set();
|
|
126
|
+
for (let n of e.matchAll(W)) t.add(Number.parseInt(n[1], 10));
|
|
127
|
+
return t;
|
|
128
|
+
}, r = n(e);
|
|
129
|
+
for (let e of n(t)) r.add(e);
|
|
130
|
+
let i = 0;
|
|
131
|
+
for (; r.has(i);) i++;
|
|
132
|
+
return `${U}${i}__`;
|
|
133
|
+
}, ie = (e, t) => {
|
|
134
|
+
if (!t) return e.sort(), e.toString();
|
|
135
|
+
let n = (e) => e.replace(t, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))), r = [...e.entries()];
|
|
136
|
+
return r.sort(([e], [t]) => {
|
|
137
|
+
let r = n(e), i = n(t);
|
|
138
|
+
return r < i ? -1 : +(r > i);
|
|
139
|
+
}), new URLSearchParams(r).toString();
|
|
140
|
+
}, Q = (e, t) => t ? e.replace(t, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))) : e, ae = (e, t, n) => {
|
|
141
|
+
let r = t === "always", i = t === "never", a = r || i ? void 0 : ne(n), o = (e) => e.replaceAll("+", "%20"), s = (e) => r ? `${e}=` : i || a.has(Z(e)) ? e : `${e}=`, c = (e) => {
|
|
142
|
+
let t = e.indexOf("=");
|
|
143
|
+
if (t === -1) return s(o(e));
|
|
144
|
+
let n = e.slice(0, t), r = e.slice(t + 1);
|
|
145
|
+
return r === "" ? n === "" ? "=" : s(o(n)) : `${o(n)}=${r}`;
|
|
146
|
+
}, l = e.slice(1).split("&").filter(Boolean);
|
|
147
|
+
return l.length === 0 ? "" : `?${l.map((e) => c(e)).join("&")}`;
|
|
148
|
+
}, oe = (e, { stripHash: t }) => {
|
|
149
|
+
let n = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(e);
|
|
150
|
+
if (!n) throw Error(`Invalid URL: ${e}`);
|
|
151
|
+
let { type: r, data: i, hash: a } = n.groups, o = r.split(";"), s = o.at(-1) === "base64";
|
|
152
|
+
s && o.pop();
|
|
153
|
+
let c = o.shift().toLowerCase(), l = [...o.map((e) => {
|
|
154
|
+
let [t, n = ""] = e.split("=").map((e) => e.trim());
|
|
155
|
+
return t === "charset" && (n = n.toLowerCase(), n === V) ? "" : `${t}${n ? `=${n}` : ""}`;
|
|
156
|
+
}).filter(Boolean)];
|
|
157
|
+
s && l.push("base64"), (l.length > 0 || c && c !== B) && l.unshift(c);
|
|
158
|
+
let u = t || !a ? "" : `#${a}`;
|
|
159
|
+
return `data:${l.join(";")},${s ? i.trim() : i}${u}`;
|
|
160
|
+
};
|
|
161
|
+
function $(e, t) {
|
|
162
|
+
if (t = {
|
|
163
|
+
defaultProtocol: "http",
|
|
164
|
+
normalizeProtocol: !0,
|
|
165
|
+
forceHttp: !1,
|
|
166
|
+
forceHttps: !1,
|
|
167
|
+
stripAuthentication: !0,
|
|
168
|
+
stripHash: !1,
|
|
169
|
+
stripTextFragment: !0,
|
|
170
|
+
stripWWW: !0,
|
|
171
|
+
removeQueryParameters: [/^utm_\w+/i],
|
|
172
|
+
removeTrailingSlash: !0,
|
|
173
|
+
removeSingleSlash: !0,
|
|
174
|
+
removeDirectoryIndex: !1,
|
|
175
|
+
removeExplicitPort: !1,
|
|
176
|
+
sortQueryParameters: !0,
|
|
177
|
+
removePath: !1,
|
|
178
|
+
transformPath: !1,
|
|
179
|
+
emptyQueryValue: "preserve",
|
|
180
|
+
...t
|
|
181
|
+
}, typeof t.defaultProtocol == "string" && !t.defaultProtocol.endsWith(":") && (t.defaultProtocol = `${t.defaultProtocol}:`), e = e.trim(), /^data:/i.test(e)) return oe(e, t);
|
|
182
|
+
let n = Array.isArray(t.customProtocols) ? t.customProtocols : [], r = new Set(n.map((e) => Y(e)).filter(Boolean)), i = X(e);
|
|
183
|
+
if (i && !r.has(i)) return e;
|
|
184
|
+
let a = e.startsWith("//");
|
|
185
|
+
!(!a && /^\.*\//.test(e)) && !i && (e = e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, t.defaultProtocol));
|
|
186
|
+
let o = new URL(e);
|
|
187
|
+
if (t.forceHttp && t.forceHttps) throw Error("The `forceHttp` and `forceHttps` options cannot be used together");
|
|
188
|
+
if (t.forceHttp && o.protocol === "https:" && (o.protocol = "http:"), t.forceHttps && o.protocol === "http:" && (o.protocol = "https:"), t.stripAuthentication && (o.username = "", o.password = ""), t.stripHash ? o.hash = "" : t.stripTextFragment && (o.hash = o.hash.replace(/#?:~:text.*?$/i, "")), o.pathname) {
|
|
189
|
+
let e = /\b[a-z][a-z\d+\-.]{1,50}:\/\//g, t = 0, n = "";
|
|
190
|
+
for (;;) {
|
|
191
|
+
let r = e.exec(o.pathname);
|
|
192
|
+
if (!r) break;
|
|
193
|
+
let i = r[0], a = r.index, s = o.pathname.slice(t, a);
|
|
194
|
+
n += s.replaceAll(/\/{2,}/g, "/"), n += i, t = a + i.length;
|
|
195
|
+
}
|
|
196
|
+
let r = o.pathname.slice(t);
|
|
197
|
+
n += r.replaceAll(/\/{2,}/g, "/"), o.pathname = n;
|
|
198
|
+
}
|
|
199
|
+
if (o.pathname) try {
|
|
200
|
+
o.pathname = decodeURI(o.pathname).replaceAll("\\", "%5C");
|
|
201
|
+
} catch {}
|
|
202
|
+
if (t.removeDirectoryIndex === !0 && (t.removeDirectoryIndex = [/^index\.[a-z]+$/]), Array.isArray(t.removeDirectoryIndex) && t.removeDirectoryIndex.length > 0) {
|
|
203
|
+
let e = o.pathname.split("/").filter(Boolean), n = e.at(-1);
|
|
204
|
+
n && q(n, t.removeDirectoryIndex) && (e.pop(), o.pathname = e.length > 0 ? `/${e.join("/")}/` : "/");
|
|
205
|
+
}
|
|
206
|
+
if (t.removePath && (o.pathname = "/"), t.transformPath && typeof t.transformPath == "function") {
|
|
207
|
+
let e = o.pathname.split("/").filter(Boolean), n = t.transformPath(e);
|
|
208
|
+
o.pathname = n?.length > 0 ? `/${n.join("/")}` : "/";
|
|
209
|
+
}
|
|
210
|
+
o.hostname && (o.hostname = o.hostname.replace(/\.$/, ""), t.stripWWW && /^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname) && (o.hostname = o.hostname.replace(/^www\./, "")));
|
|
211
|
+
let s = o.search, c;
|
|
212
|
+
if (t.sortQueryParameters && G.test(s)) {
|
|
213
|
+
let e = re(s);
|
|
214
|
+
o.search = s.replaceAll(K, (t) => `${e}${t.slice(1).toUpperCase()}`), c = RegExp(`${e}([0-9A-F]{2})`, "g");
|
|
215
|
+
}
|
|
216
|
+
let l = Array.isArray(t.keepQueryParameters), { searchParams: u } = o;
|
|
217
|
+
if (!l && Array.isArray(t.removeQueryParameters) && t.removeQueryParameters.length > 0) for (let e of [...u.keys()]) q(Q(e, c), t.removeQueryParameters) && u.delete(e);
|
|
218
|
+
if (!l && t.removeQueryParameters === !0 && (o.search = ""), l && t.keepQueryParameters.length > 0) for (let e of [...u.keys()]) q(Q(e, c), t.keepQueryParameters) || u.delete(e);
|
|
219
|
+
else l && (o.search = "");
|
|
220
|
+
t.sortQueryParameters && (o.search = ie(o.searchParams, c), o.search = decodeURIComponent(o.search.replaceAll(/%(?:26|23|3f|25|2b)/gi, (e) => `%25${e.slice(1)}`)), c && (o.search = o.search.replace(c, "%$1"))), o.search = ae(o.search, t.emptyQueryValue, s), t.removeTrailingSlash && (o.pathname = o.pathname.replace(/\/$/, "")), t.removeExplicitPort && o.port && (o.port = "");
|
|
221
|
+
let d = e;
|
|
222
|
+
return e = o.toString(), !t.removeSingleSlash && o.pathname === "/" && !d.endsWith("/") && o.hash === "" && (e = e.replace(/\/$/, "")), (t.removeTrailingSlash || o.pathname === "/") && o.hash === "" && t.removeSingleSlash && (e = e.replace(/\/$/, "")), a && !t.normalizeProtocol && (e = e.replace(/^http:\/\//, "//")), t.stripProtocol && (e = e.replace(/^(?:https?:)?\/\//, "")), e;
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/lib/CanvasWorld.js
|
|
226
|
+
var se = class {
|
|
227
|
+
constructor(e, t, n = "left-to-right") {
|
|
228
|
+
this.canvases = e, this.layers = t, this.viewingDirection = n, this._canvasDimensions = null;
|
|
229
|
+
}
|
|
230
|
+
get canvasIds() {
|
|
231
|
+
return this.canvases.map((e) => e.id);
|
|
232
|
+
}
|
|
233
|
+
get canvasDimensions() {
|
|
234
|
+
if (this._canvasDimensions) return this._canvasDimensions;
|
|
235
|
+
let [e, t] = this.canvasDirection, n = Math.min(...t === 0 ? this.canvases.map((e) => e.getHeight()) : this.canvases.map((e) => e.getWidth())), r = 0, i = 0, a = this.canvases.reduce((a, o) => {
|
|
236
|
+
let s = 0, c = 0;
|
|
237
|
+
return Number.isNaN(o.aspectRatio) || (t === 0 ? (s = n, c = Math.floor(n * o.aspectRatio)) : (c = n, s = Math.floor(n * (1 / o.aspectRatio)))), a.push({
|
|
238
|
+
canvas: o,
|
|
239
|
+
height: s,
|
|
240
|
+
width: c,
|
|
241
|
+
x: r,
|
|
242
|
+
y: i
|
|
243
|
+
}), r += e * c, i += t * s, a;
|
|
244
|
+
}, []), o = t === 0 ? n : Math.abs(i), s = e === 0 ? n : Math.abs(r);
|
|
245
|
+
return this._canvasDimensions = a.reduce((n, r) => (n.push({
|
|
246
|
+
...r,
|
|
247
|
+
x: e === -1 ? r.x + s - r.width : r.x,
|
|
248
|
+
y: t === -1 ? r.y + o - r.height : r.y
|
|
249
|
+
}), n), []), this._canvasDimensions;
|
|
250
|
+
}
|
|
251
|
+
contentResourceToWorldCoordinates(e) {
|
|
252
|
+
let t = this.canvases.findIndex((t) => t.imageResources.find((t) => t.id === e.id)), n = this.canvases[t];
|
|
253
|
+
if (!n) return [];
|
|
254
|
+
let [r, i, a, o] = this.canvasToWorldCoordinates(n.id), s = n.onFragment(e.id);
|
|
255
|
+
return s ? [
|
|
256
|
+
r + s[0],
|
|
257
|
+
i + s[1],
|
|
258
|
+
s[2],
|
|
259
|
+
s[3]
|
|
260
|
+
] : [
|
|
261
|
+
r,
|
|
262
|
+
i,
|
|
263
|
+
a,
|
|
264
|
+
o
|
|
265
|
+
];
|
|
266
|
+
}
|
|
267
|
+
canvasToWorldCoordinates(e) {
|
|
268
|
+
let t = this.canvasDimensions.find((t) => t.canvas.id === e);
|
|
269
|
+
return [
|
|
270
|
+
t.x,
|
|
271
|
+
t.y,
|
|
272
|
+
t.width,
|
|
273
|
+
t.height
|
|
274
|
+
];
|
|
275
|
+
}
|
|
276
|
+
get canvasDirection() {
|
|
277
|
+
switch (this.viewingDirection) {
|
|
278
|
+
case "left-to-right": return [1, 0];
|
|
279
|
+
case "right-to-left": return [-1, 0];
|
|
280
|
+
case "top-to-bottom": return [0, 1];
|
|
281
|
+
case "bottom-to-top": return [0, -1];
|
|
282
|
+
default: return [1, 0];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
contentResource(e) {
|
|
286
|
+
let t = this.canvases.find((t) => t.imageServiceIds.some((t) => t && e && $(t, { stripAuthentication: !1 }) === $(e, { stripAuthentication: !1 })));
|
|
287
|
+
if (t) return t.imageResources.find((t) => $(_(t).id, { stripAuthentication: !1 }) === $(e, { stripAuthentication: !1 }));
|
|
288
|
+
}
|
|
289
|
+
getLayerMetadata(e) {
|
|
290
|
+
let t = this.canvases.find((t) => t.imageResources.find((t) => t.id === e.id));
|
|
291
|
+
if (!t) return;
|
|
292
|
+
let n = t.imageResources.findIndex((t) => t.id === e.id), r = t.imageResources.find((t) => t.id === e.id), i = this.layers && this.layers[t.canvas.id], a = i && i[e.id] || {};
|
|
293
|
+
return {
|
|
294
|
+
index: n,
|
|
295
|
+
opacity: 1,
|
|
296
|
+
total: t.imageResources.length,
|
|
297
|
+
visibility: !!r.preferred,
|
|
298
|
+
...a
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
layerOpacityOfImageResource(e) {
|
|
302
|
+
let t = this.getLayerMetadata(e);
|
|
303
|
+
return t ? t.visibility ? t.opacity : 0 : 1;
|
|
304
|
+
}
|
|
305
|
+
layerIndexOfImageResource(e) {
|
|
306
|
+
let t = this.getLayerMetadata(e);
|
|
307
|
+
if (t) return t.index;
|
|
308
|
+
}
|
|
309
|
+
offsetByCanvas(e) {
|
|
310
|
+
let t = this.canvasToWorldCoordinates(e);
|
|
311
|
+
return {
|
|
312
|
+
x: t[0],
|
|
313
|
+
y: t[1]
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
hasDimensions() {
|
|
317
|
+
return this.canvasDimensions.length > 0;
|
|
318
|
+
}
|
|
319
|
+
worldBounds() {
|
|
320
|
+
return [
|
|
321
|
+
0,
|
|
322
|
+
0,
|
|
323
|
+
Math.max(0, ...this.canvasDimensions.map((e) => e.x + e.width)),
|
|
324
|
+
Math.max(0, ...this.canvasDimensions.map((e) => e.y + e.height))
|
|
325
|
+
];
|
|
326
|
+
}
|
|
327
|
+
canvasAtPoint(e) {
|
|
328
|
+
let t = this.canvasDimensions.find((t) => t.x <= e.x && e.x <= t.x + t.width && t.y <= e.y && e.y <= t.y + t.height);
|
|
329
|
+
return t && t.canvas;
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region node_modules/use-debounce/dist/index.module.js
|
|
334
|
+
function ce(e, t, n, r) {
|
|
335
|
+
var i = this, a = D(null), o = D(0), s = D(0), c = D(null), l = D([]), u = D(), d = D(), f = D(e), p = D(!0), m = D(), h = D();
|
|
336
|
+
f.current = e;
|
|
337
|
+
var g = typeof window < "u", _ = !t && t !== 0 && g;
|
|
338
|
+
if (typeof e != "function") throw TypeError("Expected a function");
|
|
339
|
+
t = +t || 0;
|
|
340
|
+
var v = !!(n ||= {}).leading, y = !("trailing" in n) || !!n.trailing, b = !!n.flushOnExit && y, x = "maxWait" in n, S = "debounceOnServer" in n && !!n.debounceOnServer, C = x ? Math.max(+n.maxWait || 0, t) : null, w = E(function() {
|
|
341
|
+
var e = function(e) {
|
|
342
|
+
var t = l.current, n = u.current;
|
|
343
|
+
return l.current = u.current = null, o.current = e, s.current = s.current || e, d.current = f.current.apply(n, t);
|
|
344
|
+
}, n = function(e, t) {
|
|
345
|
+
_ && cancelAnimationFrame(c.current), c.current = _ ? requestAnimationFrame(e) : setTimeout(e, t);
|
|
346
|
+
}, w = function(e) {
|
|
347
|
+
if (!p.current) return !1;
|
|
348
|
+
var n = e - a.current;
|
|
349
|
+
return !a.current || n >= t || n < 0 || x && e - o.current >= C;
|
|
350
|
+
}, T = function(t) {
|
|
351
|
+
return c.current = null, y && l.current ? e(t) : (l.current = u.current = null, d.current);
|
|
352
|
+
}, E = function e() {
|
|
353
|
+
var r = Date.now();
|
|
354
|
+
if (v && s.current === o.current && D(), w(r)) return T(r);
|
|
355
|
+
if (p.current) {
|
|
356
|
+
var i = t - (r - a.current);
|
|
357
|
+
n(e, x ? Math.min(i, C - (r - o.current)) : i);
|
|
358
|
+
}
|
|
359
|
+
}, D = function() {
|
|
360
|
+
r && r({});
|
|
361
|
+
}, O = function() {
|
|
362
|
+
if (g || S) {
|
|
363
|
+
var r, s = Date.now(), f = w(s);
|
|
364
|
+
if (l.current = [].slice.call(arguments), u.current = i, a.current = s, b && !m.current && (m.current = function() {
|
|
365
|
+
globalThis.document?.visibilityState === "hidden" && h.current.flush();
|
|
366
|
+
}, (r = globalThis.document) == null || r.addEventListener == null || r.addEventListener("visibilitychange", m.current)), f) {
|
|
367
|
+
if (!c.current && p.current) return o.current = a.current, n(E, t), v ? e(a.current) : d.current;
|
|
368
|
+
if (x) return n(E, t), e(a.current);
|
|
369
|
+
}
|
|
370
|
+
return c.current || n(E, t), d.current;
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
return O.cancel = function() {
|
|
374
|
+
var e = c.current;
|
|
375
|
+
e && (_ ? cancelAnimationFrame(c.current) : clearTimeout(c.current)), o.current = 0, l.current = a.current = u.current = c.current = null, e && r && r({});
|
|
376
|
+
}, O.isPending = function() {
|
|
377
|
+
return !!c.current;
|
|
378
|
+
}, O.flush = function() {
|
|
379
|
+
return c.current ? T(Date.now()) : d.current;
|
|
380
|
+
}, O;
|
|
381
|
+
}, [
|
|
382
|
+
v,
|
|
383
|
+
x,
|
|
384
|
+
t,
|
|
385
|
+
C,
|
|
386
|
+
y,
|
|
387
|
+
b,
|
|
388
|
+
_,
|
|
389
|
+
g,
|
|
390
|
+
S,
|
|
391
|
+
r
|
|
392
|
+
]);
|
|
393
|
+
return h.current = w, T(function() {
|
|
394
|
+
return p.current = !0, function() {
|
|
395
|
+
var e;
|
|
396
|
+
b && h.current.flush(), m.current &&= ((e = globalThis.document) == null || e.removeEventListener == null || e.removeEventListener("visibilitychange", m.current), null), p.current = !1;
|
|
397
|
+
};
|
|
398
|
+
}, [b]), w;
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
export { L as a, R as c, M as d, A as f, F as i, P as l, ee as m, se as n, z as o, k as p, $ as r, I as s, ce as t, N as u };
|
|
402
|
+
|
|
403
|
+
//# sourceMappingURL=index.module-CgUBfaXx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module-CgUBfaXx.js","names":["r","n","t"],"sources":["../node_modules/lodash/_isFlattenable.js","../node_modules/lodash/_baseFlatten.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/_arrayIncludesWith.js","../node_modules/lodash/_createSet.js","../node_modules/lodash/_baseUniq.js","../node_modules/lodash/isArrayLikeObject.js","../node_modules/lodash/_baseDifference.js","../src/state/selectors/layers.js","../node_modules/normalize-url/index.js","../src/lib/CanvasWorld.js","../node_modules/use-debounce/dist/index.module.js"],"sourcesContent":["var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","import { createSelector } from 'reselect';\nimport { getMiradorCanvasWrapper } from './wrappers';\nimport { getCanvas, getVisibleCanvasIds } from './canvases';\nimport { miradorSlice, EMPTY_ARRAY } from './utils';\n\n/**\n * Get the image layers from a canvas.\n * @param {object} state\n * @param {object} props\n * @param {string} props.canvasId\n * @param {string} props.windowId\n * @param {string} props.companionWindowId\n * @returns {Array}\n */\nexport const getCanvasLayers = createSelector([getCanvas, getMiradorCanvasWrapper], (canvas, getMiradorCanvas) => {\n if (!canvas) return [];\n return getMiradorCanvas(canvas).imageResources;\n});\n\nexport const getLayersForWindow = createSelector(\n [(state) => miradorSlice(state).layers, (state, { windowId }) => windowId],\n (layers, windowId) => (layers ? layers[windowId] || EMPTY_ARRAY : EMPTY_ARRAY),\n);\n\n/**\n * Get the layer state for a particular canvas.\n * @param {object} state\n * @param {string} windowId\n * @returns {object}\n */\nexport const getLayers = createSelector(\n [getLayersForWindow, (state, { canvasId }) => canvasId],\n (layers, canvasId) => layers[canvasId],\n);\n\n/**\n * Returns a list of canvas layers, sorted by the layer state configuration.\n * @param {object} state\n * @param {object} props\n * @param {string} props.companionWindowId\n * @returns {Array}\n */\nexport const getSortedLayers = createSelector([getCanvasLayers, getLayers], (canvasLayers, layerConfig) => {\n if (!layerConfig) return canvasLayers;\n\n const sorted = canvasLayers.sort((a, b) => {\n if (\n layerConfig[a.id] &&\n layerConfig[a.id].index !== undefined &&\n layerConfig[b.id] &&\n layerConfig[b.id].index !== undefined\n ) {\n return layerConfig[a.id].index - layerConfig[b.id].index;\n }\n\n // sort a layer with index data above layers without\n if (layerConfig[a.id] && layerConfig[a.id].index !== undefined) return -1;\n if (layerConfig[b.id] && layerConfig[b.id].index !== undefined) return 1;\n\n return 0;\n });\n\n return sorted;\n});\n\n/**\n * Get all the layer configuration for visible canvases.\n * @param {object} state\n * @param {object} props\n * @param {string} props.windowId\n * @returns {object}\n */\nexport const getLayersForVisibleCanvases = createSelector([getVisibleCanvasIds, getLayersForWindow], (canvasIds, layers) =>\n canvasIds.reduce((acc, canvasId) => {\n // eslint-disable-next-line no-param-reassign\n acc[canvasId] = layers[canvasId];\n return acc;\n }, {}),\n);\n","// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\nconst DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';\nconst DATA_URL_DEFAULT_CHARSET = 'us-ascii';\n\nconst encodedReservedCharactersPattern = '%(?:3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)';\nconst temporaryEncodedReservedTokenBase = '__normalize_url_encoded_reserved__';\nconst temporaryEncodedReservedTokenPattern = /__normalize_url_encoded_reserved__(\\d+)__/g;\nconst hasEncodedReservedCharactersRegex = new RegExp(encodedReservedCharactersPattern, 'i');\nconst encodedReservedCharactersRegex = new RegExp(encodedReservedCharactersPattern, 'gi');\n\nconst testParameter = (name, filters) => Array.isArray(filters) && filters.some(filter => {\n\tif (filter instanceof RegExp) {\n\t\tif (filter.flags.includes('g') || filter.flags.includes('y')) {\n\t\t\treturn new RegExp(filter.source, filter.flags.replaceAll(/[gy]/g, '')).test(name);\n\t\t}\n\n\t\treturn filter.test(name);\n\t}\n\n\treturn filter === name;\n});\n\nconst supportedProtocols = new Set([\n\t'https:',\n\t'http:',\n\t'file:',\n]);\n\nconst normalizeCustomProtocolOption = protocol => {\n\tif (typeof protocol !== 'string') {\n\t\treturn undefined;\n\t}\n\n\tconst normalizedProtocol = protocol.trim().toLowerCase().replace(/:$/, '');\n\treturn normalizedProtocol === '' ? undefined : `${normalizedProtocol}:`;\n};\n\nconst getCustomProtocol = urlString => {\n\ttry {\n\t\tconst {protocol} = new URL(urlString);\n\t\tconst hasAuthority = urlString.slice(0, protocol.length + 2).toLowerCase() === `${protocol}//`;\n\n\t\t// Avoid treating \"localhost:port\" (e.g. \"localhost:9802\") as a custom protocol.\n\t\tif (protocol === 'localhost:' && !hasAuthority && /^\\d{1,5}([/?#]|$)/.test(urlString.slice(protocol.length))) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (protocol.endsWith(':')\n\t\t\t&& (!protocol.includes('.') || hasAuthority)\n\t\t\t&& !supportedProtocols.has(protocol)) {\n\t\t\treturn protocol;\n\t\t}\n\t} catch {}\n\n\treturn undefined;\n};\n\nconst decodeQueryKey = value => {\n\ttry {\n\t\treturn decodeURIComponent(value.replaceAll('+', '%20'));\n\t} catch {\n\t\t// Match URLSearchParams behavior for malformed percent-encoding.\n\t\treturn new URLSearchParams(`${value}=`).keys().next().value;\n\t}\n};\n\nconst getKeysWithoutEquals = search => {\n\tconst keys = new Set();\n\tif (!search) {\n\t\treturn keys;\n\t}\n\n\tfor (const part of search.slice(1).split('&')) {\n\t\tif (part && !part.includes('=')) {\n\t\t\tkeys.add(decodeQueryKey(part));\n\t\t}\n\t}\n\n\treturn keys;\n};\n\nconst getTemporaryEncodedReservedTokenPrefix = search => {\n\tlet decodedSearch = search;\n\n\ttry {\n\t\tdecodedSearch = decodeURIComponent(search);\n\t} catch {\n\t\tdecodedSearch = new URLSearchParams(search).toString();\n\t}\n\n\tconst getUsedTokenIndexes = value => {\n\t\tconst indexes = new Set();\n\n\t\tfor (const match of value.matchAll(temporaryEncodedReservedTokenPattern)) {\n\t\t\tindexes.add(Number.parseInt(match[1], 10));\n\t\t}\n\n\t\treturn indexes;\n\t};\n\n\tconst usedTokenIndexes = getUsedTokenIndexes(search);\n\tfor (const tokenIndex of getUsedTokenIndexes(decodedSearch)) {\n\t\tusedTokenIndexes.add(tokenIndex);\n\t}\n\n\tlet tokenIndex = 0;\n\twhile (usedTokenIndexes.has(tokenIndex)) {\n\t\ttokenIndex++;\n\t}\n\n\treturn `${temporaryEncodedReservedTokenBase}${tokenIndex}__`;\n};\n\nconst sortSearchParameters = (searchParameters, encodedReservedTokenRegex) => {\n\tif (!encodedReservedTokenRegex) {\n\t\tsearchParameters.sort();\n\t\treturn searchParameters.toString();\n\t}\n\n\tconst getSortableKey = key => key.replace(encodedReservedTokenRegex, (_, hexCode) => String.fromCodePoint(Number.parseInt(hexCode, 16)));\n\tconst entries = [...searchParameters.entries()];\n\tentries.sort(([leftKey], [rightKey]) => {\n\t\tconst left = getSortableKey(leftKey);\n\t\tconst right = getSortableKey(rightKey);\n\t\treturn left < right ? -1 : (left > right ? 1 : 0);\n\t});\n\n\treturn new URLSearchParams(entries).toString();\n};\n\nconst decodeReservedTokens = (value, encodedReservedTokenRegex) => {\n\tif (!encodedReservedTokenRegex) {\n\t\treturn value;\n\t}\n\n\treturn value.replace(encodedReservedTokenRegex, (_, hexCode) => String.fromCodePoint(Number.parseInt(hexCode, 16)));\n};\n\nconst normalizeEmptyQueryParameters = (search, emptyQueryValue, originalSearch) => {\n\tconst isAlways = emptyQueryValue === 'always';\n\tconst isNever = emptyQueryValue === 'never';\n\tconst keysWithoutEquals = (isAlways || isNever) ? undefined : getKeysWithoutEquals(originalSearch);\n\n\tconst normalizeKey = key => key.replaceAll('+', '%20');\n\tconst formatEmptyValue = normalizedKey => {\n\t\tif (isAlways) {\n\t\t\treturn `${normalizedKey}=`;\n\t\t}\n\n\t\tif (isNever) {\n\t\t\treturn normalizedKey;\n\t\t}\n\n\t\treturn keysWithoutEquals.has(decodeQueryKey(normalizedKey)) ? normalizedKey : `${normalizedKey}=`;\n\t};\n\n\tconst normalizeParameter = parameter => {\n\t\tconst equalIndex = parameter.indexOf('=');\n\n\t\tif (equalIndex === -1) {\n\t\t\t// Normalize + to %20 (+ means space in query strings)\n\t\t\treturn formatEmptyValue(normalizeKey(parameter));\n\t\t}\n\n\t\tconst key = parameter.slice(0, equalIndex);\n\t\tconst value = parameter.slice(equalIndex + 1);\n\n\t\tif (value === '') {\n\t\t\tif (key === '') {\n\t\t\t\treturn '=';\n\t\t\t}\n\n\t\t\t// Normalize + to %20 (+ means space in query strings)\n\t\t\treturn formatEmptyValue(normalizeKey(key));\n\t\t}\n\n\t\t// Normalize + to %20 in key.\n\t\treturn `${normalizeKey(key)}=${value}`;\n\t};\n\n\tconst parameters = search.slice(1).split('&').filter(Boolean);\n\treturn parameters.length === 0 ? '' : `?${parameters.map(x => normalizeParameter(x)).join('&')}`;\n};\n\nconst normalizeDataURL = (urlString, {stripHash}) => {\n\tconst match = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(urlString);\n\n\tif (!match) {\n\t\tthrow new Error(`Invalid URL: ${urlString}`);\n\t}\n\n\tconst {type, data, hash} = match.groups;\n\tconst mediaType = type.split(';');\n\n\tconst isBase64 = mediaType.at(-1) === 'base64';\n\tif (isBase64) {\n\t\tmediaType.pop();\n\t}\n\n\t// Lowercase MIME type\n\tconst mimeType = mediaType.shift().toLowerCase();\n\tconst attributes = mediaType\n\t\t.map(attribute => {\n\t\t\tlet [key, value = ''] = attribute.split('=').map(string => string.trim());\n\n\t\t\t// Lowercase `charset`\n\t\t\tif (key === 'charset') {\n\t\t\t\tvalue = value.toLowerCase();\n\n\t\t\t\tif (value === DATA_URL_DEFAULT_CHARSET) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn `${key}${value ? `=${value}` : ''}`;\n\t\t})\n\t\t.filter(Boolean);\n\n\tconst normalizedMediaType = [...attributes];\n\n\tif (isBase64) {\n\t\tnormalizedMediaType.push('base64');\n\t}\n\n\tif (normalizedMediaType.length > 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) {\n\t\tnormalizedMediaType.unshift(mimeType);\n\t}\n\n\tconst hashPart = stripHash || !hash ? '' : `#${hash}`;\n\treturn `data:${normalizedMediaType.join(';')},${isBase64 ? data.trim() : data}${hashPart}`;\n};\n\nexport default function normalizeUrl(urlString, options) {\n\toptions = {\n\t\tdefaultProtocol: 'http',\n\t\tnormalizeProtocol: true,\n\t\tforceHttp: false,\n\t\tforceHttps: false,\n\t\tstripAuthentication: true,\n\t\tstripHash: false,\n\t\tstripTextFragment: true,\n\t\tstripWWW: true,\n\t\tremoveQueryParameters: [/^utm_\\w+/i],\n\t\tremoveTrailingSlash: true,\n\t\tremoveSingleSlash: true,\n\t\tremoveDirectoryIndex: false,\n\t\tremoveExplicitPort: false,\n\t\tsortQueryParameters: true,\n\t\tremovePath: false,\n\t\ttransformPath: false,\n\t\temptyQueryValue: 'preserve',\n\t\t...options,\n\t};\n\n\t// Legacy: Append `:` to the protocol if missing.\n\tif (typeof options.defaultProtocol === 'string' && !options.defaultProtocol.endsWith(':')) {\n\t\toptions.defaultProtocol = `${options.defaultProtocol}:`;\n\t}\n\n\turlString = urlString.trim();\n\n\t// Data URL\n\tif (/^data:/i.test(urlString)) {\n\t\treturn normalizeDataURL(urlString, options);\n\t}\n\n\tconst customProtocols = Array.isArray(options.customProtocols) ? options.customProtocols : [];\n\tconst normalizedCustomProtocols = new Set(customProtocols\n\t\t.map(protocol => normalizeCustomProtocolOption(protocol))\n\t\t.filter(Boolean));\n\n\tconst customProtocol = getCustomProtocol(urlString);\n\tif (customProtocol && !normalizedCustomProtocols.has(customProtocol)) {\n\t\treturn urlString;\n\t}\n\n\tconst hasRelativeProtocol = urlString.startsWith('//');\n\tconst isRelativeUrl = !hasRelativeProtocol && /^\\.*\\//.test(urlString);\n\n\t// Prepend protocol\n\tif (!isRelativeUrl && !customProtocol) {\n\t\turlString = urlString.replace(/^(?!(?:\\w+:)?\\/\\/)|^\\/\\//, options.defaultProtocol);\n\t}\n\n\tconst urlObject = new URL(urlString);\n\n\tif (options.forceHttp && options.forceHttps) {\n\t\tthrow new Error('The `forceHttp` and `forceHttps` options cannot be used together');\n\t}\n\n\tif (options.forceHttp && urlObject.protocol === 'https:') {\n\t\turlObject.protocol = 'http:';\n\t}\n\n\tif (options.forceHttps && urlObject.protocol === 'http:') {\n\t\turlObject.protocol = 'https:';\n\t}\n\n\t// Remove auth\n\tif (options.stripAuthentication) {\n\t\turlObject.username = '';\n\t\turlObject.password = '';\n\t}\n\n\t// Remove hash\n\tif (options.stripHash) {\n\t\turlObject.hash = '';\n\t} else if (options.stripTextFragment) {\n\t\turlObject.hash = urlObject.hash.replace(/#?:~:text.*?$/i, '');\n\t}\n\n\t// Remove duplicate slashes if not preceded by a protocol\n\t// NOTE: This could be implemented using a single negative lookbehind\n\t// regex, but we avoid that to maintain compatibility with older js engines\n\t// which do not have support for that feature.\n\tif (urlObject.pathname) {\n\t\t// TODO: Replace everything below with `urlObject.pathname = urlObject.pathname.replace(/(?<!\\b[a-z][a-z\\d+\\-.]{1,50}:)\\/{2,}/g, '/');` when Safari supports negative lookbehind.\n\n\t\t// Split the string by occurrences of this protocol regex, and perform\n\t\t// duplicate-slash replacement on the strings between those occurrences\n\t\t// (if any).\n\t\tconst protocolRegex = /\\b[a-z][a-z\\d+\\-.]{1,50}:\\/\\//g;\n\n\t\tlet lastIndex = 0;\n\t\tlet result = '';\n\t\tfor (;;) {\n\t\t\tconst match = protocolRegex.exec(urlObject.pathname);\n\t\t\tif (!match) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst protocol = match[0];\n\t\t\tconst protocolAtIndex = match.index;\n\t\t\tconst intermediate = urlObject.pathname.slice(lastIndex, protocolAtIndex);\n\n\t\t\tresult += intermediate.replaceAll(/\\/{2,}/g, '/');\n\t\t\tresult += protocol;\n\t\t\tlastIndex = protocolAtIndex + protocol.length;\n\t\t}\n\n\t\tconst remnant = urlObject.pathname.slice(lastIndex);\n\t\tresult += remnant.replaceAll(/\\/{2,}/g, '/');\n\n\t\turlObject.pathname = result;\n\t}\n\n\t// Decode URI octets\n\tif (urlObject.pathname) {\n\t\ttry {\n\t\t\turlObject.pathname = decodeURI(urlObject.pathname).replaceAll('\\\\', '%5C');\n\t\t} catch {}\n\t}\n\n\t// Remove directory index\n\tif (options.removeDirectoryIndex === true) {\n\t\toptions.removeDirectoryIndex = [/^index\\.[a-z]+$/];\n\t}\n\n\tif (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) {\n\t\tconst pathComponents = urlObject.pathname.split('/').filter(Boolean);\n\t\tconst lastComponent = pathComponents.at(-1);\n\n\t\tif (lastComponent && testParameter(lastComponent, options.removeDirectoryIndex)) {\n\t\t\tpathComponents.pop();\n\t\t\turlObject.pathname = pathComponents.length > 0 ? `/${pathComponents.join('/')}/` : '/';\n\t\t}\n\t}\n\n\t// Remove path\n\tif (options.removePath) {\n\t\turlObject.pathname = '/';\n\t}\n\n\t// Transform path components\n\tif (options.transformPath && typeof options.transformPath === 'function') {\n\t\tconst pathComponents = urlObject.pathname.split('/').filter(Boolean);\n\t\tconst newComponents = options.transformPath(pathComponents);\n\t\turlObject.pathname = newComponents?.length > 0 ? `/${newComponents.join('/')}` : '/';\n\t}\n\n\tif (urlObject.hostname) {\n\t\t// Remove trailing dot\n\t\turlObject.hostname = urlObject.hostname.replace(/\\.$/, '');\n\n\t\t// Remove `www.`\n\t\tif (options.stripWWW && /^www\\.(?!www\\.)[a-z\\-\\d]{1,63}\\.[a-z.\\-\\d]{2,63}$/.test(urlObject.hostname)) {\n\t\t\t// Each label should be max 63 at length (min: 1).\n\t\t\t// Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names\n\t\t\t// Each TLD should be up to 63 characters long (min: 2).\n\t\t\t// It is technically possible to have a single character TLD, but none currently exist.\n\t\t\turlObject.hostname = urlObject.hostname.replace(/^www\\./, '');\n\t\t}\n\t}\n\n\t// Capture original query params format before any searchParams modifications\n\tconst originalSearch = urlObject.search;\n\tlet encodedReservedTokenRegex;\n\n\tif (options.sortQueryParameters && hasEncodedReservedCharactersRegex.test(originalSearch)) {\n\t\tconst encodedReservedTokenPrefix = getTemporaryEncodedReservedTokenPrefix(originalSearch);\n\t\turlObject.search = originalSearch.replaceAll(encodedReservedCharactersRegex, match => `${encodedReservedTokenPrefix}${match.slice(1).toUpperCase()}`);\n\t\tencodedReservedTokenRegex = new RegExp(`${encodedReservedTokenPrefix}([0-9A-F]{2})`, 'g');\n\t}\n\n\tconst hasKeepQueryParameters = Array.isArray(options.keepQueryParameters);\n\tconst {searchParams} = urlObject;\n\n\t// Remove query unwanted parameters\n\tif (!hasKeepQueryParameters && Array.isArray(options.removeQueryParameters) && options.removeQueryParameters.length > 0) {\n\t\t// eslint-disable-next-line unicorn/no-useless-spread -- We are intentionally spreading to get a copy.\n\t\tfor (const key of [...searchParams.keys()]) {\n\t\t\tif (testParameter(decodeReservedTokens(key, encodedReservedTokenRegex), options.removeQueryParameters)) {\n\t\t\t\tsearchParams.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!hasKeepQueryParameters && options.removeQueryParameters === true) {\n\t\turlObject.search = '';\n\t}\n\n\t// Keep wanted query parameters\n\tif (hasKeepQueryParameters && options.keepQueryParameters.length > 0) {\n\t\t// eslint-disable-next-line unicorn/no-useless-spread -- We are intentionally spreading to get a copy.\n\t\tfor (const key of [...searchParams.keys()]) {\n\t\t\tif (!testParameter(decodeReservedTokens(key, encodedReservedTokenRegex), options.keepQueryParameters)) {\n\t\t\t\tsearchParams.delete(key);\n\t\t\t}\n\t\t}\n\t} else if (hasKeepQueryParameters) {\n\t\turlObject.search = '';\n\t}\n\n\t// Sort query parameters\n\tif (options.sortQueryParameters) {\n\t\turlObject.search = sortSearchParameters(urlObject.searchParams, encodedReservedTokenRegex);\n\n\t\t// Sorting and serializing encode the search parameters, so we need to decode them again.\n\t\t// Protect &%#? and %2B from decoding (would break URL structure or change meaning) by double-encoding them first.\n\t\turlObject.search = decodeURIComponent(urlObject.search.replaceAll(/%(?:26|23|3f|25|2b)/gi, match => `%25${match.slice(1)}`));\n\n\t\tif (encodedReservedTokenRegex) {\n\t\t\turlObject.search = urlObject.search.replace(encodedReservedTokenRegex, '%$1');\n\t\t}\n\t}\n\n\t// Normalize empty query parameter values\n\turlObject.search = normalizeEmptyQueryParameters(urlObject.search, options.emptyQueryValue, originalSearch);\n\n\tif (options.removeTrailingSlash) {\n\t\turlObject.pathname = urlObject.pathname.replace(/\\/$/, '');\n\t}\n\n\t// Remove an explicit port number, excluding a default port number, if applicable\n\tif (options.removeExplicitPort && urlObject.port) {\n\t\turlObject.port = '';\n\t}\n\n\tconst oldUrlString = urlString;\n\n\t// Take advantage of many of the Node `url` normalizations\n\turlString = urlObject.toString();\n\n\tif (!options.removeSingleSlash && urlObject.pathname === '/' && !oldUrlString.endsWith('/') && urlObject.hash === '') {\n\t\turlString = urlString.replace(/\\/$/, '');\n\t}\n\n\t// Remove ending `/` unless removeSingleSlash is false\n\tif ((options.removeTrailingSlash || urlObject.pathname === '/') && urlObject.hash === '' && options.removeSingleSlash) {\n\t\turlString = urlString.replace(/\\/$/, '');\n\t}\n\n\t// Restore relative protocol, if applicable\n\tif (hasRelativeProtocol && !options.normalizeProtocol) {\n\t\turlString = urlString.replace(/^http:\\/\\//, '//');\n\t}\n\n\t// Remove http/https\n\tif (options.stripProtocol) {\n\t\turlString = urlString.replace(/^(?:https?:)?\\/\\//, '');\n\t}\n\n\treturn urlString;\n}\n","import normalizeUrl from 'normalize-url';\nimport { getIiifResourceImageService } from './iiif';\n\n/**\n * CanvasWorld\n */\nexport default class CanvasWorld {\n /**\n * @param {Array} canvases - Array of Manifesto:Canvas objects to create a\n * world from.\n */\n constructor(miradorCanvases, layers, viewingDirection = 'left-to-right') {\n this.canvases = miradorCanvases;\n this.layers = layers;\n this.viewingDirection = viewingDirection;\n this._canvasDimensions = null;\n }\n\n /** */\n get canvasIds() {\n return this.canvases.map((canvas) => canvas.id);\n }\n\n /** */\n get canvasDimensions() {\n if (this._canvasDimensions) {\n return this._canvasDimensions;\n }\n\n const [dirX, dirY] = this.canvasDirection;\n const scale =\n dirY === 0 ? Math.min(...this.canvases.map((c) => c.getHeight())) : Math.min(...this.canvases.map((c) => c.getWidth()));\n let incX = 0;\n let incY = 0;\n\n const canvasDims = this.canvases.reduce((acc, canvas) => {\n let canvasHeight = 0;\n let canvasWidth = 0;\n\n if (!Number.isNaN(canvas.aspectRatio)) {\n if (dirY === 0) {\n // constant height\n canvasHeight = scale;\n canvasWidth = Math.floor(scale * canvas.aspectRatio);\n } else {\n // constant width\n canvasWidth = scale;\n canvasHeight = Math.floor(scale * (1 / canvas.aspectRatio));\n }\n }\n\n acc.push({\n canvas,\n height: canvasHeight,\n width: canvasWidth,\n x: incX,\n y: incY,\n });\n\n incX += dirX * canvasWidth;\n incY += dirY * canvasHeight;\n return acc;\n }, []);\n\n const worldHeight = dirY === 0 ? scale : Math.abs(incY);\n const worldWidth = dirX === 0 ? scale : Math.abs(incX);\n\n this._canvasDimensions = canvasDims.reduce((acc, dims) => {\n acc.push({\n ...dims,\n x: dirX === -1 ? dims.x + worldWidth - dims.width : dims.x,\n y: dirY === -1 ? dims.y + worldHeight - dims.height : dims.y,\n });\n\n return acc;\n }, []);\n\n return this._canvasDimensions;\n }\n\n /**\n * contentResourceToWorldCoordinates - calculates the contentResource coordinates\n * respective to the world.\n */\n contentResourceToWorldCoordinates(contentResource) {\n const miradorCanvasIndex = this.canvases.findIndex((c) => c.imageResources.find((r) => r.id === contentResource.id));\n const canvas = this.canvases[miradorCanvasIndex];\n if (!canvas) return [];\n\n const [x, y, w, h] = this.canvasToWorldCoordinates(canvas.id);\n\n const fragmentOffset = canvas.onFragment(contentResource.id);\n if (fragmentOffset) {\n return [x + fragmentOffset[0], y + fragmentOffset[1], fragmentOffset[2], fragmentOffset[3]];\n }\n return [x, y, w, h];\n }\n\n /** */\n canvasToWorldCoordinates(canvasId) {\n const canvasDimensions = this.canvasDimensions.find((c) => c.canvas.id === canvasId);\n\n return [canvasDimensions.x, canvasDimensions.y, canvasDimensions.width, canvasDimensions.height];\n }\n\n /** */\n get canvasDirection() {\n switch (this.viewingDirection) {\n case 'left-to-right':\n return [1, 0];\n case 'right-to-left':\n return [-1, 0];\n case 'top-to-bottom':\n return [0, 1];\n case 'bottom-to-top':\n return [0, -1];\n default:\n return [1, 0];\n }\n }\n\n /** Get the IIIF content resource for an image */\n contentResource(infoResponseId) {\n const miradorCanvas = this.canvases.find((c) =>\n c.imageServiceIds.some(\n (id) =>\n id &&\n infoResponseId &&\n normalizeUrl(id, { stripAuthentication: false }) === normalizeUrl(infoResponseId, { stripAuthentication: false }),\n ),\n );\n if (!miradorCanvas) return undefined;\n return miradorCanvas.imageResources.find(\n (r) =>\n normalizeUrl(getIiifResourceImageService(r).id, { stripAuthentication: false }) ===\n normalizeUrl(infoResponseId, { stripAuthentication: false }),\n );\n }\n\n /** @private */\n getLayerMetadata(contentResource) {\n const miradorCanvas = this.canvases.find((c) => c.imageResources.find((r) => r.id === contentResource.id));\n\n if (!miradorCanvas) return undefined;\n\n const resourceIndex = miradorCanvas.imageResources.findIndex((r) => r.id === contentResource.id);\n const resource = miradorCanvas.imageResources.find((r) => r.id === contentResource.id);\n\n const layer = this.layers && this.layers[miradorCanvas.canvas.id];\n const imageResourceLayer = (layer && layer[contentResource.id]) || {};\n\n return {\n index: resourceIndex,\n opacity: 1,\n total: miradorCanvas.imageResources.length,\n visibility: !!resource.preferred,\n ...imageResourceLayer,\n };\n }\n\n /** */\n layerOpacityOfImageResource(contentResource) {\n const layer = this.getLayerMetadata(contentResource);\n if (!layer) return 1;\n if (!layer.visibility) return 0;\n\n return layer.opacity;\n }\n\n /** */\n layerIndexOfImageResource(contentResource) {\n const layer = this.getLayerMetadata(contentResource);\n if (!layer) return undefined;\n\n return layer.index;\n }\n\n /**\n * offsetByCanvas - calculates the offset for a given canvas target. Currently\n * assumes a horrizontal only layout.\n */\n offsetByCanvas(canvasTarget) {\n const coordinates = this.canvasToWorldCoordinates(canvasTarget);\n return {\n x: coordinates[0],\n y: coordinates[1],\n };\n }\n\n /** */\n hasDimensions() {\n return this.canvasDimensions.length > 0;\n }\n\n /**\n * worldBounds - calculates the \"World\" bounds. World in this case is canvases\n * lined up horizontally starting from left to right.\n */\n worldBounds() {\n const worldWidth = Math.max(0, ...this.canvasDimensions.map((c) => c.x + c.width));\n const worldHeight = Math.max(0, ...this.canvasDimensions.map((c) => c.y + c.height));\n\n return [0, 0, worldWidth, worldHeight];\n }\n\n /** */\n canvasAtPoint(point) {\n const canvasDimensions = this.canvasDimensions.find(\n (c) => c.x <= point.x && point.x <= c.x + c.width && c.y <= point.y && point.y <= c.y + c.height,\n );\n\n return canvasDimensions && canvasDimensions.canvas;\n }\n}\n","import{useRef as r,useMemo as n,useEffect as t,useState as e,useCallback as u}from\"react\";function c(e,u,c,i){var l=this,a=r(null),o=r(0),f=r(0),v=r(null),d=r([]),s=r(),m=r(),h=r(e),g=r(!0),x=r(),E=r();h.current=e;var b=\"undefined\"!=typeof window,p=!u&&0!==u&&b;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");u=+u||0;var y=!!(c=c||{}).leading,w=!(\"trailing\"in c)||!!c.trailing,T=!!c.flushOnExit&&w,O=\"maxWait\"in c,F=\"debounceOnServer\"in c&&!!c.debounceOnServer,L=O?Math.max(+c.maxWait||0,u):null,A=n(function(){var r=function(r){var n=d.current,t=s.current;return d.current=s.current=null,o.current=r,f.current=f.current||r,m.current=h.current.apply(t,n)},n=function(r,n){p&&cancelAnimationFrame(v.current),v.current=p?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!g.current)return!1;var n=r-a.current;return!a.current||n>=u||n<0||O&&r-o.current>=L},e=function(n){return v.current=null,w&&d.current?r(n):(d.current=s.current=null,m.current)},c=function r(){var c=Date.now();if(y&&f.current===o.current&&A(),t(c))return e(c);if(g.current){var i=u-(c-a.current),l=O?Math.min(i,L-(c-o.current)):i;n(r,l)}},A=function(){i&&i({})},D=function(){if(b||F){var e,i=Date.now(),f=t(i);if(d.current=[].slice.call(arguments),s.current=l,a.current=i,T&&!x.current&&(x.current=function(){var r;\"hidden\"===(null==(r=globalThis.document)?void 0:r.visibilityState)&&E.current.flush()},null==(e=globalThis.document)||null==e.addEventListener||e.addEventListener(\"visibilitychange\",x.current)),f){if(!v.current&&g.current)return o.current=a.current,n(c,u),y?r(a.current):m.current;if(O)return n(c,u),r(a.current)}return v.current||n(c,u),m.current}};return D.cancel=function(){var r=v.current;r&&(p?cancelAnimationFrame(v.current):clearTimeout(v.current)),o.current=0,d.current=a.current=s.current=v.current=null,r&&i&&i({})},D.isPending=function(){return!!v.current},D.flush=function(){return v.current?e(Date.now()):m.current},D},[y,O,u,L,w,T,p,b,F,i]);return E.current=A,t(function(){return g.current=!0,function(){var r;T&&E.current.flush(),x.current&&(null==(r=globalThis.document)||null==r.removeEventListener||r.removeEventListener(\"visibilitychange\",x.current),x.current=null),g.current=!1}},[T]),A}function i(r,n){return r===n}function l(n,t,l){var a=l&&l.equalityFn||i,o=r(n),f=e({})[1],v=c(u(function(r){o.current=r,f({})},[f]),t,l,f),d=r(n);return a(d.current,n)||(v(n),d.current=n),[o.current,v]}function a(r,n,t){var e=void 0===t?{}:t,u=e.leading,i=e.trailing,l=e.flushOnExit;return c(r,n,{maxWait:n,leading:void 0===u||u,trailing:void 0===i||i,flushOnExit:void 0!==l&&l})}export{l as useDebounce,c as useDebouncedCallback,a as useThrottledCallback};\n//# sourceMappingURL=index.module.js.map\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,10,12],"mappings":";;;;;CAAA,IAAI,IAAA,EAAA,GACA,IAAA,EAAA,GACA,IAAA,EAAA,GAGA,IAAmB,IAAS,EAAO,qBAAqB,KAAA;CAS5D,SAAS,EAAc,GAAO;EAC5B,OAAO,EAAQ,CAAK,KAAK,EAAY,CAAK,KACxC,CAAC,EAAE,KAAoB,KAAS,EAAM;CAC1C;CAEA,EAAO,UAAU;;CCnBjB,IAAI,IAAA,EAAA,GACA,IAAA,EAAA;CAaJ,SAAS,EAAY,GAAO,GAAO,GAAW,GAAU,GAAQ;EAC9D,IAAI,IAAQ,IACR,IAAS,EAAM;EAKnB,KAHA,AAAc,MAAY,GAC1B,AAAW,MAAS,CAAC,GAEd,EAAE,IAAQ,IAAQ;GACvB,IAAI,IAAQ,EAAM;GAClB,AAAI,IAAQ,KAAK,EAAU,CAAK,IAC1B,IAAQ,IAEV,EAAY,GAAO,IAAQ,GAAG,GAAW,GAAU,CAAM,IAEzD,EAAU,GAAQ,CAAK,IAEf,MACV,EAAO,EAAO,UAAU;EAE5B;EACA,OAAO;CACT;CAEA,EAAO,UAAU;;CCrCjB,IAAI,IAAA,EAAA,GAGA,IAAY,KAAK;CAWrB,SAAS,EAAS,GAAM,GAAO,GAAW;EAExC,OADA,IAAQ,EAAU,MAAU,KAAA,IAAa,EAAK,SAAS,IAAK,GAAO,CAAC,GAC7D,WAAW;GAMhB,KALA,IAAI,IAAO,WACP,IAAQ,IACR,IAAS,EAAU,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