@readium/navigator 2.7.0-alpha.2 → 2.7.0-alpha.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
- const C = class C {
1
+ const E = class E {
2
2
  constructor(t) {
3
3
  this.uri = t;
4
4
  }
@@ -7,7 +7,7 @@ const C = class C {
7
7
  */
8
8
  static deserialize(t) {
9
9
  if (!(!t || typeof t != "string"))
10
- return new C(t);
10
+ return new E(t);
11
11
  }
12
12
  /**
13
13
  * Serializes an [AccessibilityProfile] to its RWPM JSON representation.
@@ -19,23 +19,23 @@ const C = class C {
19
19
  * Returns true if the profile is a WCAG Level A profile.
20
20
  */
21
21
  get isWCAGLevelA() {
22
- return this === C.EPUB_A11Y_10_WCAG_20_A || this === C.EPUB_A11Y_11_WCAG_20_A || this === C.EPUB_A11Y_11_WCAG_21_A || this === C.EPUB_A11Y_11_WCAG_22_A;
22
+ return this === E.EPUB_A11Y_10_WCAG_20_A || this === E.EPUB_A11Y_11_WCAG_20_A || this === E.EPUB_A11Y_11_WCAG_21_A || this === E.EPUB_A11Y_11_WCAG_22_A;
23
23
  }
24
24
  /**
25
25
  * Returns true if the profile is a WCAG Level AA profile.
26
26
  */
27
27
  get isWCAGLevelAA() {
28
- return this === C.EPUB_A11Y_10_WCAG_20_AA || this === C.EPUB_A11Y_11_WCAG_20_AA || this === C.EPUB_A11Y_11_WCAG_21_AA || this === C.EPUB_A11Y_11_WCAG_22_AA;
28
+ return this === E.EPUB_A11Y_10_WCAG_20_AA || this === E.EPUB_A11Y_11_WCAG_20_AA || this === E.EPUB_A11Y_11_WCAG_21_AA || this === E.EPUB_A11Y_11_WCAG_22_AA;
29
29
  }
30
30
  /**
31
31
  * Returns true if the profile is a WCAG Level AAA profile.
32
32
  */
33
33
  get isWCAGLevelAAA() {
34
- return this === C.EPUB_A11Y_10_WCAG_20_AAA || this === C.EPUB_A11Y_11_WCAG_20_AAA || this === C.EPUB_A11Y_11_WCAG_21_AAA || this === C.EPUB_A11Y_11_WCAG_22_AAA;
34
+ return this === E.EPUB_A11Y_10_WCAG_20_AAA || this === E.EPUB_A11Y_11_WCAG_20_AAA || this === E.EPUB_A11Y_11_WCAG_21_AAA || this === E.EPUB_A11Y_11_WCAG_22_AAA;
35
35
  }
36
36
  };
37
- C.EPUB_A11Y_10_WCAG_20_A = new C("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), C.EPUB_A11Y_10_WCAG_20_AA = new C("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), C.EPUB_A11Y_10_WCAG_20_AAA = new C("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), C.EPUB_A11Y_11_WCAG_20_A = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), C.EPUB_A11Y_11_WCAG_20_AA = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), C.EPUB_A11Y_11_WCAG_20_AAA = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), C.EPUB_A11Y_11_WCAG_21_A = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), C.EPUB_A11Y_11_WCAG_21_AA = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), C.EPUB_A11Y_11_WCAG_21_AAA = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), C.EPUB_A11Y_11_WCAG_22_A = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), C.EPUB_A11Y_11_WCAG_22_AA = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), C.EPUB_A11Y_11_WCAG_22_AAA = new C("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
38
- let pi = C;
37
+ E.EPUB_A11Y_10_WCAG_20_A = new E("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), E.EPUB_A11Y_10_WCAG_20_AA = new E("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), E.EPUB_A11Y_10_WCAG_20_AAA = new E("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), E.EPUB_A11Y_11_WCAG_20_A = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), E.EPUB_A11Y_11_WCAG_20_AA = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), E.EPUB_A11Y_11_WCAG_20_AAA = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), E.EPUB_A11Y_11_WCAG_21_A = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), E.EPUB_A11Y_11_WCAG_21_AA = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), E.EPUB_A11Y_11_WCAG_21_AAA = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), E.EPUB_A11Y_11_WCAG_22_A = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), E.EPUB_A11Y_11_WCAG_22_AA = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), E.EPUB_A11Y_11_WCAG_22_AAA = new E("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
38
+ let pi = E;
39
39
  const O = class O {
40
40
  constructor(t) {
41
41
  this.value = t;
@@ -112,7 +112,7 @@ const b = class b {
112
112
  };
113
113
  b.NONE = new b("none"), b.ANNOTATIONS = new b("annotations"), b.ARIA = new b("ARIA"), b.INDEX = new b("index"), b.PAGE_BREAK_MARKERS = new b("pageBreakMarkers"), b.PAGE_NAVIGATION = new b("pageNavigation"), b.PRINT_PAGE_NUMBERS = new b("printPageNumbers"), b.READING_ORDER = new b("readingOrder"), b.STRUCTURAL_NAVIGATION = new b("structuralNavigation"), b.TABLE_OF_CONTENTS = new b("tableOfContents"), b.TAGGED_PDF = new b("taggedPDF"), b.ALTERNATIVE_TEXT = new b("alternativeText"), b.AUDIO_DESCRIPTION = new b("audioDescription"), b.CAPTIONS = new b("captions"), b.CLOSED_CAPTIONS = new b("closedCaptions"), b.DESCRIBED_MATH = new b("describedMath"), b.LONG_DESCRIPTION = new b("longDescription"), b.OPEN_CAPTIONS = new b("openCaptions"), b.SIGN_LANGUAGE = new b("signLanguage"), b.TRANSCRIPT = new b("transcript"), b.DISPLAY_TRANSFORMABILITY = new b("displayTransformability"), b.SYNCHRONIZED_AUDIO_TEXT = new b("synchronizedAudioText"), b.TIMING_CONTROL = new b("timingControl"), b.UNLOCKED = new b("unlocked"), b.CHEM_ML = new b("ChemML"), b.LATEX = new b("latex"), b.LATEX_CHEMISTRY = new b("latex-chemistry"), b.MATH_ML = new b("MathML"), b.MATH_ML_CHEMISTRY = new b("MathML-chemistry"), b.TTS_MARKUP = new b("ttsMarkup"), b.HIGH_CONTRAST_AUDIO = new b("highContrastAudio"), b.HIGH_CONTRAST_DISPLAY = new b("highContrastDisplay"), b.LARGE_PRINT = new b("largePrint"), b.BRAILLE = new b("braille"), b.TACTILE_GRAPHIC = new b("tactileGraphic"), b.TACTILE_OBJECT = new b("tactileObject"), b.FULL_RUBY_ANNOTATIONS = new b("fullRubyAnnotations"), b.HORIZONTAL_WRITING = new b("horizontalWriting"), b.RUBY_ANNOTATIONS = new b("rubyAnnotations"), b.VERTICAL_WRITING = new b("verticalWriting"), b.WITH_ADDITIONAL_WORD_SEGMENTATION = new b("withAdditionalWordSegmentation"), b.WITHOUT_ADDITIONAL_WORD_SEGMENTATION = new b("withoutAdditionalWordSegmentation");
114
114
  let Zt = b;
115
- const R = class R {
115
+ const A = class A {
116
116
  constructor(t) {
117
117
  this.value = t;
118
118
  }
@@ -121,7 +121,7 @@ const R = class R {
121
121
  */
122
122
  static deserialize(t) {
123
123
  if (!(!t || typeof t != "string"))
124
- return new R(t);
124
+ return new A(t);
125
125
  }
126
126
  /**
127
127
  * Serializes a [Hazard] to its RWPM JSON representation.
@@ -130,9 +130,9 @@ const R = class R {
130
130
  return this.value;
131
131
  }
132
132
  };
133
- R.FLASHING = new R("flashing"), R.NO_FLASHING_HAZARD = new R("noFlashingHazard"), R.UNKNOWN_FLASHING_HAZARD = new R("unknownFlashingHazard"), R.MOTION_SIMULATION = new R("motionSimulation"), R.NO_MOTION_SIMULATION_HAZARD = new R("noMotionSimulationHazard"), R.UNKNOWN_MOTION_SIMULATION_HAZARD = new R("unknownMotionSimulationHazard"), R.SOUND = new R("sound"), R.NO_SOUND_HAZARD = new R("noSoundHazard"), R.UNKNOWN_SOUND_HAZARD = new R("unknownSoundHazard"), R.UNKNOWN = new R("unknown"), R.NONE = new R("none");
134
- let gi = R;
135
- const A = class A {
133
+ A.FLASHING = new A("flashing"), A.NO_FLASHING_HAZARD = new A("noFlashingHazard"), A.UNKNOWN_FLASHING_HAZARD = new A("unknownFlashingHazard"), A.MOTION_SIMULATION = new A("motionSimulation"), A.NO_MOTION_SIMULATION_HAZARD = new A("noMotionSimulationHazard"), A.UNKNOWN_MOTION_SIMULATION_HAZARD = new A("unknownMotionSimulationHazard"), A.SOUND = new A("sound"), A.NO_SOUND_HAZARD = new A("noSoundHazard"), A.UNKNOWN_SOUND_HAZARD = new A("unknownSoundHazard"), A.UNKNOWN = new A("unknown"), A.NONE = new A("none");
134
+ let gi = A;
135
+ const R = class R {
136
136
  constructor(t) {
137
137
  this.value = t;
138
138
  }
@@ -141,7 +141,7 @@ const A = class A {
141
141
  */
142
142
  static deserialize(t) {
143
143
  if (!(!t || typeof t != "string"))
144
- return new A(t);
144
+ return new R(t);
145
145
  }
146
146
  /**
147
147
  * Serializes an [Exemption] to its RWPM JSON representation.
@@ -150,8 +150,8 @@ const A = class A {
150
150
  return this.value;
151
151
  }
152
152
  };
153
- A.NONE = new A("none"), A.DOCUMENTED = new A("documented"), A.LEGAL = new A("legal"), A.TEMPORARY = new A("temporary"), A.TECHNICAL = new A("technical"), A.EAA_DISPROPORTIONATE_BURDEN = new A("eaa-disproportionate-burden"), A.EAA_FUNDAMENTAL_ALTERATION = new A("eaa-fundamental-alteration"), A.EAA_MICROENTERPRISE = new A("eaa-microenterprise"), A.EAA_TECHNICAL_IMPOSSIBILITY = new A("eaa-technical-impossibility"), A.EAA_TEMPORARY = new A("eaa-temporary");
154
- let yi = A;
153
+ R.NONE = new R("none"), R.DOCUMENTED = new R("documented"), R.LEGAL = new R("legal"), R.TEMPORARY = new R("temporary"), R.TECHNICAL = new R("technical"), R.EAA_DISPROPORTIONATE_BURDEN = new R("eaa-disproportionate-burden"), R.EAA_FUNDAMENTAL_ALTERATION = new R("eaa-fundamental-alteration"), R.EAA_MICROENTERPRISE = new R("eaa-microenterprise"), R.EAA_TECHNICAL_IMPOSSIBILITY = new R("eaa-technical-impossibility"), R.EAA_TEMPORARY = new R("eaa-temporary");
154
+ let yi = R;
155
155
  const bi = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], un = /* @__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"}}`), pn = {
156
156
  publication: un
157
157
  }, Si = {
@@ -273,7 +273,7 @@ class Ke {
273
273
  }
274
274
  }
275
275
  var x = /* @__PURE__ */ ((o) => (o.left = "left", o.right = "right", o.center = "center", o))(x || {});
276
- let Z = class De {
276
+ let Z = class Fe {
277
277
  constructor(t) {
278
278
  this.otherProperties = t;
279
279
  }
@@ -285,7 +285,7 @@ let Z = class De {
285
285
  */
286
286
  static deserialize(t) {
287
287
  if (t)
288
- return new De(t);
288
+ return new Fe(t);
289
289
  }
290
290
  /**
291
291
  * Serializes a [Properties] to its RWPM JSON representation.
@@ -300,7 +300,7 @@ let Z = class De {
300
300
  const e = Object.assign({}, this.otherProperties);
301
301
  for (const i in t)
302
302
  e[i] = t[i];
303
- return new De(e);
303
+ return new Fe(e);
304
304
  }
305
305
  };
306
306
  Object.defineProperty(Z.prototype, "encryption", {
@@ -877,7 +877,7 @@ class et {
877
877
  return this.after !== void 0 && (t.after = this.after), this.before !== void 0 && (t.before = this.before), this.highlight !== void 0 && (t.highlight = this.highlight), t;
878
878
  }
879
879
  }
880
- class F {
880
+ class I {
881
881
  /**
882
882
  * Creates a [Locator].
883
883
  */
@@ -889,7 +889,7 @@ class F {
889
889
  */
890
890
  static deserialize(t) {
891
891
  if (t && t.href && t.type)
892
- return new F({
892
+ return new I({
893
893
  href: t.href,
894
894
  type: t.type,
895
895
  title: t.title,
@@ -908,7 +908,7 @@ class F {
908
908
  * Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
909
909
  */
910
910
  copyWithLocations(t) {
911
- return new F({
911
+ return new I({
912
912
  href: this.href,
913
913
  type: this.type,
914
914
  title: this.title,
@@ -991,7 +991,7 @@ class q {
991
991
  */
992
992
  get locator() {
993
993
  let t = this.href.split("#");
994
- return new F({
994
+ return new I({
995
995
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
996
996
  type: this.type ?? "",
997
997
  title: this.title,
@@ -1239,7 +1239,7 @@ class Ze {
1239
1239
  return { currency: this.currency, value: this.value };
1240
1240
  }
1241
1241
  }
1242
- class Ft {
1242
+ class Dt {
1243
1243
  /** Creates a [Acquisition]. */
1244
1244
  constructor(t) {
1245
1245
  this.type = t.type, this.children = t.children;
@@ -1249,14 +1249,14 @@ class Ft {
1249
1249
  */
1250
1250
  static deserialize(t) {
1251
1251
  if (t && t.type)
1252
- return new Ft({
1252
+ return new Dt({
1253
1253
  type: t.type,
1254
- children: Ft.deserializeArray(t.children)
1254
+ children: Dt.deserializeArray(t.children)
1255
1255
  });
1256
1256
  }
1257
1257
  static deserializeArray(t) {
1258
1258
  if (Array.isArray(t))
1259
- return t.map((e) => Ft.deserialize(e)).filter((e) => e !== void 0);
1259
+ return t.map((e) => Dt.deserialize(e)).filter((e) => e !== void 0);
1260
1260
  }
1261
1261
  /**
1262
1262
  * Serializes a [Acquisition] to its RWPM JSON representation.
@@ -1345,7 +1345,7 @@ Z.prototype.getPrice = function() {
1345
1345
  Z.prototype.getIndirectAcquisitions = function() {
1346
1346
  const o = this.otherProperties.indirectAcquisition;
1347
1347
  if (o && Array.isArray(o))
1348
- return o.map((t) => Ft.deserialize(t)).filter((t) => t !== void 0);
1348
+ return o.map((t) => Dt.deserialize(t)).filter((t) => t !== void 0);
1349
1349
  };
1350
1350
  Z.prototype.getHolds = function() {
1351
1351
  return Qe.deserialize(this.otherProperties.holds);
@@ -1392,7 +1392,7 @@ wn([
1392
1392
  // Angular attributes
1393
1393
  "ng-*"
1394
1394
  ]);
1395
- const vn = Math.pow(2, 32), Ci = () => Math.round(Math.random() * vn).toString(36), Fe = () => `${Math.round(performance.now())}-${Ci()}-${Ci()}`, wt = 1;
1395
+ const vn = Math.pow(2, 32), Ci = () => Math.round(Math.random() * vn).toString(36), De = () => `${Math.round(performance.now())}-${Ci()}-${Ci()}`, wt = 1;
1396
1396
  class Pn {
1397
1397
  constructor(t) {
1398
1398
  this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = t, t.addEventListener("message", this.receiver);
@@ -1467,7 +1467,7 @@ class Pn {
1467
1467
  const n = {
1468
1468
  _readium: wt,
1469
1469
  _channel: this.channelId,
1470
- id: i ?? Fe(),
1470
+ id: i ?? De(),
1471
1471
  // scrict,
1472
1472
  key: t,
1473
1473
  data: e
@@ -1483,7 +1483,7 @@ class Pn {
1483
1483
  }
1484
1484
  }
1485
1485
  }
1486
- class At {
1486
+ class Rt {
1487
1487
  }
1488
1488
  function _i(o) {
1489
1489
  return o.split("").reverse().join("");
@@ -1706,7 +1706,7 @@ function Ti(o) {
1706
1706
  e += Os(t), t = t.previousSibling;
1707
1707
  return e;
1708
1708
  }
1709
- function Rs(o, ...t) {
1709
+ function As(o, ...t) {
1710
1710
  let e = t.shift();
1711
1711
  const i = o.ownerDocument.createNodeIterator(
1712
1712
  o,
@@ -1760,7 +1760,7 @@ class tt {
1760
1760
  */
1761
1761
  resolve(t = {}) {
1762
1762
  try {
1763
- return Rs(this.element, this.offset)[0];
1763
+ return As(this.element, this.offset)[0];
1764
1764
  } catch (e) {
1765
1765
  if (this.offset === 0 && t.direction !== void 0) {
1766
1766
  const i = document.createTreeWalker(
@@ -1845,7 +1845,7 @@ class lt {
1845
1845
  */
1846
1846
  toRange() {
1847
1847
  let t, e;
1848
- this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = Rs(
1848
+ this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = As(
1849
1849
  this.start.element,
1850
1850
  this.start.offset,
1851
1851
  this.end.offset
@@ -2007,7 +2007,7 @@ function kn(o, t, e = !1) {
2007
2007
  top: h.top,
2008
2008
  width: h.width
2009
2009
  });
2010
- const r = As(
2010
+ const r = Rs(
2011
2011
  n,
2012
2012
  s,
2013
2013
  t,
@@ -2023,7 +2023,7 @@ function kn(o, t, e = !1) {
2023
2023
  }
2024
2024
  return l;
2025
2025
  }
2026
- function As(o, t, e, i = !1) {
2026
+ function Rs(o, t, e, i = !1) {
2027
2027
  for (let s = 0; s < o.length; s++)
2028
2028
  for (let n = s + 1; n < o.length; n++) {
2029
2029
  const r = o[s], a = o[n];
@@ -2032,7 +2032,7 @@ function As(o, t, e, i = !1) {
2032
2032
  const l = J(r.top, a.top, t) && J(r.bottom, a.bottom, t), c = J(r.left, a.left, t) && J(r.right, a.right, t);
2033
2033
  if (l && !c && Ns(r, a, t)) {
2034
2034
  const u = o.filter((m) => m !== r && m !== a), f = Tn(r, a);
2035
- return u.push(f), As(
2035
+ return u.push(f), Rs(
2036
2036
  u,
2037
2037
  t,
2038
2038
  e,
@@ -2061,14 +2061,14 @@ function On(o, t) {
2061
2061
  continue;
2062
2062
  }
2063
2063
  for (const n of o)
2064
- if (i !== n && e.has(n) && Rn(n, i, t)) {
2064
+ if (i !== n && e.has(n) && An(n, i, t)) {
2065
2065
  e.delete(i);
2066
2066
  break;
2067
2067
  }
2068
2068
  }
2069
2069
  return Array.from(e);
2070
2070
  }
2071
- function Rn(o, t, e) {
2071
+ function An(o, t, e) {
2072
2072
  return Et(o, t.left, t.top, e) && Et(o, t.right, t.top, e) && Et(o, t.left, t.bottom, e) && Et(o, t.right, t.bottom, e);
2073
2073
  }
2074
2074
  function Et(o, t, e, i) {
@@ -2094,7 +2094,7 @@ function Ms(o) {
2094
2094
  return o;
2095
2095
  }
2096
2096
  function Oi(o, t) {
2097
- const e = An(t, o);
2097
+ const e = Rn(t, o);
2098
2098
  if (e.height === 0 || e.width === 0)
2099
2099
  return [o];
2100
2100
  const i = [];
@@ -2144,7 +2144,7 @@ function Oi(o, t) {
2144
2144
  }
2145
2145
  return i;
2146
2146
  }
2147
- function An(o, t) {
2147
+ function Rn(o, t) {
2148
2148
  const e = Math.max(o.left, t.left), i = Math.min(o.right, t.right), s = Math.max(o.top, t.top), n = Math.min(o.bottom, t.bottom);
2149
2149
  return {
2150
2150
  bottom: n,
@@ -2174,11 +2174,11 @@ const ke = () => typeof window.CSSTransformValue < "u", Mn = /* @__PURE__ */ new
2174
2174
  "darkenFilter",
2175
2175
  "invertFilter",
2176
2176
  "invertGaiji"
2177
- ]), Ri = /--(?:USER|RS)__([\w-]+)/g;
2177
+ ]), Ai = /--(?:USER|RS)__([\w-]+)/g;
2178
2178
  function Nn(o, t) {
2179
2179
  const e = o ?? "", i = t ?? "", s = /* @__PURE__ */ new Set();
2180
- for (const n of e.matchAll(Ri)) s.add(n[1]);
2181
- for (const n of i.matchAll(Ri)) s.add(n[1]);
2180
+ for (const n of e.matchAll(Ai)) s.add(n[1]);
2181
+ for (const n of i.matchAll(Ai)) s.add(n[1]);
2182
2182
  for (const n of s)
2183
2183
  if (!Mn.has(n)) return !0;
2184
2184
  return !1;
@@ -2197,7 +2197,7 @@ function Is(o, t) {
2197
2197
  e[i] !== s && Ut(o, i, s);
2198
2198
  });
2199
2199
  }
2200
- function Ai(o, t) {
2200
+ function Ri(o, t) {
2201
2201
  return o.document.documentElement.style.getPropertyValue(t);
2202
2202
  }
2203
2203
  function Ut(o, t, e) {
@@ -2222,7 +2222,7 @@ const vt = { r: 255, g: 255, b: 255, a: 1 }, mt = /* @__PURE__ */ new Map(), In
2222
2222
  });
2223
2223
  }
2224
2224
  return Te;
2225
- }, Dn = (o) => {
2225
+ }, Fn = (o) => {
2226
2226
  if (!o) return !0;
2227
2227
  const t = o.trim().toLowerCase();
2228
2228
  return t.startsWith("var(") || [
@@ -2249,7 +2249,7 @@ const vt = { r: 255, g: 255, b: 255, a: 1 }, mt = /* @__PURE__ */ new Map(), In
2249
2249
  const e = t ? `${o}|${t}` : o, i = mt.get(e);
2250
2250
  if (i !== void 0)
2251
2251
  return i ?? vt;
2252
- if (Dn(o))
2252
+ if (Fn(o))
2253
2253
  return Kt(o, "Unsupported color format or special value."), mt.set(e, null), vt;
2254
2254
  const s = In();
2255
2255
  if (!s)
@@ -2277,10 +2277,10 @@ const vt = { r: 255, g: 255, b: 255, a: 1 }, mt = /* @__PURE__ */ new Map(), In
2277
2277
  }, se = (o, t) => {
2278
2278
  const e = typeof o == "string" ? Bt(o) : o, i = typeof t == "string" ? Bt(t) : t, s = He(e), n = He(i), r = Math.max(s, n), a = Math.min(s, n);
2279
2279
  return (r + 0.05) / (a + 0.05);
2280
- }, Ds = (o, t = null) => {
2280
+ }, Fs = (o, t = null) => {
2281
2281
  const e = Bt(o, t), i = se(e, { r: 255, g: 255, b: 255, a: 1 }), s = se(e, { r: 0, g: 0, b: 0, a: 1 });
2282
2282
  return i > s;
2283
- }, Fn = (o, t = null) => Ds(o, t) ? "white" : "black", zn = (o) => {
2283
+ }, Dn = (o, t = null) => Fs(o, t) ? "white" : "black", zn = (o) => {
2284
2284
  const t = o.a !== void 0 ? o.a : 1;
2285
2285
  return `rgba(${Math.round(o.r)}, ${Math.round(o.g)}, ${Math.round(o.b)}, ${t})`;
2286
2286
  }, Hn = (o, t) => ({
@@ -2308,15 +2308,15 @@ const vt = { r: 255, g: 255, b: 255, a: 1 }, mt = /* @__PURE__ */ new Map(), In
2308
2308
  function Un(o) {
2309
2309
  return (o.document.documentElement.dir || o.document.body.dir).toLowerCase() === "rtl";
2310
2310
  }
2311
- function Fs(o) {
2311
+ function Ds(o) {
2312
2312
  return (o.getComputedStyle(o.document.documentElement).writingMode || o.getComputedStyle(o.document.body).writingMode) === "vertical-lr";
2313
2313
  }
2314
2314
  function Bn(o) {
2315
2315
  const t = o.getComputedStyle(o.document.documentElement).writingMode || o.getComputedStyle(o.document.body).writingMode;
2316
2316
  return t === "vertical-rl" || t === "vertical-lr";
2317
2317
  }
2318
- function Re(o) {
2319
- const t = Bn(o), e = t && Fs(o), i = o.innerWidth, s = o.innerHeight, n = o.document.scrollingElement, r = n.scrollLeft, a = n.scrollTop, l = parseInt(o.getComputedStyle(o.document.documentElement).getPropertyValue("column-count")), c = t && !e ? n.scrollWidth - i + r : r, h = a;
2318
+ function Ae(o) {
2319
+ const t = Bn(o), e = t && Ds(o), i = o.innerWidth, s = o.innerHeight, n = o.document.scrollingElement, r = n.scrollLeft, a = n.scrollTop, l = parseInt(o.getComputedStyle(o.document.documentElement).getPropertyValue("column-count")), c = t && !e ? n.scrollWidth - i + r : r, h = a;
2320
2320
  return {
2321
2321
  isVertical: t,
2322
2322
  isVertLR: e,
@@ -2480,7 +2480,7 @@ function Gn(o, t) {
2480
2480
  (Xn.test(s) || $n.has(s) && Yn.test(n)) && i.removeAttribute(s);
2481
2481
  }
2482
2482
  }
2483
- function Ae(o) {
2483
+ function Re(o) {
2484
2484
  switch (o) {
2485
2485
  case _.Mask:
2486
2486
  return "rgba(255, 255, 255, 0.5)";
@@ -2505,7 +2505,7 @@ const _ = {
2505
2505
  // Custom HTML template (HTMLDecorationTemplate).
2506
2506
  };
2507
2507
  var qn = /* @__PURE__ */ ((o) => (o.Wrap = "wrap", o.Viewport = "viewport", o.Bounds = "bounds", o.Page = "page", o))(qn || {}), Kn = /* @__PURE__ */ ((o) => (o.Boxes = "boxes", o.Bounds = "bounds", o))(Kn || {});
2508
- const Jn = () => "Highlight" in window, Di = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2508
+ const Jn = () => "Highlight" in window, Fi = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2509
2509
  class Zn {
2510
2510
  /**
2511
2511
  * Creates a DecorationGroup object
@@ -2532,7 +2532,7 @@ class Zn {
2532
2532
  return;
2533
2533
  }
2534
2534
  const s = i.commonAncestorContainer;
2535
- if (s.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Di.includes(s.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), i.cloneContents().querySelector(Di.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (s.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0)), this.experimentalHighlights) {
2535
+ if (s.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Fi.includes(s.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), i.cloneContents().querySelector(Fi.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (s.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0)), this.experimentalHighlights) {
2536
2536
  const { type: r } = t.style, { layout: a, width: l } = t.style;
2537
2537
  r !== _.TextColor && (r === _.Outline || r === _.Template || r === _.Mask || a !== void 0 && a !== "boxes" || l !== void 0 && l !== "wrap") && this.notTextFlag?.set(e, !0);
2538
2538
  }
@@ -2623,19 +2623,19 @@ class Zn {
2623
2623
  });
2624
2624
  }
2625
2625
  experimentalLayout(t) {
2626
- const [e, i] = this.requireContainer(!0), s = t.decoration.style, n = s.type ?? _.Highlight, r = s.tint ?? Ae(n), a = s.width, l = s.layout, c = (f, m) => this.wnd.document.caretPositionFromPoint?.(f, m) ?? null;
2626
+ const [e, i] = this.requireContainer(!0), s = t.decoration.style, n = s.type ?? _.Highlight, r = s.tint ?? Re(n), a = s.width, l = s.layout, c = (f, m) => this.wnd.document.caretPositionFromPoint?.(f, m) ?? null;
2627
2627
  if (n === _.TextColor && (l === "bounds" || a === "bounds" || a === "page")) {
2628
- const f = Re(this.wnd);
2628
+ const f = Ae(this.wnd);
2629
2629
  if (f.isVertical)
2630
2630
  console.warn("Vertical writing detected: caretPositionFromPoint has known bugs, falling back to original range"), i.add(t.range);
2631
2631
  else {
2632
2632
  const m = t.range.getBoundingClientRect();
2633
2633
  let p, y;
2634
2634
  a === "page" ? (p = Math.floor(f.inlineStart(m) / f.pageInlineSize) * f.pageInlineSize, y = f.pageInlineSize) : (p = f.inlineStart(m), y = f.inlineSize(m));
2635
- const w = c(p, f.blockStart(m) + 1), P = c(p + y, f.blockStart(m) + f.blockSize(m) - 1);
2636
- if (w && P) {
2635
+ const w = c(p, f.blockStart(m) + 1), C = c(p + y, f.blockStart(m) + f.blockSize(m) - 1);
2636
+ if (w && C) {
2637
2637
  const T = this.wnd.document.createRange();
2638
- T.setStart(w.offsetNode, w.offset), T.setEnd(P.offsetNode, P.offset), i.add(T), t.range = T;
2638
+ T.setStart(w.offsetNode, w.offset), T.setEnd(C.offsetNode, C.offset), i.add(T), t.range = T;
2639
2639
  } else
2640
2640
  i.add(t.range);
2641
2641
  }
@@ -2670,7 +2670,7 @@ class Zn {
2670
2670
  default: {
2671
2671
  const p = d ? ut(r, h) : r;
2672
2672
  u = `::highlight(${this.id}) {
2673
- color: ${Fn(p, h)};
2673
+ color: ${Dn(p, h)};
2674
2674
  background-color: ${p};
2675
2675
  }`;
2676
2676
  }
@@ -2686,7 +2686,7 @@ class Zn {
2686
2686
  return this.experimentalLayout(t);
2687
2687
  const e = this.wnd.document.createElement("div");
2688
2688
  e.setAttribute("id", t.id), e.dataset.highlightId = t.decoration.id, e.style.setProperty("pointer-events", "none");
2689
- const i = Re(this.wnd);
2689
+ const i = Ae(this.wnd);
2690
2690
  let s = 1;
2691
2691
  if (G.UA.Blink) {
2692
2692
  const h = parseFloat(this.wnd.getComputedStyle(this.wnd.document.documentElement).zoom), d = parseFloat(this.wnd.getComputedStyle(this.wnd.document.body).zoom), u = (h || 1) * (d || 1);
@@ -2726,7 +2726,7 @@ class Zn {
2726
2726
  }
2727
2727
  h.style.setProperty("pointer-events", "none"), c = h;
2728
2728
  } else {
2729
- const h = a, d = h.type ?? _.Highlight, u = h.tint ?? Ae(d);
2729
+ const h = a, d = h.type ?? _.Highlight, u = h.tint ?? Re(d);
2730
2730
  if (d === _.TextColor) {
2731
2731
  t.container = e, t.clickableElements = [];
2732
2732
  return;
@@ -2806,10 +2806,10 @@ class Zn {
2806
2806
  return this.container || (this.shadowRoot || (this.shadowHost = this.wnd.document.createElement("div"), this.shadowHost.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none", this.wnd.document.body.appendChild(this.shadowHost), this.shadowRoot = this.shadowHost.attachShadow({ mode: "open" })), this.container = this.wnd.document.createElement("div"), this.container.setAttribute("id", this.id), this.container.dataset.group = this.name, this.container.dataset.readium = "true", this.container.style.setProperty("pointer-events", "none"), this.container.style.display = "contents", this.shadowRoot.appendChild(this.container)), this.container;
2807
2807
  }
2808
2808
  getCurrentDarkMode() {
2809
- return Ai(this.wnd, "--USER__appearance") === "readium-night-on" || Ds(this.getBackgroundColor());
2809
+ return Ri(this.wnd, "--USER__appearance") === "readium-night-on" || Fs(this.getBackgroundColor());
2810
2810
  }
2811
2811
  getBackgroundColor() {
2812
- return Ai(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color");
2812
+ return Ri(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color");
2813
2813
  }
2814
2814
  updateSharedMask() {
2815
2815
  const t = this.items.filter(
@@ -2819,7 +2819,7 @@ class Zn {
2819
2819
  this.maskSvg && (this.maskSvg.remove(), this.maskSvg = void 0), this.shadowRoot && (this.shadowRoot.innerHTML = "");
2820
2820
  return;
2821
2821
  }
2822
- const e = Re(this.wnd);
2822
+ const e = Ae(this.wnd);
2823
2823
  let i = 1;
2824
2824
  if (G.UA.Blink) {
2825
2825
  const u = parseFloat(this.wnd.getComputedStyle(this.wnd.document.documentElement).zoom), f = parseFloat(this.wnd.getComputedStyle(this.wnd.document.body).zoom), m = (u || 1) * (f || 1);
@@ -2828,25 +2828,25 @@ class Zn {
2828
2828
  const s = this.wnd.document.documentElement, n = s.scrollWidth, r = s.scrollHeight, a = [];
2829
2829
  for (const u of t) {
2830
2830
  const f = u.decoration.style, m = f.layout ?? "boxes", p = f.width ?? "wrap", y = u.range.getBoundingClientRect(), w = m === "bounds" ? [y] : Array.from(u.range.getClientRects());
2831
- for (const P of w) {
2831
+ for (const C of w) {
2832
2832
  let T;
2833
2833
  switch (p) {
2834
2834
  case "viewport": {
2835
- const K = Math.floor(e.inlineStart(P) / e.viewportInlineSize) * e.viewportInlineSize;
2836
- T = e.toRect(K, e.blockStart(P), e.viewportInlineSize, e.blockSize(P));
2835
+ const K = Math.floor(e.inlineStart(C) / e.viewportInlineSize) * e.viewportInlineSize;
2836
+ T = e.toRect(K, e.blockStart(C), e.viewportInlineSize, e.blockSize(C));
2837
2837
  break;
2838
2838
  }
2839
2839
  case "page": {
2840
- const K = Math.floor(e.inlineStart(P) / e.pageInlineSize) * e.pageInlineSize;
2841
- T = e.toRect(K, e.blockStart(P), e.pageInlineSize, e.blockSize(P));
2840
+ const K = Math.floor(e.inlineStart(C) / e.pageInlineSize) * e.pageInlineSize;
2841
+ T = e.toRect(K, e.blockStart(C), e.pageInlineSize, e.blockSize(C));
2842
2842
  break;
2843
2843
  }
2844
2844
  case "bounds": {
2845
- T = e.toRect(e.inlineStart(y), e.blockStart(P), e.inlineSize(y), e.blockSize(P));
2845
+ T = e.toRect(e.inlineStart(y), e.blockStart(C), e.inlineSize(y), e.blockSize(C));
2846
2846
  break;
2847
2847
  }
2848
2848
  default:
2849
- T = P;
2849
+ T = C;
2850
2850
  }
2851
2851
  a.push(T);
2852
2852
  }
@@ -2872,7 +2872,7 @@ class Zn {
2872
2872
  h && h.setAttribute("d", l);
2873
2873
  const d = this.maskSvg.querySelector("rect");
2874
2874
  if (d) {
2875
- const f = t[0].decoration.style.tint, m = f ?? this.getBackgroundColor() ?? Ae(_.Mask), p = f ? "1" : "0.5";
2875
+ const f = t[0].decoration.style.tint, m = f ?? this.getBackgroundColor() ?? Re(_.Mask), p = f ? "1" : "0.5";
2876
2876
  d.setAttribute("x", "0"), d.setAttribute("y", "0"), d.setAttribute("width", String(n)), d.setAttribute("height", String(r)), d.setAttribute("fill", m), d.setAttribute("fill-opacity", p);
2877
2877
  }
2878
2878
  }
@@ -2888,7 +2888,7 @@ class Zn {
2888
2888
  this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.wnd.document.getElementById(`${this.id}-custom-style`)?.remove(), this.container && (this.container.remove(), this.container = void 0);
2889
2889
  }
2890
2890
  }
2891
- const _t = class _t extends At {
2891
+ const _t = class _t extends Rt {
2892
2892
  constructor() {
2893
2893
  super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
2894
2894
  }
@@ -2910,7 +2910,7 @@ const _t = class _t extends At {
2910
2910
  mount(t, e) {
2911
2911
  return this.wnd = t, e.register("decorate", _t.moduleName, (i, s) => {
2912
2912
  const n = i;
2913
- (n.action === "add" || n.action === "update") && n.decoration.locator && (n.decoration.locator = F.deserialize(n.decoration.locator)), this.groups.has(n.group) || this.groups.set(n.group, new Zn(
2913
+ (n.action === "add" || n.action === "update") && n.decoration.locator && (n.decoration.locator = I.deserialize(n.decoration.locator)), this.groups.has(n.group) || this.groups.set(n.group, new Zn(
2914
2914
  t,
2915
2915
  e,
2916
2916
  `readium-decoration-${this.lastGroupId++}`,
@@ -2951,7 +2951,7 @@ const _t = class _t extends At {
2951
2951
  };
2952
2952
  _t.moduleName = "decorator";
2953
2953
  let We = _t;
2954
- const Fi = "readium-snapper-style", Ht = class Ht extends At {
2954
+ const Di = "readium-snapper-style", Ht = class Ht extends Rt {
2955
2955
  constructor() {
2956
2956
  super(...arguments), this.protected = !1;
2957
2957
  }
@@ -2964,14 +2964,14 @@ const Fi = "readium-snapper-style", Ht = class Ht extends At {
2964
2964
  }
2965
2965
  mount(t, e) {
2966
2966
  const i = t.document.createElement("style");
2967
- return i.dataset.readium = "true", i.id = Fi, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", Ht.moduleName, (s, n) => {
2967
+ return i.dataset.readium = "true", i.id = Di, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", Ht.moduleName, (s, n) => {
2968
2968
  this.protected = !0, i.textContent = this.buildStyles(), n(!0);
2969
2969
  }), e.register("unprotect", Ht.moduleName, (s, n) => {
2970
2970
  this.protected = !1, i.textContent = this.buildStyles(), n(!0);
2971
2971
  }), e.log("Snapper Mounted"), !0;
2972
2972
  }
2973
2973
  unmount(t, e) {
2974
- return t.document.getElementById(Fi)?.remove(), e.log("Snapper Unmounted"), !0;
2974
+ return t.document.getElementById(Di)?.remove(), e.log("Snapper Unmounted"), !0;
2975
2975
  }
2976
2976
  };
2977
2977
  Ht.moduleName = "snapper";
@@ -3011,7 +3011,7 @@ function we(o, t) {
3011
3011
  const e = Vs(o, o.document.body, t), i = o._readium_cssSelectorGenerator.getCssSelector(e, {
3012
3012
  selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
3013
3013
  });
3014
- return new F({
3014
+ return new I({
3015
3015
  href: "#",
3016
3016
  type: "application/xhtml+xml",
3017
3017
  locations: new L({
@@ -3178,12 +3178,12 @@ const zi = "readium-column-snapper-style", lr = 200, V = class V extends Ot {
3178
3178
  const i = this.doc(), s = zs(this.wnd), n = this.cachedScrollWidth - this.wnd.innerWidth, r = Math.min(Math.max(0, this.normScroll()), n), a = this.dragOffset(), l = this.rtl ? -a : a, c = this.wnd.innerWidth / 3 * (l > 0 ? 2 : 1), h = Math.min(n, Math.max(0, this.snapNormOffset(r + c))), d = this.rtl ? -h : h, u = this.rtl ? -r : r, f = d > u ? "right" : "left";
3179
3179
  if (this.checkSuspiciousSnap(f, Math.abs(d - u)), t && d !== u) {
3180
3180
  this.snappingCancelled = !1;
3181
- const m = (P, T, K, ft) => K > ft ? T : P + (T - P) * Qn(K / ft), p = lr * s;
3181
+ const m = (C, T, K, ft) => K > ft ? T : C + (T - C) * Qn(K / ft), p = lr * s;
3182
3182
  let y;
3183
- const w = (P) => {
3183
+ const w = (C) => {
3184
3184
  if (this.snappingCancelled) return;
3185
- y || (y = P);
3186
- const T = P - y, K = m(this.overscroll, 0, T, p), ft = m(u, d, T, p);
3185
+ y || (y = C);
3186
+ const T = C - y, K = m(this.overscroll, 0, T, p), ft = m(u, d, T, p);
3187
3187
  i.scrollLeft = ft, this.overscroll !== 0 && (ke() ? i.attributeStyleMap.set("transform", new CSSTransformValue([
3188
3188
  new CSSTranslate(CSS.px(-K), CSS.px(0), CSS.px(0))
3189
3189
  ])) : i.style.transform = `translate3d(${-K}px, 0px, 0px)`), T < p ? this.wnd.requestAnimationFrame(w) : (this.clearTouches(), i.style.removeProperty("transform"), i.scrollLeft = d, e || this.reportProgress());
@@ -3343,7 +3343,7 @@ const zi = "readium-column-snapper-style", lr = 200, V = class V extends Ot {
3343
3343
  }), e.register("go_text", V.moduleName, (r, a) => {
3344
3344
  let l;
3345
3345
  Array.isArray(r) && (r.length > 1 && (l = r[1]), r = r[0]);
3346
- const c = et.deserialize(r), h = Gt(this.wnd.document, new F({
3346
+ const c = et.deserialize(r), h = Gt(this.wnd.document, new I({
3347
3347
  href: t.location.href,
3348
3348
  type: "text/html",
3349
3349
  text: c,
@@ -3494,7 +3494,7 @@ const Hi = "readium-scroll-snapper-style", X = class X extends Ot {
3494
3494
  }), e.register("go_text", X.moduleName, (s, n) => {
3495
3495
  let r;
3496
3496
  Array.isArray(s) && (s.length > 1 && (r = s[1]), s = s[0]);
3497
- const a = et.deserialize(s), l = Gt(this.wnd.document, new F({
3497
+ const a = et.deserialize(s), l = Gt(this.wnd.document, new I({
3498
3498
  href: t.location.href,
3499
3499
  type: "text/html",
3500
3500
  text: a,
@@ -3617,7 +3617,7 @@ const $ = class $ extends Ot {
3617
3617
  }), e.register("go_text", $.moduleName, (i, s) => {
3618
3618
  let n;
3619
3619
  Array.isArray(i) && (i.length > 1 && (n = i[1]), i = i[0]);
3620
- const r = et.deserialize(i), a = Gt(this.wnd.document, new F({
3620
+ const r = et.deserialize(i), a = Gt(this.wnd.document, new I({
3621
3621
  href: t.location.href,
3622
3622
  type: "text/html",
3623
3623
  text: r,
@@ -3834,7 +3834,7 @@ class $s {
3834
3834
  };
3835
3835
  }
3836
3836
  }
3837
- const pt = class pt extends At {
3837
+ const pt = class pt extends Rt {
3838
3838
  constructor() {
3839
3839
  super(...arguments), this.configApplied = !1, this.cleanupCallbacks = [], this.pointerMoved = !1, this.isContextMenuEnabled = !1, this.isDragAndDropEnabled = !1, this.isSelectionMonitoringEnabled = !1, this.isBulkCopyProtectionEnabled = !1, this.selectionAnalyzer = null, this.currentSelection = null, this.bulkCopyProtector = null, this.keyManager = new $s(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
3840
3840
  if (!this.isBulkCopyProtectionEnabled || !this.bulkCopyProtector)
@@ -4062,7 +4062,7 @@ const pt = class pt extends At {
4062
4062
  };
4063
4063
  pt.moduleName = "peripherals";
4064
4064
  let Xe = pt;
4065
- const Wt = class Wt extends At {
4065
+ const Wt = class Wt extends Rt {
4066
4066
  constructor() {
4067
4067
  super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
4068
4068
  }
@@ -4112,7 +4112,7 @@ const Wt = class Wt extends At {
4112
4112
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
4113
4113
  value: {
4114
4114
  name: "readium-ts-toolkit",
4115
- version: "2.7.0-alpha.1",
4115
+ version: "2.7.0-alpha.4",
4116
4116
  hasFeature: (s, n = "") => {
4117
4117
  switch (s) {
4118
4118
  case "dom-manipulation":
@@ -4236,7 +4236,7 @@ const Ui = "readium-fixed-style", Q = class Q extends ne {
4236
4236
  };
4237
4237
  Q.moduleName = "fixed_setup";
4238
4238
  let Ye = Q;
4239
- const st = class st extends At {
4239
+ const st = class st extends Rt {
4240
4240
  wndOnErr(t) {
4241
4241
  this.comms?.send("error", {
4242
4242
  message: t.message,
@@ -4270,7 +4270,7 @@ const st = class st extends At {
4270
4270
  st.moduleName = "webpub_setup";
4271
4271
  let je = st;
4272
4272
  var ct;
4273
- let dr = (ct = class extends At {
4273
+ let dr = (ct = class extends Rt {
4274
4274
  constructor() {
4275
4275
  super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
4276
4276
  }
@@ -4361,7 +4361,7 @@ const Bi = "readium-cjk-vertical-snapper-style", Y = class Y extends Ot {
4361
4361
  this.patternAnalyzer || (this.patternAnalyzer = new ve(ri), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
4362
4362
  }
4363
4363
  mount(t, e) {
4364
- this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.verticalLR = Fs(t), this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
4364
+ this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.verticalLR = Ds(t), this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
4365
4365
  const i = t.document.createElement("style");
4366
4366
  return i.dataset.readium = "true", i.id = Bi, i.textContent = `
4367
4367
  * {
@@ -4406,7 +4406,7 @@ const Bi = "readium-cjk-vertical-snapper-style", Y = class Y extends Ot {
4406
4406
  }), e.register("go_text", Y.moduleName, (s, n) => {
4407
4407
  let r;
4408
4408
  Array.isArray(s) && (s.length > 1 && (r = s[1]), s = s[0]);
4409
- const a = et.deserialize(s), l = Gt(this.wnd.document, new F({
4409
+ const a = et.deserialize(s), l = Gt(this.wnd.document, new I({
4410
4410
  href: t.location.href,
4411
4411
  type: "text/html",
4412
4412
  text: a,
@@ -4479,7 +4479,7 @@ const ur = [
4479
4479
  Ge,
4480
4480
  dr
4481
4481
  ].map((o) => [o.moduleName, o]));
4482
- class Rt {
4482
+ class At {
4483
4483
  /**
4484
4484
  * @param wnd Window instance to operate on
4485
4485
  * @param initialModules List of initial modules to load
@@ -4740,7 +4740,7 @@ class Vt {
4740
4740
  try {
4741
4741
  this.channelId = window.crypto.randomUUID();
4742
4742
  } catch {
4743
- this.channelId = Fe();
4743
+ this.channelId = De();
4744
4744
  }
4745
4745
  this.gc = setInterval(() => {
4746
4746
  this.registry.forEach((i, s) => {
@@ -4792,7 +4792,7 @@ class Vt {
4792
4792
  * @returns Identifier associated with the message
4793
4793
  */
4794
4794
  send(t, e, i, s = !1, n = []) {
4795
- const r = Fe();
4795
+ const r = De();
4796
4796
  return i && this.registry.set(r, {
4797
4797
  // Add callback to the registry
4798
4798
  cb: i,
@@ -4859,7 +4859,7 @@ class Er {
4859
4859
  }
4860
4860
  return;
4861
4861
  }
4862
- this.comms?.halt(), this.loader.destroy(), this.loader = new Rt(s, t), this.currModules = t, this.comms = void 0;
4862
+ this.comms?.halt(), this.loader.destroy(), this.loader = new At(s, t), this.currModules = t, this.comms = void 0;
4863
4863
  try {
4864
4864
  e(s);
4865
4865
  } catch {
@@ -4868,7 +4868,7 @@ class Er {
4868
4868
  }
4869
4869
  this.frame.onload = () => {
4870
4870
  const s = this.frame.contentWindow;
4871
- this.loader = new Rt(s, t), this.currModules = t;
4871
+ this.loader = new At(s, t), this.currModules = t;
4872
4872
  try {
4873
4873
  e(s);
4874
4874
  } catch {
@@ -4991,7 +4991,7 @@ class Cr {
4991
4991
  const p = t.readingOrder.findWithHref(m);
4992
4992
  if (!p) return;
4993
4993
  if (!this.blobs.has(m)) {
4994
- const P = await new vr(
4994
+ const C = await new vr(
4995
4995
  t,
4996
4996
  this.currentBaseURL || "",
4997
4997
  p,
@@ -5000,7 +5000,7 @@ class Cr {
5000
5000
  injector: this.injector
5001
5001
  }
5002
5002
  ).build();
5003
- this.blobs.set(m, P);
5003
+ this.blobs.set(m, C);
5004
5004
  }
5005
5005
  const y = new Er(this.blobs.get(m), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
5006
5006
  m !== r && await y.hide(), this.container.appendChild(y.iframe), await y.load(i), this.pool.set(m, y);
@@ -5150,10 +5150,10 @@ function _r() {
5150
5150
  break;
5151
5151
  y === 47 && (m = p);
5152
5152
  }
5153
- var P = "";
5153
+ var C = "";
5154
5154
  for (p = a + m + 1; p <= l; ++p)
5155
- (p === l || n.charCodeAt(p) === 47) && (P.length === 0 ? P += ".." : P += "/..");
5156
- return P.length > 0 ? P + r.slice(h + m) : (h += m, r.charCodeAt(h) === 47 && ++h, r.slice(h));
5155
+ (p === l || n.charCodeAt(p) === 47) && (C.length === 0 ? C += ".." : C += "/..");
5156
+ return C.length > 0 ? C + r.slice(h + m) : (h += m, r.charCodeAt(h) === 47 && ++h, r.slice(h));
5157
5157
  },
5158
5158
  _makeLong: function(n) {
5159
5159
  return n;
@@ -5262,18 +5262,18 @@ function Lt(o) {
5262
5262
  const xr = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, Lr = { description: "Attempts to filter out elements that are sized using viewport units and should not be scaled directly e.g. tables, images, iframes, etc.", scope: "RS", value: "readium-experimentalZoom-on" }, kr = {
5263
5263
  experimentalHeaderFiltering: xr,
5264
5264
  experimentalZoom: Lr
5265
- }, Tr = { disabled: [], added: [] }, Or = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, Rr = {
5265
+ }, Tr = { disabled: [], added: [] }, Or = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, Ar = {
5266
5266
  ltr: Tr,
5267
5267
  rtl: Or,
5268
5268
  "cjk-horizontal": { disabled: ["textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] },
5269
5269
  "cjk-vertical": { disabled: ["colCount", "textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] }
5270
- }, Ar = { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 }, Mr = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, Nr = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Ir = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, Dr = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, Fr = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, zr = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Hr = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, Wr = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, Ur = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, Br = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, Vr = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, Xr = { baseFontFamily: "YuGothic, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif", lineHeightCompensation: 1.167 }, $r = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, Yr = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, jr = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, Gr = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, qr = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, Kr = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, Jr = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, Zr = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, Qr = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, to = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, eo = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, io = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, so = {
5271
- latin: Ar,
5270
+ }, Rr = { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 }, Mr = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, Nr = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Ir = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, Fr = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, Dr = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, zr = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Hr = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, Wr = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, Ur = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, Br = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, Vr = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, Xr = { baseFontFamily: "YuGothic, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif", lineHeightCompensation: 1.167 }, $r = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, Yr = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, jr = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, Gr = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, qr = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, Kr = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, Jr = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, Zr = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, Qr = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, to = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, eo = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, io = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, so = {
5271
+ latin: Rr,
5272
5272
  am: Mr,
5273
5273
  ar: Nr,
5274
5274
  bn: Ir,
5275
- bo: Dr,
5276
- chr: Fr,
5275
+ bo: Fr,
5276
+ chr: Dr,
5277
5277
  fa: zr,
5278
5278
  gu: Hr,
5279
5279
  he: Wr,
@@ -5296,7 +5296,7 @@ const xr = { description: "Attempts to filter out paragraphs that are implicitly
5296
5296
  "zh-Hant": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
5297
5297
  "zh-TW": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
5298
5298
  "zh-HK": { baseFontFamily: "'方體', 'PingFang HK', '方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 }
5299
- }, ai = kr, Aa = Rr, Ma = so;
5299
+ }, ai = kr, Ra = Ar, Ma = so;
5300
5300
  var rt = /* @__PURE__ */ ((o) => (o.start = "start", o.left = "left", o.right = "right", o.justify = "justify", o))(rt || {});
5301
5301
  const gt = {
5302
5302
  range: [0, 100],
@@ -5423,7 +5423,7 @@ function ao(o, t) {
5423
5423
  function W(o) {
5424
5424
  return typeof o == "string" ? o : o === null ? null : void 0;
5425
5425
  }
5426
- function E(o) {
5426
+ function P(o) {
5427
5427
  return typeof o == "boolean" || o == null ? o : void 0;
5428
5428
  }
5429
5429
  function Mt(o, t) {
@@ -5454,7 +5454,7 @@ function Ks(o) {
5454
5454
  }
5455
5455
  class Xt {
5456
5456
  constructor(t = {}) {
5457
- this.fontFamily = W(t.fontFamily), this.fontWeight = H(t.fontWeight, dt.range), this.hyphens = E(t.hyphens), this.iOSPatch = E(t.iOSPatch), this.iPadOSPatch = E(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = E(t.ligatures), this.lineHeight = v(t.lineHeight), this.noRuby = E(t.noRuby), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.textAlign = Mt(t.textAlign, rt), this.textNormalization = E(t.textNormalization), this.wordSpacing = v(t.wordSpacing), this.zoom = H(t.zoom, pe.range);
5457
+ this.fontFamily = W(t.fontFamily), this.fontWeight = H(t.fontWeight, dt.range), this.hyphens = P(t.hyphens), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = v(t.lineHeight), this.noRuby = P(t.noRuby), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.textAlign = Mt(t.textAlign, rt), this.textNormalization = P(t.textNormalization), this.wordSpacing = v(t.wordSpacing), this.zoom = H(t.zoom, pe.range);
5458
5458
  }
5459
5459
  static serialize(t) {
5460
5460
  const { ...e } = t;
@@ -5477,7 +5477,7 @@ class Xt {
5477
5477
  }
5478
5478
  class lo {
5479
5479
  constructor(t) {
5480
- this.fontFamily = W(t.fontFamily) || null, this.fontWeight = H(t.fontWeight, dt.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (D.OS.iOS || D.OS.iPadOS) && D.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : D.OS.iPadOS && D.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = Mt(t.textAlign, rt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = H(t.zoom, pe.range) || 1, this.experiments = Ks(t.experiments) ?? null;
5480
+ this.fontFamily = W(t.fontFamily) || null, this.fontWeight = H(t.fontWeight, dt.range) || null, this.hyphens = P(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (D.OS.iOS || D.OS.iPadOS) && D.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : D.OS.iPadOS && D.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = Mt(t.textAlign, rt) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = H(t.zoom, pe.range) || 1, this.experiments = Ks(t.experiments) ?? null;
5481
5481
  }
5482
5482
  }
5483
5483
  class $i {
@@ -5485,7 +5485,7 @@ class $i {
5485
5485
  this.fontFamily = null, this.fontWeight = null, this.hyphens = null, this.iOSPatch = null, this.iPadOSPatch = null, this.letterSpacing = null, this.ligatures = null, this.lineHeight = null, this.noRuby = null, this.paragraphIndent = null, this.paragraphSpacing = null, this.textAlign = null, this.textNormalization = null, this.wordSpacing = null, i && (this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (D.OS.iOS || D.OS.iPadOS) && D.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? D.OS.iPadOS && D.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.textAlign = t.textAlign || e.textAlign || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null), this.zoom = t.zoom !== void 0 ? t.zoom : e.zoom !== void 0 ? e.zoom : null, this.experiments = e.experiments || null;
5486
5486
  }
5487
5487
  }
5488
- class I {
5488
+ class F {
5489
5489
  constructor({
5490
5490
  initialValue: t = null,
5491
5491
  effectiveValue: e,
@@ -5510,7 +5510,7 @@ class I {
5510
5510
  this._value = null;
5511
5511
  }
5512
5512
  }
5513
- class M extends I {
5513
+ class M extends F {
5514
5514
  set value(t) {
5515
5515
  this._value = t, this._onChange(this._value);
5516
5516
  }
@@ -5530,7 +5530,7 @@ class M extends I {
5530
5530
  this._value = !this._value, this._onChange(this._value);
5531
5531
  }
5532
5532
  }
5533
- class li extends I {
5533
+ class li extends F {
5534
5534
  constructor({
5535
5535
  initialValue: t = null,
5536
5536
  effectiveValue: e,
@@ -5561,7 +5561,7 @@ class li extends I {
5561
5561
  this._value = null;
5562
5562
  }
5563
5563
  }
5564
- class k extends I {
5564
+ class k extends F {
5565
5565
  constructor({
5566
5566
  initialValue: t = null,
5567
5567
  effectiveValue: e,
@@ -5627,7 +5627,7 @@ class Yi {
5627
5627
  ) ?? !1;
5628
5628
  }
5629
5629
  get fontFamily() {
5630
- return new I({
5630
+ return new F({
5631
5631
  initialValue: this.preferences.fontFamily,
5632
5632
  effectiveValue: this.settings.fontFamily || null,
5633
5633
  isEffective: this.isDisplayTransformable,
@@ -5962,7 +5962,7 @@ class Qs {
5962
5962
  }
5963
5963
  }
5964
5964
  }
5965
- const Tt = (o) => o.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Dt = (o) => o.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), co = `/*!
5965
+ const Tt = (o) => o.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ft = (o) => o.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), co = `/*!
5966
5966
  * Readium CSS v.2.0.5
5967
5967
  * Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
5968
5968
  * Use of this source code is governed by a BSD-style license which is detailed in the
@@ -6283,7 +6283,7 @@ function po(o) {
6283
6283
  id: "readium-css-webpub",
6284
6284
  as: "link",
6285
6285
  target: "head",
6286
- blob: new Blob([Dt(co)], { type: "text/css" }),
6286
+ blob: new Blob([Ft(co)], { type: "text/css" }),
6287
6287
  rel: "stylesheet"
6288
6288
  }
6289
6289
  ];
@@ -6805,9 +6805,9 @@ class xo extends oi {
6805
6805
  this.listeners.frameLoaded(this.framePool.currentFrames[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation), this._reapplyDecorationsToCurrentFrame();
6806
6806
  break;
6807
6807
  case "first_visible_locator":
6808
- const i = F.deserialize(e);
6808
+ const i = I.deserialize(e);
6809
6809
  if (!i) break;
6810
- this.currentLocation = new F({
6810
+ this.currentLocation = new I({
6811
6811
  href: this.currentLocation.href,
6812
6812
  type: this.currentLocation.type,
6813
6813
  title: this.currentLocation.title,
@@ -6817,7 +6817,7 @@ class xo extends oi {
6817
6817
  break;
6818
6818
  case "text_selected": {
6819
6819
  const l = e;
6820
- l.locator = new F({ href: this.currentLocation.href, type: this.currentLocation.type, text: new et({ highlight: l.text }) }), this.listeners.textSelected(l);
6820
+ l.locator = new I({ href: this.currentLocation.href, type: this.currentLocation.type, text: new et({ highlight: l.text }) }), this.listeners.textSelected(l);
6821
6821
  break;
6822
6822
  }
6823
6823
  case "decoration_activated": {
@@ -7110,7 +7110,7 @@ class xo extends oi {
7110
7110
  if (!e)
7111
7111
  throw new Error("No current resource available");
7112
7112
  const s = this.currentLocation && this.currentLocation.href === e.href && this.currentLocation.locations.progression ? this.currentLocation.locations.progression : 0;
7113
- return this.pub.manifest.locatorFromLink(e) || new F({
7113
+ return this.pub.manifest.locatorFromLink(e) || new I({
7114
7114
  href: e.href,
7115
7115
  type: e.type || "text/html",
7116
7116
  locations: new L({
@@ -7249,7 +7249,7 @@ class nn {
7249
7249
  }
7250
7250
  return;
7251
7251
  }
7252
- this.comms?.halt(), this.loader.destroy(), this.loader = new Rt(s, t), this.currModules = t, this.comms = void 0;
7252
+ this.comms?.halt(), this.loader.destroy(), this.loader = new At(s, t), this.currModules = t, this.comms = void 0;
7253
7253
  try {
7254
7254
  e(s);
7255
7255
  } catch {
@@ -7258,7 +7258,7 @@ class nn {
7258
7258
  }
7259
7259
  this.frame.onload = () => {
7260
7260
  const s = this.frame.contentWindow;
7261
- this.loader = new Rt(s, t), this.currModules = t;
7261
+ this.loader = new At(s, t), this.currModules = t;
7262
7262
  try {
7263
7263
  e(s);
7264
7264
  } catch {
@@ -7369,18 +7369,18 @@ class ko {
7369
7369
  (y > r + Ki || y < r - Ki) && (d.includes(p.href) || d.push(p.href)), y < r + Ji && y > r - Ji && (u.includes(p.href) || u.push(p.href));
7370
7370
  }), d.forEach(async (p) => {
7371
7371
  u.includes(p) || this.pool.has(p) && (await this.pool.get(p)?.destroy(), this.pool.delete(p), this.pendingUpdates.has(p) && this.pendingUpdates.set(p, { inPool: !1 }));
7372
- }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((p) => p.reset()), this.blobs.clear()), this.currentBaseURL = t.baseURL;
7372
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((p) => p.reset()), this.blobs.clear()), this.currentBaseURL = t.baseURL, s && (this.blobs.forEach((p) => p.reset()), this.blobs.clear(), this.pendingUpdates.clear());
7373
7373
  const f = async (p) => {
7374
- if (s && (this.blobs.forEach((P) => P.reset()), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(p) && this.pendingUpdates.get(p)?.inPool === !1) {
7375
- const P = this.blobs.get(p);
7376
- P && (P.reset(), this.blobs.delete(p), this.pendingUpdates.delete(p));
7374
+ if (this.pendingUpdates.has(p) && this.pendingUpdates.get(p)?.inPool === !1) {
7375
+ const C = this.blobs.get(p);
7376
+ C && (C.reset(), this.blobs.delete(p), this.pendingUpdates.delete(p));
7377
7377
  }
7378
7378
  if (this.pool.has(p)) {
7379
- const P = this.pool.get(p);
7379
+ const C = this.pool.get(p);
7380
7380
  if (!this.blobs.has(p))
7381
- await P.destroy(), this.pool.delete(p), this.pendingUpdates.delete(p);
7381
+ await C.destroy(), this.pool.delete(p), this.pendingUpdates.delete(p);
7382
7382
  else {
7383
- await P.load(i);
7383
+ await C.load(i);
7384
7384
  return;
7385
7385
  }
7386
7386
  }
@@ -7408,7 +7408,7 @@ class ko {
7408
7408
  c();
7409
7409
  return;
7410
7410
  }
7411
- Promise.all(u.map(async (p) => {
7411
+ Promise.all(u.filter((p) => p !== a).map(async (p) => {
7412
7412
  const y = f(p);
7413
7413
  this.inprogress.set(p, y), await y, this.inprogress.delete(p);
7414
7414
  }));
@@ -7535,7 +7535,7 @@ class rn {
7535
7535
  };
7536
7536
  }
7537
7537
  }
7538
- class Ro {
7538
+ class Ao {
7539
7539
  constructor() {
7540
7540
  this._DOM = {
7541
7541
  show: !1,
@@ -7554,7 +7554,7 @@ class Ro {
7554
7554
  }
7555
7555
  }
7556
7556
  const Zi = 6, Ie = 1.02, Qi = 50, U = () => typeof window.CSSTransformValue < "u";
7557
- class Ao {
7557
+ class Ro {
7558
7558
  constructor(t, e = !1) {
7559
7559
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
7560
7560
  startX: 0,
@@ -7573,7 +7573,7 @@ class Ao {
7573
7573
  target: { X: 0, Y: 0 },
7574
7574
  touchN: 0,
7575
7575
  startTranslate: { X: 0, Y: 0 }
7576
- }, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.dragTranslate = null, this.dragTransform = null, this.manager = t, this.coordinator = new rn(), this.attachEvents(), e && (this.debugger = new Ro());
7576
+ }, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.dragTranslate = null, this.dragTransform = null, this.manager = t, this.coordinator = new rn(), this.attachEvents(), e && (this.debugger = new Ao());
7577
7577
  }
7578
7578
  get scale() {
7579
7579
  return this._scale;
@@ -7789,7 +7789,7 @@ class Mo {
7789
7789
  }
7790
7790
  return;
7791
7791
  }
7792
- this.comms?.halt(), this.loader.destroy(), this.loader = new Rt(n, t), this.currModules = t, this.comms = void 0;
7792
+ this.comms?.halt(), this.loader.destroy(), this.loader = new At(n, t), this.currModules = t, this.comms = void 0;
7793
7793
  try {
7794
7794
  i(n), this.loadPromise = void 0;
7795
7795
  } catch {
@@ -7798,7 +7798,7 @@ class Mo {
7798
7798
  }
7799
7799
  this.frame.addEventListener("load", () => {
7800
7800
  const n = this.frame.contentWindow;
7801
- this.loader = new Rt(n, t), this.currModules = t, this.peripherals.observe(this.wrapper), this.peripherals.observe(n);
7801
+ this.loader = new At(n, t), this.currModules = t, this.peripherals.observe(this.wrapper), this.peripherals.observe(n);
7802
7802
  try {
7803
7803
  i(n);
7804
7804
  } catch {
@@ -8015,12 +8015,12 @@ class No {
8015
8015
  return this.spreads.find((e) => e.includes(t)) || void 0;
8016
8016
  }
8017
8017
  }
8018
- const ts = 8, es = 5, Io = 300, Do = 15e3, Fo = 250, is = 150, ss = 500;
8018
+ const ts = 8, es = 5, Io = 300, Fo = 15e3, Do = 250, is = 150, ss = 500;
8019
8019
  class zo {
8020
8020
  constructor(t, e, i, s, n, r, a) {
8021
8021
  if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.injector = null, this.width = 0, this.height = 0, this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.bookScale = null, this.bookTranslate = null, this.bookTransform = null, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = r || {}, this.keyboardPeripheralsConfig = a || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || ye.auto, this.pub.metadata.effectiveReadingProgression !== z.rtl && this.pub.metadata.effectiveReadingProgression !== z.ltr)
8022
8022
  throw Error("Unsupported reading progression for fixed-layout EPUB");
8023
- this.spreader = new No(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new Ao(this);
8023
+ this.spreader = new No(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new Ro(this);
8024
8024
  const l = document.createDocumentFragment();
8025
8025
  this.pub.readingOrder.items.forEach((c) => {
8026
8026
  const h = new Mo(this.peripherals, this.pub.metadata.effectiveReadingProgression, c.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
@@ -8050,7 +8050,7 @@ class zo {
8050
8050
  n.update(this.spreadPosition(l, a));
8051
8051
  });
8052
8052
  });
8053
- }, Fo);
8053
+ }, Do);
8054
8054
  }
8055
8055
  /**
8056
8056
  * It is important that these values be cached to avoid spamming them on redraws, they are expensive.
@@ -8249,16 +8249,16 @@ class zo {
8249
8249
  {
8250
8250
  injector: this.injector
8251
8251
  }
8252
- )), this.delayedShow.has(p) || this.delayedShow.set(p, new Promise((P, T) => {
8252
+ )), this.delayedShow.has(p) || this.delayedShow.set(p, new Promise((C, T) => {
8253
8253
  let K = !1;
8254
8254
  const ft = window.setTimeout(async () => {
8255
8255
  this.delayedTimeout.set(p, 0);
8256
8256
  const cn = this.makeSpread(this.reAlign(y)), dn = this.spreadPosition(cn, w), ui = this.pool.get(p);
8257
- await ui.load(i, await this.blobs.get(p).build(!0)), this.peripherals.isScaled || await ui.show(dn), this.delayedShow.delete(p), K = !0, P();
8257
+ await ui.load(i, await this.blobs.get(p).build(!0)), this.peripherals.isScaled || await ui.show(dn), this.delayedShow.delete(p), K = !0, C();
8258
8258
  }, Io);
8259
8259
  setTimeout(() => {
8260
8260
  !K && this.delayedShow.has(p) && T(`Offscreen load timeout: ${p}`);
8261
- }, Do), this.delayedTimeout.set(p, ft);
8261
+ }, Fo), this.delayedTimeout.set(p, ft);
8262
8262
  })));
8263
8263
  };
8264
8264
  try {
@@ -8337,7 +8337,7 @@ class zo {
8337
8337
  }
8338
8338
  class Yt {
8339
8339
  constructor(t = {}) {
8340
- this.backgroundColor = W(t.backgroundColor), this.blendFilter = E(t.blendFilter), this.constraint = v(t.constraint), this.columnCount = v(t.columnCount), this.darkenFilter = kt(t.darkenFilter), this.deprecatedFontSize = E(t.deprecatedFontSize), this.fontFamily = W(t.fontFamily), this.fontSize = H(t.fontSize, oe.range), this.fontSizeNormalize = E(t.fontSizeNormalize), this.fontOpticalSizing = E(t.fontOpticalSizing), this.fontWeight = H(t.fontWeight, dt.range), this.fontWidth = H(t.fontWidth, ae.range), this.hyphens = E(t.hyphens), this.invertFilter = kt(t.invertFilter), this.invertGaijiFilter = kt(t.invertGaijiFilter), this.iOSPatch = E(t.iOSPatch), this.iPadOSPatch = E(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = E(t.ligatures), this.lineHeight = v(t.lineHeight), this.linkColor = W(t.linkColor), this.noRuby = E(t.noRuby), this.pageGutter = v(t.pageGutter), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.scroll = E(t.scroll), this.scrollPaddingTop = v(t.scrollPaddingTop), this.scrollPaddingBottom = v(t.scrollPaddingBottom), this.scrollPaddingLeft = v(t.scrollPaddingLeft), this.scrollPaddingRight = v(t.scrollPaddingRight), this.selectionBackgroundColor = W(t.selectionBackgroundColor), this.selectionTextColor = W(t.selectionTextColor), this.textAlign = Mt(t.textAlign, rt), this.textColor = W(t.textColor), this.textNormalization = E(t.textNormalization), this.visitedColor = W(t.visitedColor), this.wordSpacing = v(t.wordSpacing), this.optimalLineLength = v(t.optimalLineLength), this.maximalLineLength = v(t.maximalLineLength), this.minimalLineLength = v(t.minimalLineLength);
8340
+ this.backgroundColor = W(t.backgroundColor), this.blendFilter = P(t.blendFilter), this.constraint = v(t.constraint), this.columnCount = v(t.columnCount), this.darkenFilter = kt(t.darkenFilter), this.deprecatedFontSize = P(t.deprecatedFontSize), this.fontFamily = W(t.fontFamily), this.fontSize = H(t.fontSize, oe.range), this.fontSizeNormalize = P(t.fontSizeNormalize), this.fontOpticalSizing = P(t.fontOpticalSizing), this.fontWeight = H(t.fontWeight, dt.range), this.fontWidth = H(t.fontWidth, ae.range), this.hyphens = P(t.hyphens), this.invertFilter = kt(t.invertFilter), this.invertGaijiFilter = kt(t.invertGaijiFilter), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = v(t.lineHeight), this.linkColor = W(t.linkColor), this.noRuby = P(t.noRuby), this.pageGutter = v(t.pageGutter), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.scroll = P(t.scroll), this.scrollPaddingTop = v(t.scrollPaddingTop), this.scrollPaddingBottom = v(t.scrollPaddingBottom), this.scrollPaddingLeft = v(t.scrollPaddingLeft), this.scrollPaddingRight = v(t.scrollPaddingRight), this.selectionBackgroundColor = W(t.selectionBackgroundColor), this.selectionTextColor = W(t.selectionTextColor), this.textAlign = Mt(t.textAlign, rt), this.textColor = W(t.textColor), this.textNormalization = P(t.textNormalization), this.visitedColor = W(t.visitedColor), this.wordSpacing = v(t.wordSpacing), this.optimalLineLength = v(t.optimalLineLength), this.maximalLineLength = v(t.maximalLineLength), this.minimalLineLength = v(t.minimalLineLength);
8341
8341
  }
8342
8342
  static serialize(t) {
8343
8343
  const { ...e } = t;
@@ -8360,7 +8360,7 @@ class Yt {
8360
8360
  }
8361
8361
  class Ho {
8362
8362
  constructor(t) {
8363
- this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = kt(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = H(t.fontSize, oe.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = H(t.fontWeight, dt.range) || null, this.fontWidth = H(t.fontWidth, ae.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = kt(t.invertFilter) ?? !1, this.invertGaijiFilter = kt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (D.OS.iOS || D.OS.iPadOS) && D.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : D.OS.iPadOS && D.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = Ne(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = Mt(t.textAlign, rt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = Ne(ao(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = Ne(oo(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = Ks(t.experiments) || null;
8363
+ this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = kt(t.darkenFilter) ?? !1, this.deprecatedFontSize = P(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = H(t.fontSize, oe.range) || 1, this.fontSizeNormalize = P(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = P(t.fontOpticalSizing) ?? null, this.fontWeight = H(t.fontWeight, dt.range) || null, this.fontWidth = H(t.fontWidth, ae.range) || null, this.hyphens = P(t.hyphens) ?? null, this.invertFilter = kt(t.invertFilter) ?? !1, this.invertGaijiFilter = kt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (D.OS.iOS || D.OS.iPadOS) && D.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : D.OS.iPadOS && D.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = P(t.noRuby) ?? !1, this.pageGutter = Ne(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = P(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = Mt(t.textAlign, rt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = Ne(ao(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = Ne(oo(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = Ks(t.experiments) || null;
8364
8364
  }
8365
8365
  }
8366
8366
  const Wo = "#FFFFFF", Uo = "#121212", Bo = "#0000EE", Vo = "#551A8B", Xo = "#b4d8fe", $o = "inherit", bt = {
@@ -8382,7 +8382,7 @@ class ns {
8382
8382
  this.preferences[t] = e;
8383
8383
  }
8384
8384
  get backgroundColor() {
8385
- return new I({
8385
+ return new F({
8386
8386
  initialValue: this.preferences.backgroundColor,
8387
8387
  effectiveValue: this.settings.backgroundColor || bt.backgroundColor,
8388
8388
  isEffective: this.preferences.backgroundColor !== null,
@@ -8402,7 +8402,7 @@ class ns {
8402
8402
  });
8403
8403
  }
8404
8404
  get columnCount() {
8405
- return new I({
8405
+ return new F({
8406
8406
  initialValue: this.preferences.columnCount,
8407
8407
  effectiveValue: this.settings.columnCount || null,
8408
8408
  isEffective: this.layout !== S.fixed && !this.settings.scroll,
@@ -8412,7 +8412,7 @@ class ns {
8412
8412
  });
8413
8413
  }
8414
8414
  get constraint() {
8415
- return new I({
8415
+ return new F({
8416
8416
  initialValue: this.preferences.constraint,
8417
8417
  effectiveValue: this.preferences.constraint || 0,
8418
8418
  isEffective: !0,
@@ -8444,7 +8444,7 @@ class ns {
8444
8444
  });
8445
8445
  }
8446
8446
  get fontFamily() {
8447
- return new I({
8447
+ return new F({
8448
8448
  initialValue: this.preferences.fontFamily,
8449
8449
  effectiveValue: this.settings.fontFamily || null,
8450
8450
  isEffective: this.layout !== S.fixed,
@@ -8603,7 +8603,7 @@ class ns {
8603
8603
  });
8604
8604
  }
8605
8605
  get linkColor() {
8606
- return new I({
8606
+ return new F({
8607
8607
  initialValue: this.preferences.linkColor,
8608
8608
  effectiveValue: this.settings.linkColor || bt.linkColor,
8609
8609
  isEffective: this.layout !== S.fixed && this.preferences.linkColor !== null,
@@ -8659,7 +8659,7 @@ class ns {
8659
8659
  });
8660
8660
  }
8661
8661
  get pageGutter() {
8662
- return new I({
8662
+ return new F({
8663
8663
  initialValue: this.preferences.pageGutter,
8664
8664
  effectiveValue: this.settings.pageGutter,
8665
8665
  isEffective: this.layout !== S.fixed && !this.settings.scroll,
@@ -8703,7 +8703,7 @@ class ns {
8703
8703
  });
8704
8704
  }
8705
8705
  get scrollPaddingTop() {
8706
- return new I({
8706
+ return new F({
8707
8707
  initialValue: this.preferences.scrollPaddingTop,
8708
8708
  effectiveValue: this.settings.scrollPaddingTop || 0,
8709
8709
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
@@ -8713,7 +8713,7 @@ class ns {
8713
8713
  });
8714
8714
  }
8715
8715
  get scrollPaddingBottom() {
8716
- return new I({
8716
+ return new F({
8717
8717
  initialValue: this.preferences.scrollPaddingBottom,
8718
8718
  effectiveValue: this.settings.scrollPaddingBottom || 0,
8719
8719
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
@@ -8723,7 +8723,7 @@ class ns {
8723
8723
  });
8724
8724
  }
8725
8725
  get scrollPaddingLeft() {
8726
- return new I({
8726
+ return new F({
8727
8727
  initialValue: this.preferences.scrollPaddingLeft,
8728
8728
  effectiveValue: this.settings.scrollPaddingLeft || 0,
8729
8729
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
@@ -8733,7 +8733,7 @@ class ns {
8733
8733
  });
8734
8734
  }
8735
8735
  get scrollPaddingRight() {
8736
- return new I({
8736
+ return new F({
8737
8737
  initialValue: this.preferences.scrollPaddingRight,
8738
8738
  effectiveValue: this.settings.scrollPaddingRight || 0,
8739
8739
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
@@ -8743,7 +8743,7 @@ class ns {
8743
8743
  });
8744
8744
  }
8745
8745
  get selectionBackgroundColor() {
8746
- return new I({
8746
+ return new F({
8747
8747
  initialValue: this.preferences.selectionBackgroundColor,
8748
8748
  effectiveValue: this.settings.selectionBackgroundColor || bt.selectionBackgroundColor,
8749
8749
  isEffective: this.layout !== S.fixed && this.preferences.selectionBackgroundColor !== null,
@@ -8753,7 +8753,7 @@ class ns {
8753
8753
  });
8754
8754
  }
8755
8755
  get selectionTextColor() {
8756
- return new I({
8756
+ return new F({
8757
8757
  initialValue: this.preferences.selectionTextColor,
8758
8758
  effectiveValue: this.settings.selectionTextColor || bt.selectionTextColor,
8759
8759
  isEffective: this.layout !== S.fixed && this.preferences.selectionTextColor !== null,
@@ -8774,7 +8774,7 @@ class ns {
8774
8774
  });
8775
8775
  }
8776
8776
  get textColor() {
8777
- return new I({
8777
+ return new F({
8778
8778
  initialValue: this.preferences.textColor,
8779
8779
  effectiveValue: this.settings.textColor || bt.textColor,
8780
8780
  isEffective: this.layout !== S.fixed && this.preferences.textColor !== null,
@@ -8794,7 +8794,7 @@ class ns {
8794
8794
  });
8795
8795
  }
8796
8796
  get visitedColor() {
8797
- return new I({
8797
+ return new F({
8798
8798
  initialValue: this.preferences.visitedColor,
8799
8799
  effectiveValue: this.settings.visitedColor || bt.visitedColor,
8800
8800
  isEffective: this.layout !== S.fixed && this.preferences.visitedColor !== null,
@@ -9132,7 +9132,7 @@ async function Ko(o, t) {
9132
9132
  id: "readium-css-before",
9133
9133
  as: "link",
9134
9134
  target: "head",
9135
- blob: new Blob([Dt(l)], { type: "text/css" }),
9135
+ blob: new Blob([Ft(l)], { type: "text/css" }),
9136
9136
  rel: "stylesheet"
9137
9137
  }), r.unshift(
9138
9138
  // Readium CSS Default - only for reflowable AND no existing styles
@@ -9140,7 +9140,7 @@ async function Ko(o, t) {
9140
9140
  id: "readium-css-default",
9141
9141
  as: "link",
9142
9142
  target: "head",
9143
- blob: new Blob([Dt(c)], { type: "text/css" }),
9143
+ blob: new Blob([Ft(c)], { type: "text/css" }),
9144
9144
  rel: "stylesheet",
9145
9145
  condition: (d) => !(d.querySelector("link[rel='stylesheet']") || d.querySelector("style") || d.querySelector("[style]:not([style=''])"))
9146
9146
  },
@@ -9149,7 +9149,7 @@ async function Ko(o, t) {
9149
9149
  id: "readium-css-after",
9150
9150
  as: "link",
9151
9151
  target: "head",
9152
- blob: new Blob([Dt(h)], { type: "text/css" }),
9152
+ blob: new Blob([Ft(h)], { type: "text/css" }),
9153
9153
  rel: "stylesheet"
9154
9154
  }
9155
9155
  ), (a === "cjk-horizontal" || a === "cjk-vertical") && (o.description === "ebpaj-guide-1.0" || o.otherMetadata?.["ebpaj:guide-version"] !== void 0)) {
@@ -9158,7 +9158,7 @@ async function Ko(o, t) {
9158
9158
  id: "readium-css-ebpaj",
9159
9159
  as: "link",
9160
9160
  target: "head",
9161
- blob: new Blob([Dt(u)], { type: "text/css" }),
9161
+ blob: new Blob([Ft(u)], { type: "text/css" }),
9162
9162
  rel: "stylesheet"
9163
9163
  });
9164
9164
  }
@@ -9369,9 +9369,9 @@ class an extends oi {
9369
9369
  this._reapplyDecorationsToCurrentFrames();
9370
9370
  break;
9371
9371
  case "first_visible_locator":
9372
- const s = F.deserialize(e);
9372
+ const s = I.deserialize(e);
9373
9373
  if (!s) break;
9374
- this.currentLocation = new F({
9374
+ this.currentLocation = new I({
9375
9375
  href: this.currentLocation.href,
9376
9376
  type: this.currentLocation.type,
9377
9377
  title: this.currentLocation.title,
@@ -9385,7 +9385,7 @@ class an extends oi {
9385
9385
  const d = this._cframes.filter((f) => !!f).indexOf(i), u = d >= 0 ? this.viewport.readingOrder[d] : void 0;
9386
9386
  if (u) {
9387
9387
  const f = this.pub.readingOrder.findWithHref(u);
9388
- c.locator = new F({ href: u, type: f.type || "application/xhtml+xml", text: new et({ highlight: c.text }) });
9388
+ c.locator = new I({ href: u, type: f.type || "application/xhtml+xml", text: new et({ highlight: c.text }) });
9389
9389
  }
9390
9390
  }
9391
9391
  this.listeners.textSelected(c);
@@ -10900,7 +10900,7 @@ const be = {
10900
10900
  };
10901
10901
  class jt {
10902
10902
  constructor(t = {}) {
10903
- this.backgroundColor = W(t.backgroundColor), this.constraint = v(t.constraint), this.quality = Mt(t.quality, nt), this.scrolled = E(t.scrolled), this.spreads = E(t.spreads), this.stripWidth = H(t.stripWidth, be.range);
10903
+ this.backgroundColor = W(t.backgroundColor), this.constraint = v(t.constraint), this.quality = Mt(t.quality, nt), this.scrolled = P(t.scrolled), this.spreads = P(t.spreads), this.stripWidth = H(t.stripWidth, be.range);
10904
10904
  }
10905
10905
  static serialize(t) {
10906
10906
  const { ...e } = t;
@@ -10923,7 +10923,7 @@ class jt {
10923
10923
  }
10924
10924
  class va {
10925
10925
  constructor(t) {
10926
- this.backgroundColor = W(t.backgroundColor) || null, this.constraint = v(t.constraint) || 0, this.quality = Mt(t.quality, nt) || nt.auto, this.scrolled = E(t.scrolled) ?? null, this.spreads = E(t.spreads) ?? !0, this.stripWidth = H(t.stripWidth, be.range) || 1e3;
10926
+ this.backgroundColor = W(t.backgroundColor) || null, this.constraint = v(t.constraint) || 0, this.quality = Mt(t.quality, nt) || nt.auto, this.scrolled = P(t.scrolled) ?? null, this.spreads = P(t.spreads) ?? !0, this.stripWidth = H(t.stripWidth, be.range) || 720;
10927
10927
  }
10928
10928
  }
10929
10929
  class Ss {
@@ -10950,7 +10950,7 @@ class ws {
10950
10950
  return this.metadata.effectiveLayout === S.scrolled;
10951
10951
  }
10952
10952
  get backgroundColor() {
10953
- return new I({
10953
+ return new F({
10954
10954
  initialValue: this.preferences.backgroundColor,
10955
10955
  effectiveValue: this.settings.backgroundColor,
10956
10956
  isEffective: !0,
@@ -11590,7 +11590,7 @@ class ci {
11590
11590
  }
11591
11591
  class Ca {
11592
11592
  constructor(t) {
11593
- this.audioContext = null, this.sourceNode = null, this.gainNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.isStoppedValue = !1, this.worklet = null, this.webAudioActive = !1, this.boundOnCanPlayThrough = this.onCanPlayThrough.bind(this), this.boundOnTimeUpdate = this.onTimeUpdate.bind(this), this.boundOnError = this.onError.bind(this), this.boundOnEnded = this.onEnded.bind(this), this.boundOnStalled = this.onStalled.bind(this), this.boundOnEmptied = this.onEmptied.bind(this), this.boundOnSuspend = this.onSuspend.bind(this), this.boundOnWaiting = this.onWaiting.bind(this), this.boundOnLoadedMetadata = this.onLoadedMetadata.bind(this), this.boundOnSeeking = this.onSeeking.bind(this), this.boundOnSeeked = this.onSeeked.bind(this), this.boundOnPlay = this.onPlay.bind(this), this.boundOnPlaying = this.onPlaying.bind(this), this.boundOnPause = this.onPause.bind(this), this.boundOnProgress = this.onProgress.bind(this), this.playback = t.playback, this.mediaElement = document.createElement("audio"), this.mediaElement.addEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.addEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.addEventListener("error", this.boundOnError), this.mediaElement.addEventListener("ended", this.boundOnEnded), this.mediaElement.addEventListener("stalled", this.boundOnStalled), this.mediaElement.addEventListener("emptied", this.boundOnEmptied), this.mediaElement.addEventListener("suspend", this.boundOnSuspend), this.mediaElement.addEventListener("waiting", this.boundOnWaiting), this.mediaElement.addEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.addEventListener("seeking", this.boundOnSeeking), this.mediaElement.addEventListener("seeked", this.boundOnSeeked), this.mediaElement.addEventListener("play", this.boundOnPlay), this.mediaElement.addEventListener("playing", this.boundOnPlaying), this.mediaElement.addEventListener("pause", this.boundOnPause), this.mediaElement.addEventListener("progress", this.boundOnProgress), this.mediaElement.currentTime = this.playback.state.currentTime;
11593
+ this.audioContext = null, this.sourceNode = null, this.gainNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.isStoppedValue = !1, this.worklet = null, this.webAudioActive = !1, this.mseLoader = null, this.currentHref = "", this.boundOnCanPlayThrough = this.onCanPlayThrough.bind(this), this.boundOnTimeUpdate = this.onTimeUpdate.bind(this), this.boundOnError = this.onError.bind(this), this.boundOnEnded = this.onEnded.bind(this), this.boundOnStalled = this.onStalled.bind(this), this.boundOnEmptied = this.onEmptied.bind(this), this.boundOnSuspend = this.onSuspend.bind(this), this.boundOnWaiting = this.onWaiting.bind(this), this.boundOnLoadedMetadata = this.onLoadedMetadata.bind(this), this.boundOnSeeking = this.onSeeking.bind(this), this.boundOnSeeked = this.onSeeked.bind(this), this.boundOnPlay = this.onPlay.bind(this), this.boundOnPlaying = this.onPlaying.bind(this), this.boundOnPause = this.onPause.bind(this), this.boundOnProgress = this.onProgress.bind(this), this.playback = t.playback, this.mseLoaderFactory = t.mseLoaderFactory ?? null, this.mediaElement = document.createElement("audio"), this.mediaElement.addEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.addEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.addEventListener("error", this.boundOnError), this.mediaElement.addEventListener("ended", this.boundOnEnded), this.mediaElement.addEventListener("stalled", this.boundOnStalled), this.mediaElement.addEventListener("emptied", this.boundOnEmptied), this.mediaElement.addEventListener("suspend", this.boundOnSuspend), this.mediaElement.addEventListener("waiting", this.boundOnWaiting), this.mediaElement.addEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.addEventListener("seeking", this.boundOnSeeking), this.mediaElement.addEventListener("seeked", this.boundOnSeeked), this.mediaElement.addEventListener("play", this.boundOnPlay), this.mediaElement.addEventListener("playing", this.boundOnPlaying), this.mediaElement.addEventListener("pause", this.boundOnPause), this.mediaElement.addEventListener("progress", this.boundOnProgress), this.mediaElement.currentTime = this.playback.state.currentTime;
11594
11594
  }
11595
11595
  /**
11596
11596
  * Adds an event listener to the audio engine.
@@ -11789,6 +11789,12 @@ class Ca {
11789
11789
  */
11790
11790
  async activateWebAudio() {
11791
11791
  if (this.webAudioActive) return;
11792
+ if (this.usesMse) {
11793
+ this.sourceNode = new MediaElementAudioSourceNode(this.getOrCreateAudioContext(), { mediaElement: this.mediaElement });
11794
+ const n = this.getOrCreateAudioContext();
11795
+ this.gainNode = n.createGain(), this.gainNode.gain.value = this.mediaElement.volume, this.mediaElement.volume = 1, this.sourceNode.connect(this.gainNode), this.gainNode.connect(n.destination), this.webAudioActive = !0;
11796
+ return;
11797
+ }
11792
11798
  const t = this.mediaElement.src;
11793
11799
  if (!t) return;
11794
11800
  const e = this.mediaElement.currentTime, i = this.isPlayingValue;
@@ -11817,6 +11823,10 @@ class Ca {
11817
11823
  get isWebAudioActive() {
11818
11824
  return this.webAudioActive;
11819
11825
  }
11826
+ /** True when this engine streams media through Media Source Extensions. */
11827
+ get usesMse() {
11828
+ return this.mseLoaderFactory !== null;
11829
+ }
11820
11830
  /**
11821
11831
  * Tears down the Web Audio graph and restores the media element to standalone
11822
11832
  * playback. Safe to call even if Web Audio was never activated.
@@ -11832,20 +11842,25 @@ class Ca {
11832
11842
  * the required headers), the graph is torn down and the src is reloaded
11833
11843
  * without CORS so playback continues — just without pitch correction.
11834
11844
  */
11835
- changeSrc(t) {
11836
- if (this.mediaElement.src !== t)
11837
- if (this.mediaElement.pause(), this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadedValue = !1, this.isLoadingValue = !0, this.isEndedValue = !1, this.webAudioActive) {
11845
+ changeSrc(t, e) {
11846
+ if (!(this.currentHref === t || this.mediaElement.src === t)) {
11847
+ if (this.currentHref = t, this.mediaElement.pause(), this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadedValue = !1, this.isLoadingValue = !0, this.isEndedValue = !1, this.mseLoaderFactory) {
11848
+ this.mseLoader?.destroy(), this.mseLoader = this.mseLoaderFactory(this.mediaElement, t, e), this.mseLoader.start();
11849
+ return;
11850
+ }
11851
+ if (this.webAudioActive) {
11838
11852
  this.mediaElement.crossOrigin = "anonymous", this.mediaElement.src = t, this.mediaElement.load();
11839
- const e = () => {
11840
- s();
11841
- }, i = () => {
11842
- s(), console.warn("CORS reload failed for new track — disabling Web Audio graph:", t), this.tearDownWebAudio(), this.mediaElement.removeAttribute("crossorigin"), this.mediaElement.src = t, this.mediaElement.load();
11853
+ const i = () => {
11854
+ n();
11843
11855
  }, s = () => {
11844
- this.mediaElement.removeEventListener("canplaythrough", e), this.mediaElement.removeEventListener("error", i);
11856
+ n(), console.warn("CORS reload failed for new track — disabling Web Audio graph:", t), this.tearDownWebAudio(), this.mediaElement.removeAttribute("crossorigin"), this.mediaElement.src = t, this.mediaElement.load();
11857
+ }, n = () => {
11858
+ this.mediaElement.removeEventListener("canplaythrough", i), this.mediaElement.removeEventListener("error", s);
11845
11859
  };
11846
- this.mediaElement.addEventListener("canplaythrough", e), this.mediaElement.addEventListener("error", i);
11860
+ this.mediaElement.addEventListener("canplaythrough", i), this.mediaElement.addEventListener("error", s);
11847
11861
  } else
11848
11862
  this.mediaElement.src = t, this.mediaElement.load();
11863
+ }
11849
11864
  }
11850
11865
  /**
11851
11866
  * Returns the HTML media element used for playback.
@@ -11853,10 +11868,17 @@ class Ca {
11853
11868
  getMediaElement() {
11854
11869
  return this.mediaElement;
11855
11870
  }
11871
+ /**
11872
+ * Releases loader resources (in-flight fetches, MediaSource object URL).
11873
+ * The media element itself is left intact.
11874
+ */
11875
+ destroy() {
11876
+ this.mseLoader?.destroy(), this.mseLoader = null;
11877
+ }
11856
11878
  }
11857
11879
  class xe {
11858
11880
  constructor(t = {}) {
11859
- this.volume = H(t.volume, fe.range), this.playbackRate = H(t.playbackRate, me.range), this.preservePitch = E(t.preservePitch), this.skipBackwardInterval = H(t.skipBackwardInterval, ht.range), this.skipForwardInterval = H(t.skipForwardInterval, ht.range), this.pollInterval = v(t.pollInterval), this.autoPlay = E(t.autoPlay), this.enableMediaSession = E(t.enableMediaSession);
11881
+ this.volume = H(t.volume, fe.range), this.playbackRate = H(t.playbackRate, me.range), this.preservePitch = P(t.preservePitch), this.skipBackwardInterval = H(t.skipBackwardInterval, ht.range), this.skipForwardInterval = H(t.skipForwardInterval, ht.range), this.pollInterval = v(t.pollInterval), this.autoPlay = P(t.autoPlay), this.enableMediaSession = P(t.enableMediaSession);
11860
11882
  }
11861
11883
  merging(t) {
11862
11884
  const e = { ...this };
@@ -11867,7 +11889,7 @@ class xe {
11867
11889
  }
11868
11890
  class _a {
11869
11891
  constructor(t = {}) {
11870
- this.volume = H(t.volume, fe.range) ?? 1, this.playbackRate = H(t.playbackRate, me.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = H(t.skipBackwardInterval, ht.range) ?? 10, this.skipForwardInterval = H(t.skipForwardInterval, ht.range) ?? 10, this.pollInterval = v(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
11892
+ this.volume = H(t.volume, fe.range) ?? 1, this.playbackRate = H(t.playbackRate, me.range) ?? 1, this.preservePitch = P(t.preservePitch) ?? !0, this.skipBackwardInterval = H(t.skipBackwardInterval, ht.range) ?? 10, this.skipForwardInterval = H(t.skipForwardInterval, ht.range) ?? 10, this.pollInterval = v(t.pollInterval) ?? 1e3, this.autoPlay = P(t.autoPlay) ?? !0, this.enableMediaSession = P(t.enableMediaSession) ?? !0;
11871
11893
  }
11872
11894
  }
11873
11895
  class vs {
@@ -11944,7 +11966,7 @@ class Ps {
11944
11966
  });
11945
11967
  }
11946
11968
  get pollInterval() {
11947
- return new I({
11969
+ return new F({
11948
11970
  initialValue: this.preferences.pollInterval,
11949
11971
  effectiveValue: this.settings.pollInterval,
11950
11972
  isEffective: this.preferences.pollInterval !== null,
@@ -12001,10 +12023,10 @@ class xa {
12001
12023
  const r = this._supportedAudioTypes.get(n.type);
12002
12024
  if (!r) continue;
12003
12025
  const a = n.toURL(e) ?? n.href;
12004
- if (r === "probably") return a;
12005
- s || (s = { href: a, confidence: r });
12026
+ if (r === "probably") return { href: a, type: n.type };
12027
+ s || (s = { href: a, type: n.type, confidence: r });
12006
12028
  }
12007
- return s?.href ?? t.toURL(e) ?? t.href;
12029
+ return s ? { href: s.href, type: s.type } : { href: t.toURL(e) ?? t.href, type: t.type };
12008
12030
  }
12009
12031
  get audioEngine() {
12010
12032
  return this._audioEngine;
@@ -12023,10 +12045,11 @@ class xa {
12023
12045
  * The current track is excluded — the primary engine element represents it.
12024
12046
  */
12025
12047
  update(t) {
12048
+ if (this._audioEngine.usesMse) return;
12026
12049
  const e = this._publication.readingOrder.items, i = /* @__PURE__ */ new Set();
12027
12050
  for (let s = 0; s < e.length; s++) {
12028
12051
  if (s === t) continue;
12029
- const n = this.pickPlayableHref(e[s]);
12052
+ const { href: n } = this.pickPlayableHref(e[s]);
12030
12053
  s >= t - Cs && s <= t + Cs ? (this.ensure(n), i.add(n)) : s >= t - Es && s <= t + Es && this.pool.has(n) && i.add(n);
12031
12054
  }
12032
12055
  for (const [s, n] of this.pool)
@@ -12038,15 +12061,15 @@ class xa {
12038
12061
  * session and any Web Audio graph connections across track changes.
12039
12062
  */
12040
12063
  setCurrentAudio(t, e) {
12041
- const i = this.pickPlayableHref(this._publication.readingOrder.items[t]);
12042
- if (this.audioEngine.changeSrc(i), this.pool.has(i)) {
12043
- const s = this.pool.get(i);
12044
- s.removeAttribute("src"), s.load(), this.pool.delete(i);
12064
+ const { href: i, type: s } = this.pickPlayableHref(this._publication.readingOrder.items[t]);
12065
+ if (this.audioEngine.changeSrc(i, s), this.pool.has(i)) {
12066
+ const n = this.pool.get(i);
12067
+ n.removeAttribute("src"), n.load(), this.pool.delete(i);
12045
12068
  }
12046
12069
  this.update(t);
12047
12070
  }
12048
12071
  destroy() {
12049
- this.audioEngine.stop();
12072
+ this.audioEngine.stop(), this.audioEngine.destroy();
12050
12073
  for (const [, t] of this.pool)
12051
12074
  t.removeAttribute("src"), t.load();
12052
12075
  this.pool.clear();
@@ -12103,21 +12126,21 @@ const ka = (o) => ({
12103
12126
  remotePlaybackStateChanged: o.remotePlaybackStateChanged ?? (() => {
12104
12127
  })
12105
12128
  });
12106
- class Da extends Sr {
12129
+ class Fa extends Sr {
12107
12130
  constructor(t, e, i, s = {
12108
12131
  preferences: {},
12109
12132
  defaults: {}
12110
12133
  }) {
12111
- if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners = ka(e), this._preferences = new xe(s.preferences), this._defaults = new _a(s.defaults), this._settings = new vs(this._preferences, this._defaults), t.readingOrder.items.length === 0)
12134
+ if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._destroyed = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners = ka(e), this._preferences = new xe(s.preferences), this._defaults = new _a(s.defaults), this._settings = new vs(this._preferences, this._defaults), t.readingOrder.items.length === 0)
12112
12135
  throw new Error("AudioNavigator: publication has an empty reading order");
12113
12136
  if (i)
12114
12137
  this.currentLocation = this.ensureLocatorLocations(i);
12115
12138
  else {
12116
- const d = this.pub.readingOrder.items[0];
12117
- this.currentLocation = new F({
12118
- href: d.href,
12119
- type: d.type || "audio/mpeg",
12120
- title: d.title,
12139
+ const u = this.pub.readingOrder.items[0];
12140
+ this.currentLocation = new I({
12141
+ href: u.href,
12142
+ type: u.type || "audio/mpeg",
12143
+ title: u.title,
12121
12144
  locations: new L({
12122
12145
  position: 1,
12123
12146
  progression: 0,
@@ -12126,9 +12149,16 @@ class Da extends Sr {
12126
12149
  })
12127
12150
  });
12128
12151
  }
12129
- const n = this.currentLocation.href.split("#")[0], r = this.hrefToTrackIndex(n);
12130
- if (r === -1)
12131
- throw new Error(`AudioNavigator: initial href "${n}" not found in reading order`);
12152
+ const n = this.currentLocation.href.split("#")[0];
12153
+ let r = this.hrefToTrackIndex(n);
12154
+ if (r === -1) {
12155
+ const u = this.currentLocation.locations?.totalProgression;
12156
+ if (u !== void 0) {
12157
+ const f = this.locatorFromTotalProgression(u);
12158
+ this.currentLocation = f.locator, r = f.trackIndex;
12159
+ } else
12160
+ throw new Error(`AudioNavigator: initial href "${n}" not found in reading order`);
12161
+ }
12132
12162
  const a = this.currentLocation.locations?.time() || 0, l = new Ca({
12133
12163
  playback: {
12134
12164
  state: {
@@ -12137,7 +12167,8 @@ class Da extends Sr {
12137
12167
  },
12138
12168
  playWhenReady: !1,
12139
12169
  index: r
12140
- }
12170
+ },
12171
+ mseLoaderFactory: s.mseLoaderFactory
12141
12172
  });
12142
12173
  this.pool = new xa(l, t, s.contentProtection);
12143
12174
  const c = s.contentProtection || {};
@@ -12146,16 +12177,24 @@ class Da extends Sr {
12146
12177
  c,
12147
12178
  s.keyboardPeripherals || []
12148
12179
  );
12149
- (c.disableContextMenu || c.checkAutomation || c.checkIFrameEmbedding || c.monitorDevTools || c.protectPrinting?.disable || c.disableDragAndDrop || c.protectCopy) && (this._navigatorProtector = new La(c), this._suspiciousActivityListener = (d) => {
12150
- const { type: u, ...f } = d.detail;
12151
- u === "context_menu" ? this.listeners.contextMenu(f) : this.listeners.contentProtection(u, f);
12152
- }, window.addEventListener(ot, this._suspiciousActivityListener)), h.length > 0 && (this._keyboardPeripheralsManager = new _e({ keyboardPeripherals: h }), this._keyboardPeripheralListener = (d) => {
12153
- this.listeners.peripheral(d.detail);
12154
- }, window.addEventListener(at, this._keyboardPeripheralListener)), this.setupEventListeners(), this._isNavigating = !0, this.pool.setCurrentAudio(r, "forward"), this.applyPreferences(), this.waitForLoadedAndSeeked(a).then(() => {
12180
+ (c.disableContextMenu || c.checkAutomation || c.checkIFrameEmbedding || c.monitorDevTools || c.protectPrinting?.disable || c.disableDragAndDrop || c.protectCopy) && (this._navigatorProtector = new La(c), this._suspiciousActivityListener = (u) => {
12181
+ const { type: f, ...m } = u.detail;
12182
+ f === "context_menu" ? this.listeners.contextMenu(m) : this.listeners.contentProtection(f, m);
12183
+ }, window.addEventListener(ot, this._suspiciousActivityListener)), h.length > 0 && (this._keyboardPeripheralsManager = new _e({ keyboardPeripherals: h }), this._keyboardPeripheralListener = (u) => {
12184
+ this.listeners.peripheral(u.detail);
12185
+ }, window.addEventListener(at, this._keyboardPeripheralListener)), this.setupEventListeners(), this._isNavigating = !0;
12186
+ const d = () => this.startInitialLoad(r, a);
12187
+ s.mediaElementSetup ? Promise.resolve().then(() => s.mediaElementSetup(this.pool.audioEngine.getMediaElement())).catch((u) => {
12188
+ this.listeners.error(u, this.currentLocator);
12189
+ }).then(d) : d();
12190
+ }
12191
+ /** Sets the initial track on the primary element and seeks to the starting position. */
12192
+ startInitialLoad(t, e) {
12193
+ this._destroyed || (this.pool.setCurrentAudio(t, "forward"), this.applyPreferences(), this.waitForLoadedAndSeeked(e).then(() => {
12155
12194
  this._isNavigating = !1, this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this._notifyTimelineChange(this.currentLocator), this.listeners.positionChanged(this.currentLocator), this._setupRemotePlayback();
12156
12195
  }).catch(() => {
12157
12196
  this._isNavigating = !1;
12158
- });
12197
+ }));
12159
12198
  }
12160
12199
  get settings() {
12161
12200
  return this._settings;
@@ -12180,7 +12219,7 @@ class Da extends Sr {
12180
12219
  e !== this._currentTimelineItem && (this._currentTimelineItem = e, this.listeners.timelineItemChanged(e), this._settings.enableMediaSession && this.updateMediaSessionMetadata());
12181
12220
  }
12182
12221
  ensureLocatorLocations(t) {
12183
- return new F({
12222
+ return new I({
12184
12223
  ...t,
12185
12224
  locations: t.locations instanceof L ? t.locations : t.locations ? new L(t.locations) : void 0
12186
12225
  });
@@ -12194,6 +12233,41 @@ class Da extends Sr {
12194
12233
  currentTrackIndex() {
12195
12234
  return this.hrefToTrackIndex(this.currentLocation.href);
12196
12235
  }
12236
+ /**
12237
+ * Builds a locator for an overall publication progression (0–1) by walking
12238
+ * the cumulative track durations. Falls back to the start of the first
12239
+ * track when the reading order carries no duration metadata.
12240
+ */
12241
+ locatorFromTotalProgression(t) {
12242
+ const e = this.pub.readingOrder.items, i = e.map((l) => l.duration ?? 0), s = i.reduce((l, c) => l + c, 0);
12243
+ let n = 0, r = 0;
12244
+ if (s > 0) {
12245
+ let l = Math.min(Math.max(t, 0), 1) * s;
12246
+ for (let c = 0; c < i.length; c++) {
12247
+ if (n = c, l <= i[c] || c === i.length - 1) {
12248
+ r = l;
12249
+ break;
12250
+ }
12251
+ l -= i[c];
12252
+ }
12253
+ }
12254
+ const a = e[n];
12255
+ return {
12256
+ trackIndex: n,
12257
+ locator: new I({
12258
+ href: a.href,
12259
+ type: a.type || "",
12260
+ // Should have a mimetype
12261
+ title: a.title,
12262
+ locations: new L({
12263
+ position: n + 1,
12264
+ progression: i[n] > 0 ? r / i[n] : 0,
12265
+ totalProgression: Math.min(Math.max(t, 0), 1),
12266
+ fragments: [`t=${r}`]
12267
+ })
12268
+ })
12269
+ };
12270
+ }
12197
12271
  get currentLocator() {
12198
12272
  return this.currentLocation;
12199
12273
  }
@@ -12213,7 +12287,7 @@ class Da extends Sr {
12213
12287
  const i = this.pub.readingOrder.items[t];
12214
12288
  if (!i) throw new Error(`Invalid track index: ${t}`);
12215
12289
  const s = this.pool.audioEngine.duration();
12216
- return new F({
12290
+ return new I({
12217
12291
  href: i.href,
12218
12292
  type: i.type || "audio/mpeg",
12219
12293
  title: i.title,
@@ -12261,11 +12335,15 @@ class Da extends Sr {
12261
12335
  this.pool.audioEngine.on("error", (t) => {
12262
12336
  this.listeners.error(t, this.currentLocator);
12263
12337
  }), this.pool.audioEngine.on("ended", async () => {
12264
- this.stopPositionPolling(), this.currentLocation = this.currentLocation.copyWithLocations(new L({
12338
+ if (this.stopPositionPolling(), this.currentLocation = this.currentLocation.copyWithLocations(new L({
12265
12339
  position: this.currentTrackIndex() + 1,
12266
12340
  progression: 1,
12267
12341
  fragments: [`t=${this.duration}`]
12268
- })), this.listeners.trackEnded(this.currentLocator), this.canGoForward && (await this.nextTrack(), this._settings.autoPlay && this.play());
12342
+ })), this.listeners.trackEnded(this.currentLocator), !this.canGoForward) {
12343
+ this.listeners.positionChanged(this.currentLocator);
12344
+ return;
12345
+ }
12346
+ await this.nextTrack(), this._settings.autoPlay && this.play();
12269
12347
  }), this.pool.audioEngine.on("play", () => {
12270
12348
  this._isNavigating || (this.startPositionPolling(), this.listeners.play(this.currentLocator));
12271
12349
  }), this.pool.audioEngine.on("playing", () => {
@@ -12459,15 +12537,15 @@ class Da extends Sr {
12459
12537
  "mediaSession" in navigator && (navigator.mediaSession.metadata = null, navigator.mediaSession.setActionHandler("play", null), navigator.mediaSession.setActionHandler("pause", null), navigator.mediaSession.setActionHandler("previoustrack", null), navigator.mediaSession.setActionHandler("nexttrack", null), navigator.mediaSession.setActionHandler("seekbackward", null), navigator.mediaSession.setActionHandler("seekforward", null));
12460
12538
  }
12461
12539
  destroy() {
12462
- this.stopPositionPolling(), this._stopStalledWatchdog(), this.destroyMediaSession(), this._suspiciousActivityListener && window.removeEventListener(ot, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(at, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), this.pool.destroy();
12540
+ this._destroyed = !0, this.stopPositionPolling(), this._stopStalledWatchdog(), this.destroyMediaSession(), this._suspiciousActivityListener && window.removeEventListener(ot, this._suspiciousActivityListener), this._keyboardPeripheralListener && window.removeEventListener(at, this._keyboardPeripheralListener), this._navigatorProtector?.destroy(), this._keyboardPeripheralsManager?.destroy(), this.pool.destroy();
12463
12541
  }
12464
12542
  }
12465
12543
  const Ta = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Oa = {
12466
12544
  oldStyleTf: Ta
12467
- }, Ra = 16, _s = Oa.oldStyleTf;
12545
+ }, Aa = 16, _s = Oa.oldStyleTf;
12468
12546
  class zt {
12469
12547
  constructor(t) {
12470
- this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Ra, this._fontFace = t.fontFace || _s, this._sample = t.sample || null, this._padding = t.padding ?? 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = zt.approximateWordSpaces(this._optimalChars, this._sample);
12548
+ this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Aa, this._fontFace = t.fontFace || _s, this._sample = t.sample || null, this._padding = t.padding ?? 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = zt.approximateWordSpaces(this._optimalChars, this._sample);
12471
12549
  }
12472
12550
  updateMultipliers() {
12473
12551
  this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1;
@@ -12541,7 +12619,7 @@ class zt {
12541
12619
  }
12542
12620
  export {
12543
12621
  _a as AudioDefaults,
12544
- Da as AudioNavigator,
12622
+ Fa as AudioNavigator,
12545
12623
  xe as AudioPreferences,
12546
12624
  Ps as AudioPreferencesEditor,
12547
12625
  vs as AudioSettings,
@@ -12572,7 +12650,7 @@ export {
12572
12650
  rn as FXLCoordinator,
12573
12651
  Mo as FXLFrameManager,
12574
12652
  zo as FXLFramePoolManager,
12575
- Ao as FXLPeripherals,
12653
+ Ro as FXLPeripherals,
12576
12654
  No as FXLSpreader,
12577
12655
  Vt as FrameComms,
12578
12656
  nn as FrameManager,
@@ -12585,7 +12663,7 @@ export {
12585
12663
  Sr as MediaNavigator,
12586
12664
  Ys as Navigator,
12587
12665
  $t as Orientation,
12588
- I as Preference,
12666
+ F as Preference,
12589
12667
  Ee as Properties,
12590
12668
  jo as RSProperties,
12591
12669
  k as RangePreference,
@@ -12608,7 +12686,7 @@ export {
12608
12686
  no as WebRSProperties,
12609
12687
  qs as WebUserProperties,
12610
12688
  js as decorationsEqual,
12611
- E as ensureBoolean,
12689
+ P as ensureBoolean,
12612
12690
  Mt as ensureEnumValue,
12613
12691
  Ks as ensureExperiment,
12614
12692
  kt as ensureFilter,
@@ -12635,7 +12713,7 @@ export {
12635
12713
  me as playbackRateRangeConfig,
12636
12714
  xt as resolveDecorationForWire,
12637
12715
  na as selectVariant,
12638
- Aa as settings,
12716
+ Ra as settings,
12639
12717
  ht as skipIntervalRangeConfig,
12640
12718
  be as stripWidthRangeConfig,
12641
12719
  fe as volumeRangeConfig,