@readium/navigator 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +289 -273
- package/dist/index.umd.cjs +29 -29
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1099,6 +1099,21 @@ var en = /* @__PURE__ */ ((r) => (r.EPUB = "https://readium.org/webpub-manifest/
|
|
|
1099
1099
|
J.prototype.getContains = function() {
|
|
1100
1100
|
return new Set(this.otherProperties.contains || []);
|
|
1101
1101
|
};
|
|
1102
|
+
function Vn(r) {
|
|
1103
|
+
const t = r.split(",")[0].trim(), n = (t.toLowerCase().startsWith("npt:") ? t.slice(4) : t).split(":");
|
|
1104
|
+
if (n.length === 1) {
|
|
1105
|
+
const s = parseFloat(n[0]);
|
|
1106
|
+
return isNaN(s) ? void 0 : s;
|
|
1107
|
+
}
|
|
1108
|
+
if (n.length === 2) {
|
|
1109
|
+
const s = parseInt(n[0], 10), o = parseFloat(n[1]);
|
|
1110
|
+
return isNaN(s) || isNaN(o) ? void 0 : s * 60 + o;
|
|
1111
|
+
}
|
|
1112
|
+
if (n.length === 3) {
|
|
1113
|
+
const s = parseInt(n[0], 10), o = parseInt(n[1], 10), a = parseFloat(n[2]);
|
|
1114
|
+
return isNaN(s) || isNaN(o) || isNaN(a) ? void 0 : s * 3600 + o * 60 + a;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1102
1117
|
class Xt {
|
|
1103
1118
|
/**
|
|
1104
1119
|
* Creates a [DomRange].
|
|
@@ -1189,8 +1204,9 @@ L.prototype.page = function() {
|
|
|
1189
1204
|
if (!isNaN(r) && r >= 0) return r;
|
|
1190
1205
|
};
|
|
1191
1206
|
L.prototype.time = function() {
|
|
1192
|
-
const r =
|
|
1193
|
-
if (
|
|
1207
|
+
const r = this.fragmentParameters().get("t");
|
|
1208
|
+
if (r)
|
|
1209
|
+
return Vn(r);
|
|
1194
1210
|
};
|
|
1195
1211
|
L.prototype.space = function() {
|
|
1196
1212
|
const r = this.fragmentParameters();
|
|
@@ -1343,19 +1359,19 @@ J.prototype.getAvailability = function() {
|
|
|
1343
1359
|
J.prototype.getAuthenticate = function() {
|
|
1344
1360
|
return q.deserialize(this.otherProperties.authenticate);
|
|
1345
1361
|
};
|
|
1346
|
-
const
|
|
1362
|
+
const jn = "CssSelectorGenerator";
|
|
1347
1363
|
function fi(r = "unknown problem", ...t) {
|
|
1348
|
-
console.warn(`${
|
|
1364
|
+
console.warn(`${jn}: ${r}`, ...t);
|
|
1349
1365
|
}
|
|
1350
|
-
function
|
|
1366
|
+
function $n(r) {
|
|
1351
1367
|
return r instanceof RegExp;
|
|
1352
1368
|
}
|
|
1353
|
-
function
|
|
1369
|
+
function Gn(r) {
|
|
1354
1370
|
return r.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
1355
1371
|
}
|
|
1356
|
-
function
|
|
1372
|
+
function Xn(r) {
|
|
1357
1373
|
const t = r.map((e) => {
|
|
1358
|
-
if (
|
|
1374
|
+
if ($n(e))
|
|
1359
1375
|
return (i) => e.test(i);
|
|
1360
1376
|
if (typeof e == "function")
|
|
1361
1377
|
return (i) => {
|
|
@@ -1363,21 +1379,21 @@ function Gn(r) {
|
|
|
1363
1379
|
return typeof n != "boolean" ? (fi("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
|
|
1364
1380
|
};
|
|
1365
1381
|
if (typeof e == "string") {
|
|
1366
|
-
const i = new RegExp("^" +
|
|
1382
|
+
const i = new RegExp("^" + Gn(e) + "$");
|
|
1367
1383
|
return (n) => i.test(n);
|
|
1368
1384
|
}
|
|
1369
1385
|
return fi("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
1370
1386
|
});
|
|
1371
1387
|
return (e) => t.some((i) => i(e));
|
|
1372
1388
|
}
|
|
1373
|
-
|
|
1389
|
+
Xn([
|
|
1374
1390
|
"class",
|
|
1375
1391
|
"id",
|
|
1376
1392
|
// Angular attributes
|
|
1377
1393
|
"ng-*"
|
|
1378
1394
|
]);
|
|
1379
|
-
const
|
|
1380
|
-
class
|
|
1395
|
+
const Yn = Math.pow(2, 32), mi = () => Math.round(Math.random() * Yn).toString(36), _e = () => `${Math.round(performance.now())}-${mi()}-${mi()}`, yt = 1;
|
|
1396
|
+
class qn {
|
|
1381
1397
|
constructor(t) {
|
|
1382
1398
|
this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = t, t.addEventListener("message", this.receiver);
|
|
1383
1399
|
}
|
|
@@ -1472,7 +1488,7 @@ class kt {
|
|
|
1472
1488
|
function gi(r) {
|
|
1473
1489
|
return r.split("").reverse().join("");
|
|
1474
1490
|
}
|
|
1475
|
-
function
|
|
1491
|
+
function Kn(r, t, e) {
|
|
1476
1492
|
const i = gi(t);
|
|
1477
1493
|
return e.map((n) => {
|
|
1478
1494
|
const s = Math.max(0, n.end - t.length - n.errors), o = gi(r.slice(s, n.end));
|
|
@@ -1556,9 +1572,9 @@ function nn(r, t, e) {
|
|
|
1556
1572
|
}
|
|
1557
1573
|
return i;
|
|
1558
1574
|
}
|
|
1559
|
-
function
|
|
1575
|
+
function Jn(r, t, e) {
|
|
1560
1576
|
const i = nn(r, t, e);
|
|
1561
|
-
return
|
|
1577
|
+
return Kn(r, t, i);
|
|
1562
1578
|
}
|
|
1563
1579
|
function sn(r, t, e) {
|
|
1564
1580
|
let i = 0;
|
|
@@ -1569,12 +1585,12 @@ function sn(r, t, e) {
|
|
|
1569
1585
|
end: i + t.length,
|
|
1570
1586
|
errors: 0
|
|
1571
1587
|
}), i += 1);
|
|
1572
|
-
return n.length > 0 ? n :
|
|
1588
|
+
return n.length > 0 ? n : Jn(r, t, e);
|
|
1573
1589
|
}
|
|
1574
1590
|
function bi(r, t) {
|
|
1575
1591
|
return t.length === 0 || r.length === 0 ? 0 : 1 - sn(r, t, t.length)[0].errors / t.length;
|
|
1576
1592
|
}
|
|
1577
|
-
function
|
|
1593
|
+
function Zn(r, t, e = {}) {
|
|
1578
1594
|
if (t.length === 0)
|
|
1579
1595
|
return null;
|
|
1580
1596
|
const i = Math.min(256, t.length / 2), n = sn(r, t, i);
|
|
@@ -1632,7 +1648,7 @@ function vi(r, t) {
|
|
|
1632
1648
|
return { node: s, offset: o };
|
|
1633
1649
|
throw new RangeError("No text nodes with non-whitespace text found in range");
|
|
1634
1650
|
}
|
|
1635
|
-
function
|
|
1651
|
+
function Qn(r) {
|
|
1636
1652
|
if (!r.toString().trim().length)
|
|
1637
1653
|
throw new RangeError("Range contains no non-whitespace text");
|
|
1638
1654
|
if (r.startContainer.nodeType !== Node.TEXT_NODE)
|
|
@@ -1868,7 +1884,7 @@ class st {
|
|
|
1868
1884
|
* whitespace
|
|
1869
1885
|
*/
|
|
1870
1886
|
static trimmedRange(t) {
|
|
1871
|
-
return
|
|
1887
|
+
return Qn(st.fromRange(t).toRange());
|
|
1872
1888
|
}
|
|
1873
1889
|
}
|
|
1874
1890
|
class Yt {
|
|
@@ -1932,7 +1948,7 @@ class qt {
|
|
|
1932
1948
|
return this.toPositionAnchor(t).toRange();
|
|
1933
1949
|
}
|
|
1934
1950
|
toPositionAnchor(t = {}) {
|
|
1935
|
-
const e = this.root.textContent, i =
|
|
1951
|
+
const e = this.root.textContent, i = Zn(e, this.exact, {
|
|
1936
1952
|
...this.context,
|
|
1937
1953
|
hint: t.hint
|
|
1938
1954
|
});
|
|
@@ -1941,7 +1957,7 @@ class qt {
|
|
|
1941
1957
|
return new Yt(this.root, i.start, i.end);
|
|
1942
1958
|
}
|
|
1943
1959
|
}
|
|
1944
|
-
function
|
|
1960
|
+
function ts(r) {
|
|
1945
1961
|
const t = r.tagName.toUpperCase();
|
|
1946
1962
|
return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
|
|
1947
1963
|
}
|
|
@@ -1970,7 +1986,7 @@ function Wt(r, t) {
|
|
|
1970
1986
|
}
|
|
1971
1987
|
if (n) {
|
|
1972
1988
|
const s = r.createRange();
|
|
1973
|
-
return n.childNodes.length === 0 ||
|
|
1989
|
+
return n.childNodes.length === 0 || ts(n) ? (s.selectNode(n), s) : (s.setStartBefore(n), s.setEndAfter(n), s);
|
|
1974
1990
|
}
|
|
1975
1991
|
}
|
|
1976
1992
|
} catch (e) {
|
|
@@ -1978,7 +1994,7 @@ function Wt(r, t) {
|
|
|
1978
1994
|
}
|
|
1979
1995
|
return null;
|
|
1980
1996
|
}
|
|
1981
|
-
function
|
|
1997
|
+
function es(r, t, e = !1) {
|
|
1982
1998
|
let i = r.getClientRects();
|
|
1983
1999
|
i.length || r.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (i = r.commonAncestorContainer.getClientRects());
|
|
1984
2000
|
const n = 1, s = [];
|
|
@@ -1996,7 +2012,7 @@ function ts(r, t, e = !1) {
|
|
|
1996
2012
|
n,
|
|
1997
2013
|
t,
|
|
1998
2014
|
e
|
|
1999
|
-
), a =
|
|
2015
|
+
), a = ns(o, n), l = ln(a), d = 4;
|
|
2000
2016
|
for (let h = l.length - 1; h >= 0; h--) {
|
|
2001
2017
|
const c = l[h];
|
|
2002
2018
|
if (!(c.width * c.height > d))
|
|
@@ -2015,7 +2031,7 @@ function an(r, t, e, i = !1) {
|
|
|
2015
2031
|
continue;
|
|
2016
2032
|
const l = Y(o.top, a.top, t) && Y(o.bottom, a.bottom, t), d = Y(o.left, a.left, t) && Y(o.right, a.right, t);
|
|
2017
2033
|
if (l && !d && hn(o, a, t)) {
|
|
2018
|
-
const u = r.filter((p) => p !== o && p !== a), m =
|
|
2034
|
+
const u = r.filter((p) => p !== o && p !== a), m = is(o, a);
|
|
2019
2035
|
return u.push(m), an(
|
|
2020
2036
|
u,
|
|
2021
2037
|
t,
|
|
@@ -2026,7 +2042,7 @@ function an(r, t, e, i = !1) {
|
|
|
2026
2042
|
}
|
|
2027
2043
|
return r;
|
|
2028
2044
|
}
|
|
2029
|
-
function
|
|
2045
|
+
function is(r, t) {
|
|
2030
2046
|
const e = Math.min(r.left, t.left), i = Math.max(r.right, t.right), n = Math.min(r.top, t.top), s = Math.max(r.bottom, t.bottom);
|
|
2031
2047
|
return {
|
|
2032
2048
|
bottom: s,
|
|
@@ -2037,7 +2053,7 @@ function es(r, t) {
|
|
|
2037
2053
|
width: i - e
|
|
2038
2054
|
};
|
|
2039
2055
|
}
|
|
2040
|
-
function
|
|
2056
|
+
function ns(r, t) {
|
|
2041
2057
|
const e = new Set(r);
|
|
2042
2058
|
for (const i of r) {
|
|
2043
2059
|
if (!(i.width > 1 && i.height > 1)) {
|
|
@@ -2045,14 +2061,14 @@ function is(r, t) {
|
|
|
2045
2061
|
continue;
|
|
2046
2062
|
}
|
|
2047
2063
|
for (const s of r)
|
|
2048
|
-
if (i !== s && e.has(s) &&
|
|
2064
|
+
if (i !== s && e.has(s) && ss(s, i, t)) {
|
|
2049
2065
|
e.delete(i);
|
|
2050
2066
|
break;
|
|
2051
2067
|
}
|
|
2052
2068
|
}
|
|
2053
2069
|
return Array.from(e);
|
|
2054
2070
|
}
|
|
2055
|
-
function
|
|
2071
|
+
function ss(r, t, e) {
|
|
2056
2072
|
return St(r, t.left, t.top, e) && St(r, t.right, t.top, e) && St(r, t.left, t.bottom, e) && St(r, t.right, t.bottom, e);
|
|
2057
2073
|
}
|
|
2058
2074
|
function St(r, t, e, i) {
|
|
@@ -2078,7 +2094,7 @@ function ln(r) {
|
|
|
2078
2094
|
return r;
|
|
2079
2095
|
}
|
|
2080
2096
|
function wi(r, t) {
|
|
2081
|
-
const e =
|
|
2097
|
+
const e = rs(t, r);
|
|
2082
2098
|
if (e.height === 0 || e.width === 0)
|
|
2083
2099
|
return [r];
|
|
2084
2100
|
const i = [];
|
|
@@ -2128,7 +2144,7 @@ function wi(r, t) {
|
|
|
2128
2144
|
}
|
|
2129
2145
|
return i;
|
|
2130
2146
|
}
|
|
2131
|
-
function
|
|
2147
|
+
function rs(r, t) {
|
|
2132
2148
|
const e = Math.max(r.left, t.left), i = Math.min(r.right, t.right), n = Math.max(r.top, t.top), s = Math.min(r.bottom, t.bottom);
|
|
2133
2149
|
return {
|
|
2134
2150
|
bottom: s,
|
|
@@ -2145,7 +2161,7 @@ function hn(r, t, e) {
|
|
|
2145
2161
|
function Y(r, t, e) {
|
|
2146
2162
|
return Math.abs(r - t) <= e;
|
|
2147
2163
|
}
|
|
2148
|
-
const
|
|
2164
|
+
const os = /* @__PURE__ */ new Set([
|
|
2149
2165
|
"backgroundColor",
|
|
2150
2166
|
"textColor",
|
|
2151
2167
|
"linkColor",
|
|
@@ -2159,12 +2175,12 @@ const rs = /* @__PURE__ */ new Set([
|
|
|
2159
2175
|
"invertFilter",
|
|
2160
2176
|
"invertGaiji"
|
|
2161
2177
|
]), Pi = /--(?:USER|RS)__([\w-]+)/g;
|
|
2162
|
-
function
|
|
2178
|
+
function as(r, t) {
|
|
2163
2179
|
const e = r ?? "", i = t ?? "", n = /* @__PURE__ */ new Set();
|
|
2164
2180
|
for (const s of e.matchAll(Pi)) n.add(s[1]);
|
|
2165
2181
|
for (const s of i.matchAll(Pi)) n.add(s[1]);
|
|
2166
2182
|
for (const s of n)
|
|
2167
|
-
if (!
|
|
2183
|
+
if (!os.has(s)) return !0;
|
|
2168
2184
|
return !1;
|
|
2169
2185
|
}
|
|
2170
2186
|
function Ge(r) {
|
|
@@ -2191,7 +2207,7 @@ function ce(r, t) {
|
|
|
2191
2207
|
r.document.documentElement.style.removeProperty(t);
|
|
2192
2208
|
}
|
|
2193
2209
|
let Bt = null, ye = null, Ot = 0;
|
|
2194
|
-
const bt = { r: 255, g: 255, b: 255, a: 1 }, pt = /* @__PURE__ */ new Map(),
|
|
2210
|
+
const bt = { r: 255, g: 255, b: 255, a: 1 }, pt = /* @__PURE__ */ new Map(), ls = () => {
|
|
2195
2211
|
if (!Bt)
|
|
2196
2212
|
if (typeof OffscreenCanvas < "u")
|
|
2197
2213
|
Bt = new OffscreenCanvas(5, 5), ye = Bt.getContext("2d", {
|
|
@@ -2206,7 +2222,7 @@ const bt = { r: 255, g: 255, b: 255, a: 1 }, pt = /* @__PURE__ */ new Map(), as
|
|
|
2206
2222
|
});
|
|
2207
2223
|
}
|
|
2208
2224
|
return ye;
|
|
2209
|
-
},
|
|
2225
|
+
}, hs = (r) => {
|
|
2210
2226
|
if (!r) return !0;
|
|
2211
2227
|
const t = r.trim().toLowerCase();
|
|
2212
2228
|
return t.startsWith("var(") || [
|
|
@@ -2233,9 +2249,9 @@ const bt = { r: 255, g: 255, b: 255, a: 1 }, pt = /* @__PURE__ */ new Map(), as
|
|
|
2233
2249
|
const e = t ? `${r}|${t}` : r, i = pt.get(e);
|
|
2234
2250
|
if (i !== void 0)
|
|
2235
2251
|
return i ?? bt;
|
|
2236
|
-
if (
|
|
2252
|
+
if (hs(r))
|
|
2237
2253
|
return Vt(r, "Unsupported color format or special value."), pt.set(e, null), bt;
|
|
2238
|
-
const n =
|
|
2254
|
+
const n = ls();
|
|
2239
2255
|
if (!n)
|
|
2240
2256
|
return Vt(r, "Could not get canvas context."), pt.set(e, null), bt;
|
|
2241
2257
|
try {
|
|
@@ -2264,15 +2280,15 @@ const bt = { r: 255, g: 255, b: 255, a: 1 }, pt = /* @__PURE__ */ new Map(), as
|
|
|
2264
2280
|
}, dn = (r, t = null) => {
|
|
2265
2281
|
const e = It(r, t), i = Kt(e, { r: 255, g: 255, b: 255, a: 1 }), n = Kt(e, { r: 0, g: 0, b: 0, a: 1 });
|
|
2266
2282
|
return i > n;
|
|
2267
|
-
},
|
|
2283
|
+
}, cs = (r, t = null) => dn(r, t) ? "white" : "black", ds = (r) => {
|
|
2268
2284
|
const t = r.a !== void 0 ? r.a : 1;
|
|
2269
2285
|
return `rgba(${Math.round(r.r)}, ${Math.round(r.g)}, ${Math.round(r.b)}, ${t})`;
|
|
2270
|
-
},
|
|
2286
|
+
}, us = (r, t) => ({
|
|
2271
2287
|
r: Math.min(255, r.r + (255 - r.r) * t),
|
|
2272
2288
|
g: Math.min(255, r.g + (255 - r.g) * t),
|
|
2273
2289
|
b: Math.min(255, r.b + (255 - r.b) * t),
|
|
2274
2290
|
a: r.a ?? 1
|
|
2275
|
-
}),
|
|
2291
|
+
}), ps = (r, t) => ({
|
|
2276
2292
|
r: Math.max(0, r.r * (1 - t)),
|
|
2277
2293
|
g: Math.max(0, r.g * (1 - t)),
|
|
2278
2294
|
b: Math.max(0, r.b * (1 - t)),
|
|
@@ -2285,22 +2301,22 @@ const bt = { r: 255, g: 255, b: 255, a: 1 }, pt = /* @__PURE__ */ new Map(), as
|
|
|
2285
2301
|
const a = Le(n) < 0.5;
|
|
2286
2302
|
let l = { ...i, a: i.a ?? 1 };
|
|
2287
2303
|
const d = 20, h = 0.1;
|
|
2288
|
-
for (let c = 0; c < d && (a ? l =
|
|
2304
|
+
for (let c = 0; c < d && (a ? l = us(l, h) : l = ps(l, h), s = Kt(l, n), !(s >= e)); c++)
|
|
2289
2305
|
;
|
|
2290
|
-
return
|
|
2306
|
+
return ds(l);
|
|
2291
2307
|
};
|
|
2292
|
-
function
|
|
2308
|
+
function fs(r) {
|
|
2293
2309
|
return (r.document.documentElement.dir || r.document.body.dir).toLowerCase() === "rtl";
|
|
2294
2310
|
}
|
|
2295
2311
|
function un(r) {
|
|
2296
2312
|
return (r.getComputedStyle(r.document.documentElement).writingMode || r.getComputedStyle(r.document.body).writingMode) === "vertical-lr";
|
|
2297
2313
|
}
|
|
2298
|
-
function
|
|
2314
|
+
function ms(r) {
|
|
2299
2315
|
const t = r.getComputedStyle(r.document.documentElement).writingMode || r.getComputedStyle(r.document.body).writingMode;
|
|
2300
2316
|
return t === "vertical-rl" || t === "vertical-lr";
|
|
2301
2317
|
}
|
|
2302
2318
|
function ve(r) {
|
|
2303
|
-
const t =
|
|
2319
|
+
const t = ms(r), e = t && un(r), i = r.innerWidth, n = r.innerHeight, s = r.document.scrollingElement, o = s.scrollLeft, a = s.scrollTop, l = parseInt(r.getComputedStyle(r.document.documentElement).getPropertyValue("column-count")), d = t && !e ? s.scrollWidth - i + o : o, h = a;
|
|
2304
2320
|
return {
|
|
2305
2321
|
isVertical: t,
|
|
2306
2322
|
isVertLR: e,
|
|
@@ -2387,7 +2403,7 @@ class gn {
|
|
|
2387
2403
|
}, []) };
|
|
2388
2404
|
}
|
|
2389
2405
|
}
|
|
2390
|
-
class
|
|
2406
|
+
class gs extends gn {
|
|
2391
2407
|
get iOSRequest() {
|
|
2392
2408
|
const t = mn(), e = fn();
|
|
2393
2409
|
if (this.OS.iOS && !this.OS.iPadOS)
|
|
@@ -2396,7 +2412,7 @@ class ms extends gn {
|
|
|
2396
2412
|
return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
|
|
2397
2413
|
}
|
|
2398
2414
|
}
|
|
2399
|
-
const X = new gn(), M = new
|
|
2415
|
+
const X = new gn(), M = new gs(), xi = [
|
|
2400
2416
|
// Structure / presentation
|
|
2401
2417
|
"div",
|
|
2402
2418
|
"span",
|
|
@@ -2439,8 +2455,8 @@ const X = new gn(), M = new ms(), xi = [
|
|
|
2439
2455
|
"tspan",
|
|
2440
2456
|
"defs",
|
|
2441
2457
|
"use"
|
|
2442
|
-
],
|
|
2443
|
-
function
|
|
2458
|
+
], ys = /^on/i, bs = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "xlink:href"]), vs = /^\s*(javascript|data):/i;
|
|
2459
|
+
function Ss(r, t) {
|
|
2444
2460
|
const e = r.document.createElement("div");
|
|
2445
2461
|
if ("Sanitizer" in r && typeof e.setHTML == "function")
|
|
2446
2462
|
try {
|
|
@@ -2449,11 +2465,11 @@ function vs(r, t) {
|
|
|
2449
2465
|
} catch {
|
|
2450
2466
|
}
|
|
2451
2467
|
const i = r.document.implementation.createHTMLDocument("");
|
|
2452
|
-
for (i.body.innerHTML = t,
|
|
2468
|
+
for (i.body.innerHTML = t, ws(i.body, new Set(xi)); i.body.firstChild; )
|
|
2453
2469
|
e.appendChild(r.document.adoptNode(i.body.firstChild));
|
|
2454
2470
|
return e.firstElementChild;
|
|
2455
2471
|
}
|
|
2456
|
-
function
|
|
2472
|
+
function ws(r, t) {
|
|
2457
2473
|
const e = Array.from(r.querySelectorAll("*")).reverse();
|
|
2458
2474
|
for (const i of e) {
|
|
2459
2475
|
if (!t.has(i.localName)) {
|
|
@@ -2461,7 +2477,7 @@ function Ss(r, t) {
|
|
|
2461
2477
|
continue;
|
|
2462
2478
|
}
|
|
2463
2479
|
for (const { name: n, value: s } of Array.from(i.attributes))
|
|
2464
|
-
(
|
|
2480
|
+
(ys.test(n) || bs.has(n) && vs.test(s)) && i.removeAttribute(n);
|
|
2465
2481
|
}
|
|
2466
2482
|
}
|
|
2467
2483
|
function Se(r) {
|
|
@@ -2488,16 +2504,16 @@ const _ = {
|
|
|
2488
2504
|
Template: "template"
|
|
2489
2505
|
// Custom HTML template (HTMLDecorationTemplate).
|
|
2490
2506
|
};
|
|
2491
|
-
var
|
|
2492
|
-
const
|
|
2493
|
-
class
|
|
2507
|
+
var Ps = /* @__PURE__ */ ((r) => (r.Wrap = "wrap", r.Viewport = "viewport", r.Bounds = "bounds", r.Page = "page", r))(Ps || {}), Es = /* @__PURE__ */ ((r) => (r.Boxes = "boxes", r.Bounds = "bounds", r))(Es || {});
|
|
2508
|
+
const Cs = () => "Highlight" in window, Li = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
2509
|
+
class _s {
|
|
2494
2510
|
/**
|
|
2495
2511
|
* Creates a DecorationGroup object
|
|
2496
2512
|
* @param id Unique HTML ID-adhering name of the group
|
|
2497
2513
|
* @param name Human-readable name of the group
|
|
2498
2514
|
*/
|
|
2499
2515
|
constructor(t, e, i, n) {
|
|
2500
|
-
this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this._activatable = !1, this.experimentalHighlights = !1, this.maskSvg = void 0, this.shadowHost = void 0, this.shadowRoot = void 0, this.currentRender = 0,
|
|
2516
|
+
this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this._activatable = !1, this.experimentalHighlights = !1, this.maskSvg = void 0, this.shadowHost = void 0, this.shadowRoot = void 0, this.currentRender = 0, Cs() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map()), this.activationHandler = this.handleActivation.bind(this), this.wnd.document.addEventListener("pointerup", this.activationHandler);
|
|
2501
2517
|
}
|
|
2502
2518
|
get activatable() {
|
|
2503
2519
|
return this._activatable;
|
|
@@ -2654,7 +2670,7 @@ class Cs {
|
|
|
2654
2670
|
default: {
|
|
2655
2671
|
const f = c ? lt(o, h) : o;
|
|
2656
2672
|
u = `::highlight(${this.id}) {
|
|
2657
|
-
color: ${
|
|
2673
|
+
color: ${cs(f, h)};
|
|
2658
2674
|
background-color: ${f};
|
|
2659
2675
|
}`;
|
|
2660
2676
|
}
|
|
@@ -2703,7 +2719,7 @@ class Cs {
|
|
|
2703
2719
|
let d;
|
|
2704
2720
|
if (a.type === _.Template) {
|
|
2705
2721
|
a.stylesheet && this.injectCustomStylesheet(a.stylesheet);
|
|
2706
|
-
const h =
|
|
2722
|
+
const h = Ss(this.wnd, a.element);
|
|
2707
2723
|
if (!h) {
|
|
2708
2724
|
t.container = e, t.clickableElements = [];
|
|
2709
2725
|
return;
|
|
@@ -2753,7 +2769,7 @@ class Cs {
|
|
|
2753
2769
|
const h = d.cloneNode(!0);
|
|
2754
2770
|
h.style.setProperty("pointer-events", "none"), s(h, o, o, l), e.append(h);
|
|
2755
2771
|
} else {
|
|
2756
|
-
let h =
|
|
2772
|
+
let h = es(
|
|
2757
2773
|
t.range,
|
|
2758
2774
|
!0,
|
|
2759
2775
|
// doNotMergeHorizontallyAlignedRects
|
|
@@ -2894,7 +2910,7 @@ const wt = class wt extends kt {
|
|
|
2894
2910
|
mount(t, e) {
|
|
2895
2911
|
return this.wnd = t, e.register("decorate", wt.moduleName, (i, n) => {
|
|
2896
2912
|
const s = i;
|
|
2897
|
-
(s.action === "add" || s.action === "update") && s.decoration.locator && (s.decoration.locator = F.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new
|
|
2913
|
+
(s.action === "add" || s.action === "update") && s.decoration.locator && (s.decoration.locator = F.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new _s(
|
|
2898
2914
|
t,
|
|
2899
2915
|
e,
|
|
2900
2916
|
`readium-decoration-${this.lastGroupId++}`,
|
|
@@ -2960,14 +2976,14 @@ const ki = "readium-snapper-style", Mt = class Mt extends kt {
|
|
|
2960
2976
|
};
|
|
2961
2977
|
Mt.moduleName = "snapper";
|
|
2962
2978
|
let xt = Mt;
|
|
2963
|
-
function
|
|
2979
|
+
function xs(r) {
|
|
2964
2980
|
return r < 0.5 ? 2 * r * r : -1 + (4 - 2 * r) * r;
|
|
2965
2981
|
}
|
|
2966
2982
|
function T(r) {
|
|
2967
2983
|
const t = r.getSelection();
|
|
2968
2984
|
t && t.removeAllRanges();
|
|
2969
2985
|
}
|
|
2970
|
-
const
|
|
2986
|
+
const Ls = [
|
|
2971
2987
|
"a",
|
|
2972
2988
|
"area",
|
|
2973
2989
|
"audio",
|
|
@@ -2981,15 +2997,15 @@ const xs = [
|
|
|
2981
2997
|
"submit",
|
|
2982
2998
|
"textarea",
|
|
2983
2999
|
"video"
|
|
2984
|
-
],
|
|
3000
|
+
], ks = ["dialog", "radiogroup", "radio", "menu", "menuitem"];
|
|
2985
3001
|
function Ye(r) {
|
|
2986
|
-
return
|
|
3002
|
+
return Os(r) ? null : yn(r) ? r : r.parentElement ? Ye(r.parentElement) : null;
|
|
2987
3003
|
}
|
|
2988
|
-
function
|
|
3004
|
+
function Os(r) {
|
|
2989
3005
|
return r ? r.closest("[inert]") !== null || r.hasAttribute("disabled") : !0;
|
|
2990
3006
|
}
|
|
2991
3007
|
function yn(r) {
|
|
2992
|
-
return r ? r.role &&
|
|
3008
|
+
return r ? r.role && ks.includes(r.role) ? !0 : r.tagName.toLowerCase() === "iframe" ? !1 : r.tabIndex >= 0 ? !0 : Ls.includes(r.nodeName.toLowerCase()) || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" : !1;
|
|
2993
3009
|
}
|
|
2994
3010
|
function de(r, t) {
|
|
2995
3011
|
const e = bn(r, r.document.body, t), i = r._readium_cssSelectorGenerator.getCssSelector(e, {
|
|
@@ -3011,12 +3027,12 @@ function de(r, t) {
|
|
|
3011
3027
|
function bn(r, t, e) {
|
|
3012
3028
|
for (var i = 0; i < t.children.length; i++) {
|
|
3013
3029
|
const n = t.children[i];
|
|
3014
|
-
if (!
|
|
3015
|
-
return
|
|
3030
|
+
if (!Ts(n) && Rs(r, n, e))
|
|
3031
|
+
return As(r, n) ? n : bn(r, n, e);
|
|
3016
3032
|
}
|
|
3017
3033
|
return t;
|
|
3018
3034
|
}
|
|
3019
|
-
function
|
|
3035
|
+
function Rs(r, t, e) {
|
|
3020
3036
|
if (t === document.body || t === document.documentElement)
|
|
3021
3037
|
return !0;
|
|
3022
3038
|
if (!document || !document.documentElement || !document.body)
|
|
@@ -3024,11 +3040,11 @@ function Os(r, t, e) {
|
|
|
3024
3040
|
const i = t.getBoundingClientRect();
|
|
3025
3041
|
return e ? i.bottom > 0 && i.top < r.innerHeight : i.right > 0 && i.left < r.innerWidth;
|
|
3026
3042
|
}
|
|
3027
|
-
function
|
|
3043
|
+
function As(r, t) {
|
|
3028
3044
|
const e = t.getBoundingClientRect();
|
|
3029
3045
|
return e.top >= 0 && e.left >= 0 && e.bottom <= r.innerHeight && e.right <= r.innerWidth;
|
|
3030
3046
|
}
|
|
3031
|
-
function
|
|
3047
|
+
function Ts(r) {
|
|
3032
3048
|
const t = getComputedStyle(r);
|
|
3033
3049
|
if (t) {
|
|
3034
3050
|
const e = t.getPropertyValue("display");
|
|
@@ -3037,7 +3053,7 @@ function As(r) {
|
|
|
3037
3053
|
}
|
|
3038
3054
|
return !1;
|
|
3039
3055
|
}
|
|
3040
|
-
const
|
|
3056
|
+
const Ns = {
|
|
3041
3057
|
maxVelocity: 200,
|
|
3042
3058
|
// Reasonable default for human-like scrolling (pixels/ms)
|
|
3043
3059
|
minVariance: 0.01,
|
|
@@ -3063,7 +3079,7 @@ const Ts = {
|
|
|
3063
3079
|
maxSelectionsPerSecond: 500,
|
|
3064
3080
|
minVariance: 50,
|
|
3065
3081
|
historySize: 20
|
|
3066
|
-
},
|
|
3082
|
+
}, Ms = {
|
|
3067
3083
|
enabled: !0,
|
|
3068
3084
|
maxSelectionPercent: 0.1,
|
|
3069
3085
|
minThreshold: 100,
|
|
@@ -3072,7 +3088,7 @@ const Ts = {
|
|
|
3072
3088
|
};
|
|
3073
3089
|
class ue {
|
|
3074
3090
|
constructor(t = {}) {
|
|
3075
|
-
this.history = [], this.consistentScrollCount = 0, this.options = { ...
|
|
3091
|
+
this.history = [], this.consistentScrollCount = 0, this.options = { ...Ns, ...t };
|
|
3076
3092
|
}
|
|
3077
3093
|
analyze(t, e, i) {
|
|
3078
3094
|
if (i <= 0) return !1;
|
|
@@ -3103,7 +3119,7 @@ class ue {
|
|
|
3103
3119
|
this.history = [], this.consistentScrollCount = 0;
|
|
3104
3120
|
}
|
|
3105
3121
|
}
|
|
3106
|
-
const Oi = "readium-column-snapper-style",
|
|
3122
|
+
const Oi = "readium-column-snapper-style", Fs = 200, H = class H extends xt {
|
|
3107
3123
|
constructor() {
|
|
3108
3124
|
super(...arguments), this.isSnapProtectionEnabled = !1, this.patternAnalyzer = null, this.lastTurnTime = 0, this.rtl = !1, this.shakeTimeout = 0, this.snappingCancelled = !1, this.alreadyScrollLeft = 0, this.overscroll = 0, this.cachedScrollWidth = 0, this.touchState = 0, this.startingX = void 0, this.endingX = void 0, this.onTouchStarter = this.onTouchStart.bind(this), this.onTouchEnder = this.onTouchEnd.bind(this), this.onWidthChanger = this.onWidthChange.bind(this), this.onTouchMover = this.onTouchMove.bind(this);
|
|
3109
3125
|
}
|
|
@@ -3162,7 +3178,7 @@ const Oi = "readium-column-snapper-style", Ms = 200, H = class H extends xt {
|
|
|
3162
3178
|
const i = this.doc(), n = pn(this.wnd), s = this.cachedScrollWidth - this.wnd.innerWidth, o = Math.min(Math.max(0, this.normScroll()), s), a = this.dragOffset(), l = this.rtl ? -a : a, d = this.wnd.innerWidth / 3 * (l > 0 ? 2 : 1), h = Math.min(s, Math.max(0, this.snapNormOffset(o + d))), c = this.rtl ? -h : h, u = this.rtl ? -o : o, m = c > u ? "right" : "left";
|
|
3163
3179
|
if (this.checkSuspiciousSnap(m, Math.abs(c - u)), t && c !== u) {
|
|
3164
3180
|
this.snappingCancelled = !1;
|
|
3165
|
-
const p = (C, x, G, ut) => G > ut ? x : C + (x - C) *
|
|
3181
|
+
const p = (C, x, G, ut) => G > ut ? x : C + (x - C) * xs(G / ut), f = Fs * n;
|
|
3166
3182
|
let b;
|
|
3167
3183
|
const S = (C) => {
|
|
3168
3184
|
if (this.snappingCancelled) return;
|
|
@@ -3236,7 +3252,7 @@ const Oi = "readium-column-snapper-style", Ms = 200, H = class H extends xt {
|
|
|
3236
3252
|
});
|
|
3237
3253
|
}
|
|
3238
3254
|
mount(t, e) {
|
|
3239
|
-
if (this.wnd = t, this.comms = e, this.rtl =
|
|
3255
|
+
if (this.wnd = t, this.comms = e, this.rtl = fs(t), !super.mount(t, e)) return !1;
|
|
3240
3256
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
3241
3257
|
const i = t.document.createElement("style");
|
|
3242
3258
|
i.dataset.readium = "true", i.id = Oi, i.textContent = `
|
|
@@ -3281,7 +3297,7 @@ const Oi = "readium-column-snapper-style", Ms = 200, H = class H extends xt {
|
|
|
3281
3297
|
for (const a of o)
|
|
3282
3298
|
if (a.target === this.wnd.document.documentElement) {
|
|
3283
3299
|
const l = a.oldValue, d = a.target.getAttribute("style"), h = /transform\s*:\s*([^;]+)/, c = l?.match(h), u = d?.match(h);
|
|
3284
|
-
(!c && !u &&
|
|
3300
|
+
(!c && !u && as(l, d) || c && !u || c && u && c[1] !== u[1]) && (t.requestAnimationFrame(() => {
|
|
3285
3301
|
t && _i(t);
|
|
3286
3302
|
}), this.onWidthChange());
|
|
3287
3303
|
} else
|
|
@@ -3638,7 +3654,7 @@ const V = class V extends xt {
|
|
|
3638
3654
|
};
|
|
3639
3655
|
V.moduleName = "webpub_snapper";
|
|
3640
3656
|
let Ae = V;
|
|
3641
|
-
class
|
|
3657
|
+
class zs {
|
|
3642
3658
|
constructor(t, e) {
|
|
3643
3659
|
this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
|
|
3644
3660
|
}
|
|
@@ -3678,7 +3694,7 @@ class Fs {
|
|
|
3678
3694
|
this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.copyHistory = [], this.options.enabled = !1;
|
|
3679
3695
|
}
|
|
3680
3696
|
}
|
|
3681
|
-
class
|
|
3697
|
+
class Is {
|
|
3682
3698
|
constructor(t = vn) {
|
|
3683
3699
|
this.options = t, this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
|
|
3684
3700
|
}
|
|
@@ -3937,8 +3953,8 @@ const ht = class ht extends kt {
|
|
|
3937
3953
|
}
|
|
3938
3954
|
addBulkCopyProtection(t = {}) {
|
|
3939
3955
|
if (this.isBulkCopyProtectionEnabled || !this.wnd) return;
|
|
3940
|
-
const e =
|
|
3941
|
-
this.bulkCopyProtector = new
|
|
3956
|
+
const e = Ms, i = t ? { ...e, ...t } : e;
|
|
3957
|
+
this.bulkCopyProtector = new zs(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
|
|
3942
3958
|
}
|
|
3943
3959
|
removeBulkCopyProtection() {
|
|
3944
3960
|
!this.isBulkCopyProtectionEnabled || !this.wnd || (this.wnd.document.removeEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.removeEventListener("cut", this.preventBulkCopy, !0), this.bulkCopyProtector?.destroy(), this.bulkCopyProtector = null, this.isBulkCopyProtectionEnabled = !1);
|
|
@@ -3946,7 +3962,7 @@ const ht = class ht extends kt {
|
|
|
3946
3962
|
addSelectionMonitoring(t) {
|
|
3947
3963
|
if (this.isSelectionMonitoringEnabled || !this.wnd) return;
|
|
3948
3964
|
const e = t || vn;
|
|
3949
|
-
this.selectionAnalyzer = new
|
|
3965
|
+
this.selectionAnalyzer = new Is(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
|
|
3950
3966
|
}
|
|
3951
3967
|
removeSelectionMonitoring() {
|
|
3952
3968
|
!this.isSelectionMonitoringEnabled || !this.wnd || (this.wnd.document.removeEventListener("selectionchange", this.handleSelection), this.selectionAnalyzer?.clear(), this.selectionAnalyzer = null, this.isSelectionMonitoringEnabled = !1);
|
|
@@ -4090,7 +4106,7 @@ const Ft = class Ft extends kt {
|
|
|
4090
4106
|
), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
|
|
4091
4107
|
value: {
|
|
4092
4108
|
name: "readium-ts-toolkit",
|
|
4093
|
-
version: "2.6.
|
|
4109
|
+
version: "2.6.1",
|
|
4094
4110
|
hasFeature: (n, s = "") => {
|
|
4095
4111
|
switch (n) {
|
|
4096
4112
|
case "dom-manipulation":
|
|
@@ -4248,7 +4264,7 @@ const it = class it extends kt {
|
|
|
4248
4264
|
it.moduleName = "webpub_setup";
|
|
4249
4265
|
let Fe = it;
|
|
4250
4266
|
var ot;
|
|
4251
|
-
let
|
|
4267
|
+
let Ds = (ot = class extends kt {
|
|
4252
4268
|
constructor() {
|
|
4253
4269
|
super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
|
|
4254
4270
|
}
|
|
@@ -4425,12 +4441,12 @@ const Ni = "readium-cjk-vertical-snapper-style", j = class j extends xt {
|
|
|
4425
4441
|
};
|
|
4426
4442
|
j.moduleName = "cjk_vertical_snapper";
|
|
4427
4443
|
let ze = j;
|
|
4428
|
-
const
|
|
4444
|
+
const Us = [
|
|
4429
4445
|
"fixed_setup",
|
|
4430
4446
|
"decorator",
|
|
4431
4447
|
"peripherals",
|
|
4432
4448
|
"print_protection"
|
|
4433
|
-
],
|
|
4449
|
+
], Hs = [
|
|
4434
4450
|
"reflowable_setup",
|
|
4435
4451
|
"decorator",
|
|
4436
4452
|
"peripherals",
|
|
@@ -4438,7 +4454,7 @@ const Ds = [
|
|
|
4438
4454
|
"scroll_snapper",
|
|
4439
4455
|
"cjk_vertical_snapper",
|
|
4440
4456
|
"print_protection"
|
|
4441
|
-
],
|
|
4457
|
+
], Ws = [
|
|
4442
4458
|
"webpub_setup",
|
|
4443
4459
|
"webpub_snapper",
|
|
4444
4460
|
"decorator",
|
|
@@ -4455,7 +4471,7 @@ const Ds = [
|
|
|
4455
4471
|
Oe,
|
|
4456
4472
|
Re,
|
|
4457
4473
|
ze,
|
|
4458
|
-
|
|
4474
|
+
Ds
|
|
4459
4475
|
].map((r) => [r.moduleName, r]));
|
|
4460
4476
|
class Lt {
|
|
4461
4477
|
/**
|
|
@@ -4463,7 +4479,7 @@ class Lt {
|
|
|
4463
4479
|
* @param initialModules List of initial modules to load
|
|
4464
4480
|
*/
|
|
4465
4481
|
constructor(t = window, e = []) {
|
|
4466
|
-
this.loadedModules = [], this.wnd = t, this.comms = new
|
|
4482
|
+
this.loadedModules = [], this.wnd = t, this.comms = new qn(t);
|
|
4467
4483
|
const i = [...new Set(e)];
|
|
4468
4484
|
if (i.length) {
|
|
4469
4485
|
if (typeof t > "u")
|
|
@@ -4507,7 +4523,7 @@ class Lt {
|
|
|
4507
4523
|
this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
|
|
4508
4524
|
}
|
|
4509
4525
|
}
|
|
4510
|
-
const
|
|
4526
|
+
const Bs = {
|
|
4511
4527
|
type: "developer_tools",
|
|
4512
4528
|
keyCombos: [
|
|
4513
4529
|
{ keyCode: 73, meta: !0, alt: !0 },
|
|
@@ -4541,7 +4557,7 @@ const Ws = {
|
|
|
4541
4557
|
{ keyCode: 123, meta: !0, alt: !0 }
|
|
4542
4558
|
// Cmd+Option+F12
|
|
4543
4559
|
]
|
|
4544
|
-
},
|
|
4560
|
+
}, Vs = {
|
|
4545
4561
|
type: "select_all",
|
|
4546
4562
|
keyCombos: [
|
|
4547
4563
|
{ keyCode: 65, meta: !0 },
|
|
@@ -4549,7 +4565,7 @@ const Ws = {
|
|
|
4549
4565
|
{ keyCode: 65, ctrl: !0 }
|
|
4550
4566
|
// Ctrl+A
|
|
4551
4567
|
]
|
|
4552
|
-
},
|
|
4568
|
+
}, js = {
|
|
4553
4569
|
type: "print",
|
|
4554
4570
|
keyCombos: [
|
|
4555
4571
|
{ keyCode: 80, meta: !0 },
|
|
@@ -4565,7 +4581,7 @@ const Ws = {
|
|
|
4565
4581
|
{ keyCode: 80, ctrl: !0, alt: !0 }
|
|
4566
4582
|
// Ctrl+Alt+P
|
|
4567
4583
|
]
|
|
4568
|
-
},
|
|
4584
|
+
}, $s = {
|
|
4569
4585
|
type: "save",
|
|
4570
4586
|
keyCombos: [
|
|
4571
4587
|
{ keyCode: 83, meta: !0 },
|
|
@@ -4583,7 +4599,7 @@ class wn {
|
|
|
4583
4599
|
const i = [], n = e.filter(
|
|
4584
4600
|
(s) => !["developer_tools", "select_all", "print", "save"].includes(s.type)
|
|
4585
4601
|
);
|
|
4586
|
-
t.disableSelectAll && i.push(
|
|
4602
|
+
t.disableSelectAll && i.push(Vs), t.disableSave && i.push($s), t.monitorDevTools && i.push(Bs), t.protectPrinting?.disable && i.push(js);
|
|
4587
4603
|
for (const s of n) {
|
|
4588
4604
|
const o = s.keyCombos.filter(
|
|
4589
4605
|
(a) => !i.some(
|
|
@@ -4614,7 +4630,7 @@ class Pn extends wn {
|
|
|
4614
4630
|
this.readingProgression === I.ltr ? this.goForward(t, e) : this.readingProgression === I.rtl && this.goBackward(t, e);
|
|
4615
4631
|
}
|
|
4616
4632
|
}
|
|
4617
|
-
class
|
|
4633
|
+
class Gs extends wn {
|
|
4618
4634
|
}
|
|
4619
4635
|
function Pt(r, t) {
|
|
4620
4636
|
const { style: e } = r;
|
|
@@ -4638,7 +4654,7 @@ function Pt(r, t) {
|
|
|
4638
4654
|
}
|
|
4639
4655
|
return r;
|
|
4640
4656
|
}
|
|
4641
|
-
function
|
|
4657
|
+
function Xs(r, t) {
|
|
4642
4658
|
if (r.type !== t.type || (r.isActive ?? !1) !== (t.isActive ?? !1)) return !1;
|
|
4643
4659
|
if (r.type === _.Template) {
|
|
4644
4660
|
const n = r, s = t;
|
|
@@ -4651,7 +4667,7 @@ function Mi(r) {
|
|
|
4651
4667
|
return typeof r?.serialize == "function" ? r.serialize() : r;
|
|
4652
4668
|
}
|
|
4653
4669
|
function En(r, t) {
|
|
4654
|
-
return r.locator.href === t.locator.href && JSON.stringify(Mi(r.locator.locations)) === JSON.stringify(Mi(t.locator.locations)) &&
|
|
4670
|
+
return r.locator.href === t.locator.href && JSON.stringify(Mi(r.locator.locations)) === JSON.stringify(Mi(t.locator.locations)) && Xs(r.style, t.style) && JSON.stringify(r.extras ?? null) === JSON.stringify(t.extras ?? null);
|
|
4655
4671
|
}
|
|
4656
4672
|
const Cn = /* @__PURE__ */ new Set([
|
|
4657
4673
|
_.Highlight,
|
|
@@ -4661,7 +4677,7 @@ const Cn = /* @__PURE__ */ new Set([
|
|
|
4661
4677
|
_.Mask,
|
|
4662
4678
|
_.Template
|
|
4663
4679
|
]);
|
|
4664
|
-
class
|
|
4680
|
+
class Ys {
|
|
4665
4681
|
constructor(t, e, i, n) {
|
|
4666
4682
|
this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
|
|
4667
4683
|
}
|
|
@@ -4711,7 +4727,7 @@ class Xs {
|
|
|
4711
4727
|
return n + o;
|
|
4712
4728
|
}
|
|
4713
4729
|
}
|
|
4714
|
-
const
|
|
4730
|
+
const qs = 1e4;
|
|
4715
4731
|
class Dt {
|
|
4716
4732
|
constructor(t, e) {
|
|
4717
4733
|
this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
|
|
@@ -4722,7 +4738,7 @@ class Dt {
|
|
|
4722
4738
|
}
|
|
4723
4739
|
this.gc = setInterval(() => {
|
|
4724
4740
|
this.registry.forEach((i, n) => {
|
|
4725
|
-
performance.now() - i.time >
|
|
4741
|
+
performance.now() - i.time > qs && (console.warn(n, "event for", i.key, "was never handled!"), this.registry.delete(n));
|
|
4726
4742
|
});
|
|
4727
4743
|
}, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
|
|
4728
4744
|
}
|
|
@@ -4818,7 +4834,7 @@ class Ke {
|
|
|
4818
4834
|
this.unsubs.forEach((t) => t()), this.unsubs = [], this.conditionValues.clear();
|
|
4819
4835
|
}
|
|
4820
4836
|
}
|
|
4821
|
-
class
|
|
4837
|
+
class Ks {
|
|
4822
4838
|
constructor(t, e = {}, i = []) {
|
|
4823
4839
|
this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.frame.style.backgroundColor = "#FFFFFF", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
|
|
4824
4840
|
}
|
|
@@ -4914,7 +4930,7 @@ class qs {
|
|
|
4914
4930
|
return this.loader;
|
|
4915
4931
|
}
|
|
4916
4932
|
}
|
|
4917
|
-
class
|
|
4933
|
+
class Js {
|
|
4918
4934
|
constructor(t, e, i, n = {}, s = []) {
|
|
4919
4935
|
this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.currentCssProperties = e, this.injector = i, this.contentProtectionConfig = n, this.keyboardPeripheralsConfig = [...s];
|
|
4920
4936
|
}
|
|
@@ -4965,7 +4981,7 @@ class Ks {
|
|
|
4965
4981
|
const f = t.readingOrder.findWithHref(p);
|
|
4966
4982
|
if (!f) return;
|
|
4967
4983
|
if (!this.blobs.has(p)) {
|
|
4968
|
-
const C = await new
|
|
4984
|
+
const C = await new Ys(
|
|
4969
4985
|
t,
|
|
4970
4986
|
this.currentBaseURL || "",
|
|
4971
4987
|
f,
|
|
@@ -4976,7 +4992,7 @@ class Ks {
|
|
|
4976
4992
|
).build();
|
|
4977
4993
|
this.blobs.set(p, C);
|
|
4978
4994
|
}
|
|
4979
|
-
const b = new
|
|
4995
|
+
const b = new Ks(this.blobs.get(p), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
4980
4996
|
p !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(p, b);
|
|
4981
4997
|
};
|
|
4982
4998
|
try {
|
|
@@ -5035,7 +5051,7 @@ class Ks {
|
|
|
5035
5051
|
}
|
|
5036
5052
|
}
|
|
5037
5053
|
var we, Fi;
|
|
5038
|
-
function
|
|
5054
|
+
function Zs() {
|
|
5039
5055
|
if (Fi) return we;
|
|
5040
5056
|
Fi = 1;
|
|
5041
5057
|
function r(n) {
|
|
@@ -5222,7 +5238,7 @@ function Js() {
|
|
|
5222
5238
|
};
|
|
5223
5239
|
return i.posix = i, we = i, we;
|
|
5224
5240
|
}
|
|
5225
|
-
var Zt =
|
|
5241
|
+
var Zt = Zs();
|
|
5226
5242
|
function Et(r) {
|
|
5227
5243
|
const t = r.languages?.[0]?.toLowerCase(), e = r.readingProgression;
|
|
5228
5244
|
if (t) {
|
|
@@ -5233,44 +5249,44 @@ function Et(r) {
|
|
|
5233
5249
|
}
|
|
5234
5250
|
return "ltr";
|
|
5235
5251
|
}
|
|
5236
|
-
const
|
|
5237
|
-
experimentalHeaderFiltering:
|
|
5238
|
-
experimentalZoom:
|
|
5239
|
-
},
|
|
5240
|
-
ltr:
|
|
5241
|
-
rtl:
|
|
5252
|
+
const Qs = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, tr = { description: "Attempts to filter out elements that are sized using viewport units and should not be scaled directly e.g. tables, images, iframes, etc.", scope: "RS", value: "readium-experimentalZoom-on" }, er = {
|
|
5253
|
+
experimentalHeaderFiltering: Qs,
|
|
5254
|
+
experimentalZoom: tr
|
|
5255
|
+
}, ir = { disabled: [], added: [] }, nr = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, sr = {
|
|
5256
|
+
ltr: ir,
|
|
5257
|
+
rtl: nr,
|
|
5242
5258
|
"cjk-horizontal": { disabled: ["textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] },
|
|
5243
5259
|
"cjk-vertical": { disabled: ["colCount", "textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] }
|
|
5244
|
-
},
|
|
5245
|
-
latin:
|
|
5246
|
-
am:
|
|
5247
|
-
ar
|
|
5248
|
-
bn:
|
|
5249
|
-
bo:
|
|
5250
|
-
chr:
|
|
5251
|
-
fa:
|
|
5252
|
-
gu:
|
|
5253
|
-
he:
|
|
5254
|
-
hi:
|
|
5255
|
-
hy:
|
|
5256
|
-
iu:
|
|
5257
|
-
ja:
|
|
5258
|
-
km:
|
|
5259
|
-
kn:
|
|
5260
|
-
ko:
|
|
5261
|
-
lo:
|
|
5262
|
-
ml:
|
|
5263
|
-
or:
|
|
5264
|
-
pa:
|
|
5265
|
-
si:
|
|
5266
|
-
ta:
|
|
5267
|
-
te:
|
|
5268
|
-
th:
|
|
5269
|
-
zh:
|
|
5260
|
+
}, rr = { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 }, or = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, ar = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, lr = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, hr = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, cr = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, dr = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, ur = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, pr = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, fr = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, mr = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, gr = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, yr = { baseFontFamily: "YuGothic, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif", lineHeightCompensation: 1.167 }, br = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, vr = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, Sr = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, wr = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, Pr = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, Er = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, Cr = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, _r = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, xr = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, Lr = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, kr = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, Or = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, Rr = {
|
|
5261
|
+
latin: rr,
|
|
5262
|
+
am: or,
|
|
5263
|
+
ar,
|
|
5264
|
+
bn: lr,
|
|
5265
|
+
bo: hr,
|
|
5266
|
+
chr: cr,
|
|
5267
|
+
fa: dr,
|
|
5268
|
+
gu: ur,
|
|
5269
|
+
he: pr,
|
|
5270
|
+
hi: fr,
|
|
5271
|
+
hy: mr,
|
|
5272
|
+
iu: gr,
|
|
5273
|
+
ja: yr,
|
|
5274
|
+
km: br,
|
|
5275
|
+
kn: vr,
|
|
5276
|
+
ko: Sr,
|
|
5277
|
+
lo: wr,
|
|
5278
|
+
ml: Pr,
|
|
5279
|
+
or: Er,
|
|
5280
|
+
pa: Cr,
|
|
5281
|
+
si: _r,
|
|
5282
|
+
ta: xr,
|
|
5283
|
+
te: Lr,
|
|
5284
|
+
th: kr,
|
|
5285
|
+
zh: Or,
|
|
5270
5286
|
"zh-Hant": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
|
|
5271
5287
|
"zh-TW": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
|
|
5272
5288
|
"zh-HK": { baseFontFamily: "'方體', 'PingFang HK', '方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 }
|
|
5273
|
-
}, Je =
|
|
5289
|
+
}, Je = er, Uo = sr, Ho = Rr;
|
|
5274
5290
|
var nt = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(nt || {});
|
|
5275
5291
|
const ft = {
|
|
5276
5292
|
range: [0, 100],
|
|
@@ -5351,7 +5367,7 @@ class _n extends pe {
|
|
|
5351
5367
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), this.zoom !== null && (t["--USER__zoom"] = this.toPercentage(this.zoom, !0)), t;
|
|
5352
5368
|
}
|
|
5353
5369
|
}
|
|
5354
|
-
class
|
|
5370
|
+
class Ar extends pe {
|
|
5355
5371
|
constructor(t) {
|
|
5356
5372
|
super(), this.experiments = t.experiments ?? null;
|
|
5357
5373
|
}
|
|
@@ -5362,7 +5378,7 @@ class Rr extends pe {
|
|
|
5362
5378
|
}), t;
|
|
5363
5379
|
}
|
|
5364
5380
|
}
|
|
5365
|
-
class
|
|
5381
|
+
class Tr {
|
|
5366
5382
|
constructor(t) {
|
|
5367
5383
|
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
|
|
5368
5384
|
}
|
|
@@ -5388,10 +5404,10 @@ class Ar {
|
|
|
5388
5404
|
this.userProperties = new _n(e);
|
|
5389
5405
|
}
|
|
5390
5406
|
}
|
|
5391
|
-
function
|
|
5407
|
+
function Nr(r, t) {
|
|
5392
5408
|
return r == null || t == null || r <= t ? r : void 0;
|
|
5393
5409
|
}
|
|
5394
|
-
function
|
|
5410
|
+
function Mr(r, t) {
|
|
5395
5411
|
return r == null || t == null || r >= t ? r : void 0;
|
|
5396
5412
|
}
|
|
5397
5413
|
function W(r) {
|
|
@@ -5449,7 +5465,7 @@ class Ut {
|
|
|
5449
5465
|
return new Ut(e);
|
|
5450
5466
|
}
|
|
5451
5467
|
}
|
|
5452
|
-
class
|
|
5468
|
+
class Fr {
|
|
5453
5469
|
constructor(t) {
|
|
5454
5470
|
this.fontFamily = W(t.fontFamily) || null, this.fontWeight = D(t.fontWeight, at.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (M.OS.iOS || M.OS.iPadOS) && M.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : M.OS.iPadOS && M.iOSRequest === "desktop", this.letterSpacing = w(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.textAlign = fe(t.textAlign, nt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = w(t.wordSpacing) || null, this.zoom = D(t.zoom, oe.range) || 1, this.experiments = xn(t.experiments) ?? null;
|
|
5455
5471
|
}
|
|
@@ -5780,7 +5796,7 @@ const kn = (r) => {
|
|
|
5780
5796
|
t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
|
|
5781
5797
|
e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && r.setAttribute(e, "") : r.setAttribute(e, i));
|
|
5782
5798
|
});
|
|
5783
|
-
},
|
|
5799
|
+
}, zr = (r, t, e) => {
|
|
5784
5800
|
const i = r.createElement("script");
|
|
5785
5801
|
i.dataset.readium = "true", t.id && (i.id = t.id);
|
|
5786
5802
|
const n = t.type || kn(t);
|
|
@@ -5877,7 +5893,7 @@ class Rn {
|
|
|
5877
5893
|
}
|
|
5878
5894
|
createElement(t, e, i) {
|
|
5879
5895
|
if (e.as === "script")
|
|
5880
|
-
return
|
|
5896
|
+
return zr(t, e, i);
|
|
5881
5897
|
if (e.as === "link")
|
|
5882
5898
|
return Di(t, e, i);
|
|
5883
5899
|
throw new Error(`Unsupported element type: ${e.as}`);
|
|
@@ -5936,7 +5952,7 @@ class Rn {
|
|
|
5936
5952
|
}
|
|
5937
5953
|
}
|
|
5938
5954
|
}
|
|
5939
|
-
const _t = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Rt = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "),
|
|
5955
|
+
const _t = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Rt = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), Ir = `/*!
|
|
5940
5956
|
* Readium CSS v.2.0.5
|
|
5941
5957
|
* Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
|
|
5942
5958
|
* Use of this source code is governed by a BSD-style license which is detailed in the
|
|
@@ -6209,7 +6225,7 @@ const _t = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
6209
6225
|
|
|
6210
6226
|
:root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
|
|
6211
6227
|
-webkit-text-zoom:normal;
|
|
6212
|
-
}`, An = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));',
|
|
6228
|
+
}`, An = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', Dr = `// WebPub-specific setup - no execution blocking needed
|
|
6213
6229
|
window._readium_blockedEvents = [];
|
|
6214
6230
|
window._readium_blockEvents = false; // WebPub doesn't need event blocking
|
|
6215
6231
|
window._readium_eventBlocker = null;
|
|
@@ -6227,7 +6243,7 @@ window._readium_eventBlocker = null;
|
|
|
6227
6243
|
});
|
|
6228
6244
|
})();
|
|
6229
6245
|
`;
|
|
6230
|
-
function
|
|
6246
|
+
function Ur(r) {
|
|
6231
6247
|
const t = r.filter((s) => s.mediaType.isHTML).map((s) => s.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
|
|
6232
6248
|
// CSS Selector Generator - always injected
|
|
6233
6249
|
{
|
|
@@ -6241,7 +6257,7 @@ function Dr(r) {
|
|
|
6241
6257
|
id: "webpub-execution",
|
|
6242
6258
|
as: "script",
|
|
6243
6259
|
target: "head",
|
|
6244
|
-
blob: new Blob([_t(
|
|
6260
|
+
blob: new Blob([_t(Dr)], { type: "text/javascript" })
|
|
6245
6261
|
}
|
|
6246
6262
|
], n = [
|
|
6247
6263
|
// Onload Proxy - conditional (has executable scripts)
|
|
@@ -6257,7 +6273,7 @@ function Dr(r) {
|
|
|
6257
6273
|
id: "readium-css-webpub",
|
|
6258
6274
|
as: "link",
|
|
6259
6275
|
target: "head",
|
|
6260
|
-
blob: new Blob([Rt(
|
|
6276
|
+
blob: new Blob([Rt(Ir)], { type: "text/css" }),
|
|
6261
6277
|
rel: "stylesheet"
|
|
6262
6278
|
}
|
|
6263
6279
|
];
|
|
@@ -6269,7 +6285,7 @@ function Dr(r) {
|
|
|
6269
6285
|
}
|
|
6270
6286
|
];
|
|
6271
6287
|
}
|
|
6272
|
-
class
|
|
6288
|
+
class Hr {
|
|
6273
6289
|
constructor(t) {
|
|
6274
6290
|
if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
|
|
6275
6291
|
throw new Error("onDetected callback is required");
|
|
@@ -6301,11 +6317,11 @@ class Ur {
|
|
|
6301
6317
|
this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
|
|
6302
6318
|
}
|
|
6303
6319
|
}
|
|
6304
|
-
let
|
|
6305
|
-
function
|
|
6306
|
-
return ++
|
|
6320
|
+
let Wr = 0;
|
|
6321
|
+
function Br() {
|
|
6322
|
+
return ++Wr;
|
|
6307
6323
|
}
|
|
6308
|
-
const
|
|
6324
|
+
const Vr = `
|
|
6309
6325
|
onmessage = function(event) {
|
|
6310
6326
|
var action = event.data;
|
|
6311
6327
|
var startTime = performance.now()
|
|
@@ -6326,7 +6342,7 @@ onmessage = function(event) {
|
|
|
6326
6342
|
}, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
|
|
6327
6343
|
}
|
|
6328
6344
|
async send(t, ...e) {
|
|
6329
|
-
const i =
|
|
6345
|
+
const i = Br();
|
|
6330
6346
|
return new Promise((n, s) => {
|
|
6331
6347
|
this.callbacks.set(i, n), this.worker.postMessage({
|
|
6332
6348
|
id: i,
|
|
@@ -6341,13 +6357,13 @@ onmessage = function(event) {
|
|
|
6341
6357
|
this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
|
|
6342
6358
|
}
|
|
6343
6359
|
};
|
|
6344
|
-
ii.workerScript =
|
|
6360
|
+
ii.workerScript = Vr;
|
|
6345
6361
|
let he = ii;
|
|
6346
6362
|
function Ze(r) {
|
|
6347
6363
|
return typeof window < "u" && console ? console[r] : (...t) => {
|
|
6348
6364
|
};
|
|
6349
6365
|
}
|
|
6350
|
-
const
|
|
6366
|
+
const jr = Ze("log"), Ui = Ze("table"), $r = Ze("clear");
|
|
6351
6367
|
async function Hi() {
|
|
6352
6368
|
if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
|
|
6353
6369
|
try {
|
|
@@ -6360,10 +6376,10 @@ async function Hi() {
|
|
|
6360
6376
|
}
|
|
6361
6377
|
return !1;
|
|
6362
6378
|
}
|
|
6363
|
-
function
|
|
6379
|
+
function Gr(r) {
|
|
6364
6380
|
return r.excludes.some((t) => t()) ? !1 : r.includes.some((t) => t());
|
|
6365
6381
|
}
|
|
6366
|
-
class
|
|
6382
|
+
class Xr {
|
|
6367
6383
|
constructor(t = {}) {
|
|
6368
6384
|
if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
|
|
6369
6385
|
onDetected: t.onDetected || (() => {
|
|
@@ -6425,14 +6441,14 @@ class Gr {
|
|
|
6425
6441
|
return (await this.workerConsole.log(t)).time;
|
|
6426
6442
|
{
|
|
6427
6443
|
const e = performance.now();
|
|
6428
|
-
return
|
|
6444
|
+
return jr(t), performance.now() - e;
|
|
6429
6445
|
}
|
|
6430
6446
|
}
|
|
6431
6447
|
/**
|
|
6432
6448
|
* Check if performance-based detection is enabled for current browser
|
|
6433
6449
|
*/
|
|
6434
6450
|
isPerformanceDetectionEnabled() {
|
|
6435
|
-
return
|
|
6451
|
+
return Gr({
|
|
6436
6452
|
includes: [
|
|
6437
6453
|
() => !!X.UA.Chrome,
|
|
6438
6454
|
() => !!X.UA.Chromium,
|
|
@@ -6455,7 +6471,7 @@ class Gr {
|
|
|
6455
6471
|
if (!this.isPerformanceDetectionEnabled())
|
|
6456
6472
|
return !1;
|
|
6457
6473
|
const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
|
|
6458
|
-
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() :
|
|
6474
|
+
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : $r(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Hi() : t > this.maxPrintTime * 10;
|
|
6459
6475
|
}
|
|
6460
6476
|
/**
|
|
6461
6477
|
* Debugger-based detection (fallback method)
|
|
@@ -6510,7 +6526,7 @@ class Gr {
|
|
|
6510
6526
|
this.intervalId && (clearInterval(this.intervalId), this.intervalId = void 0), this.workerConsole && (this.workerConsole.destroy(), this.workerConsole = void 0), this.isOpen = !1, this.checkCount = 0;
|
|
6511
6527
|
}
|
|
6512
6528
|
}
|
|
6513
|
-
class
|
|
6529
|
+
class Yr {
|
|
6514
6530
|
constructor(t) {
|
|
6515
6531
|
if (this.detected = !1, !t.onDetected)
|
|
6516
6532
|
throw new Error("onDetected callback is required");
|
|
@@ -6545,7 +6561,7 @@ class Xr {
|
|
|
6545
6561
|
this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
|
|
6546
6562
|
}
|
|
6547
6563
|
}
|
|
6548
|
-
class
|
|
6564
|
+
class qr {
|
|
6549
6565
|
constructor(t = {}) {
|
|
6550
6566
|
this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
|
|
6551
6567
|
}
|
|
@@ -6571,7 +6587,7 @@ class Yr {
|
|
|
6571
6587
|
this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
|
|
6572
6588
|
}
|
|
6573
6589
|
}
|
|
6574
|
-
class
|
|
6590
|
+
class Kr {
|
|
6575
6591
|
constructor(t = {}) {
|
|
6576
6592
|
this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
|
|
6577
6593
|
}
|
|
@@ -6603,7 +6619,7 @@ class Qe {
|
|
|
6603
6619
|
window.dispatchEvent(i);
|
|
6604
6620
|
}
|
|
6605
6621
|
constructor(t = {}) {
|
|
6606
|
-
t.monitorDevTools && (this.devToolsDetector = new
|
|
6622
|
+
t.monitorDevTools && (this.devToolsDetector = new Xr({
|
|
6607
6623
|
onDetected: () => {
|
|
6608
6624
|
this.dispatchSuspiciousActivity("developer_tools", {
|
|
6609
6625
|
targetFrameSrc: "",
|
|
@@ -6616,20 +6632,20 @@ class Qe {
|
|
|
6616
6632
|
metaKey: !1
|
|
6617
6633
|
});
|
|
6618
6634
|
}
|
|
6619
|
-
})), t.checkAutomation && (this.automationDetector = new
|
|
6635
|
+
})), t.checkAutomation && (this.automationDetector = new Hr({
|
|
6620
6636
|
onDetected: (e) => {
|
|
6621
6637
|
this.dispatchSuspiciousActivity("automation_detected", { tool: e });
|
|
6622
6638
|
}
|
|
6623
|
-
})), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new
|
|
6639
|
+
})), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Yr({
|
|
6624
6640
|
onDetected: (e) => {
|
|
6625
6641
|
this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
|
|
6626
6642
|
}
|
|
6627
|
-
})), t.protectPrinting?.disable && (this.printProtector = new
|
|
6643
|
+
})), t.protectPrinting?.disable && (this.printProtector = new qr({
|
|
6628
6644
|
...t.protectPrinting,
|
|
6629
6645
|
onPrintAttempt: () => {
|
|
6630
6646
|
this.dispatchSuspiciousActivity("print", {});
|
|
6631
6647
|
}
|
|
6632
|
-
})), t.disableContextMenu && (this.contextMenuProtector = new
|
|
6648
|
+
})), t.disableContextMenu && (this.contextMenuProtector = new Kr({
|
|
6633
6649
|
onContextMenuBlocked: (e) => {
|
|
6634
6650
|
this.dispatchSuspiciousActivity("context_menu", e);
|
|
6635
6651
|
}
|
|
@@ -6665,7 +6681,7 @@ class ti {
|
|
|
6665
6681
|
this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = void 0);
|
|
6666
6682
|
}
|
|
6667
6683
|
}
|
|
6668
|
-
const
|
|
6684
|
+
const Jr = (r) => ({
|
|
6669
6685
|
frameLoaded: r.frameLoaded || (() => {
|
|
6670
6686
|
}),
|
|
6671
6687
|
positionChanged: r.positionChanged || (() => {
|
|
@@ -6688,17 +6704,17 @@ const Kr = (r) => ({
|
|
|
6688
6704
|
peripheral: r.peripheral || (() => {
|
|
6689
6705
|
})
|
|
6690
6706
|
});
|
|
6691
|
-
class
|
|
6707
|
+
class Zr extends Pn {
|
|
6692
6708
|
constructor(t, e, i, n = void 0, s = { preferences: {}, defaults: {} }) {
|
|
6693
6709
|
super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._isNavigating = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._decorations = /* @__PURE__ */ new Map(), this._decorationObservers = /* @__PURE__ */ new Map(), this._decorationActivationState = /* @__PURE__ */ new Map(), this._decorationActivationConsumed = !1, this.webViewport = {
|
|
6694
6710
|
readingOrder: [],
|
|
6695
6711
|
progressions: /* @__PURE__ */ new Map(),
|
|
6696
6712
|
positions: null
|
|
6697
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
6698
|
-
rsProperties: new
|
|
6713
|
+
}, this.pub = e, this.container = t, this.listeners = Jr(i), this._preferences = new Ut(s.preferences), this._defaults = new Fr(s.defaults), this._settings = new zi(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new Tr({
|
|
6714
|
+
rsProperties: new Ar({ experiments: this._settings.experiments || null }),
|
|
6699
6715
|
userProperties: new _n({ zoom: this._settings.zoom })
|
|
6700
6716
|
});
|
|
6701
|
-
const o =
|
|
6717
|
+
const o = Ur(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
|
|
6702
6718
|
if (this._injector = new Rn({
|
|
6703
6719
|
rules: [...o, ...a.rules],
|
|
6704
6720
|
allowedDomains: a.allowedDomains
|
|
@@ -6723,7 +6739,7 @@ class Jr extends Pn {
|
|
|
6723
6739
|
async load() {
|
|
6724
6740
|
await this.updateCSS(!1);
|
|
6725
6741
|
const t = this.compileCSSProperties(this._css);
|
|
6726
|
-
this.framePool = new
|
|
6742
|
+
this.framePool = new Js(
|
|
6727
6743
|
this.container,
|
|
6728
6744
|
t,
|
|
6729
6745
|
this._injector,
|
|
@@ -6874,7 +6890,7 @@ class Jr extends Pn {
|
|
|
6874
6890
|
}
|
|
6875
6891
|
}
|
|
6876
6892
|
determineModules() {
|
|
6877
|
-
const t =
|
|
6893
|
+
const t = Ws.slice(), e = Et(this.pub.metadata);
|
|
6878
6894
|
return e === "cjk-vertical" || e === "mongolian-vertical" ? t.map((i) => i === "webpub_snapper" ? "cjk_vertical_snapper" : i) : t;
|
|
6879
6895
|
}
|
|
6880
6896
|
attachListener() {
|
|
@@ -7093,7 +7109,7 @@ class Jr extends Pn {
|
|
|
7093
7109
|
});
|
|
7094
7110
|
}
|
|
7095
7111
|
}
|
|
7096
|
-
const
|
|
7112
|
+
const Wo = Zr, Qr = (r) => {
|
|
7097
7113
|
const t = r.join(" ");
|
|
7098
7114
|
return [
|
|
7099
7115
|
// 'self' is useless because the document is loaded from a blob: URL
|
|
@@ -7172,7 +7188,7 @@ class Nn {
|
|
|
7172
7188
|
c.href = i, c.dataset.readium = "true", t.head.firstChild.before(c);
|
|
7173
7189
|
}
|
|
7174
7190
|
const h = t.createElement("meta");
|
|
7175
|
-
return h.httpEquiv = "Content-Security-Policy", h.content =
|
|
7191
|
+
return h.httpEquiv = "Content-Security-Policy", h.content = Qr(l), h.dataset.readium = "true", t.head.firstChild.before(h), URL.createObjectURL(
|
|
7176
7192
|
new Blob([new XMLSerializer().serializeToString(t)], {
|
|
7177
7193
|
type: n.isHTML ? n.string : "application/xhtml+xml"
|
|
7178
7194
|
// Fallback to XHTML
|
|
@@ -7286,7 +7302,7 @@ class Mn {
|
|
|
7286
7302
|
}
|
|
7287
7303
|
}
|
|
7288
7304
|
const Wi = 5, Bi = 3;
|
|
7289
|
-
class
|
|
7305
|
+
class to {
|
|
7290
7306
|
constructor(t, e, i, n, s, o) {
|
|
7291
7307
|
this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.positions = e, this.currentCssProperties = i, this.injector = n ?? null, this.contentProtectionConfig = s || {}, this.keyboardPeripheralsConfig = o || [];
|
|
7292
7308
|
}
|
|
@@ -7407,7 +7423,7 @@ class Qr {
|
|
|
7407
7423
|
}), t;
|
|
7408
7424
|
}
|
|
7409
7425
|
}
|
|
7410
|
-
class
|
|
7426
|
+
class eo {
|
|
7411
7427
|
constructor(t, e, i, n = {}, s = []) {
|
|
7412
7428
|
this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...s], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = i, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === I.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
|
|
7413
7429
|
}
|
|
@@ -7578,8 +7594,8 @@ class to {
|
|
|
7578
7594
|
return this.loader;
|
|
7579
7595
|
}
|
|
7580
7596
|
}
|
|
7581
|
-
var
|
|
7582
|
-
class
|
|
7597
|
+
var io = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(io || {}), no = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(no || {});
|
|
7598
|
+
class so {
|
|
7583
7599
|
constructor() {
|
|
7584
7600
|
this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
|
|
7585
7601
|
}
|
|
@@ -7627,7 +7643,7 @@ class no {
|
|
|
7627
7643
|
};
|
|
7628
7644
|
}
|
|
7629
7645
|
}
|
|
7630
|
-
class
|
|
7646
|
+
class ro {
|
|
7631
7647
|
constructor() {
|
|
7632
7648
|
this._DOM = {
|
|
7633
7649
|
show: !1,
|
|
@@ -7646,7 +7662,7 @@ class so {
|
|
|
7646
7662
|
}
|
|
7647
7663
|
}
|
|
7648
7664
|
const Vi = 6, Ee = 1.02, ji = 50;
|
|
7649
|
-
class
|
|
7665
|
+
class oo {
|
|
7650
7666
|
constructor(t, e = !1) {
|
|
7651
7667
|
this.dragState = 0, this.minimumMoved = !1, this.pan = {
|
|
7652
7668
|
startX: 0,
|
|
@@ -7665,7 +7681,7 @@ class ro {
|
|
|
7665
7681
|
target: { X: 0, Y: 0 },
|
|
7666
7682
|
touchN: 0,
|
|
7667
7683
|
startTranslate: { X: 0, Y: 0 }
|
|
7668
|
-
}, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new
|
|
7684
|
+
}, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new so(), this.attachEvents(), e && (this.debugger = new ro());
|
|
7669
7685
|
}
|
|
7670
7686
|
get scale() {
|
|
7671
7687
|
return this._scale;
|
|
@@ -7867,7 +7883,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
|
|
|
7867
7883
|
}
|
|
7868
7884
|
}
|
|
7869
7885
|
var De = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(De || {}), Ue = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(Ue || {});
|
|
7870
|
-
class
|
|
7886
|
+
class ao {
|
|
7871
7887
|
// TODO getter
|
|
7872
7888
|
constructor(t) {
|
|
7873
7889
|
this.shift = !0, this.spreads = [], this.nLandscape = 0, this.index(t), this.testShift(t), console.log(`Indexed ${this.spreads.length} spreads for ${t.readingOrder.items.length} items`);
|
|
@@ -7912,13 +7928,13 @@ class oo {
|
|
|
7912
7928
|
return this.spreads.find((e) => e.includes(t)) || void 0;
|
|
7913
7929
|
}
|
|
7914
7930
|
}
|
|
7915
|
-
const $i = 8, Gi = 5,
|
|
7916
|
-
class
|
|
7931
|
+
const $i = 8, Gi = 5, lo = 300, ho = 15e3, co = 250, uo = 150, po = 500;
|
|
7932
|
+
class fo {
|
|
7917
7933
|
constructor(t, e, i, n, s, o) {
|
|
7918
7934
|
if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.injector = null, this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = s || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Ue.auto, this.pub.metadata.effectiveReadingProgression !== I.rtl && this.pub.metadata.effectiveReadingProgression !== I.ltr)
|
|
7919
7935
|
throw Error("Unsupported reading progression for EPUB");
|
|
7920
|
-
this.spreader = new
|
|
7921
|
-
const l = new
|
|
7936
|
+
this.spreader = new ao(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new oo(this), this.pub.readingOrder.items.forEach((a) => {
|
|
7937
|
+
const l = new eo(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
7922
7938
|
this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === De.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
|
|
7923
7939
|
});
|
|
7924
7940
|
}
|
|
@@ -7943,7 +7959,7 @@ class po {
|
|
|
7943
7959
|
const a = this.spreader.findByLink(o);
|
|
7944
7960
|
i.update(this.spreadPosition(a, o));
|
|
7945
7961
|
});
|
|
7946
|
-
},
|
|
7962
|
+
}, co);
|
|
7947
7963
|
}
|
|
7948
7964
|
/**
|
|
7949
7965
|
* It is important that these values be cached to avoid spamming them on redraws, they are expensive.
|
|
@@ -7970,7 +7986,7 @@ class po {
|
|
|
7970
7986
|
let i = "0";
|
|
7971
7987
|
this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
|
|
7972
7988
|
const n = {
|
|
7973
|
-
transition: t ? `all ${e ?
|
|
7989
|
+
transition: t ? `all ${e ? uo : po}ms ease-out` : "all 0ms ease-out",
|
|
7974
7990
|
marginRight: this.rtl ? i : "0",
|
|
7975
7991
|
marginLeft: this.rtl ? "0" : i,
|
|
7976
7992
|
width: `${this.width / this.perPage * this.length}px`,
|
|
@@ -8154,10 +8170,10 @@ class po {
|
|
|
8154
8170
|
this.delayedTimeout.set(f, 0);
|
|
8155
8171
|
const In = this.makeSpread(this.reAlign(b)), Dn = this.spreadPosition(In, S), ni = this.pool.get(f);
|
|
8156
8172
|
await ni.load(i, this.blobs.get(f)), this.peripherals.isScaled || await ni.show(Dn), this.delayedShow.delete(f), G = !0, C();
|
|
8157
|
-
},
|
|
8173
|
+
}, lo);
|
|
8158
8174
|
setTimeout(() => {
|
|
8159
8175
|
!G && this.delayedShow.has(f) && x(`Offscreen load timeout: ${f}`);
|
|
8160
|
-
},
|
|
8176
|
+
}, ho), this.delayedTimeout.set(f, ut);
|
|
8161
8177
|
}));
|
|
8162
8178
|
}
|
|
8163
8179
|
};
|
|
@@ -8258,18 +8274,18 @@ class Ht {
|
|
|
8258
8274
|
return new Ht(e);
|
|
8259
8275
|
}
|
|
8260
8276
|
}
|
|
8261
|
-
class
|
|
8277
|
+
class mo {
|
|
8262
8278
|
constructor(t) {
|
|
8263
|
-
this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = w(t.constraint) || 0, this.columnCount = w(t.columnCount) || null, this.darkenFilter = Ct(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = D(t.fontSize, Qt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = D(t.fontWeight, at.range) || null, this.fontWidth = D(t.fontWidth, te.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = Ct(t.invertFilter) ?? !1, this.invertGaijiFilter = Ct(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (M.OS.iOS || M.OS.iPadOS) && M.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : M.OS.iPadOS && M.iOSRequest === "desktop", this.letterSpacing = w(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = Pe(w(t.pageGutter), 20), this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = w(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = w(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = w(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = w(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = fe(t.textAlign, nt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = w(t.wordSpacing) || null, this.optimalLineLength = w(t.optimalLineLength) || 65, this.maximalLineLength = Pe(
|
|
8279
|
+
this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = w(t.constraint) || 0, this.columnCount = w(t.columnCount) || null, this.darkenFilter = Ct(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = D(t.fontSize, Qt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = D(t.fontWeight, at.range) || null, this.fontWidth = D(t.fontWidth, te.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = Ct(t.invertFilter) ?? !1, this.invertGaijiFilter = Ct(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (M.OS.iOS || M.OS.iPadOS) && M.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : M.OS.iPadOS && M.iOSRequest === "desktop", this.letterSpacing = w(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = Pe(w(t.pageGutter), 20), this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = w(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = w(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = w(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = w(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = fe(t.textAlign, nt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = w(t.wordSpacing) || null, this.optimalLineLength = w(t.optimalLineLength) || 65, this.maximalLineLength = Pe(Mr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = Pe(Nr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = xn(t.experiments) || null;
|
|
8264
8280
|
}
|
|
8265
8281
|
}
|
|
8266
|
-
const
|
|
8267
|
-
backgroundColor:
|
|
8268
|
-
textColor:
|
|
8269
|
-
linkColor:
|
|
8270
|
-
visitedColor:
|
|
8271
|
-
selectionBackgroundColor:
|
|
8272
|
-
selectionTextColor:
|
|
8282
|
+
const go = "#FFFFFF", yo = "#121212", bo = "#0000EE", vo = "#551A8B", So = "#b4d8fe", wo = "inherit", gt = {
|
|
8283
|
+
backgroundColor: go,
|
|
8284
|
+
textColor: yo,
|
|
8285
|
+
linkColor: bo,
|
|
8286
|
+
visitedColor: vo,
|
|
8287
|
+
selectionBackgroundColor: So,
|
|
8288
|
+
selectionTextColor: wo
|
|
8273
8289
|
};
|
|
8274
8290
|
class Xi {
|
|
8275
8291
|
constructor(t, e, i) {
|
|
@@ -8725,7 +8741,7 @@ function At(r) {
|
|
|
8725
8741
|
const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
|
|
8726
8742
|
return r.clientWidth - e - i;
|
|
8727
8743
|
}
|
|
8728
|
-
function
|
|
8744
|
+
function Po(r) {
|
|
8729
8745
|
const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
|
|
8730
8746
|
return r.clientHeight - e - i;
|
|
8731
8747
|
}
|
|
@@ -8738,7 +8754,7 @@ class Fn extends pe {
|
|
|
8738
8754
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.backgroundColor && (t["--USER__backgroundColor"] = this.backgroundColor), this.blendFilter && (t["--USER__blendFilter"] = this.toFlag("blend")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.colCount && (t["--USER__colCount"] = this.toUnitless(this.colCount)), this.darkenFilter === !0 ? t["--USER__darkenFilter"] = this.toFlag("darken") : typeof this.darkenFilter == "number" && (t["--USER__darkenFilter"] = this.toPercentage(this.darkenFilter)), this.deprecatedFontSize && (t["--USER__fontSizeImplementation"] = this.toFlag("deprecatedFontSize")), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontOpticalSizing != null && (t["--USER__fontOpticalSizing"] = this.fontOpticalSizing), this.fontSize != null && (t["--USER__fontSize"] = this.toPercentage(this.fontSize, !0)), this.fontSizeNormalize && (t["--USER__fontSizeNormalize"] = this.toFlag("normalize")), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.fontWidth != null && (t["--USER__fontWidth"] = typeof this.fontWidth == "string" ? this.fontWidth : this.toUnitless(this.fontWidth)), this.invertFilter === !0 ? t["--USER__invertFilter"] = this.toFlag("invert") : typeof this.invertFilter == "number" && (t["--USER__invertFilter"] = this.toPercentage(this.invertFilter)), this.invertGaijiFilter === !0 ? t["--USER__invertGaiji"] = this.toFlag("invertGaiji") : typeof this.invertGaijiFilter == "number" && (t["--USER__invertGaiji"] = this.toPercentage(this.invertGaijiFilter)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.lineLength != null && (t["--USER__lineLength"] = this.toPx(this.lineLength)), this.linkColor && (t["--USER__linkColor"] = this.linkColor), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.selectionBackgroundColor && (t["--USER__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--USER__selectionTextColor"] = this.selectionTextColor), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.textColor && (t["--USER__textColor"] = this.textColor), this.view && (t["--USER__view"] = this.toFlag(this.view)), this.visitedColor && (t["--USER__visitedColor"] = this.visitedColor), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), t;
|
|
8739
8755
|
}
|
|
8740
8756
|
}
|
|
8741
|
-
class
|
|
8757
|
+
class Eo extends pe {
|
|
8742
8758
|
constructor(t) {
|
|
8743
8759
|
super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingLeft = t.scrollPaddingLeft ?? null, this.scrollPaddingRight = t.scrollPaddingRight ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null, this.experiments = t.experiments ?? null;
|
|
8744
8760
|
}
|
|
@@ -8749,7 +8765,7 @@ class Po extends pe {
|
|
|
8749
8765
|
}), t;
|
|
8750
8766
|
}
|
|
8751
8767
|
}
|
|
8752
|
-
class
|
|
8768
|
+
class Co {
|
|
8753
8769
|
constructor(t) {
|
|
8754
8770
|
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.isCJKVertical = t.isCJKVertical ?? !1, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = At(this.containerParent);
|
|
8755
8771
|
}
|
|
@@ -8863,7 +8879,7 @@ class Eo {
|
|
|
8863
8879
|
};
|
|
8864
8880
|
}
|
|
8865
8881
|
computeCJKVerticalLength(t, e) {
|
|
8866
|
-
const i = Math.round(At(this.containerParent) - this.constraint), n = Math.round(
|
|
8882
|
+
const i = Math.round(At(this.containerParent) - this.constraint), n = Math.round(Po(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
|
|
8867
8883
|
return { colCount: void 0, effectiveContainerWidth: i, effectiveLineLength: o };
|
|
8868
8884
|
}
|
|
8869
8885
|
// This behaves as paginate where colCount = 1
|
|
@@ -8890,7 +8906,7 @@ class Eo {
|
|
|
8890
8906
|
this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
|
|
8891
8907
|
}
|
|
8892
8908
|
}
|
|
8893
|
-
const
|
|
8909
|
+
const _o = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
|
|
8894
8910
|
// For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
|
|
8895
8911
|
// The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
|
|
8896
8912
|
(function() {
|
|
@@ -8956,7 +8972,7 @@ const Co = `// Note: we aren't blocking some of the events right now to try and
|
|
|
8956
8972
|
window.addEventListener("load", window._readium_eventBlocker, true);
|
|
8957
8973
|
})();
|
|
8958
8974
|
`;
|
|
8959
|
-
async function
|
|
8975
|
+
async function xo(r, t) {
|
|
8960
8976
|
const e = r.effectiveLayout === v.fixed, i = t.filter((a) => a.mediaType.isHTML).map((a) => a.href), n = i.length > 0 ? i : [/\.xhtml$/, /\.html$/], s = [
|
|
8961
8977
|
// CSS Selector Generator - always injected
|
|
8962
8978
|
{
|
|
@@ -8970,7 +8986,7 @@ async function _o(r, t) {
|
|
|
8970
8986
|
id: "execution-prevention",
|
|
8971
8987
|
as: "script",
|
|
8972
8988
|
target: "head",
|
|
8973
|
-
blob: new Blob([_t(
|
|
8989
|
+
blob: new Blob([_t(_o)], { type: "text/javascript" }),
|
|
8974
8990
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
8975
8991
|
}
|
|
8976
8992
|
], o = [
|
|
@@ -9071,7 +9087,7 @@ async function _o(r, t) {
|
|
|
9071
9087
|
}
|
|
9072
9088
|
];
|
|
9073
9089
|
}
|
|
9074
|
-
const
|
|
9090
|
+
const Lo = (r) => ({
|
|
9075
9091
|
frameLoaded: r.frameLoaded || (() => {
|
|
9076
9092
|
}),
|
|
9077
9093
|
positionChanged: r.positionChanged || (() => {
|
|
@@ -9102,10 +9118,10 @@ class zn extends Pn {
|
|
|
9102
9118
|
readingOrder: [],
|
|
9103
9119
|
progressions: /* @__PURE__ */ new Map(),
|
|
9104
9120
|
positions: null
|
|
9105
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
9121
|
+
}, this.pub = e, this.container = t, this.listeners = Lo(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new Ht(o.preferences), this._defaults = new mo(o.defaults), this._settings = new Yi(this._preferences, this._defaults);
|
|
9106
9122
|
const a = Et(e.metadata), l = a === "cjk-horizontal", d = a === "cjk-vertical", c = d || a === "mongolian-vertical", u = l || d;
|
|
9107
|
-
this._css = new
|
|
9108
|
-
rsProperties: new
|
|
9123
|
+
this._css = new Co({
|
|
9124
|
+
rsProperties: new Eo({ noVerticalPagination: c || void 0 }),
|
|
9109
9125
|
userProperties: new Fn({}),
|
|
9110
9126
|
lineLengths: new Nt({
|
|
9111
9127
|
optimalChars: this._settings.optimalLineLength,
|
|
@@ -9121,7 +9137,7 @@ class zn extends Pn {
|
|
|
9121
9137
|
container: t,
|
|
9122
9138
|
constraint: this._settings.constraint,
|
|
9123
9139
|
isCJKVertical: c
|
|
9124
|
-
}), this._layout = zn.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise =
|
|
9140
|
+
}), this._layout = zn.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = xo(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._decoratorConfig = o.decoratorConfig || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
9125
9141
|
this._contentProtection,
|
|
9126
9142
|
o.keyboardPeripherals || []
|
|
9127
9143
|
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Qe(this._contentProtection), this._suspiciousActivityListener = (m) => {
|
|
@@ -9152,7 +9168,7 @@ class zn extends Pn {
|
|
|
9152
9168
|
});
|
|
9153
9169
|
}
|
|
9154
9170
|
if (this._layout === v.fixed)
|
|
9155
|
-
this.framePool = new
|
|
9171
|
+
this.framePool = new fo(
|
|
9156
9172
|
this.container,
|
|
9157
9173
|
this.positions,
|
|
9158
9174
|
this.pub,
|
|
@@ -9165,7 +9181,7 @@ class zn extends Pn {
|
|
|
9165
9181
|
else {
|
|
9166
9182
|
await this.updateCSS(!1);
|
|
9167
9183
|
const t = this.compileCSSProperties(this._css);
|
|
9168
|
-
this.framePool = new
|
|
9184
|
+
this.framePool = new to(
|
|
9169
9185
|
this.container,
|
|
9170
9186
|
this.positions,
|
|
9171
9187
|
t,
|
|
@@ -9377,8 +9393,8 @@ class zn extends Pn {
|
|
|
9377
9393
|
determineModules() {
|
|
9378
9394
|
let t = Array.from(Ie.keys());
|
|
9379
9395
|
if (this._layout === v.fixed)
|
|
9380
|
-
return t.filter((n) =>
|
|
9381
|
-
t = t.filter((n) =>
|
|
9396
|
+
return t.filter((n) => Us.includes(n));
|
|
9397
|
+
t = t.filter((n) => Hs.includes(n));
|
|
9382
9398
|
const e = Et(this.pub.metadata);
|
|
9383
9399
|
if (e === "cjk-vertical" || e === "mongolian-vertical")
|
|
9384
9400
|
return t.filter((n) => n !== "column_snapper" && n !== "scroll_snapper");
|
|
@@ -9681,7 +9697,7 @@ class zn extends Pn {
|
|
|
9681
9697
|
return this.go(t.locator, e, i);
|
|
9682
9698
|
}
|
|
9683
9699
|
}
|
|
9684
|
-
const
|
|
9700
|
+
const ko = `// PreservePitchProcessor.js
|
|
9685
9701
|
// AudioWorklet processor for pitch preservation via pitch shifting.
|
|
9686
9702
|
//
|
|
9687
9703
|
// Architecture:
|
|
@@ -9906,7 +9922,7 @@ class ei {
|
|
|
9906
9922
|
if (n)
|
|
9907
9923
|
await e.audioWorklet.addModule(n);
|
|
9908
9924
|
else {
|
|
9909
|
-
const o = new Blob([
|
|
9925
|
+
const o = new Blob([ko], { type: "text/javascript" });
|
|
9910
9926
|
s.url = URL.createObjectURL(o), await e.audioWorklet.addModule(s.url);
|
|
9911
9927
|
}
|
|
9912
9928
|
} catch (o) {
|
|
@@ -9926,7 +9942,7 @@ class ei {
|
|
|
9926
9942
|
this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
|
|
9927
9943
|
}
|
|
9928
9944
|
}
|
|
9929
|
-
class
|
|
9945
|
+
class Oo {
|
|
9930
9946
|
constructor(t) {
|
|
9931
9947
|
this.audioContext = null, this.sourceNode = null, this.gainNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.isStoppedValue = !1, this.worklet = null, this.webAudioActive = !1, this.boundOnCanPlayThrough = this.onCanPlayThrough.bind(this), this.boundOnTimeUpdate = this.onTimeUpdate.bind(this), this.boundOnError = this.onError.bind(this), this.boundOnEnded = this.onEnded.bind(this), this.boundOnStalled = this.onStalled.bind(this), this.boundOnEmptied = this.onEmptied.bind(this), this.boundOnSuspend = this.onSuspend.bind(this), this.boundOnWaiting = this.onWaiting.bind(this), this.boundOnLoadedMetadata = this.onLoadedMetadata.bind(this), this.boundOnSeeking = this.onSeeking.bind(this), this.boundOnSeeked = this.onSeeked.bind(this), this.boundOnPlay = this.onPlay.bind(this), this.boundOnPlaying = this.onPlaying.bind(this), this.boundOnPause = this.onPause.bind(this), this.boundOnProgress = this.onProgress.bind(this), this.playback = t.playback, this.mediaElement = document.createElement("audio"), this.mediaElement.addEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.addEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.addEventListener("error", this.boundOnError), this.mediaElement.addEventListener("ended", this.boundOnEnded), this.mediaElement.addEventListener("stalled", this.boundOnStalled), this.mediaElement.addEventListener("emptied", this.boundOnEmptied), this.mediaElement.addEventListener("suspend", this.boundOnSuspend), this.mediaElement.addEventListener("waiting", this.boundOnWaiting), this.mediaElement.addEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.addEventListener("seeking", this.boundOnSeeking), this.mediaElement.addEventListener("seeked", this.boundOnSeeked), this.mediaElement.addEventListener("play", this.boundOnPlay), this.mediaElement.addEventListener("playing", this.boundOnPlaying), this.mediaElement.addEventListener("pause", this.boundOnPause), this.mediaElement.addEventListener("progress", this.boundOnProgress), this.mediaElement.currentTime = this.playback.state.currentTime;
|
|
9932
9948
|
}
|
|
@@ -10203,7 +10219,7 @@ class me {
|
|
|
10203
10219
|
return new me(e);
|
|
10204
10220
|
}
|
|
10205
10221
|
}
|
|
10206
|
-
class
|
|
10222
|
+
class Ro {
|
|
10207
10223
|
constructor(t = {}) {
|
|
10208
10224
|
this.volume = D(t.volume, ae.range) ?? 1, this.playbackRate = D(t.playbackRate, le.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = D(t.skipBackwardInterval, rt.range) ?? 10, this.skipForwardInterval = D(t.skipForwardInterval, rt.range) ?? 10, this.pollInterval = w(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
|
|
10209
10225
|
}
|
|
@@ -10313,7 +10329,7 @@ class Ki {
|
|
|
10313
10329
|
}
|
|
10314
10330
|
}
|
|
10315
10331
|
const Ji = 1, Zi = 1;
|
|
10316
|
-
class
|
|
10332
|
+
class Ao {
|
|
10317
10333
|
constructor(t, e, i = {}) {
|
|
10318
10334
|
this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes(), i.disableRemotePlayback && (this._audioEngine.getMediaElement().disableRemotePlayback = !0);
|
|
10319
10335
|
}
|
|
@@ -10390,7 +10406,7 @@ class Ro {
|
|
|
10390
10406
|
this.pool.clear();
|
|
10391
10407
|
}
|
|
10392
10408
|
}
|
|
10393
|
-
class
|
|
10409
|
+
class To {
|
|
10394
10410
|
constructor(t = {}) {
|
|
10395
10411
|
this.dragstartHandler = (e) => {
|
|
10396
10412
|
e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
|
|
@@ -10406,7 +10422,7 @@ class Ao {
|
|
|
10406
10422
|
document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("dragover", this.dragoverHandler, !0), document.removeEventListener("drop", this.dropHandler, !0), window.removeEventListener("unload", this.unloadHandler);
|
|
10407
10423
|
}
|
|
10408
10424
|
}
|
|
10409
|
-
class
|
|
10425
|
+
class No {
|
|
10410
10426
|
constructor(t = {}) {
|
|
10411
10427
|
this.copyHandler = (e) => {
|
|
10412
10428
|
e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
|
|
@@ -10416,16 +10432,16 @@ class To {
|
|
|
10416
10432
|
document.removeEventListener("copy", this.copyHandler, !0), window.removeEventListener("unload", this.unloadHandler);
|
|
10417
10433
|
}
|
|
10418
10434
|
}
|
|
10419
|
-
class
|
|
10435
|
+
class Mo extends Qe {
|
|
10420
10436
|
constructor(t = {}) {
|
|
10421
|
-
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new
|
|
10437
|
+
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new To({
|
|
10422
10438
|
onDragDetected: (e) => {
|
|
10423
10439
|
this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
|
|
10424
10440
|
},
|
|
10425
10441
|
onDropDetected: (e, i) => {
|
|
10426
10442
|
this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
|
|
10427
10443
|
}
|
|
10428
|
-
})), t.protectCopy && (this.copyProtector = new
|
|
10444
|
+
})), t.protectCopy && (this.copyProtector = new No({
|
|
10429
10445
|
onCopyBlocked: () => {
|
|
10430
10446
|
this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
|
|
10431
10447
|
}
|
|
@@ -10435,7 +10451,7 @@ class No extends Qe {
|
|
|
10435
10451
|
super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
|
|
10436
10452
|
}
|
|
10437
10453
|
}
|
|
10438
|
-
const
|
|
10454
|
+
const Fo = (r) => ({
|
|
10439
10455
|
trackLoaded: r.trackLoaded ?? (() => {
|
|
10440
10456
|
}),
|
|
10441
10457
|
positionChanged: r.positionChanged ?? (() => {
|
|
@@ -10467,12 +10483,12 @@ const Mo = (r) => ({
|
|
|
10467
10483
|
remotePlaybackStateChanged: r.remotePlaybackStateChanged ?? (() => {
|
|
10468
10484
|
})
|
|
10469
10485
|
});
|
|
10470
|
-
class
|
|
10486
|
+
class Bo extends Gs {
|
|
10471
10487
|
constructor(t, e, i, n = {
|
|
10472
10488
|
preferences: {},
|
|
10473
10489
|
defaults: {}
|
|
10474
10490
|
}) {
|
|
10475
|
-
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners =
|
|
10491
|
+
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners = Fo(e), this._preferences = new me(n.preferences), this._defaults = new Ro(n.defaults), this._settings = new qi(this._preferences, this._defaults), t.readingOrder.items.length === 0)
|
|
10476
10492
|
throw new Error("AudioNavigator: publication has an empty reading order");
|
|
10477
10493
|
if (i)
|
|
10478
10494
|
this.currentLocation = this.ensureLocatorLocations(i);
|
|
@@ -10493,7 +10509,7 @@ class Wo extends $s {
|
|
|
10493
10509
|
const s = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(s);
|
|
10494
10510
|
if (o === -1)
|
|
10495
10511
|
throw new Error(`AudioNavigator: initial href "${s}" not found in reading order`);
|
|
10496
|
-
const a = this.currentLocation.locations?.time() || 0, l = new
|
|
10512
|
+
const a = this.currentLocation.locations?.time() || 0, l = new Oo({
|
|
10497
10513
|
playback: {
|
|
10498
10514
|
state: {
|
|
10499
10515
|
currentTime: a,
|
|
@@ -10503,14 +10519,14 @@ class Wo extends $s {
|
|
|
10503
10519
|
index: o
|
|
10504
10520
|
}
|
|
10505
10521
|
});
|
|
10506
|
-
this.pool = new
|
|
10522
|
+
this.pool = new Ao(l, t, n.contentProtection);
|
|
10507
10523
|
const d = n.contentProtection || {};
|
|
10508
10524
|
this._contentProtection = d;
|
|
10509
10525
|
const h = this.mergeKeyboardPeripherals(
|
|
10510
10526
|
d,
|
|
10511
10527
|
n.keyboardPeripherals || []
|
|
10512
10528
|
);
|
|
10513
|
-
(d.disableContextMenu || d.checkAutomation || d.checkIFrameEmbedding || d.monitorDevTools || d.protectPrinting?.disable || d.disableDragAndDrop || d.protectCopy) && (this._navigatorProtector = new
|
|
10529
|
+
(d.disableContextMenu || d.checkAutomation || d.checkIFrameEmbedding || d.monitorDevTools || d.protectPrinting?.disable || d.disableDragAndDrop || d.protectCopy) && (this._navigatorProtector = new Mo(d), this._suspiciousActivityListener = (c) => {
|
|
10514
10530
|
const { type: u, ...m } = c.detail;
|
|
10515
10531
|
u === "context_menu" ? this.listeners.contextMenu(m) : this.listeners.contentProtection(u, m);
|
|
10516
10532
|
}, window.addEventListener(ct, this._suspiciousActivityListener)), h.length > 0 && (this._keyboardPeripheralsManager = new ti({ keyboardPeripherals: h }), this._keyboardPeripheralListener = (c) => {
|
|
@@ -10826,12 +10842,12 @@ class Wo extends $s {
|
|
|
10826
10842
|
this.stopPositionPolling(), this._stopStalledWatchdog(), this.destroyMediaSession(), this._suspiciousActivityListener && window.removeEventListener(ct, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(dt, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), this.pool.destroy();
|
|
10827
10843
|
}
|
|
10828
10844
|
}
|
|
10829
|
-
const
|
|
10830
|
-
oldStyleTf:
|
|
10831
|
-
},
|
|
10845
|
+
const zo = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Io = {
|
|
10846
|
+
oldStyleTf: zo
|
|
10847
|
+
}, Do = 16, Qi = Io.oldStyleTf;
|
|
10832
10848
|
class Nt {
|
|
10833
10849
|
constructor(t) {
|
|
10834
|
-
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize ||
|
|
10850
|
+
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Do, this._fontFace = t.fontFace || Qi, this._sample = t.sample || null, this._padding = t.padding ?? 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = Nt.approximateWordSpaces(this._optimalChars, this._sample);
|
|
10835
10851
|
}
|
|
10836
10852
|
updateMultipliers() {
|
|
10837
10853
|
this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1;
|
|
@@ -10904,66 +10920,66 @@ class Nt {
|
|
|
10904
10920
|
}
|
|
10905
10921
|
}
|
|
10906
10922
|
export {
|
|
10907
|
-
|
|
10908
|
-
|
|
10923
|
+
Ro as AudioDefaults,
|
|
10924
|
+
Bo as AudioNavigator,
|
|
10909
10925
|
me as AudioPreferences,
|
|
10910
10926
|
Ki as AudioPreferencesEditor,
|
|
10911
10927
|
qi as AudioSettings,
|
|
10912
10928
|
Cn as BUILTIN_DECORATION_TYPES,
|
|
10913
10929
|
N as BooleanPreference,
|
|
10914
|
-
|
|
10930
|
+
Es as DecorationLayout,
|
|
10915
10931
|
_ as DecorationStyleType,
|
|
10916
|
-
|
|
10932
|
+
Ps as DecorationWidth,
|
|
10917
10933
|
Ln as EnumPreference,
|
|
10918
|
-
|
|
10934
|
+
mo as EpubDefaults,
|
|
10919
10935
|
zn as EpubNavigator,
|
|
10920
10936
|
Ht as EpubPreferences,
|
|
10921
10937
|
Xi as EpubPreferencesEditor,
|
|
10922
10938
|
Yi as EpubSettings,
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10939
|
+
Wo as ExperimentalWebPubNavigator,
|
|
10940
|
+
so as FXLCoordinator,
|
|
10941
|
+
eo as FXLFrameManager,
|
|
10942
|
+
fo as FXLFramePoolManager,
|
|
10943
|
+
oo as FXLPeripherals,
|
|
10944
|
+
ao as FXLSpreader,
|
|
10929
10945
|
Dt as FrameComms,
|
|
10930
10946
|
Mn as FrameManager,
|
|
10931
|
-
|
|
10932
|
-
|
|
10947
|
+
to as FramePoolManager,
|
|
10948
|
+
io as HorizontalThird,
|
|
10933
10949
|
Rn as Injector,
|
|
10934
10950
|
Nt as LineLengths,
|
|
10935
|
-
|
|
10951
|
+
Gs as MediaNavigator,
|
|
10936
10952
|
wn as Navigator,
|
|
10937
10953
|
De as Orientation,
|
|
10938
10954
|
z as Preference,
|
|
10939
10955
|
pe as Properties,
|
|
10940
|
-
|
|
10956
|
+
Eo as RSProperties,
|
|
10941
10957
|
R as RangePreference,
|
|
10942
|
-
|
|
10958
|
+
Co as ReadiumCSS,
|
|
10943
10959
|
Ue as Spread,
|
|
10944
10960
|
nt as TextAlignment,
|
|
10945
10961
|
Fn as UserProperties,
|
|
10946
|
-
|
|
10962
|
+
no as VerticalThird,
|
|
10947
10963
|
Pn as VisualNavigator,
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10964
|
+
Oo as WebAudioEngine,
|
|
10965
|
+
Ys as WebPubBlobBuilder,
|
|
10966
|
+
Tr as WebPubCSS,
|
|
10967
|
+
Fr as WebPubDefaults,
|
|
10968
|
+
Ks as WebPubFrameManager,
|
|
10969
|
+
Js as WebPubFramePoolManager,
|
|
10970
|
+
Zr as WebPubNavigator,
|
|
10955
10971
|
Ut as WebPubPreferences,
|
|
10956
10972
|
Ii as WebPubPreferencesEditor,
|
|
10957
10973
|
zi as WebPubSettings,
|
|
10958
|
-
|
|
10974
|
+
Ar as WebRSProperties,
|
|
10959
10975
|
_n as WebUserProperties,
|
|
10960
10976
|
En as decorationsEqual,
|
|
10961
10977
|
E as ensureBoolean,
|
|
10962
10978
|
fe as ensureEnumValue,
|
|
10963
10979
|
xn as ensureExperiment,
|
|
10964
10980
|
Ct as ensureFilter,
|
|
10965
|
-
|
|
10966
|
-
|
|
10981
|
+
Nr as ensureLessThanOrEqual,
|
|
10982
|
+
Mr as ensureMoreThanOrEqual,
|
|
10967
10983
|
w as ensureNonNegative,
|
|
10968
10984
|
W as ensureString,
|
|
10969
10985
|
D as ensureValueInRange,
|
|
@@ -10973,7 +10989,7 @@ export {
|
|
|
10973
10989
|
at as fontWeightRangeConfig,
|
|
10974
10990
|
te as fontWidthRangeConfig,
|
|
10975
10991
|
Et as getScriptMode,
|
|
10976
|
-
|
|
10992
|
+
Ho as i18n,
|
|
10977
10993
|
ee as letterSpacingRangeConfig,
|
|
10978
10994
|
ie as lineHeightRangeConfig,
|
|
10979
10995
|
mt as lineLengthRangeConfig,
|
|
@@ -10981,7 +10997,7 @@ export {
|
|
|
10981
10997
|
se as paragraphSpacingRangeConfig,
|
|
10982
10998
|
le as playbackRateRangeConfig,
|
|
10983
10999
|
Pt as resolveDecorationForWire,
|
|
10984
|
-
|
|
11000
|
+
Uo as settings,
|
|
10985
11001
|
rt as skipIntervalRangeConfig,
|
|
10986
11002
|
ae as volumeRangeConfig,
|
|
10987
11003
|
Pe as withFallback,
|