@readium/navigator 2.4.0-beta.5 → 2.4.0-beta.7

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
@@ -56,15 +56,15 @@ const C = class C {
56
56
  };
57
57
  C.AUDITORY = new C("auditory"), C.CHART_ON_VISUAL = new C("chartOnVisual"), C.CHEM_ON_VISUAL = new C("chemOnVisual"), C.COLOR_DEPENDENT = new C("colorDependent"), C.DIAGRAM_ON_VISUAL = new C("diagramOnVisual"), C.MATH_ON_VISUAL = new C("mathOnVisual"), C.MUSIC_ON_VISUAL = new C("musicOnVisual"), C.TACTILE = new C("tactile"), C.TEXT_ON_VISUAL = new C("textOnVisual"), C.TEXTUAL = new C("textual"), C.VISUAL = new C("visual");
58
58
  let $e = C;
59
- const N = class N {
59
+ const F = class F {
60
60
  constructor(t) {
61
61
  if (typeof t == "string") {
62
- if (!N.VALID_MODES.has(t.toLowerCase()))
62
+ if (!F.VALID_MODES.has(t.toLowerCase()))
63
63
  return;
64
64
  this.value = t.toLowerCase();
65
65
  } else {
66
66
  const e = t.filter(
67
- (i) => N.VALID_MODES.has(i.toLowerCase())
67
+ (i) => F.VALID_MODES.has(i.toLowerCase())
68
68
  );
69
69
  if (e.length === 0)
70
70
  return;
@@ -77,11 +77,11 @@ const N = class N {
77
77
  static deserialize(t) {
78
78
  if (!t) return;
79
79
  if (typeof t == "string")
80
- return new N(t);
80
+ return new F(t);
81
81
  if (!Array.isArray(t)) return;
82
- const e = t.filter((i) => i ? N.VALID_MODES.has(i.toLowerCase()) : !1);
82
+ const e = t.filter((i) => i ? F.VALID_MODES.has(i.toLowerCase()) : !1);
83
83
  if (e.length !== 0)
84
- return new N(e);
84
+ return new F(e);
85
85
  }
86
86
  /**
87
87
  * Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
@@ -90,8 +90,8 @@ const N = class N {
90
90
  return this.value;
91
91
  }
92
92
  };
93
- N.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), N.AUDITORY = new N("auditory"), N.TACTILE = new N("tactile"), N.TEXTUAL = new N("textual"), N.VISUAL = new N("visual");
94
- let Xe = N;
93
+ F.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), F.AUDITORY = new F("auditory"), F.TACTILE = new F("tactile"), F.TEXTUAL = new F("textual"), F.VISUAL = new F("visual");
94
+ let Xe = F;
95
95
  const f = class f {
96
96
  constructor(t) {
97
97
  this.value = t;
@@ -152,8 +152,8 @@ const L = class L {
152
152
  };
153
153
  L.NONE = new L("none"), L.DOCUMENTED = new L("documented"), L.LEGAL = new L("legal"), L.TEMPORARY = new L("temporary"), L.TECHNICAL = new L("technical"), L.EAA_DISPROPORTIONATE_BURDEN = new L("eaa-disproportionate-burden"), L.EAA_FUNDAMENTAL_ALTERATION = new L("eaa-fundamental-alteration"), L.EAA_MICROENTERPRISE = new L("eaa-microenterprise"), L.EAA_TECHNICAL_IMPOSSIBILITY = new L("eaa-technical-impossibility"), L.EAA_TEMPORARY = new L("eaa-temporary");
154
154
  let qe = L;
155
- const Ke = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], vn = /* @__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"}}`), wn = {
156
- publication: vn
155
+ const Ke = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], _n = /* @__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
+ publication: _n
157
157
  }, Ze = {
158
158
  fr: () => import("./fr-C5HEel98.js"),
159
159
  ar: () => import("./ar-DyHX_uy2.js"),
@@ -165,7 +165,7 @@ const Ke = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], vn = /* @__PURE__ */ J
165
165
  sv: () => import("./sv-BfzAFsVN.js")
166
166
  // 'tr': () => import('@edrlab/thorium-locales/publication-metadata/tr.json'),
167
167
  // 'uk': () => import('@edrlab/thorium-locales/publication-metadata/uk.json')
168
- }, Je = wn?.publication?.metadata?.accessibility?.["display-guide"] || {};
168
+ }, Je = Pn?.publication?.metadata?.accessibility?.["display-guide"] || {};
169
169
  class mt {
170
170
  constructor() {
171
171
  this.currentLocaleCode = "en", this.locale = Je, this.loadedLocales = {}, this.loadedLocales.en = Je;
@@ -308,11 +308,11 @@ Object.defineProperty($.prototype, "encryption", {
308
308
  return ke.deserialize(this.otherProperties.encrypted);
309
309
  }
310
310
  });
311
- function _n(s) {
311
+ function En(s) {
312
312
  return s && Array.isArray(s) ? s : void 0;
313
313
  }
314
- function Ui(s) {
315
- return s && typeof s == "string" ? [s] : _n(s);
314
+ function Di(s) {
315
+ return s && typeof s == "string" ? [s] : En(s);
316
316
  }
317
317
  function Qe(s) {
318
318
  return typeof s == "string" ? new Date(s) : void 0;
@@ -323,7 +323,7 @@ function Mt(s) {
323
323
  function B(s) {
324
324
  return Mt(s) !== void 0 && Math.sign(s) >= 0 ? s : void 0;
325
325
  }
326
- function Pn(s) {
326
+ function Cn(s) {
327
327
  const t = new Array();
328
328
  return s.forEach((e) => t.push(e)), t;
329
329
  }
@@ -836,7 +836,7 @@ class E {
836
836
  return Object.entries(t).forEach(([a, l]) => {
837
837
  o.has(a) || r.set(a, l);
838
838
  }), new E({
839
- fragments: Ui(t.fragments || t.fragment),
839
+ fragments: Di(t.fragments || t.fragment),
840
840
  progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
841
841
  totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
842
842
  position: n !== void 0 && n > 0 ? n : void 0,
@@ -877,7 +877,7 @@ class at {
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 N {
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 N({
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 N({
912
912
  href: this.href,
913
913
  type: this.type,
914
914
  title: this.title,
@@ -941,7 +941,7 @@ class j {
941
941
  size: B(t.size),
942
942
  duration: B(t.duration),
943
943
  bitrate: B(t.bitrate),
944
- languages: Ui(t.language),
944
+ languages: Di(t.language),
945
945
  alternates: It.deserialize(t.alternate),
946
946
  children: It.deserialize(t.children)
947
947
  });
@@ -951,7 +951,7 @@ class j {
951
951
  */
952
952
  serialize() {
953
953
  const t = { href: this.href };
954
- return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = Pn(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.size !== void 0 && (t.size = this.size), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
954
+ return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = Cn(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.size !== void 0 && (t.size = this.size), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
955
955
  }
956
956
  /** MediaType of the linked resource. */
957
957
  get mediaType() {
@@ -991,7 +991,7 @@ class j {
991
991
  */
992
992
  get locator() {
993
993
  let t = this.href.split("#");
994
- return new F({
994
+ return new N({
995
995
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
996
996
  type: this.type ?? "",
997
997
  title: this.title,
@@ -1095,7 +1095,7 @@ class It {
1095
1095
  return this.items.filter((t) => t.type);
1096
1096
  }
1097
1097
  }
1098
- var Ii = /* @__PURE__ */ ((s) => (s.EPUB = "https://readium.org/webpub-manifest/profiles/epub", s.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", s.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", s.PDF = "https://readium.org/webpub-manifest/profiles/pdf", s))(Ii || {}), D = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(D || {});
1098
+ var Wi = /* @__PURE__ */ ((s) => (s.EPUB = "https://readium.org/webpub-manifest/profiles/epub", s.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", s.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", s.PDF = "https://readium.org/webpub-manifest/profiles/pdf", s))(Wi || {}), D = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(D || {});
1099
1099
  $.prototype.getContains = function() {
1100
1100
  return new Set(this.otherProperties.contains || []);
1101
1101
  };
@@ -1343,19 +1343,19 @@ $.prototype.getAvailability = function() {
1343
1343
  $.prototype.getAuthenticate = function() {
1344
1344
  return j.deserialize(this.otherProperties.authenticate);
1345
1345
  };
1346
- const En = "CssSelectorGenerator";
1346
+ const xn = "CssSelectorGenerator";
1347
1347
  function ei(s = "unknown problem", ...t) {
1348
- console.warn(`${En}: ${s}`, ...t);
1348
+ console.warn(`${xn}: ${s}`, ...t);
1349
1349
  }
1350
- function Cn(s) {
1350
+ function Rn(s) {
1351
1351
  return s instanceof RegExp;
1352
1352
  }
1353
- function xn(s) {
1353
+ function Ln(s) {
1354
1354
  return s.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
1355
1355
  }
1356
- function Rn(s) {
1356
+ function kn(s) {
1357
1357
  const t = s.map((e) => {
1358
- if (Cn(e))
1358
+ if (Rn(e))
1359
1359
  return (i) => e.test(i);
1360
1360
  if (typeof e == "function")
1361
1361
  return (i) => {
@@ -1363,21 +1363,21 @@ function Rn(s) {
1363
1363
  return typeof n != "boolean" ? (ei("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
1364
1364
  };
1365
1365
  if (typeof e == "string") {
1366
- const i = new RegExp("^" + xn(e) + "$");
1366
+ const i = new RegExp("^" + Ln(e) + "$");
1367
1367
  return (n) => i.test(n);
1368
1368
  }
1369
1369
  return ei("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
1370
1370
  });
1371
1371
  return (e) => t.some((i) => i(e));
1372
1372
  }
1373
- Rn([
1373
+ kn([
1374
1374
  "class",
1375
1375
  "id",
1376
1376
  // Angular attributes
1377
1377
  "ng-*"
1378
1378
  ]);
1379
- const Ln = Math.pow(2, 32), ii = () => Math.round(Math.random() * Ln).toString(36), ge = () => `${Math.round(performance.now())}-${ii()}-${ii()}`, ut = 1;
1380
- class kn {
1379
+ const On = Math.pow(2, 32), ii = () => Math.round(Math.random() * On).toString(36), ge = () => `${Math.round(performance.now())}-${ii()}-${ii()}`, ut = 1;
1380
+ class Tn {
1381
1381
  constructor(t) {
1382
1382
  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);
1383
1383
  }
@@ -1472,12 +1472,12 @@ class bt {
1472
1472
  function ni(s) {
1473
1473
  return s.split("").reverse().join("");
1474
1474
  }
1475
- function On(s, t, e) {
1475
+ function An(s, t, e) {
1476
1476
  const i = ni(t);
1477
1477
  return e.map((n) => {
1478
1478
  const r = Math.max(0, n.end - t.length - n.errors), o = ni(s.slice(r, n.end));
1479
1479
  return {
1480
- start: Di(o, i, n.errors).reduce((l, h) => n.end - h.end < l ? n.end - h.end : l, n.end),
1480
+ start: Hi(o, i, n.errors).reduce((l, h) => n.end - h.end < l ? n.end - h.end : l, n.end),
1481
1481
  end: n.end,
1482
1482
  errors: n.errors
1483
1483
  };
@@ -1493,7 +1493,7 @@ function ri(s, t, e, i) {
1493
1493
  const m = ae(c & s.lastRowMask[e]) - ae(u & s.lastRowMask[e]);
1494
1494
  return c <<= 1, u <<= 1, u |= o, c |= ae(i) - o, n = u | ~(l | c), r = c & l, s.P[e] = n, s.M[e] = r, m;
1495
1495
  }
1496
- function Di(s, t, e) {
1496
+ function Hi(s, t, e) {
1497
1497
  if (t.length === 0)
1498
1498
  return [];
1499
1499
  e = Math.min(e, t.length);
@@ -1556,11 +1556,11 @@ function Di(s, t, e) {
1556
1556
  }
1557
1557
  return i;
1558
1558
  }
1559
- function Tn(s, t, e) {
1560
- const i = Di(s, t, e);
1561
- return On(s, t, i);
1559
+ function zn(s, t, e) {
1560
+ const i = Hi(s, t, e);
1561
+ return An(s, t, i);
1562
1562
  }
1563
- function Wi(s, t, e) {
1563
+ function Bi(s, t, e) {
1564
1564
  let i = 0;
1565
1565
  const n = [];
1566
1566
  for (; i !== -1; )
@@ -1569,15 +1569,15 @@ function Wi(s, t, e) {
1569
1569
  end: i + t.length,
1570
1570
  errors: 0
1571
1571
  }), i += 1);
1572
- return n.length > 0 ? n : Tn(s, t, e);
1572
+ return n.length > 0 ? n : zn(s, t, e);
1573
1573
  }
1574
1574
  function si(s, t) {
1575
- return t.length === 0 || s.length === 0 ? 0 : 1 - Wi(s, t, t.length)[0].errors / t.length;
1575
+ return t.length === 0 || s.length === 0 ? 0 : 1 - Bi(s, t, t.length)[0].errors / t.length;
1576
1576
  }
1577
- function An(s, t, e = {}) {
1577
+ function Mn(s, t, e = {}) {
1578
1578
  if (t.length === 0)
1579
1579
  return null;
1580
- const i = Math.min(256, t.length / 2), n = Wi(s, t, i);
1580
+ const i = Math.min(256, t.length / 2), n = Bi(s, t, i);
1581
1581
  if (n.length === 0)
1582
1582
  return null;
1583
1583
  const r = (a) => {
@@ -1632,7 +1632,7 @@ function oi(s, t) {
1632
1632
  return { node: r, offset: o };
1633
1633
  throw new RangeError("No text nodes with non-whitespace text found in range");
1634
1634
  }
1635
- function zn(s) {
1635
+ function Nn(s) {
1636
1636
  if (!s.toString().trim().length)
1637
1637
  throw new RangeError("Range contains no non-whitespace text");
1638
1638
  if (s.startContainer.nodeType !== Node.TEXT_NODE)
@@ -1675,7 +1675,7 @@ function zn(s) {
1675
1675
  }
1676
1676
  return t;
1677
1677
  }
1678
- function Hi(s) {
1678
+ function Vi(s) {
1679
1679
  switch (s.nodeType) {
1680
1680
  case Node.ELEMENT_NODE:
1681
1681
  case Node.TEXT_NODE:
@@ -1687,10 +1687,10 @@ function Hi(s) {
1687
1687
  function ai(s) {
1688
1688
  let t = s.previousSibling, e = 0;
1689
1689
  for (; t; )
1690
- e += Hi(t), t = t.previousSibling;
1690
+ e += Vi(t), t = t.previousSibling;
1691
1691
  return e;
1692
1692
  }
1693
- function Bi(s, ...t) {
1693
+ function ji(s, ...t) {
1694
1694
  let e = t.shift();
1695
1695
  const i = s.ownerDocument.createNodeIterator(
1696
1696
  s,
@@ -1744,7 +1744,7 @@ class Y {
1744
1744
  */
1745
1745
  resolve(t = {}) {
1746
1746
  try {
1747
- return Bi(this.element, this.offset)[0];
1747
+ return ji(this.element, this.offset)[0];
1748
1748
  } catch (e) {
1749
1749
  if (this.offset === 0 && t.direction !== void 0) {
1750
1750
  const i = document.createTreeWalker(
@@ -1795,7 +1795,7 @@ class Y {
1795
1795
  throw new Error("Child node offset is out of range");
1796
1796
  let i = 0;
1797
1797
  for (let n = 0; n < e; n++)
1798
- i += Hi(t.childNodes[n]);
1798
+ i += Vi(t.childNodes[n]);
1799
1799
  return new Y(t, i);
1800
1800
  }
1801
1801
  default:
@@ -1829,7 +1829,7 @@ class tt {
1829
1829
  */
1830
1830
  toRange() {
1831
1831
  let t, e;
1832
- this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = Bi(
1832
+ this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = ji(
1833
1833
  this.start.element,
1834
1834
  this.start.offset,
1835
1835
  this.end.offset
@@ -1868,7 +1868,7 @@ class tt {
1868
1868
  * whitespace
1869
1869
  */
1870
1870
  static trimmedRange(t) {
1871
- return zn(tt.fromRange(t).toRange());
1871
+ return Nn(tt.fromRange(t).toRange());
1872
1872
  }
1873
1873
  }
1874
1874
  class Wt {
@@ -1932,7 +1932,7 @@ class Ht {
1932
1932
  return this.toPositionAnchor(t).toRange();
1933
1933
  }
1934
1934
  toPositionAnchor(t = {}) {
1935
- const e = this.root.textContent, i = An(e, this.exact, {
1935
+ const e = this.root.textContent, i = Mn(e, this.exact, {
1936
1936
  ...this.context,
1937
1937
  hint: t.hint
1938
1938
  });
@@ -1941,7 +1941,7 @@ class Ht {
1941
1941
  return new Wt(this.root, i.start, i.end);
1942
1942
  }
1943
1943
  }
1944
- function Mn(s) {
1944
+ function Fn(s) {
1945
1945
  const t = s.tagName.toUpperCase();
1946
1946
  return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
1947
1947
  }
@@ -1970,7 +1970,7 @@ function ie(s, t) {
1970
1970
  }
1971
1971
  if (n) {
1972
1972
  const r = s.createRange();
1973
- return n.childNodes.length === 0 || Mn(n) ? (r.selectNode(n), r) : (r.setStartBefore(n), r.setEndAfter(n), r);
1973
+ return n.childNodes.length === 0 || Fn(n) ? (r.selectNode(n), r) : (r.setStartBefore(n), r.setEndAfter(n), r);
1974
1974
  }
1975
1975
  }
1976
1976
  } catch (e) {
@@ -1978,7 +1978,7 @@ function ie(s, t) {
1978
1978
  }
1979
1979
  return null;
1980
1980
  }
1981
- function Fn(s, t) {
1981
+ function Un(s, t) {
1982
1982
  let e = s.getClientRects();
1983
1983
  e.length || s.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = s.commonAncestorContainer.getClientRects());
1984
1984
  const i = 1, n = [];
@@ -1991,10 +1991,10 @@ function Fn(s, t) {
1991
1991
  top: h.top,
1992
1992
  width: h.width
1993
1993
  });
1994
- const r = Vi(
1994
+ const r = Gi(
1995
1995
  n,
1996
1996
  i
1997
- ), o = Un(r, i), a = ji(o), l = 4;
1997
+ ), o = Dn(r, i), a = $i(o), l = 4;
1998
1998
  for (let h = a.length - 1; h >= 0; h--) {
1999
1999
  const c = a[h];
2000
2000
  if (!(c.width * c.height > l))
@@ -2005,16 +2005,16 @@ function Fn(s, t) {
2005
2005
  }
2006
2006
  return a;
2007
2007
  }
2008
- function Vi(s, t, e) {
2008
+ function Gi(s, t, e) {
2009
2009
  for (let i = 0; i < s.length; i++)
2010
2010
  for (let n = i + 1; n < s.length; n++) {
2011
2011
  const r = s[i], o = s[n];
2012
2012
  if (r === o)
2013
2013
  continue;
2014
2014
  const a = V(r.top, o.top, t) && V(r.bottom, o.bottom, t), l = V(r.left, o.left, t) && V(r.right, o.right, t);
2015
- if (a && !l && Gi(r, o, t)) {
2016
- const u = s.filter((y) => y !== r && y !== o), m = Nn(r, o);
2017
- return u.push(m), Vi(
2015
+ if (a && !l && Xi(r, o, t)) {
2016
+ const u = s.filter((y) => y !== r && y !== o), m = In(r, o);
2017
+ return u.push(m), Gi(
2018
2018
  u,
2019
2019
  t
2020
2020
  );
@@ -2022,7 +2022,7 @@ function Vi(s, t, e) {
2022
2022
  }
2023
2023
  return s;
2024
2024
  }
2025
- function Nn(s, t) {
2025
+ function In(s, t) {
2026
2026
  const e = Math.min(s.left, t.left), i = Math.max(s.right, t.right), n = Math.min(s.top, t.top), r = Math.max(s.bottom, t.bottom);
2027
2027
  return {
2028
2028
  bottom: r,
@@ -2033,7 +2033,7 @@ function Nn(s, t) {
2033
2033
  width: i - e
2034
2034
  };
2035
2035
  }
2036
- function Un(s, t) {
2036
+ function Dn(s, t) {
2037
2037
  const e = new Set(s);
2038
2038
  for (const i of s) {
2039
2039
  if (!(i.width > 1 && i.height > 1)) {
@@ -2041,24 +2041,24 @@ function Un(s, t) {
2041
2041
  continue;
2042
2042
  }
2043
2043
  for (const r of s)
2044
- if (i !== r && e.has(r) && In(r, i, t)) {
2044
+ if (i !== r && e.has(r) && Wn(r, i, t)) {
2045
2045
  e.delete(i);
2046
2046
  break;
2047
2047
  }
2048
2048
  }
2049
2049
  return Array.from(e);
2050
2050
  }
2051
- function In(s, t, e) {
2051
+ function Wn(s, t, e) {
2052
2052
  return Tt(s, t.left, t.top, e) && Tt(s, t.right, t.top, e) && Tt(s, t.left, t.bottom, e) && Tt(s, t.right, t.bottom, e);
2053
2053
  }
2054
2054
  function Tt(s, t, e, i) {
2055
2055
  return (s.left < t || V(s.left, t, i)) && (s.right > t || V(s.right, t, i)) && (s.top < e || V(s.top, e, i)) && (s.bottom > e || V(s.bottom, e, i));
2056
2056
  }
2057
- function ji(s) {
2057
+ function $i(s) {
2058
2058
  for (let t = 0; t < s.length; t++)
2059
2059
  for (let e = t + 1; e < s.length; e++) {
2060
2060
  const i = s[t], n = s[e];
2061
- if (i !== n && Gi(i, n, -1)) {
2061
+ if (i !== n && Xi(i, n, -1)) {
2062
2062
  let r = [], o;
2063
2063
  const a = li(i, n);
2064
2064
  if (a.length === 1)
@@ -2068,13 +2068,13 @@ function ji(s) {
2068
2068
  a.length < h.length ? (r = a, o = i) : (r = h, o = n);
2069
2069
  }
2070
2070
  const l = s.filter((h) => h !== o);
2071
- return Array.prototype.push.apply(l, r), ji(l);
2071
+ return Array.prototype.push.apply(l, r), $i(l);
2072
2072
  }
2073
2073
  }
2074
2074
  return s;
2075
2075
  }
2076
2076
  function li(s, t) {
2077
- const e = Dn(t, s);
2077
+ const e = Hn(t, s);
2078
2078
  if (e.height === 0 || e.width === 0)
2079
2079
  return [s];
2080
2080
  const i = [];
@@ -2124,7 +2124,7 @@ function li(s, t) {
2124
2124
  }
2125
2125
  return i;
2126
2126
  }
2127
- function Dn(s, t) {
2127
+ function Hn(s, t) {
2128
2128
  const e = Math.max(s.left, t.left), i = Math.min(s.right, t.right), n = Math.max(s.top, t.top), r = Math.min(s.bottom, t.bottom);
2129
2129
  return {
2130
2130
  bottom: r,
@@ -2135,20 +2135,20 @@ function Dn(s, t) {
2135
2135
  width: Math.max(0, i - e)
2136
2136
  };
2137
2137
  }
2138
- function Gi(s, t, e) {
2138
+ function Xi(s, t, e) {
2139
2139
  return (s.left < t.right || e >= 0 && V(s.left, t.right, e)) && (t.left < s.right || e >= 0 && V(t.left, s.right, e)) && (s.top < t.bottom || e >= 0 && V(s.top, t.bottom, e)) && (t.top < s.bottom || e >= 0 && V(t.top, s.bottom, e));
2140
2140
  }
2141
2141
  function V(s, t, e) {
2142
2142
  return Math.abs(s - t) <= e;
2143
2143
  }
2144
- function Fe(s) {
2144
+ function Ne(s) {
2145
2145
  const t = {}, e = s.document.documentElement.style;
2146
2146
  for (const i in s.document.documentElement.style)
2147
2147
  Object.hasOwn(e, i) && !Number.isNaN(Number.parseInt(i)) && (t[e[i]] = e.getPropertyValue(e[i]));
2148
2148
  return t;
2149
2149
  }
2150
- function $i(s, t) {
2151
- const e = Fe(s);
2150
+ function Yi(s, t) {
2151
+ const e = Ne(s);
2152
2152
  Object.keys(e).forEach((i) => {
2153
2153
  t.hasOwnProperty(i) || ne(s, i);
2154
2154
  }), Object.entries(t).forEach(([i, n]) => {
@@ -2165,7 +2165,7 @@ function ne(s, t) {
2165
2165
  s.document.documentElement.style.removeProperty(t);
2166
2166
  }
2167
2167
  let At = null, he = null, vt = 0;
2168
- const pt = { r: 255, g: 255, b: 255, a: 1 }, lt = /* @__PURE__ */ new Map(), Wn = () => {
2168
+ const pt = { r: 255, g: 255, b: 255, a: 1 }, lt = /* @__PURE__ */ new Map(), Bn = () => {
2169
2169
  if (!At)
2170
2170
  if (typeof OffscreenCanvas < "u")
2171
2171
  At = new OffscreenCanvas(5, 5), he = At.getContext("2d", {
@@ -2180,7 +2180,7 @@ const pt = { r: 255, g: 255, b: 255, a: 1 }, lt = /* @__PURE__ */ new Map(), Wn
2180
2180
  });
2181
2181
  }
2182
2182
  return he;
2183
- }, Hn = (s) => {
2183
+ }, Vn = (s) => {
2184
2184
  if (!s) return !0;
2185
2185
  const t = s.trim().toLowerCase();
2186
2186
  return t.startsWith("var(") || [
@@ -2207,9 +2207,9 @@ const pt = { r: 255, g: 255, b: 255, a: 1 }, lt = /* @__PURE__ */ new Map(), Wn
2207
2207
  const e = t ? `${s}|${t}` : s, i = lt.get(e);
2208
2208
  if (i !== void 0)
2209
2209
  return i ?? pt;
2210
- if (Hn(s))
2210
+ if (Vn(s))
2211
2211
  return zt(s, "Unsupported color format or special value."), lt.set(e, null), pt;
2212
- const n = Wn();
2212
+ const n = Bn();
2213
2213
  if (!n)
2214
2214
  return zt(s, "Could not get canvas context."), lt.set(e, null), pt;
2215
2215
  try {
@@ -2238,15 +2238,15 @@ const pt = { r: 255, g: 255, b: 255, a: 1 }, lt = /* @__PURE__ */ new Map(), Wn
2238
2238
  }, Se = (s, t = null) => {
2239
2239
  const e = ye(s, t), i = ci(e, { r: 255, g: 255, b: 255, a: 1 }), n = ci(e, { r: 0, g: 0, b: 0, a: 1 });
2240
2240
  return i > n;
2241
- }, Bn = (s, t = null) => Se(s, t) ? "white" : "black", di = "#FFFF00", Vn = () => "Highlight" in window, ui = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2242
- class jn {
2241
+ }, jn = (s, t = null) => Se(s, t) ? "white" : "black", di = "#FFFF00", Gn = () => "Highlight" in window, ui = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
2242
+ class $n {
2243
2243
  /**
2244
2244
  * Creates a DecorationGroup object
2245
2245
  * @param id Unique HTML ID-adhering name of the group
2246
2246
  * @param name Human-readable name of the group
2247
2247
  */
2248
2248
  constructor(t, e, i, n) {
2249
- this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Vn() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
2249
+ this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Gn() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
2250
2250
  }
2251
2251
  get activeable() {
2252
2252
  return this.activateable;
@@ -2309,7 +2309,7 @@ class jn {
2309
2309
  const n = le(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), r = t.decoration?.style?.tint ?? di;
2310
2310
  e.innerHTML = `
2311
2311
  ::highlight(${this.id}) {
2312
- color: ${Bn(r, n)};
2312
+ color: ${jn(r, n)};
2313
2313
  background-color: ${r};
2314
2314
  }`;
2315
2315
  }
@@ -2361,7 +2361,7 @@ class jn {
2361
2361
  const d = y.cloneNode(!0);
2362
2362
  d.style.setProperty("pointer-events", "none"), h(d, c, c), e.append(d);
2363
2363
  } else {
2364
- let d = Fn(
2364
+ let d = Un(
2365
2365
  t.range
2366
2366
  );
2367
2367
  d = d.sort((p, b) => p.top < b.top ? -1 : p.top > b.top ? 1 : 0);
@@ -2430,7 +2430,7 @@ const Pt = class Pt extends bt {
2430
2430
  mount(t, e) {
2431
2431
  return this.wnd = t, e.register("decorate", Pt.moduleName, (i, n) => {
2432
2432
  const r = i;
2433
- r.decoration && r.decoration.locator && (r.decoration.locator = F.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new jn(
2433
+ r.decoration && r.decoration.locator && (r.decoration.locator = N.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new $n(
2434
2434
  t,
2435
2435
  e,
2436
2436
  `readium-decoration-${this.lastGroupId++}`,
@@ -2501,7 +2501,7 @@ let Rt = Et;
2501
2501
  function rt(s) {
2502
2502
  return s.document.body.dir.toLowerCase() === "rtl";
2503
2503
  }
2504
- function Xi(s) {
2504
+ function qi(s) {
2505
2505
  return parseInt(
2506
2506
  s.getComputedStyle(
2507
2507
  s.document.documentElement
@@ -2513,7 +2513,7 @@ function mi(s) {
2513
2513
  return s.clientHeight - e - i;
2514
2514
  }
2515
2515
  function gi(s) {
2516
- const t = Xi(s);
2516
+ const t = qi(s);
2517
2517
  if (!t)
2518
2518
  return !1;
2519
2519
  const e = s.document.querySelectorAll("div[id^='readium-virtual-page']");
@@ -2527,18 +2527,18 @@ function gi(s) {
2527
2527
  }
2528
2528
  return i !== l;
2529
2529
  }
2530
- function Yi(s) {
2530
+ function Ki(s) {
2531
2531
  const t = s.document.createElement("style");
2532
2532
  t.appendChild(s.document.createTextNode("*{}")), s.document.body.appendChild(t), s.document.body.removeChild(t);
2533
2533
  }
2534
- function Gn(s) {
2534
+ function Xn(s) {
2535
2535
  return s < 0.5 ? 2 * s * s : -1 + (4 - 2 * s) * s;
2536
2536
  }
2537
2537
  function z(s) {
2538
2538
  const t = s.getSelection();
2539
2539
  t && t.removeAllRanges();
2540
2540
  }
2541
- const $n = [
2541
+ const Yn = [
2542
2542
  "a",
2543
2543
  "audio",
2544
2544
  "button",
@@ -2552,14 +2552,14 @@ const $n = [
2552
2552
  "textarea",
2553
2553
  "video"
2554
2554
  ];
2555
- function qi(s) {
2556
- return $n.indexOf(s.nodeName.toLowerCase()) !== -1 || s.hasAttribute("contenteditable") && s.getAttribute("contenteditable")?.toLowerCase() !== "false" ? s : s.parentElement ? qi(s.parentElement) : null;
2555
+ function Zi(s) {
2556
+ return Yn.indexOf(s.nodeName.toLowerCase()) !== -1 || s.hasAttribute("contenteditable") && s.getAttribute("contenteditable")?.toLowerCase() !== "false" ? s : s.parentElement ? Zi(s.parentElement) : null;
2557
2557
  }
2558
- function Ne(s, t) {
2559
- const e = Ki(s, s.document.body, t), i = s._readium_cssSelectorGenerator.getCssSelector(e, {
2558
+ function Fe(s, t) {
2559
+ const e = Ji(s, s.document.body, t), i = s._readium_cssSelectorGenerator.getCssSelector(e, {
2560
2560
  selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
2561
2561
  });
2562
- return new F({
2562
+ return new N({
2563
2563
  href: "#",
2564
2564
  type: "application/xhtml+xml",
2565
2565
  locations: new E({
@@ -2572,15 +2572,15 @@ function Ne(s, t) {
2572
2572
  })
2573
2573
  });
2574
2574
  }
2575
- function Ki(s, t, e) {
2575
+ function Ji(s, t, e) {
2576
2576
  for (var i = 0; i < t.children.length; i++) {
2577
2577
  const n = t.children[i];
2578
- if (!qn(n) && Xn(s, n, e))
2579
- return Yn(s, n) ? n : Ki(s, n, e);
2578
+ if (!Zn(n) && qn(s, n, e))
2579
+ return Kn(s, n) ? n : Ji(s, n, e);
2580
2580
  }
2581
2581
  return t;
2582
2582
  }
2583
- function Xn(s, t, e) {
2583
+ function qn(s, t, e) {
2584
2584
  if (t === document.body || t === document.documentElement)
2585
2585
  return !0;
2586
2586
  if (!document || !document.documentElement || !document.body)
@@ -2588,11 +2588,11 @@ function Xn(s, t, e) {
2588
2588
  const i = t.getBoundingClientRect();
2589
2589
  return e ? i.bottom > 0 && i.top < s.innerHeight : i.right > 0 && i.left < s.innerWidth;
2590
2590
  }
2591
- function Yn(s, t) {
2591
+ function Kn(s, t) {
2592
2592
  const e = t.getBoundingClientRect();
2593
2593
  return e.top >= 0 && e.left >= 0 && e.bottom <= s.innerHeight && e.right <= s.innerWidth;
2594
2594
  }
2595
- function qn(s) {
2595
+ function Zn(s) {
2596
2596
  const t = getComputedStyle(s);
2597
2597
  if (t) {
2598
2598
  const e = t.getPropertyValue("display");
@@ -2601,7 +2601,7 @@ function qn(s) {
2601
2601
  }
2602
2602
  return !1;
2603
2603
  }
2604
- const Kn = {
2604
+ const Jn = {
2605
2605
  maxVelocity: 200,
2606
2606
  // Reasonable default for human-like scrolling (pixels/ms)
2607
2607
  minVariance: 0.01,
@@ -2612,7 +2612,7 @@ const Kn = {
2612
2612
  // Reasonable default for detecting patterns
2613
2613
  maxConsistentScrolls: 15
2614
2614
  // Balanced threshold for flagging
2615
- }, Zi = {
2615
+ }, Qi = {
2616
2616
  maxVelocity: 200,
2617
2617
  // Extremely fast scrolling (pixels/ms)
2618
2618
  minVariance: 1e-5,
@@ -2623,11 +2623,11 @@ const Kn = {
2623
2623
  // Only trigger on near-perfect patterns
2624
2624
  maxConsistentScrolls: 20
2625
2625
  // Need many consistent scrolls
2626
- }, Ji = {
2626
+ }, tn = {
2627
2627
  maxSelectionsPerSecond: 500,
2628
2628
  minVariance: 50,
2629
2629
  historySize: 20
2630
- }, Zn = {
2630
+ }, Qn = {
2631
2631
  enabled: !0,
2632
2632
  maxSelectionPercent: 0.1,
2633
2633
  minThreshold: 100,
@@ -2636,7 +2636,7 @@ const Kn = {
2636
2636
  };
2637
2637
  class Ue {
2638
2638
  constructor(t = {}) {
2639
- this.history = [], this.consistentScrollCount = 0, this.options = { ...Kn, ...t };
2639
+ this.history = [], this.consistentScrollCount = 0, this.options = { ...Jn, ...t };
2640
2640
  }
2641
2641
  analyze(t, e, i) {
2642
2642
  if (i <= 0) return !1;
@@ -2667,7 +2667,7 @@ class Ue {
2667
2667
  this.history = [], this.consistentScrollCount = 0;
2668
2668
  }
2669
2669
  }
2670
- const fi = "readium-column-snapper-style", Jn = 200, U = class U extends Rt {
2670
+ const fi = "readium-column-snapper-style", tr = 200, U = class U extends Rt {
2671
2671
  constructor() {
2672
2672
  super(...arguments), this.isSnapProtectionEnabled = !1, this.patternAnalyzer = null, this.lastTurnTime = 0, this.shakeTimeout = 0, this.snappingCancelled = !1, this.alreadyScrollLeft = 0, this.overscroll = 0, this.cachedScrollWidth = 0, this.touchState = 0, this.startingX = void 0, this.endingX = void 0, this.onTouchStarter = this.onTouchStart.bind(this), this.onTouchEnder = this.onTouchEnd.bind(this), this.onWidthChanger = this.onWidthChange.bind(this), this.onTouchMover = this.onTouchMove.bind(this);
2673
2673
  }
@@ -2705,15 +2705,15 @@ const fi = "readium-column-snapper-style", Jn = 200, U = class U extends Rt {
2705
2705
  }
2706
2706
  // Snaps the current offset to the page width.
2707
2707
  snapCurrentOffset(t = !1, e = !1) {
2708
- const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), o = Xi(this.wnd), a = Math.min(Math.max(0, i), this.cachedScrollWidth), l = rt(this.wnd) ? -1 : 1, h = (
2708
+ const i = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), o = qi(this.wnd), a = Math.min(Math.max(0, i), this.cachedScrollWidth), l = rt(this.wnd) ? -1 : 1, h = (
2709
2709
  // The hurdle to overcome in order to change pages
2710
2710
  l * (this.wnd.innerWidth / 3) * (l * r > 0 ? 2 : 1)
2711
2711
  ), c = this.snapOffset(a + h), u = c > this.scrollOffset() ? "right" : "left";
2712
2712
  if (this.checkSuspiciousSnap(u, Math.abs(c - this.scrollOffset())), t && c !== this.scrollOffset()) {
2713
2713
  this.snappingCancelled = !1;
2714
- const m = (b, v, k, Q) => k > Q ? v : b + (v - b) * Gn(k / Q), y = (
2714
+ const m = (b, v, k, Q) => k > Q ? v : b + (v - b) * Xn(k / Q), y = (
2715
2715
  /*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
2716
- Jn * o
2716
+ tr * o
2717
2717
  );
2718
2718
  let d;
2719
2719
  const p = (b) => {
@@ -2870,7 +2870,7 @@ const fi = "readium-column-snapper-style", Jn = 200, U = class U extends Rt {
2870
2870
  }), e.register("go_text", U.moduleName, (r, o) => {
2871
2871
  let a;
2872
2872
  Array.isArray(r) && (r.length > 1 && (a = r[1]), r = r[0]);
2873
- const l = at.deserialize(r), h = ie(this.wnd.document, new F({
2873
+ const l = at.deserialize(r), h = ie(this.wnd.document, new N({
2874
2874
  href: t.location.href,
2875
2875
  type: "text/html",
2876
2876
  text: l,
@@ -2921,7 +2921,7 @@ const fi = "readium-column-snapper-style", Jn = 200, U = class U extends Rt {
2921
2921
  this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), o(!0);
2922
2922
  });
2923
2923
  }), e.register("first_visible_locator", U.moduleName, (r, o) => {
2924
- const a = Ne(t, !1);
2924
+ const a = Fe(t, !1);
2925
2925
  this.comms.send("first_visible_locator", a.serialize()), o(!0);
2926
2926
  }), t.addEventListener("touchstart", this.onTouchStarter, { passive: !0 }), t.addEventListener("touchend", this.onTouchEnder, { passive: !0 }), t.addEventListener("touchmove", this.onTouchMover, { passive: !0 }), t.document.addEventListener("touchstart", () => {
2927
2927
  }), e.log("ColumnSnapper Mounted"), !0;
@@ -2978,7 +2978,7 @@ const yi = "readium-scroll-snapper-style", W = class W extends Rt {
2978
2978
  });
2979
2979
  }
2980
2980
  enableScrollProtection() {
2981
- this.patternAnalyzer || (this.patternAnalyzer = new Ue(Zi), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
2981
+ this.patternAnalyzer || (this.patternAnalyzer = new Ue(Qi), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
2982
2982
  }
2983
2983
  mount(t, e) {
2984
2984
  this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
@@ -2996,7 +2996,7 @@ const yi = "readium-scroll-snapper-style", W = class W extends Rt {
2996
2996
  this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
2997
2997
  }, 50);
2998
2998
  }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", W.moduleName, () => {
2999
- Yi(this.wnd);
2999
+ Ki(this.wnd);
3000
3000
  const n = this.doc().scrollTop;
3001
3001
  n > 1 ? this.doc().scrollTop = n - 1 : this.doc().scrollTop = n + 1, this.doc().scrollTop = n;
3002
3002
  }), e.register("go_progression", W.moduleName, (n, r) => {
@@ -3022,7 +3022,7 @@ const yi = "readium-scroll-snapper-style", W = class W extends Rt {
3022
3022
  }), e.register("go_text", W.moduleName, (n, r) => {
3023
3023
  let o;
3024
3024
  Array.isArray(n) && (n.length > 1 && (o = n[1]), n = n[0]);
3025
- const a = at.deserialize(n), l = ie(this.wnd.document, new F({
3025
+ const a = at.deserialize(n), l = ie(this.wnd.document, new N({
3026
3026
  href: t.location.href,
3027
3027
  type: "text/html",
3028
3028
  text: a,
@@ -3055,7 +3055,7 @@ const yi = "readium-scroll-snapper-style", W = class W extends Rt {
3055
3055
  ], W.moduleName, (n, r) => r(!1)), e.register("focus", W.moduleName, (n, r) => {
3056
3056
  this.reportProgress(), r(!0);
3057
3057
  }), e.register("first_visible_locator", W.moduleName, (n, r) => {
3058
- const o = Ne(t, !0);
3058
+ const o = Fe(t, !0);
3059
3059
  this.comms.send("first_visible_locator", o.serialize()), r(!0);
3060
3060
  }), e.log("ScrollSnapper Mounted"), !0;
3061
3061
  }
@@ -3111,7 +3111,7 @@ const H = class H extends Rt {
3111
3111
  });
3112
3112
  }
3113
3113
  enableScrollProtection() {
3114
- this.patternAnalyzer || (this.patternAnalyzer = new Ue(Zi), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
3114
+ this.patternAnalyzer || (this.patternAnalyzer = new Ue(Qi), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
3115
3115
  }
3116
3116
  mount(t, e) {
3117
3117
  return this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), this.resizeObserver = new ResizeObserver(() => {
@@ -3119,7 +3119,7 @@ const H = class H extends Rt {
3119
3119
  this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
3120
3120
  }, 50);
3121
3121
  }), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", H.moduleName, () => {
3122
- Yi(this.wnd);
3122
+ Ki(this.wnd);
3123
3123
  const i = this.doc().scrollTop;
3124
3124
  i > 1 ? this.doc().scrollTop = i - 1 : this.doc().scrollTop = i + 1, this.doc().scrollTop = i;
3125
3125
  }), e.register("go_progression", H.moduleName, (i, n) => {
@@ -3145,7 +3145,7 @@ const H = class H extends Rt {
3145
3145
  }), e.register("go_text", H.moduleName, (i, n) => {
3146
3146
  let r;
3147
3147
  Array.isArray(i) && (i.length > 1 && (r = i[1]), i = i[0]);
3148
- const o = at.deserialize(i), a = ie(this.wnd.document, new F({
3148
+ const o = at.deserialize(i), a = ie(this.wnd.document, new N({
3149
3149
  href: t.location.href,
3150
3150
  type: "text/html",
3151
3151
  text: o,
@@ -3178,7 +3178,7 @@ const H = class H extends Rt {
3178
3178
  ], H.moduleName, (i, n) => n(!1)), e.register("focus", H.moduleName, (i, n) => {
3179
3179
  this.reportProgress(), n(!0);
3180
3180
  }), e.register("first_visible_locator", H.moduleName, (i, n) => {
3181
- const r = Ne(t, !0);
3181
+ const r = Fe(t, !0);
3182
3182
  e.send("first_visible_locator", r.serialize()), n(!0);
3183
3183
  }), e.log("WebPubSnapper Mounted"), !0;
3184
3184
  }
@@ -3188,7 +3188,7 @@ const H = class H extends Rt {
3188
3188
  };
3189
3189
  H.moduleName = "webpub_snapper";
3190
3190
  let _e = H;
3191
- class Qn {
3191
+ class er {
3192
3192
  constructor(t, e) {
3193
3193
  this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
3194
3194
  }
@@ -3228,8 +3228,8 @@ class Qn {
3228
3228
  this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.copyHistory = [], this.options.enabled = !1;
3229
3229
  }
3230
3230
  }
3231
- class tr {
3232
- constructor(t = Ji) {
3231
+ class ir {
3232
+ constructor(t = tn) {
3233
3233
  this.options = t, this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
3234
3234
  }
3235
3235
  analyze(t) {
@@ -3270,7 +3270,7 @@ class tr {
3270
3270
  this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
3271
3271
  }
3272
3272
  }
3273
- class Qi {
3273
+ class en {
3274
3274
  /**
3275
3275
  * Checks if the given keyboard event matches any of the provided key combinations
3276
3276
  */
@@ -3350,7 +3350,7 @@ class Qi {
3350
3350
  }
3351
3351
  const gt = class gt extends bt {
3352
3352
  constructor() {
3353
- 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 Qi(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
3353
+ 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 en(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
3354
3354
  if (!this.isBulkCopyProtectionEnabled || !this.bulkCopyProtector)
3355
3355
  return !0;
3356
3356
  if (!this.bulkCopyProtector.shouldAllowCopy(t)) {
@@ -3471,16 +3471,16 @@ const gt = class gt extends bt {
3471
3471
  }
3472
3472
  addBulkCopyProtection(t = {}) {
3473
3473
  if (this.isBulkCopyProtectionEnabled || !this.wnd) return;
3474
- const e = Zn, i = t ? { ...e, ...t } : e;
3475
- this.bulkCopyProtector = new Qn(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
3474
+ const e = Qn, i = t ? { ...e, ...t } : e;
3475
+ this.bulkCopyProtector = new er(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
3476
3476
  }
3477
3477
  removeBulkCopyProtection() {
3478
3478
  !this.isBulkCopyProtectionEnabled || !this.wnd || (this.wnd.document.removeEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.removeEventListener("cut", this.preventBulkCopy, !0), this.bulkCopyProtector?.destroy(), this.bulkCopyProtector = null, this.isBulkCopyProtectionEnabled = !1);
3479
3479
  }
3480
3480
  addSelectionMonitoring(t) {
3481
3481
  if (this.isSelectionMonitoringEnabled || !this.wnd) return;
3482
- const e = t || Ji;
3483
- this.selectionAnalyzer = new tr(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
3482
+ const e = t || tn;
3483
+ this.selectionAnalyzer = new ir(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
3484
3484
  }
3485
3485
  removeSelectionMonitoring() {
3486
3486
  !this.isSelectionMonitoringEnabled || !this.wnd || (this.wnd.document.removeEventListener("selectionchange", this.handleSelection), this.selectionAnalyzer?.clear(), this.selectionAnalyzer = null, this.isSelectionMonitoringEnabled = !1);
@@ -3513,7 +3513,7 @@ const gt = class gt extends bt {
3513
3513
  y: t.clientY * i,
3514
3514
  targetFrameSrc: this.wnd.location.href,
3515
3515
  targetElement: t.target.outerHTML,
3516
- interactiveElement: qi(t.target)?.outerHTML,
3516
+ interactiveElement: Zi(t.target)?.outerHTML,
3517
3517
  cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(t.target)
3518
3518
  }), this.pointerMoved = !1;
3519
3519
  }
@@ -3622,7 +3622,7 @@ const Ct = class Ct extends bt {
3622
3622
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
3623
3623
  value: {
3624
3624
  name: "readium-ts-toolkit",
3625
- version: "2.4.0-beta.5",
3625
+ version: "2.4.0-beta.7",
3626
3626
  hasFeature: (n, r = "") => {
3627
3627
  switch (n) {
3628
3628
  case "dom-manipulation":
@@ -3685,9 +3685,9 @@ const Si = "readium-viewport", K = class K extends Bt {
3685
3685
  ), t.document.head.appendChild(i), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
3686
3686
  target: t
3687
3687
  }), e.register("get_properties", K.moduleName, (n, r) => {
3688
- Fe(t), r(!0);
3688
+ Ne(t), r(!0);
3689
3689
  }), e.register("update_properties", K.moduleName, (n, r) => {
3690
- n["--RS__viewportWidth"] = `${t.innerWidth}px`, $i(t, n), r(!0);
3690
+ n["--RS__viewportWidth"] = `${t.innerWidth}px`, Yi(t, n), r(!0);
3691
3691
  }), e.register("set_property", K.moduleName, (n, r) => {
3692
3692
  const o = n;
3693
3693
  xt(t, o[0], o[1]), r(!0);
@@ -3761,9 +3761,9 @@ const Z = class Z extends bt {
3761
3761
  this.wndOnErr,
3762
3762
  !1
3763
3763
  ), e.register("get_properties", Z.moduleName, (i, n) => {
3764
- Fe(t), n(!0);
3764
+ Ne(t), n(!0);
3765
3765
  }), e.register("update_properties", Z.moduleName, (i, n) => {
3766
- $i(t, i), n(!0);
3766
+ Yi(t, i), n(!0);
3767
3767
  }), e.register("set_property", Z.moduleName, (i, n) => {
3768
3768
  const r = i;
3769
3769
  xt(t, r[0], r[1]), n(!0);
@@ -3780,7 +3780,7 @@ const Z = class Z extends bt {
3780
3780
  Z.moduleName = "webpub_setup";
3781
3781
  let xe = Z;
3782
3782
  var it;
3783
- let er = (it = class extends bt {
3783
+ let nr = (it = class extends bt {
3784
3784
  constructor() {
3785
3785
  super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
3786
3786
  }
@@ -3816,19 +3816,19 @@ let er = (it = class extends bt {
3816
3816
  return this.beforePrintHandler && (t.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null), this.comms?.unregisterAll(it.moduleName), this.configApplied = !1, !0;
3817
3817
  }
3818
3818
  }, it.moduleName = "print_protection", it);
3819
- const ir = [
3819
+ const rr = [
3820
3820
  "fixed_setup",
3821
3821
  "decorator",
3822
3822
  "peripherals",
3823
3823
  "print_protection"
3824
- ], nr = [
3824
+ ], sr = [
3825
3825
  "reflowable_setup",
3826
3826
  "decorator",
3827
3827
  "peripherals",
3828
3828
  "column_snapper",
3829
3829
  "scroll_snapper",
3830
3830
  "print_protection"
3831
- ], rr = [
3831
+ ], or = [
3832
3832
  "webpub_setup",
3833
3833
  "webpub_snapper",
3834
3834
  "decorator",
@@ -3844,7 +3844,7 @@ const ir = [
3844
3844
  be,
3845
3845
  ve,
3846
3846
  we,
3847
- er
3847
+ nr
3848
3848
  ].map((s) => [s.moduleName, s]));
3849
3849
  class St {
3850
3850
  /**
@@ -3852,7 +3852,7 @@ class St {
3852
3852
  * @param initialModules List of initial modules to load
3853
3853
  */
3854
3854
  constructor(t = window, e = []) {
3855
- this.loadedModules = [], this.wnd = t, this.comms = new kn(t);
3855
+ this.loadedModules = [], this.wnd = t, this.comms = new Tn(t);
3856
3856
  const i = [...new Set(e)];
3857
3857
  if (i.length) {
3858
3858
  if (typeof t > "u")
@@ -3896,7 +3896,7 @@ class St {
3896
3896
  this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
3897
3897
  }
3898
3898
  }
3899
- const sr = {
3899
+ const ar = {
3900
3900
  type: "developer_tools",
3901
3901
  keyCombos: [
3902
3902
  { keyCode: 73, meta: !0, alt: !0 },
@@ -3920,7 +3920,7 @@ const sr = {
3920
3920
  { keyCode: 123, meta: !0, alt: !0 }
3921
3921
  // F12+Meta+Alt
3922
3922
  ]
3923
- }, or = {
3923
+ }, lr = {
3924
3924
  type: "select_all",
3925
3925
  keyCombos: [
3926
3926
  { keyCode: 65, meta: !0 },
@@ -3928,7 +3928,7 @@ const sr = {
3928
3928
  { keyCode: 65, ctrl: !0 }
3929
3929
  // A key (Ctrl+A)
3930
3930
  ]
3931
- }, ar = {
3931
+ }, hr = {
3932
3932
  type: "print",
3933
3933
  keyCombos: [
3934
3934
  { keyCode: 80, meta: !0 },
@@ -3944,7 +3944,7 @@ const sr = {
3944
3944
  { keyCode: 80, ctrl: !0, alt: !0 }
3945
3945
  // P key (Ctrl+Alt+P)
3946
3946
  ]
3947
- }, lr = {
3947
+ }, cr = {
3948
3948
  type: "save",
3949
3949
  keyCombos: [
3950
3950
  { keyCode: 83, meta: !0 },
@@ -3953,7 +3953,7 @@ const sr = {
3953
3953
  // S key (Ctrl+S)
3954
3954
  ]
3955
3955
  };
3956
- class tn {
3956
+ class nn {
3957
3957
  /**
3958
3958
  * Merges keyboard peripherals from content protection config with user-provided peripherals
3959
3959
  * Content protection peripherals are added first for priority, then user peripherals are added only if they don't conflict
@@ -3962,7 +3962,7 @@ class tn {
3962
3962
  const i = [], n = e.filter(
3963
3963
  (r) => !["developer_tools", "select_all", "print", "save"].includes(r.type)
3964
3964
  );
3965
- t.disableSelectAll && i.push(or), t.disableSave && i.push(lr), t.monitorDevTools && i.push(sr), t.protectPrinting?.disable && i.push(ar);
3965
+ t.disableSelectAll && i.push(lr), t.disableSave && i.push(cr), t.monitorDevTools && i.push(ar), t.protectPrinting?.disable && i.push(hr);
3966
3966
  for (const r of n) {
3967
3967
  const o = r.keyCombos.filter(
3968
3968
  (a) => !i.some(
@@ -3979,7 +3979,7 @@ class tn {
3979
3979
  return i;
3980
3980
  }
3981
3981
  }
3982
- class en extends tn {
3982
+ class rn extends nn {
3983
3983
  /**
3984
3984
  * Moves to the left content portion (eg. page) relative to the reading progression direction.
3985
3985
  */
@@ -3993,9 +3993,9 @@ class en extends tn {
3993
3993
  this.readingProgression === D.ltr ? this.goForward(t, e) : this.readingProgression === D.rtl && this.goBackward(t, e);
3994
3994
  }
3995
3995
  }
3996
- class hr extends tn {
3996
+ class dr extends nn {
3997
3997
  }
3998
- class cr {
3998
+ class ur {
3999
3999
  constructor(t, e, i, n) {
4000
4000
  this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
4001
4001
  }
@@ -4045,7 +4045,7 @@ class cr {
4045
4045
  return n + o;
4046
4046
  }
4047
4047
  }
4048
- const dr = 1e4;
4048
+ const pr = 1e4;
4049
4049
  class Lt {
4050
4050
  constructor(t, e) {
4051
4051
  this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
@@ -4056,7 +4056,7 @@ class Lt {
4056
4056
  }
4057
4057
  this.gc = setInterval(() => {
4058
4058
  this.registry.forEach((i, n) => {
4059
- performance.now() - i.time > dr && (console.warn(n, "event for", i.key, "was never handled!"), this.registry.delete(n));
4059
+ performance.now() - i.time > pr && (console.warn(n, "event for", i.key, "was never handled!"), this.registry.delete(n));
4060
4060
  });
4061
4061
  }, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
4062
4062
  }
@@ -4125,12 +4125,12 @@ class Lt {
4125
4125
  ), o;
4126
4126
  }
4127
4127
  }
4128
- const ur = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", pr = {
4129
- RS__oldStyleTf: ur
4130
- }, mr = 16, vi = pr.RS__oldStyleTf;
4128
+ const mr = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", gr = {
4129
+ RS__oldStyleTf: mr
4130
+ }, fr = 16, vi = gr.RS__oldStyleTf;
4131
4131
  class _t {
4132
4132
  constructor(t) {
4133
- this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || mr, this._fontFace = t.fontFace || vi, 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 = _t.approximateWordSpaces(this._optimalChars, this._sample);
4133
+ this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || fr, this._fontFace = t.fontFace || vi, 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 = _t.approximateWordSpaces(this._optimalChars, this._sample);
4134
4134
  }
4135
4135
  updateMultipliers() {
4136
4136
  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;
@@ -4202,10 +4202,10 @@ class _t {
4202
4202
  return this.getLineLengthFallback();
4203
4203
  }
4204
4204
  }
4205
- const nn = () => typeof navigator > "u" ? "" : navigator.userAgent || "", rn = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
4206
- class sn {
4205
+ const sn = () => typeof navigator > "u" ? "" : navigator.userAgent || "", on = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
4206
+ class an {
4207
4207
  constructor() {
4208
- const t = rn(), e = nn(), i = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((o) => parseInt(o) || 0) : [], n = (r = "") => {
4208
+ const t = on(), e = sn(), i = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((o) => parseInt(o) || 0) : [], n = (r = "") => {
4209
4209
  if (!r) return [];
4210
4210
  const o = new RegExp("^.*" + r + "[ :\\/]?(\\d+([\\._]\\d+)*).*$");
4211
4211
  return o.test(e) ? i(e.replace(o, "$1")) : [];
@@ -4236,17 +4236,17 @@ class sn {
4236
4236
  }, []) };
4237
4237
  }
4238
4238
  }
4239
- class gr extends sn {
4239
+ class yr extends an {
4240
4240
  get iOSRequest() {
4241
- const t = rn(), e = nn();
4241
+ const t = on(), e = sn();
4242
4242
  if (this.OS.iOS && !this.OS.iPadOS)
4243
4243
  return "mobile";
4244
4244
  if (this.OS.iPadOS)
4245
4245
  return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
4246
4246
  }
4247
4247
  }
4248
- const q = new sn(), T = new gr();
4249
- class fr {
4248
+ const q = new an(), T = new yr();
4249
+ class Sr {
4250
4250
  constructor(t, e = {}, i = []) {
4251
4251
  this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.frame.style.backgroundColor = "#FFFFFF", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
4252
4252
  }
@@ -4337,7 +4337,7 @@ class fr {
4337
4337
  return this.loader;
4338
4338
  }
4339
4339
  }
4340
- class yr {
4340
+ class br {
4341
4341
  constructor(t, e, i, n = {}, r = []) {
4342
4342
  this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.currentCssProperties = e, this.injector = i, this.contentProtectionConfig = n, this.keyboardPeripheralsConfig = [...r];
4343
4343
  }
@@ -4388,7 +4388,7 @@ class yr {
4388
4388
  const p = t.readingOrder.findWithHref(d);
4389
4389
  if (!p) return;
4390
4390
  if (!this.blobs.has(d)) {
4391
- const k = await new cr(
4391
+ const k = await new ur(
4392
4392
  t,
4393
4393
  this.currentBaseURL || "",
4394
4394
  p,
@@ -4399,7 +4399,7 @@ class yr {
4399
4399
  ).build();
4400
4400
  this.blobs.set(d, k);
4401
4401
  }
4402
- const b = new fr(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
4402
+ const b = new Sr(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
4403
4403
  d !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(d, b);
4404
4404
  };
4405
4405
  try {
@@ -4454,7 +4454,7 @@ class yr {
4454
4454
  }
4455
4455
  }
4456
4456
  var de, wi;
4457
- function Sr() {
4457
+ function vr() {
4458
4458
  if (wi) return de;
4459
4459
  wi = 1;
4460
4460
  function s(n) {
@@ -4641,11 +4641,11 @@ function Sr() {
4641
4641
  };
4642
4642
  return i.posix = i, de = i, de;
4643
4643
  }
4644
- var jt = Sr();
4645
- const br = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, vr = { description: "Attemps 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" }, wr = {
4646
- experimentalHeaderFiltering: br,
4647
- experimentalZoom: vr
4648
- }, Ie = wr;
4644
+ var jt = vr();
4645
+ const wr = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, _r = { description: "Attemps 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" }, Pr = {
4646
+ experimentalHeaderFiltering: wr,
4647
+ experimentalZoom: _r
4648
+ }, Ie = Pr;
4649
4649
  var J = /* @__PURE__ */ ((s) => (s.start = "start", s.left = "left", s.right = "right", s.justify = "justify", s))(J || {});
4650
4650
  const ht = {
4651
4651
  range: [0, 100],
@@ -4717,7 +4717,7 @@ class re {
4717
4717
  return `${t}rem`;
4718
4718
  }
4719
4719
  }
4720
- class on extends re {
4720
+ class ln extends re {
4721
4721
  constructor(t) {
4722
4722
  super(), this.a11yNormalize = t.a11yNormalize ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.fontFamily = t.fontFamily ?? null, this.fontWeight = t.fontWeight ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.textAlign = t.textAlign ?? null, this.wordSpacing = t.wordSpacing ?? null, this.zoom = t.zoom ?? null;
4723
4723
  }
@@ -4726,7 +4726,7 @@ class on extends re {
4726
4726
  return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), this.zoom !== null && (t["--USER__zoom"] = this.toPercentage(this.zoom, !0)), t;
4727
4727
  }
4728
4728
  }
4729
- class _r extends re {
4729
+ class Er extends re {
4730
4730
  constructor(t) {
4731
4731
  super(), this.experiments = t.experiments ?? null;
4732
4732
  }
@@ -4737,7 +4737,7 @@ class _r extends re {
4737
4737
  }), t;
4738
4738
  }
4739
4739
  }
4740
- class Pr {
4740
+ class Cr {
4741
4741
  constructor(t) {
4742
4742
  this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
4743
4743
  }
@@ -4760,13 +4760,13 @@ class Pr {
4760
4760
  wordSpacing: t.wordSpacing,
4761
4761
  zoom: t.zoom
4762
4762
  };
4763
- this.userProperties = new on(e);
4763
+ this.userProperties = new ln(e);
4764
4764
  }
4765
4765
  }
4766
- function Er(s, t) {
4766
+ function xr(s, t) {
4767
4767
  return s == null || t == null || s <= t ? s : void 0;
4768
4768
  }
4769
- function Cr(s, t) {
4769
+ function Rr(s, t) {
4770
4770
  return s == null || t == null || s >= t ? s : void 0;
4771
4771
  }
4772
4772
  function I(s) {
@@ -4797,7 +4797,7 @@ function M(s, t) {
4797
4797
  function ue(s, t) {
4798
4798
  return s === void 0 ? t : s;
4799
4799
  }
4800
- function an(s) {
4800
+ function hn(s) {
4801
4801
  if (s !== void 0)
4802
4802
  return s === null ? null : s.filter((t) => t in Ie);
4803
4803
  }
@@ -4824,9 +4824,9 @@ class kt {
4824
4824
  return new kt(e);
4825
4825
  }
4826
4826
  }
4827
- class xr {
4827
+ class Lr {
4828
4828
  constructor(t) {
4829
- this.fontFamily = I(t.fontFamily) || null, this.fontWeight = M(t.fontWeight, nt.range) || null, this.hyphens = P(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = w(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.textAlign = se(t.textAlign, J) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = w(t.wordSpacing) || null, this.zoom = M(t.zoom, Jt.range) || 1, this.experiments = an(t.experiments) ?? null;
4829
+ this.fontFamily = I(t.fontFamily) || null, this.fontWeight = M(t.fontWeight, nt.range) || null, this.hyphens = P(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = w(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.textAlign = se(t.textAlign, J) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = w(t.wordSpacing) || null, this.zoom = M(t.zoom, Jt.range) || 1, this.experiments = hn(t.experiments) ?? null;
4830
4830
  }
4831
4831
  }
4832
4832
  class _i {
@@ -4879,7 +4879,7 @@ class O extends A {
4879
4879
  this._value = !this._value, this._onChange(this._value);
4880
4880
  }
4881
4881
  }
4882
- class ln extends A {
4882
+ class cn extends A {
4883
4883
  constructor({
4884
4884
  initialValue: t = null,
4885
4885
  effectiveValue: e,
@@ -5096,7 +5096,7 @@ class Pi {
5096
5096
  });
5097
5097
  }
5098
5098
  get textAlign() {
5099
- return new ln({
5099
+ return new cn({
5100
5100
  initialValue: this.preferences.textAlign,
5101
5101
  effectiveValue: this.settings.textAlign || J.start,
5102
5102
  isEffective: this.isDisplayTransformable,
@@ -5141,7 +5141,7 @@ class Pi {
5141
5141
  });
5142
5142
  }
5143
5143
  }
5144
- const hn = (s) => {
5144
+ const dn = (s) => {
5145
5145
  if ("blob" in s && s.blob.type)
5146
5146
  return s.blob.type;
5147
5147
  if (s.as === "script")
@@ -5151,22 +5151,22 @@ const hn = (s) => {
5151
5151
  if (t.endsWith(".css")) return "text/css";
5152
5152
  if ([".js", ".mjs", ".cjs"].some((e) => t.endsWith(e))) return "text/javascript";
5153
5153
  }
5154
- }, cn = (s, t) => {
5154
+ }, un = (s, t) => {
5155
5155
  t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
5156
5156
  e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && s.setAttribute(e, "") : s.setAttribute(e, i));
5157
5157
  });
5158
- }, Rr = (s, t, e) => {
5158
+ }, kr = (s, t, e) => {
5159
5159
  const i = s.createElement("script");
5160
5160
  i.dataset.readium = "true", t.id && (i.id = t.id);
5161
- const n = t.type || hn(t);
5162
- return n && (i.type = n), cn(i, t), i.src = e, i;
5161
+ const n = t.type || dn(t);
5162
+ return n && (i.type = n), un(i, t), i.src = e, i;
5163
5163
  }, Ei = (s, t, e) => {
5164
5164
  const i = s.createElement("link");
5165
5165
  i.dataset.readium = "true", t.id && (i.id = t.id), t.rel && (i.rel = t.rel);
5166
- const n = t.type || hn(t);
5167
- return n && (i.type = n), cn(i, t), i.href = e, i;
5166
+ const n = t.type || dn(t);
5167
+ return n && (i.type = n), un(i, t), i.href = e, i;
5168
5168
  };
5169
- class dn {
5169
+ class pn {
5170
5170
  constructor(t) {
5171
5171
  this.blobStore = /* @__PURE__ */ new Map(), this.createdBlobUrls = /* @__PURE__ */ new Set(), this.allowedDomains = [], this.injectableIdCounter = 0, this.allowedDomains = (t.allowedDomains || []).map((e) => {
5172
5172
  try {
@@ -5252,7 +5252,7 @@ class dn {
5252
5252
  }
5253
5253
  createElement(t, e, i) {
5254
5254
  if (e.as === "script")
5255
- return Rr(t, e, i);
5255
+ return kr(t, e, i);
5256
5256
  if (e.as === "link")
5257
5257
  return Ei(t, e, i);
5258
5258
  throw new Error(`Unsupported element type: ${e.as}`);
@@ -5311,7 +5311,7 @@ class dn {
5311
5311
  }
5312
5312
  }
5313
5313
  }
5314
- const yt = (s) => s.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ft = (s) => s.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), Lr = `/*!
5314
+ const yt = (s) => s.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Nt = (s) => s.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), Or = `/*!
5315
5315
  * Readium CSS v.2.0.0
5316
5316
  * Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
5317
5317
  * Use of this source code is governed by a BSD-style license which is detailed in the
@@ -5585,11 +5585,11 @@ const yt = (s) => s.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5585
5585
 
5586
5586
  :root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
5587
5587
  -webkit-text-zoom:normal;
5588
- }`, un = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', kr = `// WebPub-specific setup - no execution blocking needed
5588
+ }`, mn = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', Tr = `// WebPub-specific setup - no execution blocking needed
5589
5589
  window._readium_blockedEvents = [];
5590
5590
  window._readium_blockEvents = false; // WebPub doesn't need event blocking
5591
5591
  window._readium_eventBlocker = null;
5592
- `, pn = `(function() {
5592
+ `, gn = `(function() {
5593
5593
  if(window.onload) window.onload = new Proxy(window.onload, {
5594
5594
  apply: function(target, receiver, args) {
5595
5595
  if(!window._readium_blockEvents) {
@@ -5603,21 +5603,21 @@ window._readium_eventBlocker = null;
5603
5603
  });
5604
5604
  })();
5605
5605
  `;
5606
- function Or(s) {
5606
+ function Ar(s) {
5607
5607
  const t = s.filter((r) => r.mediaType.isHTML).map((r) => r.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
5608
5608
  // CSS Selector Generator - always injected
5609
5609
  {
5610
5610
  id: "css-selector-generator",
5611
5611
  as: "script",
5612
5612
  target: "head",
5613
- blob: new Blob([yt(un)], { type: "text/javascript" })
5613
+ blob: new Blob([yt(mn)], { type: "text/javascript" })
5614
5614
  },
5615
5615
  // WebPub Execution - always injected (sets up event blocking to false)
5616
5616
  {
5617
5617
  id: "webpub-execution",
5618
5618
  as: "script",
5619
5619
  target: "head",
5620
- blob: new Blob([yt(kr)], { type: "text/javascript" })
5620
+ blob: new Blob([yt(Tr)], { type: "text/javascript" })
5621
5621
  }
5622
5622
  ], n = [
5623
5623
  // Onload Proxy - conditional (has executable scripts)
@@ -5625,7 +5625,7 @@ function Or(s) {
5625
5625
  id: "onload-proxy",
5626
5626
  as: "script",
5627
5627
  target: "head",
5628
- blob: new Blob([yt(pn)], { type: "text/javascript" }),
5628
+ blob: new Blob([yt(gn)], { type: "text/javascript" }),
5629
5629
  condition: (r) => !!(r.querySelector("script") || r.querySelector("body[onload]:not(body[onload=''])"))
5630
5630
  },
5631
5631
  // Readium CSS WebPub - always injected
@@ -5633,7 +5633,7 @@ function Or(s) {
5633
5633
  id: "readium-css-webpub",
5634
5634
  as: "link",
5635
5635
  target: "head",
5636
- blob: new Blob([Ft(Lr)], { type: "text/css" }),
5636
+ blob: new Blob([Nt(Or)], { type: "text/css" }),
5637
5637
  rel: "stylesheet"
5638
5638
  }
5639
5639
  ];
@@ -5645,7 +5645,7 @@ function Or(s) {
5645
5645
  }
5646
5646
  ];
5647
5647
  }
5648
- class Tr {
5648
+ class zr {
5649
5649
  constructor(t) {
5650
5650
  if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
5651
5651
  throw new Error("onDetected callback is required");
@@ -5677,11 +5677,11 @@ class Tr {
5677
5677
  this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
5678
5678
  }
5679
5679
  }
5680
- let Ar = 0;
5681
- function zr() {
5682
- return ++Ar;
5680
+ let Mr = 0;
5681
+ function Nr() {
5682
+ return ++Mr;
5683
5683
  }
5684
- const Mr = `
5684
+ const Fr = `
5685
5685
  onmessage = function(event) {
5686
5686
  var action = event.data;
5687
5687
  var startTime = performance.now()
@@ -5702,7 +5702,7 @@ onmessage = function(event) {
5702
5702
  }, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
5703
5703
  }
5704
5704
  async send(t, ...e) {
5705
- const i = zr();
5705
+ const i = Nr();
5706
5706
  return new Promise((n, r) => {
5707
5707
  this.callbacks.set(i, n), this.worker.postMessage({
5708
5708
  id: i,
@@ -5717,13 +5717,13 @@ onmessage = function(event) {
5717
5717
  this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
5718
5718
  }
5719
5719
  };
5720
- Ve.workerScript = Mr;
5720
+ Ve.workerScript = Fr;
5721
5721
  let ee = Ve;
5722
5722
  function De(s) {
5723
5723
  return typeof window < "u" && console ? console[s] : (...t) => {
5724
5724
  };
5725
5725
  }
5726
- const Fr = De("log"), Ci = De("table"), Nr = De("clear");
5726
+ const Ur = De("log"), Ci = De("table"), Ir = De("clear");
5727
5727
  async function xi() {
5728
5728
  if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
5729
5729
  try {
@@ -5736,10 +5736,10 @@ async function xi() {
5736
5736
  }
5737
5737
  return !1;
5738
5738
  }
5739
- function Ur(s) {
5739
+ function Dr(s) {
5740
5740
  return s.excludes.some((t) => t()) ? !1 : s.includes.some((t) => t());
5741
5741
  }
5742
- class Ir {
5742
+ class Wr {
5743
5743
  constructor(t = {}) {
5744
5744
  if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
5745
5745
  onDetected: t.onDetected || (() => {
@@ -5801,14 +5801,14 @@ class Ir {
5801
5801
  return (await this.workerConsole.log(t)).time;
5802
5802
  {
5803
5803
  const e = performance.now();
5804
- return Fr(t), performance.now() - e;
5804
+ return Ur(t), performance.now() - e;
5805
5805
  }
5806
5806
  }
5807
5807
  /**
5808
5808
  * Check if performance-based detection is enabled for current browser
5809
5809
  */
5810
5810
  isPerformanceDetectionEnabled() {
5811
- return Ur({
5811
+ return Dr({
5812
5812
  includes: [
5813
5813
  () => !!q.UA.Chrome,
5814
5814
  () => !!q.UA.Chromium,
@@ -5831,7 +5831,7 @@ class Ir {
5831
5831
  if (!this.isPerformanceDetectionEnabled())
5832
5832
  return !1;
5833
5833
  const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
5834
- return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Nr(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await xi() : t > this.maxPrintTime * 10;
5834
+ return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Ir(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await xi() : t > this.maxPrintTime * 10;
5835
5835
  }
5836
5836
  /**
5837
5837
  * Debugger-based detection (fallback method)
@@ -5886,7 +5886,7 @@ class Ir {
5886
5886
  this.intervalId && (clearInterval(this.intervalId), this.intervalId = void 0), this.workerConsole && this.workerConsole.destroy(), this.isOpen = !1, this.checkCount = 0;
5887
5887
  }
5888
5888
  }
5889
- class Dr {
5889
+ class Hr {
5890
5890
  constructor(t) {
5891
5891
  if (this.detected = !1, !t.onDetected)
5892
5892
  throw new Error("onDetected callback is required");
@@ -5921,7 +5921,7 @@ class Dr {
5921
5921
  this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
5922
5922
  }
5923
5923
  }
5924
- class Wr {
5924
+ class Br {
5925
5925
  constructor(t = {}) {
5926
5926
  this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
5927
5927
  }
@@ -5947,7 +5947,7 @@ class Wr {
5947
5947
  this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
5948
5948
  }
5949
5949
  }
5950
- class Hr {
5950
+ class Vr {
5951
5951
  constructor(t = {}) {
5952
5952
  this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
5953
5953
  }
@@ -5979,7 +5979,7 @@ class We {
5979
5979
  window.dispatchEvent(i);
5980
5980
  }
5981
5981
  constructor(t = {}) {
5982
- t.monitorDevTools && (this.devToolsDetector = new Ir({
5982
+ t.monitorDevTools && (this.devToolsDetector = new Wr({
5983
5983
  onDetected: () => {
5984
5984
  this.dispatchSuspiciousActivity("developer_tools", {
5985
5985
  targetFrameSrc: "",
@@ -5992,20 +5992,20 @@ class We {
5992
5992
  metaKey: !1
5993
5993
  });
5994
5994
  }
5995
- })), t.checkAutomation && (this.automationDetector = new Tr({
5995
+ })), t.checkAutomation && (this.automationDetector = new zr({
5996
5996
  onDetected: (e) => {
5997
5997
  this.dispatchSuspiciousActivity("automation_detected", { tool: e });
5998
5998
  }
5999
- })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Dr({
5999
+ })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Hr({
6000
6000
  onDetected: (e) => {
6001
6001
  this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
6002
6002
  }
6003
- })), t.protectPrinting?.disable && (this.printProtector = new Wr({
6003
+ })), t.protectPrinting?.disable && (this.printProtector = new Br({
6004
6004
  ...t.protectPrinting,
6005
6005
  onPrintAttempt: () => {
6006
6006
  this.dispatchSuspiciousActivity("print", {});
6007
6007
  }
6008
- })), t.disableContextMenu && (this.contextMenuProtector = new Hr({
6008
+ })), t.disableContextMenu && (this.contextMenuProtector = new Vr({
6009
6009
  onContextMenuBlocked: (e) => {
6010
6010
  this.dispatchSuspiciousActivity("context_menu", e);
6011
6011
  }
@@ -6018,7 +6018,7 @@ class We {
6018
6018
  const ot = "readium:navigator:keyboardPeripheral";
6019
6019
  class He {
6020
6020
  constructor(t = {}) {
6021
- this.keyManager = new Qi(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
6021
+ this.keyManager = new en(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
6022
6022
  }
6023
6023
  setupKeyboardPeripherals(t) {
6024
6024
  if (t.length > 0) {
@@ -6041,7 +6041,7 @@ class He {
6041
6041
  this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = void 0);
6042
6042
  }
6043
6043
  }
6044
- const Br = (s) => ({
6044
+ const jr = (s) => ({
6045
6045
  frameLoaded: s.frameLoaded || (() => {
6046
6046
  }),
6047
6047
  positionChanged: s.positionChanged || (() => {
@@ -6064,18 +6064,18 @@ const Br = (s) => ({
6064
6064
  peripheral: s.peripheral || (() => {
6065
6065
  })
6066
6066
  });
6067
- class Vr extends en {
6067
+ class Gr extends rn {
6068
6068
  constructor(t, e, i, n = void 0, r = { preferences: {}, defaults: {} }) {
6069
6069
  super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
6070
6070
  readingOrder: [],
6071
6071
  progressions: /* @__PURE__ */ new Map(),
6072
6072
  positions: null
6073
- }, this.pub = e, this.container = t, this.listeners = Br(i), this._preferences = new kt(r.preferences), this._defaults = new xr(r.defaults), this._settings = new _i(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new Pr({
6074
- rsProperties: new _r({ experiments: this._settings.experiments || null }),
6075
- userProperties: new on({ zoom: this._settings.zoom })
6073
+ }, this.pub = e, this.container = t, this.listeners = jr(i), this._preferences = new kt(r.preferences), this._defaults = new Lr(r.defaults), this._settings = new _i(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new Cr({
6074
+ rsProperties: new Er({ experiments: this._settings.experiments || null }),
6075
+ userProperties: new ln({ zoom: this._settings.zoom })
6076
6076
  });
6077
- const o = Or(e.readingOrder.items), a = r.injectables || { rules: [], allowedDomains: [] };
6078
- if (this._injector = new dn({
6077
+ const o = Ar(e.readingOrder.items), a = r.injectables || { rules: [], allowedDomains: [] };
6078
+ if (this._injector = new pn({
6079
6079
  rules: [...o, ...a.rules],
6080
6080
  allowedDomains: a.allowedDomains
6081
6081
  }), this._contentProtection = r.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
@@ -6099,7 +6099,7 @@ class Vr extends en {
6099
6099
  async load() {
6100
6100
  await this.updateCSS(!1);
6101
6101
  const t = this.compileCSSProperties(this._css);
6102
- this.framePool = new yr(
6102
+ this.framePool = new br(
6103
6103
  this.container,
6104
6104
  t,
6105
6105
  this._injector,
@@ -6153,9 +6153,9 @@ class Vr extends en {
6153
6153
  this.listeners.frameLoaded(this.framePool.currentFrames[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
6154
6154
  break;
6155
6155
  case "first_visible_locator":
6156
- const i = F.deserialize(e);
6156
+ const i = N.deserialize(e);
6157
6157
  if (!i) break;
6158
- this.currentLocation = new F({
6158
+ this.currentLocation = new N({
6159
6159
  href: this.currentLocation.href,
6160
6160
  type: this.currentLocation.type,
6161
6161
  title: this.currentLocation.title,
@@ -6236,7 +6236,7 @@ class Vr extends en {
6236
6236
  }
6237
6237
  }
6238
6238
  determineModules() {
6239
- return Array.from(Vt.keys()).filter((e) => rr.includes(e));
6239
+ return Array.from(Vt.keys()).filter((e) => or.includes(e));
6240
6240
  }
6241
6241
  attachListener() {
6242
6242
  this.framePool.currentFrames[0]?.msg && (this.framePool.currentFrames[0].msg.listener = (t, e) => {
@@ -6363,7 +6363,7 @@ class Vr extends en {
6363
6363
  if (!e)
6364
6364
  throw new Error("No current resource available");
6365
6365
  const n = this.currentLocation && this.currentLocation.href === e.href && this.currentLocation.locations.progression ? this.currentLocation.locations.progression : 0;
6366
- return this.pub.manifest.locatorFromLink(e) || new F({
6366
+ return this.pub.manifest.locatorFromLink(e) || new N({
6367
6367
  href: e.href,
6368
6368
  type: e.type || "text/html",
6369
6369
  locations: new E({
@@ -6374,7 +6374,7 @@ class Vr extends en {
6374
6374
  });
6375
6375
  }
6376
6376
  }
6377
- const ks = Vr, jr = (s) => {
6377
+ const Ts = Gr, $r = (s) => {
6378
6378
  const t = s.join(" ");
6379
6379
  return [
6380
6380
  // 'self' is useless because the document is loaded from a blob: URL
@@ -6399,7 +6399,7 @@ const ks = Vr, jr = (s) => {
6399
6399
  //`report-uri ?`,
6400
6400
  ].join("; ");
6401
6401
  };
6402
- class mn {
6402
+ class fn {
6403
6403
  constructor(t, e, i, n) {
6404
6404
  this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
6405
6405
  }
@@ -6453,7 +6453,7 @@ class mn {
6453
6453
  c.href = i, c.dataset.readium = "true", t.head.firstChild.before(c);
6454
6454
  }
6455
6455
  const h = t.createElement("meta");
6456
- return h.httpEquiv = "Content-Security-Policy", h.content = jr(l), h.dataset.readium = "true", t.head.firstChild.before(h), URL.createObjectURL(
6456
+ return h.httpEquiv = "Content-Security-Policy", h.content = $r(l), h.dataset.readium = "true", t.head.firstChild.before(h), URL.createObjectURL(
6457
6457
  new Blob([new XMLSerializer().serializeToString(t)], {
6458
6458
  type: n.isHTML ? n.string : "application/xhtml+xml"
6459
6459
  // Fallback to XHTML
@@ -6461,7 +6461,7 @@ class mn {
6461
6461
  );
6462
6462
  }
6463
6463
  }
6464
- class Gr {
6464
+ class Xr {
6465
6465
  constructor(t, e = {}, i = []) {
6466
6466
  this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
6467
6467
  }
@@ -6559,7 +6559,7 @@ class Gr {
6559
6559
  }
6560
6560
  }
6561
6561
  const Ri = 5, Li = 3;
6562
- class $r {
6562
+ class Yr {
6563
6563
  constructor(t, e, i, n, r, o) {
6564
6564
  this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.positions = e, this.currentCssProperties = i, this.injector = n ?? null, this.contentProtectionConfig = r || {}, this.keyboardPeripheralsConfig = o || [];
6565
6565
  }
@@ -6611,7 +6611,7 @@ class $r {
6611
6611
  const p = t.readingOrder.findWithHref(d);
6612
6612
  if (!p) return;
6613
6613
  if (!this.blobs.has(d)) {
6614
- const k = await new mn(
6614
+ const k = await new fn(
6615
6615
  t,
6616
6616
  this.currentBaseURL || "",
6617
6617
  p,
@@ -6622,7 +6622,7 @@ class $r {
6622
6622
  ).build();
6623
6623
  this.blobs.set(d, k);
6624
6624
  }
6625
- const b = new Gr(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6625
+ const b = new Xr(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6626
6626
  d !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(d, b);
6627
6627
  };
6628
6628
  try {
@@ -6676,7 +6676,7 @@ class $r {
6676
6676
  }), t;
6677
6677
  }
6678
6678
  }
6679
- class Xr {
6679
+ class qr {
6680
6680
  constructor(t, e, i, n = {}, r = []) {
6681
6681
  this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...r], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = i, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === D.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
6682
6682
  }
@@ -6842,8 +6842,8 @@ class Xr {
6842
6842
  return this.loader;
6843
6843
  }
6844
6844
  }
6845
- var Yr = /* @__PURE__ */ ((s) => (s[s.Left = 0] = "Left", s[s.Center = 1] = "Center", s[s.Right = 2] = "Right", s))(Yr || {}), qr = /* @__PURE__ */ ((s) => (s[s.Top = 0] = "Top", s[s.Middle = 1] = "Middle", s[s.Bottom = 2] = "Bottom", s))(qr || {});
6846
- class Kr {
6845
+ var Kr = /* @__PURE__ */ ((s) => (s[s.Left = 0] = "Left", s[s.Center = 1] = "Center", s[s.Right = 2] = "Right", s))(Kr || {}), Zr = /* @__PURE__ */ ((s) => (s[s.Top = 0] = "Top", s[s.Middle = 1] = "Middle", s[s.Bottom = 2] = "Bottom", s))(Zr || {});
6846
+ class Jr {
6847
6847
  constructor() {
6848
6848
  this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
6849
6849
  }
@@ -6891,7 +6891,7 @@ class Kr {
6891
6891
  };
6892
6892
  }
6893
6893
  }
6894
- class Zr {
6894
+ class Qr {
6895
6895
  constructor() {
6896
6896
  this._DOM = {
6897
6897
  show: !1,
@@ -6910,7 +6910,7 @@ class Zr {
6910
6910
  }
6911
6911
  }
6912
6912
  const ki = 6, pe = 1.02, Oi = 50;
6913
- class Jr {
6913
+ class ts {
6914
6914
  constructor(t, e = !1) {
6915
6915
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
6916
6916
  startX: 0,
@@ -6929,7 +6929,7 @@ class Jr {
6929
6929
  target: { X: 0, Y: 0 },
6930
6930
  touchN: 0,
6931
6931
  startTranslate: { X: 0, Y: 0 }
6932
- }, 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.manager = t, this.coordinator = new Kr(), this.attachEvents(), e && (this.debugger = new Zr());
6932
+ }, 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.manager = t, this.coordinator = new Jr(), this.attachEvents(), e && (this.debugger = new Qr());
6933
6933
  }
6934
6934
  get scale() {
6935
6935
  return this._scale;
@@ -7131,7 +7131,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
7131
7131
  }
7132
7132
  }
7133
7133
  var Re = /* @__PURE__ */ ((s) => (s.auto = "auto", s.landscape = "landscape", s.portrait = "portrait", s))(Re || {}), Le = /* @__PURE__ */ ((s) => (s.auto = "auto", s.both = "both", s.none = "none", s.landscape = "landscape", s))(Le || {});
7134
- class Qr {
7134
+ class es {
7135
7135
  // TODO getter
7136
7136
  constructor(t) {
7137
7137
  this.shift = !0, this.spreads = [], this.nLandscape = 0, this.index(t), this.testShift(t), console.log(`Indexed ${this.spreads.length} spreads for ${t.readingOrder.items.length} items`);
@@ -7176,13 +7176,13 @@ class Qr {
7176
7176
  return this.spreads.find((e) => e.includes(t)) || void 0;
7177
7177
  }
7178
7178
  }
7179
- const Ti = 8, Ai = 5, ts = 300, es = 15e3, is = 250, ns = 150, rs = 500;
7180
- class ss {
7179
+ const Ti = 8, Ai = 5, is = 300, ns = 15e3, rs = 250, ss = 150, os = 500;
7180
+ class as {
7181
7181
  constructor(t, e, i, n, r, o) {
7182
7182
  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.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = r || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Le.auto, this.pub.metadata.effectiveReadingProgression !== D.rtl && this.pub.metadata.effectiveReadingProgression !== D.ltr)
7183
7183
  throw Error("Unsupported reading progression for EPUB");
7184
- this.spreader = new Qr(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 Jr(this), this.pub.readingOrder.items.forEach((a) => {
7185
- const l = new Xr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7184
+ this.spreader = new es(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 ts(this), this.pub.readingOrder.items.forEach((a) => {
7185
+ const l = new qr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7186
7186
  this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === Re.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
7187
7187
  });
7188
7188
  }
@@ -7207,7 +7207,7 @@ class ss {
7207
7207
  const a = this.spreader.findByLink(o);
7208
7208
  i.update(this.spreadPosition(a, o));
7209
7209
  });
7210
- }, is);
7210
+ }, rs);
7211
7211
  }
7212
7212
  /**
7213
7213
  * It is important that these values be cached to avoid spamming them on redraws, they are expensive.
@@ -7234,7 +7234,7 @@ class ss {
7234
7234
  let i = "0";
7235
7235
  this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
7236
7236
  const n = {
7237
- transition: t ? `all ${e ? ns : rs}ms ease-out` : "all 0ms ease-out",
7237
+ transition: t ? `all ${e ? ss : os}ms ease-out` : "all 0ms ease-out",
7238
7238
  marginRight: this.rtl ? i : "0",
7239
7239
  marginLeft: this.rtl ? "0" : i,
7240
7240
  width: `${this.width / this.perPage * this.length}px`,
@@ -7402,7 +7402,7 @@ class ss {
7402
7402
  const p = t.readingOrder.findIndexWithHref(d), b = t.readingOrder.items[p];
7403
7403
  if (b) {
7404
7404
  if (!this.blobs.has(d)) {
7405
- const k = await new mn(
7405
+ const k = await new fn(
7406
7406
  t,
7407
7407
  this.currentBaseURL || "",
7408
7408
  b,
@@ -7414,14 +7414,14 @@ class ss {
7414
7414
  }
7415
7415
  this.delayedShow.has(d) || this.delayedShow.set(d, new Promise((v, k) => {
7416
7416
  let Q = !1;
7417
- const yn = window.setTimeout(async () => {
7417
+ const bn = window.setTimeout(async () => {
7418
7418
  this.delayedTimeout.set(d, 0);
7419
- const Sn = this.makeSpread(this.reAlign(p)), bn = this.spreadPosition(Sn, b), je = this.pool.get(d);
7420
- await je.load(i, this.blobs.get(d)), this.peripherals.isScaled || await je.show(bn), this.delayedShow.delete(d), Q = !0, v();
7421
- }, ts);
7419
+ const vn = this.makeSpread(this.reAlign(p)), wn = this.spreadPosition(vn, b), je = this.pool.get(d);
7420
+ await je.load(i, this.blobs.get(d)), this.peripherals.isScaled || await je.show(wn), this.delayedShow.delete(d), Q = !0, v();
7421
+ }, is);
7422
7422
  setTimeout(() => {
7423
7423
  !Q && this.delayedShow.has(d) && k(`Offscreen load timeout: ${d}`);
7424
- }, es), this.delayedTimeout.set(d, yn);
7424
+ }, ns), this.delayedTimeout.set(d, bn);
7425
7425
  }));
7426
7426
  }
7427
7427
  };
@@ -7520,18 +7520,18 @@ class Ot {
7520
7520
  return new Ot(e);
7521
7521
  }
7522
7522
  }
7523
- class os {
7523
+ class ls {
7524
7524
  constructor(t) {
7525
- this.backgroundColor = I(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = w(t.constraint) || 0, this.columnCount = w(t.columnCount) || null, this.darkenFilter = ft(t.darkenFilter) ?? !1, this.deprecatedFontSize = P(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = I(t.fontFamily) || null, this.fontSize = M(t.fontSize, Gt.range) || 1, this.fontSizeNormalize = P(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = P(t.fontOpticalSizing) ?? null, this.fontWeight = M(t.fontWeight, nt.range) || null, this.fontWidth = M(t.fontWidth, $t.range) || null, this.hyphens = P(t.hyphens) ?? null, this.invertFilter = ft(t.invertFilter) ?? !1, this.invertGaijiFilter = ft(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = w(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.linkColor = I(t.linkColor) || null, this.noRuby = P(t.noRuby) ?? !1, this.pageGutter = ue(w(t.pageGutter), 20), this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.scroll = P(t.scroll) ?? !1, this.scrollPaddingTop = w(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = w(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = w(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = w(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = I(t.selectionBackgroundColor) || null, this.selectionTextColor = I(t.selectionTextColor) || null, this.textAlign = se(t.textAlign, J) || null, this.textColor = I(t.textColor) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.visitedColor = I(t.visitedColor) || null, this.wordSpacing = w(t.wordSpacing) || null, this.optimalLineLength = w(t.optimalLineLength) || 65, this.maximalLineLength = ue(Cr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ue(Er(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = an(t.experiments) || null;
7525
+ this.backgroundColor = I(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = w(t.constraint) || 0, this.columnCount = w(t.columnCount) || null, this.darkenFilter = ft(t.darkenFilter) ?? !1, this.deprecatedFontSize = P(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = I(t.fontFamily) || null, this.fontSize = M(t.fontSize, Gt.range) || 1, this.fontSizeNormalize = P(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = P(t.fontOpticalSizing) ?? null, this.fontWeight = M(t.fontWeight, nt.range) || null, this.fontWidth = M(t.fontWidth, $t.range) || null, this.hyphens = P(t.hyphens) ?? null, this.invertFilter = ft(t.invertFilter) ?? !1, this.invertGaijiFilter = ft(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = w(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = w(t.lineHeight) || null, this.linkColor = I(t.linkColor) || null, this.noRuby = P(t.noRuby) ?? !1, this.pageGutter = ue(w(t.pageGutter), 20), this.paragraphIndent = w(t.paragraphIndent) ?? null, this.paragraphSpacing = w(t.paragraphSpacing) ?? null, this.scroll = P(t.scroll) ?? !1, this.scrollPaddingTop = w(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = w(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = w(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = w(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = I(t.selectionBackgroundColor) || null, this.selectionTextColor = I(t.selectionTextColor) || null, this.textAlign = se(t.textAlign, J) || null, this.textColor = I(t.textColor) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.visitedColor = I(t.visitedColor) || null, this.wordSpacing = w(t.wordSpacing) || null, this.optimalLineLength = w(t.optimalLineLength) || 65, this.maximalLineLength = ue(Rr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ue(xr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = hn(t.experiments) || null;
7526
7526
  }
7527
7527
  }
7528
- const as = "#FFFFFF", ls = "#121212", hs = "#0000EE", cs = "#551A8B", ds = "#b4d8fe", us = "inherit", dt = {
7529
- RS__backgroundColor: as,
7530
- RS__textColor: ls,
7531
- RS__linkColor: hs,
7532
- RS__visitedColor: cs,
7533
- RS__selectionBackgroundColor: ds,
7534
- RS__selectionTextColor: us
7528
+ const hs = "#FFFFFF", cs = "#121212", ds = "#0000EE", us = "#551A8B", ps = "#b4d8fe", ms = "inherit", dt = {
7529
+ RS__backgroundColor: hs,
7530
+ RS__textColor: cs,
7531
+ RS__linkColor: ds,
7532
+ RS__visitedColor: us,
7533
+ RS__selectionBackgroundColor: ps,
7534
+ RS__selectionTextColor: ms
7535
7535
  };
7536
7536
  class zi {
7537
7537
  constructor(t, e, i) {
@@ -7925,7 +7925,7 @@ class zi {
7925
7925
  });
7926
7926
  }
7927
7927
  get textAlign() {
7928
- return new ln({
7928
+ return new cn({
7929
7929
  initialValue: this.preferences.textAlign,
7930
7930
  effectiveValue: this.settings.textAlign || J.start,
7931
7931
  isEffective: this.layout !== S.fixed && this.preferences.textAlign !== null,
@@ -7983,11 +7983,11 @@ class Mi {
7983
7983
  this.backgroundColor = t.backgroundColor || e.backgroundColor || null, this.blendFilter = typeof t.blendFilter == "boolean" ? t.blendFilter : e.blendFilter ?? null, this.columnCount = t.columnCount !== void 0 ? t.columnCount : e.columnCount !== void 0 ? e.columnCount : null, this.constraint = t.constraint || e.constraint, this.darkenFilter = typeof t.darkenFilter == "boolean" ? t.darkenFilter : e.darkenFilter ?? null, this.deprecatedFontSize = typeof t.deprecatedFontSize == "boolean" ? t.deprecatedFontSize : e.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontSize = t.fontSize !== void 0 ? t.fontSize : e.fontSize !== void 0 ? e.fontSize : null, this.fontSizeNormalize = typeof t.fontSizeNormalize == "boolean" ? t.fontSizeNormalize : e.fontSizeNormalize ?? null, this.fontOpticalSizing = typeof t.fontOpticalSizing == "boolean" ? t.fontOpticalSizing : e.fontOpticalSizing ?? null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.fontWidth = t.fontWidth !== void 0 ? t.fontWidth : e.fontWidth !== void 0 ? e.fontWidth : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.invertFilter = typeof t.invertFilter == "boolean" ? t.invertFilter : e.invertFilter ?? null, this.invertGaijiFilter = typeof t.invertGaijiFilter == "boolean" ? t.invertGaijiFilter : e.invertGaijiFilter ?? null, this.iOSPatch = this.deprecatedFontSize || t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? T.OS.iPadOS && T.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.linkColor = t.linkColor || e.linkColor || null, this.maximalLineLength = t.maximalLineLength === null ? null : t.maximalLineLength || e.maximalLineLength || null, this.minimalLineLength = t.minimalLineLength === null ? null : t.minimalLineLength || e.minimalLineLength || null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.optimalLineLength = t.optimalLineLength || e.optimalLineLength, this.pageGutter = t.pageGutter !== void 0 ? t.pageGutter : e.pageGutter !== void 0 ? e.pageGutter : 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.scroll = typeof t.scroll == "boolean" ? t.scroll : e.scroll ?? null, this.scrollPaddingTop = t.scrollPaddingTop !== void 0 ? t.scrollPaddingTop : e.scrollPaddingTop !== void 0 ? e.scrollPaddingTop : null, this.scrollPaddingBottom = t.scrollPaddingBottom !== void 0 ? t.scrollPaddingBottom : e.scrollPaddingBottom !== void 0 ? e.scrollPaddingBottom : null, this.scrollPaddingLeft = t.scrollPaddingLeft !== void 0 ? t.scrollPaddingLeft : e.scrollPaddingLeft !== void 0 ? e.scrollPaddingLeft : null, this.scrollPaddingRight = t.scrollPaddingRight !== void 0 ? t.scrollPaddingRight : e.scrollPaddingRight !== void 0 ? e.scrollPaddingRight : null, this.selectionBackgroundColor = t.selectionBackgroundColor || e.selectionBackgroundColor || null, this.selectionTextColor = t.selectionTextColor || e.selectionTextColor || null, this.textAlign = t.textAlign || e.textAlign || null, this.textColor = t.textColor || e.textColor || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null, this.experiments = e.experiments || null;
7984
7984
  }
7985
7985
  }
7986
- function Nt(s) {
7986
+ function Ft(s) {
7987
7987
  const t = getComputedStyle(s), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
7988
7988
  return s.clientWidth - e - i;
7989
7989
  }
7990
- class gn extends re {
7990
+ class yn extends re {
7991
7991
  constructor(t) {
7992
7992
  super(), this.a11yNormalize = t.a11yNormalize ?? null, this.backgroundColor = t.backgroundColor ?? null, this.blendFilter = t.blendFilter ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.colCount = t.colCount ?? null, this.darkenFilter = t.darkenFilter ?? null, this.deprecatedFontSize = t.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily ?? null, this.fontOpticalSizing = t.fontOpticalSizing ?? null, this.fontSize = t.fontSize ?? null, this.fontSizeNormalize = t.fontSizeNormalize ?? null, this.fontWeight = t.fontWeight ?? null, this.fontWidth = t.fontWidth ?? null, this.invertFilter = t.invertFilter ?? null, this.invertGaijiFilter = t.invertGaijiFilter ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.lineLength = t.lineLength ?? null, this.linkColor = t.linkColor ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.textAlign = t.textAlign ?? null, this.textColor = t.textColor ?? null, this.view = t.view ?? null, this.visitedColor = t.visitedColor ?? null, this.wordSpacing = t.wordSpacing ?? null;
7993
7993
  }
@@ -7996,7 +7996,7 @@ class gn extends re {
7996
7996
  return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.backgroundColor && (t["--USER__backgroundColor"] = this.backgroundColor), this.blendFilter && (t["--USER__blendFilter"] = this.toFlag("blend")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.colCount && (t["--USER__colCount"] = this.toUnitless(this.colCount)), this.darkenFilter === !0 ? t["--USER__darkenFilter"] = this.toFlag("darken") : typeof this.darkenFilter == "number" && (t["--USER__darkenFilter"] = this.toPercentage(this.darkenFilter)), this.deprecatedFontSize && (t["--USER__fontSizeImplementation"] = this.toFlag("deprecatedFontSize")), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontOpticalSizing != null && (t["--USER__fontOpticalSizing"] = this.fontOpticalSizing), this.fontSize != null && (t["--USER__fontSize"] = this.toPercentage(this.fontSize, !0)), this.fontSizeNormalize && (t["--USER__fontSizeNormalize"] = this.toFlag("normalize")), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.fontWidth != null && (t["--USER__fontWidth"] = typeof this.fontWidth == "string" ? this.fontWidth : this.toUnitless(this.fontWidth)), this.invertFilter === !0 ? t["--USER__invertFilter"] = this.toFlag("invert") : typeof this.invertFilter == "number" && (t["--USER__invertFilter"] = this.toPercentage(this.invertFilter)), this.invertGaijiFilter === !0 ? t["--USER__invertGaiji"] = this.toFlag("invertGaiji") : typeof this.invertGaijiFilter == "number" && (t["--USER__invertGaiji"] = this.toPercentage(this.invertGaijiFilter)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.lineLength != null && (t["--USER__lineLength"] = this.toPx(this.lineLength)), this.linkColor && (t["--USER__linkColor"] = this.linkColor), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.selectionBackgroundColor && (t["--USER__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--USER__selectionTextColor"] = this.selectionTextColor), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.textColor && (t["--USER__textColor"] = this.textColor), this.view && (t["--USER__view"] = this.toFlag(this.view)), this.visitedColor && (t["--USER__visitedColor"] = this.visitedColor), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), t;
7997
7997
  }
7998
7998
  }
7999
- class ps extends re {
7999
+ class gs extends re {
8000
8000
  constructor(t) {
8001
8001
  super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingLeft = t.scrollPaddingLeft ?? null, this.scrollPaddingRight = t.scrollPaddingRight ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null, this.experiments = t.experiments ?? null;
8002
8002
  }
@@ -8007,9 +8007,9 @@ class ps extends re {
8007
8007
  }), t;
8008
8008
  }
8009
8009
  }
8010
- class ms {
8010
+ class fs {
8011
8011
  constructor(t) {
8012
- this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Nt(this.containerParent);
8012
+ this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Ft(this.containerParent);
8013
8013
  }
8014
8014
  update(t) {
8015
8015
  this.cachedColCount = t.columnCount, t.constraint !== this.constraint && (this.constraint = t.constraint), t.pageGutter !== this.rsProperties.pageGutter && (this.rsProperties.pageGutter = t.pageGutter), t.scrollPaddingBottom !== this.rsProperties.scrollPaddingBottom && (this.rsProperties.scrollPaddingBottom = t.scrollPaddingBottom), t.scrollPaddingLeft !== this.rsProperties.scrollPaddingLeft && (this.rsProperties.scrollPaddingLeft = t.scrollPaddingLeft), t.scrollPaddingRight !== this.rsProperties.scrollPaddingRight && (this.rsProperties.scrollPaddingRight = t.scrollPaddingRight), t.scrollPaddingTop !== this.rsProperties.scrollPaddingTop && (this.rsProperties.scrollPaddingTop = t.scrollPaddingTop), t.experiments !== this.rsProperties.experiments && (this.rsProperties.experiments = t.experiments), this.lineLengths.update({
@@ -8057,7 +8057,7 @@ class ms {
8057
8057
  visitedColor: t.visitedColor,
8058
8058
  wordSpacing: t.wordSpacing
8059
8059
  };
8060
- this.userProperties = new gn(i);
8060
+ this.userProperties = new yn(i);
8061
8061
  }
8062
8062
  updateLayout(t, e, i, n) {
8063
8063
  return i ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, n);
@@ -8076,7 +8076,7 @@ class ms {
8076
8076
  // TODO: As scroll shows, the effective line-length
8077
8077
  // should be the same as uncompensated when scale >= 1
8078
8078
  paginate(t, e, i) {
8079
- const n = Math.round(Nt(this.containerParent) - this.constraint), r = this.getCompensatedMetrics(t, e), { zoomCompensation: o, optimal: a, minimal: l, maximal: h } = r, c = () => n >= a && h !== null ? Math.min(Math.round(h * o), n) : n;
8079
+ const n = Math.round(Ft(this.containerParent) - this.constraint), r = this.getCompensatedMetrics(t, e), { zoomCompensation: o, optimal: a, minimal: l, maximal: h } = r, c = () => n >= a && h !== null ? Math.min(Math.round(h * o), n) : n;
8080
8080
  let u = 1, m = n;
8081
8081
  if (i === void 0)
8082
8082
  return {
@@ -8122,7 +8122,7 @@ class ms {
8122
8122
  }
8123
8123
  // This behaves as paginate where colCount = 1
8124
8124
  computeScrollLength(t, e) {
8125
- const i = Math.round(Nt(this.containerParent) - this.constraint), n = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), r = n.zoomCompensation, o = n.optimal, a = n.maximal;
8125
+ const i = Math.round(Ft(this.containerParent) - this.constraint), n = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), r = n.zoomCompensation, o = n.optimal, a = n.maximal;
8126
8126
  let l, h = i, c = Math.round(o * r);
8127
8127
  if (a === null)
8128
8128
  c = i;
@@ -8144,7 +8144,7 @@ class ms {
8144
8144
  this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
8145
8145
  }
8146
8146
  }
8147
- const gs = `/*!
8147
+ const ys = `/*!
8148
8148
  * Readium CSS v.2.0.0
8149
8149
  * Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
8150
8150
  * Use of this source code is governed by a BSD-style license which is detailed in the
@@ -8733,7 +8733,7 @@ body{
8733
8733
 
8734
8734
  :root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
8735
8735
  -webkit-text-zoom:normal;
8736
- }`, fs = `/*!
8736
+ }`, Ss = `/*!
8737
8737
  * Readium CSS v.2.0.0
8738
8738
  * Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
8739
8739
  * Use of this source code is governed by a BSD-style license which is detailed in the
@@ -9154,7 +9154,7 @@ audio{
9154
9154
  table{
9155
9155
  max-width:var(--RS__maxMediaWidth);
9156
9156
  box-sizing:var(--RS__boxSizingTable);
9157
- }`, ys = `/*!
9157
+ }`, bs = `/*!
9158
9158
  * Readium CSS v.2.0.0
9159
9159
  * Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
9160
9160
  * Use of this source code is governed by a BSD-style license which is detailed in the
@@ -9312,7 +9312,7 @@ th{
9312
9312
  th, td{
9313
9313
  padding:4px;
9314
9314
  border:1px solid currentcolor;
9315
- }`, Ss = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
9315
+ }`, vs = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
9316
9316
  // For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
9317
9317
  // The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
9318
9318
  (function() {
@@ -9378,21 +9378,21 @@ th, td{
9378
9378
  window.addEventListener("load", window._readium_eventBlocker, true);
9379
9379
  })();
9380
9380
  `;
9381
- function bs(s, t) {
9381
+ function ws(s, t) {
9382
9382
  const e = s.effectiveLayout === S.fixed, i = t.filter((a) => a.mediaType.isHTML).map((a) => a.href), n = i.length > 0 ? i : [/\.xhtml$/, /\.html$/], r = [
9383
9383
  // CSS Selector Generator - always injected
9384
9384
  {
9385
9385
  id: "css-selector-generator",
9386
9386
  as: "script",
9387
9387
  target: "head",
9388
- blob: new Blob([yt(un)], { type: "text/javascript" })
9388
+ blob: new Blob([yt(mn)], { type: "text/javascript" })
9389
9389
  },
9390
9390
  // Execution Prevention - conditional (has executable scripts)
9391
9391
  {
9392
9392
  id: "execution-prevention",
9393
9393
  as: "script",
9394
9394
  target: "head",
9395
- blob: new Blob([yt(Ss)], { type: "text/javascript" }),
9395
+ blob: new Blob([yt(vs)], { type: "text/javascript" }),
9396
9396
  condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
9397
9397
  }
9398
9398
  ], o = [
@@ -9401,7 +9401,7 @@ function bs(s, t) {
9401
9401
  id: "onload-proxy",
9402
9402
  as: "script",
9403
9403
  target: "head",
9404
- blob: new Blob([yt(pn)], { type: "text/javascript" }),
9404
+ blob: new Blob([yt(gn)], { type: "text/javascript" }),
9405
9405
  condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
9406
9406
  }
9407
9407
  ];
@@ -9409,7 +9409,7 @@ function bs(s, t) {
9409
9409
  id: "readium-css-before",
9410
9410
  as: "link",
9411
9411
  target: "head",
9412
- blob: new Blob([Ft(fs)], { type: "text/css" }),
9412
+ blob: new Blob([Nt(Ss)], { type: "text/css" }),
9413
9413
  rel: "stylesheet"
9414
9414
  }), o.unshift(
9415
9415
  // Readium CSS Default - only for reflowable AND no existing styles
@@ -9417,7 +9417,7 @@ function bs(s, t) {
9417
9417
  id: "readium-css-default",
9418
9418
  as: "link",
9419
9419
  target: "head",
9420
- blob: new Blob([Ft(ys)], { type: "text/css" }),
9420
+ blob: new Blob([Nt(bs)], { type: "text/css" }),
9421
9421
  rel: "stylesheet",
9422
9422
  condition: (a) => !(a.querySelector("link[rel='stylesheet']") || a.querySelector("style") || a.querySelector("[style]:not([style=''])"))
9423
9423
  },
@@ -9426,7 +9426,7 @@ function bs(s, t) {
9426
9426
  id: "readium-css-after",
9427
9427
  as: "link",
9428
9428
  target: "head",
9429
- blob: new Blob([Ft(gs)], { type: "text/css" }),
9429
+ blob: new Blob([Nt(ys)], { type: "text/css" }),
9430
9430
  rel: "stylesheet"
9431
9431
  }
9432
9432
  )), [
@@ -9437,7 +9437,7 @@ function bs(s, t) {
9437
9437
  }
9438
9438
  ];
9439
9439
  }
9440
- const vs = (s) => ({
9440
+ const _s = (s) => ({
9441
9441
  frameLoaded: s.frameLoaded || (() => {
9442
9442
  }),
9443
9443
  positionChanged: s.positionChanged || (() => {
@@ -9462,15 +9462,15 @@ const vs = (s) => ({
9462
9462
  peripheral: s.peripheral || (() => {
9463
9463
  })
9464
9464
  });
9465
- class fn extends en {
9465
+ class Sn extends rn {
9466
9466
  constructor(t, e, i, n = [], r = void 0, o = { preferences: {}, defaults: {} }) {
9467
9467
  super(), this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.reflowViewport = {
9468
9468
  readingOrder: [],
9469
9469
  progressions: /* @__PURE__ */ new Map(),
9470
9470
  positions: null
9471
- }, this.pub = e, this.container = t, this.listeners = vs(i), this.currentLocation = r, n.length && (this.positions = n), this._preferences = new Ot(o.preferences), this._defaults = new os(o.defaults), this._settings = new Mi(this._preferences, this._defaults), this._css = new ms({
9472
- rsProperties: new ps({}),
9473
- userProperties: new gn({}),
9471
+ }, this.pub = e, this.container = t, this.listeners = _s(i), this.currentLocation = r, n.length && (this.positions = n), this._preferences = new Ot(o.preferences), this._defaults = new ls(o.defaults), this._settings = new Mi(this._preferences, this._defaults), this._css = new fs({
9472
+ rsProperties: new gs({}),
9473
+ userProperties: new yn({}),
9474
9474
  lineLengths: new _t({
9475
9475
  optimalChars: this._settings.optimalLineLength,
9476
9476
  minChars: this._settings.minimalLineLength,
@@ -9483,9 +9483,9 @@ class fn extends en {
9483
9483
  }),
9484
9484
  container: t,
9485
9485
  constraint: this._settings.constraint
9486
- }), this._layout = fn.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression;
9487
- const a = bs(e.metadata, e.readingOrder.items), l = o.injectables || { rules: [], allowedDomains: [] };
9488
- this._injector = new dn({
9486
+ }), this._layout = Sn.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression;
9487
+ const a = ws(e.metadata, e.readingOrder.items), l = o.injectables || { rules: [], allowedDomains: [] };
9488
+ this._injector = new pn({
9489
9489
  rules: [...a, ...l.rules],
9490
9490
  allowedDomains: l.allowedDomains
9491
9491
  }), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
@@ -9503,11 +9503,11 @@ class fn extends en {
9503
9503
  }
9504
9504
  static determineLayout(t, e) {
9505
9505
  const i = t.metadata.effectiveLayout;
9506
- return i === S.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(Ii.DIVINA) ? S.fixed : i === S.scrolled || i === S.reflowable && e ? S.scrolled : S.reflowable;
9506
+ return i === S.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(Wi.DIVINA) ? S.fixed : i === S.scrolled || i === S.reflowable && e ? S.scrolled : S.reflowable;
9507
9507
  }
9508
9508
  async load() {
9509
9509
  if (this.positions?.length || (this.positions = await this.pub.positionsFromManifest()), this._layout === S.fixed)
9510
- this.framePool = new ss(
9510
+ this.framePool = new as(
9511
9511
  this.container,
9512
9512
  this.positions,
9513
9513
  this.pub,
@@ -9520,7 +9520,7 @@ class fn extends en {
9520
9520
  else {
9521
9521
  await this.updateCSS(!1);
9522
9522
  const t = this.compileCSSProperties(this._css);
9523
- this.framePool = new $r(
9523
+ this.framePool = new Yr(
9524
9524
  this.container,
9525
9525
  this.positions,
9526
9526
  t,
@@ -9571,7 +9571,7 @@ class fn extends en {
9571
9571
  async resizeHandler() {
9572
9572
  const t = this.container.parentElement || document.documentElement;
9573
9573
  if (this._layout === S.fixed)
9574
- this.container.style.width = `${Nt(t) - this._settings.constraint}px`, this.framePool.resizeHandler();
9574
+ this.container.style.width = `${Ft(t) - this._settings.constraint}px`, this.framePool.resizeHandler();
9575
9575
  else {
9576
9576
  const e = this._css.userProperties.colCount, i = this._css.userProperties.lineLength;
9577
9577
  this._css.resizeHandler(), (this._css.userProperties.view !== "scroll" && e !== this._css.userProperties.colCount || i !== this._css.userProperties.lineLength) && await this.commitCSS(this._css);
@@ -9608,9 +9608,9 @@ class fn extends en {
9608
9608
  this.listeners.frameLoaded(this._cframes[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
9609
9609
  break;
9610
9610
  case "first_visible_locator":
9611
- const i = F.deserialize(e);
9611
+ const i = N.deserialize(e);
9612
9612
  if (!i) break;
9613
- this.currentLocation = new F({
9613
+ this.currentLocation = new N({
9614
9614
  href: this.currentLocation.href,
9615
9615
  type: this.currentLocation.type,
9616
9616
  title: this.currentLocation.title,
@@ -9704,7 +9704,7 @@ class fn extends en {
9704
9704
  }
9705
9705
  determineModules() {
9706
9706
  let t = Array.from(Vt.keys());
9707
- return this._layout === S.fixed ? t.filter((e) => ir.includes(e)) : (t = t.filter((e) => nr.includes(e)), this._layout === S.scrolled ? t = t.filter((e) => e !== "column_snapper") : t = t.filter((e) => e !== "scroll_snapper"), t);
9707
+ return this._layout === S.fixed ? t.filter((e) => rr.includes(e)) : (t = t.filter((e) => sr.includes(e)), this._layout === S.scrolled ? t = t.filter((e) => e !== "column_snapper") : t = t.filter((e) => e !== "scroll_snapper"), t);
9708
9708
  }
9709
9709
  // Start listening to messages from the current iframe
9710
9710
  attachListener() {
@@ -9898,7 +9898,7 @@ class fn extends en {
9898
9898
  return this.go(t.locator, e, i);
9899
9899
  }
9900
9900
  }
9901
- const ws = `// PreservePitchProcessor.js
9901
+ const Ps = `// PreservePitchProcessor.js
9902
9902
  // AudioWorklet processor for pitch preservation via pitch shifting
9903
9903
 
9904
9904
  class PreservePitchProcessor extends AudioWorkletProcessor {
@@ -10058,7 +10058,7 @@ class Be {
10058
10058
  if (r)
10059
10059
  await e.audioWorklet.addModule(r);
10060
10060
  else {
10061
- const a = new Blob([ws], { type: "text/javascript" });
10061
+ const a = new Blob([Ps], { type: "text/javascript" });
10062
10062
  o.url = URL.createObjectURL(a), await e.audioWorklet.addModule(o.url);
10063
10063
  }
10064
10064
  } catch (a) {
@@ -10081,7 +10081,7 @@ class Be {
10081
10081
  this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.source && (this.source.disconnect(), this.source = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
10082
10082
  }
10083
10083
  }
10084
- class _s {
10084
+ class Es {
10085
10085
  constructor(t) {
10086
10086
  this.audioContext = null, this.sourceNode = null, this.gainNode = null, this.listeners = {}, this.currentVolume = 1, this.currentPlaybackRate = 1, 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;
10087
10087
  }
@@ -10103,22 +10103,6 @@ class _s {
10103
10103
  (i) => i !== e
10104
10104
  ));
10105
10105
  }
10106
- /**
10107
- * Load the audio resource at the given URL.
10108
- * @param url The URL of the audio resource.
10109
- * */
10110
- loadAudio(t) {
10111
- if (this.isLoadingValue = !0, this.isLoadedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.webAudioActive) {
10112
- this.mediaElement.crossOrigin = "anonymous", this.mediaElement.src = t, this.mediaElement.load(), this.mediaElement.playbackRate = this.currentPlaybackRate;
10113
- const e = () => {
10114
- this.mediaElement.removeEventListener("error", i), this.mediaElement.removeEventListener("canplaythrough", n);
10115
- }, i = () => {
10116
- e(), this.deactivateWebAudio(), this.mediaElement.removeAttribute("crossOrigin"), this.mediaElement.src = t, this.mediaElement.load(), this.mediaElement.playbackRate = this.currentPlaybackRate;
10117
- }, n = () => e();
10118
- this.mediaElement.addEventListener("error", i), this.mediaElement.addEventListener("canplaythrough", n);
10119
- } else
10120
- this.mediaElement.src = t, this.mediaElement.load(), this.mediaElement.playbackRate = this.currentPlaybackRate;
10121
- }
10122
10106
  deactivateWebAudio() {
10123
10107
  this.worklet && (this.worklet.destroy(), this.worklet = null), this.sourceNode && (this.sourceNode.disconnect(), this.sourceNode = null), this.gainNode && (this.gainNode.disconnect(), this.gainNode = null), this.webAudioActive = !1;
10124
10108
  }
@@ -10127,7 +10111,14 @@ class _s {
10127
10111
  * @param element The HTML audio element to use.
10128
10112
  */
10129
10113
  setMediaElement(t) {
10130
- this.mediaElement.pause(), this.isPlayingValue = !1, this.isPausedValue = !1, this.sourceNode && (this.sourceNode.disconnect(), this.sourceNode = null), this.mediaElement.removeEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.removeEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.removeEventListener("error", this.boundOnError), this.mediaElement.removeEventListener("ended", this.boundOnEnded), this.mediaElement.removeEventListener("stalled", this.boundOnStalled), this.mediaElement.removeEventListener("emptied", this.boundOnEmptied), this.mediaElement.removeEventListener("suspend", this.boundOnSuspend), this.mediaElement.removeEventListener("waiting", this.boundOnWaiting), this.mediaElement.removeEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.removeEventListener("seeking", this.boundOnSeeking), this.mediaElement.removeEventListener("seeked", this.boundOnSeeked), this.mediaElement.removeEventListener("play", this.boundOnPlay), this.mediaElement.removeEventListener("playing", this.boundOnPlaying), this.mediaElement.removeEventListener("pause", this.boundOnPause), this.mediaElement.removeEventListener("progress", this.boundOnProgress), this.mediaElement = t, 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.volume = this.isMutedValue ? 0 : this.currentVolume, this.mediaElement.playbackRate = this.currentPlaybackRate, this.mediaElement.readyState >= 1 && this.onLoadedMetadata(new Event("loadedmetadata")), this.mediaElement.seekable.length > 0 && this.onProgress(), this.mediaElement.readyState >= 4 ? this.onCanPlayThrough() : (this.isLoadingValue = !0, this.isLoadedValue = !1);
10114
+ if (this.mediaElement.removeEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.removeEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.removeEventListener("error", this.boundOnError), this.mediaElement.removeEventListener("ended", this.boundOnEnded), this.mediaElement.removeEventListener("stalled", this.boundOnStalled), this.mediaElement.removeEventListener("emptied", this.boundOnEmptied), this.mediaElement.removeEventListener("suspend", this.boundOnSuspend), this.mediaElement.removeEventListener("waiting", this.boundOnWaiting), this.mediaElement.removeEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.removeEventListener("seeking", this.boundOnSeeking), this.mediaElement.removeEventListener("seeked", this.boundOnSeeked), this.mediaElement.removeEventListener("play", this.boundOnPlay), this.mediaElement.removeEventListener("playing", this.boundOnPlaying), this.mediaElement.removeEventListener("pause", this.boundOnPause), this.mediaElement.removeEventListener("progress", this.boundOnProgress), this.mediaElement.pause(), this.isPlayingValue = !1, this.isPausedValue = !1, this.sourceNode && (this.sourceNode.disconnect(), this.sourceNode = null), this.mediaElement = t, 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.volume = this.isMutedValue ? 0 : this.currentVolume, this.mediaElement.playbackRate = this.currentPlaybackRate, this.webAudioActive)
10115
+ try {
10116
+ const e = this.getOrCreateAudioContext();
10117
+ this.sourceNode = new MediaElementAudioSourceNode(e, { mediaElement: this.mediaElement }), this.gainNode || (this.gainNode = e.createGain(), this.gainNode.connect(e.destination)), this.worklet?.workletNode ? this.sourceNode.connect(this.worklet.workletNode) : this.sourceNode.connect(this.gainNode);
10118
+ } catch {
10119
+ this.deactivateWebAudio();
10120
+ }
10121
+ this.mediaElement.readyState >= 1 && this.onLoadedMetadata(new Event("loadedmetadata")), this.mediaElement.seekable.length > 0 && this.onProgress(), this.mediaElement.readyState >= 4 ? this.onCanPlayThrough() : (this.isLoadingValue = !0, this.isLoadedValue = !1);
10131
10122
  }
10132
10123
  // Ensure AudioContext is running
10133
10124
  async ensureAudioContextRunning() {
@@ -10351,17 +10342,17 @@ class oe {
10351
10342
  return new oe(e);
10352
10343
  }
10353
10344
  }
10354
- class Ps {
10345
+ class Cs {
10355
10346
  constructor(t = {}) {
10356
10347
  this.volume = M(t.volume, Qt.range) ?? 1, this.playbackRate = M(t.playbackRate, te.range) ?? 1, this.preservePitch = P(t.preservePitch) ?? !0, this.skipBackwardInterval = M(t.skipBackwardInterval, et.range) ?? 10, this.skipForwardInterval = M(t.skipForwardInterval, et.range) ?? 10, this.pollInterval = w(t.pollInterval) ?? 1e3, this.autoPlay = P(t.autoPlay) ?? !0, this.enableMediaSession = P(t.enableMediaSession) ?? !0;
10357
10348
  }
10358
10349
  }
10359
- class Fi {
10350
+ class Ni {
10360
10351
  constructor(t, e) {
10361
10352
  this.volume = t.volume ?? e.volume, this.playbackRate = t.playbackRate ?? e.playbackRate, this.preservePitch = t.preservePitch ?? e.preservePitch, this.skipBackwardInterval = t.skipBackwardInterval ?? e.skipBackwardInterval, this.skipForwardInterval = t.skipForwardInterval ?? e.skipForwardInterval, this.pollInterval = t.pollInterval ?? e.pollInterval, this.autoPlay = t.autoPlay ?? e.autoPlay, this.enableMediaSession = t.enableMediaSession ?? e.enableMediaSession;
10362
10353
  }
10363
10354
  }
10364
- class Ni {
10355
+ class Fi {
10365
10356
  constructor(t, e) {
10366
10357
  this.preferences = t, this.settings = e;
10367
10358
  }
@@ -10460,9 +10451,10 @@ class Ni {
10460
10451
  });
10461
10452
  }
10462
10453
  }
10463
- class Es {
10454
+ const Ui = 1, Ii = 1;
10455
+ class xs {
10464
10456
  constructor(t, e) {
10465
- this.preloadedElements = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes();
10457
+ this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes();
10466
10458
  }
10467
10459
  detectSupportedAudioTypes() {
10468
10460
  const t = document.createElement("audio"), e = /* @__PURE__ */ new Set();
@@ -10495,77 +10487,42 @@ class Es {
10495
10487
  return this._audioEngine;
10496
10488
  }
10497
10489
  /**
10498
- * Sets the current audio by href, using preloaded element if available or loading otherwise,
10499
- * and preloads adjacent tracks.
10500
- * @param href The URL of the audio resource.
10501
- * @param publication The publication containing the reading order.
10502
- * @param currentIndex The current track index.
10503
- * @param direction The navigation direction ('forward' or 'backward').
10504
- */
10505
- setCurrentAudio(t, e) {
10506
- const i = this.pickPlayableHref(this._publication.readingOrder.items[t]), n = this.audioEngine.isWebAudioActive ? void 0 : this.get(i);
10507
- n ? (this.audioEngine.setMediaElement(n), this.clear(i)) : (this.clear(i), this.audioEngine.loadAudio(i)), this.preloadAdjacent(t, e);
10508
- }
10509
- preload(t) {
10510
- if (this.preloadedElements.has(t))
10511
- return;
10512
- const e = document.createElement("audio");
10513
- e.preload = "auto", e.src = t, e.load(), this.preloadedElements.set(t, e);
10514
- }
10515
- /**
10516
- * Retrieves a preloaded audio element by URL.
10517
- * @param href The URL of the audio resource.
10518
- * @returns The preloaded HTMLAudioElement, or undefined if not preloaded.
10519
- */
10520
- get(t) {
10521
- return this.preloadedElements.get(t);
10522
- }
10523
- /**
10524
- * Removes a preloaded element from the pool.
10525
- * @param href The URL of the audio resource.
10526
- */
10527
- clear(t) {
10528
- this.preloadedElements.delete(t);
10529
- }
10530
- /**
10531
- * Preloads the next track in the reading order.
10532
- * @param publication The publication containing the reading order.
10533
- * @param currentIndex The current track index.
10490
+ * Ensures an audio element exists in the pool for the given href.
10491
+ * If one already exists, it is left untouched (preserving its buffered data).
10534
10492
  */
10535
- preloadNext(t) {
10536
- const e = t + 1;
10537
- if (e < this._publication.readingOrder.items.length) {
10538
- const i = this._publication.readingOrder.items[e];
10539
- this.preload(this.pickPlayableHref(i));
10540
- }
10493
+ ensure(t) {
10494
+ let e = this.pool.get(t);
10495
+ return e || (e = document.createElement("audio"), e.preload = "auto", this._audioEngine.isWebAudioActive && (e.crossOrigin = "anonymous"), e.src = t, e.load(), this.pool.set(t, e)), e;
10541
10496
  }
10542
10497
  /**
10543
- * Preloads the previous track in the reading order.
10544
- * @param currentIndex The current track index.
10498
+ * Updates the pool around the given index: ensures elements exist within
10499
+ * the LOWER_BOUNDARY and disposes those beyond the UPPER_BOUNDARY.
10545
10500
  */
10546
- preloadPrevious(t) {
10547
- const e = t - 1;
10548
- if (e >= 0) {
10549
- const i = this._publication.readingOrder.items[e];
10550
- this.preload(this.pickPlayableHref(i));
10501
+ update(t) {
10502
+ const e = this._publication.readingOrder.items, i = /* @__PURE__ */ new Set();
10503
+ for (let n = 0; n < e.length; n++) {
10504
+ const r = this.pickPlayableHref(e[n]);
10505
+ n >= t - Ii && n <= t + Ii ? (this.ensure(r), i.add(r)) : n >= t - Ui && n <= t + Ui && this.pool.has(r) && i.add(r);
10551
10506
  }
10507
+ for (const [n, r] of this.pool)
10508
+ i.has(n) || (r.removeAttribute("src"), r.load(), this.pool.delete(n));
10552
10509
  }
10553
10510
  /**
10554
- * Preloads adjacent tracks (previous and next) for smoother navigation.
10555
- * @param currentIndex The current track index.
10556
- * @param direction The navigation direction ('forward' or 'backward').
10511
+ * Sets the current audio for playback at the given track index.
10512
+ * The element is always sourced from the pool — never loaded ad-hoc on the engine.
10557
10513
  */
10558
- preloadAdjacent(t, e = "forward") {
10559
- e === "forward" ? (this.preloadNext(t), this.preloadPrevious(t)) : (this.preloadPrevious(t), this.preloadNext(t));
10514
+ setCurrentAudio(t, e) {
10515
+ const i = this.pickPlayableHref(this._publication.readingOrder.items[t]), n = this.ensure(i);
10516
+ this.audioEngine.setMediaElement(n), this.pool.delete(i), this.update(t);
10560
10517
  }
10561
- /**
10562
- * Destroys the pool by stopping the engine and clearing all preloaded elements.
10563
- */
10564
10518
  destroy() {
10565
- this.audioEngine.stop(), this.preloadedElements.clear();
10519
+ this.audioEngine.stop();
10520
+ for (const [, t] of this.pool)
10521
+ t.removeAttribute("src"), t.load();
10522
+ this.pool.clear();
10566
10523
  }
10567
10524
  }
10568
- class Cs {
10525
+ class Rs {
10569
10526
  constructor(t = {}) {
10570
10527
  this.dragstartHandler = (e) => {
10571
10528
  e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
@@ -10579,7 +10536,7 @@ class Cs {
10579
10536
  document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("drop", this.dropHandler, !0);
10580
10537
  }
10581
10538
  }
10582
- class xs {
10539
+ class Ls {
10583
10540
  constructor(t = {}) {
10584
10541
  this.copyHandler = (e) => {
10585
10542
  e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
@@ -10589,16 +10546,16 @@ class xs {
10589
10546
  document.removeEventListener("copy", this.copyHandler, !0);
10590
10547
  }
10591
10548
  }
10592
- class Rs extends We {
10549
+ class ks extends We {
10593
10550
  constructor(t = {}) {
10594
- super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new Cs({
10551
+ super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new Rs({
10595
10552
  onDragDetected: (e) => {
10596
10553
  this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
10597
10554
  },
10598
10555
  onDropDetected: (e, i) => {
10599
10556
  this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
10600
10557
  }
10601
- })), t.protectCopy && (this.copyProtector = new xs({
10558
+ })), t.protectCopy && (this.copyProtector = new Ls({
10602
10559
  onCopyBlocked: () => {
10603
10560
  this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
10604
10561
  }
@@ -10608,7 +10565,7 @@ class Rs extends We {
10608
10565
  super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
10609
10566
  }
10610
10567
  }
10611
- const Ls = (s) => ({
10568
+ const Os = (s) => ({
10612
10569
  trackLoaded: s.trackLoaded ?? (() => {
10613
10570
  }),
10614
10571
  positionChanged: s.positionChanged ?? (() => {
@@ -10636,16 +10593,16 @@ const Ls = (s) => ({
10636
10593
  contextMenu: s.contextMenu ?? (() => {
10637
10594
  })
10638
10595
  });
10639
- class Os extends hr {
10596
+ class As extends dr {
10640
10597
  constructor(t, e, i, n = {
10641
10598
  preferences: {},
10642
10599
  defaults: {}
10643
10600
  }) {
10644
- if (super(), this.positionPollInterval = null, this.navigationId = 0, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.pub = t, this.listeners = Ls(e), this._preferences = new oe(n.preferences), this._defaults = new Ps(n.defaults), this._settings = new Fi(this._preferences, this._defaults), i)
10601
+ 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.pub = t, this.listeners = Os(e), this._preferences = new oe(n.preferences), this._defaults = new Cs(n.defaults), this._settings = new Ni(this._preferences, this._defaults), i)
10645
10602
  this.currentLocation = this.ensureLocatorLocations(i);
10646
10603
  else {
10647
10604
  const u = this.pub.readingOrder.items[0];
10648
- this.currentLocation = new F({
10605
+ this.currentLocation = new N({
10649
10606
  href: u.href,
10650
10607
  type: u.type || "audio/mpeg",
10651
10608
  title: u.title,
@@ -10657,7 +10614,7 @@ class Os extends hr {
10657
10614
  })
10658
10615
  });
10659
10616
  }
10660
- const r = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(r), a = this.currentLocation.locations?.time() || 0, l = new _s({
10617
+ const r = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(r), a = this.currentLocation.locations?.time() || 0, l = new Es({
10661
10618
  playback: {
10662
10619
  state: {
10663
10620
  currentTime: a,
@@ -10667,12 +10624,12 @@ class Os extends hr {
10667
10624
  index: o
10668
10625
  }
10669
10626
  });
10670
- this.pool = new Es(l, t);
10627
+ this.pool = new xs(l, t);
10671
10628
  const h = n.contentProtection || {}, c = this.mergeKeyboardPeripherals(
10672
10629
  h,
10673
10630
  n.keyboardPeripherals || []
10674
10631
  );
10675
- (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new Rs(h), this._suspiciousActivityListener = (u) => {
10632
+ (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new ks(h), this._suspiciousActivityListener = (u) => {
10676
10633
  const { type: m, ...y } = u.detail;
10677
10634
  m === "context_menu" ? this.listeners.contextMenu(y) : this.listeners.contentProtection(m, y);
10678
10635
  }, window.addEventListener(st, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new He({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
@@ -10686,19 +10643,19 @@ class Os extends hr {
10686
10643
  return this._settings;
10687
10644
  }
10688
10645
  get preferencesEditor() {
10689
- return this._preferencesEditor === null && (this._preferencesEditor = new Ni(this._preferences, this.settings)), this._preferencesEditor;
10646
+ return this._preferencesEditor === null && (this._preferencesEditor = new Fi(this._preferences, this.settings)), this._preferencesEditor;
10690
10647
  }
10691
10648
  async submitPreferences(t) {
10692
10649
  this._preferences = this._preferences.merging(t), this.applyPreferences();
10693
10650
  }
10694
10651
  applyPreferences() {
10695
- this._settings = new Fi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Ni(this._preferences, this.settings)), this.pool.audioEngine.setVolume(this._settings.volume), this.pool.audioEngine.setPlaybackRate(this._settings.playbackRate, this._settings.preservePitch), this._settings.enableMediaSession && !this._mediaSessionEnabled ? (this._mediaSessionEnabled = !0, this.setupMediaSession()) : !this._settings.enableMediaSession && this._mediaSessionEnabled && (this._mediaSessionEnabled = !1, this.destroyMediaSession());
10652
+ this._settings = new Ni(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Fi(this._preferences, this.settings)), this.pool.audioEngine.setVolume(this._settings.volume), this.pool.audioEngine.setPlaybackRate(this._settings.playbackRate, this._settings.preservePitch), this._settings.enableMediaSession && !this._mediaSessionEnabled ? (this._mediaSessionEnabled = !0, this.setupMediaSession()) : !this._settings.enableMediaSession && this._mediaSessionEnabled && (this._mediaSessionEnabled = !1, this.destroyMediaSession());
10696
10653
  }
10697
10654
  get publication() {
10698
10655
  return this.pub;
10699
10656
  }
10700
10657
  ensureLocatorLocations(t) {
10701
- return new F({
10658
+ return new N({
10702
10659
  ...t,
10703
10660
  locations: t.locations instanceof E ? t.locations : t.locations ? new E(t.locations) : void 0
10704
10661
  });
@@ -10731,7 +10688,7 @@ class Os extends hr {
10731
10688
  const i = this.pub.readingOrder.items[t];
10732
10689
  if (!i) throw new Error(`Invalid track index: ${t}`);
10733
10690
  const n = this.pool.audioEngine.duration();
10734
- return new F({
10691
+ return new N({
10735
10692
  href: i.href,
10736
10693
  type: i.type || "audio/mpeg",
10737
10694
  title: i.title,
@@ -10783,7 +10740,7 @@ class Os extends hr {
10783
10740
  position: this.currentTrackIndex(),
10784
10741
  progression: 1,
10785
10742
  fragments: [`t=${this.duration}`]
10786
- })), this.listeners.trackEnded(this.currentLocator), await this.nextTrack(), this._settings.autoPlay && this.play();
10743
+ })), this.listeners.trackEnded(this.currentLocator), this.canGoForward && (await this.nextTrack(), this._settings.autoPlay && this.play());
10787
10744
  }), this.pool.audioEngine.on("play", () => {
10788
10745
  this.startPositionPolling(), this.listeners.play(this.currentLocator);
10789
10746
  }), this.pool.audioEngine.on("playing", () => {
@@ -10839,9 +10796,9 @@ class Os extends hr {
10839
10796
  i(!1);
10840
10797
  return;
10841
10798
  }
10842
- const a = ++this.navigationId, l = r >= this.currentTrackIndex() ? "forward" : "backward", h = this.isPlaying;
10843
- if (this.stopPositionPolling(), this.pool.setCurrentAudio(r, l), this.currentLocation = t.copyWithLocations(t.locations), await this.waitForLoadedAndSeeked(o, a), a !== this.navigationId) return;
10844
- this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this.listeners.positionChanged(this.currentLocator), this._settings.enableMediaSession && this.updateMediaSessionMetadata(), h && this.play(), i(!0);
10799
+ const a = ++this.navigationId, l = r >= this.currentTrackIndex() ? "forward" : "backward", h = this.isPlaying || this._playIntent;
10800
+ if (this._playIntent = h, this.stopPositionPolling(), this.pool.setCurrentAudio(r, l), this.currentLocation = t.copyWithLocations(t.locations), await this.waitForLoadedAndSeeked(o, a), a !== this.navigationId) return;
10801
+ this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this.listeners.positionChanged(this.currentLocator), this._settings.enableMediaSession && this.updateMediaSessionMetadata(), h && this.play(), this._playIntent = !1, i(!0);
10845
10802
  } catch (n) {
10846
10803
  console.error("Failed to go to locator:", n), i(!1);
10847
10804
  }
@@ -10927,61 +10884,61 @@ class Os extends hr {
10927
10884
  }
10928
10885
  }
10929
10886
  export {
10930
- Ps as AudioDefaults,
10931
- Os as AudioNavigator,
10887
+ Cs as AudioDefaults,
10888
+ As as AudioNavigator,
10932
10889
  oe as AudioPreferences,
10933
- Ni as AudioPreferencesEditor,
10934
- Fi as AudioSettings,
10890
+ Fi as AudioPreferencesEditor,
10891
+ Ni as AudioSettings,
10935
10892
  O as BooleanPreference,
10936
- ln as EnumPreference,
10937
- os as EpubDefaults,
10938
- fn as EpubNavigator,
10893
+ cn as EnumPreference,
10894
+ ls as EpubDefaults,
10895
+ Sn as EpubNavigator,
10939
10896
  Ot as EpubPreferences,
10940
10897
  zi as EpubPreferencesEditor,
10941
10898
  Mi as EpubSettings,
10942
- ks as ExperimentalWebPubNavigator,
10943
- Kr as FXLCoordinator,
10944
- Xr as FXLFrameManager,
10945
- ss as FXLFramePoolManager,
10946
- Jr as FXLPeripherals,
10947
- Qr as FXLSpreader,
10899
+ Ts as ExperimentalWebPubNavigator,
10900
+ Jr as FXLCoordinator,
10901
+ qr as FXLFrameManager,
10902
+ as as FXLFramePoolManager,
10903
+ ts as FXLPeripherals,
10904
+ es as FXLSpreader,
10948
10905
  Lt as FrameComms,
10949
- Gr as FrameManager,
10950
- $r as FramePoolManager,
10951
- Yr as HorizontalThird,
10952
- dn as Injector,
10906
+ Xr as FrameManager,
10907
+ Yr as FramePoolManager,
10908
+ Kr as HorizontalThird,
10909
+ pn as Injector,
10953
10910
  _t as LineLengths,
10954
- hr as MediaNavigator,
10955
- tn as Navigator,
10911
+ dr as MediaNavigator,
10912
+ nn as Navigator,
10956
10913
  Re as Orientation,
10957
10914
  A as Preference,
10958
10915
  re as Properties,
10959
- ps as RSProperties,
10916
+ gs as RSProperties,
10960
10917
  R as RangePreference,
10961
- ms as ReadiumCSS,
10918
+ fs as ReadiumCSS,
10962
10919
  Le as Spread,
10963
10920
  J as TextAlignment,
10964
- gn as UserProperties,
10965
- qr as VerticalThird,
10966
- en as VisualNavigator,
10967
- _s as WebAudioEngine,
10968
- cr as WebPubBlobBuilder,
10969
- Pr as WebPubCSS,
10970
- xr as WebPubDefaults,
10971
- fr as WebPubFrameManager,
10972
- yr as WebPubFramePoolManager,
10973
- Vr as WebPubNavigator,
10921
+ yn as UserProperties,
10922
+ Zr as VerticalThird,
10923
+ rn as VisualNavigator,
10924
+ Es as WebAudioEngine,
10925
+ ur as WebPubBlobBuilder,
10926
+ Cr as WebPubCSS,
10927
+ Lr as WebPubDefaults,
10928
+ Sr as WebPubFrameManager,
10929
+ br as WebPubFramePoolManager,
10930
+ Gr as WebPubNavigator,
10974
10931
  kt as WebPubPreferences,
10975
10932
  Pi as WebPubPreferencesEditor,
10976
10933
  _i as WebPubSettings,
10977
- _r as WebRSProperties,
10978
- on as WebUserProperties,
10934
+ Er as WebRSProperties,
10935
+ ln as WebUserProperties,
10979
10936
  P as ensureBoolean,
10980
10937
  se as ensureEnumValue,
10981
- an as ensureExperiment,
10938
+ hn as ensureExperiment,
10982
10939
  ft as ensureFilter,
10983
- Er as ensureLessThanOrEqual,
10984
- Cr as ensureMoreThanOrEqual,
10940
+ xr as ensureLessThanOrEqual,
10941
+ Rr as ensureMoreThanOrEqual,
10985
10942
  w as ensureNonNegative,
10986
10943
  I as ensureString,
10987
10944
  M as ensureValueInRange,