@readium/shared 2.1.2 → 2.1.4
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/ar-DyHX_uy2.js +7 -0
- package/dist/da-Dct0PS3E.js +7 -0
- package/dist/fr-C5HEel98.js +7 -0
- package/dist/index.js +1020 -963
- package/dist/index.umd.cjs +3 -3
- package/dist/it-DFOBoXGy.js +7 -0
- package/dist/pt_PT-Di3sVjze.js +7 -0
- package/dist/sv-BfzAFsVN.js +7 -0
- package/package.json +17 -13
- package/src/publication/LocalizedString.ts +1 -1
- package/src/publication/accessibility/Localization.md +39 -10
- package/src/publication/accessibility/Localization.ts +88 -18
- package/src/publication/accessibility/SupportedLanguages.ts +1 -0
- package/types/src/publication/LocalizedString.d.ts +1 -1
- package/types/src/publication/accessibility/Localization.d.ts +15 -6
- package/types/src/publication/accessibility/SupportedLanguages.d.ts +1 -0
- package/src/publication/accessibility/locales/en.json +0 -231
- package/src/publication/accessibility/locales/fr.json +0 -231
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class ti {
|
|
2
2
|
close() {
|
|
3
3
|
}
|
|
4
4
|
links() {
|
|
@@ -8,7 +8,7 @@ class je {
|
|
|
8
8
|
throw Error("This is an empty fetcher");
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
class
|
|
11
|
+
class tr {
|
|
12
12
|
constructor(t, e) {
|
|
13
13
|
this.client = t || window.fetch.bind(window), this.baseUrl = e;
|
|
14
14
|
}
|
|
@@ -19,12 +19,12 @@ class en {
|
|
|
19
19
|
const e = t.toURL(this.baseUrl);
|
|
20
20
|
if (e === void 0)
|
|
21
21
|
throw Error(`Invalid HREF: ${t.href}`);
|
|
22
|
-
return new
|
|
22
|
+
return new ei(this.client, t, e);
|
|
23
23
|
}
|
|
24
24
|
close() {
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
class
|
|
27
|
+
class ei {
|
|
28
28
|
constructor(t, e, i) {
|
|
29
29
|
this.client = t || window.fetch.bind(window), this._link = e, this.url = i;
|
|
30
30
|
}
|
|
@@ -88,12 +88,12 @@ class ti {
|
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
class
|
|
91
|
+
class er {
|
|
92
92
|
constructor(t, e) {
|
|
93
93
|
this.start = t, this.endInclusive = e;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
class
|
|
96
|
+
class ir {
|
|
97
97
|
readAsString() {
|
|
98
98
|
return this.read().then((t) => t === void 0 ? t : new TextDecoder().decode(t));
|
|
99
99
|
}
|
|
@@ -104,7 +104,7 @@ class nn {
|
|
|
104
104
|
return this.readAsString().then((t) => t === void 0 ? t : new DOMParser().parseFromString(t, "text/xml"));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
class
|
|
107
|
+
class _ {
|
|
108
108
|
constructor(t = {}) {
|
|
109
109
|
this.conformsTo = t.conformsTo ?? [], this.certification = t.certification ?? null, this.summary = t.summary ?? null, this.accessMode = t.accessMode ?? [], this.accessModeSufficient = t.accessModeSufficient ?? [], this.feature = t.feature ?? [], this.hazard = t.hazard ?? [], this.exemption = t.exemption ?? [];
|
|
110
110
|
}
|
|
@@ -114,13 +114,13 @@ class V {
|
|
|
114
114
|
static deserialize(t) {
|
|
115
115
|
if (!t || typeof t != "object") return;
|
|
116
116
|
const e = t;
|
|
117
|
-
return new
|
|
118
|
-
conformsTo: e.conformsTo ? e.conformsTo.map((i) =>
|
|
119
|
-
certification: e.certification ?
|
|
117
|
+
return new _({
|
|
118
|
+
conformsTo: e.conformsTo ? e.conformsTo.map((i) => Tt.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
119
|
+
certification: e.certification ? Pt.deserialize(e.certification) : void 0,
|
|
120
120
|
summary: e.summary,
|
|
121
|
-
accessMode: e.accessMode ? e.accessMode.map((i) =>
|
|
122
|
-
accessModeSufficient: e.accessModeSufficient ? e.accessModeSufficient.map((i) =>
|
|
123
|
-
feature: e.feature ? e.feature.map((i) =>
|
|
121
|
+
accessMode: e.accessMode ? e.accessMode.map((i) => R.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
122
|
+
accessModeSufficient: e.accessModeSufficient ? e.accessModeSufficient.map((i) => It.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
123
|
+
feature: e.feature ? e.feature.map((i) => A.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
124
124
|
hazard: e.hazard ? e.hazard.map((i) => P.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
125
125
|
exemption: e.exemption ? e.exemption.map((i) => xt.deserialize(i)).filter((i) => i !== void 0) : void 0
|
|
126
126
|
});
|
|
@@ -170,8 +170,8 @@ const b = class b {
|
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
b.EPUB_A11Y_10_WCAG_20_A = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), b.EPUB_A11Y_10_WCAG_20_AA = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), b.EPUB_A11Y_10_WCAG_20_AAA = new b("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), b.EPUB_A11Y_11_WCAG_20_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), b.EPUB_A11Y_11_WCAG_20_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), b.EPUB_A11Y_11_WCAG_20_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), b.EPUB_A11Y_11_WCAG_21_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), b.EPUB_A11Y_11_WCAG_21_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), b.EPUB_A11Y_11_WCAG_21_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), b.EPUB_A11Y_11_WCAG_22_A = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), b.EPUB_A11Y_11_WCAG_22_AA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), b.EPUB_A11Y_11_WCAG_22_AAA = new b("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
|
|
173
|
-
let
|
|
174
|
-
class
|
|
173
|
+
let Tt = b;
|
|
174
|
+
class Pt {
|
|
175
175
|
constructor(t = null, e = null, i = null) {
|
|
176
176
|
this.certifiedBy = t, this.credential = e, this.report = i;
|
|
177
177
|
}
|
|
@@ -180,7 +180,7 @@ class Rt {
|
|
|
180
180
|
*/
|
|
181
181
|
static deserialize(t) {
|
|
182
182
|
if (!(!t || typeof t != "object"))
|
|
183
|
-
return new
|
|
183
|
+
return new Pt(
|
|
184
184
|
t.certifiedBy,
|
|
185
185
|
t.credential,
|
|
186
186
|
t.report
|
|
@@ -194,7 +194,7 @@ class Rt {
|
|
|
194
194
|
return this.certifiedBy && (t.certifiedBy = this.certifiedBy), this.credential && (t.credential = this.credential), this.report && (t.report = this.report), t;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
const
|
|
197
|
+
const y = class y {
|
|
198
198
|
constructor(t) {
|
|
199
199
|
this.value = t;
|
|
200
200
|
}
|
|
@@ -203,7 +203,7 @@ const w = class w {
|
|
|
203
203
|
*/
|
|
204
204
|
static deserialize(t) {
|
|
205
205
|
if (!(!t || typeof t != "string"))
|
|
206
|
-
return new
|
|
206
|
+
return new y(t);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* Serializes an [AccessMode] to its RWPM JSON representation.
|
|
@@ -212,17 +212,17 @@ const w = class w {
|
|
|
212
212
|
return this.value;
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
|
-
|
|
216
|
-
let
|
|
217
|
-
const
|
|
215
|
+
y.AUDITORY = new y("auditory"), y.CHART_ON_VISUAL = new y("chartOnVisual"), y.CHEM_ON_VISUAL = new y("chemOnVisual"), y.COLOR_DEPENDENT = new y("colorDependent"), y.DIAGRAM_ON_VISUAL = new y("diagramOnVisual"), y.MATH_ON_VISUAL = new y("mathOnVisual"), y.MUSIC_ON_VISUAL = new y("musicOnVisual"), y.TACTILE = new y("tactile"), y.TEXT_ON_VISUAL = new y("textOnVisual"), y.TEXTUAL = new y("textual"), y.VISUAL = new y("visual");
|
|
216
|
+
let R = y;
|
|
217
|
+
const x = class x {
|
|
218
218
|
constructor(t) {
|
|
219
219
|
if (typeof t == "string") {
|
|
220
|
-
if (!
|
|
220
|
+
if (!x.VALID_MODES.has(t.toLowerCase()))
|
|
221
221
|
return;
|
|
222
222
|
this.value = t.toLowerCase();
|
|
223
223
|
} else {
|
|
224
224
|
const e = t.filter(
|
|
225
|
-
(i) =>
|
|
225
|
+
(i) => x.VALID_MODES.has(i.toLowerCase())
|
|
226
226
|
);
|
|
227
227
|
if (e.length === 0)
|
|
228
228
|
return;
|
|
@@ -235,11 +235,11 @@ const I = class I {
|
|
|
235
235
|
static deserialize(t) {
|
|
236
236
|
if (!t) return;
|
|
237
237
|
if (typeof t == "string")
|
|
238
|
-
return new
|
|
238
|
+
return new x(t);
|
|
239
239
|
if (!Array.isArray(t)) return;
|
|
240
|
-
const e = t.filter((i) => i ?
|
|
240
|
+
const e = t.filter((i) => i ? x.VALID_MODES.has(i.toLowerCase()) : !1);
|
|
241
241
|
if (e.length !== 0)
|
|
242
|
-
return new
|
|
242
|
+
return new x(e);
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
245
245
|
* Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
|
|
@@ -248,8 +248,8 @@ const I = class I {
|
|
|
248
248
|
return this.value;
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
|
|
252
|
-
let
|
|
251
|
+
x.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), x.AUDITORY = new x("auditory"), x.TACTILE = new x("tactile"), x.TEXTUAL = new x("textual"), x.VISUAL = new x("visual");
|
|
252
|
+
let It = x;
|
|
253
253
|
const l = class l {
|
|
254
254
|
constructor(t) {
|
|
255
255
|
this.value = t;
|
|
@@ -269,8 +269,8 @@ const l = class l {
|
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
271
|
l.NONE = new l("none"), l.ANNOTATIONS = new l("annotations"), l.ARIA = new l("ARIA"), l.INDEX = new l("index"), l.PAGE_BREAK_MARKERS = new l("pageBreakMarkers"), l.PAGE_NAVIGATION = new l("pageNavigation"), l.PRINT_PAGE_NUMBERS = new l("printPageNumbers"), l.READING_ORDER = new l("readingOrder"), l.STRUCTURAL_NAVIGATION = new l("structuralNavigation"), l.TABLE_OF_CONTENTS = new l("tableOfContents"), l.TAGGED_PDF = new l("taggedPDF"), l.ALTERNATIVE_TEXT = new l("alternativeText"), l.AUDIO_DESCRIPTION = new l("audioDescription"), l.CAPTIONS = new l("captions"), l.CLOSED_CAPTIONS = new l("closedCaptions"), l.DESCRIBED_MATH = new l("describedMath"), l.LONG_DESCRIPTION = new l("longDescription"), l.OPEN_CAPTIONS = new l("openCaptions"), l.SIGN_LANGUAGE = new l("signLanguage"), l.TRANSCRIPT = new l("transcript"), l.DISPLAY_TRANSFORMABILITY = new l("displayTransformability"), l.SYNCHRONIZED_AUDIO_TEXT = new l("synchronizedAudioText"), l.TIMING_CONTROL = new l("timingControl"), l.UNLOCKED = new l("unlocked"), l.CHEM_ML = new l("ChemML"), l.LATEX = new l("latex"), l.LATEX_CHEMISTRY = new l("latex-chemistry"), l.MATH_ML = new l("MathML"), l.MATH_ML_CHEMISTRY = new l("MathML-chemistry"), l.TTS_MARKUP = new l("ttsMarkup"), l.HIGH_CONTRAST_AUDIO = new l("highContrastAudio"), l.HIGH_CONTRAST_DISPLAY = new l("highContrastDisplay"), l.LARGE_PRINT = new l("largePrint"), l.BRAILLE = new l("braille"), l.TACTILE_GRAPHIC = new l("tactileGraphic"), l.TACTILE_OBJECT = new l("tactileObject"), l.FULL_RUBY_ANNOTATIONS = new l("fullRubyAnnotations"), l.HORIZONTAL_WRITING = new l("horizontalWriting"), l.RUBY_ANNOTATIONS = new l("rubyAnnotations"), l.VERTICAL_WRITING = new l("verticalWriting"), l.WITH_ADDITIONAL_WORD_SEGMENTATION = new l("withAdditionalWordSegmentation"), l.WITHOUT_ADDITIONAL_WORD_SEGMENTATION = new l("withoutAdditionalWordSegmentation");
|
|
272
|
-
let
|
|
273
|
-
const
|
|
272
|
+
let A = l;
|
|
273
|
+
const w = class w {
|
|
274
274
|
constructor(t) {
|
|
275
275
|
this.value = t;
|
|
276
276
|
}
|
|
@@ -279,7 +279,7 @@ const y = class y {
|
|
|
279
279
|
*/
|
|
280
280
|
static deserialize(t) {
|
|
281
281
|
if (!(!t || typeof t != "string"))
|
|
282
|
-
return new
|
|
282
|
+
return new w(t);
|
|
283
283
|
}
|
|
284
284
|
/**
|
|
285
285
|
* Serializes a [Hazard] to its RWPM JSON representation.
|
|
@@ -288,8 +288,8 @@ const y = class y {
|
|
|
288
288
|
return this.value;
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
|
-
|
|
292
|
-
let P =
|
|
291
|
+
w.FLASHING = new w("flashing"), w.NO_FLASHING_HAZARD = new w("noFlashingHazard"), w.UNKNOWN_FLASHING_HAZARD = new w("unknownFlashingHazard"), w.MOTION_SIMULATION = new w("motionSimulation"), w.NO_MOTION_SIMULATION_HAZARD = new w("noMotionSimulationHazard"), w.UNKNOWN_MOTION_SIMULATION_HAZARD = new w("unknownMotionSimulationHazard"), w.SOUND = new w("sound"), w.NO_SOUND_HAZARD = new w("noSoundHazard"), w.UNKNOWN_SOUND_HAZARD = new w("unknownSoundHazard"), w.UNKNOWN = new w("unknown"), w.NONE = new w("none");
|
|
292
|
+
let P = w;
|
|
293
293
|
const S = class S {
|
|
294
294
|
constructor(t) {
|
|
295
295
|
this.value = t;
|
|
@@ -310,34 +310,45 @@ const S = class S {
|
|
|
310
310
|
};
|
|
311
311
|
S.NONE = new S("none"), S.DOCUMENTED = new S("documented"), S.LEGAL = new S("legal"), S.TEMPORARY = new S("temporary"), S.TECHNICAL = new S("technical"), S.EAA_DISPROPORTIONATE_BURDEN = new S("eaa-disproportionate-burden"), S.EAA_FUNDAMENTAL_ALTERATION = new S("eaa-fundamental-alteration"), S.EAA_MICROENTERPRISE = new S("eaa-microenterprise"), S.EAA_TECHNICAL_IMPOSSIBILITY = new S("eaa-technical-impossibility"), S.EAA_TEMPORARY = new S("eaa-temporary");
|
|
312
312
|
let xt = S;
|
|
313
|
-
const ei = { title: "Conformance", "details-title": "Detailed conformance information", a: { compact: "This publication meets minimum accessibility standards", descriptive: "The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level A standard" }, aa: { compact: "This publication meets accepted accessibility standards", descriptive: "The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AA standard" }, aaa: { compact: "This publication exceeds accepted accessibility standards", descriptive: "The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AAA standard" }, no: "No information is available", "unknown-standard": "Conformance to accepted standards for accessibility of this publication cannot be determined", certifier: "The publication was certified by ", "certifier-credentials": "The certifier's credential is ", details: { "certification-info": "The publication was certified on ", "certifier-report": "For more information refer to the certifier's report", claim: "This publication claims to meet", "epub-accessibility-1-0": "EPUB Accessibility 1.0", "epub-accessibility-1-1": "EPUB Accessibility 1.1", "level-a": "Level A", "level-aa": "Level AA", "level-aaa": "Level AAA", "wcag-2-0": { compact: "WCAG 2.0", descriptive: "Web Content Accessibility Guidelines (WCAG) 2.0" }, "wcag-2-1": { compact: "WCAG 2.1", descriptive: "Web Content Accessibility Guidelines (WCAG) 2.1" }, "wcag-2-2": { compact: "WCAG 2.2", descriptive: "Web Content Accessibility Guidelines (WCAG) 2.2" } } }, ii = { title: "Navigation", index: { compact: "Index", descriptive: "Index with links to referenced entries" }, "no-metadata": "No information is available", "page-navigation": { compact: "Go to page", descriptive: "Page list to go to pages from the print source version" }, structural: { compact: "Headings", descriptive: "Elements such as headings, tables, etc for structured navigation" }, toc: { compact: "Table of contents", descriptive: "Table of contents to all chapters of the text via links" } }, si = { title: "Hazards", flashing: { compact: "Flashing content", descriptive: "The publication contains flashing content that can cause photosensitive seizures" }, "flashing-none": { compact: "No flashing hazards", descriptive: "The publication does not contain flashing content that can cause photosensitive seizures" }, "flashing-unknown": { compact: "Flashing hazards not known", descriptive: "The presence of flashing content that can cause photosensitive seizures could not be determined" }, motion: { compact: "Motion simulation", descriptive: "The publication contains motion simulations that can cause motion sickness" }, "motion-none": { compact: "No motion simulation hazards", descriptive: "The publication does not contain motion simulations that can cause motion sickness" }, "motion-unknown": { compact: "Motion simulation hazards not known", descriptive: "The presence of motion simulations that can cause motion sickness could not be determined" }, "no-metadata": "No information is available", none: { compact: "No hazards", descriptive: "The publication contains no hazards" }, sound: { compact: "Sounds", descriptive: "The publication contains sounds that can cause sensitivity issues" }, "sound-none": { compact: "No sound hazards", descriptive: "The publication does not contain sounds that can cause sensitivity issues" }, "sound-unknown": { compact: "Sound hazards not known", descriptive: "The presence of sounds that can cause sensitivity issues could not be determined" }, unknown: "The presence of hazards is unknown" }, ee = {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
"accessibility-summary": { title: "Informations d'accessibilité supplémentaires fournies par l'éditeur", "no-metadata": "Aucune information disponible", "publisher-contact": "Pour plus d'information à propos de l'accessibilité de cette publication, veuillez contacter l'éditeur : " },
|
|
329
|
-
"legal-considerations": { title: "Considérations légales", exempt: { compact: "Déclare être sous le coup d'une exemption dans certaines juridictions", descriptive: "Cette publication dééclare être sous le coup d'une exemption dans certaines juridictions" }, "no-metadata": "Aucune information disponible" },
|
|
330
|
-
"additional-accessibility-information": { title: "Informations complémentaires sur l'accessibilité", aria: { compact: "Information enrichie pour les technologies d'assistances", descriptive: "La structure est enrichi de rôles ARIA afin d'optimiser l'organisation et de faciliter la navigation via les technologies d'assistances" }, "audio-descriptions": "Description audio", braille: "Braille", "color-not-sole-means-of-conveying-information": "La couleur n'est pas la seule manière de communiquer de l'information", "dyslexia-readability": "Lisibilité adapté aux publics dys", "full-ruby-annotations": "Annotations complètes au format ruby (langues asiatiques)", "high-contrast-between-foreground-and-background-audio": "Contraste sonore amélioré entre les différents plans", "high-contrast-between-text-and-background": "Contraste élevé entre le texte et l'arrière-plan", "large-print": "Grands caractères", "page-breaks": { compact: "Pagination identique à l'imprimé", descriptive: "Contient une pagination identique à la version imprimée" }, "ruby-annotations": "Annotations partielles au format ruby (langues asiatiques)", "sign-language": "Langue des signes", "tactile-graphics": { compact: "Graphiques tactiles", descriptive: "Des graphiques tactiles ont été intégrés pour faciliter l'accès des personnes aveugles aux éléments visuels" }, "tactile-objects": "Objets 3D ou tactiles", "text-to-speech-hinting": "Prononciation améliorée pour la synthèse vocale", "ultra-high-contrast-between-text-and-background": "Contraste très élevé entre le texte et l'arrière-plan", "visible-page-numbering": "Numérotation de page visible", "without-background-sounds": "Aucun bruit de fond" }
|
|
331
|
-
};
|
|
332
|
-
class $ {
|
|
313
|
+
const ee = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], ii = /* @__PURE__ */ JSON.parse(`{"format":{"audiobook":"Audiobook","audiobookJSON":"Audiobook Manifest","cbz":"Comic Book Archive","divina":"Divina Publication","divinaJSON":"Divina Publication Manifest","epub":"EPUB","lcpa":"LCP Protected Audiobook","lcpdf":"LCP Protected PDF","lcpl":"LCP License Document","pdf":"PDF","rwp":"Readium Web Publication","rwpm":"Readium Web Publication Manifest","zab":"Audiobook Archive","zip":"ZIP Archive"},"kind":{"audiobook_one":"audiobook","audiobook_other":"audiobooks","book_one":"book","book_other":"books","comic_one":"comic","comic_other":"comics","document_one":"document","document_other":"documents"},"metadata":{"accessibility":{"display-guide":{"accessibility-summary":{"no-metadata":"No information is available","publisher-contact":"For more information about the accessibility of this product, please contact the publisher: ","title":"Accessibility summary"},"additional-accessibility-information":{"aria":{"compact":"ARIA roles included","descriptive":"Content is enhanced with ARIA roles to optimize organization and facilitate navigation"},"audio-descriptions":"Audio descriptions","braille":"Braille","color-not-sole-means-of-conveying-information":"Color is not the sole means of conveying information","dyslexia-readability":"Dyslexia readability","full-ruby-annotations":"Full ruby annotations","high-contrast-between-foreground-and-background-audio":"High contrast between foreground and background audio","high-contrast-between-text-and-background":"High contrast between foreground text and background","large-print":"Large print","page-breaks":{"compact":"Page breaks included","descriptive":"Page breaks included from the original print source"},"ruby-annotations":"Some Ruby annotations","sign-language":"Sign language","tactile-graphics":{"compact":"Tactile graphics included","descriptive":"Tactile graphics have been integrated to facilitate access to visual elements for blind people"},"tactile-objects":"Tactile 3D objects","text-to-speech-hinting":"Text-to-speech hinting provided","title":"Additional accessibility information","ultra-high-contrast-between-text-and-background":"Ultra high contrast between text and background","visible-page-numbering":"Visible page numbering","without-background-sounds":"Without background sounds"},"conformance":{"a":{"compact":"This publication meets minimum accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level A standard"},"aa":{"compact":"This publication meets accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AA standard"},"aaa":{"compact":"This publication exceeds accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AAA standard"},"certifier":"The publication was certified by ","certifier-credentials":"The certifier's credential is ","details":{"certification-info":"The publication was certified on ","certifier-report":"For more information refer to the certifier's report","claim":"This publication claims to meet","epub-accessibility-1-0":"EPUB Accessibility 1.0","epub-accessibility-1-1":"EPUB Accessibility 1.1","level-a":"Level A","level-aa":"Level AA","level-aaa":"Level AAA","wcag-2-0":{"compact":"WCAG 2.0","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.0"},"wcag-2-1":{"compact":"WCAG 2.1","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.1"},"wcag-2-2":{"compact":"WCAG 2.2","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.2"}},"details-title":"Detailed conformance information","no":"No information is available","title":"Conformance","unknown-standard":"Conformance to accepted standards for accessibility of this publication cannot be determined"},"hazards":{"flashing":{"compact":"Flashing content","descriptive":"The publication contains flashing content that can cause photosensitive seizures"},"flashing-none":{"compact":"No flashing hazards","descriptive":"The publication does not contain flashing content that can cause photosensitive seizures"},"flashing-unknown":{"compact":"Flashing hazards not known","descriptive":"The presence of flashing content that can cause photosensitive seizures could not be determined"},"motion":{"compact":"Motion simulation","descriptive":"The publication contains motion simulations that can cause motion sickness"},"motion-none":{"compact":"No motion simulation hazards","descriptive":"The publication does not contain motion simulations that can cause motion sickness"},"motion-unknown":{"compact":"Motion simulation hazards not known","descriptive":"The presence of motion simulations that can cause motion sickness could not be determined"},"no-metadata":"No information is available","none":{"compact":"No hazards","descriptive":"The publication contains no hazards"},"sound":{"compact":"Sounds","descriptive":"The publication contains sounds that can cause sensitivity issues"},"sound-none":{"compact":"No sound hazards","descriptive":"The publication does not contain sounds that can cause sensitivity issues"},"sound-unknown":{"compact":"Sound hazards not known","descriptive":"The presence of sounds that can cause sensitivity issues could not be determined"},"title":"Hazards","unknown":"The presence of hazards is unknown"},"legal-considerations":{"exempt":{"compact":"Claims an accessibility exemption in some jurisdictions","descriptive":"This publication claims an accessibility exemption in some jurisdictions"},"no-metadata":"No information is available","title":"Legal considerations"},"navigation":{"index":{"compact":"Index","descriptive":"Index with links to referenced entries"},"no-metadata":"No information is available","page-navigation":{"compact":"Go to page","descriptive":"Page list to go to pages from the print source version"},"structural":{"compact":"Headings","descriptive":"Elements such as headings, tables, etc for structured navigation"},"title":"Navigation","toc":{"compact":"Table of contents","descriptive":"Table of contents to all chapters of the text via links"}},"rich-content":{"accessible-chemistry-as-latex":{"compact":"Chemical formulas in LaTeX","descriptive":"Chemical formulas in accessible format (LaTeX)"},"accessible-chemistry-as-mathml":{"compact":"Chemical formulas in MathML","descriptive":"Chemical formulas in accessible format (MathML)"},"accessible-math-as-latex":{"compact":"Math as LaTeX","descriptive":"Math formulas in accessible format (LaTeX)"},"accessible-math-described":"Text descriptions of math are provided","closed-captions":{"compact":"Videos have closed captions","descriptive":"Videos included in publications have closed captions"},"extended-descriptions":"Information-rich images are described by extended descriptions","math-as-mathml":{"compact":"Math as MathML","descriptive":"Math formulas in accessible format (MathML)"},"open-captions":{"compact":"Videos have open captions","descriptive":"Videos included in publications have open captions"},"title":"Rich content","transcript":"Transcript(s) provided","unknown":"No information is available"},"ways-of-reading":{"nonvisual-reading":{"alt-text":{"compact":"Has alternative text","descriptive":"Has alternative text descriptions for images"},"no-metadata":"No information about nonvisual reading is available","none":{"compact":"Not readable in read aloud or dynamic braille","descriptive":"The content is not readable as read aloud speech or dynamic braille"},"not-fully":{"compact":"Not fully readable in read aloud or dynamic braille","descriptive":"Not all of the content will be readable as read aloud speech or dynamic braille"},"readable":{"compact":"Readable in read aloud or dynamic braille","descriptive":"All content can be read as read aloud speech or dynamic braille"}},"prerecorded-audio":{"complementary":{"compact":"Prerecorded audio clips","descriptive":"Prerecorded audio clips are embedded in the content"},"no-metadata":"No information about prerecorded audio is available","only":{"compact":"Prerecorded audio only","descriptive":"Audiobook with no text alternative"},"synchronized":{"compact":"Prerecorded audio synchronized with text","descriptive":"All the content is available as prerecorded audio synchronized with text"}},"title":"Ways of reading","visual-adjustments":{"modifiable":{"compact":"Appearance can be modified","descriptive":"Appearance of the text and page layout can be modified according to the capabilities of the reading system (font family and font size, spaces between paragraphs, sentences, words, and letters, as well as color of background and text)"},"unknown":"No information about appearance modifiability is available","unmodifiable":{"compact":"Appearance cannot be modified","descriptive":"Text and page layout cannot be modified as the reading experience is close to a print version, but reading systems can still provide zooming options"}}}}},"altIdentifier_one":"alternate identifier","altIdentifier_other":"alternate identifiers","artist_one":"artist","artist_other":"artists","author_one":"author","author_other":"authors","collection_one":"editorial collection","collection_other":"editorial collections","colorist_one":"colorist","colorist_other":"colorists","contributor_one":"contributor","contributor_other":"contributors","description":"description","duration":"duration","editor_one":"editor","editor_other":"editors","identifier_one":"identifier","identifier_other":"identifiers","illustrator_one":"illustrator","illustrator_other":"illustrators","imprint_one":"imprint","imprint_other":"imprints","inker_one":"inker","inker_other":"inkers","language_one":"language","language_other":"languages","letterer_one":"letterer","letterer_other":"letterers","modified":"modification date","narrator_one":"narrator","narrator_other":"narrators","numberOfPages":"print length","penciler_one":"penciler","penciler_other":"pencilers","published":"publication date","publisher_one":"publisher","publisher_other":"publishers","series_one":"series","series_other":"series","subject_one":"subject","subject_other":"subjects","subtitle":"subtitle","title":"title","translator_one":"translator","translator_other":"translators"}}`), si = {
|
|
314
|
+
publication: ii
|
|
315
|
+
}, ie = {
|
|
316
|
+
fr: () => import("./fr-C5HEel98.js"),
|
|
317
|
+
ar: () => import("./ar-DyHX_uy2.js"),
|
|
318
|
+
da: () => import("./da-Dct0PS3E.js"),
|
|
319
|
+
// 'el': () => import('@edrlab/thorium-locales/publication-metadata/el.json'),
|
|
320
|
+
// 'et': () => import('@edrlab/thorium-locales/publication-metadata/et.json'),
|
|
321
|
+
it: () => import("./it-DFOBoXGy.js"),
|
|
322
|
+
pt_PT: () => import("./pt_PT-Di3sVjze.js"),
|
|
323
|
+
sv: () => import("./sv-BfzAFsVN.js")
|
|
324
|
+
// 'tr': () => import('@edrlab/thorium-locales/publication-metadata/tr.json'),
|
|
325
|
+
// 'uk': () => import('@edrlab/thorium-locales/publication-metadata/uk.json')
|
|
326
|
+
}, se = si?.publication?.metadata?.accessibility?.["display-guide"] || {};
|
|
327
|
+
class Y {
|
|
333
328
|
constructor() {
|
|
334
|
-
this.currentLocaleCode = "en", this.locale =
|
|
335
|
-
en: ee,
|
|
336
|
-
fr: oi
|
|
337
|
-
};
|
|
329
|
+
this.currentLocaleCode = "en", this.locale = se, this.loadedLocales = {}, this.loadedLocales.en = se;
|
|
338
330
|
}
|
|
339
331
|
static getInstance() {
|
|
340
|
-
return
|
|
332
|
+
return Y.instance || (Y.instance = new Y()), Y.instance;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Loads a locale dynamically
|
|
336
|
+
* @param localeCode BCP 47 language code (e.g., 'en', 'fr')
|
|
337
|
+
* @returns Promise indicating if the locale was loaded successfully
|
|
338
|
+
*/
|
|
339
|
+
async loadLocale(t) {
|
|
340
|
+
if (!ee.includes(t))
|
|
341
|
+
return console.warn(`Locale '${t}' is not enabled`), !1;
|
|
342
|
+
if (t in this.loadedLocales)
|
|
343
|
+
return !0;
|
|
344
|
+
try {
|
|
345
|
+
if (!(t in ie))
|
|
346
|
+
return console.warn(`Locale file not found for: ${t}`), !1;
|
|
347
|
+
const r = (await ie[t]()).default?.publication?.metadata?.accessibility?.["display-guide"];
|
|
348
|
+
return r ? (this.loadedLocales[t] = r, !0) : (console.warn(`No accessibility strings found in locale ${t}`), !1);
|
|
349
|
+
} catch (e) {
|
|
350
|
+
return console.warn(`Failed to load locale ${t}:`, e), !1;
|
|
351
|
+
}
|
|
341
352
|
}
|
|
342
353
|
/**
|
|
343
354
|
* Registers a new locale or updates an existing one
|
|
@@ -347,15 +358,15 @@ class $ {
|
|
|
347
358
|
registerLocale(t, e) {
|
|
348
359
|
if (!t || typeof t != "string")
|
|
349
360
|
throw new Error("Locale code must be a non-empty string");
|
|
350
|
-
this.
|
|
361
|
+
this.loadedLocales[t] = e;
|
|
351
362
|
}
|
|
352
363
|
/**
|
|
353
|
-
* Sets the current locale by language code
|
|
354
|
-
* @param localeCode BCP 47 language code (e.g., 'en', 'fr
|
|
355
|
-
* @returns
|
|
364
|
+
* Sets the current locale by language code, loading it dynamically if needed
|
|
365
|
+
* @param localeCode BCP 47 language code (e.g., 'en', 'fr')
|
|
366
|
+
* @returns Promise indicating if the locale was set successfully
|
|
356
367
|
*/
|
|
357
|
-
setLocale(t) {
|
|
358
|
-
return t in this.
|
|
368
|
+
async setLocale(t) {
|
|
369
|
+
return t in this.loadedLocales || await this.loadLocale(t), t in this.loadedLocales ? (this.locale = this.loadedLocales[t], this.currentLocaleCode = t, !0) : (console.warn(`Locale '${t}' is not available`), !1);
|
|
359
370
|
}
|
|
360
371
|
/**
|
|
361
372
|
* Gets the current locale code (BCP 47)
|
|
@@ -367,17 +378,17 @@ class $ {
|
|
|
367
378
|
* Gets a list of available locale codes
|
|
368
379
|
*/
|
|
369
380
|
getAvailableLocales() {
|
|
370
|
-
return
|
|
381
|
+
return ee;
|
|
371
382
|
}
|
|
372
383
|
getNestedValue(t, e) {
|
|
373
384
|
const i = e.split(".");
|
|
374
|
-
let
|
|
375
|
-
for (const
|
|
376
|
-
if (
|
|
385
|
+
let r = t;
|
|
386
|
+
for (const n of i) {
|
|
387
|
+
if (r == null)
|
|
377
388
|
return;
|
|
378
|
-
|
|
389
|
+
r = r[n];
|
|
379
390
|
}
|
|
380
|
-
return
|
|
391
|
+
return r;
|
|
381
392
|
}
|
|
382
393
|
/**
|
|
383
394
|
* Gets a localized string by key
|
|
@@ -386,17 +397,17 @@ class $ {
|
|
|
386
397
|
*/
|
|
387
398
|
getString(t) {
|
|
388
399
|
let e = this.getNestedValue(this.locale, t);
|
|
389
|
-
return e === void 0 && this.currentLocaleCode !== "en" && (e = this.getNestedValue(this.
|
|
400
|
+
return e === void 0 && this.currentLocaleCode !== "en" && (e = this.getNestedValue(this.loadedLocales.en, t)), e !== void 0 ? typeof e == "string" ? { compact: e, descriptive: e } : e : (console.warn(`Missing localization for key: ${t}`), { compact: "", descriptive: "" });
|
|
390
401
|
}
|
|
391
402
|
}
|
|
392
|
-
const
|
|
393
|
-
var
|
|
394
|
-
class
|
|
395
|
-
constructor(t = "unknown", e = "noMetadata", i = !1,
|
|
396
|
-
this.id = "ways-of-reading.title", this.visualAdjustments = t, this.nonvisualReading = e, this.nonvisualReadingAltText = i, this.prerecordedAudio =
|
|
397
|
-
const
|
|
398
|
-
this.title =
|
|
399
|
-
const a = t === "modifiable" ? "ways-of-reading.visual-adjustments.modifiable" : t === "unmodifiable" ? "ways-of-reading.visual-adjustments.unmodifiable" : "ways-of-reading.visual-adjustments.unknown", o =
|
|
403
|
+
const f = Y.getInstance();
|
|
404
|
+
var $ = /* @__PURE__ */ ((s) => (s.reflowable = "reflowable", s.fixed = "fixed", s.scrolled = "scrolled", s))($ || {}), ri = /* @__PURE__ */ ((s) => (s.Unknown = "unknown", s.Modifiable = "modifiable", s.Unmodifiable = "unmodifiable", s))(ri || {}), ni = /* @__PURE__ */ ((s) => (s.NoMetadata = "noMetadata", s.Readable = "readable", s.NotFully = "notFully", s.Unreadable = "unreadable", s))(ni || {}), ai = /* @__PURE__ */ ((s) => (s.NoMetadata = "noMetadata", s.Synchronized = "synchronized", s.AudioOnly = "audioOnly", s.AudioComplementary = "audioComplementary", s))(ai || {});
|
|
405
|
+
class kt {
|
|
406
|
+
constructor(t = "unknown", e = "noMetadata", i = !1, r = "noMetadata") {
|
|
407
|
+
this.id = "ways-of-reading.title", this.visualAdjustments = t, this.nonvisualReading = e, this.nonvisualReadingAltText = i, this.prerecordedAudio = r, this.shouldDisplay = !0;
|
|
408
|
+
const n = f.getString(this.id);
|
|
409
|
+
this.title = n.compact, this.statements = [];
|
|
410
|
+
const a = t === "modifiable" ? "ways-of-reading.visual-adjustments.modifiable" : t === "unmodifiable" ? "ways-of-reading.visual-adjustments.unmodifiable" : "ways-of-reading.visual-adjustments.unknown", o = f.getString(a);
|
|
400
411
|
this.statements.push({
|
|
401
412
|
id: a,
|
|
402
413
|
compactString: o.compact,
|
|
@@ -404,61 +415,61 @@ class Pt {
|
|
|
404
415
|
});
|
|
405
416
|
let h = "";
|
|
406
417
|
e === "readable" ? h = "ways-of-reading.nonvisual-reading.readable" : e === "notFully" ? h = "ways-of-reading.nonvisual-reading.not-fully" : e === "unreadable" ? h = "ways-of-reading.nonvisual-reading.none" : e === "noMetadata" && (h = "ways-of-reading.nonvisual-reading.no-metadata");
|
|
407
|
-
const
|
|
418
|
+
const m = f.getString(h);
|
|
408
419
|
if (this.statements.push({
|
|
409
420
|
id: h,
|
|
410
|
-
compactString:
|
|
411
|
-
descriptiveString:
|
|
421
|
+
compactString: m.compact,
|
|
422
|
+
descriptiveString: m.descriptive
|
|
412
423
|
}), i) {
|
|
413
|
-
const g =
|
|
424
|
+
const g = f.getString("ways-of-reading.nonvisual-reading.alt-text");
|
|
414
425
|
this.statements.push({
|
|
415
426
|
id: "ways-of-reading.nonvisual-reading.alt-text",
|
|
416
427
|
compactString: g.compact,
|
|
417
428
|
descriptiveString: g.descriptive
|
|
418
429
|
});
|
|
419
430
|
}
|
|
420
|
-
let
|
|
421
|
-
|
|
422
|
-
const u =
|
|
431
|
+
let p = "";
|
|
432
|
+
r === "synchronized" ? p = "ways-of-reading.prerecorded-audio.synchronized" : r === "audioOnly" ? p = "ways-of-reading.prerecorded-audio.only" : r === "audioComplementary" ? p = "ways-of-reading.prerecorded-audio.complementary" : r === "noMetadata" && (p = "ways-of-reading.prerecorded-audio.no-metadata");
|
|
433
|
+
const u = f.getString(p);
|
|
423
434
|
this.statements.push({
|
|
424
|
-
id:
|
|
435
|
+
id: p,
|
|
425
436
|
compactString: u.compact,
|
|
426
437
|
descriptiveString: u.descriptive
|
|
427
438
|
});
|
|
428
439
|
}
|
|
429
440
|
static fromPublication(t) {
|
|
430
|
-
const e = t.metadata.accessibility ?? new
|
|
431
|
-
const
|
|
432
|
-
return Array.isArray(
|
|
433
|
-
}),
|
|
434
|
-
const
|
|
435
|
-
return Array.isArray(
|
|
436
|
-
}),
|
|
437
|
-
const
|
|
438
|
-
return Array.isArray(
|
|
441
|
+
const e = t.metadata.accessibility ?? new _(), i = e.feature ?? [], r = t.metadata.layout === $.fixed, n = i.some((d) => d.value === A.DISPLAY_TRANSFORMABILITY.value) ? "modifiable" : r ? "unmodifiable" : "unknown", a = e.accessMode ?? [], o = e.accessModeSufficient ?? [], h = a.length > 0 && a.every((d) => d.value === R.TEXTUAL.value) || o.some((d) => {
|
|
442
|
+
const I = d.value;
|
|
443
|
+
return Array.isArray(I) ? I.every((B) => B === R.TEXTUAL.value) : I === R.TEXTUAL.value;
|
|
444
|
+
}), m = a.some((d) => d.value === R.TEXTUAL.value) || o.some((d) => {
|
|
445
|
+
const I = d.value;
|
|
446
|
+
return Array.isArray(I) ? I.some((B) => B === R.TEXTUAL.value) : I === R.TEXTUAL.value;
|
|
447
|
+
}), p = !(a.length === 0 && o.length === 0) && !a.some((d) => d.value === R.TEXTUAL.value) && !o.some((d) => {
|
|
448
|
+
const I = d.value;
|
|
449
|
+
return Array.isArray(I) ? I.some((B) => B === R.TEXTUAL.value) : I === R.TEXTUAL.value;
|
|
439
450
|
}), u = i.some((d) => [
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
].includes(d.value)), g = h ? "readable" :
|
|
445
|
-
const
|
|
446
|
-
return Array.isArray(
|
|
447
|
-
}) ? "audioOnly" : a.some((d) => d.value ===
|
|
448
|
-
return new
|
|
449
|
-
|
|
451
|
+
A.LONG_DESCRIPTION.value,
|
|
452
|
+
A.ALTERNATIVE_TEXT.value,
|
|
453
|
+
A.DESCRIBED_MATH.value,
|
|
454
|
+
A.TRANSCRIPT.value
|
|
455
|
+
].includes(d.value)), g = h ? "readable" : m || u ? "notFully" : p ? "unreadable" : "noMetadata", v = u, C = i.some((d) => d.value === A.SYNCHRONIZED_AUDIO_TEXT.value) ? "synchronized" : o.some((d) => {
|
|
456
|
+
const I = d.value;
|
|
457
|
+
return Array.isArray(I) ? I.some((B) => B === R.AUDITORY.value) : I === R.AUDITORY.value;
|
|
458
|
+
}) ? "audioOnly" : a.some((d) => d.value === R.AUDITORY.value) ? "audioComplementary" : "noMetadata";
|
|
459
|
+
return new kt(
|
|
460
|
+
n,
|
|
450
461
|
g,
|
|
451
|
-
|
|
452
|
-
|
|
462
|
+
v,
|
|
463
|
+
C
|
|
453
464
|
);
|
|
454
465
|
}
|
|
455
466
|
}
|
|
456
|
-
class
|
|
457
|
-
constructor(t = !1, e = !1, i = !1,
|
|
458
|
-
this.id = "navigation.title", this.tableOfContents = t, this.index = e, this.headings = i, this.page =
|
|
459
|
-
const
|
|
460
|
-
if (this.title =
|
|
461
|
-
const a =
|
|
467
|
+
class Dt {
|
|
468
|
+
constructor(t = !1, e = !1, i = !1, r = !1) {
|
|
469
|
+
this.id = "navigation.title", this.tableOfContents = t, this.index = e, this.headings = i, this.page = r, this.noMetadata = !t && !e && !i && !r;
|
|
470
|
+
const n = f.getString(this.id);
|
|
471
|
+
if (this.title = n.compact, this.shouldDisplay = !this.noMetadata, this.statements = [], t) {
|
|
472
|
+
const a = f.getString("navigation.toc");
|
|
462
473
|
this.statements.push({
|
|
463
474
|
id: "navigation.toc",
|
|
464
475
|
compactString: a.compact,
|
|
@@ -466,7 +477,7 @@ class kt {
|
|
|
466
477
|
});
|
|
467
478
|
}
|
|
468
479
|
if (e) {
|
|
469
|
-
const a =
|
|
480
|
+
const a = f.getString("navigation.index");
|
|
470
481
|
this.statements.push({
|
|
471
482
|
id: "navigation.index",
|
|
472
483
|
compactString: a.compact,
|
|
@@ -474,15 +485,15 @@ class kt {
|
|
|
474
485
|
});
|
|
475
486
|
}
|
|
476
487
|
if (i) {
|
|
477
|
-
const a =
|
|
488
|
+
const a = f.getString("navigation.structural");
|
|
478
489
|
this.statements.push({
|
|
479
490
|
id: "navigation.structural",
|
|
480
491
|
compactString: a.compact,
|
|
481
492
|
descriptiveString: a.descriptive
|
|
482
493
|
});
|
|
483
494
|
}
|
|
484
|
-
if (
|
|
485
|
-
const a =
|
|
495
|
+
if (r) {
|
|
496
|
+
const a = f.getString("navigation.page-navigation");
|
|
486
497
|
this.statements.push({
|
|
487
498
|
id: "navigation.page-navigation",
|
|
488
499
|
compactString: a.compact,
|
|
@@ -490,7 +501,7 @@ class kt {
|
|
|
490
501
|
});
|
|
491
502
|
}
|
|
492
503
|
if (this.statements.length === 0) {
|
|
493
|
-
const a =
|
|
504
|
+
const a = f.getString("navigation.no-metadata");
|
|
494
505
|
this.statements.push({
|
|
495
506
|
id: "navigation.no-metadata",
|
|
496
507
|
compactString: a.compact,
|
|
@@ -499,22 +510,22 @@ class kt {
|
|
|
499
510
|
}
|
|
500
511
|
}
|
|
501
512
|
static fromPublication(t) {
|
|
502
|
-
const i = (t.metadata.accessibility ?? new
|
|
503
|
-
return new
|
|
504
|
-
i.some((
|
|
505
|
-
i.some((
|
|
506
|
-
i.some((
|
|
507
|
-
i.some((
|
|
513
|
+
const i = (t.metadata.accessibility ?? new _()).feature ?? [];
|
|
514
|
+
return new Dt(
|
|
515
|
+
i.some((r) => r.value === A.TABLE_OF_CONTENTS.value),
|
|
516
|
+
i.some((r) => r.value === A.INDEX.value),
|
|
517
|
+
i.some((r) => r.value === A.STRUCTURAL_NAVIGATION.value),
|
|
518
|
+
i.some((r) => r.value === A.PAGE_NAVIGATION.value)
|
|
508
519
|
);
|
|
509
520
|
}
|
|
510
521
|
}
|
|
511
|
-
var
|
|
512
|
-
class
|
|
513
|
-
constructor(t = !1, e = !1, i = !1,
|
|
514
|
-
this.id = "rich-content.title", this.extendedAltTextDescriptions = t, this.mathFormula = e, this.mathFormulaAsMathML = i, this.mathFormulaAsLaTeX =
|
|
515
|
-
const
|
|
516
|
-
if (this.title =
|
|
517
|
-
const u =
|
|
522
|
+
var oi = /* @__PURE__ */ ((s) => (s.Math = "math", s.Chemistry = "chemistry", s.Music = "music", s.Diagram = "diagram", s.Chart = "chart", s.Graph = "graph", s.Table = "table", s.Image = "image", s))(oi || {});
|
|
523
|
+
class Ut {
|
|
524
|
+
constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, h = !1, m = !1) {
|
|
525
|
+
this.id = "rich-content.title", this.extendedAltTextDescriptions = t, this.mathFormula = e, this.mathFormulaAsMathML = i, this.mathFormulaAsLaTeX = r, this.chemicalFormulaAsMathML = n, this.chemicalFormulaAsLaTeX = a, this.closedCaptions = o, this.openCaptions = h, this.transcript = m, this.noMetadata = !t && !e && !i && !r && !n && !a && !o && !h && !m, this.shouldDisplay = !this.noMetadata;
|
|
526
|
+
const p = f.getString(this.id);
|
|
527
|
+
if (this.title = p.compact, this.statements = [], t) {
|
|
528
|
+
const u = f.getString("rich-content.extended-descriptions");
|
|
518
529
|
this.statements.push({
|
|
519
530
|
id: "rich-content.extended-descriptions",
|
|
520
531
|
compactString: u.compact,
|
|
@@ -522,7 +533,7 @@ class Dt {
|
|
|
522
533
|
});
|
|
523
534
|
}
|
|
524
535
|
if (e) {
|
|
525
|
-
const u =
|
|
536
|
+
const u = f.getString("rich-content.accessible-math-described");
|
|
526
537
|
this.statements.push({
|
|
527
538
|
id: "rich-content.accessible-math-described",
|
|
528
539
|
compactString: u.compact,
|
|
@@ -530,23 +541,23 @@ class Dt {
|
|
|
530
541
|
});
|
|
531
542
|
}
|
|
532
543
|
if (i) {
|
|
533
|
-
const u =
|
|
544
|
+
const u = f.getString("rich-content.math-as-mathml");
|
|
534
545
|
this.statements.push({
|
|
535
546
|
id: "rich-content.math-as-mathml",
|
|
536
547
|
compactString: u.compact,
|
|
537
548
|
descriptiveString: u.descriptive
|
|
538
549
|
});
|
|
539
550
|
}
|
|
540
|
-
if (
|
|
541
|
-
const u =
|
|
551
|
+
if (r) {
|
|
552
|
+
const u = f.getString("rich-content.accessible-math-as-latex");
|
|
542
553
|
this.statements.push({
|
|
543
554
|
id: "rich-content.accessible-math-as-latex",
|
|
544
555
|
compactString: u.compact,
|
|
545
556
|
descriptiveString: u.descriptive
|
|
546
557
|
});
|
|
547
558
|
}
|
|
548
|
-
if (
|
|
549
|
-
const u =
|
|
559
|
+
if (n) {
|
|
560
|
+
const u = f.getString("rich-content.accessible-chemistry-as-mathml");
|
|
550
561
|
this.statements.push({
|
|
551
562
|
id: "rich-content.accessible-chemistry-as-mathml",
|
|
552
563
|
compactString: u.compact,
|
|
@@ -554,7 +565,7 @@ class Dt {
|
|
|
554
565
|
});
|
|
555
566
|
}
|
|
556
567
|
if (a) {
|
|
557
|
-
const u =
|
|
568
|
+
const u = f.getString("rich-content.accessible-chemistry-as-latex");
|
|
558
569
|
this.statements.push({
|
|
559
570
|
id: "rich-content.accessible-chemistry-as-latex",
|
|
560
571
|
compactString: u.compact,
|
|
@@ -562,7 +573,7 @@ class Dt {
|
|
|
562
573
|
});
|
|
563
574
|
}
|
|
564
575
|
if (o) {
|
|
565
|
-
const u =
|
|
576
|
+
const u = f.getString("rich-content.closed-captions");
|
|
566
577
|
this.statements.push({
|
|
567
578
|
id: "rich-content.closed-captions",
|
|
568
579
|
compactString: u.compact,
|
|
@@ -570,15 +581,15 @@ class Dt {
|
|
|
570
581
|
});
|
|
571
582
|
}
|
|
572
583
|
if (h) {
|
|
573
|
-
const u =
|
|
584
|
+
const u = f.getString("rich-content.open-captions");
|
|
574
585
|
this.statements.push({
|
|
575
586
|
id: "rich-content.open-captions",
|
|
576
587
|
compactString: u.compact,
|
|
577
588
|
descriptiveString: u.descriptive
|
|
578
589
|
});
|
|
579
590
|
}
|
|
580
|
-
if (
|
|
581
|
-
const u =
|
|
591
|
+
if (m) {
|
|
592
|
+
const u = f.getString("rich-content.transcript");
|
|
582
593
|
this.statements.push({
|
|
583
594
|
id: "rich-content.transcript",
|
|
584
595
|
compactString: u.compact,
|
|
@@ -586,7 +597,7 @@ class Dt {
|
|
|
586
597
|
});
|
|
587
598
|
}
|
|
588
599
|
if (this.statements.length === 0) {
|
|
589
|
-
const u =
|
|
600
|
+
const u = f.getString("rich-content.unknown");
|
|
590
601
|
this.statements.push({
|
|
591
602
|
id: "rich-content.unknown",
|
|
592
603
|
compactString: u.compact,
|
|
@@ -595,26 +606,26 @@ class Dt {
|
|
|
595
606
|
}
|
|
596
607
|
}
|
|
597
608
|
static fromPublication(t) {
|
|
598
|
-
const i = (t.metadata.accessibility ?? new
|
|
599
|
-
return new
|
|
600
|
-
i.some((
|
|
601
|
-
i.some((
|
|
602
|
-
i.some((
|
|
603
|
-
i.some((
|
|
604
|
-
i.some((
|
|
605
|
-
i.some((
|
|
606
|
-
i.some((
|
|
607
|
-
i.some((
|
|
608
|
-
i.some((
|
|
609
|
+
const i = (t.metadata.accessibility ?? new _()).feature ?? [];
|
|
610
|
+
return new Ut(
|
|
611
|
+
i.some((r) => r.value === A.LONG_DESCRIPTION.value),
|
|
612
|
+
i.some((r) => r.value === A.DESCRIBED_MATH.value),
|
|
613
|
+
i.some((r) => r.value === A.MATH_ML.value),
|
|
614
|
+
i.some((r) => r.value === A.LATEX.value),
|
|
615
|
+
i.some((r) => r.value === A.MATH_ML_CHEMISTRY.value),
|
|
616
|
+
i.some((r) => r.value === A.LATEX_CHEMISTRY.value),
|
|
617
|
+
i.some((r) => r.value === A.CLOSED_CAPTIONS.value),
|
|
618
|
+
i.some((r) => r.value === A.OPEN_CAPTIONS.value),
|
|
619
|
+
i.some((r) => r.value === A.TRANSCRIPT.value)
|
|
609
620
|
);
|
|
610
621
|
}
|
|
611
622
|
}
|
|
612
|
-
class
|
|
613
|
-
constructor(t = !1, e = !1, i = !1,
|
|
614
|
-
this.id = "additional-accessibility-information.title", this.pageBreakMarkers = t, this.aria = e, this.audioDescriptions = i, this.braille =
|
|
615
|
-
const
|
|
616
|
-
if (this.title =
|
|
617
|
-
const d =
|
|
623
|
+
class Mt {
|
|
624
|
+
constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, h = !1, m = !1, p = !1, u = !1, g = !1, v = !1) {
|
|
625
|
+
this.id = "additional-accessibility-information.title", this.pageBreakMarkers = t, this.aria = e, this.audioDescriptions = i, this.braille = r, this.rubyAnnotations = n, this.fullRubyAnnotations = a, this.highAudioContrast = o, this.highDisplayContrast = h, this.largePrint = m, this.signLanguage = p, this.tactileGraphics = u, this.tactileObjects = g, this.textToSpeechHinting = v, this.noMetadata = !t && !e && !i && !r && !n && !a && !o && !h && !m && !p && !u && !g && !v, this.shouldDisplay = !this.noMetadata;
|
|
626
|
+
const C = f.getString(this.id);
|
|
627
|
+
if (this.title = C.compact, this.statements = [], t) {
|
|
628
|
+
const d = f.getString("additional-accessibility-information.page-breaks");
|
|
618
629
|
this.statements.push({
|
|
619
630
|
id: "additional-accessibility-information.page-breaks",
|
|
620
631
|
compactString: d.compact,
|
|
@@ -622,7 +633,7 @@ class Ut {
|
|
|
622
633
|
});
|
|
623
634
|
}
|
|
624
635
|
if (e) {
|
|
625
|
-
const d =
|
|
636
|
+
const d = f.getString("additional-accessibility-information.aria");
|
|
626
637
|
this.statements.push({
|
|
627
638
|
id: "additional-accessibility-information.aria",
|
|
628
639
|
compactString: d.compact,
|
|
@@ -630,23 +641,23 @@ class Ut {
|
|
|
630
641
|
});
|
|
631
642
|
}
|
|
632
643
|
if (i) {
|
|
633
|
-
const d =
|
|
644
|
+
const d = f.getString("additional-accessibility-information.audio-descriptions");
|
|
634
645
|
this.statements.push({
|
|
635
646
|
id: "additional-accessibility-information.audio-descriptions",
|
|
636
647
|
compactString: d.compact,
|
|
637
648
|
descriptiveString: d.descriptive
|
|
638
649
|
});
|
|
639
650
|
}
|
|
640
|
-
if (
|
|
641
|
-
const d =
|
|
651
|
+
if (r) {
|
|
652
|
+
const d = f.getString("additional-accessibility-information.braille");
|
|
642
653
|
this.statements.push({
|
|
643
654
|
id: "additional-accessibility-information.braille",
|
|
644
655
|
compactString: d.compact,
|
|
645
656
|
descriptiveString: d.descriptive
|
|
646
657
|
});
|
|
647
658
|
}
|
|
648
|
-
if (
|
|
649
|
-
const d =
|
|
659
|
+
if (n) {
|
|
660
|
+
const d = f.getString("additional-accessibility-information.ruby-annotations");
|
|
650
661
|
this.statements.push({
|
|
651
662
|
id: "additional-accessibility-information.ruby-annotations",
|
|
652
663
|
compactString: d.compact,
|
|
@@ -654,7 +665,7 @@ class Ut {
|
|
|
654
665
|
});
|
|
655
666
|
}
|
|
656
667
|
if (a) {
|
|
657
|
-
const d =
|
|
668
|
+
const d = f.getString("additional-accessibility-information.full-ruby-annotations");
|
|
658
669
|
this.statements.push({
|
|
659
670
|
id: "additional-accessibility-information.full-ruby-annotations",
|
|
660
671
|
compactString: d.compact,
|
|
@@ -662,7 +673,7 @@ class Ut {
|
|
|
662
673
|
});
|
|
663
674
|
}
|
|
664
675
|
if (o) {
|
|
665
|
-
const d =
|
|
676
|
+
const d = f.getString("additional-accessibility-information.high-contrast-between-foreground-and-background-audio");
|
|
666
677
|
this.statements.push({
|
|
667
678
|
id: "additional-accessibility-information.high-contrast-between-foreground-and-background-audio",
|
|
668
679
|
compactString: d.compact,
|
|
@@ -670,23 +681,23 @@ class Ut {
|
|
|
670
681
|
});
|
|
671
682
|
}
|
|
672
683
|
if (h) {
|
|
673
|
-
const d =
|
|
684
|
+
const d = f.getString("additional-accessibility-information.high-contrast-between-text-and-background");
|
|
674
685
|
this.statements.push({
|
|
675
686
|
id: "additional-accessibility-information.high-contrast-between-text-and-background",
|
|
676
687
|
compactString: d.compact,
|
|
677
688
|
descriptiveString: d.descriptive
|
|
678
689
|
});
|
|
679
690
|
}
|
|
680
|
-
if (
|
|
681
|
-
const d =
|
|
691
|
+
if (m) {
|
|
692
|
+
const d = f.getString("additional-accessibility-information.large-print");
|
|
682
693
|
this.statements.push({
|
|
683
694
|
id: "additional-accessibility-information.large-print",
|
|
684
695
|
compactString: d.compact,
|
|
685
696
|
descriptiveString: d.descriptive
|
|
686
697
|
});
|
|
687
698
|
}
|
|
688
|
-
if (
|
|
689
|
-
const d =
|
|
699
|
+
if (p) {
|
|
700
|
+
const d = f.getString("additional-accessibility-information.sign-language");
|
|
690
701
|
this.statements.push({
|
|
691
702
|
id: "additional-accessibility-information.sign-language",
|
|
692
703
|
compactString: d.compact,
|
|
@@ -694,7 +705,7 @@ class Ut {
|
|
|
694
705
|
});
|
|
695
706
|
}
|
|
696
707
|
if (u) {
|
|
697
|
-
const d =
|
|
708
|
+
const d = f.getString("additional-accessibility-information.tactile-graphics");
|
|
698
709
|
this.statements.push({
|
|
699
710
|
id: "additional-accessibility-information.tactile-graphics",
|
|
700
711
|
compactString: d.compact,
|
|
@@ -702,15 +713,15 @@ class Ut {
|
|
|
702
713
|
});
|
|
703
714
|
}
|
|
704
715
|
if (g) {
|
|
705
|
-
const d =
|
|
716
|
+
const d = f.getString("additional-accessibility-information.tactile-objects");
|
|
706
717
|
this.statements.push({
|
|
707
718
|
id: "additional-accessibility-information.tactile-objects",
|
|
708
719
|
compactString: d.compact,
|
|
709
720
|
descriptiveString: d.descriptive
|
|
710
721
|
});
|
|
711
722
|
}
|
|
712
|
-
if (
|
|
713
|
-
const d =
|
|
723
|
+
if (v) {
|
|
724
|
+
const d = f.getString("additional-accessibility-information.text-to-speech-hinting");
|
|
714
725
|
this.statements.push({
|
|
715
726
|
id: "additional-accessibility-information.text-to-speech-hinting",
|
|
716
727
|
compactString: d.compact,
|
|
@@ -719,115 +730,115 @@ class Ut {
|
|
|
719
730
|
}
|
|
720
731
|
}
|
|
721
732
|
static fromPublication(t) {
|
|
722
|
-
const i = (t.metadata.accessibility ?? new
|
|
723
|
-
return new
|
|
724
|
-
i.some((
|
|
725
|
-
i.some((
|
|
726
|
-
i.some((
|
|
727
|
-
i.some((
|
|
728
|
-
i.some((
|
|
729
|
-
i.some((
|
|
730
|
-
i.some((
|
|
731
|
-
i.some((
|
|
732
|
-
i.some((
|
|
733
|
-
i.some((
|
|
734
|
-
i.some((
|
|
735
|
-
i.some((
|
|
736
|
-
i.some((
|
|
733
|
+
const i = (t.metadata.accessibility ?? new _()).feature ?? [];
|
|
734
|
+
return new Mt(
|
|
735
|
+
i.some((r) => r.value === A.PAGE_BREAK_MARKERS.value || r.value === A.PRINT_PAGE_NUMBERS.value),
|
|
736
|
+
i.some((r) => r.value === A.ARIA.value),
|
|
737
|
+
i.some((r) => r.value === A.AUDIO_DESCRIPTION.value),
|
|
738
|
+
i.some((r) => r.value === A.BRAILLE.value),
|
|
739
|
+
i.some((r) => r.value === A.RUBY_ANNOTATIONS.value),
|
|
740
|
+
i.some((r) => r.value === A.FULL_RUBY_ANNOTATIONS.value),
|
|
741
|
+
i.some((r) => r.value === A.HIGH_CONTRAST_AUDIO.value),
|
|
742
|
+
i.some((r) => r.value === A.HIGH_CONTRAST_DISPLAY.value),
|
|
743
|
+
i.some((r) => r.value === A.LARGE_PRINT.value),
|
|
744
|
+
i.some((r) => r.value === A.SIGN_LANGUAGE.value),
|
|
745
|
+
i.some((r) => r.value === A.TACTILE_GRAPHIC.value),
|
|
746
|
+
i.some((r) => r.value === A.TACTILE_OBJECT.value),
|
|
747
|
+
i.some((r) => r.value === A.TTS_MARKUP.value)
|
|
737
748
|
);
|
|
738
749
|
}
|
|
739
750
|
}
|
|
740
|
-
var
|
|
741
|
-
class
|
|
751
|
+
var ci = /* @__PURE__ */ ((s) => (s.yes = "yes", s.no = "no", s.unknown = "unknown", s.noMetadata = "noMetadata", s))(ci || {});
|
|
752
|
+
class Bt {
|
|
742
753
|
constructor(t = "unknown", e = "unknown", i = "unknown") {
|
|
743
754
|
this.id = "hazards.title", this.flashing = t, this.motion = e, this.sound = i;
|
|
744
|
-
const
|
|
745
|
-
if (this.title =
|
|
746
|
-
const
|
|
755
|
+
const r = f.getString(this.id);
|
|
756
|
+
if (this.title = r.compact, this.noMetadata = t === "noMetadata" && e === "noMetadata" && i === "noMetadata", this.noHazards = t === "no" && e === "no" && i === "no", this.unknown = t === "unknown" && e === "unknown" && i === "unknown", this.shouldDisplay = !this.noMetadata, this.statements = [], this.noHazards) {
|
|
757
|
+
const n = f.getString("hazards.none");
|
|
747
758
|
this.statements.push({
|
|
748
759
|
id: "hazards.none",
|
|
749
|
-
compactString:
|
|
750
|
-
descriptiveString:
|
|
760
|
+
compactString: n.compact,
|
|
761
|
+
descriptiveString: n.descriptive
|
|
751
762
|
});
|
|
752
763
|
} else if (this.unknown) {
|
|
753
|
-
const
|
|
764
|
+
const n = f.getString("hazards.unknown");
|
|
754
765
|
this.statements.push({
|
|
755
766
|
id: "hazards.unknown",
|
|
756
|
-
compactString:
|
|
757
|
-
descriptiveString:
|
|
767
|
+
compactString: n.compact,
|
|
768
|
+
descriptiveString: n.descriptive
|
|
758
769
|
});
|
|
759
770
|
} else if (this.noMetadata) {
|
|
760
|
-
const
|
|
771
|
+
const n = f.getString("hazards.no-metadata");
|
|
761
772
|
this.statements.push({
|
|
762
773
|
id: "hazards.no-metadata",
|
|
763
|
-
compactString:
|
|
764
|
-
descriptiveString:
|
|
774
|
+
compactString: n.compact,
|
|
775
|
+
descriptiveString: n.descriptive
|
|
765
776
|
});
|
|
766
777
|
} else {
|
|
767
778
|
if (t === "yes") {
|
|
768
|
-
const
|
|
779
|
+
const n = f.getString("hazards.flashing");
|
|
769
780
|
this.statements.push({
|
|
770
781
|
id: "hazards.flashing",
|
|
771
|
-
compactString:
|
|
772
|
-
descriptiveString:
|
|
782
|
+
compactString: n.compact,
|
|
783
|
+
descriptiveString: n.descriptive
|
|
773
784
|
});
|
|
774
785
|
} else if (t === "unknown") {
|
|
775
|
-
const
|
|
786
|
+
const n = f.getString("hazards.flashing-unknown");
|
|
776
787
|
this.statements.push({
|
|
777
788
|
id: "hazards.flashing-unknown",
|
|
778
|
-
compactString:
|
|
779
|
-
descriptiveString:
|
|
789
|
+
compactString: n.compact,
|
|
790
|
+
descriptiveString: n.descriptive
|
|
780
791
|
});
|
|
781
792
|
} else if (t === "no") {
|
|
782
|
-
const
|
|
793
|
+
const n = f.getString("hazards.flashing-none");
|
|
783
794
|
this.statements.push({
|
|
784
795
|
id: "hazards.flashing-none",
|
|
785
|
-
compactString:
|
|
786
|
-
descriptiveString:
|
|
796
|
+
compactString: n.compact,
|
|
797
|
+
descriptiveString: n.descriptive
|
|
787
798
|
});
|
|
788
799
|
}
|
|
789
800
|
if (e === "yes") {
|
|
790
|
-
const
|
|
801
|
+
const n = f.getString("hazards.motion");
|
|
791
802
|
this.statements.push({
|
|
792
803
|
id: "hazards.motion",
|
|
793
|
-
compactString:
|
|
794
|
-
descriptiveString:
|
|
804
|
+
compactString: n.compact,
|
|
805
|
+
descriptiveString: n.descriptive
|
|
795
806
|
});
|
|
796
807
|
} else if (e === "unknown") {
|
|
797
|
-
const
|
|
808
|
+
const n = f.getString("hazards.motion-unknown");
|
|
798
809
|
this.statements.push({
|
|
799
810
|
id: "hazards.motion-unknown",
|
|
800
|
-
compactString:
|
|
801
|
-
descriptiveString:
|
|
811
|
+
compactString: n.compact,
|
|
812
|
+
descriptiveString: n.descriptive
|
|
802
813
|
});
|
|
803
814
|
} else if (e === "no") {
|
|
804
|
-
const
|
|
815
|
+
const n = f.getString("hazards.motion-none");
|
|
805
816
|
this.statements.push({
|
|
806
817
|
id: "hazards.motion-none",
|
|
807
|
-
compactString:
|
|
808
|
-
descriptiveString:
|
|
818
|
+
compactString: n.compact,
|
|
819
|
+
descriptiveString: n.descriptive
|
|
809
820
|
});
|
|
810
821
|
}
|
|
811
822
|
if (i === "yes") {
|
|
812
|
-
const
|
|
823
|
+
const n = f.getString("hazards.sound");
|
|
813
824
|
this.statements.push({
|
|
814
825
|
id: "hazards.sound",
|
|
815
|
-
compactString:
|
|
816
|
-
descriptiveString:
|
|
826
|
+
compactString: n.compact,
|
|
827
|
+
descriptiveString: n.descriptive
|
|
817
828
|
});
|
|
818
829
|
} else if (i === "unknown") {
|
|
819
|
-
const
|
|
830
|
+
const n = f.getString("hazards.sound-unknown");
|
|
820
831
|
this.statements.push({
|
|
821
832
|
id: "hazards.sound-unknown",
|
|
822
|
-
compactString:
|
|
823
|
-
descriptiveString:
|
|
833
|
+
compactString: n.compact,
|
|
834
|
+
descriptiveString: n.descriptive
|
|
824
835
|
});
|
|
825
836
|
} else if (i === "no") {
|
|
826
|
-
const
|
|
837
|
+
const n = f.getString("hazards.sound-none");
|
|
827
838
|
this.statements.push({
|
|
828
839
|
id: "hazards.sound-none",
|
|
829
|
-
compactString:
|
|
830
|
-
descriptiveString:
|
|
840
|
+
compactString: n.compact,
|
|
841
|
+
descriptiveString: n.descriptive
|
|
831
842
|
});
|
|
832
843
|
}
|
|
833
844
|
}
|
|
@@ -836,20 +847,20 @@ class Mt {
|
|
|
836
847
|
const e = t.metadata.accessibility?.hazard ?? [];
|
|
837
848
|
let i;
|
|
838
849
|
e.some((o) => o.value === P.NONE.value) ? i = "no" : e.some((o) => o.value === P.UNKNOWN.value) ? i = "unknown" : i = "noMetadata";
|
|
839
|
-
let n;
|
|
840
|
-
e.some((o) => o.value === P.FLASHING.value) ? n = "yes" : e.some((o) => o.value === P.NO_FLASHING_HAZARD.value) ? n = "no" : e.some((o) => o.value === P.UNKNOWN_FLASHING_HAZARD.value) ? n = "unknown" : n = i;
|
|
841
850
|
let r;
|
|
842
|
-
e.some((o) => o.value === P.
|
|
851
|
+
e.some((o) => o.value === P.FLASHING.value) ? r = "yes" : e.some((o) => o.value === P.NO_FLASHING_HAZARD.value) ? r = "no" : e.some((o) => o.value === P.UNKNOWN_FLASHING_HAZARD.value) ? r = "unknown" : r = i;
|
|
852
|
+
let n;
|
|
853
|
+
e.some((o) => o.value === P.MOTION_SIMULATION.value) ? n = "yes" : e.some((o) => o.value === P.NO_MOTION_SIMULATION_HAZARD.value) ? n = "no" : e.some((o) => o.value === P.UNKNOWN_MOTION_SIMULATION_HAZARD.value) ? n = "unknown" : n = i;
|
|
843
854
|
let a;
|
|
844
|
-
return e.some((o) => o.value === P.SOUND.value) ? a = "yes" : e.some((o) => o.value === P.NO_SOUND_HAZARD.value) ? a = "no" : e.some((o) => o.value === P.UNKNOWN_SOUND_HAZARD.value) ? a = "unknown" : a = i, new
|
|
855
|
+
return e.some((o) => o.value === P.SOUND.value) ? a = "yes" : e.some((o) => o.value === P.NO_SOUND_HAZARD.value) ? a = "no" : e.some((o) => o.value === P.UNKNOWN_SOUND_HAZARD.value) ? a = "unknown" : a = i, new Bt(r, n, a);
|
|
845
856
|
}
|
|
846
857
|
}
|
|
847
|
-
class
|
|
858
|
+
class Gt {
|
|
848
859
|
constructor(t = []) {
|
|
849
860
|
this.id = "conformance.title", this.profiles = t, this.shouldDisplay = !0;
|
|
850
|
-
const e =
|
|
861
|
+
const e = f.getString(this.id);
|
|
851
862
|
if (this.title = e.compact, this.statements = [], t.length === 0) {
|
|
852
|
-
const i =
|
|
863
|
+
const i = f.getString("conformance.no");
|
|
853
864
|
this.statements.push({
|
|
854
865
|
id: "conformance.no",
|
|
855
866
|
compactString: i.compact,
|
|
@@ -858,28 +869,28 @@ class Bt {
|
|
|
858
869
|
return;
|
|
859
870
|
}
|
|
860
871
|
if (t.some((i) => i.isWCAGLevelAAA)) {
|
|
861
|
-
const i =
|
|
872
|
+
const i = f.getString("conformance.aaa");
|
|
862
873
|
this.statements.push({
|
|
863
874
|
id: "conformance.aaa",
|
|
864
875
|
compactString: i.compact,
|
|
865
876
|
descriptiveString: i.descriptive
|
|
866
877
|
});
|
|
867
878
|
} else if (t.some((i) => i.isWCAGLevelAA)) {
|
|
868
|
-
const i =
|
|
879
|
+
const i = f.getString("conformance.aa");
|
|
869
880
|
this.statements.push({
|
|
870
881
|
id: "conformance.aa",
|
|
871
882
|
compactString: i.compact,
|
|
872
883
|
descriptiveString: i.descriptive
|
|
873
884
|
});
|
|
874
885
|
} else if (t.some((i) => i.isWCAGLevelA)) {
|
|
875
|
-
const i =
|
|
886
|
+
const i = f.getString("conformance.a");
|
|
876
887
|
this.statements.push({
|
|
877
888
|
id: "conformance.a",
|
|
878
889
|
compactString: i.compact,
|
|
879
890
|
descriptiveString: i.descriptive
|
|
880
891
|
});
|
|
881
892
|
} else {
|
|
882
|
-
const i =
|
|
893
|
+
const i = f.getString("conformance.unknown-standard");
|
|
883
894
|
this.statements.push({
|
|
884
895
|
id: "conformance.unknown-standard",
|
|
885
896
|
compactString: i.compact,
|
|
@@ -889,22 +900,22 @@ class Bt {
|
|
|
889
900
|
}
|
|
890
901
|
static fromPublication(t) {
|
|
891
902
|
const e = t.metadata.accessibility?.conformsTo ?? [];
|
|
892
|
-
return new
|
|
903
|
+
return new Gt(e);
|
|
893
904
|
}
|
|
894
905
|
}
|
|
895
906
|
class Wt {
|
|
896
907
|
constructor(t = !1) {
|
|
897
908
|
this.id = "legal-considerations.title", this.exemption = t, this.shouldDisplay = this.exemption;
|
|
898
|
-
const e =
|
|
909
|
+
const e = f.getString(this.id);
|
|
899
910
|
if (this.title = e.compact, this.statements = [], t) {
|
|
900
|
-
const i =
|
|
911
|
+
const i = f.getString("legal-considerations.exempt");
|
|
901
912
|
this.statements.push({
|
|
902
913
|
id: "legal-considerations.exempt",
|
|
903
914
|
compactString: i.compact,
|
|
904
915
|
descriptiveString: i.descriptive
|
|
905
916
|
});
|
|
906
917
|
} else {
|
|
907
|
-
const i =
|
|
918
|
+
const i = f.getString("legal-considerations.no-metadata");
|
|
908
919
|
this.statements.push({
|
|
909
920
|
id: "legal-considerations.no-metadata",
|
|
910
921
|
compactString: i.compact,
|
|
@@ -917,10 +928,10 @@ class Wt {
|
|
|
917
928
|
return new Wt(i);
|
|
918
929
|
}
|
|
919
930
|
}
|
|
920
|
-
class
|
|
931
|
+
class Ht {
|
|
921
932
|
constructor(t) {
|
|
922
933
|
this.id = "accessibility-summary.title", this.shouldDisplay = !0;
|
|
923
|
-
const e =
|
|
934
|
+
const e = f.getString(this.id);
|
|
924
935
|
this.title = e.compact;
|
|
925
936
|
const i = t.metadata.accessibility?.summary;
|
|
926
937
|
if (this.statements = [], this.shouldDisplay && i)
|
|
@@ -930,21 +941,21 @@ class Gt {
|
|
|
930
941
|
descriptiveString: i
|
|
931
942
|
});
|
|
932
943
|
else {
|
|
933
|
-
const
|
|
944
|
+
const r = f.getString("accessibility-summary.no-metadata");
|
|
934
945
|
this.statements.push({
|
|
935
946
|
id: "accessibility-summary.no-metadata",
|
|
936
|
-
compactString:
|
|
937
|
-
descriptiveString:
|
|
947
|
+
compactString: r.compact,
|
|
948
|
+
descriptiveString: r.descriptive
|
|
938
949
|
});
|
|
939
950
|
}
|
|
940
951
|
}
|
|
941
952
|
static fromPublication(t) {
|
|
942
|
-
return new
|
|
953
|
+
return new Ht(t);
|
|
943
954
|
}
|
|
944
955
|
}
|
|
945
|
-
class
|
|
956
|
+
class sr {
|
|
946
957
|
constructor(t) {
|
|
947
|
-
this.waysOfReading =
|
|
958
|
+
this.waysOfReading = kt.fromPublication(t), this.navigation = Dt.fromPublication(t), this.richContent = Ut.fromPublication(t), this.additionalInformation = Mt.fromPublication(t), this.hazards = Bt.fromPublication(t), this.conformance = Gt.fromPublication(t), this.legal = Wt.fromPublication(t), this.accessibilitySummary = Ht.fromPublication(t), this.fields = [
|
|
948
959
|
this.waysOfReading,
|
|
949
960
|
this.navigation,
|
|
950
961
|
this.richContent,
|
|
@@ -956,7 +967,7 @@ class rn {
|
|
|
956
967
|
];
|
|
957
968
|
}
|
|
958
969
|
}
|
|
959
|
-
class
|
|
970
|
+
class Ft {
|
|
960
971
|
/**
|
|
961
972
|
* Creates a [Encryption].
|
|
962
973
|
*/
|
|
@@ -968,7 +979,7 @@ class Ht {
|
|
|
968
979
|
*/
|
|
969
980
|
static deserialize(t) {
|
|
970
981
|
if (t && t.algorithm)
|
|
971
|
-
return new
|
|
982
|
+
return new Ft({
|
|
972
983
|
algorithm: t.algorithm,
|
|
973
984
|
compression: t.compression,
|
|
974
985
|
originalLength: t.originalLength,
|
|
@@ -984,7 +995,7 @@ class Ht {
|
|
|
984
995
|
return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
|
|
985
996
|
}
|
|
986
997
|
}
|
|
987
|
-
var
|
|
998
|
+
var Nt = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.center = "center", s))(Nt || {});
|
|
988
999
|
class D {
|
|
989
1000
|
constructor(t) {
|
|
990
1001
|
this.otherProperties = t;
|
|
@@ -1017,10 +1028,10 @@ class D {
|
|
|
1017
1028
|
}
|
|
1018
1029
|
Object.defineProperty(D.prototype, "encryption", {
|
|
1019
1030
|
get: function() {
|
|
1020
|
-
return
|
|
1031
|
+
return Ft.deserialize(this.otherProperties.encrypted);
|
|
1021
1032
|
}
|
|
1022
1033
|
});
|
|
1023
|
-
class
|
|
1034
|
+
class _t {
|
|
1024
1035
|
/** Creates a MediaOverlay object */
|
|
1025
1036
|
constructor(t) {
|
|
1026
1037
|
this.activeClass = t.activeClass, this.playbackActiveClass = t.playbackActiveClass;
|
|
@@ -1030,7 +1041,7 @@ class Ft {
|
|
|
1030
1041
|
*/
|
|
1031
1042
|
static deserialize(t) {
|
|
1032
1043
|
if (t)
|
|
1033
|
-
return new
|
|
1044
|
+
return new _t({
|
|
1034
1045
|
activeClass: t.activeClass,
|
|
1035
1046
|
playbackActiveClass: t.playbackActiveClass
|
|
1036
1047
|
});
|
|
@@ -1043,11 +1054,11 @@ class Ft {
|
|
|
1043
1054
|
return this.activeClass && (t.activeClass = this.activeClass), this.playbackActiveClass && (t.playbackActiveClass = this.playbackActiveClass), t;
|
|
1044
1055
|
}
|
|
1045
1056
|
}
|
|
1046
|
-
function
|
|
1057
|
+
function li(s) {
|
|
1047
1058
|
return s && Array.isArray(s) ? s : void 0;
|
|
1048
1059
|
}
|
|
1049
1060
|
function F(s) {
|
|
1050
|
-
return s && typeof s == "string" ? [s] :
|
|
1061
|
+
return s && typeof s == "string" ? [s] : li(s);
|
|
1051
1062
|
}
|
|
1052
1063
|
function ct(s) {
|
|
1053
1064
|
return typeof s == "string" ? new Date(s) : void 0;
|
|
@@ -1094,30 +1105,30 @@ class Z {
|
|
|
1094
1105
|
class c {
|
|
1095
1106
|
/** Creates a MediaType object. */
|
|
1096
1107
|
constructor(t) {
|
|
1097
|
-
let e, i,
|
|
1098
|
-
const
|
|
1099
|
-
if (
|
|
1100
|
-
if (e =
|
|
1108
|
+
let e, i, r = t.mediaType.replace(/\s/g, "").split(";");
|
|
1109
|
+
const n = r[0].split("/");
|
|
1110
|
+
if (n.length === 2) {
|
|
1111
|
+
if (e = n[0].toLowerCase().trim(), i = n[1].toLowerCase().trim(), e.length === 0 || i.length === 0)
|
|
1101
1112
|
throw new Error("Invalid media type");
|
|
1102
1113
|
} else
|
|
1103
1114
|
throw new Error("Invalid media type");
|
|
1104
1115
|
const a = {};
|
|
1105
|
-
for (let g = 1; g <
|
|
1106
|
-
const
|
|
1107
|
-
if (
|
|
1108
|
-
const
|
|
1109
|
-
a[
|
|
1116
|
+
for (let g = 1; g < r.length; g++) {
|
|
1117
|
+
const v = r[g].split("=");
|
|
1118
|
+
if (v.length === 2) {
|
|
1119
|
+
const C = v[0].toLocaleLowerCase(), d = C === "charset" ? v[1].toUpperCase() : v[1];
|
|
1120
|
+
a[C] = d;
|
|
1110
1121
|
}
|
|
1111
1122
|
}
|
|
1112
1123
|
const o = {}, h = Object.keys(a);
|
|
1113
|
-
h.sort((g,
|
|
1114
|
-
let
|
|
1124
|
+
h.sort((g, v) => g.localeCompare(v)), h.forEach((g) => o[g] = a[g]);
|
|
1125
|
+
let m = "";
|
|
1115
1126
|
for (const g in o) {
|
|
1116
|
-
const
|
|
1117
|
-
|
|
1127
|
+
const v = o[g];
|
|
1128
|
+
m += `;${g}=${v}`;
|
|
1118
1129
|
}
|
|
1119
|
-
const
|
|
1120
|
-
this.string =
|
|
1130
|
+
const p = `${e}/${i}${m}`, u = o.encoding;
|
|
1131
|
+
this.string = p, this.type = e, this.subtype = i, this.parameters = o, this.encoding = u, this.name = t.name, this.fileExtension = t.fileExtension;
|
|
1121
1132
|
}
|
|
1122
1133
|
static parse(t) {
|
|
1123
1134
|
return new c(t);
|
|
@@ -1154,12 +1165,12 @@ class c {
|
|
|
1154
1165
|
if (!((this.type === "*" || this.type === e.type) && (this.subtype === "*" || this.subtype === e.subtype)))
|
|
1155
1166
|
return !1;
|
|
1156
1167
|
const i = new Set(
|
|
1157
|
-
Object.entries(this.parameters).map(([
|
|
1158
|
-
),
|
|
1159
|
-
Object.entries(e.parameters).map(([
|
|
1168
|
+
Object.entries(this.parameters).map(([n, a]) => `${n}=${a}`)
|
|
1169
|
+
), r = new Set(
|
|
1170
|
+
Object.entries(e.parameters).map(([n, a]) => `${n}=${a}`)
|
|
1160
1171
|
);
|
|
1161
|
-
for (const
|
|
1162
|
-
if (!
|
|
1172
|
+
for (const n of Array.from(i.values()))
|
|
1173
|
+
if (!r.has(n))
|
|
1163
1174
|
return !1;
|
|
1164
1175
|
return !0;
|
|
1165
1176
|
}
|
|
@@ -1546,7 +1557,7 @@ class c {
|
|
|
1546
1557
|
});
|
|
1547
1558
|
}
|
|
1548
1559
|
}
|
|
1549
|
-
class
|
|
1560
|
+
class ht {
|
|
1550
1561
|
constructor(t) {
|
|
1551
1562
|
this.uri = t, this.parameters = this.getParameters(t);
|
|
1552
1563
|
}
|
|
@@ -1556,7 +1567,7 @@ class ut {
|
|
|
1556
1567
|
getParameters(t) {
|
|
1557
1568
|
const e = /\{\??([^}]+)\}/g, i = t.match(e);
|
|
1558
1569
|
return i ? new Set(
|
|
1559
|
-
i.join(",").replace(e, "$1").split(",").map((
|
|
1570
|
+
i.join(",").replace(e, "$1").split(",").map((r) => r.trim())
|
|
1560
1571
|
) : /* @__PURE__ */ new Set();
|
|
1561
1572
|
}
|
|
1562
1573
|
/** Expands the URI by replacing the template variables by the given parameters.
|
|
@@ -1564,14 +1575,14 @@ class ut {
|
|
|
1564
1575
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
1565
1576
|
*/
|
|
1566
1577
|
expand(t) {
|
|
1567
|
-
const e = (
|
|
1568
|
-
const a = t[
|
|
1578
|
+
const e = (r) => r.split(",").map((n) => {
|
|
1579
|
+
const a = t[n];
|
|
1569
1580
|
return a ? encodeURIComponent(a) : "";
|
|
1570
|
-
}).join(","), i = (
|
|
1571
|
-
const a =
|
|
1581
|
+
}).join(","), i = (r) => "?" + r.split(",").map((n) => {
|
|
1582
|
+
const a = n.split("=")[0], o = t[a];
|
|
1572
1583
|
return o ? `${a}=${encodeURIComponent(o)}` : "";
|
|
1573
1584
|
}).join("&");
|
|
1574
|
-
return this.uri.replace(/\{(\??)([^}]+)\}/g, (...
|
|
1585
|
+
return this.uri.replace(/\{(\??)([^}]+)\}/g, (...r) => r[1] ? i(r[2]) : e(r[2]));
|
|
1575
1586
|
}
|
|
1576
1587
|
}
|
|
1577
1588
|
class T {
|
|
@@ -1586,7 +1597,7 @@ class T {
|
|
|
1586
1597
|
*/
|
|
1587
1598
|
static deserialize(t) {
|
|
1588
1599
|
if (!t) return;
|
|
1589
|
-
const e = K(t.progression), i = K(t.totalProgression),
|
|
1600
|
+
const e = K(t.progression), i = K(t.totalProgression), r = K(t.position), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set([
|
|
1590
1601
|
"fragment",
|
|
1591
1602
|
"fragments",
|
|
1592
1603
|
"progression",
|
|
@@ -1594,13 +1605,13 @@ class T {
|
|
|
1594
1605
|
"position"
|
|
1595
1606
|
]);
|
|
1596
1607
|
return Object.entries(t).forEach(([o, h]) => {
|
|
1597
|
-
a.has(o) ||
|
|
1608
|
+
a.has(o) || n.set(o, h);
|
|
1598
1609
|
}), new T({
|
|
1599
1610
|
fragments: F(t.fragments || t.fragment),
|
|
1600
1611
|
progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
|
|
1601
1612
|
totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
|
|
1602
|
-
position:
|
|
1603
|
-
otherLocations:
|
|
1613
|
+
position: r !== void 0 && r > 0 ? r : void 0,
|
|
1614
|
+
otherLocations: n.size === 0 ? void 0 : n
|
|
1604
1615
|
});
|
|
1605
1616
|
}
|
|
1606
1617
|
/**
|
|
@@ -1611,7 +1622,7 @@ class T {
|
|
|
1611
1622
|
return this.fragments && (t.fragments = this.fragments), this.progression !== void 0 && (t.progression = this.progression), this.totalProgression !== void 0 && (t.totalProgression = this.totalProgression), this.position !== void 0 && (t.position = this.position), this.otherLocations && this.otherLocations.forEach((e, i) => t[i] = e), t;
|
|
1612
1623
|
}
|
|
1613
1624
|
}
|
|
1614
|
-
class
|
|
1625
|
+
class rt {
|
|
1615
1626
|
/**
|
|
1616
1627
|
* Creates a [Text].
|
|
1617
1628
|
*/
|
|
@@ -1623,7 +1634,7 @@ class nt {
|
|
|
1623
1634
|
*/
|
|
1624
1635
|
static deserialize(t) {
|
|
1625
1636
|
if (t)
|
|
1626
|
-
return new
|
|
1637
|
+
return new rt({
|
|
1627
1638
|
after: t.after,
|
|
1628
1639
|
before: t.before,
|
|
1629
1640
|
highlight: t.highlight
|
|
@@ -1654,7 +1665,7 @@ class k {
|
|
|
1654
1665
|
type: t.type,
|
|
1655
1666
|
title: t.title,
|
|
1656
1667
|
locations: T.deserialize(t.locations),
|
|
1657
|
-
text:
|
|
1668
|
+
text: rt.deserialize(t.text)
|
|
1658
1669
|
});
|
|
1659
1670
|
}
|
|
1660
1671
|
/**
|
|
@@ -1728,14 +1739,14 @@ class U {
|
|
|
1728
1739
|
}
|
|
1729
1740
|
/** List of URI template parameter keys, if the `Link` is templated. */
|
|
1730
1741
|
get templateParameters() {
|
|
1731
|
-
return this.templated ? new
|
|
1742
|
+
return this.templated ? new ht(this.href).parameters : /* @__PURE__ */ new Set();
|
|
1732
1743
|
}
|
|
1733
1744
|
/** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
|
|
1734
1745
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
1735
1746
|
*/
|
|
1736
1747
|
expandTemplate(t) {
|
|
1737
1748
|
return new U({
|
|
1738
|
-
href: new
|
|
1749
|
+
href: new ht(this.href).expand(t),
|
|
1739
1750
|
templated: !1
|
|
1740
1751
|
});
|
|
1741
1752
|
}
|
|
@@ -1816,8 +1827,8 @@ class O {
|
|
|
1816
1827
|
/** Finds all the links matching any of the given media types. */
|
|
1817
1828
|
filterByMediaTypes(t) {
|
|
1818
1829
|
const e = (i) => {
|
|
1819
|
-
for (const
|
|
1820
|
-
if (i.mediaType.matches(
|
|
1830
|
+
for (const r of t)
|
|
1831
|
+
if (i.mediaType.matches(r))
|
|
1821
1832
|
return !0;
|
|
1822
1833
|
return !1;
|
|
1823
1834
|
};
|
|
@@ -1855,13 +1866,13 @@ class O {
|
|
|
1855
1866
|
return this.items.filter((t) => t.type);
|
|
1856
1867
|
}
|
|
1857
1868
|
}
|
|
1858
|
-
const
|
|
1869
|
+
const G = class G {
|
|
1859
1870
|
/**
|
|
1860
1871
|
* translations can be a string or a collection of language/translation pairs,
|
|
1861
1872
|
* for a single string the language is assumed to be undefined
|
|
1862
1873
|
*/
|
|
1863
1874
|
constructor(t) {
|
|
1864
|
-
this.translations = typeof t == "string" ? { [
|
|
1875
|
+
this.translations = typeof t == "string" ? { [G.UNDEFINED_LANGUAGE]: t } : t;
|
|
1865
1876
|
}
|
|
1866
1877
|
/**
|
|
1867
1878
|
* Parses a [LocalizedString] from its RWPM JSON representation.
|
|
@@ -1885,7 +1896,7 @@ const W = class W {
|
|
|
1885
1896
|
*/
|
|
1886
1897
|
static deserialize(t) {
|
|
1887
1898
|
if (t && (typeof t == "string" || t.constructor === Object))
|
|
1888
|
-
return new
|
|
1899
|
+
return new G(t);
|
|
1889
1900
|
}
|
|
1890
1901
|
serialize() {
|
|
1891
1902
|
return this.translations;
|
|
@@ -1899,12 +1910,12 @@ const W = class W {
|
|
|
1899
1910
|
* 4. returns empty string
|
|
1900
1911
|
*/
|
|
1901
1912
|
getTranslation(t) {
|
|
1902
|
-
return this.translations[t ||
|
|
1913
|
+
return this.translations[t || G.UNDEFINED_LANGUAGE] || this.translations[G.UNDEFINED_LANGUAGE] || this.translations[G.LANGUAGE_EN] || (Object.values(this.translations).length === 0 ? "" : Object.values(this.translations)[0]);
|
|
1903
1914
|
}
|
|
1904
1915
|
};
|
|
1905
|
-
|
|
1906
|
-
let M =
|
|
1907
|
-
class
|
|
1916
|
+
G.UNDEFINED_LANGUAGE = "und", G.LANGUAGE_EN = "en";
|
|
1917
|
+
let M = G;
|
|
1918
|
+
class ut {
|
|
1908
1919
|
/**
|
|
1909
1920
|
* Creates a [Contributor] object.
|
|
1910
1921
|
*/
|
|
@@ -1918,9 +1929,9 @@ class ht {
|
|
|
1918
1929
|
*/
|
|
1919
1930
|
static deserialize(t) {
|
|
1920
1931
|
if (t)
|
|
1921
|
-
return typeof t == "string" ? new
|
|
1932
|
+
return typeof t == "string" ? new ut({
|
|
1922
1933
|
name: M.deserialize(t)
|
|
1923
|
-
}) : t.name ? new
|
|
1934
|
+
}) : t.name ? new ut({
|
|
1924
1935
|
name: M.deserialize(t.name),
|
|
1925
1936
|
sortAs: M.deserialize(t.sortAs),
|
|
1926
1937
|
identifier: t.identifier,
|
|
@@ -1953,7 +1964,7 @@ class N {
|
|
|
1953
1964
|
if (!t) return;
|
|
1954
1965
|
const e = Array.isArray(t) ? t : [t];
|
|
1955
1966
|
return new N(
|
|
1956
|
-
e.map((i) =>
|
|
1967
|
+
e.map((i) => ut.deserialize(i)).filter((i) => i !== void 0)
|
|
1957
1968
|
);
|
|
1958
1969
|
}
|
|
1959
1970
|
/**
|
|
@@ -1963,7 +1974,7 @@ class N {
|
|
|
1963
1974
|
return this.items.map((t) => t.serialize());
|
|
1964
1975
|
}
|
|
1965
1976
|
}
|
|
1966
|
-
class
|
|
1977
|
+
class q {
|
|
1967
1978
|
/** Creates an Array of [Subject]. */
|
|
1968
1979
|
constructor(t) {
|
|
1969
1980
|
this.items = t && t.items ? t.items : /* @__PURE__ */ new Map();
|
|
@@ -1974,10 +1985,10 @@ class _ {
|
|
|
1974
1985
|
static deserialize(t) {
|
|
1975
1986
|
if (!(t && typeof t == "object")) return;
|
|
1976
1987
|
const e = /* @__PURE__ */ new Map();
|
|
1977
|
-
return Object.entries(t).forEach(([i,
|
|
1978
|
-
const
|
|
1979
|
-
|
|
1980
|
-
}), new
|
|
1988
|
+
return Object.entries(t).forEach(([i, r]) => {
|
|
1989
|
+
const n = N.deserialize(r);
|
|
1990
|
+
n && n.items.length > 0 && e.set(i, n);
|
|
1991
|
+
}), new q({ items: e });
|
|
1981
1992
|
}
|
|
1982
1993
|
/**
|
|
1983
1994
|
* Serializes a [BelongsTo] to its RWPM JSON representation.
|
|
@@ -1990,8 +2001,8 @@ class _ {
|
|
|
1990
2001
|
}
|
|
1991
2002
|
}
|
|
1992
2003
|
var J = /* @__PURE__ */ ((s) => (s.EPUB = "https://readium.org/webpub-manifest/profiles/epub", s.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", s.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", s.PDF = "https://readium.org/webpub-manifest/profiles/pdf", s))(J || {}), H = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(H || {});
|
|
1993
|
-
function
|
|
1994
|
-
return s === "rtl" ?
|
|
2004
|
+
function rr(s) {
|
|
2005
|
+
return s === "rtl" ? Nt.right : Nt.left;
|
|
1995
2006
|
}
|
|
1996
2007
|
class dt {
|
|
1997
2008
|
/** Creates a [Subject]. */
|
|
@@ -2045,7 +2056,7 @@ class Vt {
|
|
|
2045
2056
|
return this.items.map((t) => t.serialize());
|
|
2046
2057
|
}
|
|
2047
2058
|
}
|
|
2048
|
-
var
|
|
2059
|
+
var hi = /* @__PURE__ */ ((s) => (s.all = "all", s.none = "none", s))(hi || {});
|
|
2049
2060
|
class Yt {
|
|
2050
2061
|
/** Creates a [TDM] object */
|
|
2051
2062
|
constructor(t) {
|
|
@@ -2072,7 +2083,7 @@ class Yt {
|
|
|
2072
2083
|
const tt = class tt {
|
|
2073
2084
|
/** Creates [Metadata] object */
|
|
2074
2085
|
constructor(t) {
|
|
2075
|
-
this.title = t.title, this.typeUri = t.typeUri, this.conformsTo = t.conformsTo, this.identifier = t.identifier, this.altIdentifier = t.altIdentifier, this.subtitle = t.subtitle, this.sortAs = t.sortAs, this.artists = t.artists, this.authors = t.authors, this.colorists = t.colorists, this.contributors = t.contributors, this.editors = t.editors, this.illustrators = t.illustrators, this.inkers = t.inkers, this.letterers = t.letterers, this.narrators = t.narrators, this.pencilers = t.pencilers, this.translators = t.translators, this.languages = t.languages, this.description = t.description, this.publishers = t.publishers, this.imprints = t.imprints, this.published = t.published, this.modified = t.modified, this.subjects = t.subjects, this.belongsTo = t.belongsTo, this.belongsToCollections = t.belongsToCollections, this.belongsToSeries = t.belongsToSeries, this.belongsToCollections && this.belongsToCollections.items.length > 0 && (this.belongsTo || (this.belongsTo = new
|
|
2086
|
+
this.title = t.title, this.typeUri = t.typeUri, this.conformsTo = t.conformsTo, this.identifier = t.identifier, this.altIdentifier = t.altIdentifier, this.subtitle = t.subtitle, this.sortAs = t.sortAs, this.artists = t.artists, this.authors = t.authors, this.colorists = t.colorists, this.contributors = t.contributors, this.editors = t.editors, this.illustrators = t.illustrators, this.inkers = t.inkers, this.letterers = t.letterers, this.narrators = t.narrators, this.pencilers = t.pencilers, this.translators = t.translators, this.languages = t.languages, this.description = t.description, this.publishers = t.publishers, this.imprints = t.imprints, this.published = t.published, this.modified = t.modified, this.subjects = t.subjects, this.belongsTo = t.belongsTo, this.belongsToCollections = t.belongsToCollections, this.belongsToSeries = t.belongsToSeries, this.belongsToCollections && this.belongsToCollections.items.length > 0 && (this.belongsTo || (this.belongsTo = new q()), this.belongsTo.items.set("collection", this.belongsToCollections)), this.belongsToSeries && this.belongsToSeries.items.length > 0 && (this.belongsTo || (this.belongsTo = new q()), this.belongsTo.items.set("series", this.belongsToSeries)), this.layout = t.layout, this.readingProgression = t.readingProgression, this.duration = t.duration, this.numberOfPages = t.numberOfPages, this.accessibility = t.accessibility, this.tdm = t.tdm, this.otherMetadata = t.otherMetadata;
|
|
2076
2087
|
}
|
|
2077
2088
|
/**
|
|
2078
2089
|
* Parses a [Metadata] from its RWPM JSON representation.
|
|
@@ -2081,41 +2092,41 @@ const tt = class tt {
|
|
|
2081
2092
|
*/
|
|
2082
2093
|
static deserialize(t) {
|
|
2083
2094
|
if (!(t && t.title)) return;
|
|
2084
|
-
const e = M.deserialize(t.title), i = t["@type"],
|
|
2095
|
+
const e = M.deserialize(t.title), i = t["@type"], r = F(t.conformsTo), n = t.identifier, a = Z.deserialize(t.altIdentifier), o = M.deserialize(t.subtitle), h = M.deserialize(t.sortAs), m = N.deserialize(t.artist), p = N.deserialize(t.author), u = N.deserialize(t.colorist), g = N.deserialize(t.contributor), v = N.deserialize(t.editor), C = N.deserialize(t.illustrator), d = N.deserialize(t.inker), I = N.deserialize(t.letterer), B = N.deserialize(t.narrator), Me = N.deserialize(t.penciler), Be = N.deserialize(t.translator), Ge = F(t.language), We = t.description, He = N.deserialize(t.publisher), Fe = N.deserialize(t.imprint), _e = ct(t.published), Ve = ct(t.modified), Ye = Vt.deserialize(t.subject), $e = q.deserialize(t.belongsTo), Xe = _.deserialize(t.accessibility), Ke = t.layout, Ze = t.readingProgression, Je = L(t.duration), qe = L(t.numberOfPages), Qe = Yt.deserialize(t.tdm);
|
|
2085
2096
|
let at = Object.assign({}, t);
|
|
2086
|
-
return tt.mappedProperties.forEach((
|
|
2097
|
+
return tt.mappedProperties.forEach((je) => delete at[je]), Object.keys(at).length === 0 && (at = void 0), new tt({
|
|
2087
2098
|
title: e,
|
|
2088
2099
|
typeUri: i,
|
|
2089
|
-
conformsTo:
|
|
2090
|
-
identifier:
|
|
2100
|
+
conformsTo: r,
|
|
2101
|
+
identifier: n,
|
|
2091
2102
|
altIdentifier: a,
|
|
2092
2103
|
subtitle: o,
|
|
2093
2104
|
sortAs: h,
|
|
2094
|
-
artists:
|
|
2095
|
-
authors:
|
|
2105
|
+
artists: m,
|
|
2106
|
+
authors: p,
|
|
2096
2107
|
colorists: u,
|
|
2097
2108
|
contributors: g,
|
|
2098
|
-
editors:
|
|
2099
|
-
illustrators:
|
|
2109
|
+
editors: v,
|
|
2110
|
+
illustrators: C,
|
|
2100
2111
|
inkers: d,
|
|
2101
|
-
letterers:
|
|
2112
|
+
letterers: I,
|
|
2102
2113
|
narrators: B,
|
|
2103
|
-
pencilers:
|
|
2104
|
-
translators:
|
|
2105
|
-
languages:
|
|
2114
|
+
pencilers: Me,
|
|
2115
|
+
translators: Be,
|
|
2116
|
+
languages: Ge,
|
|
2106
2117
|
description: We,
|
|
2107
|
-
publishers:
|
|
2108
|
-
imprints:
|
|
2109
|
-
published:
|
|
2118
|
+
publishers: He,
|
|
2119
|
+
imprints: Fe,
|
|
2120
|
+
published: _e,
|
|
2110
2121
|
modified: Ve,
|
|
2111
2122
|
subjects: Ye,
|
|
2112
2123
|
belongsTo: $e,
|
|
2113
|
-
layout:
|
|
2114
|
-
readingProgression:
|
|
2115
|
-
duration:
|
|
2116
|
-
numberOfPages:
|
|
2117
|
-
accessibility:
|
|
2118
|
-
tdm:
|
|
2124
|
+
layout: Ke,
|
|
2125
|
+
readingProgression: Ze,
|
|
2126
|
+
duration: Je,
|
|
2127
|
+
numberOfPages: qe,
|
|
2128
|
+
accessibility: Xe,
|
|
2129
|
+
tdm: Qe,
|
|
2119
2130
|
otherMetadata: at
|
|
2120
2131
|
});
|
|
2121
2132
|
}
|
|
@@ -2147,9 +2158,9 @@ const tt = class tt {
|
|
|
2147
2158
|
for (const t of this.conformsTo)
|
|
2148
2159
|
switch (t) {
|
|
2149
2160
|
case J.EPUB:
|
|
2150
|
-
return this.layout ||
|
|
2161
|
+
return this.layout || $.reflowable;
|
|
2151
2162
|
case J.DIVINA:
|
|
2152
|
-
return this.layout ===
|
|
2163
|
+
return this.layout === $.reflowable ? $.fixed : this.layout || $.fixed;
|
|
2153
2164
|
case J.AUDIOBOOK:
|
|
2154
2165
|
case J.PDF:
|
|
2155
2166
|
return null;
|
|
@@ -2215,11 +2226,11 @@ tt.mappedProperties = [
|
|
|
2215
2226
|
"accessibility",
|
|
2216
2227
|
"tdm"
|
|
2217
2228
|
];
|
|
2218
|
-
let
|
|
2219
|
-
|
|
2229
|
+
let ft = tt;
|
|
2230
|
+
ft.prototype.getMediaOverlay = function() {
|
|
2220
2231
|
const s = this.otherMetadata?.mediaOverlay;
|
|
2221
2232
|
if (s)
|
|
2222
|
-
return
|
|
2233
|
+
return _t.deserialize(s);
|
|
2223
2234
|
};
|
|
2224
2235
|
D.prototype.getContains = function() {
|
|
2225
2236
|
return new Set(this.otherProperties.contains || []);
|
|
@@ -2240,7 +2251,7 @@ class $t {
|
|
|
2240
2251
|
return this.links !== void 0 && (t.links = this.links.serialize()), this.guided !== void 0 && (t.guided = this.guided.map((e) => e.serialize())), t;
|
|
2241
2252
|
}
|
|
2242
2253
|
}
|
|
2243
|
-
class
|
|
2254
|
+
class pt {
|
|
2244
2255
|
constructor(t) {
|
|
2245
2256
|
this.plain = t.plain, this.ssml = t.ssml, this.language = t.language;
|
|
2246
2257
|
}
|
|
@@ -2250,9 +2261,9 @@ class ft {
|
|
|
2250
2261
|
static deserialize(t) {
|
|
2251
2262
|
if (t != null) {
|
|
2252
2263
|
if (typeof t == "string")
|
|
2253
|
-
return new
|
|
2264
|
+
return new pt({ plain: t });
|
|
2254
2265
|
if (t.plain || t.ssml || t.language)
|
|
2255
|
-
return new
|
|
2266
|
+
return new pt({
|
|
2256
2267
|
plain: t.plain,
|
|
2257
2268
|
ssml: t.ssml,
|
|
2258
2269
|
language: t.language
|
|
@@ -2304,7 +2315,7 @@ class X {
|
|
|
2304
2315
|
imgref: t.imgref,
|
|
2305
2316
|
role: t.role ? new Set(F(t.role)) : void 0,
|
|
2306
2317
|
level: typeof t.level == "number" ? t.level : void 0,
|
|
2307
|
-
text:
|
|
2318
|
+
text: pt.deserialize(t.text),
|
|
2308
2319
|
textref: t.textref,
|
|
2309
2320
|
description: X.deserialize(t.description)
|
|
2310
2321
|
});
|
|
@@ -2349,8 +2360,8 @@ class X {
|
|
|
2349
2360
|
fragmentId: this.fragmentId
|
|
2350
2361
|
};
|
|
2351
2362
|
if (!e) return i;
|
|
2352
|
-
const
|
|
2353
|
-
return i.start =
|
|
2363
|
+
const r = this.parseTimer(e);
|
|
2364
|
+
return i.start = r[0], i.end = r[1], i;
|
|
2354
2365
|
}
|
|
2355
2366
|
parseTimer(t) {
|
|
2356
2367
|
if (!t || !t.startsWith("t=")) return [void 0, void 0];
|
|
@@ -2358,16 +2369,16 @@ class X {
|
|
|
2358
2369
|
return e.length === 1 ? [isNaN(e[0]) ? void 0 : e[0], void 0] : e.length > 2 ? [void 0, void 0] : [isNaN(e[0]) ? void 0 : e[0], isNaN(e[1]) ? void 0 : e[1]];
|
|
2359
2370
|
}
|
|
2360
2371
|
}
|
|
2361
|
-
function
|
|
2372
|
+
function ui(s, t) {
|
|
2362
2373
|
return t.length > 1 ? t.indexOf(s.slice(-1)) > -1 : s.slice(-1) === t;
|
|
2363
2374
|
}
|
|
2364
|
-
function
|
|
2375
|
+
function di(s, t) {
|
|
2365
2376
|
return s.slice(s.length - t.length) === t;
|
|
2366
2377
|
}
|
|
2367
|
-
const
|
|
2368
|
-
endsWith:
|
|
2369
|
-
endsWithChar:
|
|
2370
|
-
},
|
|
2378
|
+
const yt = {
|
|
2379
|
+
endsWith: di,
|
|
2380
|
+
endsWithChar: ui
|
|
2381
|
+
}, fi = [
|
|
2371
2382
|
"ie",
|
|
2372
2383
|
"eg",
|
|
2373
2384
|
"ext",
|
|
@@ -2459,16 +2470,16 @@ const wt = {
|
|
|
2459
2470
|
"Fri",
|
|
2460
2471
|
"Sat"
|
|
2461
2472
|
];
|
|
2462
|
-
function
|
|
2463
|
-
return /^[A-Z][a-z].*/.test(s) ||
|
|
2473
|
+
function de(s) {
|
|
2474
|
+
return /^[A-Z][a-z].*/.test(s) || Lt(s);
|
|
2464
2475
|
}
|
|
2465
|
-
function
|
|
2466
|
-
return
|
|
2476
|
+
function pi(s) {
|
|
2477
|
+
return de(s) || /``|"|'/.test(s.substring(0, 2));
|
|
2467
2478
|
}
|
|
2468
|
-
function
|
|
2469
|
-
return ~
|
|
2479
|
+
function mi(s) {
|
|
2480
|
+
return ~fi.indexOf(s.replace(/\W+/g, ""));
|
|
2470
2481
|
}
|
|
2471
|
-
function
|
|
2482
|
+
function gi(s, t) {
|
|
2472
2483
|
if (s === "a.m." || s === "p.m.") {
|
|
2473
2484
|
var e = t.replace(/\W+/g, "").slice(-3).toLowerCase();
|
|
2474
2485
|
if (e === "day")
|
|
@@ -2476,23 +2487,23 @@ function wi(s, t) {
|
|
|
2476
2487
|
}
|
|
2477
2488
|
return !1;
|
|
2478
2489
|
}
|
|
2479
|
-
function
|
|
2490
|
+
function re(s) {
|
|
2480
2491
|
var t = s.replace(/[\(\)\[\]\{\}]/g, "").match(/(.\.)*/);
|
|
2481
2492
|
return t && t[0].length > 0;
|
|
2482
2493
|
}
|
|
2483
|
-
function
|
|
2484
|
-
return s.length <= 3 ? !0 :
|
|
2494
|
+
function ne(s) {
|
|
2495
|
+
return s.length <= 3 ? !0 : de(s);
|
|
2485
2496
|
}
|
|
2486
|
-
function
|
|
2497
|
+
function Lt(s, t) {
|
|
2487
2498
|
return t && (s = s.slice(t - 1, t + 2)), !isNaN(Number(s));
|
|
2488
2499
|
}
|
|
2489
|
-
function
|
|
2500
|
+
function bi(s) {
|
|
2490
2501
|
return s.match(/^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/);
|
|
2491
2502
|
}
|
|
2492
|
-
function
|
|
2503
|
+
function Ai(s) {
|
|
2493
2504
|
return s.match(/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/);
|
|
2494
2505
|
}
|
|
2495
|
-
function
|
|
2506
|
+
function vi(s) {
|
|
2496
2507
|
var t = 0;
|
|
2497
2508
|
if ((t = s.indexOf(".")) > -1 || (t = s.indexOf("!")) > -1 || (t = s.indexOf("?")) > -1) {
|
|
2498
2509
|
var e = s.charAt(t + 1);
|
|
@@ -2501,10 +2512,10 @@ function Ei(s) {
|
|
|
2501
2512
|
}
|
|
2502
2513
|
return !1;
|
|
2503
2514
|
}
|
|
2504
|
-
function
|
|
2515
|
+
function yi(s) {
|
|
2505
2516
|
return s === "." || s === "!" || s === "?";
|
|
2506
2517
|
}
|
|
2507
|
-
function
|
|
2518
|
+
function wi(s, t) {
|
|
2508
2519
|
t = Object.assign(t || {}, {
|
|
2509
2520
|
newlineBoundary: t && t.newlineBoundary || !0
|
|
2510
2521
|
});
|
|
@@ -2513,30 +2524,30 @@ function xi(s, t) {
|
|
|
2513
2524
|
// Split into words
|
|
2514
2525
|
s.re(e, { split: !0 }),
|
|
2515
2526
|
// Merge words as sentences
|
|
2516
|
-
s.splitAndMerge(function(i,
|
|
2517
|
-
var
|
|
2518
|
-
return !e.test(
|
|
2527
|
+
s.splitAndMerge(function(i, r, n, a, o, h) {
|
|
2528
|
+
var m, p = [i, null], u = i, g = h.slice(o + 1).find(function(C) {
|
|
2529
|
+
return !e.test(C.value);
|
|
2519
2530
|
});
|
|
2520
2531
|
if (i === `
|
|
2521
|
-
` && t.newlineBoundary ||
|
|
2522
|
-
return
|
|
2523
|
-
if (
|
|
2532
|
+
` && t.newlineBoundary || yi(i) || yt.endsWithChar(i, "?!"))
|
|
2533
|
+
return p;
|
|
2534
|
+
if (yt.endsWithChar(i, ".")) {
|
|
2524
2535
|
if (g) {
|
|
2525
|
-
if (i.length === 2 && isNaN(i.charAt(0)) && i.match(/[a-zA-Z]/) ||
|
|
2536
|
+
if (i.length === 2 && isNaN(i.charAt(0)) && i.match(/[a-zA-Z]/) || mi(i))
|
|
2526
2537
|
return u;
|
|
2527
|
-
if (
|
|
2528
|
-
if (
|
|
2538
|
+
if (pi(g.value)) {
|
|
2539
|
+
if (gi(i, g.value) || Lt(g.value) && ne(i))
|
|
2529
2540
|
return u;
|
|
2530
|
-
} else if (
|
|
2541
|
+
} else if (yt.endsWith(i, "..") || re(i) || ne(i))
|
|
2531
2542
|
return u;
|
|
2532
2543
|
}
|
|
2533
|
-
return
|
|
2544
|
+
return p;
|
|
2534
2545
|
}
|
|
2535
|
-
let
|
|
2536
|
-
return (
|
|
2537
|
-
|
|
2546
|
+
let v;
|
|
2547
|
+
return (v = i.indexOf(".")) > -1 && (Lt(i, v) || re(i) || Ai(i) || bi(i)) ? u : (m = vi(i)) ? [
|
|
2548
|
+
m[0] + m[1],
|
|
2538
2549
|
null,
|
|
2539
|
-
|
|
2550
|
+
m[2]
|
|
2540
2551
|
] : u;
|
|
2541
2552
|
}),
|
|
2542
2553
|
// Filter empty sentences
|
|
@@ -2545,27 +2556,27 @@ function xi(s, t) {
|
|
|
2545
2556
|
})
|
|
2546
2557
|
);
|
|
2547
2558
|
}
|
|
2548
|
-
const
|
|
2549
|
-
function
|
|
2559
|
+
const Si = (s, ...t) => (...e) => s(...t, ...e);
|
|
2560
|
+
function Ei(s) {
|
|
2550
2561
|
return {
|
|
2551
|
-
sentences:
|
|
2562
|
+
sentences: Si(wi, s)
|
|
2552
2563
|
};
|
|
2553
2564
|
}
|
|
2554
|
-
function
|
|
2565
|
+
function Ti(s, t) {
|
|
2555
2566
|
return t ? s.reduce(function(e, i) {
|
|
2556
|
-
var
|
|
2567
|
+
var r = [
|
|
2557
2568
|
i.index,
|
|
2558
2569
|
i.offset,
|
|
2559
2570
|
i.value
|
|
2560
2571
|
].join("-");
|
|
2561
|
-
return [e,
|
|
2572
|
+
return [e, r].join(":");
|
|
2562
2573
|
}, t) : null;
|
|
2563
2574
|
}
|
|
2564
|
-
function
|
|
2565
|
-
const { index: t, offset: e, value: i, ...
|
|
2566
|
-
return
|
|
2575
|
+
function Ii(s) {
|
|
2576
|
+
const { index: t, offset: e, value: i, ...r } = s;
|
|
2577
|
+
return r;
|
|
2567
2578
|
}
|
|
2568
|
-
function
|
|
2579
|
+
function xi(s, t) {
|
|
2569
2580
|
var e = 0;
|
|
2570
2581
|
return Array.isArray(t) || (t = [t]), t.map(function(i) {
|
|
2571
2582
|
return i === null ? null : (typeof i == "string" && (i = {
|
|
@@ -2575,31 +2586,31 @@ function zi(s, t) {
|
|
|
2575
2586
|
}), typeof i == "object" && (i.index = i.index || 0, e = e + i.index + i.offset, i.index = s.index + i.index, i.offset = i.offset || i.value.length), i);
|
|
2576
2587
|
});
|
|
2577
2588
|
}
|
|
2578
|
-
function
|
|
2589
|
+
function Ni(s, t) {
|
|
2579
2590
|
if (s.length == 0) return null;
|
|
2580
|
-
var e = "", i = 0,
|
|
2581
|
-
return s.forEach(function(
|
|
2591
|
+
var e = "", i = 0, r = s[0]?.index;
|
|
2592
|
+
return s.forEach(function(n, a) {
|
|
2582
2593
|
var o = s[a - 1];
|
|
2583
2594
|
s[a + 1];
|
|
2584
|
-
var h = o ?
|
|
2585
|
-
e = e + new Array(h).join(t) +
|
|
2586
|
-
var
|
|
2587
|
-
|
|
2595
|
+
var h = o ? n.index + 1 - (o.index + o.offset) : 0;
|
|
2596
|
+
e = e + new Array(h).join(t) + n.value;
|
|
2597
|
+
var m = n.index - r + n.offset;
|
|
2598
|
+
m > i && (i = m);
|
|
2588
2599
|
}), {
|
|
2589
2600
|
// Index equal is the one from the first token
|
|
2590
|
-
index:
|
|
2601
|
+
index: r,
|
|
2591
2602
|
value: e,
|
|
2592
2603
|
offset: Math.max(i, e.length)
|
|
2593
2604
|
};
|
|
2594
2605
|
}
|
|
2595
2606
|
const Q = {
|
|
2596
|
-
tokensId:
|
|
2597
|
-
normalize:
|
|
2598
|
-
properties:
|
|
2599
|
-
merge:
|
|
2607
|
+
tokensId: Ti,
|
|
2608
|
+
normalize: xi,
|
|
2609
|
+
properties: Ii,
|
|
2610
|
+
merge: Ni
|
|
2600
2611
|
};
|
|
2601
|
-
var
|
|
2602
|
-
"([^" +
|
|
2612
|
+
var Li = ' \r\n !"#$%&()*+,-.\\/:;<=>?@[\\]^_`{|}~', Oi = new RegExp(
|
|
2613
|
+
"([^" + Li + "]+)"
|
|
2603
2614
|
);
|
|
2604
2615
|
function z(s) {
|
|
2605
2616
|
if (!(this instanceof z)) return new z(s);
|
|
@@ -2613,54 +2624,54 @@ function z(s) {
|
|
|
2613
2624
|
}
|
|
2614
2625
|
z.prototype.split = function(t, e = {}) {
|
|
2615
2626
|
var i = this;
|
|
2616
|
-
return e = Object.assign({ preserveProperties: !0, cache: () => null }, e), function(
|
|
2627
|
+
return e = Object.assign({ preserveProperties: !0, cache: () => null }, e), function(r, n) {
|
|
2617
2628
|
if (arguments.length === 6) return t.apply(null, arguments);
|
|
2618
2629
|
var a, o, h;
|
|
2619
|
-
if (
|
|
2620
|
-
if (typeof
|
|
2621
|
-
value:
|
|
2630
|
+
if (r === void 0) return [];
|
|
2631
|
+
if (typeof r == "string" ? r = [{
|
|
2632
|
+
value: r,
|
|
2622
2633
|
index: 0,
|
|
2623
|
-
offset:
|
|
2624
|
-
}] : Array.isArray(
|
|
2634
|
+
offset: r.length
|
|
2635
|
+
}] : Array.isArray(r) || (r = [r]), o = Q.tokensId(r, e.cache()), o && (h = i.opts.cacheGet(o), h))
|
|
2625
2636
|
return h;
|
|
2626
|
-
var
|
|
2627
|
-
var g =
|
|
2628
|
-
|
|
2629
|
-
Object.assign({},
|
|
2637
|
+
var m = r.map(function(p, u) {
|
|
2638
|
+
var g = r[u + 1], v = t(
|
|
2639
|
+
p.value,
|
|
2640
|
+
Object.assign({}, p),
|
|
2630
2641
|
a ? Object.assign({}, a) : null,
|
|
2631
2642
|
g ? Object.assign({}, g) : null,
|
|
2632
2643
|
u,
|
|
2633
|
-
|
|
2644
|
+
r
|
|
2634
2645
|
) || [];
|
|
2635
|
-
if (
|
|
2636
|
-
var
|
|
2637
|
-
|
|
2638
|
-
return Object.assign({}, d,
|
|
2646
|
+
if (v = Q.normalize(p, v), e.preserveProperties) {
|
|
2647
|
+
var C = Q.properties(p);
|
|
2648
|
+
v = v.map(function(d) {
|
|
2649
|
+
return Object.assign({}, d, C);
|
|
2639
2650
|
});
|
|
2640
2651
|
}
|
|
2641
|
-
return a =
|
|
2652
|
+
return a = p, v;
|
|
2642
2653
|
}).filter(Boolean).flat();
|
|
2643
|
-
return o && i.opts.cacheSet(o,
|
|
2654
|
+
return o && i.opts.cacheSet(o, m), m;
|
|
2644
2655
|
};
|
|
2645
2656
|
};
|
|
2646
2657
|
z.prototype.re = function(t, e = {}) {
|
|
2647
|
-
return e = Object.assign({ split: !1 }, e), this.split(function(i,
|
|
2648
|
-
for (var
|
|
2649
|
-
var
|
|
2650
|
-
if (e.split && h <
|
|
2651
|
-
var
|
|
2658
|
+
return e = Object.assign({ split: !1 }, e), this.split(function(i, r) {
|
|
2659
|
+
for (var n = i, a = [], o, h = 0; o = t.exec(i); ) {
|
|
2660
|
+
var m = o.index, p = h + m, u = o[0] || "", g = u.length;
|
|
2661
|
+
if (e.split && h < p) {
|
|
2662
|
+
var v = n.slice(h, p);
|
|
2652
2663
|
a.push({
|
|
2653
|
-
value:
|
|
2664
|
+
value: v,
|
|
2654
2665
|
index: h,
|
|
2655
|
-
offset:
|
|
2666
|
+
offset: v.length
|
|
2656
2667
|
});
|
|
2657
2668
|
}
|
|
2658
2669
|
a.push({
|
|
2659
2670
|
value: u,
|
|
2660
|
-
index:
|
|
2671
|
+
index: p,
|
|
2661
2672
|
offset: g,
|
|
2662
2673
|
match: o
|
|
2663
|
-
}), i = i.slice(
|
|
2674
|
+
}), i = i.slice(m + g), h = p + g;
|
|
2664
2675
|
}
|
|
2665
2676
|
return e.split && i && a.push({
|
|
2666
2677
|
value: i,
|
|
@@ -2675,20 +2686,20 @@ z.prototype.re = function(t, e = {}) {
|
|
|
2675
2686
|
};
|
|
2676
2687
|
z.prototype.splitAndMerge = function(t, e = {}) {
|
|
2677
2688
|
var i = this;
|
|
2678
|
-
return e = Object.assign({ mergeWith: "" }, e), function(
|
|
2679
|
-
var
|
|
2689
|
+
return e = Object.assign({ mergeWith: "" }, e), function(r) {
|
|
2690
|
+
var n = [], a = [];
|
|
2680
2691
|
function o() {
|
|
2681
2692
|
if (a.length != 0) {
|
|
2682
2693
|
var h = Q.merge(a, e.mergeWith);
|
|
2683
|
-
|
|
2694
|
+
n.push(h), a = [];
|
|
2684
2695
|
}
|
|
2685
2696
|
}
|
|
2686
|
-
return i.split(function(h,
|
|
2687
|
-
var
|
|
2688
|
-
|
|
2697
|
+
return i.split(function(h, m) {
|
|
2698
|
+
var p = t.apply(null, arguments);
|
|
2699
|
+
p = Q.normalize(m, p), p.forEach(function(u) {
|
|
2689
2700
|
u === null ? o() : a.push(u);
|
|
2690
2701
|
});
|
|
2691
|
-
})(
|
|
2702
|
+
})(r), o(), n;
|
|
2692
2703
|
};
|
|
2693
2704
|
};
|
|
2694
2705
|
z.prototype.filter = function(t) {
|
|
@@ -2703,20 +2714,20 @@ z.prototype.filter = function(t) {
|
|
|
2703
2714
|
};
|
|
2704
2715
|
z.prototype.extend = function(t) {
|
|
2705
2716
|
return this.split(function(e, i) {
|
|
2706
|
-
var
|
|
2717
|
+
var r = typeof t == "function" ? t.apply(null, arguments) : t;
|
|
2707
2718
|
return Object.assign({
|
|
2708
2719
|
value: i.value,
|
|
2709
2720
|
index: 0,
|
|
2710
2721
|
offset: i.offset
|
|
2711
|
-
},
|
|
2722
|
+
}, r);
|
|
2712
2723
|
});
|
|
2713
2724
|
};
|
|
2714
2725
|
z.prototype.ifthen = function(s, t) {
|
|
2715
2726
|
return this.split(function(e, i) {
|
|
2716
2727
|
if (s.apply(null, arguments))
|
|
2717
2728
|
return t.apply(null, arguments);
|
|
2718
|
-
const { index:
|
|
2719
|
-
return
|
|
2729
|
+
const { index: r, ...n } = i;
|
|
2730
|
+
return n;
|
|
2720
2731
|
});
|
|
2721
2732
|
};
|
|
2722
2733
|
z.prototype.test = function(t) {
|
|
@@ -2727,11 +2738,11 @@ z.prototype.test = function(t) {
|
|
|
2727
2738
|
});
|
|
2728
2739
|
};
|
|
2729
2740
|
z.prototype.flow = function(...t) {
|
|
2730
|
-
const e = t.reduce((i,
|
|
2741
|
+
const e = t.reduce((i, r) => (...n) => r(i(...n)));
|
|
2731
2742
|
return this.split(e);
|
|
2732
2743
|
};
|
|
2733
2744
|
z.prototype.serie = function(...t) {
|
|
2734
|
-
return t.reduce((e, i) => (...
|
|
2745
|
+
return t.reduce((e, i) => (...r) => i(e(...r)));
|
|
2735
2746
|
};
|
|
2736
2747
|
z.prototype.merge = function() {
|
|
2737
2748
|
return this.splitAndMerge((s) => [s]);
|
|
@@ -2740,14 +2751,14 @@ z.prototype.sections = function() {
|
|
|
2740
2751
|
return this.re(/([^\n\.,;!?]+)/i, { split: !1 });
|
|
2741
2752
|
};
|
|
2742
2753
|
z.prototype.words = function() {
|
|
2743
|
-
return this.re(
|
|
2754
|
+
return this.re(Oi);
|
|
2744
2755
|
};
|
|
2745
2756
|
z.prototype.characters = function() {
|
|
2746
2757
|
return this.re(/[^\s]/);
|
|
2747
2758
|
};
|
|
2748
|
-
var
|
|
2749
|
-
const
|
|
2750
|
-
class
|
|
2759
|
+
var zi = /* @__PURE__ */ ((s) => (s.Word = "word", s.Sentence = "sentence", s.Paragraph = "paragraph", s))(zi || {});
|
|
2760
|
+
const Ri = (s, t) => "Segmenter" in Intl ? new Ci(s, t) : new Pi(s, t);
|
|
2761
|
+
class Ci {
|
|
2751
2762
|
constructor(t, e) {
|
|
2752
2763
|
if (this.unit = e, t = t ?? navigator?.language, !("Segmenter" in Intl)) throw new Error("Intl.Segmenter is not supported in this environment");
|
|
2753
2764
|
if (e === "paragraph") throw new Error("IntlTextTokenizer does not handle TextUnit.Paragraph");
|
|
@@ -2757,15 +2768,15 @@ class Ui {
|
|
|
2757
2768
|
}
|
|
2758
2769
|
tokenize(t) {
|
|
2759
2770
|
const e = this.segmenter.segment(t), i = [];
|
|
2760
|
-
for (let
|
|
2761
|
-
if (this.unit === "word" &&
|
|
2762
|
-
const
|
|
2763
|
-
|
|
2771
|
+
for (let r of e) {
|
|
2772
|
+
if (this.unit === "word" && r.isWordLike === !1) continue;
|
|
2773
|
+
const n = fe(r.segment);
|
|
2774
|
+
n !== null && i.push([r.index, r.index + n.length]);
|
|
2764
2775
|
}
|
|
2765
2776
|
return i;
|
|
2766
2777
|
}
|
|
2767
2778
|
}
|
|
2768
|
-
class
|
|
2779
|
+
class Pi {
|
|
2769
2780
|
constructor(t, e) {
|
|
2770
2781
|
if (this.unit = e, t = t ?? navigator?.language, this.isEnglish = t.toLowerCase().split("-")[0] === "en", e === "paragraph") throw new Error("NaiveTextTokenizer does not handle TextUnit.Paragraph");
|
|
2771
2782
|
this.tokenizer = new z();
|
|
@@ -2777,27 +2788,27 @@ class Mi {
|
|
|
2777
2788
|
e = this.tokenizer.words()(t);
|
|
2778
2789
|
break;
|
|
2779
2790
|
case "sentence":
|
|
2780
|
-
this.isEnglish ? e =
|
|
2791
|
+
this.isEnglish ? e = Ei(this.tokenizer).sentences()(t) : e = this.tokenizer.sections()(t);
|
|
2781
2792
|
break;
|
|
2782
2793
|
default:
|
|
2783
2794
|
e = [];
|
|
2784
2795
|
}
|
|
2785
2796
|
if (!e) return [];
|
|
2786
2797
|
const i = [];
|
|
2787
|
-
return e.forEach((
|
|
2788
|
-
if (
|
|
2789
|
-
const
|
|
2790
|
-
|
|
2798
|
+
return e.forEach((r) => {
|
|
2799
|
+
if (r.value.length === 0) return;
|
|
2800
|
+
const n = fe(r.value);
|
|
2801
|
+
n !== null && i.push([r.index, r.index + n.length]);
|
|
2791
2802
|
}), i;
|
|
2792
2803
|
}
|
|
2793
2804
|
}
|
|
2794
|
-
const
|
|
2805
|
+
const ki = new RegExp("[\\p{L}\\p{N}]+", "u"), fe = (s) => {
|
|
2795
2806
|
const t = s.trimEnd();
|
|
2796
|
-
return t.length === 0 || t.match(
|
|
2807
|
+
return t.length === 0 || t.match(ki) === null ? null : t;
|
|
2797
2808
|
};
|
|
2798
|
-
class
|
|
2809
|
+
class V {
|
|
2799
2810
|
constructor(t) {
|
|
2800
|
-
this.fetcher = new
|
|
2811
|
+
this.fetcher = new ti(), t.fetcher && (this.fetcher = t.fetcher), this.manifest = t.manifest, this.context = t.manifest.context, this.metadata = t.manifest.metadata, this.links = t.manifest.links, this.readingOrder = t.manifest.readingOrder, this.resources = t.manifest.resources, this.toc = t.manifest.toc, this.subcollections = t.manifest.subcollections;
|
|
2801
2812
|
}
|
|
2802
2813
|
/** The URL where this publication is served, computed from the `Link` with `self` relation.
|
|
2803
2814
|
* e.g. https://provider.com/pub1293/manifest.json gives https://provider.com/pub1293/
|
|
@@ -2849,15 +2860,15 @@ class Y {
|
|
|
2849
2860
|
if (i || (i = this.manifest.links.findWithMediaType(
|
|
2850
2861
|
"application/guided-navigation+json"
|
|
2851
2862
|
)), !i) return;
|
|
2852
|
-
let
|
|
2863
|
+
let r = i.href;
|
|
2853
2864
|
if (i.templated) {
|
|
2854
|
-
const a = new
|
|
2855
|
-
a.parameters.has("ref") && (o.ref = t.href),
|
|
2865
|
+
const a = new ht(r), o = {};
|
|
2866
|
+
a.parameters.has("ref") && (o.ref = t.href), r = new ht(r).expand(o);
|
|
2856
2867
|
}
|
|
2857
|
-
const
|
|
2858
|
-
href:
|
|
2868
|
+
const n = await this.get(new U({
|
|
2869
|
+
href: r
|
|
2859
2870
|
})).readAsJSON();
|
|
2860
|
-
return $t.deserialize(
|
|
2871
|
+
return $t.deserialize(n);
|
|
2861
2872
|
}
|
|
2862
2873
|
/**
|
|
2863
2874
|
* Returns the resource targeted by the given non-templated [link].
|
|
@@ -2866,22 +2877,22 @@ class Y {
|
|
|
2866
2877
|
return this.fetcher.get(t);
|
|
2867
2878
|
}
|
|
2868
2879
|
}
|
|
2869
|
-
|
|
2880
|
+
V.prototype.getPageList = function() {
|
|
2870
2881
|
return this.linksWithRole("pageList");
|
|
2871
2882
|
};
|
|
2872
|
-
|
|
2883
|
+
V.prototype.getLandmarks = function() {
|
|
2873
2884
|
return this.linksWithRole("landmarks");
|
|
2874
2885
|
};
|
|
2875
|
-
|
|
2886
|
+
V.prototype.getListOfAudioClips = function() {
|
|
2876
2887
|
return this.linksWithRole("loa");
|
|
2877
2888
|
};
|
|
2878
|
-
|
|
2889
|
+
V.prototype.getListOfIllustrations = function() {
|
|
2879
2890
|
return this.linksWithRole("loi");
|
|
2880
2891
|
};
|
|
2881
|
-
|
|
2892
|
+
V.prototype.getListOfTables = function() {
|
|
2882
2893
|
return this.linksWithRole("lot");
|
|
2883
2894
|
};
|
|
2884
|
-
|
|
2895
|
+
V.prototype.getListOfVideoClips = function() {
|
|
2885
2896
|
return this.linksWithRole("lov");
|
|
2886
2897
|
};
|
|
2887
2898
|
class mt {
|
|
@@ -2916,7 +2927,7 @@ class mt {
|
|
|
2916
2927
|
return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
|
|
2917
2928
|
}
|
|
2918
2929
|
}
|
|
2919
|
-
class
|
|
2930
|
+
class Xt {
|
|
2920
2931
|
/**
|
|
2921
2932
|
* Creates a [DomRange].
|
|
2922
2933
|
*/
|
|
@@ -2930,7 +2941,7 @@ class qt {
|
|
|
2930
2941
|
if (!t) return;
|
|
2931
2942
|
let e = mt.deserialize(t.start);
|
|
2932
2943
|
if (e)
|
|
2933
|
-
return new
|
|
2944
|
+
return new Xt({
|
|
2934
2945
|
start: e,
|
|
2935
2946
|
end: mt.deserialize(t.end)
|
|
2936
2947
|
});
|
|
@@ -2950,7 +2961,7 @@ T.prototype.getPartialCfi = function() {
|
|
|
2950
2961
|
return this.otherLocations?.get("partialCfi");
|
|
2951
2962
|
};
|
|
2952
2963
|
T.prototype.getDomRange = function() {
|
|
2953
|
-
return
|
|
2964
|
+
return Xt.deserialize(this.otherLocations?.get("domRange"));
|
|
2954
2965
|
};
|
|
2955
2966
|
T.prototype.fragmentParameters = function() {
|
|
2956
2967
|
return new Map(
|
|
@@ -2984,7 +2995,7 @@ T.prototype.space = function() {
|
|
|
2984
2995
|
if (t.length === 4 && !t.some(isNaN))
|
|
2985
2996
|
return t;
|
|
2986
2997
|
};
|
|
2987
|
-
class
|
|
2998
|
+
class Kt {
|
|
2988
2999
|
/** Creates a [Price]. */
|
|
2989
3000
|
constructor(t) {
|
|
2990
3001
|
this.currency = t.currency, this.value = t.value;
|
|
@@ -2999,7 +3010,7 @@ class Xt {
|
|
|
2999
3010
|
return;
|
|
3000
3011
|
let i = L(t.value);
|
|
3001
3012
|
if (i !== void 0)
|
|
3002
|
-
return new
|
|
3013
|
+
return new Kt({ currency: e, value: i });
|
|
3003
3014
|
}
|
|
3004
3015
|
/**
|
|
3005
3016
|
* Serializes a [Price] to its RWPM JSON representation.
|
|
@@ -3035,7 +3046,7 @@ class j {
|
|
|
3035
3046
|
return this.children && (t.children = this.children.map((e) => e.serialize())), t;
|
|
3036
3047
|
}
|
|
3037
3048
|
}
|
|
3038
|
-
class
|
|
3049
|
+
class Zt {
|
|
3039
3050
|
/** Creates a [Price]. */
|
|
3040
3051
|
constructor(t) {
|
|
3041
3052
|
this.total = t.total, this.position = t.position;
|
|
@@ -3045,7 +3056,7 @@ class Kt {
|
|
|
3045
3056
|
*/
|
|
3046
3057
|
static deserialize(t) {
|
|
3047
3058
|
if (t)
|
|
3048
|
-
return new
|
|
3059
|
+
return new Zt({
|
|
3049
3060
|
total: L(t.total),
|
|
3050
3061
|
position: L(t.position)
|
|
3051
3062
|
});
|
|
@@ -3058,7 +3069,7 @@ class Kt {
|
|
|
3058
3069
|
return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
|
|
3059
3070
|
}
|
|
3060
3071
|
}
|
|
3061
|
-
class
|
|
3072
|
+
class Jt {
|
|
3062
3073
|
/** Creates a [Copies]. */
|
|
3063
3074
|
constructor(t) {
|
|
3064
3075
|
this.total = t.total, this.available = t.available;
|
|
@@ -3068,7 +3079,7 @@ class Zt {
|
|
|
3068
3079
|
*/
|
|
3069
3080
|
static deserialize(t) {
|
|
3070
3081
|
if (t)
|
|
3071
|
-
return new
|
|
3082
|
+
return new Jt({
|
|
3072
3083
|
total: L(t.total),
|
|
3073
3084
|
available: L(t.available)
|
|
3074
3085
|
});
|
|
@@ -3081,8 +3092,8 @@ class Zt {
|
|
|
3081
3092
|
return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
|
|
3082
3093
|
}
|
|
3083
3094
|
}
|
|
3084
|
-
var
|
|
3085
|
-
class
|
|
3095
|
+
var Di = /* @__PURE__ */ ((s) => (s.available = "available", s.reserved = "reserved", s.ready = "ready", s))(Di || {});
|
|
3096
|
+
class qt {
|
|
3086
3097
|
/** Creates a [Availability]. */
|
|
3087
3098
|
constructor(t) {
|
|
3088
3099
|
this.state = t.state, this.since = t.since, this.until = t.until;
|
|
@@ -3092,7 +3103,7 @@ class Jt {
|
|
|
3092
3103
|
*/
|
|
3093
3104
|
static deserialize(t) {
|
|
3094
3105
|
if (t && t.state)
|
|
3095
|
-
return new
|
|
3106
|
+
return new qt({
|
|
3096
3107
|
state: t.state,
|
|
3097
3108
|
since: ct(t.since),
|
|
3098
3109
|
until: ct(t.until)
|
|
@@ -3110,7 +3121,7 @@ D.prototype.getNumberOfItems = function() {
|
|
|
3110
3121
|
return L(this.otherProperties.numberOfItems);
|
|
3111
3122
|
};
|
|
3112
3123
|
D.prototype.getPrice = function() {
|
|
3113
|
-
return
|
|
3124
|
+
return Kt.deserialize(this.otherProperties.price);
|
|
3114
3125
|
};
|
|
3115
3126
|
D.prototype.getIndirectAcquisitions = function() {
|
|
3116
3127
|
const s = this.otherProperties.indirectAcquisition;
|
|
@@ -3118,21 +3129,21 @@ D.prototype.getIndirectAcquisitions = function() {
|
|
|
3118
3129
|
return s.map((t) => j.deserialize(t)).filter((t) => t !== void 0);
|
|
3119
3130
|
};
|
|
3120
3131
|
D.prototype.getHolds = function() {
|
|
3121
|
-
return
|
|
3132
|
+
return Zt.deserialize(this.otherProperties.holds);
|
|
3122
3133
|
};
|
|
3123
3134
|
D.prototype.getCopies = function() {
|
|
3124
|
-
return
|
|
3135
|
+
return Jt.deserialize(this.otherProperties.copies);
|
|
3125
3136
|
};
|
|
3126
3137
|
D.prototype.getAvailability = function() {
|
|
3127
|
-
return
|
|
3138
|
+
return qt.deserialize(this.otherProperties.availability);
|
|
3128
3139
|
};
|
|
3129
3140
|
D.prototype.getAuthenticate = function() {
|
|
3130
3141
|
return U.deserialize(this.otherProperties.authenticate);
|
|
3131
3142
|
};
|
|
3132
|
-
|
|
3143
|
+
V.prototype.getImages = function() {
|
|
3133
3144
|
return this.linksWithRole("images");
|
|
3134
3145
|
};
|
|
3135
|
-
class
|
|
3146
|
+
class nr {
|
|
3136
3147
|
/**
|
|
3137
3148
|
* Extracts the full raw text, or returns null if no text content can be found.
|
|
3138
3149
|
* @param separator Separator to use between individual elements. Defaults to newline.
|
|
@@ -3151,12 +3162,12 @@ class on {
|
|
|
3151
3162
|
return t;
|
|
3152
3163
|
}
|
|
3153
3164
|
}
|
|
3154
|
-
class
|
|
3165
|
+
class ae {
|
|
3155
3166
|
constructor(t, e) {
|
|
3156
3167
|
this.key = t, this.value = e;
|
|
3157
3168
|
}
|
|
3158
3169
|
}
|
|
3159
|
-
var
|
|
3170
|
+
var Ot = /* @__PURE__ */ ((s) => (s.ACCESSIBILITY_LABEL = "accessibilityLabel", s.LANGUAGE = "language", s))(Ot || {});
|
|
3160
3171
|
class pe {
|
|
3161
3172
|
constructor(t = []) {
|
|
3162
3173
|
this._attributes = t;
|
|
@@ -3186,12 +3197,12 @@ class pe {
|
|
|
3186
3197
|
return this._attributes.filter((e) => e.key === t).map((e) => e.value);
|
|
3187
3198
|
}
|
|
3188
3199
|
}
|
|
3189
|
-
class
|
|
3200
|
+
class me extends pe {
|
|
3190
3201
|
constructor(t, e = []) {
|
|
3191
3202
|
super(e), this.locator = t;
|
|
3192
3203
|
}
|
|
3193
3204
|
}
|
|
3194
|
-
class
|
|
3205
|
+
class vt extends me {
|
|
3195
3206
|
/**
|
|
3196
3207
|
* Human-readable text representation for this element.
|
|
3197
3208
|
*/
|
|
@@ -3199,38 +3210,38 @@ class At extends fe {
|
|
|
3199
3210
|
return this.accessibilityLabel;
|
|
3200
3211
|
}
|
|
3201
3212
|
}
|
|
3202
|
-
class
|
|
3213
|
+
class Ui extends vt {
|
|
3203
3214
|
constructor(t, e, i = []) {
|
|
3204
3215
|
super(t, i), this.embeddedLink = e;
|
|
3205
3216
|
}
|
|
3206
3217
|
}
|
|
3207
|
-
class
|
|
3218
|
+
class Mi extends vt {
|
|
3208
3219
|
constructor(t, e, i = []) {
|
|
3209
3220
|
super(t, i), this.embeddedLink = e;
|
|
3210
3221
|
}
|
|
3211
3222
|
}
|
|
3212
|
-
class
|
|
3213
|
-
constructor(t, e, i,
|
|
3214
|
-
super(t,
|
|
3223
|
+
class Bi extends vt {
|
|
3224
|
+
constructor(t, e, i, r = []) {
|
|
3225
|
+
super(t, r), this.embeddedLink = e, this.caption = i;
|
|
3215
3226
|
}
|
|
3216
3227
|
get text() {
|
|
3217
3228
|
return (this.caption?.length || 0) > 0 ? this.caption : super.text;
|
|
3218
3229
|
}
|
|
3219
3230
|
}
|
|
3220
|
-
class
|
|
3231
|
+
class ge extends pe {
|
|
3221
3232
|
constructor(t, e, i = []) {
|
|
3222
3233
|
super(i), this.locator = t, this.text = e;
|
|
3223
3234
|
}
|
|
3224
3235
|
}
|
|
3225
|
-
class
|
|
3226
|
-
constructor(t, e, i,
|
|
3227
|
-
super(t,
|
|
3236
|
+
class zt extends vt {
|
|
3237
|
+
constructor(t, e, i, r = []) {
|
|
3238
|
+
super(t, r), this.role = e, this.segments = i;
|
|
3228
3239
|
}
|
|
3229
3240
|
get text() {
|
|
3230
3241
|
return this.segments.map((t) => t.text).join("");
|
|
3231
3242
|
}
|
|
3232
3243
|
}
|
|
3233
|
-
class
|
|
3244
|
+
class Gi {
|
|
3234
3245
|
constructor(t) {
|
|
3235
3246
|
this.level = t;
|
|
3236
3247
|
}
|
|
@@ -3238,17 +3249,17 @@ class Vi {
|
|
|
3238
3249
|
return `heading-${this.level}`;
|
|
3239
3250
|
}
|
|
3240
3251
|
}
|
|
3241
|
-
const
|
|
3252
|
+
const Wi = {
|
|
3242
3253
|
role: "body"
|
|
3243
|
-
},
|
|
3254
|
+
}, Hi = {
|
|
3244
3255
|
role: "footnote"
|
|
3245
3256
|
};
|
|
3246
|
-
class
|
|
3257
|
+
class Fi {
|
|
3247
3258
|
constructor(t, e) {
|
|
3248
3259
|
this.referenceUrl = t, this.referenceTitle = e, this.role = "quote";
|
|
3249
3260
|
}
|
|
3250
3261
|
}
|
|
3251
|
-
class
|
|
3262
|
+
class ar {
|
|
3252
3263
|
/**
|
|
3253
3264
|
*
|
|
3254
3265
|
* @param defaultLanguage The default assumed language
|
|
@@ -3256,12 +3267,12 @@ class cn {
|
|
|
3256
3267
|
* @param contextSnippetLength Length of `before` and `after` snippets in the produced [Locator]s.
|
|
3257
3268
|
* @param textTokenizerFactory Factory to create a [TextTokenizer] from, using the specified language and unit.
|
|
3258
3269
|
*/
|
|
3259
|
-
constructor(t, e, i = 50,
|
|
3260
|
-
this.defaultLanguage = t, this.contextSnippetLength = i, this.textTokenizerFactory =
|
|
3270
|
+
constructor(t, e, i = 50, r = (n) => Ri(n, e)) {
|
|
3271
|
+
this.defaultLanguage = t, this.contextSnippetLength = i, this.textTokenizerFactory = r;
|
|
3261
3272
|
}
|
|
3262
3273
|
tokenize(t) {
|
|
3263
|
-
return t instanceof
|
|
3264
|
-
new
|
|
3274
|
+
return t instanceof zt ? [
|
|
3275
|
+
new zt(
|
|
3265
3276
|
t.locator,
|
|
3266
3277
|
t.role,
|
|
3267
3278
|
t.segments.map((e) => this.tokenizeSegment(e)).flat()
|
|
@@ -3269,7 +3280,7 @@ class cn {
|
|
|
3269
3280
|
] : [t];
|
|
3270
3281
|
}
|
|
3271
3282
|
tokenizeSegment(t) {
|
|
3272
|
-
return this.textTokenizerFactory(t.language ?? this.defaultLanguage).tokenize(t.text).map((e) => new
|
|
3283
|
+
return this.textTokenizerFactory(t.language ?? this.defaultLanguage).tokenize(t.text).map((e) => new ge(
|
|
3273
3284
|
new k({
|
|
3274
3285
|
href: t.locator.href,
|
|
3275
3286
|
type: t.locator.type,
|
|
@@ -3282,10 +3293,10 @@ class cn {
|
|
|
3282
3293
|
));
|
|
3283
3294
|
}
|
|
3284
3295
|
extractTextContextIn(t, e) {
|
|
3285
|
-
const i = t.substring(e[1], e[1] + this.contextSnippetLength),
|
|
3286
|
-
return new
|
|
3296
|
+
const i = t.substring(e[1], e[1] + this.contextSnippetLength), r = t.substring(e[0] - this.contextSnippetLength, e[0]);
|
|
3297
|
+
return new rt({
|
|
3287
3298
|
after: i.length > 0 ? i : void 0,
|
|
3288
|
-
before:
|
|
3299
|
+
before: r.length > 0 ? r : void 0,
|
|
3289
3300
|
highlight: t.substring(e[0], e[1])
|
|
3290
3301
|
});
|
|
3291
3302
|
}
|
|
@@ -3295,7 +3306,7 @@ class et extends Error {
|
|
|
3295
3306
|
super(t);
|
|
3296
3307
|
}
|
|
3297
3308
|
}
|
|
3298
|
-
class
|
|
3309
|
+
class Qt {
|
|
3299
3310
|
/**
|
|
3300
3311
|
* Advances to the next item and returns it, or null if we reached the end.
|
|
3301
3312
|
*/
|
|
@@ -3309,12 +3320,12 @@ class _t {
|
|
|
3309
3320
|
return await this.hasPrevious() ? this.previous() : null;
|
|
3310
3321
|
}
|
|
3311
3322
|
}
|
|
3312
|
-
let
|
|
3323
|
+
let _i = class {
|
|
3313
3324
|
constructor(t, e) {
|
|
3314
3325
|
this.element = t, this.direction = e;
|
|
3315
3326
|
}
|
|
3316
3327
|
};
|
|
3317
|
-
class
|
|
3328
|
+
class cr extends Qt {
|
|
3318
3329
|
constructor(t, e, i) {
|
|
3319
3330
|
super(), this.publication = t, this.startLocator = e, this.resourceContentIteratorFactories = i, this._currentIterator = null, this.currentElement = null;
|
|
3320
3331
|
}
|
|
@@ -3343,10 +3354,10 @@ class un extends _t {
|
|
|
3343
3354
|
if (!e) return null;
|
|
3344
3355
|
const i = await e.nextContentIn(t);
|
|
3345
3356
|
if (!i) {
|
|
3346
|
-
const
|
|
3347
|
-
return
|
|
3357
|
+
const r = this.nextIteratorIn(t, e.index);
|
|
3358
|
+
return r ? (this._currentIterator = r, this.nextIn(t)) : null;
|
|
3348
3359
|
}
|
|
3349
|
-
return new
|
|
3360
|
+
return new _i(i, t);
|
|
3350
3361
|
}
|
|
3351
3362
|
/**
|
|
3352
3363
|
* Returns the [Iterator] for the current [Resource] in the reading order.
|
|
@@ -3367,25 +3378,25 @@ class un extends _t {
|
|
|
3367
3378
|
nextIteratorIn(t, e) {
|
|
3368
3379
|
const i = e + t;
|
|
3369
3380
|
if (i < 0 || i >= this.publication.manifest.readingOrder.items.length) return null;
|
|
3370
|
-
const
|
|
3371
|
-
return this.loadIteratorAt(i,
|
|
3381
|
+
const r = t === 1 ? 0 : 1;
|
|
3382
|
+
return this.loadIteratorAt(i, r) ?? this.nextIteratorIn(t, i);
|
|
3372
3383
|
}
|
|
3373
3384
|
/**
|
|
3374
3385
|
* Loads the iterator at the given [index] in the reading order.
|
|
3375
3386
|
* The [location] will be used to compute the starting [Locator] for the iterator.
|
|
3376
3387
|
*/
|
|
3377
3388
|
loadIteratorAt(t, e) {
|
|
3378
|
-
const i = this.publication.readingOrder.items[t],
|
|
3389
|
+
const i = this.publication.readingOrder.items[t], r = typeof e == "number" ? this.publication.manifest.locatorFromLink(i)?.copyWithLocations({
|
|
3379
3390
|
progression: e
|
|
3380
3391
|
}) : e;
|
|
3381
|
-
if (!
|
|
3382
|
-
const
|
|
3392
|
+
if (!r) return null;
|
|
3393
|
+
const n = this.publication.get(i);
|
|
3383
3394
|
for (const a of this.resourceContentIteratorFactories)
|
|
3384
|
-
a(
|
|
3395
|
+
a(n, r);
|
|
3385
3396
|
return null;
|
|
3386
3397
|
}
|
|
3387
3398
|
}
|
|
3388
|
-
class
|
|
3399
|
+
class wt extends me {
|
|
3389
3400
|
constructor(t, e, i = []) {
|
|
3390
3401
|
super(t, i), this.element = e;
|
|
3391
3402
|
}
|
|
@@ -3393,25 +3404,25 @@ class yt extends fe {
|
|
|
3393
3404
|
return this.element.text;
|
|
3394
3405
|
}
|
|
3395
3406
|
}
|
|
3396
|
-
class
|
|
3407
|
+
class oe {
|
|
3397
3408
|
constructor(t, e) {
|
|
3398
3409
|
this.element = t, this.direction = e;
|
|
3399
3410
|
}
|
|
3400
3411
|
}
|
|
3401
|
-
class
|
|
3412
|
+
class lr extends Qt {
|
|
3402
3413
|
constructor(t, e) {
|
|
3403
3414
|
super(), this.pageContent = t, this.startLocator = e, this.pageContentFiltered = [], this.currentElement = null, this.currentProgression = 0, this.currentElementIndex = 0;
|
|
3404
3415
|
const i = this.pageContent.filter(
|
|
3405
|
-
(
|
|
3416
|
+
(r) => r?.str !== " " && r?.str !== ""
|
|
3406
3417
|
);
|
|
3407
|
-
if (this.pageContentFiltered = i.map((
|
|
3408
|
-
index: i.indexOf(
|
|
3409
|
-
text:
|
|
3410
|
-
readingDirection:
|
|
3418
|
+
if (this.pageContentFiltered = i.map((r) => new wt(r.locator, {
|
|
3419
|
+
index: i.indexOf(r),
|
|
3420
|
+
text: r.str,
|
|
3421
|
+
readingDirection: r.dir
|
|
3411
3422
|
})), this.startLocator && (this.currentProgression = this.startLocator?.locations?.progression || 0, this.updateElementIndex()), this.pageContentFiltered.length > 0) {
|
|
3412
|
-
const
|
|
3413
|
-
(
|
|
3414
|
-
this.pageContentFiltered[
|
|
3423
|
+
const r = this.currentElementIndex;
|
|
3424
|
+
(r || r === 0) && (this.currentElement = new oe(
|
|
3425
|
+
this.pageContentFiltered[r],
|
|
3415
3426
|
1
|
|
3416
3427
|
/* Forward */
|
|
3417
3428
|
));
|
|
@@ -3436,7 +3447,7 @@ class hn extends _t {
|
|
|
3436
3447
|
const t = this.currentElementIndex - 1;
|
|
3437
3448
|
this.currentProgression = t / this.pageContentFiltered.length * 100, this.currentElementIndex = t;
|
|
3438
3449
|
}
|
|
3439
|
-
return this.currentElement ? this.currentElement.element : new
|
|
3450
|
+
return this.currentElement ? this.currentElement.element : new wt(new k({ href: "", type: "" }), { index: -1, text: "" });
|
|
3440
3451
|
}
|
|
3441
3452
|
async hasNext() {
|
|
3442
3453
|
return this.currentElement?.direction, this.nextIn(
|
|
@@ -3454,13 +3465,13 @@ class hn extends _t {
|
|
|
3454
3465
|
const e = t + 1;
|
|
3455
3466
|
this.currentProgression = e / this.pageContentFiltered.length * 100, this.currentElementIndex = e;
|
|
3456
3467
|
}
|
|
3457
|
-
return this.currentElement ? this.currentElement.element : new
|
|
3468
|
+
return this.currentElement ? this.currentElement.element : new wt(new k({ href: "", type: "" }), { index: -1, text: "" });
|
|
3458
3469
|
}
|
|
3459
3470
|
nextIn(t) {
|
|
3460
3471
|
const e = this.currentElementIndex;
|
|
3461
3472
|
if (e === null || e === this.pageContentFiltered.length - 1 && t === 1 || e === 0 && t === -1) return null;
|
|
3462
3473
|
const i = this.pageContentFiltered[e + t];
|
|
3463
|
-
return i ? new
|
|
3474
|
+
return i ? new oe(i, t) : null;
|
|
3464
3475
|
}
|
|
3465
3476
|
/**
|
|
3466
3477
|
* Updates the current [PDFReadableElement] position in the pageContentFiltered array
|
|
@@ -3470,7 +3481,7 @@ class hn extends _t {
|
|
|
3470
3481
|
return this.currentProgression === 0 ? 0 : this.currentProgression < 0 || this.currentProgression >= 100 ? null : Math.floor(this.currentProgression * this.pageContentFiltered.length / 100);
|
|
3471
3482
|
}
|
|
3472
3483
|
}
|
|
3473
|
-
const
|
|
3484
|
+
const Vi = [
|
|
3474
3485
|
"OBJECT",
|
|
3475
3486
|
"BASE",
|
|
3476
3487
|
"FONT",
|
|
@@ -3538,8 +3549,8 @@ const Ki = [
|
|
|
3538
3549
|
"NOBR",
|
|
3539
3550
|
"RB"
|
|
3540
3551
|
];
|
|
3541
|
-
function
|
|
3542
|
-
return
|
|
3552
|
+
function ce(s) {
|
|
3553
|
+
return Vi.includes(s.nodeName.toUpperCase());
|
|
3543
3554
|
}
|
|
3544
3555
|
function St(s, t) {
|
|
3545
3556
|
const e = s.getAttribute("src");
|
|
@@ -3550,15 +3561,15 @@ function St(s, t) {
|
|
|
3550
3561
|
return e;
|
|
3551
3562
|
}
|
|
3552
3563
|
}
|
|
3553
|
-
const it = "[\\s\\u0085\\u00A0\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]",
|
|
3564
|
+
const it = "[\\s\\u0085\\u00A0\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]", Yi = new RegExp(`^${it}+$`, "g"), $i = new RegExp(`^${it}+|${it}+$/g`, "g"), be = new RegExp(`^${it}+`, "g"), Ae = new RegExp(`${it}+$`, "g"), ot = (s) => (
|
|
3554
3565
|
// Normal spaces, \t, \n, \v, \f, \r, U+0085, U+00A0, U+2000 to U+200A, U+2028, U+2029, U+202F, U+205F, U+3000
|
|
3555
|
-
s?.length ?
|
|
3556
|
-
), ve = (s) => s.replace(
|
|
3557
|
-
before: t + (
|
|
3566
|
+
s?.length ? Yi.test(s) : !0
|
|
3567
|
+
), ve = (s) => s.replace($i, ""), Xi = (s) => s.replace(be, ""), Ki = (s) => s.replace(Ae, ""), le = (s, t = "") => new rt({
|
|
3568
|
+
before: t + (be.exec(s)?.[0] ?? ""),
|
|
3558
3569
|
highlight: ve(s),
|
|
3559
|
-
after:
|
|
3570
|
+
after: Ae.exec(s)?.[0] ?? ""
|
|
3560
3571
|
});
|
|
3561
|
-
function
|
|
3572
|
+
function Zi(s) {
|
|
3562
3573
|
for (; s; ) {
|
|
3563
3574
|
let t = s.getAttribute("lang") || s.getAttributeNS("http://www.w3.org/1999/xhtml", "lang") || s.getAttributeNS("http://www.w3.org/XML/1998/namespace", "lang");
|
|
3564
3575
|
if (t) return t;
|
|
@@ -3566,21 +3577,21 @@ function ji(s) {
|
|
|
3566
3577
|
}
|
|
3567
3578
|
return null;
|
|
3568
3579
|
}
|
|
3569
|
-
function
|
|
3580
|
+
function Ji(s, t) {
|
|
3570
3581
|
const e = s.length > 0 && s[s.length - 1] === " ";
|
|
3571
|
-
let i = !1,
|
|
3572
|
-
for (let
|
|
3573
|
-
if (ot(t[
|
|
3574
|
-
if (e && !
|
|
3582
|
+
let i = !1, r = !1;
|
|
3583
|
+
for (let n = 0; n < t.length; n++)
|
|
3584
|
+
if (ot(t[n])) {
|
|
3585
|
+
if (e && !r || i)
|
|
3575
3586
|
continue;
|
|
3576
3587
|
s += " ", i = !0;
|
|
3577
3588
|
} else {
|
|
3578
|
-
const a = t.charCodeAt(
|
|
3579
|
-
a !== 8203 && a !== 173 && (s += t[
|
|
3589
|
+
const a = t.charCodeAt(n);
|
|
3590
|
+
a !== 8203 && a !== 173 && (s += t[n], i = !1, r = !0);
|
|
3580
3591
|
}
|
|
3581
3592
|
return s;
|
|
3582
3593
|
}
|
|
3583
|
-
function
|
|
3594
|
+
function ye(s) {
|
|
3584
3595
|
return typeof s == "object" && s !== null && s.nodeType === Node.ELEMENT_NODE;
|
|
3585
3596
|
}
|
|
3586
3597
|
const gt = {
|
|
@@ -3595,14 +3606,14 @@ const gt = {
|
|
|
3595
3606
|
nthchild: "nthchild",
|
|
3596
3607
|
nthoftype: "nthoftype"
|
|
3597
3608
|
};
|
|
3598
|
-
function
|
|
3609
|
+
function qi(s, t) {
|
|
3599
3610
|
return Object.values(s).includes(t);
|
|
3600
3611
|
}
|
|
3601
|
-
const
|
|
3612
|
+
const Qi = "CssSelectorGenerator";
|
|
3602
3613
|
function bt(s = "unknown problem", ...t) {
|
|
3603
|
-
console.warn(`${
|
|
3614
|
+
console.warn(`${Qi}: ${s}`, ...t);
|
|
3604
3615
|
}
|
|
3605
|
-
const
|
|
3616
|
+
const ji = {
|
|
3606
3617
|
selectors: [
|
|
3607
3618
|
E.id,
|
|
3608
3619
|
E.class,
|
|
@@ -3617,404 +3628,450 @@ const ss = {
|
|
|
3617
3628
|
combineBetweenSelectors: !0,
|
|
3618
3629
|
root: null,
|
|
3619
3630
|
maxCombinations: Number.POSITIVE_INFINITY,
|
|
3620
|
-
maxCandidates: Number.POSITIVE_INFINITY
|
|
3631
|
+
maxCandidates: Number.POSITIVE_INFINITY,
|
|
3632
|
+
useScope: !1
|
|
3621
3633
|
};
|
|
3622
|
-
function
|
|
3623
|
-
return Array.isArray(s) ? s.filter((t) =>
|
|
3634
|
+
function ts(s) {
|
|
3635
|
+
return Array.isArray(s) ? s.filter((t) => qi(E, t)) : [];
|
|
3624
3636
|
}
|
|
3625
|
-
function
|
|
3637
|
+
function we(s) {
|
|
3626
3638
|
return s instanceof RegExp;
|
|
3627
3639
|
}
|
|
3628
|
-
function
|
|
3629
|
-
return ["string", "function"].includes(typeof s) ||
|
|
3640
|
+
function es(s) {
|
|
3641
|
+
return ["string", "function"].includes(typeof s) || we(s);
|
|
3630
3642
|
}
|
|
3631
|
-
function
|
|
3632
|
-
return Array.isArray(s) ? s.filter(
|
|
3643
|
+
function he(s) {
|
|
3644
|
+
return Array.isArray(s) ? s.filter(es) : [];
|
|
3633
3645
|
}
|
|
3634
|
-
function
|
|
3646
|
+
function is(s) {
|
|
3635
3647
|
return s instanceof Node;
|
|
3636
3648
|
}
|
|
3637
|
-
function
|
|
3649
|
+
function ue(s) {
|
|
3638
3650
|
const t = [
|
|
3639
3651
|
Node.DOCUMENT_NODE,
|
|
3640
3652
|
Node.DOCUMENT_FRAGMENT_NODE,
|
|
3641
3653
|
// this includes Shadow DOM root
|
|
3642
3654
|
Node.ELEMENT_NODE
|
|
3643
3655
|
];
|
|
3644
|
-
return
|
|
3656
|
+
return is(s) && t.includes(s.nodeType);
|
|
3645
3657
|
}
|
|
3646
|
-
function
|
|
3647
|
-
if (
|
|
3658
|
+
function Se(s, t) {
|
|
3659
|
+
if (ue(s))
|
|
3648
3660
|
return s.contains(t) || bt("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."), s;
|
|
3649
3661
|
const e = t.getRootNode({ composed: !1 });
|
|
3650
|
-
return
|
|
3662
|
+
return ue(e) ? (e !== document && bt("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."), e) : te(t);
|
|
3651
3663
|
}
|
|
3652
|
-
function
|
|
3664
|
+
function Et(s) {
|
|
3653
3665
|
return typeof s == "number" ? s : Number.POSITIVE_INFINITY;
|
|
3654
3666
|
}
|
|
3655
|
-
function
|
|
3656
|
-
const e = Object.assign(Object.assign({},
|
|
3667
|
+
function ss(s, t = {}) {
|
|
3668
|
+
const e = Object.assign(Object.assign({}, ji), t);
|
|
3657
3669
|
return {
|
|
3658
|
-
selectors:
|
|
3659
|
-
whitelist:
|
|
3660
|
-
blacklist:
|
|
3661
|
-
root:
|
|
3670
|
+
selectors: ts(e.selectors),
|
|
3671
|
+
whitelist: he(e.whitelist),
|
|
3672
|
+
blacklist: he(e.blacklist),
|
|
3673
|
+
root: Se(e.root, s),
|
|
3662
3674
|
combineWithinSelector: !!e.combineWithinSelector,
|
|
3663
3675
|
combineBetweenSelectors: !!e.combineBetweenSelectors,
|
|
3664
3676
|
includeTag: !!e.includeTag,
|
|
3665
|
-
maxCombinations:
|
|
3666
|
-
maxCandidates:
|
|
3677
|
+
maxCombinations: Et(e.maxCombinations),
|
|
3678
|
+
maxCandidates: Et(e.maxCandidates),
|
|
3679
|
+
useScope: !!e.useScope,
|
|
3680
|
+
maxResults: Et(e.maxResults)
|
|
3667
3681
|
};
|
|
3668
3682
|
}
|
|
3669
|
-
function
|
|
3683
|
+
function nt(s = []) {
|
|
3670
3684
|
const [t = [], ...e] = s;
|
|
3671
|
-
return e.length === 0 ? t : e.reduce((i,
|
|
3685
|
+
return e.length === 0 ? t : e.reduce((i, r) => i.filter((n) => r.includes(n)), t);
|
|
3672
3686
|
}
|
|
3673
|
-
function
|
|
3687
|
+
function rs(s) {
|
|
3674
3688
|
return [].concat(...s);
|
|
3675
3689
|
}
|
|
3676
|
-
function
|
|
3690
|
+
function ns(s) {
|
|
3677
3691
|
return s.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
3678
3692
|
}
|
|
3679
|
-
function
|
|
3693
|
+
function Rt(s) {
|
|
3680
3694
|
const t = s.map((e) => {
|
|
3681
|
-
if (
|
|
3695
|
+
if (we(e))
|
|
3682
3696
|
return (i) => e.test(i);
|
|
3683
3697
|
if (typeof e == "function")
|
|
3684
3698
|
return (i) => {
|
|
3685
|
-
const
|
|
3686
|
-
return typeof
|
|
3699
|
+
const r = e(i);
|
|
3700
|
+
return typeof r != "boolean" ? (bt("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : r;
|
|
3687
3701
|
};
|
|
3688
3702
|
if (typeof e == "string") {
|
|
3689
|
-
const i = new RegExp("^" +
|
|
3690
|
-
return (
|
|
3703
|
+
const i = new RegExp("^" + ns(e) + "$");
|
|
3704
|
+
return (r) => i.test(r);
|
|
3691
3705
|
}
|
|
3692
3706
|
return bt("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
3693
3707
|
});
|
|
3694
3708
|
return (e) => t.some((i) => i(e));
|
|
3695
3709
|
}
|
|
3696
3710
|
function jt(s, t, e) {
|
|
3697
|
-
const i = Array.from(
|
|
3698
|
-
return i.length === s.length && s.every((
|
|
3711
|
+
const i = Array.from(Se(e, s[0]).querySelectorAll(t));
|
|
3712
|
+
return i.length === s.length && s.every((r) => i.includes(r));
|
|
3699
3713
|
}
|
|
3700
|
-
function
|
|
3714
|
+
function Ee(s, t) {
|
|
3701
3715
|
t = t ?? te(s);
|
|
3702
3716
|
const e = [];
|
|
3703
3717
|
let i = s;
|
|
3704
|
-
for (;
|
|
3718
|
+
for (; ye(i) && i !== t; )
|
|
3705
3719
|
e.push(i), i = i.parentElement;
|
|
3706
3720
|
return e;
|
|
3707
3721
|
}
|
|
3708
|
-
function
|
|
3709
|
-
return
|
|
3722
|
+
function as(s, t) {
|
|
3723
|
+
return nt(s.map((e) => Ee(e, t)));
|
|
3710
3724
|
}
|
|
3711
3725
|
function te(s) {
|
|
3712
3726
|
return s.ownerDocument.querySelector(":root");
|
|
3713
3727
|
}
|
|
3714
|
-
const
|
|
3728
|
+
const Te = ", ", os = new RegExp([
|
|
3715
3729
|
"^$",
|
|
3716
3730
|
// empty or not set
|
|
3717
3731
|
"\\s"
|
|
3718
3732
|
// contains whitespace
|
|
3719
|
-
].join("|")),
|
|
3733
|
+
].join("|")), cs = new RegExp([
|
|
3720
3734
|
"^$"
|
|
3721
3735
|
// empty or not set
|
|
3722
|
-
].join("|")),
|
|
3736
|
+
].join("|")), Ie = [
|
|
3723
3737
|
E.nthoftype,
|
|
3724
3738
|
E.tag,
|
|
3725
3739
|
E.id,
|
|
3726
3740
|
E.class,
|
|
3727
3741
|
E.attribute,
|
|
3728
3742
|
E.nthchild
|
|
3729
|
-
],
|
|
3743
|
+
], ls = Rt([
|
|
3730
3744
|
"class",
|
|
3731
3745
|
"id",
|
|
3732
3746
|
// Angular attributes
|
|
3733
3747
|
"ng-*"
|
|
3734
3748
|
]);
|
|
3735
|
-
function
|
|
3749
|
+
function hs({ name: s }) {
|
|
3736
3750
|
return `[${s}]`;
|
|
3737
3751
|
}
|
|
3738
|
-
function
|
|
3752
|
+
function us({ name: s, value: t }) {
|
|
3739
3753
|
return `[${s}='${t}']`;
|
|
3740
3754
|
}
|
|
3741
|
-
function
|
|
3755
|
+
function ds({ nodeName: s, nodeValue: t }, e) {
|
|
3742
3756
|
const i = e.tagName.toLowerCase();
|
|
3743
|
-
return ["input", "option"].includes(i) && s === "value" || s === "src" && t?.startsWith("data:") ? !1 : !
|
|
3757
|
+
return ["input", "option"].includes(i) && s === "value" || s === "src" && t?.startsWith("data:") ? !1 : !ls(s);
|
|
3744
3758
|
}
|
|
3745
|
-
function
|
|
3759
|
+
function fs({ nodeName: s, nodeValue: t }) {
|
|
3746
3760
|
return {
|
|
3747
3761
|
name: st(s),
|
|
3748
3762
|
value: st(t ?? void 0)
|
|
3749
3763
|
};
|
|
3750
3764
|
}
|
|
3751
3765
|
function xe(s) {
|
|
3752
|
-
const t = Array.from(s.attributes).filter((e) =>
|
|
3766
|
+
const t = Array.from(s.attributes).filter((e) => ds(e, s)).map(fs);
|
|
3753
3767
|
return [
|
|
3754
|
-
...t.map(
|
|
3755
|
-
...t.map(
|
|
3768
|
+
...t.map(hs),
|
|
3769
|
+
...t.map(us)
|
|
3756
3770
|
];
|
|
3757
3771
|
}
|
|
3758
|
-
function
|
|
3772
|
+
function ps(s) {
|
|
3759
3773
|
const t = s.map(xe);
|
|
3760
|
-
return
|
|
3774
|
+
return nt(t);
|
|
3761
3775
|
}
|
|
3762
|
-
function
|
|
3776
|
+
function Ne(s) {
|
|
3763
3777
|
var t;
|
|
3764
|
-
return ((t = s.getAttribute("class")) !== null && t !== void 0 ? t : "").trim().split(/\s+/).filter((e) => !
|
|
3778
|
+
return ((t = s.getAttribute("class")) !== null && t !== void 0 ? t : "").trim().split(/\s+/).filter((e) => !cs.test(e)).map((e) => `.${st(e)}`);
|
|
3765
3779
|
}
|
|
3766
|
-
function
|
|
3767
|
-
const t = s.map(
|
|
3768
|
-
return
|
|
3780
|
+
function ms(s) {
|
|
3781
|
+
const t = s.map(Ne);
|
|
3782
|
+
return nt(t);
|
|
3769
3783
|
}
|
|
3770
|
-
function
|
|
3784
|
+
function Le(s) {
|
|
3771
3785
|
var t;
|
|
3772
|
-
const e = (t = s.getAttribute("id")) !== null && t !== void 0 ? t : "", i = `#${st(e)}`,
|
|
3773
|
-
return !
|
|
3786
|
+
const e = (t = s.getAttribute("id")) !== null && t !== void 0 ? t : "", i = `#${st(e)}`, r = s.getRootNode({ composed: !1 });
|
|
3787
|
+
return !os.test(e) && jt([s], i, r) ? [i] : [];
|
|
3774
3788
|
}
|
|
3775
|
-
function
|
|
3776
|
-
return s.length === 0 || s.length > 1 ? [] :
|
|
3789
|
+
function gs(s) {
|
|
3790
|
+
return s.length === 0 || s.length > 1 ? [] : Le(s[0]);
|
|
3777
3791
|
}
|
|
3778
|
-
function
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
`:nth-child(${String(i + 1)})`
|
|
3785
|
-
];
|
|
3792
|
+
function Oe(s) {
|
|
3793
|
+
var t;
|
|
3794
|
+
const e = (t = s.parentElement) === null || t === void 0 ? void 0 : t.children;
|
|
3795
|
+
if (e) {
|
|
3796
|
+
for (let i = 0; i < e.length; i++)
|
|
3797
|
+
if (e[i] === s)
|
|
3798
|
+
return [`:nth-child(${String(i + 1)})`];
|
|
3786
3799
|
}
|
|
3787
3800
|
return [];
|
|
3788
3801
|
}
|
|
3789
|
-
function
|
|
3790
|
-
return
|
|
3802
|
+
function bs(s) {
|
|
3803
|
+
return nt(s.map(Oe));
|
|
3791
3804
|
}
|
|
3792
|
-
function
|
|
3805
|
+
function ze(s) {
|
|
3793
3806
|
return [
|
|
3794
3807
|
st(s.tagName.toLowerCase())
|
|
3795
3808
|
];
|
|
3796
3809
|
}
|
|
3797
|
-
function
|
|
3810
|
+
function Re(s) {
|
|
3798
3811
|
const t = [
|
|
3799
|
-
...new Set(
|
|
3812
|
+
...new Set(rs(s.map(ze)))
|
|
3800
3813
|
];
|
|
3801
3814
|
return t.length === 0 || t.length > 1 ? [] : [t[0]];
|
|
3802
3815
|
}
|
|
3803
3816
|
function Ce(s) {
|
|
3804
|
-
const t =
|
|
3817
|
+
const t = Re([s])[0], e = s.parentElement;
|
|
3805
3818
|
if (e) {
|
|
3806
|
-
const
|
|
3807
|
-
if (
|
|
3819
|
+
const r = Array.from(e.children).filter((n) => n.tagName.toLowerCase() === t).indexOf(s);
|
|
3820
|
+
if (r > -1)
|
|
3808
3821
|
return [
|
|
3809
|
-
`${t}:nth-of-type(${String(
|
|
3822
|
+
`${t}:nth-of-type(${String(r + 1)})`
|
|
3810
3823
|
];
|
|
3811
3824
|
}
|
|
3812
3825
|
return [];
|
|
3813
3826
|
}
|
|
3814
|
-
function
|
|
3815
|
-
return
|
|
3827
|
+
function As(s) {
|
|
3828
|
+
return nt(s.map(Ce));
|
|
3816
3829
|
}
|
|
3817
|
-
function*
|
|
3830
|
+
function* Pe(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
|
|
3818
3831
|
let e = 0, i = Ct(1);
|
|
3819
3832
|
for (; i.length <= s.length && e < t; )
|
|
3820
|
-
e += 1, yield i.map((
|
|
3833
|
+
e += 1, yield i.map((n) => s[n]), i = ys(i, s.length - 1);
|
|
3821
3834
|
}
|
|
3822
|
-
function
|
|
3823
|
-
return Array.from(
|
|
3835
|
+
function vs(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
|
|
3836
|
+
return Array.from(Pe(s, { maxResults: t }));
|
|
3824
3837
|
}
|
|
3825
|
-
function
|
|
3838
|
+
function ys(s = [], t = 0) {
|
|
3826
3839
|
const e = s.length;
|
|
3827
3840
|
if (e === 0)
|
|
3828
3841
|
return [];
|
|
3829
3842
|
const i = [...s];
|
|
3830
3843
|
i[e - 1] += 1;
|
|
3831
|
-
for (let
|
|
3832
|
-
if (i[
|
|
3833
|
-
if (
|
|
3844
|
+
for (let r = e - 1; r >= 0; r--)
|
|
3845
|
+
if (i[r] > t) {
|
|
3846
|
+
if (r === 0)
|
|
3834
3847
|
return Ct(e + 1);
|
|
3835
|
-
i[
|
|
3848
|
+
i[r - 1]++, i[r] = i[r - 1] + 1;
|
|
3836
3849
|
}
|
|
3837
3850
|
return i[e - 1] > t ? Ct(e + 1) : i;
|
|
3838
3851
|
}
|
|
3839
3852
|
function Ct(s = 1) {
|
|
3840
3853
|
return Array.from(Array(s).keys());
|
|
3841
3854
|
}
|
|
3842
|
-
function
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3855
|
+
function* ws(s = {}) {
|
|
3856
|
+
const t = Object.entries(s);
|
|
3857
|
+
if (t.length === 0)
|
|
3858
|
+
return;
|
|
3859
|
+
const e = [
|
|
3860
|
+
{ index: t.length - 1, partial: {} }
|
|
3861
|
+
];
|
|
3862
|
+
for (; e.length > 0; ) {
|
|
3863
|
+
const i = e.pop();
|
|
3864
|
+
if (!i)
|
|
3865
|
+
break;
|
|
3866
|
+
const { index: r, partial: n } = i;
|
|
3867
|
+
if (r < 0) {
|
|
3868
|
+
yield n;
|
|
3869
|
+
continue;
|
|
3870
|
+
}
|
|
3871
|
+
const [a, o] = t[r];
|
|
3872
|
+
for (let h = o.length - 1; h >= 0; h--)
|
|
3873
|
+
e.push({
|
|
3874
|
+
index: r - 1,
|
|
3875
|
+
partial: Object.assign(Object.assign({}, n), { [a]: o[h] })
|
|
3876
|
+
});
|
|
3877
|
+
}
|
|
3847
3878
|
}
|
|
3848
|
-
const
|
|
3879
|
+
const Ss = "3a".toUpperCase(), Es = /[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;
|
|
3849
3880
|
function st(s = "") {
|
|
3850
|
-
return CSS ? CSS.escape(s) :
|
|
3851
|
-
}
|
|
3852
|
-
function
|
|
3853
|
-
return s.split("").map((t) => t === ":" ? `\\${
|
|
3854
|
-
}
|
|
3855
|
-
const
|
|
3881
|
+
return CSS ? CSS.escape(s) : Ts(s);
|
|
3882
|
+
}
|
|
3883
|
+
function Ts(s = "") {
|
|
3884
|
+
return s.split("").map((t) => t === ":" ? `\\${Ss} ` : Es.test(t) ? `\\${t}` : escape(t).replace(/%/g, "\\")).join("");
|
|
3885
|
+
}
|
|
3886
|
+
const Is = {
|
|
3887
|
+
tag: Re,
|
|
3888
|
+
id: gs,
|
|
3889
|
+
class: ms,
|
|
3890
|
+
attribute: ps,
|
|
3891
|
+
nthchild: bs,
|
|
3892
|
+
nthoftype: As
|
|
3893
|
+
}, xs = {
|
|
3856
3894
|
tag: ze,
|
|
3857
|
-
id:
|
|
3858
|
-
class:
|
|
3859
|
-
attribute: bs,
|
|
3860
|
-
nthchild: ws,
|
|
3861
|
-
nthoftype: ys
|
|
3862
|
-
}, Os = {
|
|
3863
|
-
tag: Oe,
|
|
3864
|
-
id: Ne,
|
|
3865
|
-
class: Ie,
|
|
3895
|
+
id: Le,
|
|
3896
|
+
class: Ne,
|
|
3866
3897
|
attribute: xe,
|
|
3867
|
-
nthchild:
|
|
3898
|
+
nthchild: Oe,
|
|
3868
3899
|
nthoftype: Ce
|
|
3869
3900
|
};
|
|
3870
|
-
function
|
|
3871
|
-
return
|
|
3901
|
+
function Ns(s, t) {
|
|
3902
|
+
return xs[t](s);
|
|
3872
3903
|
}
|
|
3873
|
-
function
|
|
3874
|
-
const e =
|
|
3904
|
+
function Ls(s, t) {
|
|
3905
|
+
const e = Is[t];
|
|
3875
3906
|
return e(s);
|
|
3876
3907
|
}
|
|
3877
|
-
function
|
|
3908
|
+
function Os(s = [], t, e) {
|
|
3878
3909
|
return s.filter((i) => e(i) || !t(i));
|
|
3879
3910
|
}
|
|
3880
|
-
function
|
|
3911
|
+
function zs(s = [], t) {
|
|
3881
3912
|
return s.sort((e, i) => {
|
|
3882
|
-
const
|
|
3883
|
-
return
|
|
3913
|
+
const r = t(e), n = t(i);
|
|
3914
|
+
return r && !n ? -1 : !r && n ? 1 : 0;
|
|
3884
3915
|
});
|
|
3885
3916
|
}
|
|
3886
|
-
function
|
|
3887
|
-
const
|
|
3888
|
-
|
|
3917
|
+
function* Rs(s, t) {
|
|
3918
|
+
const e = /* @__PURE__ */ new Set(), i = Cs(s, t);
|
|
3919
|
+
for (const r of Us(i, t))
|
|
3920
|
+
e.has(r) || (e.add(r), yield r);
|
|
3889
3921
|
}
|
|
3890
|
-
function
|
|
3891
|
-
const { blacklist: e, whitelist: i, combineWithinSelector:
|
|
3892
|
-
const u =
|
|
3893
|
-
return
|
|
3922
|
+
function Cs(s, t) {
|
|
3923
|
+
const { blacklist: e, whitelist: i, combineWithinSelector: r, maxCombinations: n } = t, a = Rt(e), o = Rt(i), h = (m, p) => {
|
|
3924
|
+
const u = Ls(s, p), g = Os(u, a, o), v = zs(g, o);
|
|
3925
|
+
return m[p] = r ? Array.from(Pe(v, { maxResults: n })) : v.map((C) => [C]), m;
|
|
3894
3926
|
};
|
|
3895
|
-
return
|
|
3927
|
+
return Ps(t).reduce(h, {});
|
|
3896
3928
|
}
|
|
3897
|
-
function
|
|
3929
|
+
function Ps(s) {
|
|
3898
3930
|
const { selectors: t, includeTag: e } = s, i = [...t];
|
|
3899
3931
|
return e && !i.includes("tag") && i.push("tag"), i;
|
|
3900
3932
|
}
|
|
3901
|
-
function
|
|
3933
|
+
function ks(s) {
|
|
3902
3934
|
return s.includes(E.tag) || s.includes(E.nthoftype) ? [...s] : [...s, E.tag];
|
|
3903
3935
|
}
|
|
3904
|
-
function
|
|
3905
|
-
const { selectors: t, combineBetweenSelectors: e, includeTag: i, maxCandidates:
|
|
3906
|
-
return i ?
|
|
3936
|
+
function Ds(s) {
|
|
3937
|
+
const { selectors: t, combineBetweenSelectors: e, includeTag: i, maxCandidates: r } = s, n = e ? vs(t, { maxResults: r }) : t.map((a) => [a]);
|
|
3938
|
+
return i ? n.map(ks) : n;
|
|
3907
3939
|
}
|
|
3908
|
-
function
|
|
3909
|
-
|
|
3940
|
+
function* Us(s, t) {
|
|
3941
|
+
for (const e of Ds(t))
|
|
3942
|
+
yield* Ms(e, s);
|
|
3910
3943
|
}
|
|
3911
|
-
function
|
|
3944
|
+
function* Ms(s, t) {
|
|
3912
3945
|
const e = {};
|
|
3913
|
-
|
|
3914
|
-
const r = t[
|
|
3915
|
-
r && r.length > 0 && (e[
|
|
3916
|
-
}
|
|
3946
|
+
for (const i of s) {
|
|
3947
|
+
const r = t[i];
|
|
3948
|
+
r && r.length > 0 && (e[i] = r);
|
|
3949
|
+
}
|
|
3950
|
+
for (const i of ws(e))
|
|
3951
|
+
yield Gs(i);
|
|
3917
3952
|
}
|
|
3918
|
-
function
|
|
3953
|
+
function Bs(s, t) {
|
|
3919
3954
|
return t[s] ? t[s].join("") : "";
|
|
3920
3955
|
}
|
|
3921
|
-
function
|
|
3922
|
-
const t = [...
|
|
3923
|
-
return s[E.tag] && s[E.nthoftype] && t.splice(t.indexOf(E.tag), 1), t.map((e) =>
|
|
3956
|
+
function Gs(s = {}) {
|
|
3957
|
+
const t = [...Ie];
|
|
3958
|
+
return s[E.tag] && s[E.nthoftype] && t.splice(t.indexOf(E.tag), 1), t.map((e) => Bs(e, s)).join("");
|
|
3924
3959
|
}
|
|
3925
|
-
function
|
|
3960
|
+
function Ws(s, t) {
|
|
3926
3961
|
return [
|
|
3927
3962
|
...s.map((e) => t + gt.DESCENDANT + e),
|
|
3928
3963
|
...s.map((e) => t + gt.CHILD + e)
|
|
3929
3964
|
];
|
|
3930
3965
|
}
|
|
3931
|
-
function
|
|
3932
|
-
|
|
3966
|
+
function* Hs(s, t) {
|
|
3967
|
+
if (t === "")
|
|
3968
|
+
yield* s;
|
|
3969
|
+
else
|
|
3970
|
+
for (const e of s)
|
|
3971
|
+
yield* Ws([e], t);
|
|
3933
3972
|
}
|
|
3934
|
-
function
|
|
3935
|
-
const
|
|
3936
|
-
for (const
|
|
3937
|
-
|
|
3938
|
-
return a;
|
|
3939
|
-
return null;
|
|
3973
|
+
function* Fs(s, t, e = "", i) {
|
|
3974
|
+
const r = Rs(s, i);
|
|
3975
|
+
for (const n of Hs(r, e))
|
|
3976
|
+
jt(s, n, t) && (yield n);
|
|
3940
3977
|
}
|
|
3941
|
-
function
|
|
3978
|
+
function* _s(s, t, e = "", i) {
|
|
3942
3979
|
if (s.length === 0)
|
|
3943
3980
|
return null;
|
|
3944
|
-
const
|
|
3981
|
+
const r = [
|
|
3945
3982
|
s.length > 1 ? s : [],
|
|
3946
|
-
...
|
|
3983
|
+
...as(s, t).map((n) => [n])
|
|
3947
3984
|
];
|
|
3948
|
-
for (const
|
|
3949
|
-
const a
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
foundElements: r,
|
|
3985
|
+
for (const n of r)
|
|
3986
|
+
for (const a of Fs(n, t, e, i))
|
|
3987
|
+
yield {
|
|
3988
|
+
foundElements: n,
|
|
3953
3989
|
selector: a
|
|
3954
3990
|
};
|
|
3991
|
+
}
|
|
3992
|
+
function* Vs({ elements: s, root: t, rootSelector: e = "", options: i }) {
|
|
3993
|
+
let r = t, n = e, a = !0;
|
|
3994
|
+
for (; a; ) {
|
|
3995
|
+
let o = !1;
|
|
3996
|
+
for (const h of _s(s, r, n, i)) {
|
|
3997
|
+
const { foundElements: m, selector: p } = h;
|
|
3998
|
+
if (o = !0, jt(s, p, t))
|
|
3999
|
+
yield p;
|
|
4000
|
+
else {
|
|
4001
|
+
r = m[0], n = p;
|
|
4002
|
+
break;
|
|
4003
|
+
}
|
|
4004
|
+
}
|
|
4005
|
+
o || (a = !1);
|
|
3955
4006
|
}
|
|
3956
|
-
return null;
|
|
3957
4007
|
}
|
|
3958
|
-
function
|
|
4008
|
+
function Ys(s) {
|
|
3959
4009
|
(s instanceof NodeList || s instanceof HTMLCollection) && (s = Array.from(s));
|
|
3960
|
-
const t = (Array.isArray(s) ? s : [s]).filter(
|
|
4010
|
+
const t = (Array.isArray(s) ? s : [s]).filter(ye);
|
|
3961
4011
|
return [...new Set(t)];
|
|
3962
4012
|
}
|
|
3963
|
-
function
|
|
4013
|
+
function $s(s) {
|
|
3964
4014
|
return {
|
|
3965
4015
|
value: s,
|
|
3966
4016
|
include: !1
|
|
3967
4017
|
};
|
|
3968
4018
|
}
|
|
3969
|
-
function
|
|
4019
|
+
function Xs(s, t, e = gt.NONE) {
|
|
3970
4020
|
const i = {};
|
|
3971
|
-
return t.forEach((
|
|
3972
|
-
Reflect.set(i,
|
|
4021
|
+
return t.forEach((r) => {
|
|
4022
|
+
Reflect.set(i, r, Ns(s, r).map($s));
|
|
3973
4023
|
}), {
|
|
3974
4024
|
element: s,
|
|
3975
4025
|
operator: e,
|
|
3976
4026
|
selectors: i
|
|
3977
4027
|
};
|
|
3978
4028
|
}
|
|
3979
|
-
function
|
|
3980
|
-
let e = [...
|
|
3981
|
-
s[E.tag] && s[E.nthoftype] && (e = e.filter((
|
|
4029
|
+
function Ks({ selectors: s, operator: t }) {
|
|
4030
|
+
let e = [...Ie];
|
|
4031
|
+
s[E.tag] && s[E.nthoftype] && (e = e.filter((r) => r !== E.tag));
|
|
3982
4032
|
let i = "";
|
|
3983
|
-
return e.forEach((
|
|
3984
|
-
var
|
|
3985
|
-
((
|
|
4033
|
+
return e.forEach((r) => {
|
|
4034
|
+
var n;
|
|
4035
|
+
((n = s[r]) !== null && n !== void 0 ? n : []).forEach(({ value: o, include: h }) => {
|
|
3986
4036
|
h && (i += o);
|
|
3987
4037
|
});
|
|
3988
4038
|
}), t + i;
|
|
3989
4039
|
}
|
|
3990
|
-
function
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4040
|
+
function Zs(s, t) {
|
|
4041
|
+
const i = Ee(s, t).reverse().map((r) => {
|
|
4042
|
+
var n;
|
|
4043
|
+
const a = Xs(r, [E.nthchild], gt.CHILD);
|
|
4044
|
+
return ((n = a.selectors.nthchild) !== null && n !== void 0 ? n : []).forEach((o) => {
|
|
4045
|
+
o.include = !0;
|
|
4046
|
+
}), a;
|
|
4047
|
+
});
|
|
4048
|
+
return [
|
|
4049
|
+
t ? ":scope" : ":root",
|
|
4050
|
+
...i.map(Ks)
|
|
4051
|
+
].join("");
|
|
3997
4052
|
}
|
|
3998
|
-
function
|
|
3999
|
-
return s.map(
|
|
4053
|
+
function Js(s, t) {
|
|
4054
|
+
return s.map((e) => Zs(e, t)).join(Te);
|
|
4000
4055
|
}
|
|
4001
|
-
function
|
|
4056
|
+
function ke(s, t = {}) {
|
|
4057
|
+
const e = Object.assign(Object.assign({}, t), { maxResults: 1 });
|
|
4058
|
+
return qs(s, e).next().value;
|
|
4059
|
+
}
|
|
4060
|
+
function* qs(s, t = {}) {
|
|
4002
4061
|
var e;
|
|
4003
|
-
const i =
|
|
4004
|
-
let a =
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
if (
|
|
4012
|
-
return
|
|
4013
|
-
|
|
4014
|
-
}
|
|
4015
|
-
return i.length > 1 ? i.map((m) => Pe(m, n)).join(Ee) : Qs(i);
|
|
4062
|
+
const i = Ys(s), r = ss(i[0], t), n = (e = r.root) !== null && e !== void 0 ? e : te(i[0]);
|
|
4063
|
+
let a = 0;
|
|
4064
|
+
for (const o of Vs({
|
|
4065
|
+
elements: i,
|
|
4066
|
+
options: r,
|
|
4067
|
+
root: n,
|
|
4068
|
+
rootSelector: ""
|
|
4069
|
+
}))
|
|
4070
|
+
if (yield o, a++, a >= r.maxResults)
|
|
4071
|
+
return;
|
|
4072
|
+
i.length > 1 && (yield i.map((o) => ke(o, r)).join(Te), a++, a >= r.maxResults) || (yield Js(i, r.useScope ? n : void 0));
|
|
4016
4073
|
}
|
|
4017
|
-
class
|
|
4074
|
+
class hr extends Qt {
|
|
4018
4075
|
constructor(t, e, i = 50) {
|
|
4019
4076
|
super(), this.resource = t, this.locator = e, this.beforeMaxLength = i, this.currentElement = null, this.currentIndex = null, this.parsedElementRecipes = null, this.parser = null;
|
|
4020
4077
|
}
|
|
@@ -4049,15 +4106,15 @@ class dn extends _t {
|
|
|
4049
4106
|
}
|
|
4050
4107
|
async parseElements() {
|
|
4051
4108
|
const t = await this.resource.readAsString(), e = new DOMParser().parseFromString(t, this.locator.type);
|
|
4052
|
-
return this.parser = new
|
|
4109
|
+
return this.parser = new js(
|
|
4053
4110
|
e,
|
|
4054
4111
|
this.locator,
|
|
4055
4112
|
this.locator.locations.getCssSelector() ? e.querySelector(this.locator.locations.getCssSelector()) : null,
|
|
4056
4113
|
this.beforeMaxLength
|
|
4057
|
-
),
|
|
4114
|
+
), Qs(this.parser, e.body), this.parser.result();
|
|
4058
4115
|
}
|
|
4059
4116
|
}
|
|
4060
|
-
function
|
|
4117
|
+
function Qs(s, t) {
|
|
4061
4118
|
let e = t, i = 0;
|
|
4062
4119
|
for (; e != null; )
|
|
4063
4120
|
if (s.head(e, i), e.firstChild != null)
|
|
@@ -4070,9 +4127,9 @@ function js(s, t) {
|
|
|
4070
4127
|
e = e?.nextSibling || null;
|
|
4071
4128
|
}
|
|
4072
4129
|
}
|
|
4073
|
-
class
|
|
4074
|
-
constructor(t, e, i,
|
|
4075
|
-
this.doc = t, this.baseLocator = e, this.startElement = i, this.beforeMaxLength =
|
|
4130
|
+
class js {
|
|
4131
|
+
constructor(t, e, i, r) {
|
|
4132
|
+
this.doc = t, this.baseLocator = e, this.startElement = i, this.beforeMaxLength = r, this.elementRecipes = [], this.startIndex = 0, this.segmentRecipesAcc = [], this.textAcc = "", this.wholeRawTextAcc = null, this.elementRawTextAcc = "", this.rawTextAcc = "", this.currentLanguage = null, this.breadcrumbs = [], this.recipeCssSelectorCache = /* @__PURE__ */ new WeakMap();
|
|
4076
4133
|
}
|
|
4077
4134
|
result() {
|
|
4078
4135
|
return {
|
|
@@ -4084,7 +4141,7 @@ class tn {
|
|
|
4084
4141
|
const e = t.recipe.cssSelectorNode ? this.cssSelector(t.recipe.cssSelectorNode) : null;
|
|
4085
4142
|
if (t.type === 1) {
|
|
4086
4143
|
const i = t.recipe;
|
|
4087
|
-
return new
|
|
4144
|
+
return new Bi(
|
|
4088
4145
|
new k({
|
|
4089
4146
|
href: this.baseLocator.href,
|
|
4090
4147
|
type: this.baseLocator.type,
|
|
@@ -4111,39 +4168,39 @@ class tn {
|
|
|
4111
4168
|
["cssSelector", e]
|
|
4112
4169
|
])
|
|
4113
4170
|
} : {})
|
|
4114
|
-
}),
|
|
4115
|
-
return t.type === 3 ? new
|
|
4171
|
+
}), r = t.recipe;
|
|
4172
|
+
return t.type === 3 ? new Mi(
|
|
4116
4173
|
i,
|
|
4117
|
-
|
|
4118
|
-
) : new
|
|
4174
|
+
r.link
|
|
4175
|
+
) : new Ui(
|
|
4119
4176
|
i,
|
|
4120
|
-
|
|
4177
|
+
r.link
|
|
4121
4178
|
);
|
|
4122
4179
|
} else if (t.type === 0) {
|
|
4123
|
-
const i = t.recipe,
|
|
4124
|
-
const a =
|
|
4125
|
-
return new
|
|
4180
|
+
const i = t.recipe, r = i.segments.map((n) => {
|
|
4181
|
+
const a = n.cssSelectorNode ? this.cssSelector(n.cssSelectorNode) : null;
|
|
4182
|
+
return new ge(
|
|
4126
4183
|
new k({
|
|
4127
4184
|
href: this.baseLocator.href,
|
|
4128
4185
|
type: this.baseLocator.type,
|
|
4129
4186
|
title: this.baseLocator.title,
|
|
4130
|
-
text:
|
|
4187
|
+
text: le(n.text, this.wholeRawTextAcc?.substring(n.beforeRange[0], n.beforeRange[1])),
|
|
4131
4188
|
locations: new T(a ? {
|
|
4132
4189
|
otherLocations: /* @__PURE__ */ new Map([
|
|
4133
4190
|
["cssSelector", a]
|
|
4134
4191
|
])
|
|
4135
4192
|
} : {})
|
|
4136
4193
|
}),
|
|
4137
|
-
|
|
4138
|
-
|
|
4194
|
+
n.text,
|
|
4195
|
+
n.attributes
|
|
4139
4196
|
);
|
|
4140
4197
|
});
|
|
4141
|
-
return new
|
|
4198
|
+
return new zt(
|
|
4142
4199
|
new k({
|
|
4143
4200
|
href: this.baseLocator.href,
|
|
4144
4201
|
type: this.baseLocator.type,
|
|
4145
4202
|
title: this.baseLocator.title,
|
|
4146
|
-
text:
|
|
4203
|
+
text: le(i.text, r.length && r[0].locator.text?.before || ""),
|
|
4147
4204
|
locations: new T(e ? {
|
|
4148
4205
|
otherLocations: /* @__PURE__ */ new Map([
|
|
4149
4206
|
["cssSelector", e]
|
|
@@ -4151,7 +4208,7 @@ class tn {
|
|
|
4151
4208
|
} : {})
|
|
4152
4209
|
}),
|
|
4153
4210
|
i.role,
|
|
4154
|
-
|
|
4211
|
+
r
|
|
4155
4212
|
);
|
|
4156
4213
|
} else
|
|
4157
4214
|
throw new Error("Unknown recipe type");
|
|
@@ -4159,73 +4216,73 @@ class tn {
|
|
|
4159
4216
|
cssSelector(t) {
|
|
4160
4217
|
const e = t, i = this.recipeCssSelectorCache.get(e);
|
|
4161
4218
|
if (i) return i;
|
|
4162
|
-
const
|
|
4163
|
-
let
|
|
4164
|
-
for (;
|
|
4165
|
-
for (let o = 0; o <
|
|
4166
|
-
const h =
|
|
4167
|
-
h.prefix && (
|
|
4219
|
+
const r = /* @__PURE__ */ new Map();
|
|
4220
|
+
let n = e;
|
|
4221
|
+
for (; n && n !== this.doc.body; ) {
|
|
4222
|
+
for (let o = 0; o < n.attributes.length; o++) {
|
|
4223
|
+
const h = n.attributes[o];
|
|
4224
|
+
h.prefix && (r.has(n) ? r.set(n, r.get(n).concat([h])) : r.set(n, [h]), n.attributes.removeNamedItem(h.name));
|
|
4168
4225
|
}
|
|
4169
|
-
|
|
4226
|
+
n = n.parentElement;
|
|
4170
4227
|
}
|
|
4171
|
-
const a =
|
|
4228
|
+
const a = ke(e, {
|
|
4172
4229
|
root: this.doc
|
|
4173
4230
|
});
|
|
4174
|
-
return
|
|
4231
|
+
return r.forEach((o, h) => o.forEach((m) => h.attributes.setNamedItem(m))), this.recipeCssSelectorCache.set(e, a), a;
|
|
4175
4232
|
}
|
|
4176
4233
|
// Implements NodeTraversor
|
|
4177
4234
|
head(t, e) {
|
|
4178
4235
|
if (t.nodeType == Node.ELEMENT_NODE) {
|
|
4179
|
-
const i = !
|
|
4236
|
+
const i = !ce(t);
|
|
4180
4237
|
i && (this.flushText(), this.breadcrumbs.push(t));
|
|
4181
|
-
const
|
|
4182
|
-
if (
|
|
4238
|
+
const r = t.nodeName.toUpperCase();
|
|
4239
|
+
if (r === "BR")
|
|
4183
4240
|
this.flushText();
|
|
4184
|
-
else if (
|
|
4185
|
-
if (this.flushText(),
|
|
4186
|
-
const
|
|
4187
|
-
let o =
|
|
4188
|
-
o?.length || (o =
|
|
4241
|
+
else if (r === "IMG" || r === "AUDIO" || r === "VIDEO")
|
|
4242
|
+
if (this.flushText(), r === "IMG") {
|
|
4243
|
+
const n = t, a = St(n, this.baseLocator.href);
|
|
4244
|
+
let o = n.getAttribute("alt");
|
|
4245
|
+
o?.length || (o = n.getAttribute("title")), a != null && this.elementRecipes.push({
|
|
4189
4246
|
type: 1,
|
|
4190
4247
|
recipe: {
|
|
4191
4248
|
href: a,
|
|
4192
4249
|
caption: void 0,
|
|
4193
4250
|
// FIXME: Get the caption from figcaption
|
|
4194
4251
|
cssSelectorNode: t,
|
|
4195
|
-
attributes: o?.length ? [new
|
|
4196
|
-
|
|
4252
|
+
attributes: o?.length ? [new ae(
|
|
4253
|
+
Ot.ACCESSIBILITY_LABEL,
|
|
4197
4254
|
o
|
|
4198
4255
|
)] : []
|
|
4199
4256
|
}
|
|
4200
4257
|
});
|
|
4201
4258
|
} else {
|
|
4202
|
-
const
|
|
4259
|
+
const n = t, a = St(n, this.baseLocator.href);
|
|
4203
4260
|
let o;
|
|
4204
4261
|
if (a != null)
|
|
4205
4262
|
o = new U({
|
|
4206
4263
|
href: a
|
|
4207
4264
|
});
|
|
4208
4265
|
else {
|
|
4209
|
-
const h = [...
|
|
4210
|
-
const
|
|
4211
|
-
return
|
|
4212
|
-
href:
|
|
4213
|
-
type:
|
|
4266
|
+
const h = [...n.getElementsByTagName("source")].map((m) => {
|
|
4267
|
+
const p = St(m, this.baseLocator.href);
|
|
4268
|
+
return p ? new U({
|
|
4269
|
+
href: p,
|
|
4270
|
+
type: m.getAttribute("type") || void 0
|
|
4214
4271
|
}) : null;
|
|
4215
|
-
}).filter((
|
|
4272
|
+
}).filter((m) => !!m);
|
|
4216
4273
|
h.length > 0 && (o = new U({
|
|
4217
4274
|
href: h[0].href,
|
|
4218
4275
|
type: h[0].type,
|
|
4219
4276
|
alternates: h.length > 1 ? new O(h.slice(1)) : void 0
|
|
4220
4277
|
}));
|
|
4221
4278
|
}
|
|
4222
|
-
o && (
|
|
4279
|
+
o && (r === "AUDIO" ? this.elementRecipes.push({
|
|
4223
4280
|
type: 2,
|
|
4224
4281
|
recipe: {
|
|
4225
4282
|
cssSelectorNode: t,
|
|
4226
4283
|
link: o
|
|
4227
4284
|
}
|
|
4228
|
-
}) :
|
|
4285
|
+
}) : r === "VIDEO" && this.elementRecipes.push({
|
|
4229
4286
|
type: 3,
|
|
4230
4287
|
recipe: {
|
|
4231
4288
|
cssSelectorNode: t,
|
|
@@ -4239,23 +4296,23 @@ class tn {
|
|
|
4239
4296
|
// Implements NodeTraversor
|
|
4240
4297
|
tail(t, e) {
|
|
4241
4298
|
if (t.nodeType === Node.TEXT_NODE && !ot(t.textContent)) {
|
|
4242
|
-
const i =
|
|
4243
|
-
this.currentLanguage !== i && (this.flushSegment(), this.currentLanguage = i), this.rawTextAcc += t.textContent, this.textAcc =
|
|
4244
|
-
} else if (t.nodeType === Node.ELEMENT_NODE && !
|
|
4299
|
+
const i = Zi(t.parentElement);
|
|
4300
|
+
this.currentLanguage !== i && (this.flushSegment(), this.currentLanguage = i), this.rawTextAcc += t.textContent, this.textAcc = Ji(this.textAcc, t.textContent);
|
|
4301
|
+
} else if (t.nodeType === Node.ELEMENT_NODE && !ce(t)) {
|
|
4245
4302
|
if (!this.breadcrumbs.length || this.breadcrumbs.at(-1) !== t) throw new Error("HTMLContentIterator: breadcrumbs mismatch");
|
|
4246
4303
|
this.flushText(), this.breadcrumbs.pop();
|
|
4247
4304
|
}
|
|
4248
4305
|
}
|
|
4249
4306
|
flushText() {
|
|
4250
4307
|
if (this.flushSegment(), this.startIndex === 0 && this.startElement && this.breadcrumbs.length && this.breadcrumbs.at(-1) === this.startElement && (this.startIndex = this.elementRecipes.length), !this.segmentRecipesAcc.length) return;
|
|
4251
|
-
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text =
|
|
4308
|
+
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text = Ki(
|
|
4252
4309
|
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text
|
|
4253
4310
|
);
|
|
4254
|
-
let t =
|
|
4311
|
+
let t = Wi;
|
|
4255
4312
|
if (this.breadcrumbs.length > 0) {
|
|
4256
4313
|
const e = this.breadcrumbs.at(-1);
|
|
4257
4314
|
if (e.getAttributeNS("http://www.idpf.org/2007/ops", "type") === "footnote")
|
|
4258
|
-
t =
|
|
4315
|
+
t = Hi;
|
|
4259
4316
|
else
|
|
4260
4317
|
switch (e.nodeName.toUpperCase()) {
|
|
4261
4318
|
case "H1":
|
|
@@ -4264,11 +4321,11 @@ class tn {
|
|
|
4264
4321
|
case "H4":
|
|
4265
4322
|
case "H5":
|
|
4266
4323
|
case "H6":
|
|
4267
|
-
t = new
|
|
4324
|
+
t = new Gi(parseInt(e.nodeName[1]));
|
|
4268
4325
|
break;
|
|
4269
4326
|
case "BLOCKQUOTE":
|
|
4270
4327
|
case "Q":
|
|
4271
|
-
t = new
|
|
4328
|
+
t = new Fi(
|
|
4272
4329
|
e.getAttribute("cite")?.length ? new URL(e.getAttribute("cite")) : void 0,
|
|
4273
4330
|
e.getAttribute("title") || void 0
|
|
4274
4331
|
);
|
|
@@ -4290,14 +4347,14 @@ class tn {
|
|
|
4290
4347
|
const e = ve(t);
|
|
4291
4348
|
if (!ot(e)) {
|
|
4292
4349
|
if (!this.segmentRecipesAcc.length) {
|
|
4293
|
-
t =
|
|
4350
|
+
t = Xi(t);
|
|
4294
4351
|
const i = t.length && ot(t[t.length - 1]) ? t[t.length - 1] : "";
|
|
4295
4352
|
t = e + i;
|
|
4296
4353
|
}
|
|
4297
4354
|
this.segmentRecipesAcc.push({
|
|
4298
4355
|
text: t,
|
|
4299
|
-
attributes: this.currentLanguage ? [new
|
|
4300
|
-
|
|
4356
|
+
attributes: this.currentLanguage ? [new ae(
|
|
4357
|
+
Ot.LANGUAGE,
|
|
4301
4358
|
this.currentLanguage
|
|
4302
4359
|
)] : [],
|
|
4303
4360
|
beforeRange: this.wholeRawTextAcc ? [this.wholeRawTextAcc.length - this.beforeMaxLength, this.wholeRawTextAcc.length] : [0, 0],
|
|
@@ -4307,7 +4364,7 @@ class tn {
|
|
|
4307
4364
|
this.rawTextAcc.length && (this.wholeRawTextAcc = (this.wholeRawTextAcc || "") + this.rawTextAcc, this.elementRawTextAcc += this.rawTextAcc), this.rawTextAcc = "", this.textAcc = "";
|
|
4308
4365
|
}
|
|
4309
4366
|
}
|
|
4310
|
-
class
|
|
4367
|
+
class At {
|
|
4311
4368
|
/**
|
|
4312
4369
|
* Creates a [LocatorMetadata].
|
|
4313
4370
|
*/
|
|
@@ -4320,9 +4377,9 @@ class vt {
|
|
|
4320
4377
|
static deserialize(t) {
|
|
4321
4378
|
if (!t) return;
|
|
4322
4379
|
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(["title", "numberOfItems"]);
|
|
4323
|
-
return Object.entries(t).forEach(([
|
|
4324
|
-
i.has(
|
|
4325
|
-
}), new
|
|
4380
|
+
return Object.entries(t).forEach(([r, n]) => {
|
|
4381
|
+
i.has(r) || e.set(r, n);
|
|
4382
|
+
}), new At({
|
|
4326
4383
|
title: M.deserialize(t.title),
|
|
4327
4384
|
numberOfItems: K(t.numberOfItems),
|
|
4328
4385
|
otherMetadata: e.size === 0 ? void 0 : e
|
|
@@ -4336,12 +4393,12 @@ class vt {
|
|
|
4336
4393
|
return this.title && (t.title = this.title.serialize()), this.numberOfItems !== void 0 && (t.numberOfItems = this.numberOfItems), this.otherMetadata && this.otherMetadata.forEach((e, i) => t[i] = e), t;
|
|
4337
4394
|
}
|
|
4338
4395
|
}
|
|
4339
|
-
class
|
|
4396
|
+
class De {
|
|
4340
4397
|
/**
|
|
4341
4398
|
* Creates a [LocatorCollection].
|
|
4342
4399
|
*/
|
|
4343
4400
|
constructor(t) {
|
|
4344
|
-
this.metadata = t.metadata ?? new
|
|
4401
|
+
this.metadata = t.metadata ?? new At({}), this.links = t.links ?? new O([]), this.locators = t.locators ?? [];
|
|
4345
4402
|
}
|
|
4346
4403
|
/**
|
|
4347
4404
|
* Parses a [LocatorCollection] from its RWPM JSON representation.
|
|
@@ -4349,8 +4406,8 @@ class ke {
|
|
|
4349
4406
|
static deserialize(t) {
|
|
4350
4407
|
if (!t) return;
|
|
4351
4408
|
let e, i = t.locators;
|
|
4352
|
-
return i && Array.isArray(i) && (e = i.map((
|
|
4353
|
-
metadata:
|
|
4409
|
+
return i && Array.isArray(i) && (e = i.map((r) => k.deserialize(r)).filter((r) => r !== void 0)), new De({
|
|
4410
|
+
metadata: At.deserialize(t.metadata),
|
|
4354
4411
|
links: O.deserialize(t.links),
|
|
4355
4412
|
locators: e
|
|
4356
4413
|
});
|
|
@@ -4367,7 +4424,7 @@ class ke {
|
|
|
4367
4424
|
return this.links && this.links.items.length > 0 && (t.links = this.links.serialize()), this.locators && (t.locators = this.locators.map((e) => e.serialize())), t;
|
|
4368
4425
|
}
|
|
4369
4426
|
}
|
|
4370
|
-
class
|
|
4427
|
+
class W {
|
|
4371
4428
|
/**
|
|
4372
4429
|
* Creates a [PublicationCollection].
|
|
4373
4430
|
*/
|
|
@@ -4379,20 +4436,20 @@ class G {
|
|
|
4379
4436
|
*/
|
|
4380
4437
|
static deserialize(t) {
|
|
4381
4438
|
if (!t) return;
|
|
4382
|
-
let e, i,
|
|
4439
|
+
let e, i, r;
|
|
4383
4440
|
if (Array.isArray(t))
|
|
4384
4441
|
e = O.deserialize(t);
|
|
4385
4442
|
else if (typeof t == "object")
|
|
4386
|
-
e = O.deserialize(t.links), i = /* @__PURE__ */ new Map(), t.metadata && Object.entries(t.metadata).forEach(([
|
|
4387
|
-
i?.set(
|
|
4388
|
-
}),
|
|
4443
|
+
e = O.deserialize(t.links), i = /* @__PURE__ */ new Map(), t.metadata && Object.entries(t.metadata).forEach(([n, a]) => {
|
|
4444
|
+
i?.set(n, a);
|
|
4445
|
+
}), r = W.deserializeCollections(t);
|
|
4389
4446
|
else
|
|
4390
4447
|
return;
|
|
4391
4448
|
if (!(!e || e.items.length === 0))
|
|
4392
|
-
return new
|
|
4449
|
+
return new W({
|
|
4393
4450
|
metadata: i?.size ? i : void 0,
|
|
4394
4451
|
links: e,
|
|
4395
|
-
subcollections:
|
|
4452
|
+
subcollections: r?.size ? r : void 0
|
|
4396
4453
|
});
|
|
4397
4454
|
}
|
|
4398
4455
|
/**
|
|
@@ -4402,15 +4459,15 @@ class G {
|
|
|
4402
4459
|
static deserializeCollections(t) {
|
|
4403
4460
|
if (!t) return;
|
|
4404
4461
|
const e = /* @__PURE__ */ new Map();
|
|
4405
|
-
return Object.entries(t).forEach(([i,
|
|
4462
|
+
return Object.entries(t).forEach(([i, r]) => {
|
|
4406
4463
|
if (i !== "links" && i !== "metadata") {
|
|
4407
|
-
const
|
|
4408
|
-
if (
|
|
4464
|
+
const n = W.deserialize(r);
|
|
4465
|
+
if (n) {
|
|
4409
4466
|
const a = new Array();
|
|
4410
|
-
a.push(
|
|
4411
|
-
} else if (Array.isArray(
|
|
4412
|
-
const a =
|
|
4413
|
-
(o) =>
|
|
4467
|
+
a.push(n), e.set(i, a);
|
|
4468
|
+
} else if (Array.isArray(r)) {
|
|
4469
|
+
const a = r.map(
|
|
4470
|
+
(o) => W.deserialize(o)
|
|
4414
4471
|
).filter((o) => o !== void 0);
|
|
4415
4472
|
e.set(i, a);
|
|
4416
4473
|
}
|
|
@@ -4424,17 +4481,17 @@ class G {
|
|
|
4424
4481
|
const t = {};
|
|
4425
4482
|
return this.metadata && (t.metadata = {}, this.metadata.forEach(
|
|
4426
4483
|
(e, i) => t.metadata[i] = e
|
|
4427
|
-
)), this.links.items.length && (t.links = this.links.serialize()),
|
|
4484
|
+
)), this.links.items.length && (t.links = this.links.serialize()), W.serializeCollection(t, this.subcollections), t;
|
|
4428
4485
|
}
|
|
4429
4486
|
static serializeCollection(t, e) {
|
|
4430
4487
|
e && e.size > 0 && e.forEach(
|
|
4431
|
-
(i,
|
|
4432
|
-
i.length === 1 ? t[
|
|
4488
|
+
(i, r) => {
|
|
4489
|
+
i.length === 1 ? t[r] = i[0].serialize() : t[r] = i.map((n) => n.serialize());
|
|
4433
4490
|
}
|
|
4434
4491
|
);
|
|
4435
4492
|
}
|
|
4436
4493
|
}
|
|
4437
|
-
class
|
|
4494
|
+
class Ue {
|
|
4438
4495
|
constructor(t) {
|
|
4439
4496
|
this.context = t.context, this.metadata = t.metadata, this.links = t.links, this.readingOrder = t.readingOrder, this.resources = t.resources, this.toc = t.toc, this.subcollections = t.subcollections;
|
|
4440
4497
|
}
|
|
@@ -4446,22 +4503,22 @@ class De {
|
|
|
4446
4503
|
*/
|
|
4447
4504
|
static deserialize(t) {
|
|
4448
4505
|
if (!t) return;
|
|
4449
|
-
const e =
|
|
4506
|
+
const e = ft.deserialize(t.metadata);
|
|
4450
4507
|
if (!e) return;
|
|
4451
4508
|
const i = O.deserialize(t.links);
|
|
4452
4509
|
if (!i) return;
|
|
4453
|
-
const
|
|
4510
|
+
const r = O.deserialize(
|
|
4454
4511
|
t.readingOrder ? t.readingOrder : t.spine
|
|
4455
4512
|
);
|
|
4456
|
-
if (
|
|
4457
|
-
return new
|
|
4513
|
+
if (r)
|
|
4514
|
+
return new Ue({
|
|
4458
4515
|
context: F(t["@context"]),
|
|
4459
4516
|
metadata: e,
|
|
4460
4517
|
links: i,
|
|
4461
|
-
readingOrder:
|
|
4518
|
+
readingOrder: r,
|
|
4462
4519
|
resources: O.deserialize(t.resources),
|
|
4463
4520
|
toc: O.deserialize(t.toc),
|
|
4464
|
-
subcollections:
|
|
4521
|
+
subcollections: W.deserializeCollections({
|
|
4465
4522
|
sub: t.sub
|
|
4466
4523
|
})
|
|
4467
4524
|
});
|
|
@@ -4471,37 +4528,37 @@ class De {
|
|
|
4471
4528
|
*/
|
|
4472
4529
|
serialize() {
|
|
4473
4530
|
const t = {};
|
|
4474
|
-
return this.context !== void 0 && (t["@context"] = this.context), t.metadata = this.metadata.serialize(), t.links = this.links.serialize(), t.readingOrder = this.readingOrder.serialize(), this.resources && (t.resources = this.resources.serialize()), this.toc && (t.toc = this.toc.serialize()),
|
|
4531
|
+
return this.context !== void 0 && (t["@context"] = this.context), t.metadata = this.metadata.serialize(), t.links = this.links.serialize(), t.readingOrder = this.readingOrder.serialize(), this.resources && (t.resources = this.resources.serialize()), this.toc && (t.toc = this.toc.serialize()), W.serializeCollection(t, this.subcollections), t;
|
|
4475
4532
|
}
|
|
4476
4533
|
/** Finds the first link with the given relation in the manifest's links. */
|
|
4477
4534
|
linkWithRel(t) {
|
|
4478
4535
|
const e = new Array();
|
|
4479
4536
|
e.push(this.readingOrder), this.resources && e.push(this.resources), e.push(this.links);
|
|
4480
4537
|
let i;
|
|
4481
|
-
for (const
|
|
4482
|
-
if (i =
|
|
4538
|
+
for (const r of e)
|
|
4539
|
+
if (i = r.findWithRel(t), i !== void 0)
|
|
4483
4540
|
return i;
|
|
4484
4541
|
return i;
|
|
4485
4542
|
}
|
|
4486
4543
|
/** Finds all the links with the given relation in the manifest's links. */
|
|
4487
4544
|
linksWithRel(t) {
|
|
4488
4545
|
const e = [];
|
|
4489
|
-
return e.push(this.readingOrder.filterByRel(t)), this.resources && e.push(this.resources.filterByRel(t)), e.push(this.links.filterByRel(t)), e.reduce((i,
|
|
4546
|
+
return e.push(this.readingOrder.filterByRel(t)), this.resources && e.push(this.resources.filterByRel(t)), e.push(this.links.filterByRel(t)), e.reduce((i, r) => i.concat(r), []);
|
|
4490
4547
|
}
|
|
4491
4548
|
/**
|
|
4492
4549
|
* Creates a new [Locator] object from a [Link] to a resource of this manifest.
|
|
4493
4550
|
* Returns null if the resource is not found in this manifest.
|
|
4494
4551
|
*/
|
|
4495
4552
|
locatorFromLink(t) {
|
|
4496
|
-
const e = t.href.split("#"), i = e.length == 2 ? e[0] : t.href,
|
|
4497
|
-
if (!n) return;
|
|
4498
|
-
const r = n.type;
|
|
4553
|
+
const e = t.href.split("#"), i = e.length == 2 ? e[0] : t.href, r = this.linkWithHref(i);
|
|
4499
4554
|
if (!r) return;
|
|
4555
|
+
const n = r.type;
|
|
4556
|
+
if (!n) return;
|
|
4500
4557
|
const a = e.length == 2 ? e[1] : void 0;
|
|
4501
4558
|
return new k({
|
|
4502
4559
|
href: i,
|
|
4503
|
-
type:
|
|
4504
|
-
title:
|
|
4560
|
+
type: n,
|
|
4561
|
+
title: r.title ?? t.title,
|
|
4505
4562
|
locations: new T({
|
|
4506
4563
|
fragments: a ? [a] : void 0,
|
|
4507
4564
|
progression: a ? void 0 : 0
|
|
@@ -4512,24 +4569,24 @@ class De {
|
|
|
4512
4569
|
linkWithHref(t) {
|
|
4513
4570
|
const e = (o) => {
|
|
4514
4571
|
let h;
|
|
4515
|
-
for (const
|
|
4516
|
-
if (h =
|
|
4572
|
+
for (const p of o)
|
|
4573
|
+
if (h = p.findWithHref(t), h !== void 0)
|
|
4517
4574
|
return h;
|
|
4518
|
-
const
|
|
4519
|
-
return o.forEach((
|
|
4575
|
+
const m = new Array();
|
|
4576
|
+
return o.forEach((p) => {
|
|
4520
4577
|
const u = [];
|
|
4521
|
-
for (const g of
|
|
4578
|
+
for (const g of p.items)
|
|
4522
4579
|
g.alternates && u.push(g.alternates), g.children && u.push(g.children);
|
|
4523
|
-
|
|
4524
|
-
}),
|
|
4580
|
+
m.push(...u);
|
|
4581
|
+
}), m.length > 0 && (h = e(m)), h;
|
|
4525
4582
|
}, i = [];
|
|
4526
4583
|
i.push(this.readingOrder), this.resources && i.push(this.resources), i.push(this.links);
|
|
4527
|
-
const
|
|
4528
|
-
if (
|
|
4529
|
-
return
|
|
4530
|
-
const
|
|
4531
|
-
if (
|
|
4532
|
-
const a =
|
|
4584
|
+
const r = e(i);
|
|
4585
|
+
if (r !== void 0)
|
|
4586
|
+
return r;
|
|
4587
|
+
const n = t.split(/[#]/);
|
|
4588
|
+
if (n.length < 2) return;
|
|
4589
|
+
const a = n[0];
|
|
4533
4590
|
return this.linkWithHref(a);
|
|
4534
4591
|
}
|
|
4535
4592
|
/** The URL where this publication is served, computed from the `Link` with `self` relation.
|
|
@@ -4542,8 +4599,8 @@ class De {
|
|
|
4542
4599
|
if (t) {
|
|
4543
4600
|
let e = t.href;
|
|
4544
4601
|
if (e) {
|
|
4545
|
-
const i = e.lastIndexOf("/"),
|
|
4546
|
-
e = e.replace(new RegExp("/?$query$"), ""), e = e.replace(new RegExp("//$"), ""),
|
|
4602
|
+
const i = e.lastIndexOf("/"), r = i === -1 ? void 0 : e.substring(i + 1);
|
|
4603
|
+
e = e.replace(new RegExp("/?$query$"), ""), e = e.replace(new RegExp("//$"), ""), r && (e = e.replace(new RegExp(r + "$"), ""));
|
|
4547
4604
|
}
|
|
4548
4605
|
return e;
|
|
4549
4606
|
}
|
|
@@ -4564,106 +4621,106 @@ class De {
|
|
|
4564
4621
|
}
|
|
4565
4622
|
}
|
|
4566
4623
|
export {
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4624
|
+
R as AccessMode,
|
|
4625
|
+
_ as Accessibility,
|
|
4626
|
+
sr as AccessibilityMetadataDisplayGuide,
|
|
4627
|
+
Tt as AccessibilityProfile,
|
|
4628
|
+
Ht as AccessibilitySummary,
|
|
4572
4629
|
j as Acquisition,
|
|
4573
|
-
|
|
4630
|
+
Mt as AdditionalInformation,
|
|
4574
4631
|
Z as AltIdentifier,
|
|
4575
|
-
|
|
4576
|
-
|
|
4632
|
+
ae as Attribute,
|
|
4633
|
+
Ot as AttributeKeys,
|
|
4577
4634
|
pe as AttributesHolder,
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4635
|
+
Ui as AudioElement,
|
|
4636
|
+
qt as Availability,
|
|
4637
|
+
Di as AvailabilityStatus,
|
|
4638
|
+
q as BelongsTo,
|
|
4639
|
+
Wi as Body,
|
|
4640
|
+
Pt as Certification,
|
|
4641
|
+
Gt as Conformance,
|
|
4642
|
+
nr as Content,
|
|
4643
|
+
me as ContentElement,
|
|
4644
|
+
ut as Contributor,
|
|
4588
4645
|
N as Contributors,
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4646
|
+
Jt as Copies,
|
|
4647
|
+
Ri as DefaultTextContentTokenizer,
|
|
4648
|
+
Xt as DomRange,
|
|
4592
4649
|
mt as DomRangePoint,
|
|
4593
|
-
|
|
4594
|
-
|
|
4650
|
+
ti as EmptyFetcher,
|
|
4651
|
+
Ft as Encryption,
|
|
4595
4652
|
xt as Exemption,
|
|
4596
|
-
|
|
4597
|
-
|
|
4653
|
+
A as Feature,
|
|
4654
|
+
Hi as Footnote,
|
|
4598
4655
|
$t as GuidedNavigationDocument,
|
|
4599
4656
|
X as GuidedNavigationObject,
|
|
4600
|
-
|
|
4601
|
-
|
|
4657
|
+
pt as GuidedNavigationText,
|
|
4658
|
+
hr as HTMLResourceContentIterator,
|
|
4602
4659
|
P as Hazard,
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4660
|
+
ci as HazardType,
|
|
4661
|
+
Bt as Hazards,
|
|
4662
|
+
Gi as Heading,
|
|
4663
|
+
Zt as Holds,
|
|
4664
|
+
tr as HttpFetcher,
|
|
4665
|
+
ei as HttpResource,
|
|
4609
4666
|
et as IllegalStateError,
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4667
|
+
Bi as ImageElement,
|
|
4668
|
+
Ci as IntlTextTokenizer,
|
|
4669
|
+
Qt as Iterator,
|
|
4670
|
+
$ as Layout,
|
|
4614
4671
|
Wt as Legal,
|
|
4615
4672
|
U as Link,
|
|
4616
4673
|
O as Links,
|
|
4617
|
-
|
|
4674
|
+
f as Localization,
|
|
4618
4675
|
M as LocalizedString,
|
|
4619
4676
|
k as Locator,
|
|
4620
|
-
|
|
4621
|
-
|
|
4677
|
+
De as LocatorCollection,
|
|
4678
|
+
At as LocatorCollectionMetadata,
|
|
4622
4679
|
T as LocatorLocations,
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4680
|
+
rt as LocatorText,
|
|
4681
|
+
Ue as Manifest,
|
|
4682
|
+
_t as MediaOverlay,
|
|
4626
4683
|
c as MediaType,
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4684
|
+
ft as Metadata,
|
|
4685
|
+
Pi as NaiveTextTokenizer,
|
|
4686
|
+
Dt as Navigation,
|
|
4687
|
+
ni as NonvisualReading,
|
|
4688
|
+
er as NumberRange,
|
|
4689
|
+
wt as PDFContentElement,
|
|
4690
|
+
Nt as Page,
|
|
4691
|
+
lr as PageContentIteratorPDF,
|
|
4692
|
+
ai as PrerecordedAudio,
|
|
4693
|
+
Kt as Price,
|
|
4694
|
+
It as PrimaryAccessMode,
|
|
4638
4695
|
J as Profile,
|
|
4639
4696
|
D as Properties,
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4697
|
+
V as Publication,
|
|
4698
|
+
W as PublicationCollection,
|
|
4699
|
+
cr as PublicationContentIterator,
|
|
4643
4700
|
H as ReadingProgression,
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4701
|
+
ir as Resource,
|
|
4702
|
+
Ut as RichContent,
|
|
4703
|
+
oi as RichContentType,
|
|
4647
4704
|
dt as Subject,
|
|
4648
4705
|
Vt as Subjects,
|
|
4649
4706
|
Yt as TDM,
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4707
|
+
hi as TDMReservation,
|
|
4708
|
+
ar as TextContentTokenizer,
|
|
4709
|
+
zt as TextElement,
|
|
4710
|
+
Fi as TextQuote,
|
|
4711
|
+
ge as TextSegment,
|
|
4712
|
+
zi as TextUnit,
|
|
4713
|
+
vt as TextualElement,
|
|
4714
|
+
ht as URITemplate,
|
|
4715
|
+
Mi as VideoElement,
|
|
4716
|
+
ri as VisualAdjustments,
|
|
4717
|
+
kt as WaysOfReading,
|
|
4718
|
+
li as arrayfromJSON,
|
|
4662
4719
|
F as arrayfromJSONorString,
|
|
4663
4720
|
ct as datefromJSON,
|
|
4664
|
-
|
|
4721
|
+
rr as leadingPage,
|
|
4665
4722
|
K as numberfromJSON,
|
|
4666
4723
|
L as positiveNumberfromJSON,
|
|
4667
4724
|
lt as setToArray,
|
|
4668
|
-
|
|
4725
|
+
fe as speakableToken
|
|
4669
4726
|
};
|