@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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- class je {
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 en {
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 ti(this.client, t, e);
22
+ return new ei(this.client, t, e);
23
23
  }
24
24
  close() {
25
25
  }
26
26
  }
27
- class ti {
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 sn {
91
+ class er {
92
92
  constructor(t, e) {
93
93
  this.start = t, this.endInclusive = e;
94
94
  }
95
95
  }
96
- class nn {
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 V {
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 V({
118
- conformsTo: e.conformsTo ? e.conformsTo.map((i) => Et.deserialize(i)).filter((i) => i !== void 0) : void 0,
119
- certification: e.certification ? Rt.deserialize(e.certification) : void 0,
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) => C.deserialize(i)).filter((i) => i !== void 0) : void 0,
122
- accessModeSufficient: e.accessModeSufficient ? e.accessModeSufficient.map((i) => Tt.deserialize(i)).filter((i) => i !== void 0) : void 0,
123
- feature: e.feature ? e.feature.map((i) => v.deserialize(i)).filter((i) => i !== void 0) : void 0,
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 Et = b;
174
- class Rt {
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 Rt(
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 w = class w {
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 w(t);
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
- w.AUDITORY = new w("auditory"), w.CHART_ON_VISUAL = new w("chartOnVisual"), w.CHEM_ON_VISUAL = new w("chemOnVisual"), w.COLOR_DEPENDENT = new w("colorDependent"), w.DIAGRAM_ON_VISUAL = new w("diagramOnVisual"), w.MATH_ON_VISUAL = new w("mathOnVisual"), w.MUSIC_ON_VISUAL = new w("musicOnVisual"), w.TACTILE = new w("tactile"), w.TEXT_ON_VISUAL = new w("textOnVisual"), w.TEXTUAL = new w("textual"), w.VISUAL = new w("visual");
216
- let C = w;
217
- const I = class I {
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 (!I.VALID_MODES.has(t.toLowerCase()))
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) => I.VALID_MODES.has(i.toLowerCase())
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 I(t);
238
+ return new x(t);
239
239
  if (!Array.isArray(t)) return;
240
- const e = t.filter((i) => i ? I.VALID_MODES.has(i.toLowerCase()) : !1);
240
+ const e = t.filter((i) => i ? x.VALID_MODES.has(i.toLowerCase()) : !1);
241
241
  if (e.length !== 0)
242
- return new I(e);
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
- I.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), I.AUDITORY = new I("auditory"), I.TACTILE = new I("tactile"), I.TEXTUAL = new I("textual"), I.VISUAL = new I("visual");
252
- let Tt = I;
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 v = l;
273
- const y = class y {
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 y(t);
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
- y.FLASHING = new y("flashing"), y.NO_FLASHING_HAZARD = new y("noFlashingHazard"), y.UNKNOWN_FLASHING_HAZARD = new y("unknownFlashingHazard"), y.MOTION_SIMULATION = new y("motionSimulation"), y.NO_MOTION_SIMULATION_HAZARD = new y("noMotionSimulationHazard"), y.UNKNOWN_MOTION_SIMULATION_HAZARD = new y("unknownMotionSimulationHazard"), y.SOUND = new y("sound"), y.NO_SOUND_HAZARD = new y("noSoundHazard"), y.UNKNOWN_SOUND_HAZARD = new y("unknownSoundHazard"), y.UNKNOWN = new y("unknown"), y.NONE = new y("none");
292
- let P = y;
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
- "ways-of-reading": { title: "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" } }, "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" } } },
315
- conformance: ei,
316
- navigation: ii,
317
- "rich-content": { title: "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)" }, "math-as-mathml": { compact: "Math as MathML", descriptive: "Math formulas in accessible format (MathML)" }, "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", "open-captions": { compact: "Videos have open captions", descriptive: "Videos included in publications have open captions" }, transcript: "Transcript(s) provided", unknown: "No information is available" },
318
- hazards: si,
319
- "accessibility-summary": { title: "Accessibility summary", "no-metadata": "No information is available", "publisher-contact": "For more information about the accessibility of this product, please contact the publisher: " },
320
- "legal-considerations": { title: "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" },
321
- "additional-accessibility-information": { title: "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", "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" }
322
- }, ni = { title: "Règles d'accessibilité", "details-title": "Information détaillée", a: { compact: "Cette publication répond aux règles minimales d'accessibilité", descriptive: "La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau A" }, aa: { compact: "Cette publication répond aux règles d'accessibilité reconnues", descriptive: "La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau AA" }, aaa: { compact: "Cette publication dépasse les règles d'accessibilité reconnues", descriptive: "La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau AAA" }, no: "Aucune information disponible", "unknown-standard": "Aucune indication concernant les normes d'accessibilité", certifier: "Accessibilité évaluée par ", "certifier-credentials": "L'évaluateur est accrédité par ", details: { "certification-info": "Cette publication a été certifié le", "certifier-report": "Pour plus d'information, veuillez consulter le rapport de certification", claim: "Cette publication indique respecter", "epub-accessibility-1-0": "EPUB Accessibilité 1.0", "epub-accessibility-1-1": "EPUB Accessibilité 1.1", "level-a": "Niveau A", "level-aa": "Niveau AA", "level-aaa": "Niveau AAA", "wcag-2-0": { compact: "WCAG 2.0", descriptive: "Règles pour l’accessibilité des contenus Web (WCAG) 2.0" }, "wcag-2-1": { compact: "WCAG 2.1", descriptive: "Règles pour l’accessibilité des contenus Web (WCAG) 2.1" }, "wcag-2-2": { compact: "WCAG 2.2", descriptive: "Règles pour l’accessibilité des contenus Web (WCAG) 2.2" } } }, ri = { title: "Points de repère", index: { compact: "Index", descriptive: "Index comportant des liens vers les entrées référencées" }, "no-metadata": "Aucune information disponible", "page-navigation": { compact: "Aller à la page", descriptive: "Permet d'accéder aux pages de la version source imprimée" }, structural: { compact: "Titres", descriptive: "Contient des titres pour une navigation structurée" }, toc: { compact: "Table des matières", descriptive: "Table des matières" } }, ai = { title: "Points d'attention", flashing: { compact: "Flashs lumineux", descriptive: "La publication contient des flashs lumineux qui peuvent provoquer des crises d’épilepsie" }, "flashing-none": { compact: "Pas de flashs lumineux", descriptive: "La publication ne contient pas de flashs lumineux susceptibles de provoquer des crises d’épilepsie" }, "flashing-unknown": { compact: "Pas d'information concernant la présence de flashs lumineux", descriptive: "La présence de flashs lumineux susceptibles de provoquer des crises d’épilepsie n'a pas pu être déterminée" }, motion: { compact: "Sensations de mouvement", descriptive: "La publication contient des images en mouvement qui peuvent provoquer des nausées, des vertiges et des maux de tête" }, "motion-none": { compact: "Pas de sensations de mouvement", descriptive: "La publication ne contient pas d'images en mouvement qui pourraient provoquer des nausées, des vertiges et des maux de tête" }, "motion-unknown": { compact: "Pas d'information concernant la présence d'images en mouvement", descriptive: "La présence d'images en mouvement susceptibles de provoquer des nausées, des vertiges et des maux de tête n'a pas pu être déterminée" }, "no-metadata": "Aucune information disponible", none: { compact: "Aucun points d'attention", descriptive: "La publication ne présente aucun risque lié à la présence de flashs lumineux, de sensations de mouvement ou de sons" }, sound: { compact: "Sons", descriptive: "La publication contient des sons qui peuvent causer des troubles de la sensibilité" }, "sound-none": { compact: "Pas de risques sonores", descriptive: "La publication ne contient pas de sons susceptibles de provoquer des troubles de la sensibilité" }, "sound-unknown": { compact: "Pas d'information concernant la présence de sons", descriptive: "La présence de sons susceptibles de causer des troubles de sensibilité n'a pas pu être déterminée" }, unknown: "La présence de risques est inconnue" }, oi = {
323
- "ways-of-reading": { title: "Lisibilité", "nonvisual-reading": { "alt-text": { compact: "Images décrites", descriptive: "Les images sont décrites par un texte" }, "no-metadata": "Aucune information pour la lecture en voix de synthèse ou en braille", none: { compact: "Non lisible en voix de synthèse ou en braille", descriptive: "Le contenu n'est pas lisible en voix de synthèse ou en braille" }, "not-fully": { compact: "Pas entièrement lisible en voix de synthèse ou en braille", descriptive: "Tous les contenus ne pourront pas être lus à haute voix ou en braille" }, readable: { compact: "Entièrement lisible en voix de synthèse ou en braille", descriptive: "Tous les contenus peuvent être lus en voix de synthèse ou en braille" } }, "prerecorded-audio": { complementary: { compact: "Clips audio préenregistrés", descriptive: "Des clips audio préenregistrés sont intégrés au contenu" }, "no-metadata": "Aucune information sur les enregistrements audio", only: { compact: "Audio préenregistré uniquement", descriptive: "Livre audio sans texte alternatif" }, synchronized: { compact: "Audio préenregistré synchronisé avec du texte", descriptive: "Tous les contenus sont disponibles comme audio préenregistrés synchronisés avec le texte" } }, "visual-adjustments": { modifiable: { compact: "L'affichage peut être adapté", descriptive: "L'apparence du texte et la mise en page peuvent être modifiées en fonction des capacités du système de lecture (famille et taille des polices, espaces entre les paragraphes, les phrases, les mots et les lettres, ainsi que la couleur de l'arrière-plan et du texte)" }, unknown: "Aucune information sur les possibilités d'adaptation de l'affichage", unmodifiable: { compact: "L'affichage ne peut pas être adapté", descriptive: "Le texte et la mise en page ne peuvent pas être adaptés étant donné que l'expérience de lecture est proche de celle de la version imprimée, mais l'application de lecture peut tout de même proposer la capacité de zoomer" } } },
324
- conformance: ni,
325
- navigation: ri,
326
- "rich-content": { title: "Contenus spécifiques", "accessible-chemistry-as-latex": { compact: "Formules chimiques en LaTeX", descriptive: "Formules chimiques en format accessible (LaTeX)" }, "accessible-chemistry-as-mathml": { compact: "Formules chimiques en MathML", descriptive: "Formules chimiques en format accessible (MathML)" }, "accessible-math-as-latex": { compact: "Mathématiques en LaTeX", descriptive: "Formules mathématiques en format accessible (LaTeX)" }, "math-as-mathml": { compact: "Mathématiques en MathML", descriptive: "Formules mathématiques en format accessible (MathML)" }, "accessible-math-described": "Des descriptions textuelles des formules mathématiques sont fournies", "closed-captions": { compact: "Sous-titres disponibles pour les vidéos", descriptive: "Des sous titres sont disponibles pour les vidéos" }, "extended-descriptions": "Les images porteuses d'informations complexes sont décrites par des descriptions longues", "open-captions": { compact: "Sous-titres incrustés", descriptive: "Des sous titres sont incrustés pour les vidéos" }, transcript: "Transcriptions fournies", unknown: "Aucune information disponible" },
327
- hazards: ai,
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 = ee, this.availableLocales = {
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 $.instance || ($.instance = new $()), $.instance;
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.availableLocales[t] = e;
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-FR')
355
- * @returns boolean indicating if the locale was set successfully
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.availableLocales ? (this.locale = this.availableLocales[t], this.currentLocaleCode = t, !0) : (console.warn(`Locale '${t}' is not available`), !1);
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 Object.keys(this.availableLocales);
381
+ return ee;
371
382
  }
372
383
  getNestedValue(t, e) {
373
384
  const i = e.split(".");
374
- let n = t;
375
- for (const r of i) {
376
- if (n == null)
385
+ let r = t;
386
+ for (const n of i) {
387
+ if (r == null)
377
388
  return;
378
- n = n[r];
389
+ r = r[n];
379
390
  }
380
- return n;
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.availableLocales.en, t)), e !== void 0 ? typeof e == "string" ? { compact: e, descriptive: e } : e : (console.warn(`Missing localization for key: ${t}`), { compact: "", descriptive: "" });
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 p = $.getInstance();
393
- var q = /* @__PURE__ */ ((s) => (s.reflowable = "reflowable", s.fixed = "fixed", s.scrolled = "scrolled", s))(q || {}), ci = /* @__PURE__ */ ((s) => (s.Unknown = "unknown", s.Modifiable = "modifiable", s.Unmodifiable = "unmodifiable", s))(ci || {}), li = /* @__PURE__ */ ((s) => (s.NoMetadata = "noMetadata", s.Readable = "readable", s.NotFully = "notFully", s.Unreadable = "unreadable", s))(li || {}), ui = /* @__PURE__ */ ((s) => (s.NoMetadata = "noMetadata", s.Synchronized = "synchronized", s.AudioOnly = "audioOnly", s.AudioComplementary = "audioComplementary", s))(ui || {});
394
- class Pt {
395
- constructor(t = "unknown", e = "noMetadata", i = !1, n = "noMetadata") {
396
- this.id = "ways-of-reading.title", this.visualAdjustments = t, this.nonvisualReading = e, this.nonvisualReadingAltText = i, this.prerecordedAudio = n, this.shouldDisplay = !0;
397
- const r = p.getString(this.id);
398
- this.title = r.compact, this.statements = [];
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 = p.getString(a);
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 f = p.getString(h);
418
+ const m = f.getString(h);
408
419
  if (this.statements.push({
409
420
  id: h,
410
- compactString: f.compact,
411
- descriptiveString: f.descriptive
421
+ compactString: m.compact,
422
+ descriptiveString: m.descriptive
412
423
  }), i) {
413
- const g = p.getString("ways-of-reading.nonvisual-reading.alt-text");
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 m = "";
421
- n === "synchronized" ? m = "ways-of-reading.prerecorded-audio.synchronized" : n === "audioOnly" ? m = "ways-of-reading.prerecorded-audio.only" : n === "audioComplementary" ? m = "ways-of-reading.prerecorded-audio.complementary" : n === "noMetadata" && (m = "ways-of-reading.prerecorded-audio.no-metadata");
422
- const u = p.getString(m);
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: m,
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 V(), i = e.feature ?? [], n = t.metadata.layout === q.fixed, r = i.some((d) => d.value === v.DISPLAY_TRANSFORMABILITY.value) ? "modifiable" : n ? "unmodifiable" : "unknown", a = e.accessMode ?? [], o = e.accessModeSufficient ?? [], h = a.length > 0 && a.every((d) => d.value === C.TEXTUAL.value) || o.some((d) => {
431
- const x = d.value;
432
- return Array.isArray(x) ? x.every((B) => B === C.TEXTUAL.value) : x === C.TEXTUAL.value;
433
- }), f = a.some((d) => d.value === C.TEXTUAL.value) || o.some((d) => {
434
- const x = d.value;
435
- return Array.isArray(x) ? x.some((B) => B === C.TEXTUAL.value) : x === C.TEXTUAL.value;
436
- }), m = !(a.length === 0 && o.length === 0) && !a.some((d) => d.value === C.TEXTUAL.value) && !o.some((d) => {
437
- const x = d.value;
438
- return Array.isArray(x) ? x.some((B) => B === C.TEXTUAL.value) : x === C.TEXTUAL.value;
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
- v.LONG_DESCRIPTION.value,
441
- v.ALTERNATIVE_TEXT.value,
442
- v.DESCRIBED_MATH.value,
443
- v.TRANSCRIPT.value
444
- ].includes(d.value)), g = h ? "readable" : f || u ? "notFully" : m ? "unreadable" : "noMetadata", A = u, R = i.some((d) => d.value === v.SYNCHRONIZED_AUDIO_TEXT.value) ? "synchronized" : o.some((d) => {
445
- const x = d.value;
446
- return Array.isArray(x) ? x.some((B) => B === C.AUDITORY.value) : x === C.AUDITORY.value;
447
- }) ? "audioOnly" : a.some((d) => d.value === C.AUDITORY.value) ? "audioComplementary" : "noMetadata";
448
- return new Pt(
449
- r,
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
- A,
452
- R
462
+ v,
463
+ C
453
464
  );
454
465
  }
455
466
  }
456
- class kt {
457
- constructor(t = !1, e = !1, i = !1, n = !1) {
458
- this.id = "navigation.title", this.tableOfContents = t, this.index = e, this.headings = i, this.page = n, this.noMetadata = !t && !e && !i && !n;
459
- const r = p.getString(this.id);
460
- if (this.title = r.compact, this.shouldDisplay = !this.noMetadata, this.statements = [], t) {
461
- const a = p.getString("navigation.toc");
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 = p.getString("navigation.index");
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 = p.getString("navigation.structural");
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 (n) {
485
- const a = p.getString("navigation.page-navigation");
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 = p.getString("navigation.no-metadata");
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 V()).feature ?? [];
503
- return new kt(
504
- i.some((n) => n.value === v.TABLE_OF_CONTENTS.value),
505
- i.some((n) => n.value === v.INDEX.value),
506
- i.some((n) => n.value === v.STRUCTURAL_NAVIGATION.value),
507
- i.some((n) => n.value === v.PAGE_NAVIGATION.value)
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 hi = /* @__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))(hi || {});
512
- class Dt {
513
- constructor(t = !1, e = !1, i = !1, n = !1, r = !1, a = !1, o = !1, h = !1, f = !1) {
514
- this.id = "rich-content.title", this.extendedAltTextDescriptions = t, this.mathFormula = e, this.mathFormulaAsMathML = i, this.mathFormulaAsLaTeX = n, this.chemicalFormulaAsMathML = r, this.chemicalFormulaAsLaTeX = a, this.closedCaptions = o, this.openCaptions = h, this.transcript = f, this.noMetadata = !t && !e && !i && !n && !r && !a && !o && !h && !f, this.shouldDisplay = !this.noMetadata;
515
- const m = p.getString(this.id);
516
- if (this.title = m.compact, this.statements = [], t) {
517
- const u = p.getString("rich-content.extended-descriptions");
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 = p.getString("rich-content.accessible-math-described");
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 = p.getString("rich-content.math-as-mathml");
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 (n) {
541
- const u = p.getString("rich-content.accessible-math-as-latex");
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 (r) {
549
- const u = p.getString("rich-content.accessible-chemistry-as-mathml");
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 = p.getString("rich-content.accessible-chemistry-as-latex");
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 = p.getString("rich-content.closed-captions");
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 = p.getString("rich-content.open-captions");
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 (f) {
581
- const u = p.getString("rich-content.transcript");
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 = p.getString("rich-content.unknown");
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 V()).feature ?? [];
599
- return new Dt(
600
- i.some((n) => n.value === v.LONG_DESCRIPTION.value),
601
- i.some((n) => n.value === v.DESCRIBED_MATH.value),
602
- i.some((n) => n.value === v.MATH_ML.value),
603
- i.some((n) => n.value === v.LATEX.value),
604
- i.some((n) => n.value === v.MATH_ML_CHEMISTRY.value),
605
- i.some((n) => n.value === v.LATEX_CHEMISTRY.value),
606
- i.some((n) => n.value === v.CLOSED_CAPTIONS.value),
607
- i.some((n) => n.value === v.OPEN_CAPTIONS.value),
608
- i.some((n) => n.value === v.TRANSCRIPT.value)
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 Ut {
613
- constructor(t = !1, e = !1, i = !1, n = !1, r = !1, a = !1, o = !1, h = !1, f = !1, m = !1, u = !1, g = !1, A = !1) {
614
- this.id = "additional-accessibility-information.title", this.pageBreakMarkers = t, this.aria = e, this.audioDescriptions = i, this.braille = n, this.rubyAnnotations = r, this.fullRubyAnnotations = a, this.highAudioContrast = o, this.highDisplayContrast = h, this.largePrint = f, this.signLanguage = m, this.tactileGraphics = u, this.tactileObjects = g, this.textToSpeechHinting = A, this.noMetadata = !t && !e && !i && !n && !r && !a && !o && !h && !f && !m && !u && !g && !A, this.shouldDisplay = !this.noMetadata;
615
- const R = p.getString(this.id);
616
- if (this.title = R.compact, this.statements = [], t) {
617
- const d = p.getString("additional-accessibility-information.page-breaks");
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 = p.getString("additional-accessibility-information.aria");
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 = p.getString("additional-accessibility-information.audio-descriptions");
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 (n) {
641
- const d = p.getString("additional-accessibility-information.braille");
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 (r) {
649
- const d = p.getString("additional-accessibility-information.ruby-annotations");
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 = p.getString("additional-accessibility-information.full-ruby-annotations");
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 = p.getString("additional-accessibility-information.high-contrast-between-foreground-and-background-audio");
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 = p.getString("additional-accessibility-information.high-contrast-between-text-and-background");
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 (f) {
681
- const d = p.getString("additional-accessibility-information.large-print");
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 (m) {
689
- const d = p.getString("additional-accessibility-information.sign-language");
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 = p.getString("additional-accessibility-information.tactile-graphics");
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 = p.getString("additional-accessibility-information.tactile-objects");
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 (A) {
713
- const d = p.getString("additional-accessibility-information.text-to-speech-hinting");
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 V()).feature ?? [];
723
- return new Ut(
724
- i.some((n) => n.value === v.PAGE_BREAK_MARKERS.value || n.value === v.PRINT_PAGE_NUMBERS.value),
725
- i.some((n) => n.value === v.ARIA.value),
726
- i.some((n) => n.value === v.AUDIO_DESCRIPTION.value),
727
- i.some((n) => n.value === v.BRAILLE.value),
728
- i.some((n) => n.value === v.RUBY_ANNOTATIONS.value),
729
- i.some((n) => n.value === v.FULL_RUBY_ANNOTATIONS.value),
730
- i.some((n) => n.value === v.HIGH_CONTRAST_AUDIO.value),
731
- i.some((n) => n.value === v.HIGH_CONTRAST_DISPLAY.value),
732
- i.some((n) => n.value === v.LARGE_PRINT.value),
733
- i.some((n) => n.value === v.SIGN_LANGUAGE.value),
734
- i.some((n) => n.value === v.TACTILE_GRAPHIC.value),
735
- i.some((n) => n.value === v.TACTILE_OBJECT.value),
736
- i.some((n) => n.value === v.TTS_MARKUP.value)
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 di = /* @__PURE__ */ ((s) => (s.yes = "yes", s.no = "no", s.unknown = "unknown", s.noMetadata = "noMetadata", s))(di || {});
741
- class Mt {
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 n = p.getString(this.id);
745
- if (this.title = n.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) {
746
- const r = p.getString("hazards.none");
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: r.compact,
750
- descriptiveString: r.descriptive
760
+ compactString: n.compact,
761
+ descriptiveString: n.descriptive
751
762
  });
752
763
  } else if (this.unknown) {
753
- const r = p.getString("hazards.unknown");
764
+ const n = f.getString("hazards.unknown");
754
765
  this.statements.push({
755
766
  id: "hazards.unknown",
756
- compactString: r.compact,
757
- descriptiveString: r.descriptive
767
+ compactString: n.compact,
768
+ descriptiveString: n.descriptive
758
769
  });
759
770
  } else if (this.noMetadata) {
760
- const r = p.getString("hazards.no-metadata");
771
+ const n = f.getString("hazards.no-metadata");
761
772
  this.statements.push({
762
773
  id: "hazards.no-metadata",
763
- compactString: r.compact,
764
- descriptiveString: r.descriptive
774
+ compactString: n.compact,
775
+ descriptiveString: n.descriptive
765
776
  });
766
777
  } else {
767
778
  if (t === "yes") {
768
- const r = p.getString("hazards.flashing");
779
+ const n = f.getString("hazards.flashing");
769
780
  this.statements.push({
770
781
  id: "hazards.flashing",
771
- compactString: r.compact,
772
- descriptiveString: r.descriptive
782
+ compactString: n.compact,
783
+ descriptiveString: n.descriptive
773
784
  });
774
785
  } else if (t === "unknown") {
775
- const r = p.getString("hazards.flashing-unknown");
786
+ const n = f.getString("hazards.flashing-unknown");
776
787
  this.statements.push({
777
788
  id: "hazards.flashing-unknown",
778
- compactString: r.compact,
779
- descriptiveString: r.descriptive
789
+ compactString: n.compact,
790
+ descriptiveString: n.descriptive
780
791
  });
781
792
  } else if (t === "no") {
782
- const r = p.getString("hazards.flashing-none");
793
+ const n = f.getString("hazards.flashing-none");
783
794
  this.statements.push({
784
795
  id: "hazards.flashing-none",
785
- compactString: r.compact,
786
- descriptiveString: r.descriptive
796
+ compactString: n.compact,
797
+ descriptiveString: n.descriptive
787
798
  });
788
799
  }
789
800
  if (e === "yes") {
790
- const r = p.getString("hazards.motion");
801
+ const n = f.getString("hazards.motion");
791
802
  this.statements.push({
792
803
  id: "hazards.motion",
793
- compactString: r.compact,
794
- descriptiveString: r.descriptive
804
+ compactString: n.compact,
805
+ descriptiveString: n.descriptive
795
806
  });
796
807
  } else if (e === "unknown") {
797
- const r = p.getString("hazards.motion-unknown");
808
+ const n = f.getString("hazards.motion-unknown");
798
809
  this.statements.push({
799
810
  id: "hazards.motion-unknown",
800
- compactString: r.compact,
801
- descriptiveString: r.descriptive
811
+ compactString: n.compact,
812
+ descriptiveString: n.descriptive
802
813
  });
803
814
  } else if (e === "no") {
804
- const r = p.getString("hazards.motion-none");
815
+ const n = f.getString("hazards.motion-none");
805
816
  this.statements.push({
806
817
  id: "hazards.motion-none",
807
- compactString: r.compact,
808
- descriptiveString: r.descriptive
818
+ compactString: n.compact,
819
+ descriptiveString: n.descriptive
809
820
  });
810
821
  }
811
822
  if (i === "yes") {
812
- const r = p.getString("hazards.sound");
823
+ const n = f.getString("hazards.sound");
813
824
  this.statements.push({
814
825
  id: "hazards.sound",
815
- compactString: r.compact,
816
- descriptiveString: r.descriptive
826
+ compactString: n.compact,
827
+ descriptiveString: n.descriptive
817
828
  });
818
829
  } else if (i === "unknown") {
819
- const r = p.getString("hazards.sound-unknown");
830
+ const n = f.getString("hazards.sound-unknown");
820
831
  this.statements.push({
821
832
  id: "hazards.sound-unknown",
822
- compactString: r.compact,
823
- descriptiveString: r.descriptive
833
+ compactString: n.compact,
834
+ descriptiveString: n.descriptive
824
835
  });
825
836
  } else if (i === "no") {
826
- const r = p.getString("hazards.sound-none");
837
+ const n = f.getString("hazards.sound-none");
827
838
  this.statements.push({
828
839
  id: "hazards.sound-none",
829
- compactString: r.compact,
830
- descriptiveString: r.descriptive
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.MOTION_SIMULATION.value) ? r = "yes" : e.some((o) => o.value === P.NO_MOTION_SIMULATION_HAZARD.value) ? r = "no" : e.some((o) => o.value === P.UNKNOWN_MOTION_SIMULATION_HAZARD.value) ? r = "unknown" : r = i;
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 Mt(n, r, a);
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 Bt {
858
+ class Gt {
848
859
  constructor(t = []) {
849
860
  this.id = "conformance.title", this.profiles = t, this.shouldDisplay = !0;
850
- const e = p.getString(this.id);
861
+ const e = f.getString(this.id);
851
862
  if (this.title = e.compact, this.statements = [], t.length === 0) {
852
- const i = p.getString("conformance.no");
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 = p.getString("conformance.aaa");
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 = p.getString("conformance.aa");
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 = p.getString("conformance.a");
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 = p.getString("conformance.unknown-standard");
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 Bt(e);
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 = p.getString(this.id);
909
+ const e = f.getString(this.id);
899
910
  if (this.title = e.compact, this.statements = [], t) {
900
- const i = p.getString("legal-considerations.exempt");
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 = p.getString("legal-considerations.no-metadata");
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 Gt {
931
+ class Ht {
921
932
  constructor(t) {
922
933
  this.id = "accessibility-summary.title", this.shouldDisplay = !0;
923
- const e = p.getString(this.id);
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 n = p.getString("accessibility-summary.no-metadata");
944
+ const r = f.getString("accessibility-summary.no-metadata");
934
945
  this.statements.push({
935
946
  id: "accessibility-summary.no-metadata",
936
- compactString: n.compact,
937
- descriptiveString: n.descriptive
947
+ compactString: r.compact,
948
+ descriptiveString: r.descriptive
938
949
  });
939
950
  }
940
951
  }
941
952
  static fromPublication(t) {
942
- return new Gt(t);
953
+ return new Ht(t);
943
954
  }
944
955
  }
945
- class rn {
956
+ class sr {
946
957
  constructor(t) {
947
- this.waysOfReading = Pt.fromPublication(t), this.navigation = kt.fromPublication(t), this.richContent = Dt.fromPublication(t), this.additionalInformation = Ut.fromPublication(t), this.hazards = Mt.fromPublication(t), this.conformance = Bt.fromPublication(t), this.legal = Wt.fromPublication(t), this.accessibilitySummary = Gt.fromPublication(t), this.fields = [
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 Ht {
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 Ht({
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 It = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.center = "center", s))(It || {});
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 Ht.deserialize(this.otherProperties.encrypted);
1031
+ return Ft.deserialize(this.otherProperties.encrypted);
1021
1032
  }
1022
1033
  });
1023
- class Ft {
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 Ft({
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 pi(s) {
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] : pi(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, n = t.mediaType.replace(/\s/g, "").split(";");
1098
- const r = n[0].split("/");
1099
- if (r.length === 2) {
1100
- if (e = r[0].toLowerCase().trim(), i = r[1].toLowerCase().trim(), e.length === 0 || i.length === 0)
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 < n.length; g++) {
1106
- const A = n[g].split("=");
1107
- if (A.length === 2) {
1108
- const R = A[0].toLocaleLowerCase(), d = R === "charset" ? A[1].toUpperCase() : A[1];
1109
- a[R] = d;
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, A) => g.localeCompare(A)), h.forEach((g) => o[g] = a[g]);
1114
- let f = "";
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 A = o[g];
1117
- f += `;${g}=${A}`;
1127
+ const v = o[g];
1128
+ m += `;${g}=${v}`;
1118
1129
  }
1119
- const m = `${e}/${i}${f}`, u = o.encoding;
1120
- this.string = m, this.type = e, this.subtype = i, this.parameters = o, this.encoding = u, this.name = t.name, this.fileExtension = t.fileExtension;
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(([r, a]) => `${r}=${a}`)
1158
- ), n = new Set(
1159
- Object.entries(e.parameters).map(([r, a]) => `${r}=${a}`)
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 r of Array.from(i.values()))
1162
- if (!n.has(r))
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 ut {
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((n) => n.trim())
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 = (n) => n.split(",").map((r) => {
1568
- const a = t[r];
1578
+ const e = (r) => r.split(",").map((n) => {
1579
+ const a = t[n];
1569
1580
  return a ? encodeURIComponent(a) : "";
1570
- }).join(","), i = (n) => "?" + n.split(",").map((r) => {
1571
- const a = r.split("=")[0], o = t[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, (...n) => n[1] ? i(n[2]) : e(n[2]));
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), n = K(t.position), r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set([
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) || r.set(o, h);
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: n !== void 0 && n > 0 ? n : void 0,
1603
- otherLocations: r.size === 0 ? void 0 : r
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 nt {
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 nt({
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: nt.deserialize(t.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 ut(this.href).parameters : /* @__PURE__ */ new Set();
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 ut(this.href).expand(t),
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 n of t)
1820
- if (i.mediaType.matches(n))
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 W = class W {
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" ? { [W.UNDEFINED_LANGUAGE]: t } : t;
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 W(t);
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 || W.UNDEFINED_LANGUAGE] || this.translations[W.UNDEFINED_LANGUAGE] || this.translations[W.LANGUAGE_EN] || (Object.values(this.translations).length === 0 ? "" : Object.values(this.translations)[0]);
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
- W.UNDEFINED_LANGUAGE = "undefined", W.LANGUAGE_EN = "en";
1906
- let M = W;
1907
- class ht {
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 ht({
1932
+ return typeof t == "string" ? new ut({
1922
1933
  name: M.deserialize(t)
1923
- }) : t.name ? new ht({
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) => ht.deserialize(i)).filter((i) => i !== void 0)
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, n]) => {
1978
- const r = N.deserialize(n);
1979
- r && r.items.length > 0 && e.set(i, r);
1980
- }), new _({ items: e });
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 an(s) {
1994
- return s === "rtl" ? It.right : It.left;
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 fi = /* @__PURE__ */ ((s) => (s.all = "all", s.none = "none", s))(fi || {});
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 _()), this.belongsTo.items.set("collection", this.belongsToCollections)), this.belongsToSeries && this.belongsToSeries.items.length > 0 && (this.belongsTo || (this.belongsTo = new _()), 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;
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"], n = F(t.conformsTo), r = t.identifier, a = Z.deserialize(t.altIdentifier), o = M.deserialize(t.subtitle), h = M.deserialize(t.sortAs), f = N.deserialize(t.artist), m = N.deserialize(t.author), u = N.deserialize(t.colorist), g = N.deserialize(t.contributor), A = N.deserialize(t.editor), R = N.deserialize(t.illustrator), d = N.deserialize(t.inker), x = N.deserialize(t.letterer), B = N.deserialize(t.narrator), Ue = N.deserialize(t.penciler), Me = N.deserialize(t.translator), Be = F(t.language), We = t.description, Ge = N.deserialize(t.publisher), He = N.deserialize(t.imprint), Fe = ct(t.published), Ve = ct(t.modified), Ye = Vt.deserialize(t.subject), $e = _.deserialize(t.belongsTo), qe = V.deserialize(t.accessibility), Xe = t.layout, Ke = t.readingProgression, Ze = L(t.duration), Je = L(t.numberOfPages), _e = Yt.deserialize(t.tdm);
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((Qe) => delete at[Qe]), Object.keys(at).length === 0 && (at = void 0), new tt({
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: n,
2090
- identifier: r,
2100
+ conformsTo: r,
2101
+ identifier: n,
2091
2102
  altIdentifier: a,
2092
2103
  subtitle: o,
2093
2104
  sortAs: h,
2094
- artists: f,
2095
- authors: m,
2105
+ artists: m,
2106
+ authors: p,
2096
2107
  colorists: u,
2097
2108
  contributors: g,
2098
- editors: A,
2099
- illustrators: R,
2109
+ editors: v,
2110
+ illustrators: C,
2100
2111
  inkers: d,
2101
- letterers: x,
2112
+ letterers: I,
2102
2113
  narrators: B,
2103
- pencilers: Ue,
2104
- translators: Me,
2105
- languages: Be,
2114
+ pencilers: Me,
2115
+ translators: Be,
2116
+ languages: Ge,
2106
2117
  description: We,
2107
- publishers: Ge,
2108
- imprints: He,
2109
- published: Fe,
2118
+ publishers: He,
2119
+ imprints: Fe,
2120
+ published: _e,
2110
2121
  modified: Ve,
2111
2122
  subjects: Ye,
2112
2123
  belongsTo: $e,
2113
- layout: Xe,
2114
- readingProgression: Ke,
2115
- duration: Ze,
2116
- numberOfPages: Je,
2117
- accessibility: qe,
2118
- tdm: _e,
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 || q.reflowable;
2161
+ return this.layout || $.reflowable;
2151
2162
  case J.DIVINA:
2152
- return this.layout === q.reflowable ? q.fixed : this.layout || q.fixed;
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 pt = tt;
2219
- pt.prototype.getMediaOverlay = function() {
2229
+ let ft = tt;
2230
+ ft.prototype.getMediaOverlay = function() {
2220
2231
  const s = this.otherMetadata?.mediaOverlay;
2221
2232
  if (s)
2222
- return Ft.deserialize(s);
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 ft {
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 ft({ plain: t });
2264
+ return new pt({ plain: t });
2254
2265
  if (t.plain || t.ssml || t.language)
2255
- return new ft({
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: ft.deserialize(t.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 n = this.parseTimer(e);
2353
- return i.start = n[0], i.end = n[1], i;
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 mi(s, t) {
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 gi(s, t) {
2375
+ function di(s, t) {
2365
2376
  return s.slice(s.length - t.length) === t;
2366
2377
  }
2367
- const wt = {
2368
- endsWith: gi,
2369
- endsWithChar: mi
2370
- }, bi = [
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 he(s) {
2463
- return /^[A-Z][a-z].*/.test(s) || Nt(s);
2473
+ function de(s) {
2474
+ return /^[A-Z][a-z].*/.test(s) || Lt(s);
2464
2475
  }
2465
- function vi(s) {
2466
- return he(s) || /``|"|'/.test(s.substring(0, 2));
2476
+ function pi(s) {
2477
+ return de(s) || /``|"|'/.test(s.substring(0, 2));
2467
2478
  }
2468
- function Ai(s) {
2469
- return ~bi.indexOf(s.replace(/\W+/g, ""));
2479
+ function mi(s) {
2480
+ return ~fi.indexOf(s.replace(/\W+/g, ""));
2470
2481
  }
2471
- function wi(s, t) {
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 ie(s) {
2490
+ function re(s) {
2480
2491
  var t = s.replace(/[\(\)\[\]\{\}]/g, "").match(/(.\.)*/);
2481
2492
  return t && t[0].length > 0;
2482
2493
  }
2483
- function se(s) {
2484
- return s.length <= 3 ? !0 : he(s);
2494
+ function ne(s) {
2495
+ return s.length <= 3 ? !0 : de(s);
2485
2496
  }
2486
- function Nt(s, t) {
2497
+ function Lt(s, t) {
2487
2498
  return t && (s = s.slice(t - 1, t + 2)), !isNaN(Number(s));
2488
2499
  }
2489
- function yi(s) {
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 Si(s) {
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 Ei(s) {
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 Ti(s) {
2515
+ function yi(s) {
2505
2516
  return s === "." || s === "!" || s === "?";
2506
2517
  }
2507
- function xi(s, t) {
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, n, r, a, o, h) {
2517
- var f, m = [i, null], u = i, g = h.slice(o + 1).find(function(R) {
2518
- return !e.test(R.value);
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 || Ti(i) || wt.endsWithChar(i, "?!"))
2522
- return m;
2523
- if (wt.endsWithChar(i, ".")) {
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]/) || Ai(i))
2536
+ if (i.length === 2 && isNaN(i.charAt(0)) && i.match(/[a-zA-Z]/) || mi(i))
2526
2537
  return u;
2527
- if (vi(g.value)) {
2528
- if (wi(i, g.value) || Nt(g.value) && se(i))
2538
+ if (pi(g.value)) {
2539
+ if (gi(i, g.value) || Lt(g.value) && ne(i))
2529
2540
  return u;
2530
- } else if (wt.endsWith(i, "..") || ie(i) || se(i))
2541
+ } else if (yt.endsWith(i, "..") || re(i) || ne(i))
2531
2542
  return u;
2532
2543
  }
2533
- return m;
2544
+ return p;
2534
2545
  }
2535
- let A;
2536
- return (A = i.indexOf(".")) > -1 && (Nt(i, A) || ie(i) || Si(i) || yi(i)) ? u : (f = Ei(i)) ? [
2537
- f[0] + f[1],
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
- f[2]
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 Ii = (s, ...t) => (...e) => s(...t, ...e);
2549
- function Ni(s) {
2559
+ const Si = (s, ...t) => (...e) => s(...t, ...e);
2560
+ function Ei(s) {
2550
2561
  return {
2551
- sentences: Ii(xi, s)
2562
+ sentences: Si(wi, s)
2552
2563
  };
2553
2564
  }
2554
- function Li(s, t) {
2565
+ function Ti(s, t) {
2555
2566
  return t ? s.reduce(function(e, i) {
2556
- var n = [
2567
+ var r = [
2557
2568
  i.index,
2558
2569
  i.offset,
2559
2570
  i.value
2560
2571
  ].join("-");
2561
- return [e, n].join(":");
2572
+ return [e, r].join(":");
2562
2573
  }, t) : null;
2563
2574
  }
2564
- function Oi(s) {
2565
- const { index: t, offset: e, value: i, ...n } = s;
2566
- return n;
2575
+ function Ii(s) {
2576
+ const { index: t, offset: e, value: i, ...r } = s;
2577
+ return r;
2567
2578
  }
2568
- function zi(s, t) {
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 Ci(s, t) {
2589
+ function Ni(s, t) {
2579
2590
  if (s.length == 0) return null;
2580
- var e = "", i = 0, n = s[0]?.index;
2581
- return s.forEach(function(r, a) {
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 ? r.index + 1 - (o.index + o.offset) : 0;
2585
- e = e + new Array(h).join(t) + r.value;
2586
- var f = r.index - n + r.offset;
2587
- f > i && (i = f);
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: n,
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: Li,
2597
- normalize: zi,
2598
- properties: Oi,
2599
- merge: Ci
2607
+ tokensId: Ti,
2608
+ normalize: xi,
2609
+ properties: Ii,
2610
+ merge: Ni
2600
2611
  };
2601
- var Ri = ' \r\n  !"#$%&()*+,-.\\/:;<=>?@[\\]^_`{|}~', Pi = new RegExp(
2602
- "([^" + Ri + "]+)"
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(n, r) {
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 (n === void 0) return [];
2620
- if (typeof n == "string" ? n = [{
2621
- value: n,
2630
+ if (r === void 0) return [];
2631
+ if (typeof r == "string" ? r = [{
2632
+ value: r,
2622
2633
  index: 0,
2623
- offset: n.length
2624
- }] : Array.isArray(n) || (n = [n]), o = Q.tokensId(n, e.cache()), o && (h = i.opts.cacheGet(o), h))
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 f = n.map(function(m, u) {
2627
- var g = n[u + 1], A = t(
2628
- m.value,
2629
- Object.assign({}, m),
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
- n
2644
+ r
2634
2645
  ) || [];
2635
- if (A = Q.normalize(m, A), e.preserveProperties) {
2636
- var R = Q.properties(m);
2637
- A = A.map(function(d) {
2638
- return Object.assign({}, d, R);
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 = m, A;
2652
+ return a = p, v;
2642
2653
  }).filter(Boolean).flat();
2643
- return o && i.opts.cacheSet(o, f), f;
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, n) {
2648
- for (var r = i, a = [], o, h = 0; o = t.exec(i); ) {
2649
- var f = o.index, m = h + f, u = o[0] || "", g = u.length;
2650
- if (e.split && h < m) {
2651
- var A = r.slice(h, m);
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: A,
2664
+ value: v,
2654
2665
  index: h,
2655
- offset: A.length
2666
+ offset: v.length
2656
2667
  });
2657
2668
  }
2658
2669
  a.push({
2659
2670
  value: u,
2660
- index: m,
2671
+ index: p,
2661
2672
  offset: g,
2662
2673
  match: o
2663
- }), i = i.slice(f + g), h = m + g;
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(n) {
2679
- var r = [], a = [];
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
- r.push(h), a = [];
2694
+ n.push(h), a = [];
2684
2695
  }
2685
2696
  }
2686
- return i.split(function(h, f) {
2687
- var m = t.apply(null, arguments);
2688
- m = Q.normalize(f, m), m.forEach(function(u) {
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
- })(n), o(), r;
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 n = typeof t == "function" ? t.apply(null, arguments) : t;
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
- }, n);
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: n, ...r } = i;
2719
- return r;
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, n) => (...r) => n(i(...r)));
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) => (...n) => i(e(...n)));
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(Pi);
2754
+ return this.re(Oi);
2744
2755
  };
2745
2756
  z.prototype.characters = function() {
2746
2757
  return this.re(/[^\s]/);
2747
2758
  };
2748
- var ki = /* @__PURE__ */ ((s) => (s.Word = "word", s.Sentence = "sentence", s.Paragraph = "paragraph", s))(ki || {});
2749
- const Di = (s, t) => "Segmenter" in Intl ? new Ui(s, t) : new Mi(s, t);
2750
- class Ui {
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 n of e) {
2761
- if (this.unit === "word" && n.isWordLike === !1) continue;
2762
- const r = de(n.segment);
2763
- r !== null && i.push([n.index, n.index + r.length]);
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 Mi {
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 = Ni(this.tokenizer).sentences()(t) : e = this.tokenizer.sections()(t);
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((n) => {
2788
- if (n.value.length === 0) return;
2789
- const r = de(n.value);
2790
- r !== null && i.push([n.index, n.index + r.length]);
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 Bi = new RegExp("[\\p{L}\\p{N}]+", "u"), de = (s) => {
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(Bi) === null ? null : t;
2807
+ return t.length === 0 || t.match(ki) === null ? null : t;
2797
2808
  };
2798
- class Y {
2809
+ class V {
2799
2810
  constructor(t) {
2800
- this.fetcher = new je(), 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;
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 n = i.href;
2863
+ let r = i.href;
2853
2864
  if (i.templated) {
2854
- const a = new ut(n), o = {};
2855
- a.parameters.has("ref") && (o.ref = t.href), n = new ut(n).expand(o);
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 r = await this.get(new U({
2858
- href: n
2868
+ const n = await this.get(new U({
2869
+ href: r
2859
2870
  })).readAsJSON();
2860
- return $t.deserialize(r);
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
- Y.prototype.getPageList = function() {
2880
+ V.prototype.getPageList = function() {
2870
2881
  return this.linksWithRole("pageList");
2871
2882
  };
2872
- Y.prototype.getLandmarks = function() {
2883
+ V.prototype.getLandmarks = function() {
2873
2884
  return this.linksWithRole("landmarks");
2874
2885
  };
2875
- Y.prototype.getListOfAudioClips = function() {
2886
+ V.prototype.getListOfAudioClips = function() {
2876
2887
  return this.linksWithRole("loa");
2877
2888
  };
2878
- Y.prototype.getListOfIllustrations = function() {
2889
+ V.prototype.getListOfIllustrations = function() {
2879
2890
  return this.linksWithRole("loi");
2880
2891
  };
2881
- Y.prototype.getListOfTables = function() {
2892
+ V.prototype.getListOfTables = function() {
2882
2893
  return this.linksWithRole("lot");
2883
2894
  };
2884
- Y.prototype.getListOfVideoClips = function() {
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 qt {
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 qt({
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 qt.deserialize(this.otherLocations?.get("domRange"));
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 Xt {
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 Xt({ currency: e, value: i });
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 Kt {
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 Kt({
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 Zt {
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 Zt({
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 Wi = /* @__PURE__ */ ((s) => (s.available = "available", s.reserved = "reserved", s.ready = "ready", s))(Wi || {});
3085
- class Jt {
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 Jt({
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 Xt.deserialize(this.otherProperties.price);
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 Kt.deserialize(this.otherProperties.holds);
3132
+ return Zt.deserialize(this.otherProperties.holds);
3122
3133
  };
3123
3134
  D.prototype.getCopies = function() {
3124
- return Zt.deserialize(this.otherProperties.copies);
3135
+ return Jt.deserialize(this.otherProperties.copies);
3125
3136
  };
3126
3137
  D.prototype.getAvailability = function() {
3127
- return Jt.deserialize(this.otherProperties.availability);
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
- Y.prototype.getImages = function() {
3143
+ V.prototype.getImages = function() {
3133
3144
  return this.linksWithRole("images");
3134
3145
  };
3135
- class on {
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 ne {
3165
+ class ae {
3155
3166
  constructor(t, e) {
3156
3167
  this.key = t, this.value = e;
3157
3168
  }
3158
3169
  }
3159
- var Lt = /* @__PURE__ */ ((s) => (s.ACCESSIBILITY_LABEL = "accessibilityLabel", s.LANGUAGE = "language", s))(Lt || {});
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 fe extends pe {
3200
+ class me extends pe {
3190
3201
  constructor(t, e = []) {
3191
3202
  super(e), this.locator = t;
3192
3203
  }
3193
3204
  }
3194
- class At extends fe {
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 Gi extends At {
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 Hi extends At {
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 Fi extends At {
3213
- constructor(t, e, i, n = []) {
3214
- super(t, n), this.embeddedLink = e, this.caption = i;
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 me extends pe {
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 Ot extends At {
3226
- constructor(t, e, i, n = []) {
3227
- super(t, n), this.role = e, this.segments = i;
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 Vi {
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 Yi = {
3252
+ const Wi = {
3242
3253
  role: "body"
3243
- }, $i = {
3254
+ }, Hi = {
3244
3255
  role: "footnote"
3245
3256
  };
3246
- class qi {
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 cn {
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, n = (r) => Di(r, e)) {
3260
- this.defaultLanguage = t, this.contextSnippetLength = i, this.textTokenizerFactory = n;
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 Ot ? [
3264
- new Ot(
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 me(
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), n = t.substring(e[0] - this.contextSnippetLength, e[0]);
3286
- return new nt({
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: n.length > 0 ? n : void 0,
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 _t {
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 Xi = class {
3323
+ let _i = class {
3313
3324
  constructor(t, e) {
3314
3325
  this.element = t, this.direction = e;
3315
3326
  }
3316
3327
  };
3317
- class un extends _t {
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 n = this.nextIteratorIn(t, e.index);
3347
- return n ? (this._currentIterator = n, this.nextIn(t)) : null;
3357
+ const r = this.nextIteratorIn(t, e.index);
3358
+ return r ? (this._currentIterator = r, this.nextIn(t)) : null;
3348
3359
  }
3349
- return new Xi(i, t);
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 n = t === 1 ? 0 : 1;
3371
- return this.loadIteratorAt(i, n) ?? this.nextIteratorIn(t, 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], n = typeof e == "number" ? this.publication.manifest.locatorFromLink(i)?.copyWithLocations({
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 (!n) return null;
3382
- const r = this.publication.get(i);
3392
+ if (!r) return null;
3393
+ const n = this.publication.get(i);
3383
3394
  for (const a of this.resourceContentIteratorFactories)
3384
- a(r, n);
3395
+ a(n, r);
3385
3396
  return null;
3386
3397
  }
3387
3398
  }
3388
- class yt extends fe {
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 re {
3407
+ class oe {
3397
3408
  constructor(t, e) {
3398
3409
  this.element = t, this.direction = e;
3399
3410
  }
3400
3411
  }
3401
- class hn extends _t {
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
- (n) => n?.str !== " " && n?.str !== ""
3416
+ (r) => r?.str !== " " && r?.str !== ""
3406
3417
  );
3407
- if (this.pageContentFiltered = i.map((n) => new yt(n.locator, {
3408
- index: i.indexOf(n),
3409
- text: n.str,
3410
- readingDirection: n.dir
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 n = this.currentElementIndex;
3413
- (n || n === 0) && (this.currentElement = new re(
3414
- this.pageContentFiltered[n],
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 yt(new k({ href: "", type: "" }), { index: -1, text: "" });
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 yt(new k({ href: "", type: "" }), { index: -1, text: "" });
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 re(i, t) : null;
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 Ki = [
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 ae(s) {
3542
- return Ki.includes(s.nodeName.toUpperCase());
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]", Zi = new RegExp(`^${it}+$`, "g"), Ji = new RegExp(`^${it}+|${it}+$/g`, "g"), ge = new RegExp(`^${it}+`, "g"), be = new RegExp(`${it}+$`, "g"), ot = (s) => (
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 ? Zi.test(s) : !0
3556
- ), ve = (s) => s.replace(Ji, ""), _i = (s) => s.replace(ge, ""), Qi = (s) => s.replace(be, ""), oe = (s, t = "") => new nt({
3557
- before: t + (ge.exec(s)?.[0] ?? ""),
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: be.exec(s)?.[0] ?? ""
3570
+ after: Ae.exec(s)?.[0] ?? ""
3560
3571
  });
3561
- function ji(s) {
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 ts(s, t) {
3580
+ function Ji(s, t) {
3570
3581
  const e = s.length > 0 && s[s.length - 1] === " ";
3571
- let i = !1, n = !1;
3572
- for (let r = 0; r < t.length; r++)
3573
- if (ot(t[r])) {
3574
- if (e && !n || i)
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(r);
3579
- a !== 8203 && a !== 173 && (s += t[r], i = !1, n = !0);
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 Qt(s) {
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 es(s, t) {
3609
+ function qi(s, t) {
3599
3610
  return Object.values(s).includes(t);
3600
3611
  }
3601
- const is = "CssSelectorGenerator";
3612
+ const Qi = "CssSelectorGenerator";
3602
3613
  function bt(s = "unknown problem", ...t) {
3603
- console.warn(`${is}: ${s}`, ...t);
3614
+ console.warn(`${Qi}: ${s}`, ...t);
3604
3615
  }
3605
- const ss = {
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 ns(s) {
3623
- return Array.isArray(s) ? s.filter((t) => es(E, t)) : [];
3634
+ function ts(s) {
3635
+ return Array.isArray(s) ? s.filter((t) => qi(E, t)) : [];
3624
3636
  }
3625
- function Ae(s) {
3637
+ function we(s) {
3626
3638
  return s instanceof RegExp;
3627
3639
  }
3628
- function rs(s) {
3629
- return ["string", "function"].includes(typeof s) || Ae(s);
3640
+ function es(s) {
3641
+ return ["string", "function"].includes(typeof s) || we(s);
3630
3642
  }
3631
- function ce(s) {
3632
- return Array.isArray(s) ? s.filter(rs) : [];
3643
+ function he(s) {
3644
+ return Array.isArray(s) ? s.filter(es) : [];
3633
3645
  }
3634
- function as(s) {
3646
+ function is(s) {
3635
3647
  return s instanceof Node;
3636
3648
  }
3637
- function le(s) {
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 as(s) && t.includes(s.nodeType);
3656
+ return is(s) && t.includes(s.nodeType);
3645
3657
  }
3646
- function we(s, t) {
3647
- if (le(s))
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 le(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);
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 ue(s) {
3664
+ function Et(s) {
3653
3665
  return typeof s == "number" ? s : Number.POSITIVE_INFINITY;
3654
3666
  }
3655
- function os(s, t = {}) {
3656
- const e = Object.assign(Object.assign({}, ss), t);
3667
+ function ss(s, t = {}) {
3668
+ const e = Object.assign(Object.assign({}, ji), t);
3657
3669
  return {
3658
- selectors: ns(e.selectors),
3659
- whitelist: ce(e.whitelist),
3660
- blacklist: ce(e.blacklist),
3661
- root: we(e.root, s),
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: ue(e.maxCombinations),
3666
- maxCandidates: ue(e.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 rt(s = []) {
3683
+ function nt(s = []) {
3670
3684
  const [t = [], ...e] = s;
3671
- return e.length === 0 ? t : e.reduce((i, n) => i.filter((r) => n.includes(r)), t);
3685
+ return e.length === 0 ? t : e.reduce((i, r) => i.filter((n) => r.includes(n)), t);
3672
3686
  }
3673
- function ye(s) {
3687
+ function rs(s) {
3674
3688
  return [].concat(...s);
3675
3689
  }
3676
- function cs(s) {
3690
+ function ns(s) {
3677
3691
  return s.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
3678
3692
  }
3679
- function zt(s) {
3693
+ function Rt(s) {
3680
3694
  const t = s.map((e) => {
3681
- if (Ae(e))
3695
+ if (we(e))
3682
3696
  return (i) => e.test(i);
3683
3697
  if (typeof e == "function")
3684
3698
  return (i) => {
3685
- const n = e(i);
3686
- return typeof n != "boolean" ? (bt("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
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("^" + cs(e) + "$");
3690
- return (n) => i.test(n);
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(we(e, s[0]).querySelectorAll(t));
3698
- return i.length === s.length && s.every((n) => i.includes(n));
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 Se(s, t) {
3714
+ function Ee(s, t) {
3701
3715
  t = t ?? te(s);
3702
3716
  const e = [];
3703
3717
  let i = s;
3704
- for (; Qt(i) && i !== t; )
3718
+ for (; ye(i) && i !== t; )
3705
3719
  e.push(i), i = i.parentElement;
3706
3720
  return e;
3707
3721
  }
3708
- function ls(s, t) {
3709
- return rt(s.map((e) => Se(e, t)));
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 Ee = ", ", us = new RegExp([
3728
+ const Te = ", ", os = new RegExp([
3715
3729
  "^$",
3716
3730
  // empty or not set
3717
3731
  "\\s"
3718
3732
  // contains whitespace
3719
- ].join("|")), hs = new RegExp([
3733
+ ].join("|")), cs = new RegExp([
3720
3734
  "^$"
3721
3735
  // empty or not set
3722
- ].join("|")), Te = [
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
- ], ds = zt([
3743
+ ], ls = Rt([
3730
3744
  "class",
3731
3745
  "id",
3732
3746
  // Angular attributes
3733
3747
  "ng-*"
3734
3748
  ]);
3735
- function ps({ name: s }) {
3749
+ function hs({ name: s }) {
3736
3750
  return `[${s}]`;
3737
3751
  }
3738
- function fs({ name: s, value: t }) {
3752
+ function us({ name: s, value: t }) {
3739
3753
  return `[${s}='${t}']`;
3740
3754
  }
3741
- function ms({ nodeName: s, nodeValue: t }, e) {
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 : !ds(s);
3757
+ return ["input", "option"].includes(i) && s === "value" || s === "src" && t?.startsWith("data:") ? !1 : !ls(s);
3744
3758
  }
3745
- function gs({ nodeName: s, nodeValue: t }) {
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) => ms(e, s)).map(gs);
3766
+ const t = Array.from(s.attributes).filter((e) => ds(e, s)).map(fs);
3753
3767
  return [
3754
- ...t.map(ps),
3755
- ...t.map(fs)
3768
+ ...t.map(hs),
3769
+ ...t.map(us)
3756
3770
  ];
3757
3771
  }
3758
- function bs(s) {
3772
+ function ps(s) {
3759
3773
  const t = s.map(xe);
3760
- return rt(t);
3774
+ return nt(t);
3761
3775
  }
3762
- function Ie(s) {
3776
+ function Ne(s) {
3763
3777
  var t;
3764
- return ((t = s.getAttribute("class")) !== null && t !== void 0 ? t : "").trim().split(/\s+/).filter((e) => !hs.test(e)).map((e) => `.${st(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 vs(s) {
3767
- const t = s.map(Ie);
3768
- return rt(t);
3780
+ function ms(s) {
3781
+ const t = s.map(Ne);
3782
+ return nt(t);
3769
3783
  }
3770
- function Ne(s) {
3784
+ function Le(s) {
3771
3785
  var t;
3772
- const e = (t = s.getAttribute("id")) !== null && t !== void 0 ? t : "", i = `#${st(e)}`, n = s.getRootNode({ composed: !1 });
3773
- return !us.test(e) && jt([s], i, n) ? [i] : [];
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 As(s) {
3776
- return s.length === 0 || s.length > 1 ? [] : Ne(s[0]);
3789
+ function gs(s) {
3790
+ return s.length === 0 || s.length > 1 ? [] : Le(s[0]);
3777
3791
  }
3778
- function Le(s) {
3779
- const t = s.parentNode;
3780
- if (t) {
3781
- const i = Array.from(t.childNodes).filter(Qt).indexOf(s);
3782
- if (i > -1)
3783
- return [
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 ws(s) {
3790
- return rt(s.map(Le));
3802
+ function bs(s) {
3803
+ return nt(s.map(Oe));
3791
3804
  }
3792
- function Oe(s) {
3805
+ function ze(s) {
3793
3806
  return [
3794
3807
  st(s.tagName.toLowerCase())
3795
3808
  ];
3796
3809
  }
3797
- function ze(s) {
3810
+ function Re(s) {
3798
3811
  const t = [
3799
- ...new Set(ye(s.map(Oe)))
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 = ze([s])[0], e = s.parentElement;
3817
+ const t = Re([s])[0], e = s.parentElement;
3805
3818
  if (e) {
3806
- const n = Array.from(e.children).filter((r) => r.tagName.toLowerCase() === t).indexOf(s);
3807
- if (n > -1)
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(n + 1)})`
3822
+ `${t}:nth-of-type(${String(r + 1)})`
3810
3823
  ];
3811
3824
  }
3812
3825
  return [];
3813
3826
  }
3814
- function ys(s) {
3815
- return rt(s.map(Ce));
3827
+ function As(s) {
3828
+ return nt(s.map(Ce));
3816
3829
  }
3817
- function* Ss(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
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((r) => s[r]), i = Es(i, s.length - 1);
3833
+ e += 1, yield i.map((n) => s[n]), i = ys(i, s.length - 1);
3821
3834
  }
3822
- function Re(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
3823
- return Array.from(Ss(s, { maxResults: t }));
3835
+ function vs(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
3836
+ return Array.from(Pe(s, { maxResults: t }));
3824
3837
  }
3825
- function Es(s = [], t = 0) {
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 n = e - 1; n >= 0; n--)
3832
- if (i[n] > t) {
3833
- if (n === 0)
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[n - 1]++, i[n] = i[n - 1] + 1;
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 Ts(s = {}) {
3843
- let t = [];
3844
- return Object.entries(s).forEach(([e, i]) => {
3845
- t = i.flatMap((n) => t.length === 0 ? [{ [e]: n }] : t.map((r) => Object.assign(Object.assign({}, r), { [e]: n })));
3846
- }), t;
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 xs = "3a".toUpperCase(), Is = /[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;
3879
+ const Ss = "3a".toUpperCase(), Es = /[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;
3849
3880
  function st(s = "") {
3850
- return CSS ? CSS.escape(s) : Ns(s);
3851
- }
3852
- function Ns(s = "") {
3853
- return s.split("").map((t) => t === ":" ? `\\${xs} ` : Is.test(t) ? `\\${t}` : escape(t).replace(/%/g, "\\")).join("");
3854
- }
3855
- const Ls = {
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: As,
3858
- class: vs,
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: Le,
3898
+ nthchild: Oe,
3868
3899
  nthoftype: Ce
3869
3900
  };
3870
- function zs(s, t) {
3871
- return Os[t](s);
3901
+ function Ns(s, t) {
3902
+ return xs[t](s);
3872
3903
  }
3873
- function Cs(s, t) {
3874
- const e = Ls[t];
3904
+ function Ls(s, t) {
3905
+ const e = Is[t];
3875
3906
  return e(s);
3876
3907
  }
3877
- function Rs(s = [], t, e) {
3908
+ function Os(s = [], t, e) {
3878
3909
  return s.filter((i) => e(i) || !t(i));
3879
3910
  }
3880
- function Ps(s = [], t) {
3911
+ function zs(s = [], t) {
3881
3912
  return s.sort((e, i) => {
3882
- const n = t(e), r = t(i);
3883
- return n && !r ? -1 : !n && r ? 1 : 0;
3913
+ const r = t(e), n = t(i);
3914
+ return r && !n ? -1 : !r && n ? 1 : 0;
3884
3915
  });
3885
3916
  }
3886
- function ks(s, t, e) {
3887
- const i = Ds(s, e), n = Ws(i, e), r = ye(n);
3888
- return [...new Set(r)];
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 Ds(s, t) {
3891
- const { blacklist: e, whitelist: i, combineWithinSelector: n, maxCombinations: r } = t, a = zt(e), o = zt(i), h = (f, m) => {
3892
- const u = Cs(s, m), g = Rs(u, a, o), A = Ps(g, o);
3893
- return f[m] = n ? Re(A, { maxResults: r }) : A.map((R) => [R]), f;
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 Us(t).reduce(h, {});
3927
+ return Ps(t).reduce(h, {});
3896
3928
  }
3897
- function Us(s) {
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 Ms(s) {
3933
+ function ks(s) {
3902
3934
  return s.includes(E.tag) || s.includes(E.nthoftype) ? [...s] : [...s, E.tag];
3903
3935
  }
3904
- function Bs(s) {
3905
- const { selectors: t, combineBetweenSelectors: e, includeTag: i, maxCandidates: n } = s, r = e ? Re(t, { maxResults: n }) : t.map((a) => [a]);
3906
- return i ? r.map(Ms) : r;
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 Ws(s, t) {
3909
- return Bs(t).map((e) => Gs(e, s)).filter((e) => e.length > 0);
3940
+ function* Us(s, t) {
3941
+ for (const e of Ds(t))
3942
+ yield* Ms(e, s);
3910
3943
  }
3911
- function Gs(s, t) {
3944
+ function* Ms(s, t) {
3912
3945
  const e = {};
3913
- return s.forEach((n) => {
3914
- const r = t[n];
3915
- r && r.length > 0 && (e[n] = r);
3916
- }), Ts(e).map(Fs);
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 Hs(s, t) {
3953
+ function Bs(s, t) {
3919
3954
  return t[s] ? t[s].join("") : "";
3920
3955
  }
3921
- function Fs(s = {}) {
3922
- const t = [...Te];
3923
- return s[E.tag] && s[E.nthoftype] && t.splice(t.indexOf(E.tag), 1), t.map((e) => Hs(e, s)).join("");
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 Vs(s, t) {
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 Ys(s, t) {
3932
- return t === "" ? s : Vs(s, t);
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 $s(s, t, e = "", i) {
3935
- const n = ks(s, t, i), r = Ys(n, e);
3936
- for (const a of r)
3937
- if (jt(s, a, t))
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 qs(s, t, e = "", i) {
3978
+ function* _s(s, t, e = "", i) {
3942
3979
  if (s.length === 0)
3943
3980
  return null;
3944
- const n = [
3981
+ const r = [
3945
3982
  s.length > 1 ? s : [],
3946
- ...ls(s, t).map((r) => [r])
3983
+ ...as(s, t).map((n) => [n])
3947
3984
  ];
3948
- for (const r of n) {
3949
- const a = $s(r, t, e, i);
3950
- if (a)
3951
- return {
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 Xs(s) {
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(Qt);
4010
+ const t = (Array.isArray(s) ? s : [s]).filter(ye);
3961
4011
  return [...new Set(t)];
3962
4012
  }
3963
- function Ks(s) {
4013
+ function $s(s) {
3964
4014
  return {
3965
4015
  value: s,
3966
4016
  include: !1
3967
4017
  };
3968
4018
  }
3969
- function Zs(s, t, e = gt.NONE) {
4019
+ function Xs(s, t, e = gt.NONE) {
3970
4020
  const i = {};
3971
- return t.forEach((n) => {
3972
- Reflect.set(i, n, zs(s, n).map(Ks));
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 Js({ selectors: s, operator: t }) {
3980
- let e = [...Te];
3981
- s[E.tag] && s[E.nthoftype] && (e = e.filter((n) => n !== E.tag));
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((n) => {
3984
- var r;
3985
- ((r = s[n]) !== null && r !== void 0 ? r : []).forEach(({ value: o, include: h }) => {
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 _s(s) {
3991
- return [":root", ...Se(s).reverse().map((i) => {
3992
- const n = Zs(i, [E.nthchild], gt.CHILD);
3993
- return n.selectors.nthchild.forEach((r) => {
3994
- r.include = !0;
3995
- }), n;
3996
- }).map(Js)].join("");
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 Qs(s) {
3999
- return s.map(_s).join(Ee);
4053
+ function Js(s, t) {
4054
+ return s.map((e) => Zs(e, t)).join(Te);
4000
4055
  }
4001
- function Pe(s, t = {}) {
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 = Xs(s), n = os(i[0], t), r = (e = n.root) !== null && e !== void 0 ? e : te(i[0]);
4004
- let a = "", o = r;
4005
- function h() {
4006
- return qs(i, o, a, n);
4007
- }
4008
- let f = h();
4009
- for (; f; ) {
4010
- const { foundElements: m, selector: u } = f;
4011
- if (jt(i, u, r))
4012
- return u;
4013
- o = m[0], a = u, f = h();
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 dn extends _t {
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 tn(
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
- ), js(this.parser, e.body), this.parser.result();
4114
+ ), Qs(this.parser, e.body), this.parser.result();
4058
4115
  }
4059
4116
  }
4060
- function js(s, t) {
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 tn {
4074
- constructor(t, e, i, n) {
4075
- this.doc = t, this.baseLocator = e, this.startElement = i, this.beforeMaxLength = n, 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();
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 Fi(
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
- }), n = t.recipe;
4115
- return t.type === 3 ? new Hi(
4171
+ }), r = t.recipe;
4172
+ return t.type === 3 ? new Mi(
4116
4173
  i,
4117
- n.link
4118
- ) : new Gi(
4174
+ r.link
4175
+ ) : new Ui(
4119
4176
  i,
4120
- n.link
4177
+ r.link
4121
4178
  );
4122
4179
  } else if (t.type === 0) {
4123
- const i = t.recipe, n = i.segments.map((r) => {
4124
- const a = r.cssSelectorNode ? this.cssSelector(r.cssSelectorNode) : null;
4125
- return new me(
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: oe(r.text, this.wholeRawTextAcc?.substring(r.beforeRange[0], r.beforeRange[1])),
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
- r.text,
4138
- r.attributes
4194
+ n.text,
4195
+ n.attributes
4139
4196
  );
4140
4197
  });
4141
- return new Ot(
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: oe(i.text, n.length && n[0].locator.text?.before || ""),
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
- n
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 n = /* @__PURE__ */ new Map();
4163
- let r = e;
4164
- for (; r && r !== this.doc.body; ) {
4165
- for (let o = 0; o < r.attributes.length; o++) {
4166
- const h = r.attributes[o];
4167
- h.prefix && (n.has(r) ? n.set(r, n.get(r).concat([h])) : n.set(r, [h]), r.attributes.removeNamedItem(h.name));
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
- r = r.parentElement;
4226
+ n = n.parentElement;
4170
4227
  }
4171
- const a = Pe(e, {
4228
+ const a = ke(e, {
4172
4229
  root: this.doc
4173
4230
  });
4174
- return n.forEach((o, h) => o.forEach((f) => h.attributes.setNamedItem(f))), this.recipeCssSelectorCache.set(e, a), a;
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 = !ae(t);
4236
+ const i = !ce(t);
4180
4237
  i && (this.flushText(), this.breadcrumbs.push(t));
4181
- const n = t.nodeName.toUpperCase();
4182
- if (n === "BR")
4238
+ const r = t.nodeName.toUpperCase();
4239
+ if (r === "BR")
4183
4240
  this.flushText();
4184
- else if (n === "IMG" || n === "AUDIO" || n === "VIDEO")
4185
- if (this.flushText(), n === "IMG") {
4186
- const r = t, a = St(r, this.baseLocator.href);
4187
- let o = r.getAttribute("alt");
4188
- o?.length || (o = r.getAttribute("title")), a != null && this.elementRecipes.push({
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 ne(
4196
- Lt.ACCESSIBILITY_LABEL,
4252
+ attributes: o?.length ? [new ae(
4253
+ Ot.ACCESSIBILITY_LABEL,
4197
4254
  o
4198
4255
  )] : []
4199
4256
  }
4200
4257
  });
4201
4258
  } else {
4202
- const r = t, a = St(r, this.baseLocator.href);
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 = [...r.getElementsByTagName("source")].map((f) => {
4210
- const m = St(f, this.baseLocator.href);
4211
- return m ? new U({
4212
- href: m,
4213
- type: f.getAttribute("type") || void 0
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((f) => !!f);
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 && (n === "AUDIO" ? this.elementRecipes.push({
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
- }) : n === "VIDEO" && this.elementRecipes.push({
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 = ji(t.parentElement);
4243
- this.currentLanguage !== i && (this.flushSegment(), this.currentLanguage = i), this.rawTextAcc += t.textContent, this.textAcc = ts(this.textAcc, t.textContent);
4244
- } else if (t.nodeType === Node.ELEMENT_NODE && !ae(t)) {
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 = Qi(
4308
+ this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text = Ki(
4252
4309
  this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text
4253
4310
  );
4254
- let t = Yi;
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 = $i;
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 Vi(parseInt(e.nodeName[1]));
4324
+ t = new Gi(parseInt(e.nodeName[1]));
4268
4325
  break;
4269
4326
  case "BLOCKQUOTE":
4270
4327
  case "Q":
4271
- t = new qi(
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 = _i(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 ne(
4300
- Lt.LANGUAGE,
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 vt {
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(([n, r]) => {
4324
- i.has(n) || e.set(n, r);
4325
- }), new vt({
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 ke {
4396
+ class De {
4340
4397
  /**
4341
4398
  * Creates a [LocatorCollection].
4342
4399
  */
4343
4400
  constructor(t) {
4344
- this.metadata = t.metadata ?? new vt({}), this.links = t.links ?? new O([]), this.locators = t.locators ?? [];
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((n) => k.deserialize(n)).filter((n) => n !== void 0)), new ke({
4353
- metadata: vt.deserialize(t.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 G {
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, n;
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(([r, a]) => {
4387
- i?.set(r, a);
4388
- }), n = G.deserializeCollections(t);
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 G({
4449
+ return new W({
4393
4450
  metadata: i?.size ? i : void 0,
4394
4451
  links: e,
4395
- subcollections: n?.size ? n : void 0
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, n]) => {
4462
+ return Object.entries(t).forEach(([i, r]) => {
4406
4463
  if (i !== "links" && i !== "metadata") {
4407
- const r = G.deserialize(n);
4408
- if (r) {
4464
+ const n = W.deserialize(r);
4465
+ if (n) {
4409
4466
  const a = new Array();
4410
- a.push(r), e.set(i, a);
4411
- } else if (Array.isArray(n)) {
4412
- const a = n.map(
4413
- (o) => G.deserialize(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()), G.serializeCollection(t, this.subcollections), t;
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, n) => {
4432
- i.length === 1 ? t[n] = i[0].serialize() : t[n] = i.map((r) => r.serialize());
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 De {
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 = pt.deserialize(t.metadata);
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 n = O.deserialize(
4510
+ const r = O.deserialize(
4454
4511
  t.readingOrder ? t.readingOrder : t.spine
4455
4512
  );
4456
- if (n)
4457
- return new De({
4513
+ if (r)
4514
+ return new Ue({
4458
4515
  context: F(t["@context"]),
4459
4516
  metadata: e,
4460
4517
  links: i,
4461
- readingOrder: n,
4518
+ readingOrder: r,
4462
4519
  resources: O.deserialize(t.resources),
4463
4520
  toc: O.deserialize(t.toc),
4464
- subcollections: G.deserializeCollections({
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()), G.serializeCollection(t, this.subcollections), t;
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 n of e)
4482
- if (i = n.findWithRel(t), i !== void 0)
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, n) => i.concat(n), []);
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, n = this.linkWithHref(i);
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: r,
4504
- title: n.title ?? t.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 m of o)
4516
- if (h = m.findWithHref(t), h !== void 0)
4572
+ for (const p of o)
4573
+ if (h = p.findWithHref(t), h !== void 0)
4517
4574
  return h;
4518
- const f = new Array();
4519
- return o.forEach((m) => {
4575
+ const m = new Array();
4576
+ return o.forEach((p) => {
4520
4577
  const u = [];
4521
- for (const g of m.items)
4578
+ for (const g of p.items)
4522
4579
  g.alternates && u.push(g.alternates), g.children && u.push(g.children);
4523
- f.push(...u);
4524
- }), f.length > 0 && (h = e(f)), h;
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 n = e(i);
4528
- if (n !== void 0)
4529
- return n;
4530
- const r = t.split(/[#]/);
4531
- if (r.length < 2) return;
4532
- const a = r[0];
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("/"), n = i === -1 ? void 0 : e.substring(i + 1);
4546
- e = e.replace(new RegExp("/?$query$"), ""), e = e.replace(new RegExp("//$"), ""), n && (e = e.replace(new RegExp(n + "$"), ""));
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
- C as AccessMode,
4568
- V as Accessibility,
4569
- rn as AccessibilityMetadataDisplayGuide,
4570
- Et as AccessibilityProfile,
4571
- Gt as AccessibilitySummary,
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
- Ut as AdditionalInformation,
4630
+ Mt as AdditionalInformation,
4574
4631
  Z as AltIdentifier,
4575
- ne as Attribute,
4576
- Lt as AttributeKeys,
4632
+ ae as Attribute,
4633
+ Ot as AttributeKeys,
4577
4634
  pe as AttributesHolder,
4578
- Gi as AudioElement,
4579
- Jt as Availability,
4580
- Wi as AvailabilityStatus,
4581
- _ as BelongsTo,
4582
- Yi as Body,
4583
- Rt as Certification,
4584
- Bt as Conformance,
4585
- on as Content,
4586
- fe as ContentElement,
4587
- ht as Contributor,
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
- Zt as Copies,
4590
- Di as DefaultTextContentTokenizer,
4591
- qt as DomRange,
4646
+ Jt as Copies,
4647
+ Ri as DefaultTextContentTokenizer,
4648
+ Xt as DomRange,
4592
4649
  mt as DomRangePoint,
4593
- je as EmptyFetcher,
4594
- Ht as Encryption,
4650
+ ti as EmptyFetcher,
4651
+ Ft as Encryption,
4595
4652
  xt as Exemption,
4596
- v as Feature,
4597
- $i as Footnote,
4653
+ A as Feature,
4654
+ Hi as Footnote,
4598
4655
  $t as GuidedNavigationDocument,
4599
4656
  X as GuidedNavigationObject,
4600
- ft as GuidedNavigationText,
4601
- dn as HTMLResourceContentIterator,
4657
+ pt as GuidedNavigationText,
4658
+ hr as HTMLResourceContentIterator,
4602
4659
  P as Hazard,
4603
- di as HazardType,
4604
- Mt as Hazards,
4605
- Vi as Heading,
4606
- Kt as Holds,
4607
- en as HttpFetcher,
4608
- ti as HttpResource,
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
- Fi as ImageElement,
4611
- Ui as IntlTextTokenizer,
4612
- _t as Iterator,
4613
- q as Layout,
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
- p as Localization,
4674
+ f as Localization,
4618
4675
  M as LocalizedString,
4619
4676
  k as Locator,
4620
- ke as LocatorCollection,
4621
- vt as LocatorCollectionMetadata,
4677
+ De as LocatorCollection,
4678
+ At as LocatorCollectionMetadata,
4622
4679
  T as LocatorLocations,
4623
- nt as LocatorText,
4624
- De as Manifest,
4625
- Ft as MediaOverlay,
4680
+ rt as LocatorText,
4681
+ Ue as Manifest,
4682
+ _t as MediaOverlay,
4626
4683
  c as MediaType,
4627
- pt as Metadata,
4628
- Mi as NaiveTextTokenizer,
4629
- kt as Navigation,
4630
- li as NonvisualReading,
4631
- sn as NumberRange,
4632
- yt as PDFContentElement,
4633
- It as Page,
4634
- hn as PageContentIteratorPDF,
4635
- ui as PrerecordedAudio,
4636
- Xt as Price,
4637
- Tt as PrimaryAccessMode,
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
- Y as Publication,
4641
- G as PublicationCollection,
4642
- un as PublicationContentIterator,
4697
+ V as Publication,
4698
+ W as PublicationCollection,
4699
+ cr as PublicationContentIterator,
4643
4700
  H as ReadingProgression,
4644
- nn as Resource,
4645
- Dt as RichContent,
4646
- hi as RichContentType,
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
- fi as TDMReservation,
4651
- cn as TextContentTokenizer,
4652
- Ot as TextElement,
4653
- qi as TextQuote,
4654
- me as TextSegment,
4655
- ki as TextUnit,
4656
- At as TextualElement,
4657
- ut as URITemplate,
4658
- Hi as VideoElement,
4659
- ci as VisualAdjustments,
4660
- Pt as WaysOfReading,
4661
- pi as arrayfromJSON,
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
- an as leadingPage,
4721
+ rr as leadingPage,
4665
4722
  K as numberfromJSON,
4666
4723
  L as positiveNumberfromJSON,
4667
4724
  lt as setToArray,
4668
- de as speakableToken
4725
+ fe as speakableToken
4669
4726
  };