@prose-reader/streamer 1.300.0 → 1.303.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/archives/createArchiveFromArrayBufferList.d.ts +2 -1
- package/dist/archives/createArchiveFromJszip.d.ts +2 -1
- package/dist/archives/createArchiveFromLibArchive.d.ts +2 -1
- package/dist/archives/getArchiveHasComicInfo.d.ts +2 -0
- package/dist/archives/types.d.ts +9 -3
- package/dist/epubs/getArchiveOpfInfo.d.ts +1 -10
- package/dist/epubs/getSpineItemFilesFromArchive.d.ts +1 -16
- package/dist/generators/manifest/hooks/finalDefaults.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +394 -348
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +12 -12
- package/dist/index.umd.cjs.map +1 -1
- package/dist/utils/createXmlSafeId.d.ts +3 -0
- package/dist/utils/createXmlSafeId.test.d.ts +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,50 +1,55 @@
|
|
|
1
|
-
import { detectMimeTypeFromName as
|
|
2
|
-
import {
|
|
3
|
-
import { XmlDocument as R, XmlTextNode as
|
|
4
|
-
import { Subject as
|
|
5
|
-
const
|
|
1
|
+
import { detectMimeTypeFromName as b, Report as ie, escapeXmlAttributeValue as N, isXmlBasedMimeType as ae, parseContentType as J, isMediaContentMimeType as ce, urlJoin as T } from "@prose-reader/shared";
|
|
2
|
+
import { COMIC_INFO_FILENAME as W, parseOpf as de, APPLE_IBOOKS_DISPLAY_OPTIONS_FILENAME as Z, parseAppleDisplayOptionsXml as le, resolveArchiveMetadata as S, parseComicInfo as ue, KOBO_DISPLAY_OPTIONS_FILENAME as z, parseKoboXml as pe, tokenizeXmlSpaceSeparatedList as fe } from "@prose-reader/archive-parser";
|
|
3
|
+
import { XmlDocument as R, XmlTextNode as me, XmlElement as he } from "xmldoc";
|
|
4
|
+
import { Subject as x, mergeMap as Y, EMPTY as O, pairwise as ge, filter as E, startWith as ye, from as F, tap as k, catchError as C, switchMap as I, merge as M, first as D, takeUntil as be, map as $, ignoreElements as ve, BehaviorSubject as we, distinctUntilChanged as $e, shareReplay as Ae, NEVER as B, timer as Fe, finalize as Ie, of as Te, lastValueFrom as Se } from "rxjs";
|
|
5
|
+
const P = (e, t) => {
|
|
6
6
|
const o = e.split(/(\d+)/), r = t.split(/(\d+)/);
|
|
7
7
|
for (let n = 0, s = o.length; n < s; n++)
|
|
8
8
|
if (o[n] !== r[n])
|
|
9
9
|
return o[n]?.match(/\d/) ? +(o[n] || "") - +(r[n] || "") : (o[n] || "").localeCompare(r[n] || "");
|
|
10
10
|
return 1;
|
|
11
|
-
},
|
|
11
|
+
}, A = (e) => e.substring(e.lastIndexOf("/") + 1) || e, j = (e) => e.endsWith("/") ? e.slice(0, -1) : e, Re = (e) => {
|
|
12
12
|
const t = e.lastIndexOf("/");
|
|
13
13
|
return t >= 0 ? e.substring(0, t) : "";
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
}, Dt = async (e, {
|
|
15
|
+
orderByAlpha: t,
|
|
16
|
+
name: o,
|
|
17
|
+
encodingFormat: r
|
|
18
|
+
} = {}) => {
|
|
19
|
+
let n = e;
|
|
20
|
+
return t && (n = n.slice().sort((s, i) => P(s.name, i.name))), {
|
|
17
21
|
filename: o || "",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
encodingFormat: r,
|
|
23
|
+
records: n.map((s) => {
|
|
24
|
+
const i = s.size, a = A(s.name);
|
|
25
|
+
return s.isDir ? {
|
|
21
26
|
dir: !0,
|
|
22
|
-
basename:
|
|
23
|
-
uri:
|
|
24
|
-
size:
|
|
27
|
+
basename: a,
|
|
28
|
+
uri: s.name,
|
|
29
|
+
size: i
|
|
25
30
|
} : {
|
|
26
|
-
dir:
|
|
27
|
-
basename:
|
|
28
|
-
encodingFormat:
|
|
29
|
-
uri:
|
|
30
|
-
blob: async () => new Blob([await
|
|
31
|
-
type:
|
|
31
|
+
dir: s.isDir,
|
|
32
|
+
basename: a,
|
|
33
|
+
encodingFormat: b(s.name),
|
|
34
|
+
uri: s.name,
|
|
35
|
+
blob: async () => new Blob([await s.data()], {
|
|
36
|
+
type: b(s.name) ?? ""
|
|
32
37
|
}),
|
|
33
38
|
string: async () => {
|
|
34
|
-
const
|
|
39
|
+
const c = await s.data();
|
|
35
40
|
return String.fromCharCode.apply(
|
|
36
41
|
null,
|
|
37
|
-
Array.from(new Uint16Array(
|
|
42
|
+
Array.from(new Uint16Array(c))
|
|
38
43
|
);
|
|
39
44
|
},
|
|
40
|
-
size:
|
|
45
|
+
size: i
|
|
41
46
|
};
|
|
42
47
|
}),
|
|
43
48
|
close: () => Promise.resolve()
|
|
44
49
|
};
|
|
45
|
-
}, Le = "@prose-reader/streamer", f =
|
|
50
|
+
}, Le = "@prose-reader/streamer", f = ie.namespace(Le, !1, {
|
|
46
51
|
color: "#ffae42"
|
|
47
|
-
}),
|
|
52
|
+
}), xe = (e) => {
|
|
48
53
|
const t = {};
|
|
49
54
|
for (const r of e) {
|
|
50
55
|
const n = r.split("/");
|
|
@@ -55,63 +60,72 @@ const E = (e, t) => {
|
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
const o = (r, n = "") => Object.keys(r).sort().map((s, i, a) => {
|
|
58
|
-
const c = i === a.length - 1,
|
|
59
|
-
return
|
|
60
|
-
${o(
|
|
63
|
+
const c = i === a.length - 1, d = n + (c ? "└── " : "├── "), u = n + (c ? " " : "│ "), p = r[s];
|
|
64
|
+
return p && Object.keys(p).length > 0 ? `${d}${s}/
|
|
65
|
+
${o(p, u)}` : `${d}${s}`;
|
|
61
66
|
}).join(`
|
|
62
67
|
`);
|
|
63
68
|
return o(t);
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
}, Bt = async (e, {
|
|
70
|
+
orderByAlpha: t,
|
|
71
|
+
name: o,
|
|
72
|
+
encodingFormat: r
|
|
73
|
+
} = {}) => {
|
|
74
|
+
let n = Object.values(e.files);
|
|
75
|
+
t && (n = n.slice().sort((i, a) => P(i.name, a.name)));
|
|
76
|
+
const s = {
|
|
68
77
|
filename: o || "",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
encodingFormat: r,
|
|
79
|
+
records: n.map((i) => {
|
|
80
|
+
const a = i._data.uncompressedSize, c = A(i.name);
|
|
81
|
+
return i.dir ? {
|
|
72
82
|
dir: !0,
|
|
73
|
-
basename:
|
|
74
|
-
uri:
|
|
75
|
-
size:
|
|
83
|
+
basename: c,
|
|
84
|
+
uri: i.name,
|
|
85
|
+
size: a
|
|
76
86
|
} : {
|
|
77
87
|
dir: !1,
|
|
78
|
-
basename:
|
|
79
|
-
uri:
|
|
80
|
-
encodingFormat:
|
|
81
|
-
blob: () =>
|
|
82
|
-
string: () =>
|
|
83
|
-
...
|
|
84
|
-
stream:
|
|
88
|
+
basename: A(i.name),
|
|
89
|
+
uri: i.name,
|
|
90
|
+
encodingFormat: b(i.name),
|
|
91
|
+
blob: () => i.async("blob"),
|
|
92
|
+
string: () => i.async("string"),
|
|
93
|
+
...i.internalStream && {
|
|
94
|
+
stream: i.internalStream
|
|
85
95
|
},
|
|
86
96
|
// this is private API
|
|
87
97
|
// @ts-expect-error
|
|
88
|
-
size:
|
|
98
|
+
size: i._data.uncompressedSize
|
|
89
99
|
};
|
|
90
100
|
}),
|
|
91
101
|
close: () => Promise.resolve()
|
|
92
102
|
};
|
|
93
|
-
if (f.log("Generated archive",
|
|
94
|
-
const
|
|
103
|
+
if (f.log("Generated archive", s), process.env.NODE_ENV === "development" && f.isEnabled()) {
|
|
104
|
+
const i = xe(n.map((a) => a.name));
|
|
95
105
|
f.groupCollapsed(...f.getGroupArgs("Archive folder structure")), f.log(`
|
|
96
|
-
${
|
|
106
|
+
${i}`), f.groupEnd();
|
|
97
107
|
}
|
|
98
|
-
return
|
|
99
|
-
},
|
|
100
|
-
|
|
108
|
+
return s;
|
|
109
|
+
}, jt = async (e, {
|
|
110
|
+
name: t,
|
|
111
|
+
encodingFormat: o
|
|
112
|
+
} = {}) => {
|
|
113
|
+
const r = await e.getFilesArray(), n = {
|
|
101
114
|
close: () => e.close(),
|
|
102
115
|
filename: t ?? "",
|
|
103
|
-
|
|
116
|
+
encodingFormat: o,
|
|
117
|
+
records: r.map((s) => ({
|
|
104
118
|
dir: !1,
|
|
105
|
-
basename:
|
|
106
|
-
encodingFormat:
|
|
107
|
-
size:
|
|
108
|
-
uri: `${
|
|
109
|
-
blob: async () => await
|
|
110
|
-
string: async () => (await
|
|
119
|
+
basename: s.file.name,
|
|
120
|
+
encodingFormat: b(s.file.name),
|
|
121
|
+
size: s.file.size,
|
|
122
|
+
uri: `${s.path}${s.file.name}`,
|
|
123
|
+
blob: async () => await s.file.extract(),
|
|
124
|
+
string: async () => (await s.file.extract()).text()
|
|
111
125
|
}))
|
|
112
126
|
};
|
|
113
|
-
return f.log("Generated archive",
|
|
114
|
-
},
|
|
127
|
+
return f.log("Generated archive", n), n;
|
|
128
|
+
}, Ut = async (e, {
|
|
115
129
|
mimeType: t,
|
|
116
130
|
direction: o
|
|
117
131
|
} = { mimeType: "text/plain" }) => {
|
|
@@ -133,10 +147,11 @@ ${s}`), f.groupEnd();
|
|
|
133
147
|
`;
|
|
134
148
|
return {
|
|
135
149
|
filename: "content.txt",
|
|
150
|
+
encodingFormat: t,
|
|
136
151
|
records: [
|
|
137
152
|
{
|
|
138
153
|
dir: !1,
|
|
139
|
-
basename:
|
|
154
|
+
basename: A("generated.opf"),
|
|
140
155
|
uri: "generated.opf",
|
|
141
156
|
blob: async () => new Blob([r]),
|
|
142
157
|
string: async () => r,
|
|
@@ -144,7 +159,7 @@ ${s}`), f.groupEnd();
|
|
|
144
159
|
},
|
|
145
160
|
{
|
|
146
161
|
dir: !1,
|
|
147
|
-
basename:
|
|
162
|
+
basename: A("p01.txt"),
|
|
148
163
|
uri: "p01.txt",
|
|
149
164
|
blob: async () => typeof e == "string" ? new Blob([e]) : e,
|
|
150
165
|
string: async () => typeof e == "string" ? e : e.text(),
|
|
@@ -154,31 +169,53 @@ ${s}`), f.groupEnd();
|
|
|
154
169
|
],
|
|
155
170
|
close: () => Promise.resolve()
|
|
156
171
|
};
|
|
157
|
-
},
|
|
158
|
-
|
|
172
|
+
}, Ee = /^[A-Za-z0-9_][A-Za-z0-9_.-]*$/, ke = /^[A-Za-z0-9_]/, U = /^xml/i, Ce = /[^A-Za-z0-9_.-]+/g, H = "_", We = (e) => e.replace(/^_+|_+$/g, ""), Pe = (e) => We(
|
|
173
|
+
e.trim().replaceAll("/", "_").replace(Ce, "_")
|
|
174
|
+
), _e = (e) => {
|
|
175
|
+
if (Ee.test(e) && !U.test(e))
|
|
176
|
+
return e;
|
|
177
|
+
const t = Pe(e), o = t && !U.test(t) ? t : `${H}${t}`;
|
|
178
|
+
return ke.test(o) ? o : `${H}${o}`;
|
|
179
|
+
}, Ne = (e, t) => {
|
|
180
|
+
const o = _e(e);
|
|
181
|
+
if (!t.has(o))
|
|
182
|
+
return t.add(o), o;
|
|
183
|
+
let r = 2, n = `${o}-${r}`;
|
|
184
|
+
for (; t.has(n); )
|
|
185
|
+
r += 1, n = `${o}-${r}`;
|
|
186
|
+
return t.add(n), n;
|
|
187
|
+
}, Q = () => {
|
|
188
|
+
const e = /* @__PURE__ */ new Set();
|
|
189
|
+
return (t) => Ne(t, e);
|
|
190
|
+
}, Ht = async (e, t) => {
|
|
191
|
+
const o = Q(), r = e.map((a) => ({
|
|
192
|
+
id: o(a),
|
|
193
|
+
url: a
|
|
194
|
+
})), n = `
|
|
159
195
|
<?xml version="1.0" encoding="UTF-8"?><package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="bookid">
|
|
160
196
|
<metadata>
|
|
161
197
|
<meta property="rendition:layout">${t?.useRenditionFlow ? "reflowable" : "pre-paginated"}</meta>
|
|
162
198
|
${t?.useRenditionFlow ? '<meta property="rendition:flow">scrolled-continuous</meta>' : ""}
|
|
163
199
|
</metadata>
|
|
164
200
|
<manifest>
|
|
165
|
-
${
|
|
166
|
-
|
|
167
|
-
|
|
201
|
+
${r.map(({ id: a, url: c }) => {
|
|
202
|
+
const d = b(c);
|
|
203
|
+
return `<item id="${a}" href="${N(c)}" media-type="${N(d ?? "")}"/>`;
|
|
204
|
+
}).join(`
|
|
168
205
|
`)}
|
|
169
206
|
</manifest>
|
|
170
207
|
<spine>
|
|
171
|
-
${
|
|
208
|
+
${r.map(({ id: a }) => `<itemref idref="${a}" />`).join(`
|
|
172
209
|
`)}
|
|
173
210
|
</spine>
|
|
174
211
|
</package>
|
|
175
|
-
`,
|
|
212
|
+
`, s = e.map((a) => ({
|
|
176
213
|
dir: !1,
|
|
177
|
-
basename:
|
|
178
|
-
encodingFormat:
|
|
179
|
-
uri:
|
|
214
|
+
basename: A(a),
|
|
215
|
+
encodingFormat: b(a),
|
|
216
|
+
uri: a,
|
|
180
217
|
size: 100 / e.length,
|
|
181
|
-
blob: async () => (await fetch(
|
|
218
|
+
blob: async () => (await fetch(a)).blob(),
|
|
182
219
|
string: async () => ""
|
|
183
220
|
}));
|
|
184
221
|
return {
|
|
@@ -189,15 +226,17 @@ ${s}`), f.groupEnd();
|
|
|
189
226
|
uri: "content.opf",
|
|
190
227
|
size: 0,
|
|
191
228
|
blob: async () => new Blob(),
|
|
192
|
-
string: async () =>
|
|
193
|
-
}, ...
|
|
229
|
+
string: async () => n
|
|
230
|
+
}, ...s],
|
|
194
231
|
close: () => Promise.resolve()
|
|
195
232
|
};
|
|
196
|
-
},
|
|
233
|
+
}, ze = (e) => !e.dir, Oe = W.toLowerCase(), Me = (e) => e.records.find(
|
|
234
|
+
(t) => ze(t) && t.basename.toLowerCase() === Oe
|
|
235
|
+
), Xt = ({
|
|
197
236
|
enableReport: e
|
|
198
237
|
} = {}) => {
|
|
199
238
|
f.enable(!!e);
|
|
200
|
-
},
|
|
239
|
+
}, _ = (e) => {
|
|
201
240
|
const o = Object.values(e.records).filter(
|
|
202
241
|
(r) => !r.dir
|
|
203
242
|
).find((r) => r.uri.endsWith(".opf"));
|
|
@@ -206,65 +245,63 @@ ${s}`), f.groupEnd();
|
|
|
206
245
|
basePath: o?.uri.substring(0, o.uri.lastIndexOf("/")) || ""
|
|
207
246
|
};
|
|
208
247
|
};
|
|
209
|
-
async function
|
|
210
|
-
const { data: t, basePath: o } =
|
|
248
|
+
async function ee(e) {
|
|
249
|
+
const { data: t, basePath: o } = _(e) || {};
|
|
211
250
|
if (!t || t.dir)
|
|
212
251
|
return;
|
|
213
252
|
const r = await t.string();
|
|
214
253
|
return {
|
|
215
|
-
opf:
|
|
254
|
+
opf: de(r),
|
|
216
255
|
basePath: o
|
|
217
256
|
};
|
|
218
257
|
}
|
|
219
|
-
const
|
|
258
|
+
const De = Z.toLowerCase(), Be = ({ archive: e }) => async (t) => {
|
|
220
259
|
const o = e.records.find(
|
|
221
|
-
(n) => !n.dir && n.basename.toLowerCase() ===
|
|
260
|
+
(n) => !n.dir && n.basename.toLowerCase() === De
|
|
222
261
|
);
|
|
223
262
|
if (!o || o.dir)
|
|
224
263
|
return t;
|
|
225
264
|
const r = await o.string();
|
|
226
265
|
try {
|
|
227
|
-
const n =
|
|
266
|
+
const n = le(r), { renditionLayout: s } = S(n);
|
|
228
267
|
return {
|
|
229
268
|
...t,
|
|
230
269
|
renditionLayout: t.renditionLayout ?? s
|
|
231
270
|
};
|
|
232
271
|
} catch (n) {
|
|
233
272
|
return console.error(
|
|
234
|
-
`Unable to parse ${
|
|
273
|
+
`Unable to parse ${Z} for content
|
|
235
274
|
`,
|
|
236
275
|
r
|
|
237
276
|
), console.error(n), t;
|
|
238
277
|
}
|
|
239
|
-
},
|
|
240
|
-
const o = e
|
|
241
|
-
|
|
242
|
-
);
|
|
243
|
-
if (!o || o.dir)
|
|
278
|
+
}, je = W.toLowerCase(), Ue = ({ archive: e }) => async (t) => {
|
|
279
|
+
const o = Me(e);
|
|
280
|
+
if (!o)
|
|
244
281
|
return t;
|
|
245
282
|
const r = {
|
|
246
283
|
...t,
|
|
247
284
|
spineItems: t.spineItems.filter(
|
|
248
|
-
(s) => !s.id.toLowerCase().endsWith(
|
|
285
|
+
(s) => !s.id.toLowerCase().endsWith(je)
|
|
249
286
|
).map((s, i, a) => ({
|
|
250
287
|
...s,
|
|
251
288
|
progressionWeight: 1 / a.length
|
|
252
289
|
}))
|
|
253
290
|
}, n = await o.string();
|
|
254
291
|
try {
|
|
255
|
-
const s =
|
|
292
|
+
const s = ue(n), i = S(s);
|
|
256
293
|
return {
|
|
257
294
|
...r,
|
|
258
|
-
readingDirection: i.readingDirection ??
|
|
295
|
+
readingDirection: i.readingDirection ?? r.readingDirection
|
|
259
296
|
};
|
|
260
297
|
} catch (s) {
|
|
261
298
|
return console.error(
|
|
262
|
-
`Unable to parse ${
|
|
299
|
+
`Unable to parse ${W} for content
|
|
263
300
|
`,
|
|
264
301
|
n
|
|
265
302
|
), console.error(s), r;
|
|
266
303
|
}
|
|
267
|
-
},
|
|
304
|
+
}, He = ({
|
|
268
305
|
baseUrl: e = "",
|
|
269
306
|
resourcePath: t
|
|
270
307
|
}) => {
|
|
@@ -272,44 +309,44 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
272
309
|
return encodeURI(t);
|
|
273
310
|
const o = e ? `${e}${e.endsWith("/") ? "" : "/"}` : "file://";
|
|
274
311
|
return encodeURI(`${o}${t}`);
|
|
275
|
-
},
|
|
276
|
-
const o = Object.values(e.records).filter((
|
|
312
|
+
}, Xe = ({ archive: e, baseUrl: t }) => async () => {
|
|
313
|
+
const o = Object.values(e.records).filter((s) => !s.dir), r = Q(), n = o.map((s) => ({
|
|
314
|
+
file: s,
|
|
315
|
+
id: r(s.uri)
|
|
316
|
+
}));
|
|
277
317
|
return {
|
|
278
318
|
filename: e.filename,
|
|
279
|
-
title: e.records.find(({ dir:
|
|
319
|
+
title: e.records.find(({ dir: s }) => s)?.basename.replace(/\/$/, "") || e.filename,
|
|
280
320
|
renditionLayout: void 0,
|
|
281
321
|
renditionSpread: "auto",
|
|
282
|
-
readingDirection:
|
|
283
|
-
spineItems:
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
id: `${n}.${r.basename}`,
|
|
288
|
-
index: n,
|
|
289
|
-
href: ke({
|
|
322
|
+
readingDirection: void 0,
|
|
323
|
+
spineItems: n.filter(({ file: s }) => !s.basename.endsWith(".db")).map(({ file: s, id: i }, a) => ({
|
|
324
|
+
id: i,
|
|
325
|
+
index: a,
|
|
326
|
+
href: He({
|
|
290
327
|
baseUrl: t,
|
|
291
|
-
resourcePath:
|
|
328
|
+
resourcePath: s.uri
|
|
292
329
|
}),
|
|
293
330
|
renditionLayout: void 0,
|
|
294
331
|
progressionWeight: 1 / o.length,
|
|
295
332
|
pageSpreadLeft: void 0,
|
|
296
333
|
pageSpreadRight: void 0,
|
|
297
|
-
mediaType:
|
|
334
|
+
mediaType: s.encodingFormat
|
|
298
335
|
})),
|
|
299
|
-
items:
|
|
300
|
-
id:
|
|
301
|
-
href: encodeURI(`${t}${
|
|
336
|
+
items: n.map(({ file: s, id: i }) => ({
|
|
337
|
+
id: i,
|
|
338
|
+
href: encodeURI(`${t}${s.uri}`)
|
|
302
339
|
}))
|
|
303
340
|
};
|
|
304
|
-
},
|
|
341
|
+
}, te = async ({
|
|
305
342
|
archive: e,
|
|
306
343
|
archiveOpf: t
|
|
307
344
|
}) => {
|
|
308
345
|
if (!t) return [];
|
|
309
346
|
const { opf: o, basePath: r } = t, { spineRows: n } = o;
|
|
310
347
|
return e.records.filter((i) => n.find((a) => r ? `${r}/${a.href}` === i.uri : `${a.href}` === i.uri));
|
|
311
|
-
},
|
|
312
|
-
const { basePath: r } =
|
|
348
|
+
}, ne = (e, t, o) => {
|
|
349
|
+
const { basePath: r } = _(t) || {};
|
|
313
350
|
return e.map((n) => {
|
|
314
351
|
const s = n.href, i = o?.(s) ?? "";
|
|
315
352
|
return {
|
|
@@ -318,85 +355,85 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
318
355
|
mediaType: n.mediaType
|
|
319
356
|
};
|
|
320
357
|
});
|
|
321
|
-
},
|
|
358
|
+
}, Ve = (e) => {
|
|
322
359
|
const t = e?.trim();
|
|
323
360
|
return t === "scrolled-continuous" || t === "scrolled-doc" || t === "paginated" || t === "auto" ? t : "auto";
|
|
324
|
-
},
|
|
361
|
+
}, Ge = (e) => {
|
|
325
362
|
const t = e?.trim();
|
|
326
363
|
if (t === "none" || t === "landscape" || t === "portrait" || t === "both" || t === "auto")
|
|
327
364
|
return t;
|
|
328
|
-
},
|
|
365
|
+
}, Ke = (e) => {
|
|
329
366
|
const t = e?.trim();
|
|
330
367
|
if (t === "cover" || t === "title-page" || t === "copyright-page" || t === "text")
|
|
331
368
|
return t;
|
|
332
|
-
},
|
|
369
|
+
}, qe = ({
|
|
333
370
|
archive: e,
|
|
334
371
|
baseUrl: t,
|
|
335
372
|
archiveOpf: o
|
|
336
373
|
}) => async (r) => {
|
|
337
374
|
if (!o)
|
|
338
375
|
return r;
|
|
339
|
-
const { opf: n, basePath: s } = o, i =
|
|
376
|
+
const { opf: n, basePath: s } = o, i = S(n);
|
|
340
377
|
f.groupCollapsed(...f.getGroupArgs("OPF parsed")), f.log("opf", n), f.groupEnd();
|
|
341
|
-
const a = n.renditionLayoutMeta?.trim(), c = a === "reflowable" || a === "pre-paginated" ? a : i.renditionLayout,
|
|
378
|
+
const a = n.renditionLayoutMeta?.trim(), c = a === "reflowable" || a === "pre-paginated" ? a : i.renditionLayout, d = n.title?.trim() || e.records.find(({ dir: l }) => l)?.basename || "", u = i.readingDirection ?? r.readingDirection, m = (await te({
|
|
342
379
|
archive: e,
|
|
343
380
|
archiveOpf: o
|
|
344
381
|
})).reduce(
|
|
345
|
-
(
|
|
382
|
+
(l, v) => v.size + l,
|
|
346
383
|
0
|
|
347
384
|
), h = n.guide, y = [];
|
|
348
|
-
for (const
|
|
349
|
-
const
|
|
350
|
-
|
|
385
|
+
for (const l of h) {
|
|
386
|
+
const v = Ke(l.type);
|
|
387
|
+
v !== void 0 && y.push({ href: l.href, title: l.title, type: v });
|
|
351
388
|
}
|
|
352
389
|
return {
|
|
353
390
|
filename: e.filename,
|
|
354
391
|
renditionLayout: c,
|
|
355
|
-
renditionFlow:
|
|
356
|
-
renditionSpread:
|
|
357
|
-
title:
|
|
358
|
-
readingDirection:
|
|
392
|
+
renditionFlow: Ve(n.renditionFlowMeta),
|
|
393
|
+
renditionSpread: Ge(n.renditionSpreadMeta),
|
|
394
|
+
title: d,
|
|
395
|
+
readingDirection: u,
|
|
359
396
|
/**
|
|
360
397
|
* @see https://www.w3.org/TR/epub/#sec-itemref-elem
|
|
361
398
|
*/
|
|
362
|
-
spineItems: n.spineRows.map((
|
|
363
|
-
const g = e.records.find((
|
|
399
|
+
spineItems: n.spineRows.map((l, v) => {
|
|
400
|
+
const g = e.records.find((L) => L.uri.endsWith(l.href))?.size || 0, w = t || (/^https?:\/\//.test(l.href) ? "" : "file://");
|
|
364
401
|
return {
|
|
365
|
-
id:
|
|
366
|
-
index:
|
|
367
|
-
href:
|
|
368
|
-
renditionLayout:
|
|
369
|
-
...
|
|
402
|
+
id: l.id,
|
|
403
|
+
index: v,
|
|
404
|
+
href: l.href.startsWith("https://") ? l.href : s ? `${w}${s}/${l.href}` : `${w}${l.href}`,
|
|
405
|
+
renditionLayout: l.renditionLayout ?? c,
|
|
406
|
+
...l.renditionFlow !== void 0 ? { renditionFlow: l.renditionFlow } : {},
|
|
370
407
|
progressionWeight: g / m,
|
|
371
|
-
pageSpreadLeft:
|
|
372
|
-
pageSpreadRight:
|
|
373
|
-
mediaType:
|
|
408
|
+
pageSpreadLeft: l.pageSpreadLeft,
|
|
409
|
+
pageSpreadRight: l.pageSpreadRight,
|
|
410
|
+
mediaType: l.mediaType
|
|
374
411
|
};
|
|
375
412
|
}),
|
|
376
|
-
items:
|
|
413
|
+
items: ne(n.manifestItems, e, (l) => /^https?:\/\//.test(l) ? "" : t || "file://"),
|
|
377
414
|
guide: y.length > 0 ? y : void 0
|
|
378
415
|
};
|
|
379
|
-
},
|
|
416
|
+
}, Je = (e) => {
|
|
380
417
|
const t = e.descendantWithPath("head")?.childrenNamed("meta").find((o) => o.attr.name === "viewport");
|
|
381
418
|
return !!(t && t.attr.name === "viewport");
|
|
382
|
-
},
|
|
383
|
-
if (!await t || !
|
|
419
|
+
}, Ze = (e) => e.reduce(async (t, o) => {
|
|
420
|
+
if (!await t || !ae({
|
|
384
421
|
mimeType: o.encodingFormat,
|
|
385
422
|
uri: o.uri
|
|
386
423
|
}))
|
|
387
424
|
return !1;
|
|
388
425
|
const n = o.dir ? null : await o.string();
|
|
389
|
-
return n ?
|
|
390
|
-
}, Promise.resolve(!0)),
|
|
426
|
+
return n ? Je(new R(n)) : !1;
|
|
427
|
+
}, Promise.resolve(!0)), Ye = ({
|
|
391
428
|
archive: e,
|
|
392
429
|
archiveOpf: t
|
|
393
430
|
}) => async (o) => {
|
|
394
431
|
if (o.renditionLayout === "reflowable" && o.spineItems.every((n) => n.renditionLayout === "reflowable")) {
|
|
395
|
-
const n = await
|
|
432
|
+
const n = await te({
|
|
396
433
|
archive: e,
|
|
397
434
|
archiveOpf: t
|
|
398
435
|
});
|
|
399
|
-
if (await
|
|
436
|
+
if (await Ze(n))
|
|
400
437
|
return {
|
|
401
438
|
...o,
|
|
402
439
|
spineItems: o.spineItems.map((i) => ({
|
|
@@ -407,18 +444,21 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
407
444
|
};
|
|
408
445
|
}
|
|
409
446
|
return o;
|
|
410
|
-
},
|
|
447
|
+
}, Qe = () => (e) => ({
|
|
448
|
+
...e,
|
|
449
|
+
readingDirection: e.readingDirection ?? "ltr"
|
|
450
|
+
}), et = async (e) => {
|
|
411
451
|
let t;
|
|
412
452
|
return await Promise.all(
|
|
413
453
|
e.records.map(async (o) => {
|
|
414
|
-
if (o.dir || !o.uri.endsWith(
|
|
454
|
+
if (o.dir || !o.uri.endsWith(z)) return;
|
|
415
455
|
const r = await o.string();
|
|
416
456
|
try {
|
|
417
|
-
const { renditionLayout: n } =
|
|
457
|
+
const { renditionLayout: n } = pe(r);
|
|
418
458
|
n && (t = n);
|
|
419
459
|
} catch (n) {
|
|
420
460
|
console.error(
|
|
421
|
-
`Unable to parse ${
|
|
461
|
+
`Unable to parse ${z} for content
|
|
422
462
|
`,
|
|
423
463
|
r
|
|
424
464
|
), console.error(n);
|
|
@@ -428,26 +468,26 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
428
468
|
kind: "kobo",
|
|
429
469
|
...t !== void 0 ? { renditionLayout: t } : {}
|
|
430
470
|
};
|
|
431
|
-
},
|
|
432
|
-
const o = await
|
|
471
|
+
}, tt = ({ archive: e }) => async (t) => {
|
|
472
|
+
const o = await et(e), { renditionLayout: r } = S(o);
|
|
433
473
|
return {
|
|
434
474
|
...t,
|
|
435
475
|
renditionLayout: t.renditionLayout ?? r
|
|
436
476
|
};
|
|
437
|
-
},
|
|
438
|
-
(t) => !t.dir && (
|
|
439
|
-
),
|
|
477
|
+
}, X = (e) => e.toLowerCase().endsWith(".opf"), nt = (e) => e.records.some(
|
|
478
|
+
(t) => !t.dir && (X(t.basename) || X(t.uri))
|
|
479
|
+
), rt = ({ archive: e }) => async (t) => nt(e) ? t : {
|
|
440
480
|
...t,
|
|
441
481
|
spineItems: t.spineItems.map((r) => {
|
|
442
482
|
const n = e.records.find(
|
|
443
483
|
(i) => decodeURI(r.href).endsWith(i.uri)
|
|
444
|
-
), s =
|
|
484
|
+
), s = J(n?.encodingFormat ?? "") || b(n?.basename ?? "");
|
|
445
485
|
return {
|
|
446
486
|
...r,
|
|
447
|
-
renditionLayout: s &&
|
|
487
|
+
renditionLayout: s && ce(s) ? "pre-paginated" : r.renditionLayout
|
|
448
488
|
};
|
|
449
489
|
})
|
|
450
|
-
},
|
|
490
|
+
}, re = (e) => e ? e.children.map((t) => t instanceof me ? t.text : t instanceof he ? re(t) : "").join("").trim() : "", st = (e) => fe(e.properties).includes("nav"), se = (e, { basePath: t, baseUrl: o }) => {
|
|
451
491
|
const r = {
|
|
452
492
|
contents: [],
|
|
453
493
|
path: "",
|
|
@@ -455,55 +495,55 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
455
495
|
title: ""
|
|
456
496
|
};
|
|
457
497
|
let n = e.childNamed("span") || e.childNamed("a");
|
|
458
|
-
r.title = (n?.attr.title || n?.val.trim() ||
|
|
498
|
+
r.title = (n?.attr.title || n?.val.trim() || re(n)) ?? "";
|
|
459
499
|
let s = n?.name;
|
|
460
|
-
s !== "a" && (n = e.descendantWithPath(`${s}.a`), n && (s = n.name.toLowerCase())), s === "a" && n?.attr.href && (r.path =
|
|
500
|
+
s !== "a" && (n = e.descendantWithPath(`${s}.a`), n && (s = n.name.toLowerCase())), s === "a" && n?.attr.href && (r.path = T(t, n.attr.href), r.href = T(o, t, n.attr.href));
|
|
461
501
|
const i = e.childNamed("ol");
|
|
462
502
|
if (i) {
|
|
463
503
|
const a = i.childrenNamed("li");
|
|
464
504
|
a && a.length > 0 && (r.contents = a.map(
|
|
465
|
-
(c) =>
|
|
505
|
+
(c) => se(c, { basePath: t, baseUrl: o })
|
|
466
506
|
));
|
|
467
507
|
}
|
|
468
508
|
return r;
|
|
469
|
-
},
|
|
509
|
+
}, ot = (e, { basePath: t, baseUrl: o }) => {
|
|
470
510
|
const r = [];
|
|
471
511
|
let n;
|
|
472
512
|
return e.descendantWithPath("body.nav.ol") ? n = e.descendantWithPath("body.nav.ol")?.children : e.descendantWithPath("body.section.nav.ol") && (n = e.descendantWithPath("body.section.nav.ol")?.children), n && n.length > 0 && n.filter((s) => s.name === "li").forEach((s) => {
|
|
473
|
-
r.push(
|
|
513
|
+
r.push(se(s, { basePath: t, baseUrl: o }));
|
|
474
514
|
}), r;
|
|
475
|
-
},
|
|
476
|
-
const r = e.manifestItems.find(
|
|
515
|
+
}, it = async (e, t, { baseUrl: o }) => {
|
|
516
|
+
const r = e.manifestItems.find(st);
|
|
477
517
|
if (r?.href) {
|
|
478
518
|
const n = Object.values(t.records).find(
|
|
479
519
|
(s) => s.uri.endsWith(r.href)
|
|
480
520
|
);
|
|
481
521
|
if (n && !n.dir) {
|
|
482
|
-
const s = new R(await n.string()), i =
|
|
483
|
-
return
|
|
522
|
+
const s = new R(await n.string()), i = Re(n.uri);
|
|
523
|
+
return ot(s, { basePath: i, baseUrl: o });
|
|
484
524
|
}
|
|
485
525
|
}
|
|
486
|
-
},
|
|
526
|
+
}, oe = (e, {
|
|
487
527
|
opfBasePath: t,
|
|
488
528
|
baseUrl: o,
|
|
489
529
|
prefix: r
|
|
490
530
|
}) => {
|
|
491
531
|
const n = e?.childNamed(`${r}content`)?.attr.src || "", s = {
|
|
492
532
|
title: e?.descendantWithPath(`${r}navLabel.${r}text`)?.val || "",
|
|
493
|
-
path:
|
|
494
|
-
href:
|
|
533
|
+
path: T(t, n),
|
|
534
|
+
href: T(o, t, n),
|
|
495
535
|
contents: []
|
|
496
536
|
}, i = e.childrenNamed(`${r}navPoint`);
|
|
497
537
|
return i && i.length > 0 && (s.contents = i.map(
|
|
498
|
-
(a) =>
|
|
538
|
+
(a) => oe(a, { opfBasePath: t, baseUrl: o, prefix: r })
|
|
499
539
|
)), s;
|
|
500
|
-
},
|
|
540
|
+
}, at = (e, { opfBasePath: t, baseUrl: o }) => {
|
|
501
541
|
const r = [], n = e.name;
|
|
502
542
|
let s = "";
|
|
503
543
|
return n.indexOf(":") !== -1 && (s = `${n.split(":")[0]}:`), e.childNamed(`${s}navMap`)?.childrenNamed(`${s}navPoint`).forEach((i) => {
|
|
504
|
-
r.push(
|
|
544
|
+
r.push(oe(i, { opfBasePath: t, baseUrl: o, prefix: s }));
|
|
505
545
|
}), r;
|
|
506
|
-
},
|
|
546
|
+
}, ct = async ({
|
|
507
547
|
opf: e,
|
|
508
548
|
opfBasePath: t,
|
|
509
549
|
baseUrl: o,
|
|
@@ -518,17 +558,17 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
518
558
|
);
|
|
519
559
|
if (a && !a.dir) {
|
|
520
560
|
const c = new R(await a.string());
|
|
521
|
-
return
|
|
561
|
+
return at(c, { opfBasePath: t, baseUrl: o });
|
|
522
562
|
}
|
|
523
563
|
}
|
|
524
564
|
}
|
|
525
|
-
},
|
|
526
|
-
const { basePath: r } =
|
|
565
|
+
}, dt = async (e, t, { baseUrl: o }) => {
|
|
566
|
+
const { basePath: r } = _(t) || {}, n = await it(e, t, {
|
|
527
567
|
baseUrl: o
|
|
528
568
|
});
|
|
529
569
|
if (n)
|
|
530
570
|
return n;
|
|
531
|
-
const s = await
|
|
571
|
+
const s = await ct({
|
|
532
572
|
opf: e,
|
|
533
573
|
opfBasePath: r ?? "",
|
|
534
574
|
archive: t,
|
|
@@ -536,53 +576,53 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
536
576
|
});
|
|
537
577
|
if (s)
|
|
538
578
|
return s;
|
|
539
|
-
},
|
|
540
|
-
if (!(e.spineItems.length === 0 || !e.spineItems.every((r) => (
|
|
579
|
+
}, lt = (e) => e.replace(/\.[^.]+$/, "").replace(/[_-]/g, " ").replace(/\s+/g, " ").trim(), ut = (e, t) => {
|
|
580
|
+
if (!(e.spineItems.length === 0 || !e.spineItems.every((r) => (J(r.mediaType ?? "") || b(r.href))?.startsWith("audio/"))))
|
|
541
581
|
return e.spineItems.map((r) => {
|
|
542
582
|
const n = t.records.find(
|
|
543
583
|
(s) => !s.dir && decodeURI(r.href).endsWith(s.uri)
|
|
544
584
|
);
|
|
545
585
|
return {
|
|
546
|
-
title:
|
|
586
|
+
title: lt(n?.basename ?? r.href),
|
|
547
587
|
href: r.href,
|
|
548
588
|
path: n?.uri ?? r.href,
|
|
549
589
|
contents: []
|
|
550
590
|
};
|
|
551
591
|
});
|
|
552
|
-
},
|
|
592
|
+
}, pt = (e, { baseUrl: t }) => {
|
|
553
593
|
const o = [...e.records].sort(
|
|
554
|
-
(n, s) =>
|
|
594
|
+
(n, s) => P(n.uri, s.uri)
|
|
555
595
|
), r = (n, s, i, a, c) => {
|
|
556
|
-
const
|
|
557
|
-
return
|
|
558
|
-
...n.filter((h) => h !==
|
|
596
|
+
const d = n.find((m) => m.title === s), [u, ...p] = i;
|
|
597
|
+
return d ? u ? [
|
|
598
|
+
...n.filter((h) => h !== d),
|
|
559
599
|
{
|
|
560
|
-
...
|
|
600
|
+
...d,
|
|
561
601
|
contents: [
|
|
562
|
-
...
|
|
602
|
+
...d.contents,
|
|
563
603
|
...r(
|
|
564
|
-
|
|
565
|
-
p,
|
|
604
|
+
d.contents,
|
|
566
605
|
u,
|
|
606
|
+
p,
|
|
567
607
|
a,
|
|
568
608
|
c
|
|
569
609
|
)
|
|
570
610
|
]
|
|
571
611
|
}
|
|
572
|
-
] :
|
|
573
|
-
...n.filter((h) => h !==
|
|
612
|
+
] : d.path.split("/").length > c.split("/").length ? [
|
|
613
|
+
...n.filter((h) => h !== d),
|
|
574
614
|
{
|
|
575
|
-
...
|
|
615
|
+
...d,
|
|
576
616
|
path: c,
|
|
577
617
|
href: a
|
|
578
618
|
}
|
|
579
|
-
] : n :
|
|
619
|
+
] : n : u ? [
|
|
580
620
|
...n,
|
|
581
621
|
{
|
|
582
622
|
contents: r(
|
|
583
623
|
[],
|
|
584
|
-
p,
|
|
585
624
|
u,
|
|
625
|
+
p,
|
|
586
626
|
a,
|
|
587
627
|
c
|
|
588
628
|
),
|
|
@@ -604,27 +644,27 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
604
644
|
if (s.dir) return n;
|
|
605
645
|
const i = s.uri.split("/").slice(0, -1), [a, ...c] = i;
|
|
606
646
|
if (!a) return n;
|
|
607
|
-
const
|
|
608
|
-
return r(n, a, c,
|
|
647
|
+
const d = T(t, encodeURI(s.uri)).replace(/\/$/, ""), u = s.uri.replace(/\/$/, "");
|
|
648
|
+
return r(n, a, c, d, u);
|
|
609
649
|
}, []);
|
|
610
|
-
},
|
|
650
|
+
}, ft = async (e, t, {
|
|
611
651
|
baseUrl: o,
|
|
612
652
|
archiveOpf: r
|
|
613
653
|
}) => {
|
|
614
654
|
if (r)
|
|
615
|
-
return await
|
|
616
|
-
const n =
|
|
655
|
+
return await dt(r.opf, e, { baseUrl: o }) || [];
|
|
656
|
+
const n = ut(t, e);
|
|
617
657
|
if (n) return n;
|
|
618
|
-
const s =
|
|
658
|
+
const s = pt(e, { baseUrl: o });
|
|
619
659
|
if (s.length !== 0)
|
|
620
660
|
return s;
|
|
621
|
-
},
|
|
661
|
+
}, mt = ({
|
|
622
662
|
archive: e,
|
|
623
663
|
baseUrl: t,
|
|
624
664
|
archiveOpf: o
|
|
625
665
|
}) => async (r) => {
|
|
626
666
|
if (r.nav) return r;
|
|
627
|
-
const n = await
|
|
667
|
+
const n = await ft(e, r, {
|
|
628
668
|
baseUrl: t,
|
|
629
669
|
archiveOpf: o
|
|
630
670
|
});
|
|
@@ -634,58 +674,60 @@ const Re = K.toLowerCase(), Te = ({ archive: e }) => async (t) => {
|
|
|
634
674
|
toc: n
|
|
635
675
|
}
|
|
636
676
|
} : r;
|
|
637
|
-
},
|
|
677
|
+
}, ht = (e) => e ? e.endsWith("/") ? e : `${e}/` : "", gt = async (e, {
|
|
638
678
|
baseUrl: t = "",
|
|
639
679
|
hooks: o = {}
|
|
640
680
|
} = {}) => {
|
|
641
|
-
|
|
681
|
+
f.log("Generating manifest from archive", e);
|
|
682
|
+
const r = await ee(e), n = ht(t), s = (p) => (p ?? []).map(
|
|
642
683
|
(m) => m({ archive: e, baseUrl: n })
|
|
643
684
|
), i = [
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
685
|
+
qe({ archive: e, baseUrl: n, archiveOpf: r }),
|
|
686
|
+
Ue({ archive: e }),
|
|
687
|
+
Be({ archive: e }),
|
|
688
|
+
rt({ archive: e }),
|
|
648
689
|
...s(o.content)
|
|
649
690
|
], a = s(o.spine), c = [
|
|
650
|
-
|
|
651
|
-
|
|
691
|
+
Ye({ archive: e, archiveOpf: r }),
|
|
692
|
+
tt({ archive: e }),
|
|
652
693
|
...s(o.presentation)
|
|
653
|
-
],
|
|
654
|
-
|
|
694
|
+
], d = [
|
|
695
|
+
mt({ archive: e, baseUrl: n, archiveOpf: r }),
|
|
655
696
|
...s(o.navigation)
|
|
656
|
-
],
|
|
697
|
+
], u = [
|
|
657
698
|
...i,
|
|
658
699
|
...a,
|
|
659
700
|
...c,
|
|
660
|
-
...
|
|
701
|
+
...d,
|
|
702
|
+
Qe()
|
|
661
703
|
];
|
|
662
704
|
try {
|
|
663
|
-
const
|
|
705
|
+
const p = Xe({
|
|
664
706
|
archive: e,
|
|
665
707
|
baseUrl: n
|
|
666
|
-
})(), m = await
|
|
708
|
+
})(), m = await u.reduce(async (h, y) => await y(await h), p);
|
|
667
709
|
if (f.log("Generated manifest", m), process.env.NODE_ENV === "development" && f.isEnabled()) {
|
|
668
710
|
const h = JSON.stringify(m, null, 2);
|
|
669
711
|
f.groupCollapsed(...f.getGroupArgs("Generated manifest")), f.log(`
|
|
670
712
|
${h}`), f.groupEnd();
|
|
671
713
|
}
|
|
672
714
|
return m;
|
|
673
|
-
} catch (
|
|
674
|
-
throw f.error(
|
|
715
|
+
} catch (p) {
|
|
716
|
+
throw f.error(p), p;
|
|
675
717
|
}
|
|
676
|
-
},
|
|
718
|
+
}, yt = (e) => {
|
|
677
719
|
const t = e.descendantWithPath("head")?.childrenNamed("meta").find((o) => o.attr.name === "calibre:cover");
|
|
678
720
|
return !!(t && t.attr.name === "calibre:cover");
|
|
679
|
-
},
|
|
721
|
+
}, bt = (e) => e.descendantWithPath("body")?.descendantWithPath("div")?.childrenNamed("svg")?.find(
|
|
680
722
|
(t) => t.attr.width === "100%" && t.attr.preserveAspectRatio === "none"
|
|
681
|
-
),
|
|
723
|
+
), vt = ({ archive: e, resourcePath: t }) => async (o) => {
|
|
682
724
|
const r = Object.values(e.records).find(
|
|
683
725
|
(n) => n.uri === t && !n.dir
|
|
684
726
|
);
|
|
685
727
|
if (r && !r.dir && r.basename.endsWith(".xhtml")) {
|
|
686
728
|
const n = typeof o.body == "string" ? o.body : await r.string(), s = new R(n);
|
|
687
|
-
if (
|
|
688
|
-
const i =
|
|
729
|
+
if (yt(s)) {
|
|
730
|
+
const i = bt(s);
|
|
689
731
|
return i && delete i.attr.preserveAspectRatio, {
|
|
690
732
|
...o,
|
|
691
733
|
body: s?.toString()
|
|
@@ -693,7 +735,7 @@ ${h}`), f.groupEnd();
|
|
|
693
735
|
}
|
|
694
736
|
}
|
|
695
737
|
return o;
|
|
696
|
-
},
|
|
738
|
+
}, wt = ({ archive: e, resourcePath: t }) => async (o) => vt({ archive: e, resourcePath: t })(o), $t = ({ archive: e, resourcePath: t }) => async (o) => {
|
|
697
739
|
const r = Object.values(e.records).find(
|
|
698
740
|
(n) => n.uri === t && !n.dir
|
|
699
741
|
);
|
|
@@ -708,10 +750,10 @@ ${h}`), f.groupEnd();
|
|
|
708
750
|
};
|
|
709
751
|
}
|
|
710
752
|
return o;
|
|
711
|
-
},
|
|
712
|
-
const o = await
|
|
753
|
+
}, At = async (e, t) => {
|
|
754
|
+
const o = await ee(e);
|
|
713
755
|
if (o) {
|
|
714
|
-
const { opf: r } = o, n =
|
|
756
|
+
const { opf: r } = o, n = ne(r.manifestItems, e, () => "");
|
|
715
757
|
if (n.find(
|
|
716
758
|
(i) => t.endsWith(i.href)
|
|
717
759
|
)?.mediaType)
|
|
@@ -720,9 +762,9 @@ ${h}`), f.groupEnd();
|
|
|
720
762
|
};
|
|
721
763
|
}
|
|
722
764
|
return {
|
|
723
|
-
mediaType:
|
|
765
|
+
mediaType: Ft(t)
|
|
724
766
|
};
|
|
725
|
-
},
|
|
767
|
+
}, Ft = (e) => {
|
|
726
768
|
if (e.endsWith(".css"))
|
|
727
769
|
return "text/css; charset=UTF-8";
|
|
728
770
|
if (e.endsWith(".jpg"))
|
|
@@ -733,12 +775,12 @@ ${h}`), f.groupEnd();
|
|
|
733
775
|
return "video/mp4";
|
|
734
776
|
if (e.endsWith(".svg"))
|
|
735
777
|
return "image/svg+xml";
|
|
736
|
-
},
|
|
778
|
+
}, It = ({ archive: e, resourcePath: t }) => async (o) => {
|
|
737
779
|
const r = Object.values(e.records).find(
|
|
738
780
|
(s) => s.uri === t && !s.dir
|
|
739
781
|
);
|
|
740
782
|
if (!r || r.dir) return o;
|
|
741
|
-
const n = await
|
|
783
|
+
const n = await At(e, t);
|
|
742
784
|
return {
|
|
743
785
|
...o,
|
|
744
786
|
params: {
|
|
@@ -751,7 +793,7 @@ ${h}`), f.groupEnd();
|
|
|
751
793
|
}
|
|
752
794
|
}
|
|
753
795
|
};
|
|
754
|
-
},
|
|
796
|
+
}, V = [
|
|
755
797
|
"div",
|
|
756
798
|
"span",
|
|
757
799
|
"p",
|
|
@@ -802,23 +844,23 @@ ${h}`), f.groupEnd();
|
|
|
802
844
|
"canvas",
|
|
803
845
|
"script",
|
|
804
846
|
"style"
|
|
805
|
-
],
|
|
847
|
+
], Tt = ({ archive: e, resourcePath: t }) => async (o) => {
|
|
806
848
|
const r = Object.values(e.records).find(
|
|
807
849
|
(n) => n.uri === t && !n.dir
|
|
808
850
|
);
|
|
809
851
|
if (r && !r.dir && r.basename.endsWith(".xhtml")) {
|
|
810
852
|
const n = typeof o.body == "string" ? o.body : await r.string();
|
|
811
853
|
if (!new RegExp(
|
|
812
|
-
`<(${
|
|
854
|
+
`<(${V.join("|")})[\\s/>]`,
|
|
813
855
|
"i"
|
|
814
856
|
).test(n))
|
|
815
857
|
return o;
|
|
816
858
|
const i = new RegExp(
|
|
817
|
-
`<(${
|
|
859
|
+
`<(${V.join("|")})(\\s[^>]*)?\\s*/>`,
|
|
818
860
|
"gi"
|
|
819
861
|
), a = n.replace(
|
|
820
862
|
i,
|
|
821
|
-
(c,
|
|
863
|
+
(c, d, u = "") => `<${d} ${u.trim()}></${d}>`
|
|
822
864
|
);
|
|
823
865
|
return {
|
|
824
866
|
...o,
|
|
@@ -826,18 +868,18 @@ ${h}`), f.groupEnd();
|
|
|
826
868
|
};
|
|
827
869
|
}
|
|
828
870
|
return o;
|
|
829
|
-
},
|
|
871
|
+
}, St = async (e, t, { hooks: o = [] } = {}) => {
|
|
830
872
|
const r = {
|
|
831
873
|
params: {}
|
|
832
874
|
}, s = [
|
|
833
875
|
...o.map((i) => i({ archive: e, resourcePath: t })),
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
876
|
+
It({ archive: e, resourcePath: t }),
|
|
877
|
+
Tt({ archive: e, resourcePath: t }),
|
|
878
|
+
$t({ archive: e, resourcePath: t }),
|
|
879
|
+
wt({ archive: e, resourcePath: t })
|
|
838
880
|
];
|
|
839
881
|
try {
|
|
840
|
-
const i = await s.reduce(async (c,
|
|
882
|
+
const i = await s.reduce(async (c, d) => await d(await c), Promise.resolve(r));
|
|
841
883
|
if (f.log("Generated resource", t, i), i.body !== void 0)
|
|
842
884
|
return i;
|
|
843
885
|
const a = Object.values(e.records).find(
|
|
@@ -853,9 +895,9 @@ ${h}`), f.groupEnd();
|
|
|
853
895
|
throw f.error(i), i;
|
|
854
896
|
}
|
|
855
897
|
};
|
|
856
|
-
class
|
|
898
|
+
class Rt {
|
|
857
899
|
constructor(t) {
|
|
858
|
-
this.cleanArchiveAfter = t, this.state$ = new
|
|
900
|
+
this.cleanArchiveAfter = t, this.state$ = new we({
|
|
859
901
|
status: "idle",
|
|
860
902
|
locks: 0
|
|
861
903
|
});
|
|
@@ -864,103 +906,103 @@ class ut {
|
|
|
864
906
|
this.state$.next({ ...this.state$.getValue(), ...t });
|
|
865
907
|
}
|
|
866
908
|
get locks$() {
|
|
867
|
-
return this.state$.pipe(
|
|
909
|
+
return this.state$.pipe($(({ locks: t }) => t));
|
|
868
910
|
}
|
|
869
911
|
get state() {
|
|
870
912
|
return this.state$.getValue();
|
|
871
913
|
}
|
|
872
914
|
get isUnlocked$() {
|
|
873
915
|
return this.locks$.pipe(
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
916
|
+
$((t) => t <= 0),
|
|
917
|
+
$e(),
|
|
918
|
+
Ae()
|
|
877
919
|
);
|
|
878
920
|
}
|
|
879
921
|
get overTTL$() {
|
|
880
922
|
return this.isUnlocked$.pipe(
|
|
881
|
-
|
|
882
|
-
(t) => t ? this.cleanArchiveAfter === 1 / 0 ? B :
|
|
923
|
+
I(
|
|
924
|
+
(t) => t ? this.cleanArchiveAfter === 1 / 0 ? B : Fe(this.cleanArchiveAfter) : B
|
|
883
925
|
)
|
|
884
926
|
);
|
|
885
927
|
}
|
|
886
928
|
}
|
|
887
|
-
const
|
|
929
|
+
const Lt = ({
|
|
888
930
|
getArchive: e,
|
|
889
931
|
cleanArchiveAfter: t = 300 * 1e3
|
|
890
932
|
// 5mn
|
|
891
933
|
}) => {
|
|
892
|
-
const o = new
|
|
893
|
-
|
|
894
|
-
const
|
|
895
|
-
if (!
|
|
896
|
-
let
|
|
934
|
+
const o = new x(), r = new x(), n = new x(), s = {}, i = o.pipe(
|
|
935
|
+
Y((d) => {
|
|
936
|
+
const u = s[d];
|
|
937
|
+
if (!u || u.state.status !== "idle") return O;
|
|
938
|
+
let p = !1;
|
|
897
939
|
const m = (g) => {
|
|
898
940
|
f.debug(`Cleaning up archive with key: ${g}`);
|
|
899
|
-
const
|
|
900
|
-
delete s[g],
|
|
941
|
+
const w = s[g];
|
|
942
|
+
delete s[g], p || (w?.state.archive?.close(), p = !0);
|
|
901
943
|
};
|
|
902
|
-
|
|
944
|
+
u.update({
|
|
903
945
|
status: "loading"
|
|
904
946
|
});
|
|
905
|
-
const h =
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
947
|
+
const h = u.locks$, y = u.isUnlocked$, l = h.pipe(
|
|
948
|
+
ge(),
|
|
949
|
+
E(([g, w]) => w > g),
|
|
950
|
+
ye(!0)
|
|
909
951
|
);
|
|
910
|
-
return
|
|
911
|
-
|
|
912
|
-
|
|
952
|
+
return F(e(d)).pipe(
|
|
953
|
+
k((g) => {
|
|
954
|
+
u.update({
|
|
913
955
|
archive: g,
|
|
914
956
|
status: "success"
|
|
915
957
|
});
|
|
916
958
|
}),
|
|
917
|
-
|
|
959
|
+
C((g) => (m(d), u.update({
|
|
918
960
|
status: "error",
|
|
919
961
|
error: g
|
|
920
962
|
}), O)),
|
|
921
|
-
|
|
922
|
-
const g =
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
963
|
+
I(() => {
|
|
964
|
+
const g = l.pipe(
|
|
965
|
+
I(() => n),
|
|
966
|
+
I(() => y),
|
|
967
|
+
E((L) => L)
|
|
926
968
|
);
|
|
927
|
-
return
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
m(
|
|
969
|
+
return M(g, u.overTTL$).pipe(
|
|
970
|
+
D(),
|
|
971
|
+
k(() => {
|
|
972
|
+
m(d);
|
|
931
973
|
})
|
|
932
974
|
);
|
|
933
975
|
})
|
|
934
976
|
);
|
|
935
977
|
}),
|
|
936
|
-
|
|
937
|
-
), a = (
|
|
938
|
-
let
|
|
939
|
-
const
|
|
940
|
-
s[
|
|
941
|
-
locks:
|
|
978
|
+
be(r)
|
|
979
|
+
), a = (d) => {
|
|
980
|
+
let u = !1;
|
|
981
|
+
const p = s[d] ?? new Rt(t);
|
|
982
|
+
s[d] = p, p.update({
|
|
983
|
+
locks: p.state.locks + 1
|
|
942
984
|
});
|
|
943
985
|
const m = () => {
|
|
944
|
-
|
|
945
|
-
locks:
|
|
986
|
+
u || (u = !0, p.update({
|
|
987
|
+
locks: p.state.locks - 1
|
|
946
988
|
}));
|
|
947
989
|
};
|
|
948
|
-
o.next(
|
|
949
|
-
const h =
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
), y =
|
|
953
|
-
|
|
954
|
-
if (
|
|
955
|
-
throw
|
|
990
|
+
o.next(d);
|
|
991
|
+
const h = p.state$.pipe(
|
|
992
|
+
$(({ archive: l }) => l),
|
|
993
|
+
E((l) => !!l)
|
|
994
|
+
), y = p.state$.pipe(
|
|
995
|
+
k(({ error: l }) => {
|
|
996
|
+
if (l)
|
|
997
|
+
throw l;
|
|
956
998
|
}),
|
|
957
|
-
|
|
999
|
+
ve()
|
|
958
1000
|
);
|
|
959
|
-
return
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
throw m(),
|
|
1001
|
+
return M(h, y).pipe(
|
|
1002
|
+
D(),
|
|
1003
|
+
$((l) => ({ archive: l, release: m })),
|
|
1004
|
+
C((l) => {
|
|
1005
|
+
throw m(), l;
|
|
964
1006
|
})
|
|
965
1007
|
);
|
|
966
1008
|
}, c = () => {
|
|
@@ -971,7 +1013,7 @@ const ft = ({
|
|
|
971
1013
|
purge: c,
|
|
972
1014
|
_archives: s
|
|
973
1015
|
};
|
|
974
|
-
},
|
|
1016
|
+
}, G = (e) => e ? /^\d+$/.test(e) ? {
|
|
975
1017
|
valid: !0,
|
|
976
1018
|
value: Number.parseInt(e, 10)
|
|
977
1019
|
} : {
|
|
@@ -980,7 +1022,7 @@ const ft = ({
|
|
|
980
1022
|
} : {
|
|
981
1023
|
valid: !0,
|
|
982
1024
|
value: void 0
|
|
983
|
-
},
|
|
1025
|
+
}, xt = (e) => {
|
|
984
1026
|
if (!e.toLowerCase().startsWith("bytes="))
|
|
985
1027
|
return {
|
|
986
1028
|
kind: "missing"
|
|
@@ -999,7 +1041,7 @@ const ft = ({
|
|
|
999
1041
|
return {
|
|
1000
1042
|
kind: "invalid"
|
|
1001
1043
|
};
|
|
1002
|
-
const [, r = "", n = ""] = o, s =
|
|
1044
|
+
const [, r = "", n = ""] = o, s = G(r.trim()), i = G(n.trim());
|
|
1003
1045
|
return !s.valid || !i.valid ? {
|
|
1004
1046
|
kind: "invalid"
|
|
1005
1047
|
} : {
|
|
@@ -1007,7 +1049,7 @@ const ft = ({
|
|
|
1007
1049
|
start: s.value,
|
|
1008
1050
|
end: i.value
|
|
1009
1051
|
};
|
|
1010
|
-
},
|
|
1052
|
+
}, Et = (e) => {
|
|
1011
1053
|
if (e instanceof Blob)
|
|
1012
1054
|
return {
|
|
1013
1055
|
size: e.size,
|
|
@@ -1024,7 +1066,7 @@ const ft = ({
|
|
|
1024
1066
|
return { content: n, length: n.byteLength };
|
|
1025
1067
|
}
|
|
1026
1068
|
};
|
|
1027
|
-
},
|
|
1069
|
+
}, kt = ({
|
|
1028
1070
|
body: e,
|
|
1029
1071
|
contentType: t,
|
|
1030
1072
|
rangeHeader: o
|
|
@@ -1035,13 +1077,13 @@ const ft = ({
|
|
|
1035
1077
|
status: 200,
|
|
1036
1078
|
headers: r
|
|
1037
1079
|
});
|
|
1038
|
-
const n =
|
|
1080
|
+
const n = xt(o);
|
|
1039
1081
|
if (n.kind === "missing" || n.kind === "multi")
|
|
1040
1082
|
return e instanceof Blob && r.set("Content-Length", String(e.size)), new Response(e, {
|
|
1041
1083
|
status: 200,
|
|
1042
1084
|
headers: r
|
|
1043
1085
|
});
|
|
1044
|
-
const s =
|
|
1086
|
+
const s = Et(e), i = s.size;
|
|
1045
1087
|
if (n.kind === "invalid")
|
|
1046
1088
|
return new Response(null, {
|
|
1047
1089
|
status: 416,
|
|
@@ -1058,8 +1100,8 @@ const ft = ({
|
|
|
1058
1100
|
}
|
|
1059
1101
|
});
|
|
1060
1102
|
if (a === void 0) {
|
|
1061
|
-
const
|
|
1062
|
-
a = Math.max(0, i -
|
|
1103
|
+
const u = Math.min(c ?? 0, i);
|
|
1104
|
+
a = Math.max(0, i - u), c = i - 1;
|
|
1063
1105
|
} else (c === void 0 || c >= i) && (c = i - 1);
|
|
1064
1106
|
if (a < 0 || c < 0 || a >= i || c >= i || a > c)
|
|
1065
1107
|
return new Response(null, {
|
|
@@ -1068,29 +1110,29 @@ const ft = ({
|
|
|
1068
1110
|
"Content-Range": `bytes */${i}`
|
|
1069
1111
|
}
|
|
1070
1112
|
});
|
|
1071
|
-
const
|
|
1072
|
-
return r.set("Content-Length", String(
|
|
1113
|
+
const d = s.slice(a, c + 1);
|
|
1114
|
+
return r.set("Content-Length", String(d.length)), r.set("Content-Range", `bytes ${a}-${c}/${i}`), new Response(d.content, {
|
|
1073
1115
|
status: 206,
|
|
1074
1116
|
headers: r
|
|
1075
1117
|
});
|
|
1076
|
-
},
|
|
1118
|
+
}, K = "file://", Ct = /^https?:\/\//, Wt = (e) => {
|
|
1077
1119
|
try {
|
|
1078
1120
|
return decodeURIComponent(e);
|
|
1079
1121
|
} catch {
|
|
1080
1122
|
return e;
|
|
1081
1123
|
}
|
|
1082
|
-
},
|
|
1083
|
-
const t =
|
|
1084
|
-
return
|
|
1124
|
+
}, q = (e) => e.startsWith(K) ? e.slice(K.length) : e, Pt = (e) => {
|
|
1125
|
+
const t = q(e);
|
|
1126
|
+
return Ct.test(t) ? t : q(Wt(t));
|
|
1085
1127
|
};
|
|
1086
|
-
class
|
|
1128
|
+
class _t {
|
|
1087
1129
|
constructor({
|
|
1088
1130
|
hooks: t,
|
|
1089
1131
|
onError: o,
|
|
1090
1132
|
onManifestSuccess: r,
|
|
1091
1133
|
...n
|
|
1092
1134
|
}) {
|
|
1093
|
-
this.onError = (s) => (console.error(s), new Response(String(s), { status: 500 })), this.archiveLoader =
|
|
1135
|
+
this.onError = (s) => (console.error(s), new Response(String(s), { status: 500 })), this.archiveLoader = Lt(n), this.hooks = t ?? {}, this.onManifestSuccess = r ?? (({ manifest: s }) => Promise.resolve(s)), this.onError = o ?? this.onError;
|
|
1094
1136
|
}
|
|
1095
1137
|
prune() {
|
|
1096
1138
|
this.archiveLoader.purge();
|
|
@@ -1100,7 +1142,7 @@ class wt {
|
|
|
1100
1142
|
}
|
|
1101
1143
|
accessArchiveWithoutLock(t) {
|
|
1102
1144
|
return this.accessArchive(t).pipe(
|
|
1103
|
-
|
|
1145
|
+
$(({ archive: o, release: r }) => (r(), o))
|
|
1104
1146
|
);
|
|
1105
1147
|
}
|
|
1106
1148
|
withArchiveResponse({
|
|
@@ -1108,30 +1150,30 @@ class wt {
|
|
|
1108
1150
|
getResponse: o
|
|
1109
1151
|
}) {
|
|
1110
1152
|
const r = this.accessArchive(t).pipe(
|
|
1111
|
-
|
|
1112
|
-
({ archive: n, release: s }) =>
|
|
1113
|
-
|
|
1153
|
+
Y(
|
|
1154
|
+
({ archive: n, release: s }) => F(o(n)).pipe(
|
|
1155
|
+
Ie(() => {
|
|
1114
1156
|
s();
|
|
1115
1157
|
})
|
|
1116
1158
|
)
|
|
1117
1159
|
),
|
|
1118
|
-
|
|
1160
|
+
C((n) => Te(this.onError(n)))
|
|
1119
1161
|
);
|
|
1120
|
-
return
|
|
1162
|
+
return Se(r);
|
|
1121
1163
|
}
|
|
1122
1164
|
fetchManifest({ key: t, baseUrl: o }) {
|
|
1123
1165
|
return this.withArchiveResponse({
|
|
1124
1166
|
key: t,
|
|
1125
|
-
getResponse: (r) =>
|
|
1126
|
-
|
|
1167
|
+
getResponse: (r) => F(
|
|
1168
|
+
gt(r, {
|
|
1127
1169
|
baseUrl: o,
|
|
1128
1170
|
hooks: this.hooks.manifest
|
|
1129
1171
|
})
|
|
1130
1172
|
).pipe(
|
|
1131
|
-
|
|
1132
|
-
(s) =>
|
|
1173
|
+
I(
|
|
1174
|
+
(s) => F(this.onManifestSuccess({ manifest: s, archive: r }))
|
|
1133
1175
|
),
|
|
1134
|
-
|
|
1176
|
+
$(
|
|
1135
1177
|
(s) => new Response(JSON.stringify(s), {
|
|
1136
1178
|
status: 200
|
|
1137
1179
|
})
|
|
@@ -1147,14 +1189,14 @@ class wt {
|
|
|
1147
1189
|
return this.withArchiveResponse({
|
|
1148
1190
|
key: t,
|
|
1149
1191
|
getResponse: (n) => {
|
|
1150
|
-
const s =
|
|
1151
|
-
return
|
|
1152
|
-
|
|
1192
|
+
const s = Pt(o);
|
|
1193
|
+
return F(
|
|
1194
|
+
St(n, s, {
|
|
1153
1195
|
hooks: this.hooks.resource
|
|
1154
1196
|
})
|
|
1155
1197
|
).pipe(
|
|
1156
|
-
|
|
1157
|
-
(a) =>
|
|
1198
|
+
$(
|
|
1199
|
+
(a) => kt({
|
|
1158
1200
|
body: a.body ?? "",
|
|
1159
1201
|
contentType: a.params.contentType,
|
|
1160
1202
|
rangeHeader: r?.headers.get("range")
|
|
@@ -1165,7 +1207,7 @@ class wt {
|
|
|
1165
1207
|
});
|
|
1166
1208
|
}
|
|
1167
1209
|
}
|
|
1168
|
-
class
|
|
1210
|
+
class Vt extends _t {
|
|
1169
1211
|
constructor({
|
|
1170
1212
|
getUriInfo: t,
|
|
1171
1213
|
...o
|
|
@@ -1196,20 +1238,24 @@ class Ct extends wt {
|
|
|
1196
1238
|
}
|
|
1197
1239
|
}
|
|
1198
1240
|
export {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1241
|
+
Vt as ServiceWorkerStreamer,
|
|
1242
|
+
_t as Streamer,
|
|
1243
|
+
Xt as configure,
|
|
1244
|
+
Dt as createArchiveFromArrayBufferList,
|
|
1245
|
+
Bt as createArchiveFromJszip,
|
|
1246
|
+
jt as createArchiveFromLibArchive,
|
|
1247
|
+
Ut as createArchiveFromText,
|
|
1248
|
+
Ht as createArchiveFromUrls,
|
|
1249
|
+
Ne as createUniqueXmlSafeId,
|
|
1250
|
+
_e as createXmlSafeId,
|
|
1251
|
+
Q as createXmlSafeIdFactory,
|
|
1252
|
+
gt as generateManifestFromArchive,
|
|
1253
|
+
St as generateResourceFromArchive,
|
|
1254
|
+
Me as getArchiveHasComicInfo,
|
|
1255
|
+
_ as getArchiveOpfInfo,
|
|
1256
|
+
Re as getUriBasePath,
|
|
1257
|
+
A as getUriBasename,
|
|
1212
1258
|
j as removeTrailingSlash,
|
|
1213
|
-
|
|
1259
|
+
P as sortByTitleComparator
|
|
1214
1260
|
};
|
|
1215
1261
|
//# sourceMappingURL=index.js.map
|