@prose-reader/archive-reader 1.358.0 → 1.359.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/index/index.cjs +1 -1
- package/dist/index/index.cjs.map +1 -1
- package/dist/index/index.js +166 -163
- package/dist/index/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/utils/normalizeIdentifierScheme.d.ts +2 -0
- package/dist/utils/normalizeIdentifierScheme.test.d.ts +1 -0
- package/package.json +3 -3
package/dist/index/index.js
CHANGED
|
@@ -88,17 +88,17 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
88
88
|
}, ...d],
|
|
89
89
|
close: () => Promise.resolve()
|
|
90
90
|
});
|
|
91
|
-
}, x = (e) => !e.dir,
|
|
91
|
+
}, x = (e) => !e.dir, ee = (e) => e.dir, S = (e, t) => {
|
|
92
92
|
let n = e.recordsByUri.get(t);
|
|
93
93
|
return n && x(n) ? n : void 0;
|
|
94
|
-
},
|
|
94
|
+
}, C = (e) => f(e.encodingFormat ?? "") || o(e.basename), w = (e) => x(e) && C(e)?.startsWith("image/") === !0, T = (e) => e.records.filter(x).filter(w), E = async (e) => new TextDecoder().decode(await e.arrayBuffer()), D = (e) => {
|
|
95
95
|
let t = e.records.filter((e) => !e.dir).find((e) => e.uri.endsWith(".opf"));
|
|
96
96
|
return {
|
|
97
97
|
data: t,
|
|
98
98
|
basePath: t?.uri.substring(0, t.uri.lastIndexOf("/")) || ""
|
|
99
99
|
};
|
|
100
|
-
},
|
|
101
|
-
let t =
|
|
100
|
+
}, O = (e) => e === void 0 || e.trim().length === 0 ? [] : e.trim().split(/\s+/).filter((e) => e.length > 0), k = (e) => {
|
|
101
|
+
let t = O(e);
|
|
102
102
|
if (t.length === 0) return {};
|
|
103
103
|
let n;
|
|
104
104
|
t.includes("rendition:layout-reflowable") && (n = "reflowable"), t.includes("rendition:layout-pre-paginated") && (n = "pre-paginated");
|
|
@@ -109,16 +109,16 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
109
109
|
...t.includes("page-spread-left") ? { pageSpreadLeft: !0 } : {},
|
|
110
110
|
...t.includes("page-spread-right") ? { pageSpreadRight: !0 } : {}
|
|
111
111
|
};
|
|
112
|
-
},
|
|
113
|
-
for (let n of e.children) if (
|
|
114
|
-
},
|
|
112
|
+
}, A = (e) => e.includes(":") ? e.slice(e.lastIndexOf(":") + 1) : e, j = (e, t) => A(e).toLowerCase() === t.toLowerCase(), te = (e) => e.type === "element", M = (e, t) => {
|
|
113
|
+
for (let n of e.children) if (te(n) && j(n.name, t)) return n;
|
|
114
|
+
}, N = (e, t) => {
|
|
115
115
|
let n = [];
|
|
116
|
-
for (let r of e.children)
|
|
116
|
+
for (let r of e.children) te(r) && j(r.name, t) && n.push(r);
|
|
117
117
|
return n;
|
|
118
|
-
},
|
|
118
|
+
}, ne = (e, t) => {
|
|
119
119
|
let n = [];
|
|
120
120
|
return e.eachChild((e) => {
|
|
121
|
-
if (
|
|
121
|
+
if (A(e.name).toLowerCase() !== "identifier") return;
|
|
122
122
|
let r = e.val.trim();
|
|
123
123
|
if (r.length === 0) return;
|
|
124
124
|
let i = (e.attr["opf:scheme"] ?? e.attr["opf:Scheme"] ?? e.attr.scheme)?.trim(), a = e.attr.id?.trim(), o = a !== void 0 && a.length > 0 ? a : void 0;
|
|
@@ -129,10 +129,10 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
129
129
|
...o !== void 0 && o === t ? { unique: !0 } : {}
|
|
130
130
|
});
|
|
131
131
|
}), n;
|
|
132
|
-
},
|
|
132
|
+
}, re = (e) => {
|
|
133
133
|
let t = [];
|
|
134
134
|
return e.eachChild((e) => {
|
|
135
|
-
if (
|
|
135
|
+
if (A(e.name).toLowerCase() !== "title") return;
|
|
136
136
|
let n = e.val.trim();
|
|
137
137
|
if (n.length === 0) return;
|
|
138
138
|
let r = e.attr.id?.trim();
|
|
@@ -141,46 +141,46 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
141
141
|
...r !== void 0 && r.length > 0 ? { id: r } : {}
|
|
142
142
|
});
|
|
143
143
|
}), t;
|
|
144
|
-
},
|
|
144
|
+
}, P = (e, t) => {
|
|
145
145
|
let n;
|
|
146
146
|
return e.eachChild((e) => {
|
|
147
|
-
if (n !== void 0 ||
|
|
147
|
+
if (n !== void 0 || A(e.name).toLowerCase() !== t.toLowerCase()) return;
|
|
148
148
|
let r = e.val.trim();
|
|
149
149
|
r.length > 0 && (n = r);
|
|
150
150
|
}), n;
|
|
151
|
-
},
|
|
151
|
+
}, ie = (e, t) => {
|
|
152
152
|
let n = [];
|
|
153
153
|
return e.eachChild((e) => {
|
|
154
|
-
if (
|
|
154
|
+
if (A(e.name).toLowerCase() !== t.toLowerCase()) return;
|
|
155
155
|
let r = e.val.trim();
|
|
156
156
|
r.length > 0 && n.push(r);
|
|
157
157
|
}), n;
|
|
158
|
-
},
|
|
158
|
+
}, ae = (e) => {
|
|
159
159
|
let t;
|
|
160
160
|
return e.eachChild((e) => {
|
|
161
|
-
if (t !== void 0 ||
|
|
161
|
+
if (t !== void 0 || A(e.name).toLowerCase() !== "meta" || e.attr.name?.toLowerCase() !== "cover") return;
|
|
162
162
|
let n = e.attr.content?.trim();
|
|
163
163
|
n !== void 0 && n.length > 0 && (t = n);
|
|
164
164
|
}), t;
|
|
165
|
-
},
|
|
166
|
-
let n = (e) => e.mediaType?.toLowerCase().includes("image/") === !0, r = e.find((e) => n(e) ?
|
|
165
|
+
}, oe = ({ manifestItems: e, metadataEl: t }) => {
|
|
166
|
+
let n = (e) => e.mediaType?.toLowerCase().includes("image/") === !0, r = e.find((e) => n(e) ? O(e.properties).includes("cover-image") : !1);
|
|
167
167
|
if (r !== void 0) return r.href;
|
|
168
168
|
if (t !== void 0) {
|
|
169
|
-
let r =
|
|
169
|
+
let r = ae(t);
|
|
170
170
|
if (r !== void 0) {
|
|
171
171
|
let t = e.find((e) => e.id === r && n(e));
|
|
172
172
|
if (t !== void 0) return t.href;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
return e.find((e) => e.id.toLowerCase().includes("cover") && n(e))?.href;
|
|
176
|
-
},
|
|
176
|
+
}, F = (e, t) => {
|
|
177
177
|
let n = e.attr[t]?.trim();
|
|
178
178
|
return n !== void 0 && n.length > 0 ? n : void 0;
|
|
179
|
-
},
|
|
179
|
+
}, se = (e) => {
|
|
180
180
|
let t = [];
|
|
181
181
|
return e.eachChild((e) => {
|
|
182
|
-
if (
|
|
183
|
-
let n =
|
|
182
|
+
if (A(e.name).toLowerCase() !== "meta") return;
|
|
183
|
+
let n = F(e, "property"), r = F(e, "refines"), i = F(e, "scheme"), a = F(e, "id"), o = F(e, "name"), s = F(e, "content"), c = e.val.trim(), l = c.length > 0 ? c : void 0, u = {
|
|
184
184
|
...n === void 0 ? {} : { property: n },
|
|
185
185
|
...r === void 0 ? {} : { refines: r },
|
|
186
186
|
...i === void 0 ? {} : { scheme: i },
|
|
@@ -191,14 +191,14 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
191
191
|
};
|
|
192
192
|
Object.keys(u).length !== 0 && t.push(u);
|
|
193
193
|
}), t;
|
|
194
|
-
},
|
|
194
|
+
}, ce = (e, t) => e.replace(/^#/, "") === t, le = (e, t) => {
|
|
195
195
|
let n = [];
|
|
196
196
|
return e.eachChild((e) => {
|
|
197
|
-
let r =
|
|
197
|
+
let r = A(e.name).toLowerCase();
|
|
198
198
|
if (r !== "creator" && r !== "contributor") return;
|
|
199
199
|
let i = e.val.trim();
|
|
200
200
|
if (i.length === 0) return;
|
|
201
|
-
let a =
|
|
201
|
+
let a = F(e, "id"), o = (e) => a === void 0 ? [] : t.flatMap((t) => t.refines !== void 0 && ce(t.refines, a) && t.property === e && t.value !== void 0 ? [t.value] : []), s = F(e, "opf:role") ?? F(e, "role"), c = [...s === void 0 ? [] : [s], ...o("role")], l = F(e, "opf:file-as") ?? F(e, "file-as") ?? o("file-as")[0];
|
|
202
202
|
n.push({
|
|
203
203
|
name: i,
|
|
204
204
|
source: r,
|
|
@@ -207,14 +207,14 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
207
207
|
...l === void 0 ? {} : { fileAs: l }
|
|
208
208
|
});
|
|
209
209
|
}), n;
|
|
210
|
-
},
|
|
211
|
-
let n =
|
|
210
|
+
}, I = (e, t) => {
|
|
211
|
+
let n = N(e, "meta").find((e) => e.attr.property === t)?.val;
|
|
212
212
|
if (!(n === void 0 || n.trim().length === 0)) return n;
|
|
213
|
-
},
|
|
214
|
-
let t =
|
|
213
|
+
}, ue = (e) => {
|
|
214
|
+
let t = M(e, "guide");
|
|
215
215
|
if (t === void 0) return [];
|
|
216
216
|
let n = [];
|
|
217
|
-
for (let e of
|
|
217
|
+
for (let e of N(t, "reference")) {
|
|
218
218
|
let t = e.attr.href?.trim();
|
|
219
219
|
t === void 0 || t.length === 0 || n.push({
|
|
220
220
|
href: t,
|
|
@@ -223,7 +223,7 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
return n;
|
|
226
|
-
},
|
|
226
|
+
}, de = (e) => {
|
|
227
227
|
let t = e.attr.id, n = e.attr.href;
|
|
228
228
|
if (t === void 0 || t.length === 0 || n === void 0 || n.length === 0) return;
|
|
229
229
|
let r = e.attr["media-type"], i = e.attr.properties?.trim();
|
|
@@ -233,24 +233,24 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
233
233
|
...r !== void 0 && r.length > 0 ? { mediaType: r } : {},
|
|
234
234
|
...i !== void 0 && i.length > 0 ? { properties: i } : {}
|
|
235
235
|
};
|
|
236
|
-
},
|
|
236
|
+
}, fe = (e) => {
|
|
237
237
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
238
|
-
for (let r of
|
|
239
|
-
let e =
|
|
238
|
+
for (let r of N(e, "item")) {
|
|
239
|
+
let e = de(r);
|
|
240
240
|
e !== void 0 && (t.push(e), n.set(e.id, e));
|
|
241
241
|
}
|
|
242
242
|
return {
|
|
243
243
|
items: t,
|
|
244
244
|
byId: n
|
|
245
245
|
};
|
|
246
|
-
},
|
|
246
|
+
}, pe = (e, t) => {
|
|
247
247
|
let n = [];
|
|
248
|
-
for (let r of
|
|
248
|
+
for (let r of N(t, "itemref")) {
|
|
249
249
|
let t = r.attr.idref;
|
|
250
250
|
if (t === void 0 || t.trim().length === 0) continue;
|
|
251
251
|
let i = e.get(t);
|
|
252
252
|
if (i === void 0) continue;
|
|
253
|
-
let a =
|
|
253
|
+
let a = k(r.attr.properties);
|
|
254
254
|
n.push({
|
|
255
255
|
idref: t,
|
|
256
256
|
id: i.id,
|
|
@@ -264,24 +264,24 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
return n;
|
|
267
|
-
},
|
|
268
|
-
let t = new h(e), n =
|
|
267
|
+
}, me = (e) => {
|
|
268
|
+
let t = new h(e), n = M(t, "manifest"), r = M(t, "spine"), i = M(t, "metadata"), a = t.attr["unique-identifier"]?.trim(), o = a !== void 0 && a.length > 0 ? a : void 0, s = [], c = [];
|
|
269
269
|
if (n !== void 0) {
|
|
270
|
-
let { items: e, byId: t } =
|
|
271
|
-
s = e, r !== void 0 && (c =
|
|
270
|
+
let { items: e, byId: t } = fe(n);
|
|
271
|
+
s = e, r !== void 0 && (c = pe(t, r));
|
|
272
272
|
}
|
|
273
|
-
let l = r?.attr["page-progression-direction"], u = l !== void 0 && l.trim().length > 0 ? l : void 0, d = r?.attr.toc, f = d !== void 0 && d.trim().length > 0 ? d.trim() : void 0, p = [], m, g, _, v, y = [], b = [], x = [],
|
|
274
|
-
i !== void 0 && (p =
|
|
275
|
-
let
|
|
273
|
+
let l = r?.attr["page-progression-direction"], u = l !== void 0 && l.trim().length > 0 ? l : void 0, d = r?.attr.toc, f = d !== void 0 && d.trim().length > 0 ? d.trim() : void 0, p = [], m, g, _, v, y = [], b = [], x = [], ee = [], S, C, w, T = [], E = [];
|
|
274
|
+
i !== void 0 && (p = re(i), m = P(i, "publisher"), g = P(i, "description"), _ = P(i, "rights"), v = P(i, "date"), y = ie(i, "creator"), x = ie(i, "language"), ee = ie(i, "subject"), S = I(i, "rendition:layout"), C = I(i, "rendition:flow"), w = I(i, "rendition:spread"), T = se(i), b = le(i, T), E.push(...ne(i, o)));
|
|
275
|
+
let D = oe({
|
|
276
276
|
manifestItems: s,
|
|
277
277
|
metadataEl: i
|
|
278
|
-
}),
|
|
278
|
+
}), O = ue(t);
|
|
279
279
|
return {
|
|
280
280
|
kind: "opf",
|
|
281
281
|
manifestItems: s,
|
|
282
282
|
spineRows: c,
|
|
283
283
|
spineTocIdref: f,
|
|
284
|
-
identifiers:
|
|
284
|
+
identifiers: E,
|
|
285
285
|
titles: p,
|
|
286
286
|
creators: y,
|
|
287
287
|
contributors: b,
|
|
@@ -289,29 +289,29 @@ var v = async (e, t = {}) => n(e, (e) => e.isDir ? {
|
|
|
289
289
|
description: g,
|
|
290
290
|
rights: _,
|
|
291
291
|
languages: x,
|
|
292
|
-
subjects:
|
|
292
|
+
subjects: ee,
|
|
293
293
|
date: v,
|
|
294
|
-
coverHref:
|
|
295
|
-
renditionLayoutMeta:
|
|
296
|
-
renditionFlowMeta:
|
|
297
|
-
renditionSpreadMeta:
|
|
294
|
+
coverHref: D,
|
|
295
|
+
renditionLayoutMeta: S,
|
|
296
|
+
renditionFlowMeta: C,
|
|
297
|
+
renditionSpreadMeta: w,
|
|
298
298
|
pageProgressionDirection: u,
|
|
299
|
-
guide:
|
|
300
|
-
metas:
|
|
299
|
+
guide: O,
|
|
300
|
+
metas: T
|
|
301
301
|
};
|
|
302
302
|
};
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/metadata/opf/readArchiveOpf.ts
|
|
305
|
-
async function
|
|
306
|
-
let { data: t, basePath: n } =
|
|
305
|
+
async function L(e) {
|
|
306
|
+
let { data: t, basePath: n } = D(e) || {};
|
|
307
307
|
if (!(!t || t.dir)) return {
|
|
308
|
-
opf:
|
|
308
|
+
opf: me(await E(t)),
|
|
309
309
|
basePath: n
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/metadata/apple/parse.ts
|
|
314
|
-
var
|
|
314
|
+
var R = "com.apple.ibooks.display-options.xml", he = (e) => e.childrenNamed("option").map((e) => ({
|
|
315
315
|
name: e.attr?.name,
|
|
316
316
|
value: e.val
|
|
317
317
|
})), ge = (e) => {
|
|
@@ -375,7 +375,7 @@ var me = "com.apple.ibooks.display-options.xml", he = (e) => e.childrenNamed("op
|
|
|
375
375
|
return {
|
|
376
376
|
row: t,
|
|
377
377
|
uri: r,
|
|
378
|
-
record:
|
|
378
|
+
record: S(e, r)
|
|
379
379
|
};
|
|
380
380
|
}), a = i.reduce((e, { record: t }) => e + (t?.size ?? 0), 0);
|
|
381
381
|
return i.map(({ row: e, uri: n, record: i }) => B({
|
|
@@ -389,7 +389,7 @@ var me = "com.apple.ibooks.display-options.xml", he = (e) => e.childrenNamed("op
|
|
|
389
389
|
pageSpreadRight: e.pageSpreadRight,
|
|
390
390
|
progressionWeight: a > 0 ? (i?.size ?? 0) / a : 1 / t.spineRows.length
|
|
391
391
|
}));
|
|
392
|
-
}, ke = z.toLowerCase(), Ae =
|
|
392
|
+
}, ke = z.toLowerCase(), Ae = R.toLowerCase(), je = (e) => {
|
|
393
393
|
let t = e.basename.toLowerCase();
|
|
394
394
|
return t === ke || t === Ae || e.uri.endsWith("com.kobobooks.display-options.xml") || t.endsWith(".db");
|
|
395
395
|
}, Me = (e) => {
|
|
@@ -405,13 +405,13 @@ var me = "com.apple.ibooks.display-options.xml", he = (e) => e.childrenNamed("op
|
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}, V = async (e, { opf: t } = {}) => {
|
|
408
|
-
let n = t ?? await
|
|
408
|
+
let n = t ?? await L(e).catch(() => void 0);
|
|
409
409
|
return n ? Oe(e, n) : Me(e);
|
|
410
410
|
}, Ne = (e, t) => {
|
|
411
|
-
let n =
|
|
411
|
+
let n = S(e, t);
|
|
412
412
|
if (n !== void 0) return f(n.encodingFormat ?? "") || o(n.basename);
|
|
413
413
|
}, Pe = async (e, { opf: t, readingOrder: n } = {}) => {
|
|
414
|
-
let r = t ?? await
|
|
414
|
+
let r = t ?? await L(e).catch(() => void 0);
|
|
415
415
|
if (r !== void 0 && r.opf.coverHref !== void 0) {
|
|
416
416
|
let t = Ee(r.opf.coverHref, r.basePath);
|
|
417
417
|
return B({
|
|
@@ -436,19 +436,19 @@ var me = "com.apple.ibooks.display-options.xml", he = (e) => e.childrenNamed("op
|
|
|
436
436
|
mimeType: r.mediaType,
|
|
437
437
|
uri: r.uri
|
|
438
438
|
})) return !1;
|
|
439
|
-
let n =
|
|
439
|
+
let n = S(e, r.uri);
|
|
440
440
|
if (!n || !x(n)) return !1;
|
|
441
441
|
try {
|
|
442
|
-
if (!Fe(new h(await
|
|
442
|
+
if (!Fe(new h(await E(n)))) return !1;
|
|
443
443
|
} catch (e) {
|
|
444
444
|
return t.error(`layout scan: unable to inspect ${r.uri}`, e), !1;
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
return !0;
|
|
448
|
-
}, Le =
|
|
448
|
+
}, Le = R.toLowerCase();
|
|
449
449
|
async function Re(e) {
|
|
450
450
|
let t = e.records.find((e) => x(e) && e.basename.toLowerCase() === Le);
|
|
451
|
-
if (t) return ge(await
|
|
451
|
+
if (t) return ge(await E(t));
|
|
452
452
|
}
|
|
453
453
|
//#endregion
|
|
454
454
|
//#region src/metadata/comicInfo/getArchiveHasComicInfo.ts
|
|
@@ -465,7 +465,7 @@ var ze = z.toLowerCase(), Be = (e) => e.records.find((e) => x(e) && e.basename.t
|
|
|
465
465
|
//#region src/metadata/comicInfo/readArchiveComicInfo.ts
|
|
466
466
|
async function Ue(e) {
|
|
467
467
|
let t = Be(e);
|
|
468
|
-
if (t) return xe(await
|
|
468
|
+
if (t) return xe(await E(t));
|
|
469
469
|
}
|
|
470
470
|
//#endregion
|
|
471
471
|
//#region src/metadata/kobo/readArchiveKobo.ts
|
|
@@ -474,7 +474,7 @@ async function We(e) {
|
|
|
474
474
|
if (n.length === 0) return;
|
|
475
475
|
let r;
|
|
476
476
|
for (let e of n) {
|
|
477
|
-
let n = await
|
|
477
|
+
let n = await E(e);
|
|
478
478
|
try {
|
|
479
479
|
let { renditionLayout: e } = we(n);
|
|
480
480
|
e && (r = e);
|
|
@@ -666,7 +666,19 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
666
666
|
if (e == null) return;
|
|
667
667
|
let t = String(e).replace(/\D/g, "");
|
|
668
668
|
if (!(t.length === 0 || !gt.has(t.length))) return t;
|
|
669
|
-
}, vt = (
|
|
669
|
+
}, vt = new Map(Object.entries({
|
|
670
|
+
isbn: "ISBN",
|
|
671
|
+
gtin: "GTIN",
|
|
672
|
+
doi: "DOI",
|
|
673
|
+
googlebooks: "GoogleBooks",
|
|
674
|
+
openlibrary: "OpenLibrary",
|
|
675
|
+
projectgutenberg: "ProjectGutenberg",
|
|
676
|
+
url: "URL",
|
|
677
|
+
unknown: "Unknown"
|
|
678
|
+
})), q = (e) => {
|
|
679
|
+
let t = e.trim();
|
|
680
|
+
return vt.get(t.toLowerCase()) ?? t;
|
|
681
|
+
}, yt = (e) => {
|
|
670
682
|
if (e === void 0) return;
|
|
671
683
|
let t = e.trim().match(/^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?/);
|
|
672
684
|
if (t === null) return;
|
|
@@ -676,25 +688,13 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
676
688
|
...r === void 0 ? {} : { month: Number.parseInt(r, 10) },
|
|
677
689
|
...i === void 0 ? {} : { day: Number.parseInt(i, 10) }
|
|
678
690
|
};
|
|
679
|
-
},
|
|
691
|
+
}, bt = (e) => {
|
|
680
692
|
let t = e.trim();
|
|
681
693
|
if (/^https?:\/\//i.test(t)) try {
|
|
682
694
|
let e = new URL(t);
|
|
683
695
|
if ((e.protocol === "http:" || e.protocol === "https:") && e.hostname.length > 0) return "URL";
|
|
684
696
|
} catch {}
|
|
685
697
|
return ht(t) === void 0 ? _t(t) === void 0 ? "Unknown" : "GTIN" : "ISBN";
|
|
686
|
-
}, bt = (e) => {
|
|
687
|
-
switch (e.trim().toLowerCase()) {
|
|
688
|
-
case "isbn": return "ISBN";
|
|
689
|
-
case "gtin": return "GTIN";
|
|
690
|
-
case "doi": return "DOI";
|
|
691
|
-
case "googlebooks": return "GoogleBooks";
|
|
692
|
-
case "openlibrary": return "OpenLibrary";
|
|
693
|
-
case "projectgutenberg": return "ProjectGutenberg";
|
|
694
|
-
case "url": return "URL";
|
|
695
|
-
case "unknown": return "Unknown";
|
|
696
|
-
default: return e.trim();
|
|
697
|
-
}
|
|
698
698
|
}, xt = {
|
|
699
699
|
art: "artist",
|
|
700
700
|
aut: "author",
|
|
@@ -711,7 +711,7 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
711
711
|
roles: t.length > 0 ? t : [e.source === "creator" ? "author" : "contributor"],
|
|
712
712
|
sortAs: e.fileAs
|
|
713
713
|
});
|
|
714
|
-
}),
|
|
714
|
+
}), J = (e, t) => e.refines !== void 0 && e.refines.replace(/^#/, "") === t, Ct = {
|
|
715
715
|
"02": "ISBN",
|
|
716
716
|
"03": "GTIN",
|
|
717
717
|
"04": "UPC",
|
|
@@ -732,7 +732,7 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
732
732
|
if (!(t === void 0 || t.length === 0)) return e?.scheme?.trim().toLowerCase() === "onix:codelist5" ? Ct[t] ?? t : t;
|
|
733
733
|
}, Tt = (e, t) => {
|
|
734
734
|
let n = e.id;
|
|
735
|
-
if (n !== void 0) return wt(t.find((e) => e.property === "identifier-type" &&
|
|
735
|
+
if (n !== void 0) return wt(t.find((e) => e.property === "identifier-type" && J(e, n) && e.value !== void 0));
|
|
736
736
|
}, Et = (e) => {
|
|
737
737
|
let t = e?.trim();
|
|
738
738
|
if (t === void 0 || !/^\d+(\.\d+)?$/.test(t)) return;
|
|
@@ -746,19 +746,19 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
746
746
|
}, Ot = (e) => {
|
|
747
747
|
let t = e?.trim();
|
|
748
748
|
return t !== void 0 && t.length > 0 ? t : void 0;
|
|
749
|
-
},
|
|
749
|
+
}, Y = (e, t, n) => t === void 0 ? void 0 : e.find((e) => J(e, t) && e.property === n && e.value !== void 0)?.value, kt = (e, t) => e.map((e) => B({
|
|
750
750
|
value: e.value,
|
|
751
|
-
type: Ot(
|
|
752
|
-
displaySeq: Dt(
|
|
753
|
-
sortAs: Ot(
|
|
751
|
+
type: Ot(Y(t, e.id, "title-type"))?.toLowerCase(),
|
|
752
|
+
displaySeq: Dt(Y(t, e.id, "display-seq")),
|
|
753
|
+
sortAs: Ot(Y(t, e.id, "file-as"))
|
|
754
754
|
})), At = (e, t) => {
|
|
755
755
|
if (t === void 0) return;
|
|
756
756
|
let n = e.flatMap((n) => {
|
|
757
|
-
if (!
|
|
757
|
+
if (!J(n, t) || n.property !== "dcterms:identifier") return [];
|
|
758
758
|
let r = Ot(n.value);
|
|
759
759
|
return r === void 0 ? [] : [{
|
|
760
760
|
value: r,
|
|
761
|
-
scheme:
|
|
761
|
+
scheme: q(wt(e.find((e) => n.id !== void 0 && J(e, n.id) && e.property === "identifier-type")) ?? bt(r))
|
|
762
762
|
}];
|
|
763
763
|
});
|
|
764
764
|
return n.length > 0 ? n : void 0;
|
|
@@ -766,7 +766,7 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
766
766
|
let t = [], n = [];
|
|
767
767
|
for (let r of e) {
|
|
768
768
|
if (r.property !== "belongs-to-collection" || r.value === void 0) continue;
|
|
769
|
-
let i = r.id, a = (t) =>
|
|
769
|
+
let i = r.id, a = (t) => Y(e, i, t), o = a("collection-type")?.trim().toLowerCase(), s = B({
|
|
770
770
|
name: r.value,
|
|
771
771
|
identifiers: At(e, i),
|
|
772
772
|
position: Et(a("group-position"))
|
|
@@ -791,31 +791,31 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
791
791
|
let t = e?.trim();
|
|
792
792
|
if (t === "none" || t === "landscape" || t === "portrait" || t === "both" || t === "auto") return t;
|
|
793
793
|
}, Pt = (e) => {
|
|
794
|
-
let { titles: t, contributors: n, publisher: r, description: i, rights: a, languages: o, subjects: s, date: c, renditionLayoutMeta: l, renditionFlowMeta: u, renditionSpreadMeta: d, pageProgressionDirection: f, identifiers: p, metas: m, kind: h, creators: g, manifestItems: _, spineRows: v, spineTocIdref: y, coverHref: b, guide: x, ...
|
|
795
|
-
series:
|
|
796
|
-
collection:
|
|
797
|
-
}) : void 0,
|
|
798
|
-
date:
|
|
794
|
+
let { titles: t, contributors: n, publisher: r, description: i, rights: a, languages: o, subjects: s, date: c, renditionLayoutMeta: l, renditionFlowMeta: u, renditionSpreadMeta: d, pageProgressionDirection: f, identifiers: p, metas: m, kind: h, creators: g, manifestItems: _, spineRows: v, spineTocIdref: y, coverHref: b, guide: x, ...ee } = e, S = f?.trim().toLowerCase(), C = S === "ltr" || S === "rtl" ? S : void 0, w = l?.trim().toLowerCase(), T = w === "reflowable" || w === "pre-paginated" ? w : void 0, E = St(n), D = kt(t, m), { series: O, collection: k } = jt(m), A = O.length > 0 || k.length > 0 ? B({
|
|
795
|
+
series: O.length > 0 ? O : void 0,
|
|
796
|
+
collection: k.length > 0 ? k : void 0
|
|
797
|
+
}) : void 0, j = B({
|
|
798
|
+
date: yt(c),
|
|
799
799
|
publisher: r
|
|
800
800
|
});
|
|
801
801
|
return B({
|
|
802
|
-
titles:
|
|
802
|
+
titles: D.length > 0 ? D : void 0,
|
|
803
803
|
description: i,
|
|
804
|
-
publication:
|
|
804
|
+
publication: j.date !== void 0 || j.publisher !== void 0 ? { edition: j } : void 0,
|
|
805
805
|
rights: a,
|
|
806
806
|
languages: o.length > 0 ? [...o] : void 0,
|
|
807
807
|
subjects: s.length > 0 ? [...s] : void 0,
|
|
808
|
-
contributors:
|
|
809
|
-
readingDirection:
|
|
810
|
-
renditionLayout:
|
|
808
|
+
contributors: E.length > 0 ? E : void 0,
|
|
809
|
+
readingDirection: C,
|
|
810
|
+
renditionLayout: T,
|
|
811
811
|
renditionFlow: Mt(u),
|
|
812
812
|
renditionSpread: Nt(d),
|
|
813
813
|
identifiers: p.length > 0 ? p.map((e) => B({
|
|
814
814
|
value: e.value,
|
|
815
|
-
scheme:
|
|
815
|
+
scheme: q(e.scheme ?? Tt(e, m) ?? bt(e.value)),
|
|
816
816
|
unique: e.unique
|
|
817
817
|
})) : void 0,
|
|
818
|
-
belongsTo:
|
|
818
|
+
belongsTo: A,
|
|
819
819
|
properties: m.length > 0 ? [...m] : void 0
|
|
820
820
|
});
|
|
821
821
|
}, Ft = (e) => e.kind === "comicInfo" ? ut(e) : e.kind === "kobo" ? dt(e) : e.kind === "apple" ? Je(e) : Pt(e), It = (e) => {
|
|
@@ -874,7 +874,7 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
874
874
|
let a = encodeURI(t.uri).replace(/#/g, "%23").replace(/\?/g, "%3F").replace(/\/$/, ""), o = t.uri.replace(/\/$/, "");
|
|
875
875
|
return n(e, r, i, a, o);
|
|
876
876
|
}, []);
|
|
877
|
-
}, Rt = (e) => e ? e.children.map((e) => e instanceof _ ? e.text : e instanceof g ? Rt(e) : "").join("").trim() : "", zt = (e) =>
|
|
877
|
+
}, Rt = (e) => e ? e.children.map((e) => e instanceof _ ? e.text : e instanceof g ? Rt(e) : "").join("").trim() : "", zt = (e) => O(e.properties).includes("nav"), Bt = (e, { basePath: t }) => {
|
|
878
878
|
let n = {
|
|
879
879
|
contents: [],
|
|
880
880
|
path: "",
|
|
@@ -899,7 +899,7 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
899
899
|
let n = e.manifestItems.find(zt);
|
|
900
900
|
if (n?.href) {
|
|
901
901
|
let e = t.records.find((e) => e.uri.endsWith(n.href));
|
|
902
|
-
if (e && !e.dir) return Vt(new h(await
|
|
902
|
+
if (e && !e.dir) return Vt(new h(await E(e)), { basePath: c(e.uri) });
|
|
903
903
|
}
|
|
904
904
|
}, Ut = (e, { basePath: t, prefix: n }) => {
|
|
905
905
|
let r = m(t, e?.childNamed(`${n}content`)?.attr.src || ""), i = {
|
|
@@ -926,11 +926,11 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
926
926
|
let i = e.manifestItems.find((e) => e.id === r);
|
|
927
927
|
if (i) {
|
|
928
928
|
let e = `${t}${t === "" ? "" : "/"}${i.href}`, r = n.records.find((t) => t.uri.endsWith(e));
|
|
929
|
-
if (r && !r.dir) return Wt(new h(await
|
|
929
|
+
if (r && !r.dir) return Wt(new h(await E(r)), { basePath: c(r.uri) });
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
}, Kt = async (e, { opf: t } = {}) => {
|
|
933
|
-
let n = t ?? await
|
|
933
|
+
let n = t ?? await L(e);
|
|
934
934
|
if (n) return await Ht(n.opf, e) || await Gt({
|
|
935
935
|
opf: n.opf,
|
|
936
936
|
opfBasePath: n.basePath,
|
|
@@ -942,7 +942,7 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
942
942
|
"metadata",
|
|
943
943
|
"readingOrder",
|
|
944
944
|
"toc"
|
|
945
|
-
],
|
|
945
|
+
], X = async (e, n) => {
|
|
946
946
|
try {
|
|
947
947
|
return {
|
|
948
948
|
value: await e(),
|
|
@@ -961,7 +961,7 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
961
961
|
let a = [];
|
|
962
962
|
return t !== void 0 && t.value === void 0 && (t.failed || qe(e)) && a.push("opf"), n?.failed && a.push("comicInfo"), r?.failed && a.push("apple"), i?.failed && a.push("kobo"), a;
|
|
963
963
|
}, Xt = 3, Zt = async (e, t = {}) => {
|
|
964
|
-
let n = new Set(t.include ?? qt), r = n.has("metadata"), i = n.has("sources"), a = n.has("readingOrder"), o = n.has("toc"), s = t.layoutScan === !0 && (r || a), c = r || i || a || o ? await
|
|
964
|
+
let n = new Set(t.include ?? qt), r = n.has("metadata"), i = n.has("sources"), a = n.has("readingOrder"), o = n.has("toc"), s = t.layoutScan === !0 && (r || a), c = r || i || a || o ? await X(() => L(e), "opf") : void 0, l = c?.value, u = r || i || s, d = u ? await X(() => Ue(e), "comicInfo") : void 0, f = d?.value, p = u ? await X(() => Re(e), "apple") : void 0, m = p?.value, h = u ? await X(() => We(e), "kobo") : void 0, g = h?.value, _ = r || s ? It({
|
|
965
965
|
opf: l?.opf,
|
|
966
966
|
comicInfo: f,
|
|
967
967
|
apple: m,
|
|
@@ -984,7 +984,7 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
984
984
|
numberOfPages: r
|
|
985
985
|
});
|
|
986
986
|
}
|
|
987
|
-
let y = o ? (await
|
|
987
|
+
let y = o ? (await X(() => Kt(e, { opf: l }), "toc")).value : void 0, b = {
|
|
988
988
|
version: Xt,
|
|
989
989
|
unreadableSources: Yt({
|
|
990
990
|
archive: e,
|
|
@@ -1016,92 +1016,92 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
1016
1016
|
} catch {
|
|
1017
1017
|
return;
|
|
1018
1018
|
}
|
|
1019
|
-
},
|
|
1019
|
+
}, Z = (e, t) => {
|
|
1020
1020
|
let n = en(e);
|
|
1021
1021
|
return n !== void 0 && t(n.hostname.toLowerCase()) ? n : void 0;
|
|
1022
|
-
}, tn = /^books\.google\.(?:com|[a-z]{2}|com\.[a-z]{2}|co\.[a-z]{2})$/i, nn = /* @__PURE__ */ new Set(["books.googleapis.com", "www.googleapis.com"]), rn = /^\/books\/v1\/volumes\/([^/]+)\/?$/i,
|
|
1022
|
+
}, tn = /^books\.google\.(?:com|[a-z]{2}|com\.[a-z]{2}|co\.[a-z]{2})$/i, nn = /* @__PURE__ */ new Set(["books.googleapis.com", "www.googleapis.com"]), rn = /^\/books\/v1\/volumes\/([^/]+)\/?$/i, an = (e) => {
|
|
1023
1023
|
let t = e.trim();
|
|
1024
1024
|
return /^[a-z0-9_-]+$/i.test(t) ? t : void 0;
|
|
1025
|
-
},
|
|
1026
|
-
let t =
|
|
1025
|
+
}, on = (e) => {
|
|
1026
|
+
let t = Z(e, (e) => tn.test(e) || nn.has(e));
|
|
1027
1027
|
if (t !== void 0) {
|
|
1028
1028
|
if (nn.has(t.hostname.toLowerCase())) {
|
|
1029
1029
|
let e = rn.exec(t.pathname)?.[1], n = e === void 0 ? void 0 : $t(e);
|
|
1030
|
-
return n === void 0 ? void 0 :
|
|
1030
|
+
return n === void 0 ? void 0 : an(n);
|
|
1031
1031
|
}
|
|
1032
|
-
return
|
|
1032
|
+
return an(t.searchParams.get("id") ?? "");
|
|
1033
1033
|
}
|
|
1034
|
-
},
|
|
1034
|
+
}, sn = /* @__PURE__ */ new Set(["gutenberg.org", "www.gutenberg.org"]), cn = [
|
|
1035
1035
|
/^\/ebooks\/(\d+)(?:[./]|$)/i,
|
|
1036
1036
|
/^\/files\/(\d+)(?:\/|$)/i,
|
|
1037
1037
|
/^\/cache\/epub\/(\d+)(?:\/|$)/i,
|
|
1038
1038
|
/^\/(\d+)(?:\/|$)/
|
|
1039
|
-
],
|
|
1039
|
+
], ln = (e) => {
|
|
1040
1040
|
let t = e.trim();
|
|
1041
1041
|
if (!/^\d+$/.test(t)) return;
|
|
1042
1042
|
let n = t.replace(/^0+(?=\d)/, "");
|
|
1043
1043
|
return n === "0" ? void 0 : n;
|
|
1044
|
-
},
|
|
1045
|
-
let t =
|
|
1046
|
-
if (t !== void 0) for (let e of
|
|
1044
|
+
}, un = (e) => {
|
|
1045
|
+
let t = Z(e, (e) => sn.has(e));
|
|
1046
|
+
if (t !== void 0) for (let e of cn) {
|
|
1047
1047
|
let n = e.exec(t.pathname)?.[1];
|
|
1048
|
-
if (n !== void 0) return
|
|
1048
|
+
if (n !== void 0) return ln(n);
|
|
1049
1049
|
}
|
|
1050
|
-
},
|
|
1050
|
+
}, dn = /* @__PURE__ */ new Set(["openlibrary.org", "www.openlibrary.org"]), fn = /^\/(works|books|authors)\/(OL\d+[A-Z])(?:\/|$)/i, pn = /^OL\d+([MWA])$/i, mn = {
|
|
1051
1051
|
M: "books",
|
|
1052
1052
|
W: "works",
|
|
1053
1053
|
A: "authors"
|
|
1054
|
-
},
|
|
1055
|
-
let t = e.trim(), n =
|
|
1054
|
+
}, hn = (e) => {
|
|
1055
|
+
let t = e.trim(), n = fn.exec(t);
|
|
1056
1056
|
if (n?.[1] !== void 0 && n[2] !== void 0) return `/${n[1].toLowerCase()}/${n[2].toUpperCase()}`;
|
|
1057
|
-
let r = pn
|
|
1057
|
+
let r = mn[pn.exec(t)?.[1]?.toUpperCase() ?? ""];
|
|
1058
1058
|
return r === void 0 ? void 0 : `/${r}/${t.toUpperCase()}`;
|
|
1059
|
-
},
|
|
1060
|
-
let t =
|
|
1061
|
-
return t === void 0 ? void 0 :
|
|
1062
|
-
},
|
|
1059
|
+
}, gn = (e) => {
|
|
1060
|
+
let t = Z(e, (e) => dn.has(e));
|
|
1061
|
+
return t === void 0 ? void 0 : hn(t.pathname);
|
|
1062
|
+
}, _n = /* @__PURE__ */ new Set([
|
|
1063
1063
|
"doi.org",
|
|
1064
1064
|
"dx.doi.org",
|
|
1065
1065
|
"www.doi.org"
|
|
1066
|
-
]),
|
|
1066
|
+
]), vn = /^10\.\d{4,9}\/\S+$/, yn = (e) => {
|
|
1067
1067
|
let t = e.trim().replace(/^doi:/i, "");
|
|
1068
|
-
return
|
|
1069
|
-
},
|
|
1068
|
+
return vn.test(t) ? t : void 0;
|
|
1069
|
+
}, bn = (e) => e.split("/").map(encodeURIComponent).join("/"), Q = [
|
|
1070
1070
|
{
|
|
1071
1071
|
scheme: "GoogleBooks",
|
|
1072
|
-
normalizeValue:
|
|
1073
|
-
valueFromUrl:
|
|
1072
|
+
normalizeValue: an,
|
|
1073
|
+
valueFromUrl: on,
|
|
1074
1074
|
toUrl: (e) => `https://books.google.com/books?id=${encodeURIComponent(e)}`
|
|
1075
1075
|
},
|
|
1076
1076
|
{
|
|
1077
1077
|
scheme: "ProjectGutenberg",
|
|
1078
|
-
normalizeValue:
|
|
1079
|
-
valueFromUrl:
|
|
1078
|
+
normalizeValue: ln,
|
|
1079
|
+
valueFromUrl: un,
|
|
1080
1080
|
toUrl: (e) => `https://www.gutenberg.org/ebooks/${e}`
|
|
1081
1081
|
},
|
|
1082
1082
|
{
|
|
1083
1083
|
scheme: "OpenLibrary",
|
|
1084
|
-
normalizeValue:
|
|
1085
|
-
valueFromUrl:
|
|
1084
|
+
normalizeValue: hn,
|
|
1085
|
+
valueFromUrl: gn,
|
|
1086
1086
|
toUrl: (e) => `https://openlibrary.org${e}`
|
|
1087
1087
|
},
|
|
1088
1088
|
{
|
|
1089
1089
|
scheme: "DOI",
|
|
1090
|
-
normalizeValue:
|
|
1090
|
+
normalizeValue: yn,
|
|
1091
1091
|
valueFromUrl: (e) => {
|
|
1092
|
-
let t =
|
|
1093
|
-
return n === void 0 ? void 0 :
|
|
1092
|
+
let t = Z(e, (e) => _n.has(e)), n = t === void 0 ? void 0 : $t(t.pathname.replace(/^\//, ""));
|
|
1093
|
+
return n === void 0 ? void 0 : yn(n);
|
|
1094
1094
|
},
|
|
1095
|
-
toUrl: (e) => `https://doi.org/${
|
|
1095
|
+
toUrl: (e) => `https://doi.org/${bn(e)}`
|
|
1096
1096
|
}
|
|
1097
|
-
],
|
|
1097
|
+
], xn = Q.map(function(e) {
|
|
1098
1098
|
return e.scheme;
|
|
1099
|
-
}),
|
|
1099
|
+
}), Sn = (e) => {
|
|
1100
1100
|
let t = e.trim().toLowerCase();
|
|
1101
1101
|
return Q.find(function(e) {
|
|
1102
1102
|
return e.scheme.toLowerCase() === t;
|
|
1103
1103
|
});
|
|
1104
|
-
},
|
|
1104
|
+
}, Cn = (e) => Sn(e) !== void 0, wn = (e) => {
|
|
1105
1105
|
for (let t of Q) {
|
|
1106
1106
|
let n = t.valueFromUrl(e);
|
|
1107
1107
|
if (n !== void 0) return {
|
|
@@ -1109,32 +1109,35 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
1109
1109
|
scheme: t.scheme
|
|
1110
1110
|
};
|
|
1111
1111
|
}
|
|
1112
|
-
},
|
|
1113
|
-
let n =
|
|
1112
|
+
}, Tn = ({ scheme: e, value: t }) => {
|
|
1113
|
+
let n = Sn(e), r = n?.normalizeValue(t);
|
|
1114
1114
|
if (n === void 0 || r === void 0) return;
|
|
1115
1115
|
let i = n.toUrl(r);
|
|
1116
1116
|
return n.valueFromUrl(i) === r ? i : void 0;
|
|
1117
|
-
},
|
|
1117
|
+
}, En = (e) => {
|
|
1118
1118
|
let t = Q.find(function(t) {
|
|
1119
1119
|
return t.scheme === e;
|
|
1120
1120
|
});
|
|
1121
1121
|
if (t === void 0) throw Error(`No catalog rule for scheme ${e}`);
|
|
1122
1122
|
return t;
|
|
1123
|
-
},
|
|
1124
|
-
|
|
1123
|
+
}, Dn = (e) => {
|
|
1124
|
+
let t = q(e);
|
|
1125
|
+
return t === "ISBN" || t === "GTIN";
|
|
1126
|
+
}, On = (e) => ({
|
|
1127
|
+
carries: Dn,
|
|
1125
1128
|
normalizeValue: e
|
|
1126
1129
|
}), $ = (e) => ({
|
|
1127
|
-
carries: (t) => t
|
|
1128
|
-
...
|
|
1129
|
-
}),
|
|
1130
|
-
ISBN:
|
|
1131
|
-
GTIN:
|
|
1130
|
+
carries: (t) => q(t) === e,
|
|
1131
|
+
...En(e)
|
|
1132
|
+
}), kn = {
|
|
1133
|
+
ISBN: On(ht),
|
|
1134
|
+
GTIN: On(_t),
|
|
1132
1135
|
GoogleBooks: $("GoogleBooks"),
|
|
1133
1136
|
OpenLibrary: $("OpenLibrary"),
|
|
1134
1137
|
ProjectGutenberg: $("ProjectGutenberg"),
|
|
1135
1138
|
DOI: $("DOI")
|
|
1136
|
-
},
|
|
1137
|
-
let n =
|
|
1139
|
+
}, An = (e, t) => {
|
|
1140
|
+
let n = kn[t];
|
|
1138
1141
|
for (let t of e ?? []) {
|
|
1139
1142
|
if (n.carries(t.scheme)) {
|
|
1140
1143
|
let e = n.normalizeValue(t.value) ?? n.valueFromUrl?.(t.value);
|
|
@@ -1145,8 +1148,8 @@ var Ge = async ({ archive: e, archiveOpf: t }) => {
|
|
|
1145
1148
|
let e = n.valueFromUrl(t.value);
|
|
1146
1149
|
if (e !== void 0) return e;
|
|
1147
1150
|
}
|
|
1148
|
-
},
|
|
1151
|
+
}, jn = (e) => e?.titles?.[0]?.value;
|
|
1149
1152
|
//#endregion
|
|
1150
|
-
export {
|
|
1153
|
+
export { R as APPLE_IBOOKS_DISPLAY_OPTIONS_FILENAME, z as COMIC_INFO_FILENAME, _e as COMIC_INFO_KNOWN_FIELDS, Ve as COMIC_INFO_MANGA_VALUES, Se as KOBO_DISPLAY_OPTIONS_FILENAME, xn as METADATA_CATALOG_SCHEMES, i as arrayBufferFileAccessors, r as blobFileAccessors, wn as catalogIdentifierFromUrl, Tn as catalogUrlFromIdentifier, e as createArchive, v as createArchiveFromArrayBufferList, n as createArchiveFromEntries, y as createArchiveFromText, b as createArchiveFromUrls, S as getArchiveFileRecordByUri, Be as getArchiveHasComicInfo, T as getArchiveImageRecords, D as getArchiveOpfInfo, Ge as getSpineItemFilesFromArchive, An as identifierValue, qe as isArchiveEpub, He as isComicInfoManga, ee as isDirectoryRecord, x as isFileRecord, w as isImageRecord, Dn as isIsbnBearingScheme, Cn as isMetadataCatalogScheme, jn as mainTitle, _t as normalizeGtin, q as normalizeIdentifierScheme, mt as normalizeIsbn, ge as parseAppleDisplayOptionsXml, xe as parseComicInfo, we as parseKoboXml, me as parseOpf, yt as parseW3cDtfDate, Re as readArchiveApple, Ue as readArchiveComicInfo, We as readArchiveKobo, L as readArchiveOpf, E as readRecordAsText, Ie as readingOrderDocumentsAllHaveViewport, Zt as resolveArchive, Pe as resolveArchiveCover, Ft as resolveArchiveMetadata, V as resolveArchiveReadingOrder, Kt as resolveArchiveToc, It as resolveMetadata, O as tokenizeXmlSpaceSeparatedList };
|
|
1151
1154
|
|
|
1152
1155
|
//# sourceMappingURL=index.js.map
|