@readium/navigator 2.4.0-alpha.3 → 2.4.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const v = class v {
1
+ const w = class w {
2
2
  constructor(t) {
3
3
  this.uri = t;
4
4
  }
@@ -7,7 +7,7 @@ const v = class v {
7
7
  */
8
8
  static deserialize(t) {
9
9
  if (!(!t || typeof t != "string"))
10
- return new v(t);
10
+ return new w(t);
11
11
  }
12
12
  /**
13
13
  * Serializes an [AccessibilityProfile] to its RWPM JSON representation.
@@ -19,23 +19,23 @@ const v = class v {
19
19
  * Returns true if the profile is a WCAG Level A profile.
20
20
  */
21
21
  get isWCAGLevelA() {
22
- return this === v.EPUB_A11Y_10_WCAG_20_A || this === v.EPUB_A11Y_11_WCAG_20_A || this === v.EPUB_A11Y_11_WCAG_21_A || this === v.EPUB_A11Y_11_WCAG_22_A;
22
+ return this === w.EPUB_A11Y_10_WCAG_20_A || this === w.EPUB_A11Y_11_WCAG_20_A || this === w.EPUB_A11Y_11_WCAG_21_A || this === w.EPUB_A11Y_11_WCAG_22_A;
23
23
  }
24
24
  /**
25
25
  * Returns true if the profile is a WCAG Level AA profile.
26
26
  */
27
27
  get isWCAGLevelAA() {
28
- return this === v.EPUB_A11Y_10_WCAG_20_AA || this === v.EPUB_A11Y_11_WCAG_20_AA || this === v.EPUB_A11Y_11_WCAG_21_AA || this === v.EPUB_A11Y_11_WCAG_22_AA;
28
+ return this === w.EPUB_A11Y_10_WCAG_20_AA || this === w.EPUB_A11Y_11_WCAG_20_AA || this === w.EPUB_A11Y_11_WCAG_21_AA || this === w.EPUB_A11Y_11_WCAG_22_AA;
29
29
  }
30
30
  /**
31
31
  * Returns true if the profile is a WCAG Level AAA profile.
32
32
  */
33
33
  get isWCAGLevelAAA() {
34
- return this === v.EPUB_A11Y_10_WCAG_20_AAA || this === v.EPUB_A11Y_11_WCAG_20_AAA || this === v.EPUB_A11Y_11_WCAG_21_AAA || this === v.EPUB_A11Y_11_WCAG_22_AAA;
34
+ return this === w.EPUB_A11Y_10_WCAG_20_AAA || this === w.EPUB_A11Y_11_WCAG_20_AAA || this === w.EPUB_A11Y_11_WCAG_21_AAA || this === w.EPUB_A11Y_11_WCAG_22_AAA;
35
35
  }
36
36
  };
37
- v.EPUB_A11Y_10_WCAG_20_A = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), v.EPUB_A11Y_10_WCAG_20_AA = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), v.EPUB_A11Y_10_WCAG_20_AAA = new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), v.EPUB_A11Y_11_WCAG_20_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), v.EPUB_A11Y_11_WCAG_20_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), v.EPUB_A11Y_11_WCAG_20_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), v.EPUB_A11Y_11_WCAG_21_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), v.EPUB_A11Y_11_WCAG_21_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), v.EPUB_A11Y_11_WCAG_21_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), v.EPUB_A11Y_11_WCAG_22_A = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), v.EPUB_A11Y_11_WCAG_22_AA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), v.EPUB_A11Y_11_WCAG_22_AAA = new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
38
- let De = v;
37
+ w.EPUB_A11Y_10_WCAG_20_A = new w("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), w.EPUB_A11Y_10_WCAG_20_AA = new w("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), w.EPUB_A11Y_10_WCAG_20_AAA = new w("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), w.EPUB_A11Y_11_WCAG_20_A = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), w.EPUB_A11Y_11_WCAG_20_AA = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), w.EPUB_A11Y_11_WCAG_20_AAA = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), w.EPUB_A11Y_11_WCAG_21_A = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), w.EPUB_A11Y_11_WCAG_21_AA = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), w.EPUB_A11Y_11_WCAG_21_AAA = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), w.EPUB_A11Y_11_WCAG_22_A = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), w.EPUB_A11Y_11_WCAG_22_AA = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), w.EPUB_A11Y_11_WCAG_22_AAA = new w("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
38
+ let De = w;
39
39
  const E = class E {
40
40
  constructor(t) {
41
41
  this.value = t;
@@ -154,7 +154,7 @@ x.NONE = new x("none"), x.DOCUMENTED = new x("documented"), x.LEGAL = new x("leg
154
154
  let Be = x;
155
155
  const Ve = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], un = /* @__PURE__ */ JSON.parse(`{"format":{"audiobook":"Audiobook","audiobookJSON":"Audiobook Manifest","cbz":"Comic Book Archive","divina":"Divina Publication","divinaJSON":"Divina Publication Manifest","epub":"EPUB","lcpa":"LCP Protected Audiobook","lcpdf":"LCP Protected PDF","lcpl":"LCP License Document","pdf":"PDF","rwp":"Readium Web Publication","rwpm":"Readium Web Publication Manifest","zab":"Audiobook Archive","zip":"ZIP Archive"},"kind":{"audiobook_one":"audiobook","audiobook_other":"audiobooks","book_one":"book","book_other":"books","comic_one":"comic","comic_other":"comics","document_one":"document","document_other":"documents"},"metadata":{"accessibility":{"display-guide":{"accessibility-summary":{"no-metadata":"No information is available","publisher-contact":"For more information about the accessibility of this product, please contact the publisher: ","title":"Accessibility summary"},"additional-accessibility-information":{"aria":{"compact":"ARIA roles included","descriptive":"Content is enhanced with ARIA roles to optimize organization and facilitate navigation"},"audio-descriptions":"Audio descriptions","braille":"Braille","color-not-sole-means-of-conveying-information":"Color is not the sole means of conveying information","dyslexia-readability":"Dyslexia readability","full-ruby-annotations":"Full ruby annotations","high-contrast-between-foreground-and-background-audio":"High contrast between foreground and background audio","high-contrast-between-text-and-background":"High contrast between foreground text and background","large-print":"Large print","page-breaks":{"compact":"Page breaks included","descriptive":"Page breaks included from the original print source"},"ruby-annotations":"Some Ruby annotations","sign-language":"Sign language","tactile-graphics":{"compact":"Tactile graphics included","descriptive":"Tactile graphics have been integrated to facilitate access to visual elements for blind people"},"tactile-objects":"Tactile 3D objects","text-to-speech-hinting":"Text-to-speech hinting provided","title":"Additional accessibility information","ultra-high-contrast-between-text-and-background":"Ultra high contrast between text and background","visible-page-numbering":"Visible page numbering","without-background-sounds":"Without background sounds"},"conformance":{"a":{"compact":"This publication meets minimum accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level A standard"},"aa":{"compact":"This publication meets accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AA standard"},"aaa":{"compact":"This publication exceeds accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AAA standard"},"certifier":"The publication was certified by ","certifier-credentials":"The certifier's credential is ","details":{"certification-info":"The publication was certified on ","certifier-report":"For more information refer to the certifier's report","claim":"This publication claims to meet","epub-accessibility-1-0":"EPUB Accessibility 1.0","epub-accessibility-1-1":"EPUB Accessibility 1.1","level-a":"Level A","level-aa":"Level AA","level-aaa":"Level AAA","wcag-2-0":{"compact":"WCAG 2.0","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.0"},"wcag-2-1":{"compact":"WCAG 2.1","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.1"},"wcag-2-2":{"compact":"WCAG 2.2","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.2"}},"details-title":"Detailed conformance information","no":"No information is available","title":"Conformance","unknown-standard":"Conformance to accepted standards for accessibility of this publication cannot be determined"},"hazards":{"flashing":{"compact":"Flashing content","descriptive":"The publication contains flashing content that can cause photosensitive seizures"},"flashing-none":{"compact":"No flashing hazards","descriptive":"The publication does not contain flashing content that can cause photosensitive seizures"},"flashing-unknown":{"compact":"Flashing hazards not known","descriptive":"The presence of flashing content that can cause photosensitive seizures could not be determined"},"motion":{"compact":"Motion simulation","descriptive":"The publication contains motion simulations that can cause motion sickness"},"motion-none":{"compact":"No motion simulation hazards","descriptive":"The publication does not contain motion simulations that can cause motion sickness"},"motion-unknown":{"compact":"Motion simulation hazards not known","descriptive":"The presence of motion simulations that can cause motion sickness could not be determined"},"no-metadata":"No information is available","none":{"compact":"No hazards","descriptive":"The publication contains no hazards"},"sound":{"compact":"Sounds","descriptive":"The publication contains sounds that can cause sensitivity issues"},"sound-none":{"compact":"No sound hazards","descriptive":"The publication does not contain sounds that can cause sensitivity issues"},"sound-unknown":{"compact":"Sound hazards not known","descriptive":"The presence of sounds that can cause sensitivity issues could not be determined"},"title":"Hazards","unknown":"The presence of hazards is unknown"},"legal-considerations":{"exempt":{"compact":"Claims an accessibility exemption in some jurisdictions","descriptive":"This publication claims an accessibility exemption in some jurisdictions"},"no-metadata":"No information is available","title":"Legal considerations"},"navigation":{"index":{"compact":"Index","descriptive":"Index with links to referenced entries"},"no-metadata":"No information is available","page-navigation":{"compact":"Go to page","descriptive":"Page list to go to pages from the print source version"},"structural":{"compact":"Headings","descriptive":"Elements such as headings, tables, etc for structured navigation"},"title":"Navigation","toc":{"compact":"Table of contents","descriptive":"Table of contents to all chapters of the text via links"}},"rich-content":{"accessible-chemistry-as-latex":{"compact":"Chemical formulas in LaTeX","descriptive":"Chemical formulas in accessible format (LaTeX)"},"accessible-chemistry-as-mathml":{"compact":"Chemical formulas in MathML","descriptive":"Chemical formulas in accessible format (MathML)"},"accessible-math-as-latex":{"compact":"Math as LaTeX","descriptive":"Math formulas in accessible format (LaTeX)"},"accessible-math-described":"Text descriptions of math are provided","closed-captions":{"compact":"Videos have closed captions","descriptive":"Videos included in publications have closed captions"},"extended-descriptions":"Information-rich images are described by extended descriptions","math-as-mathml":{"compact":"Math as MathML","descriptive":"Math formulas in accessible format (MathML)"},"open-captions":{"compact":"Videos have open captions","descriptive":"Videos included in publications have open captions"},"title":"Rich content","transcript":"Transcript(s) provided","unknown":"No information is available"},"ways-of-reading":{"nonvisual-reading":{"alt-text":{"compact":"Has alternative text","descriptive":"Has alternative text descriptions for images"},"no-metadata":"No information about nonvisual reading is available","none":{"compact":"Not readable in read aloud or dynamic braille","descriptive":"The content is not readable as read aloud speech or dynamic braille"},"not-fully":{"compact":"Not fully readable in read aloud or dynamic braille","descriptive":"Not all of the content will be readable as read aloud speech or dynamic braille"},"readable":{"compact":"Readable in read aloud or dynamic braille","descriptive":"All content can be read as read aloud speech or dynamic braille"}},"prerecorded-audio":{"complementary":{"compact":"Prerecorded audio clips","descriptive":"Prerecorded audio clips are embedded in the content"},"no-metadata":"No information about prerecorded audio is available","only":{"compact":"Prerecorded audio only","descriptive":"Audiobook with no text alternative"},"synchronized":{"compact":"Prerecorded audio synchronized with text","descriptive":"All the content is available as prerecorded audio synchronized with text"}},"title":"Ways of reading","visual-adjustments":{"modifiable":{"compact":"Appearance can be modified","descriptive":"Appearance of the text and page layout can be modified according to the capabilities of the reading system (font family and font size, spaces between paragraphs, sentences, words, and letters, as well as color of background and text)"},"unknown":"No information about appearance modifiability is available","unmodifiable":{"compact":"Appearance cannot be modified","descriptive":"Text and page layout cannot be modified as the reading experience is close to a print version, but reading systems can still provide zooming options"}}}}},"altIdentifier_one":"alternate identifier","altIdentifier_other":"alternate identifiers","artist_one":"artist","artist_other":"artists","author_one":"author","author_other":"authors","collection_one":"editorial collection","collection_other":"editorial collections","colorist_one":"colorist","colorist_other":"colorists","contributor_one":"contributor","contributor_other":"contributors","description":"description","duration":"duration","editor_one":"editor","editor_other":"editors","identifier_one":"identifier","identifier_other":"identifiers","illustrator_one":"illustrator","illustrator_other":"illustrators","imprint_one":"imprint","imprint_other":"imprints","inker_one":"inker","inker_other":"inkers","language_one":"language","language_other":"languages","letterer_one":"letterer","letterer_other":"letterers","modified":"modification date","narrator_one":"narrator","narrator_other":"narrators","numberOfPages":"print length","penciler_one":"penciler","penciler_other":"pencilers","published":"publication date","publisher_one":"publisher","publisher_other":"publishers","series_one":"series","series_other":"series","subject_one":"subject","subject_other":"subjects","subtitle":"subtitle","title":"title","translator_one":"translator","translator_other":"translators"}}`), pn = {
156
156
  publication: un
157
- }, je = {
157
+ }, Ge = {
158
158
  fr: () => import("./fr-C5HEel98.js"),
159
159
  ar: () => import("./ar-DyHX_uy2.js"),
160
160
  da: () => import("./da-Dct0PS3E.js"),
@@ -165,10 +165,10 @@ const Ve = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], un = /* @__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
- }, Ge = pn?.publication?.metadata?.accessibility?.["display-guide"] || {};
168
+ }, je = pn?.publication?.metadata?.accessibility?.["display-guide"] || {};
169
169
  class dt {
170
170
  constructor() {
171
- this.currentLocaleCode = "en", this.locale = Ge, this.loadedLocales = {}, this.loadedLocales.en = Ge;
171
+ this.currentLocaleCode = "en", this.locale = je, this.loadedLocales = {}, this.loadedLocales.en = je;
172
172
  }
173
173
  static getInstance() {
174
174
  return dt.instance || (dt.instance = new dt()), dt.instance;
@@ -184,9 +184,9 @@ class dt {
184
184
  if (t in this.loadedLocales)
185
185
  return !0;
186
186
  try {
187
- if (!(t in je))
187
+ if (!(t in Ge))
188
188
  return console.warn(`Locale file not found for: ${t}`), !1;
189
- const n = (await je[t]()).default?.publication?.metadata?.accessibility?.["display-guide"];
189
+ const n = (await Ge[t]()).default?.publication?.metadata?.accessibility?.["display-guide"];
190
190
  return n ? (this.loadedLocales[t] = n, !0) : (console.warn(`No accessibility strings found in locale ${t}`), !1);
191
191
  } catch (e) {
192
192
  return console.warn(`Failed to load locale ${t}:`, e), !1;
@@ -272,8 +272,8 @@ class Ce {
272
272
  return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
273
273
  }
274
274
  }
275
- var j = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.center = "center", s))(j || {});
276
- let G = class ce {
275
+ var G = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.center = "center", s))(G || {});
276
+ let j = class ce {
277
277
  constructor(t) {
278
278
  this.otherProperties = t;
279
279
  }
@@ -303,7 +303,7 @@ let G = class ce {
303
303
  return new ce(e);
304
304
  }
305
305
  };
306
- Object.defineProperty(G.prototype, "encryption", {
306
+ Object.defineProperty(j.prototype, "encryption", {
307
307
  get: function() {
308
308
  return Ce.deserialize(this.otherProperties.encrypted);
309
309
  }
@@ -810,7 +810,7 @@ class Xe {
810
810
  return this.uri.replace(/\{(\??)([^}]+)\}/g, (...n) => n[1] ? i(n[2]) : e(n[2]));
811
811
  }
812
812
  }
813
- class k {
813
+ class O {
814
814
  /**
815
815
  * Creates a [Locations].
816
816
  */
@@ -831,7 +831,7 @@ class k {
831
831
  ]);
832
832
  return Object.entries(t).forEach(([a, l]) => {
833
833
  o.has(a) || r.set(a, l);
834
- }), new k({
834
+ }), new O({
835
835
  fragments: Li(t.fragments || t.fragment),
836
836
  progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
837
837
  totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
@@ -878,7 +878,7 @@ class H {
878
878
  * Creates a [Locator].
879
879
  */
880
880
  constructor(t) {
881
- this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new k({}), this.text = t.text;
881
+ this.href = t.href, this.type = t.type, this.title = t.title, this.locations = t.locations ? t.locations : new O({}), this.text = t.text;
882
882
  }
883
883
  /**
884
884
  * Parses a [Link] from its RWPM JSON representation.
@@ -889,7 +889,7 @@ class H {
889
889
  href: t.href,
890
890
  type: t.type,
891
891
  title: t.title,
892
- locations: k.deserialize(t.locations),
892
+ locations: O.deserialize(t.locations),
893
893
  text: rt.deserialize(t.text)
894
894
  });
895
895
  }
@@ -909,7 +909,7 @@ class H {
909
909
  type: this.type,
910
910
  title: this.title,
911
911
  text: this.text,
912
- locations: new k({ ...this.locations, ...t })
912
+ locations: new O({ ...this.locations, ...t })
913
913
  });
914
914
  }
915
915
  }
@@ -931,7 +931,7 @@ class B {
931
931
  type: t.type,
932
932
  title: t.title,
933
933
  rels: t.rel ? Array.isArray(t.rel) ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
934
- properties: G.deserialize(t.properties),
934
+ properties: j.deserialize(t.properties),
935
935
  height: W(t.height),
936
936
  width: W(t.width),
937
937
  size: W(t.size),
@@ -980,7 +980,7 @@ class B {
980
980
  */
981
981
  addProperties(t) {
982
982
  const e = B.deserialize(this.serialize());
983
- return e.properties = e.properties ? e.properties?.add(t) : new G(t), e;
983
+ return e.properties = e.properties ? e.properties?.add(t) : new j(t), e;
984
984
  }
985
985
  /**
986
986
  * Creates a [Locator] from a reading order [Link].
@@ -991,7 +991,7 @@ class B {
991
991
  href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
992
992
  type: this.type ?? "",
993
993
  title: this.title,
994
- locations: new k({
994
+ locations: new O({
995
995
  fragments: t.length > 1 && t[1] !== void 0 ? [t[1]] : []
996
996
  })
997
997
  });
@@ -1092,7 +1092,7 @@ class Ft {
1092
1092
  }
1093
1093
  }
1094
1094
  var Oi = /* @__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))(Oi || {}), F = /* @__PURE__ */ ((s) => (s.ltr = "ltr", s.rtl = "rtl", s))(F || {});
1095
- G.prototype.getContains = function() {
1095
+ j.prototype.getContains = function() {
1096
1096
  return new Set(this.otherProperties.contains || []);
1097
1097
  };
1098
1098
  class Dt {
@@ -1154,16 +1154,16 @@ class xe {
1154
1154
  return this.end && (t.end = this.end.serialize()), t;
1155
1155
  }
1156
1156
  }
1157
- k.prototype.getCssSelector = function() {
1157
+ O.prototype.getCssSelector = function() {
1158
1158
  return this.otherLocations?.get("cssSelector");
1159
1159
  };
1160
- k.prototype.getPartialCfi = function() {
1160
+ O.prototype.getPartialCfi = function() {
1161
1161
  return this.otherLocations?.get("partialCfi");
1162
1162
  };
1163
- k.prototype.getDomRange = function() {
1163
+ O.prototype.getDomRange = function() {
1164
1164
  return xe.deserialize(this.otherLocations?.get("domRange"));
1165
1165
  };
1166
- k.prototype.fragmentParameters = function() {
1166
+ O.prototype.fragmentParameters = function() {
1167
1167
  return new Map(
1168
1168
  this.fragments.map((s) => s.startsWith("#") ? s.slice(1) : s).join("&").split("&").filter((s) => !s.startsWith("#")).map((s) => s.split("=")).filter((s) => s.length === 2).map((s) => [
1169
1169
  s[0].trim().toLowerCase(),
@@ -1171,7 +1171,7 @@ k.prototype.fragmentParameters = function() {
1171
1171
  ])
1172
1172
  );
1173
1173
  };
1174
- k.prototype.htmlId = function() {
1174
+ O.prototype.htmlId = function() {
1175
1175
  if (!this.fragments.length) return;
1176
1176
  let s = this.fragments.find((t) => t.length && !t.includes("="));
1177
1177
  if (!s) {
@@ -1180,22 +1180,22 @@ k.prototype.htmlId = function() {
1180
1180
  }
1181
1181
  return s?.startsWith("#") ? s.slice(1) : s;
1182
1182
  };
1183
- k.prototype.page = function() {
1183
+ O.prototype.page = function() {
1184
1184
  const s = parseInt(this.fragmentParameters().get("page"));
1185
1185
  if (!isNaN(s) && s >= 0) return s;
1186
1186
  };
1187
- k.prototype.time = function() {
1187
+ O.prototype.time = function() {
1188
1188
  const s = parseInt(this.fragmentParameters().get("t"));
1189
1189
  if (!isNaN(s)) return s;
1190
1190
  };
1191
- k.prototype.space = function() {
1191
+ O.prototype.space = function() {
1192
1192
  const s = this.fragmentParameters();
1193
1193
  if (!s.has("xywh")) return;
1194
1194
  const t = s.get("xywh").split(",").map((e) => parseInt(e));
1195
1195
  if (t.length === 4 && !t.some(isNaN))
1196
1196
  return t;
1197
1197
  };
1198
- k.prototype.text = function() {
1198
+ O.prototype.text = function() {
1199
1199
  const s = this.fragmentParameters();
1200
1200
  console.log(s);
1201
1201
  };
@@ -1320,27 +1320,27 @@ class ke {
1320
1320
  return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
1321
1321
  }
1322
1322
  }
1323
- G.prototype.getNumberOfItems = function() {
1323
+ j.prototype.getNumberOfItems = function() {
1324
1324
  return W(this.otherProperties.numberOfItems);
1325
1325
  };
1326
- G.prototype.getPrice = function() {
1326
+ j.prototype.getPrice = function() {
1327
1327
  return Re.deserialize(this.otherProperties.price);
1328
1328
  };
1329
- G.prototype.getIndirectAcquisitions = function() {
1329
+ j.prototype.getIndirectAcquisitions = function() {
1330
1330
  const s = this.otherProperties.indirectAcquisition;
1331
1331
  if (s && Array.isArray(s))
1332
1332
  return s.map((t) => St.deserialize(t)).filter((t) => t !== void 0);
1333
1333
  };
1334
- G.prototype.getHolds = function() {
1334
+ j.prototype.getHolds = function() {
1335
1335
  return Le.deserialize(this.otherProperties.holds);
1336
1336
  };
1337
- G.prototype.getCopies = function() {
1337
+ j.prototype.getCopies = function() {
1338
1338
  return Oe.deserialize(this.otherProperties.copies);
1339
1339
  };
1340
- G.prototype.getAvailability = function() {
1340
+ j.prototype.getAvailability = function() {
1341
1341
  return ke.deserialize(this.otherProperties.availability);
1342
1342
  };
1343
- G.prototype.getAuthenticate = function() {
1343
+ j.prototype.getAuthenticate = function() {
1344
1344
  return B.deserialize(this.otherProperties.authenticate);
1345
1345
  };
1346
1346
  const fn = "CssSelectorGenerator";
@@ -1515,10 +1515,10 @@ function ki(s, t, e) {
1515
1515
  for (let p = 0; p <= r; p += 1) {
1516
1516
  d[p] = 0;
1517
1517
  for (let b = 0; b < n; b += 1) {
1518
- const w = p * n + b;
1519
- if (w >= t.length)
1518
+ const _ = p * n + b;
1519
+ if (_ >= t.length)
1520
1520
  continue;
1521
- t.charCodeAt(w) === y && (d[p] |= 1 << b);
1521
+ t.charCodeAt(_) === y && (d[p] |= 1 << b);
1522
1522
  }
1523
1523
  }
1524
1524
  }
@@ -1540,8 +1540,8 @@ function ki(s, t, e) {
1540
1540
  h += 1, o.P[h] = -1, o.M[h] = 0;
1541
1541
  let b;
1542
1542
  if (h === r) {
1543
- const w = t.length % n;
1544
- b = w === 0 ? n : w;
1543
+ const _ = t.length % n;
1544
+ b = _ === 0 ? n : _;
1545
1545
  } else
1546
1546
  b = n;
1547
1547
  u[h] = u[h - 1] + b - p + Ze(o, d, h, p);
@@ -2329,14 +2329,14 @@ class Nn {
2329
2329
  ), r = i / (n || 1), o = this.wnd.document.scrollingElement, a = o.scrollLeft, l = o.scrollTop, c = (d, p, b) => {
2330
2330
  if (d.style.position = "absolute", t.decoration?.style?.width === "viewport") {
2331
2331
  d.style.width = `${i}px`, d.style.height = `${p.height}px`;
2332
- let w = Math.floor(p.left / i) * i;
2333
- d.style.left = `${w + a}px`, d.style.top = `${p.top + l}px`;
2332
+ let _ = Math.floor(p.left / i) * i;
2333
+ d.style.left = `${_ + a}px`, d.style.top = `${p.top + l}px`;
2334
2334
  } else if (t.decoration?.style?.width === "bounds")
2335
2335
  d.style.width = `${b.width}px`, d.style.height = `${p.height}px`, d.style.left = `${b.left + a}px`, d.style.top = `${p.top + l}px`;
2336
2336
  else if (t.decoration?.style?.width === "page") {
2337
2337
  d.style.width = `${r}px`, d.style.height = `${p.height}px`;
2338
- let w = Math.floor(p.left / r) * r;
2339
- d.style.left = `${w + a}px`, d.style.top = `${p.top + l}px`;
2338
+ let _ = Math.floor(p.left / r) * r;
2339
+ d.style.left = `${_ + a}px`, d.style.top = `${p.top + l}px`;
2340
2340
  } else
2341
2341
  d.style.width = `${p.width}px`, d.style.height = `${p.height}px`, d.style.left = `${p.left + a}px`, d.style.top = `${p.top + l}px`;
2342
2342
  }, h = t.range.getBoundingClientRect();
@@ -2534,7 +2534,7 @@ function Ii(s) {
2534
2534
  function Fn(s) {
2535
2535
  return s < 0.5 ? 2 * s * s : -1 + (4 - 2 * s) * s;
2536
2536
  }
2537
- function A(s) {
2537
+ function T(s) {
2538
2538
  const t = s.getSelection();
2539
2539
  t && t.removeAllRanges();
2540
2540
  }
@@ -2562,7 +2562,7 @@ function Ae(s, t) {
2562
2562
  return new H({
2563
2563
  href: "#",
2564
2564
  type: "application/xhtml+xml",
2565
- locations: new k({
2565
+ locations: new O({
2566
2566
  otherLocations: /* @__PURE__ */ new Map([
2567
2567
  ["cssSelector", i]
2568
2568
  ])
@@ -2667,7 +2667,7 @@ class ze {
2667
2667
  this.history = [], this.consistentScrollCount = 0;
2668
2668
  }
2669
2669
  }
2670
- const hi = "readium-column-snapper-style", jn = 200, U = class U extends Et {
2670
+ const hi = "readium-column-snapper-style", Gn = 200, U = class U extends Et {
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
  }
@@ -2711,16 +2711,16 @@ const hi = "readium-column-snapper-style", jn = 200, U = class U extends Et {
2711
2711
  ), h = this.snapOffset(a + c), u = h > this.scrollOffset() ? "right" : "left";
2712
2712
  if (this.checkSuspiciousSnap(u, Math.abs(h - this.scrollOffset())), t && h !== this.scrollOffset()) {
2713
2713
  this.snappingCancelled = !1;
2714
- const m = (b, w, L, Q) => L > Q ? w : b + (w - b) * Fn(L / Q), y = (
2714
+ const m = (b, _, z, Q) => z > Q ? _ : b + (_ - b) * Fn(z / Q), y = (
2715
2715
  /*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
2716
- jn * o
2716
+ Gn * o
2717
2717
  );
2718
2718
  let d;
2719
2719
  const p = (b) => {
2720
2720
  if (this.snappingCancelled) return;
2721
2721
  d || (d = b);
2722
- const w = b - d, L = m(this.overscroll, 0, w, y), Q = m(i, h, w, y);
2723
- n.scrollLeft = Q, this.overscroll !== 0 && (n.style.transform = `translate3d(${-L}px, 0px, 0px)`), w < y ? this.wnd.requestAnimationFrame(p) : (this.clearTouches(), n.style.removeProperty("transform"), n.scrollLeft = h, e || this.reportProgress());
2722
+ const _ = b - d, z = m(this.overscroll, 0, _, y), Q = m(i, h, _, y);
2723
+ n.scrollLeft = Q, this.overscroll !== 0 && (n.style.transform = `translate3d(${-z}px, 0px, 0px)`), _ < y ? this.wnd.requestAnimationFrame(p) : (this.clearTouches(), n.style.removeProperty("transform"), n.scrollLeft = h, e || this.reportProgress());
2724
2724
  };
2725
2725
  this.wnd.requestAnimationFrame(p);
2726
2726
  } else
@@ -2760,7 +2760,7 @@ const hi = "readium-column-snapper-style", jn = 200, U = class U extends Et {
2760
2760
  }
2761
2761
  onTouchMove(t) {
2762
2762
  if (this.touchState === 0) return;
2763
- this.touchState === 1 && (this.touchState = 2, A(this.wnd)), this.endingX = t.touches[0].clientX;
2763
+ this.touchState === 1 && (this.touchState = 2, T(this.wnd)), this.endingX = t.touches[0].clientX;
2764
2764
  const e = this.dragOffset(), i = this.alreadyScrollLeft + e;
2765
2765
  i < 0 ? (this.overscroll = i, this.doc().style.transform = `translate3d(${-this.overscroll}px, 0px, 0px)`) : i + this.wnd.innerWidth > this.cachedScrollWidth ? (this.overscroll = i, this.doc().style.transform = `translate3d(${-i}px, 0px, 0px)`) : (this.overscroll = 0, this.doc().style.removeProperty("transform"), this.doc().scrollLeft = this.alreadyScrollLeft + e);
2766
2766
  }
@@ -2856,7 +2856,7 @@ const hi = "readium-column-snapper-style", jn = 200, U = class U extends Et {
2856
2856
  this.wnd.requestAnimationFrame(() => {
2857
2857
  this.cachedScrollWidth = this.doc().scrollWidth;
2858
2858
  const l = this.cachedScrollWidth, c = nt(t) ? -1 : 1, h = l * a * c;
2859
- this.doc().scrollLeft = this.snapOffset(h), this.reportProgress(), A(this.wnd), o(!0);
2859
+ this.doc().scrollLeft = this.snapOffset(h), this.reportProgress(), T(this.wnd), o(!0);
2860
2860
  });
2861
2861
  }), e.register("go_id", U.moduleName, (r, o) => {
2862
2862
  const a = t.document.getElementById(r);
@@ -2865,7 +2865,7 @@ const hi = "readium-column-snapper-style", jn = 200, U = class U extends Et {
2865
2865
  return;
2866
2866
  }
2867
2867
  this.wnd.requestAnimationFrame(() => {
2868
- this.doc().scrollLeft = this.snapOffset(a.getBoundingClientRect().left + t.scrollX), this.reportProgress(), A(this.wnd), o(!0);
2868
+ this.doc().scrollLeft = this.snapOffset(a.getBoundingClientRect().left + t.scrollX), this.reportProgress(), T(this.wnd), o(!0);
2869
2869
  });
2870
2870
  }), e.register("go_text", U.moduleName, (r, o) => {
2871
2871
  let a;
@@ -2874,7 +2874,7 @@ const hi = "readium-column-snapper-style", jn = 200, U = class U extends Et {
2874
2874
  href: t.location.href,
2875
2875
  type: "text/html",
2876
2876
  text: l,
2877
- locations: a ? new k({
2877
+ locations: a ? new O({
2878
2878
  otherLocations: /* @__PURE__ */ new Map([
2879
2879
  ["cssSelector", a]
2880
2880
  ])
@@ -2885,7 +2885,7 @@ const hi = "readium-column-snapper-style", jn = 200, U = class U extends Et {
2885
2885
  return;
2886
2886
  }
2887
2887
  this.wnd.requestAnimationFrame(() => {
2888
- this.doc().scrollLeft = this.snapOffset(c.getBoundingClientRect().left + t.scrollX), this.reportProgress(), A(this.wnd), o(!0);
2888
+ this.doc().scrollLeft = this.snapOffset(c.getBoundingClientRect().left + t.scrollX), this.reportProgress(), T(this.wnd), o(!0);
2889
2889
  });
2890
2890
  }), e.register("go_end", U.moduleName, (r, o) => {
2891
2891
  const a = nt(t) ? -1 : 1;
@@ -2893,27 +2893,27 @@ const hi = "readium-column-snapper-style", jn = 200, U = class U extends Et {
2893
2893
  this.cachedScrollWidth = this.doc().scrollWidth;
2894
2894
  const l = this.cachedScrollWidth * a;
2895
2895
  if (this.doc().scrollLeft === l) return o(!1);
2896
- this.doc().scrollLeft = this.snapOffset(l), this.reportProgress(), A(this.wnd), o(!0);
2896
+ this.doc().scrollLeft = this.snapOffset(l), this.reportProgress(), T(this.wnd), o(!0);
2897
2897
  });
2898
2898
  }), e.register("go_start", U.moduleName, (r, o) => {
2899
2899
  this.wnd.requestAnimationFrame(() => {
2900
2900
  if (this.doc().scrollLeft === 0) return o(!1);
2901
- this.doc().scrollLeft = 0, this.reportProgress(), A(this.wnd), o(!0);
2901
+ this.doc().scrollLeft = 0, this.reportProgress(), T(this.wnd), o(!0);
2902
2902
  });
2903
2903
  }), e.register("go_prev", U.moduleName, (r, o) => {
2904
2904
  this.wnd.requestAnimationFrame(() => {
2905
2905
  this.cachedScrollWidth = this.doc().scrollWidth;
2906
2906
  const a = t.scrollX - t.innerWidth, l = nt(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, c = n(Math.max(a, l));
2907
- c && (this.reportProgress(), A(this.wnd), this.checkSuspiciousSnap("left", this.wnd.innerWidth)), o(c);
2907
+ c && (this.reportProgress(), T(this.wnd), this.checkSuspiciousSnap("left", this.wnd.innerWidth)), o(c);
2908
2908
  });
2909
2909
  }), e.register("go_next", U.moduleName, (r, o) => {
2910
2910
  this.wnd.requestAnimationFrame(() => {
2911
2911
  this.cachedScrollWidth = this.doc().scrollWidth;
2912
2912
  const a = t.scrollX + t.innerWidth, l = nt(t) ? 0 : this.cachedScrollWidth - t.innerWidth, c = n(Math.min(a, l));
2913
- c && (this.reportProgress(), A(this.wnd), this.checkSuspiciousSnap("right", this.wnd.innerWidth)), o(c);
2913
+ c && (this.reportProgress(), T(this.wnd), this.checkSuspiciousSnap("right", this.wnd.innerWidth)), o(c);
2914
2914
  });
2915
2915
  }), e.register("unfocus", U.moduleName, (r, o) => {
2916
- this.snappingCancelled = !0, A(this.wnd), o(!0);
2916
+ this.snappingCancelled = !0, T(this.wnd), o(!0);
2917
2917
  }), e.register("shake", U.moduleName, (r, o) => {
2918
2918
  this.shake(), o(!0);
2919
2919
  }), e.register("focus", U.moduleName, (r, o) => {
@@ -3008,7 +3008,7 @@ const ci = "readium-scroll-snapper-style", D = class D extends Et {
3008
3008
  return;
3009
3009
  }
3010
3010
  this.wnd.requestAnimationFrame(() => {
3011
- this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(), A(this.wnd), r(!0);
3011
+ this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(), T(this.wnd), r(!0);
3012
3012
  });
3013
3013
  }), e.register("go_id", D.moduleName, (n, r) => {
3014
3014
  const o = t.document.getElementById(n);
@@ -3017,7 +3017,7 @@ const ci = "readium-scroll-snapper-style", D = class D extends Et {
3017
3017
  return;
3018
3018
  }
3019
3019
  this.wnd.requestAnimationFrame(() => {
3020
- this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), A(this.wnd), r(!0);
3020
+ this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), T(this.wnd), r(!0);
3021
3021
  });
3022
3022
  }), e.register("go_text", D.moduleName, (n, r) => {
3023
3023
  let o;
@@ -3026,7 +3026,7 @@ const ci = "readium-scroll-snapper-style", D = class D extends Et {
3026
3026
  href: t.location.href,
3027
3027
  type: "text/html",
3028
3028
  text: a,
3029
- locations: o ? new k({
3029
+ locations: o ? new O({
3030
3030
  otherLocations: /* @__PURE__ */ new Map([
3031
3031
  ["cssSelector", o]
3032
3032
  ])
@@ -3037,7 +3037,7 @@ const ci = "readium-scroll-snapper-style", D = class D extends Et {
3037
3037
  return;
3038
3038
  }
3039
3039
  this.wnd.requestAnimationFrame(() => {
3040
- this.doc().scrollTop = l.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), A(this.wnd), r(!0);
3040
+ this.doc().scrollTop = l.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), T(this.wnd), r(!0);
3041
3041
  });
3042
3042
  }), e.register("go_start", D.moduleName, (n, r) => {
3043
3043
  if (this.doc().scrollTop === 0) return r(!1);
@@ -3046,7 +3046,7 @@ const ci = "readium-scroll-snapper-style", D = class D extends Et {
3046
3046
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return r(!1);
3047
3047
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), r(!0);
3048
3048
  }), e.register("unfocus", D.moduleName, (n, r) => {
3049
- A(this.wnd), r(!0);
3049
+ T(this.wnd), r(!0);
3050
3050
  }), e.register("scroll_protection", D.moduleName, (n, r) => {
3051
3051
  this.enableScrollProtection(), r(!0);
3052
3052
  }), e.register([
@@ -3131,7 +3131,7 @@ const I = class I extends Et {
3131
3131
  return;
3132
3132
  }
3133
3133
  this.wnd.requestAnimationFrame(() => {
3134
- this.doc().scrollTop = this.doc().offsetHeight * r, this.reportProgress(), A(this.wnd), n(!0);
3134
+ this.doc().scrollTop = this.doc().offsetHeight * r, this.reportProgress(), T(this.wnd), n(!0);
3135
3135
  });
3136
3136
  }), e.register("go_id", I.moduleName, (i, n) => {
3137
3137
  const r = t.document.getElementById(i);
@@ -3140,7 +3140,7 @@ const I = class I extends Et {
3140
3140
  return;
3141
3141
  }
3142
3142
  this.wnd.requestAnimationFrame(() => {
3143
- this.doc().scrollTop = r.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), A(this.wnd), n(!0);
3143
+ this.doc().scrollTop = r.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), T(this.wnd), n(!0);
3144
3144
  });
3145
3145
  }), e.register("go_text", I.moduleName, (i, n) => {
3146
3146
  let r;
@@ -3149,7 +3149,7 @@ const I = class I extends Et {
3149
3149
  href: t.location.href,
3150
3150
  type: "text/html",
3151
3151
  text: o,
3152
- locations: r ? new k({
3152
+ locations: r ? new O({
3153
3153
  otherLocations: /* @__PURE__ */ new Map([
3154
3154
  ["cssSelector", r]
3155
3155
  ])
@@ -3160,7 +3160,7 @@ const I = class I extends Et {
3160
3160
  return;
3161
3161
  }
3162
3162
  this.wnd.requestAnimationFrame(() => {
3163
- this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), A(this.wnd), n(!0);
3163
+ this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), T(this.wnd), n(!0);
3164
3164
  });
3165
3165
  }), e.register("go_start", I.moduleName, (i, n) => {
3166
3166
  if (this.doc().scrollTop === 0) return n(!1);
@@ -3169,7 +3169,7 @@ const I = class I extends Et {
3169
3169
  if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return n(!1);
3170
3170
  this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), n(!0);
3171
3171
  }), e.register("unfocus", I.moduleName, (i, n) => {
3172
- A(this.wnd), n(!0);
3172
+ T(this.wnd), n(!0);
3173
3173
  }), e.register("scroll_protection", I.moduleName, (i, n) => {
3174
3174
  this.enableScrollProtection(), n(!0);
3175
3175
  }), e.register([
@@ -3188,7 +3188,7 @@ const I = class I extends Et {
3188
3188
  };
3189
3189
  I.moduleName = "webpub_snapper";
3190
3190
  let Se = I;
3191
- class Gn {
3191
+ class jn {
3192
3192
  constructor(t, e) {
3193
3193
  this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
3194
3194
  }
@@ -3270,7 +3270,7 @@ class $n {
3270
3270
  this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
3271
3271
  }
3272
3272
  }
3273
- class ji {
3273
+ class Gi {
3274
3274
  /**
3275
3275
  * Checks if the given keyboard event matches any of the provided key combinations
3276
3276
  */
@@ -3350,7 +3350,7 @@ class ji {
3350
3350
  }
3351
3351
  const ut = class ut extends ft {
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 ji(), 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 Gi(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
3354
3354
  if (!this.isBulkCopyProtectionEnabled || !this.bulkCopyProtector)
3355
3355
  return !0;
3356
3356
  if (!this.bulkCopyProtector.shouldAllowCopy(t)) {
@@ -3472,7 +3472,7 @@ const ut = class ut extends ft {
3472
3472
  addBulkCopyProtection(t = {}) {
3473
3473
  if (this.isBulkCopyProtectionEnabled || !this.wnd) return;
3474
3474
  const e = Vn, i = t ? { ...e, ...t } : e;
3475
- this.bulkCopyProtector = new Gn(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
3475
+ this.bulkCopyProtector = new jn(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);
@@ -3622,7 +3622,7 @@ const _t = class _t extends ft {
3622
3622
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
3623
3623
  value: {
3624
3624
  name: "readium-ts-toolkit",
3625
- version: "2.4.0-alpha.2",
3625
+ version: "2.4.0-alpha.5",
3626
3626
  hasFeature: (n, r = "") => {
3627
3627
  switch (n) {
3628
3628
  case "dom-manipulation":
@@ -3726,7 +3726,7 @@ const ui = "readium-fixed-style", $ = class $ extends Ht {
3726
3726
  }), e.register("remove_property", $.moduleName, (n, r) => {
3727
3727
  te(t, n), r(!0);
3728
3728
  }), e.register("first_visible_locator", $.moduleName, (n, r) => r(!1)), e.register("unfocus", $.moduleName, (n, r) => {
3729
- A(t), r(!0);
3729
+ T(t), r(!0);
3730
3730
  }), e.register([
3731
3731
  "focus",
3732
3732
  "go_next",
@@ -3979,7 +3979,7 @@ class er {
3979
3979
  return i;
3980
3980
  }
3981
3981
  }
3982
- class Gi extends er {
3982
+ class ji extends er {
3983
3983
  /**
3984
3984
  * Moves to the left content portion (eg. page) relative to the reading progression direction.
3985
3985
  */
@@ -4243,7 +4243,7 @@ class ar extends Yi {
4243
4243
  return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
4244
4244
  }
4245
4245
  }
4246
- const Y = new Yi(), O = new ar();
4246
+ const Y = new Yi(), L = new ar();
4247
4247
  class lr {
4248
4248
  constructor(t, e = {}, i = []) {
4249
4249
  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];
@@ -4371,22 +4371,22 @@ class hr {
4371
4371
  }), this.blobs.clear()), this.currentBaseURL = t.baseURL;
4372
4372
  const m = async (d) => {
4373
4373
  if (this.pendingUpdates.has(d) && this.pendingUpdates.get(d)?.inPool === !1) {
4374
- const w = this.blobs.get(d);
4375
- w && (this.injector?.releaseBlobUrl?.(w), URL.revokeObjectURL(w), this.blobs.delete(d), this.pendingUpdates.delete(d));
4374
+ const _ = this.blobs.get(d);
4375
+ _ && (this.injector?.releaseBlobUrl?.(_), URL.revokeObjectURL(_), this.blobs.delete(d), this.pendingUpdates.delete(d));
4376
4376
  }
4377
4377
  if (this.pool.has(d)) {
4378
- const w = this.pool.get(d);
4378
+ const _ = this.pool.get(d);
4379
4379
  if (!this.blobs.has(d))
4380
- await w.destroy(), this.pool.delete(d), this.pendingUpdates.delete(d);
4380
+ await _.destroy(), this.pool.delete(d), this.pendingUpdates.delete(d);
4381
4381
  else {
4382
- await w.load(i);
4382
+ await _.load(i);
4383
4383
  return;
4384
4384
  }
4385
4385
  }
4386
4386
  const p = t.readingOrder.findWithHref(d);
4387
4387
  if (!p) return;
4388
4388
  if (!this.blobs.has(d)) {
4389
- const L = await new ir(
4389
+ const z = await new ir(
4390
4390
  t,
4391
4391
  this.currentBaseURL || "",
4392
4392
  p,
@@ -4395,7 +4395,7 @@ class hr {
4395
4395
  injector: this.injector
4396
4396
  }
4397
4397
  ).build();
4398
- this.blobs.set(d, L);
4398
+ this.blobs.set(d, z);
4399
4399
  }
4400
4400
  const b = new lr(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
4401
4401
  d !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(d, b);
@@ -4536,15 +4536,15 @@ function cr() {
4536
4536
  } else c > y && (r.charCodeAt(a + p) === 47 ? d = p : p === 0 && (d = 0));
4537
4537
  break;
4538
4538
  }
4539
- var b = r.charCodeAt(a + p), w = o.charCodeAt(h + p);
4540
- if (b !== w)
4539
+ var b = r.charCodeAt(a + p), _ = o.charCodeAt(h + p);
4540
+ if (b !== _)
4541
4541
  break;
4542
4542
  b === 47 && (d = p);
4543
4543
  }
4544
- var L = "";
4544
+ var z = "";
4545
4545
  for (p = a + d + 1; p <= l; ++p)
4546
- (p === l || r.charCodeAt(p) === 47) && (L.length === 0 ? L += ".." : L += "/..");
4547
- return L.length > 0 ? L + o.slice(h + d) : (h += d, o.charCodeAt(h) === 47 && ++h, o.slice(h));
4546
+ (p === l || r.charCodeAt(p) === 47) && (z.length === 0 ? z += ".." : z += "/..");
4547
+ return z.length > 0 ? z + o.slice(h + d) : (h += d, o.charCodeAt(h) === 47 && ++h, o.slice(h));
4548
4548
  },
4549
4549
  _makeLong: function(r) {
4550
4550
  return r;
@@ -4648,13 +4648,13 @@ var J = /* @__PURE__ */ ((s) => (s.start = "start", s.left = "left", s.right = "
4648
4648
  const ot = {
4649
4649
  range: [0, 100],
4650
4650
  step: 1
4651
- }, jt = {
4651
+ }, Gt = {
4652
4652
  range: [0.7, 4],
4653
4653
  step: 0.05
4654
4654
  }, it = {
4655
4655
  range: [100, 1e3],
4656
4656
  step: 100
4657
- }, Gt = {
4657
+ }, jt = {
4658
4658
  range: [50, 250],
4659
4659
  step: 10
4660
4660
  }, $t = {
@@ -4771,7 +4771,7 @@ function ie(s, t) {
4771
4771
  function pt(s) {
4772
4772
  return typeof s == "boolean" || typeof s == "number" && s >= 0 ? s : s === null ? null : void 0;
4773
4773
  }
4774
- function _(s) {
4774
+ function v(s) {
4775
4775
  if (s !== void 0)
4776
4776
  return s === null ? null : s < 0 ? void 0 : s;
4777
4777
  }
@@ -4792,7 +4792,7 @@ function Ki(s) {
4792
4792
  }
4793
4793
  class xt {
4794
4794
  constructor(t = {}) {
4795
- this.fontFamily = N(t.fontFamily), this.fontWeight = q(t.fontWeight, it.range), this.hyphens = P(t.hyphens), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = _(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = _(t.lineHeight), this.noRuby = P(t.noRuby), this.paragraphIndent = _(t.paragraphIndent), this.paragraphSpacing = _(t.paragraphSpacing), this.textAlign = ie(t.textAlign, J), this.textNormalization = P(t.textNormalization), this.wordSpacing = _(t.wordSpacing), this.zoom = q(t.zoom, Zt.range);
4795
+ this.fontFamily = N(t.fontFamily), this.fontWeight = q(t.fontWeight, it.range), this.hyphens = P(t.hyphens), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = v(t.lineHeight), this.noRuby = P(t.noRuby), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.textAlign = ie(t.textAlign, J), this.textNormalization = P(t.textNormalization), this.wordSpacing = v(t.wordSpacing), this.zoom = q(t.zoom, Zt.range);
4796
4796
  }
4797
4797
  static serialize(t) {
4798
4798
  const { ...e } = t;
@@ -4815,15 +4815,15 @@ class xt {
4815
4815
  }
4816
4816
  class Sr {
4817
4817
  constructor(t) {
4818
- this.fontFamily = N(t.fontFamily) || null, this.fontWeight = q(t.fontWeight, it.range) || null, this.hyphens = P(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : O.OS.iPadOS && O.iOSRequest === "desktop", this.letterSpacing = _(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = _(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = _(t.paragraphIndent) ?? null, this.paragraphSpacing = _(t.paragraphSpacing) ?? null, this.textAlign = ie(t.textAlign, J) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = _(t.wordSpacing) || null, this.zoom = q(t.zoom, Zt.range) || 1, this.experiments = Ki(t.experiments) ?? null;
4818
+ this.fontFamily = N(t.fontFamily) || null, this.fontWeight = q(t.fontWeight, it.range) || null, this.hyphens = P(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (L.OS.iOS || L.OS.iPadOS) && L.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : L.OS.iPadOS && L.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = P(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = ie(t.textAlign, J) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = q(t.zoom, Zt.range) || 1, this.experiments = Ki(t.experiments) ?? null;
4819
4819
  }
4820
4820
  }
4821
4821
  class gi {
4822
4822
  constructor(t, e, i) {
4823
- this.fontFamily = null, this.fontWeight = null, this.hyphens = null, this.iOSPatch = null, this.iPadOSPatch = null, this.letterSpacing = null, this.ligatures = null, this.lineHeight = null, this.noRuby = null, this.paragraphIndent = null, this.paragraphSpacing = null, this.textAlign = null, this.textNormalization = null, this.wordSpacing = null, i && (this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? O.OS.iPadOS && O.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.textAlign = t.textAlign || e.textAlign || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null), this.zoom = t.zoom !== void 0 ? t.zoom : e.zoom !== void 0 ? e.zoom : null, this.experiments = e.experiments || null;
4823
+ this.fontFamily = null, this.fontWeight = null, this.hyphens = null, this.iOSPatch = null, this.iPadOSPatch = null, this.letterSpacing = null, this.ligatures = null, this.lineHeight = null, this.noRuby = null, this.paragraphIndent = null, this.paragraphSpacing = null, this.textAlign = null, this.textNormalization = null, this.wordSpacing = null, i && (this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (L.OS.iOS || L.OS.iPadOS) && L.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? L.OS.iPadOS && L.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.textAlign = t.textAlign || e.textAlign || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null), this.zoom = t.zoom !== void 0 ? t.zoom : e.zoom !== void 0 ? e.zoom : null, this.experiments = e.experiments || null;
4824
4824
  }
4825
4825
  }
4826
- class T {
4826
+ class k {
4827
4827
  constructor({
4828
4828
  initialValue: t = null,
4829
4829
  effectiveValue: e,
@@ -4848,7 +4848,7 @@ class T {
4848
4848
  this._value = null;
4849
4849
  }
4850
4850
  }
4851
- class z extends T {
4851
+ class A extends k {
4852
4852
  set value(t) {
4853
4853
  this._value = t, this._onChange(this._value);
4854
4854
  }
@@ -4868,7 +4868,7 @@ class z extends T {
4868
4868
  this._value = !this._value, this._onChange(this._value);
4869
4869
  }
4870
4870
  }
4871
- class Zi extends T {
4871
+ class Zi extends k {
4872
4872
  constructor({
4873
4873
  initialValue: t = null,
4874
4874
  effectiveValue: e,
@@ -4899,7 +4899,7 @@ class Zi extends T {
4899
4899
  this._value = null;
4900
4900
  }
4901
4901
  }
4902
- class R extends T {
4902
+ class R extends k {
4903
4903
  constructor({
4904
4904
  initialValue: t = null,
4905
4905
  effectiveValue: e,
@@ -4965,7 +4965,7 @@ class fi {
4965
4965
  ) ?? !1;
4966
4966
  }
4967
4967
  get fontFamily() {
4968
- return new T({
4968
+ return new k({
4969
4969
  initialValue: this.preferences.fontFamily,
4970
4970
  effectiveValue: this.settings.fontFamily || null,
4971
4971
  isEffective: this.isDisplayTransformable,
@@ -4987,7 +4987,7 @@ class fi {
4987
4987
  });
4988
4988
  }
4989
4989
  get hyphens() {
4990
- return new z({
4990
+ return new A({
4991
4991
  initialValue: this.preferences.hyphens,
4992
4992
  effectiveValue: this.settings.hyphens || !1,
4993
4993
  isEffective: this.isDisplayTransformable,
@@ -4997,7 +4997,7 @@ class fi {
4997
4997
  });
4998
4998
  }
4999
4999
  get iOSPatch() {
5000
- return new z({
5000
+ return new A({
5001
5001
  initialValue: this.preferences.iOSPatch,
5002
5002
  effectiveValue: this.settings.iOSPatch || !1,
5003
5003
  isEffective: !0,
@@ -5007,7 +5007,7 @@ class fi {
5007
5007
  });
5008
5008
  }
5009
5009
  get iPadOSPatch() {
5010
- return new z({
5010
+ return new A({
5011
5011
  initialValue: this.preferences.iPadOSPatch,
5012
5012
  effectiveValue: this.settings.iPadOSPatch || !1,
5013
5013
  isEffective: !0,
@@ -5029,7 +5029,7 @@ class fi {
5029
5029
  });
5030
5030
  }
5031
5031
  get ligatures() {
5032
- return new z({
5032
+ return new A({
5033
5033
  initialValue: this.preferences.ligatures,
5034
5034
  effectiveValue: this.settings.ligatures || !0,
5035
5035
  isEffective: this.isDisplayTransformable,
@@ -5051,7 +5051,7 @@ class fi {
5051
5051
  });
5052
5052
  }
5053
5053
  get noRuby() {
5054
- return new z({
5054
+ return new A({
5055
5055
  initialValue: this.preferences.noRuby,
5056
5056
  effectiveValue: this.settings.noRuby || !1,
5057
5057
  isEffective: this.isDisplayTransformable,
@@ -5096,7 +5096,7 @@ class fi {
5096
5096
  });
5097
5097
  }
5098
5098
  get textNormalization() {
5099
- return new z({
5099
+ return new A({
5100
5100
  initialValue: this.preferences.textNormalization,
5101
5101
  effectiveValue: this.settings.textNormalization || !1,
5102
5102
  isEffective: this.isDisplayTransformable,
@@ -6007,7 +6007,7 @@ class rn {
6007
6007
  const Lt = "readium:navigator:keyboardPeripheral";
6008
6008
  class sn {
6009
6009
  constructor(t = {}) {
6010
- this.keyManager = new ji(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
6010
+ this.keyManager = new Gi(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
6011
6011
  }
6012
6012
  setupKeyboardPeripherals(t) {
6013
6013
  if (t.length > 0) {
@@ -6053,7 +6053,7 @@ const Mr = (s) => ({
6053
6053
  peripheral: s.peripheral || (() => {
6054
6054
  })
6055
6055
  });
6056
- class Ur extends Gi {
6056
+ class Ur extends ji {
6057
6057
  constructor(t, e, i, n = void 0, r = { preferences: {}, defaults: {} }) {
6058
6058
  super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
6059
6059
  readingOrder: [],
@@ -6355,7 +6355,7 @@ class Ur extends Gi {
6355
6355
  return this.pub.manifest.locatorFromLink(e) || new H({
6356
6356
  href: e.href,
6357
6357
  type: e.type || "text/html",
6358
- locations: new k({
6358
+ locations: new O({
6359
6359
  fragments: [],
6360
6360
  progression: n,
6361
6361
  position: this.currentIndex + 1
@@ -6392,29 +6392,41 @@ class on {
6392
6392
  constructor(t, e, i, n) {
6393
6393
  this.pub = t, this.baseURL = e, this.item = i, this.injector = null, this.item = i, this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
6394
6394
  }
6395
+ reset() {
6396
+ this.currentUrl && URL.revokeObjectURL(this.currentUrl), this.currentUrl = void 0, this.currentResource?.close(), this.currentResource = void 0;
6397
+ }
6395
6398
  async build(t = !1) {
6396
- const e = await this.pub.get(this.item).link();
6397
- if (e.mediaType.isHTML)
6398
- return await this.buildHtmlFrame(t);
6399
- if (e.mediaType.isBitmap || e.mediaType.equals(g.SVG))
6400
- return await this.buildImageFrame();
6401
- throw Error("Unsupported frame mediatype " + e.mediaType.string);
6399
+ if (this.currentUrl) return this.currentUrl;
6400
+ this.currentResource = this.pub.get(this.item);
6401
+ const e = await this.currentResource.link();
6402
+ if (!this.currentResource)
6403
+ return "about:blank";
6404
+ if (e.mediaType.isHTML) {
6405
+ const i = await this.buildHtmlFrame(t);
6406
+ return this.currentUrl = i, i;
6407
+ } else if (e.mediaType.isBitmap || e.mediaType.equals(g.SVG)) {
6408
+ const i = await this.buildImageFrame();
6409
+ return this.currentUrl = i, i;
6410
+ } else
6411
+ throw Error("Unsupported frame mediatype " + e.mediaType.string);
6402
6412
  }
6403
6413
  async buildHtmlFrame(t = !1) {
6404
- const e = this.pub.get(this.item), i = await e.link(), n = await e.readAsString();
6405
- if (!n) throw new Error(`Failed reading item ${i.href}`);
6406
- const r = new DOMParser().parseFromString(
6407
- n,
6408
- i.mediaType.string
6409
- ), o = r.querySelector("parsererror");
6410
- if (o) {
6411
- const a = o.querySelector("div");
6412
- throw new Error(`Failed parsing item ${i.href}: ${a?.textContent || o.textContent}`);
6414
+ if (!this.currentResource) throw new Error("No resource loaded");
6415
+ const e = await this.currentResource.link(), i = await this.currentResource.readAsString();
6416
+ if (!i) throw new Error(`Failed reading item ${e.href}`);
6417
+ const n = new DOMParser().parseFromString(
6418
+ i,
6419
+ e.mediaType.string
6420
+ ), r = n.querySelector("parsererror");
6421
+ if (r) {
6422
+ const o = r.querySelector("div");
6423
+ throw new Error(`Failed parsing item ${e.href}: ${o?.textContent || r.textContent}`);
6413
6424
  }
6414
- return this.injector && await this.injector.injectForDocument(r, i), this.finalizeDOM(r, this.pub.baseURL, i.toURL(this.baseURL) || "", i.mediaType, t, this.cssProperties);
6425
+ return this.injector && await this.injector.injectForDocument(n, e), this.finalizeDOM(n, this.pub.baseURL, e.toURL(this.baseURL) || "", e.mediaType, t, this.cssProperties);
6415
6426
  }
6416
6427
  async buildImageFrame() {
6417
- const t = await this.pub.get(this.item).link(), e = t.toURL(this.baseURL) || "", i = document.implementation.createHTMLDocument(t.title || t.href);
6428
+ if (!this.currentResource) throw new Error("No resource loaded");
6429
+ const t = await this.currentResource.link(), e = t.toURL(this.baseURL) || "", i = document.implementation.createHTMLDocument(t.title || t.href);
6418
6430
  if ((t?.height || 0) > 0 && (t?.width || 0) > 0) {
6419
6431
  const o = i.createElement("meta");
6420
6432
  o.name = "viewport", o.content = `width=${t.width}, height=${t.height}`, o.dataset.readium = "true", i.head.appendChild(o);
@@ -6578,9 +6590,7 @@ class Dr {
6578
6590
  let n = this.pool.values(), r = n.next();
6579
6591
  for (; r.value; )
6580
6592
  await r.value.destroy(), r = n.next();
6581
- this.pool.clear(), this.blobs.forEach((o) => {
6582
- this.injector?.releaseBlobUrl?.(o), URL.revokeObjectURL(o);
6583
- }), this.injector?.dispose(), this.container.childNodes.forEach((o) => {
6593
+ this.pool.clear(), this.blobs.forEach((o) => o.reset()), this.blobs.clear(), this.injector?.dispose(), this.container.childNodes.forEach((o) => {
6584
6594
  (o.nodeType === Node.ELEMENT_NODE || o.nodeType === Node.TEXT_NODE) && o.remove();
6585
6595
  });
6586
6596
  }
@@ -6595,40 +6605,33 @@ class Dr {
6595
6605
  (p > r + wi || p < r - wi) && (h.includes(d.href) || h.push(d.href)), p < r + vi && p > r - vi && (u.includes(d.href) || u.push(d.href));
6596
6606
  }), h.forEach(async (d) => {
6597
6607
  u.includes(d) || this.pool.has(d) && (await this.pool.get(d)?.destroy(), this.pool.delete(d), this.pendingUpdates.has(d) && this.pendingUpdates.set(d, { inPool: !1 }));
6598
- }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => {
6599
- this.injector?.releaseBlobUrl?.(d), URL.revokeObjectURL(d);
6600
- }), this.blobs.clear()), this.currentBaseURL = t.baseURL;
6608
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => d.reset()), this.blobs.clear()), this.currentBaseURL = t.baseURL;
6601
6609
  const m = async (d) => {
6602
- if (n && (this.blobs.forEach((w) => {
6603
- this.injector?.releaseBlobUrl?.(w), URL.revokeObjectURL(w);
6604
- }), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(d) && this.pendingUpdates.get(d)?.inPool === !1) {
6605
- const w = this.blobs.get(d);
6606
- w && (this.injector?.releaseBlobUrl?.(w), URL.revokeObjectURL(w), this.blobs.delete(d), this.pendingUpdates.delete(d));
6610
+ if (n && (this.blobs.forEach((_) => _.reset()), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(d) && this.pendingUpdates.get(d)?.inPool === !1) {
6611
+ const _ = this.blobs.get(d);
6612
+ _ && (_.reset(), this.blobs.delete(d), this.pendingUpdates.delete(d));
6607
6613
  }
6608
6614
  if (this.pool.has(d)) {
6609
- const w = this.pool.get(d);
6615
+ const _ = this.pool.get(d);
6610
6616
  if (!this.blobs.has(d))
6611
- await w.destroy(), this.pool.delete(d), this.pendingUpdates.delete(d);
6617
+ await _.destroy(), this.pool.delete(d), this.pendingUpdates.delete(d);
6612
6618
  else {
6613
- await w.load(i);
6619
+ await _.load(i);
6614
6620
  return;
6615
6621
  }
6616
6622
  }
6617
6623
  const p = t.readingOrder.findWithHref(d);
6618
6624
  if (!p) return;
6619
- if (!this.blobs.has(d)) {
6620
- const L = await new on(
6621
- t,
6622
- this.currentBaseURL || "",
6623
- p,
6624
- {
6625
- cssProperties: this.currentCssProperties,
6626
- injector: this.injector
6627
- }
6628
- ).build();
6629
- this.blobs.set(d, L);
6630
- }
6631
- const b = new Fr(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6625
+ this.blobs.has(d) || this.blobs.set(d, new on(
6626
+ t,
6627
+ this.currentBaseURL || "",
6628
+ p,
6629
+ {
6630
+ cssProperties: this.currentCssProperties,
6631
+ injector: this.injector
6632
+ }
6633
+ ));
6634
+ const b = new Fr(await this.blobs.get(d).build(), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6632
6635
  d !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(d, b);
6633
6636
  };
6634
6637
  try {
@@ -6684,10 +6687,10 @@ class Dr {
6684
6687
  }
6685
6688
  class Ir {
6686
6689
  constructor(t, e, i, n = {}, r = []) {
6687
- 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 === F.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
6690
+ this.frameIsAppended = !1, 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 === F.rtl ? "right" : "left";
6688
6691
  }
6689
6692
  async load(t, e) {
6690
- return this.source === e && this.loadPromise && [...this.currModules].sort().join("|") === [...t].sort().join("|") ? this.loadPromise : (this.loaded && this.source !== e && this.window.stop(), this.source = e, this.loadPromise = new Promise((i, n) => {
6693
+ return this.frameIsAppended || (this.wrapper.appendChild(this.frame), this.frameIsAppended = !0), this.source === e && this.loadPromise && [...this.currModules].sort().join("|") === [...t].sort().join("|") ? this.loadPromise : (this.loaded && this.source !== e && this.window.stop(), this.source = e, this.loadPromise = new Promise((i, n) => {
6691
6694
  if (this.loader && this.loaded) {
6692
6695
  const r = this.frame.contentWindow;
6693
6696
  if ([...this.currModules].sort().join("|") === [...t].sort().join("|")) {
@@ -6744,10 +6747,10 @@ class Ir {
6744
6747
  const i = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
6745
6748
  this.frame.style.transform = `scale(${i})`;
6746
6749
  const n = this.frame.getBoundingClientRect(), r = this.wrapper.clientHeight - n.height;
6747
- if (this.frame.style.top = `${r / 2}px`, t === j.left) {
6750
+ if (this.frame.style.top = `${r / 2}px`, t === G.left) {
6748
6751
  const o = this.wrapper.clientWidth - n.width;
6749
6752
  this.frame.style.left = `${o}px`;
6750
- } else if (t === j.center) {
6753
+ } else if (t === G.center) {
6751
6754
  const o = this.wrapper.clientWidth - n.width;
6752
6755
  this.frame.style.left = `${o / 2}px`;
6753
6756
  } else
@@ -6916,7 +6919,7 @@ class Vr {
6916
6919
  }
6917
6920
  }
6918
6921
  const _i = 6, he = 1.02, Pi = 50;
6919
- class jr {
6922
+ class Gr {
6920
6923
  constructor(t, e = !1) {
6921
6924
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
6922
6925
  startX: 0,
@@ -7137,7 +7140,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
7137
7140
  }
7138
7141
  }
7139
7142
  var Pe = /* @__PURE__ */ ((s) => (s.auto = "auto", s.landscape = "landscape", s.portrait = "portrait", s))(Pe || {}), Ee = /* @__PURE__ */ ((s) => (s.auto = "auto", s.both = "both", s.none = "none", s.landscape = "landscape", s))(Ee || {});
7140
- class Gr {
7143
+ class jr {
7141
7144
  // TODO getter
7142
7145
  constructor(t) {
7143
7146
  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`);
@@ -7166,13 +7169,13 @@ class Gr {
7166
7169
  if (i.length > 1)
7167
7170
  return;
7168
7171
  const r = i[0], o = r.properties?.otherProperties.orientation;
7169
- n === 0 && (o === "landscape" || o !== "portrait" && ((r.width || 0) > (r.height || 0) || r.properties?.otherProperties.spread === "both")) && (this.shift = !1), e && r.properties?.page === j.center && this.spreads[n - 1][0].addProperties({ addBlank: !0 }), o === "portrait" && r.properties?.page !== "center" && r.properties?.otherProperties.number > 1 ? e = !0 : e = !1;
7172
+ n === 0 && (o === "landscape" || o !== "portrait" && ((r.width || 0) > (r.height || 0) || r.properties?.otherProperties.spread === "both")) && (this.shift = !1), e && r.properties?.page === G.center && this.spreads[n - 1][0].addProperties({ addBlank: !0 }), o === "portrait" && r.properties?.page !== "center" && r.properties?.otherProperties.number > 1 ? e = !0 : e = !1;
7170
7173
  }), this.shift || this.index(t, !0);
7171
7174
  }
7172
7175
  buildSpreads(t) {
7173
7176
  let e = [];
7174
7177
  t.items.forEach((i, n) => {
7175
- !n && this.shift ? this.spreads.push([i]) : i.properties?.page === j.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([i]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [i]) : e.push(i);
7178
+ !n && this.shift ? this.spreads.push([i]) : i.properties?.page === G.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([i]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [i]) : e.push(i);
7176
7179
  }), e.length > 0 && this.spreads.push(e);
7177
7180
  }
7178
7181
  currentSpread(t, e) {
@@ -7187,7 +7190,7 @@ class Zr {
7187
7190
  constructor(t, e, i, n, r, o) {
7188
7191
  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 || Ee.auto, this.pub.metadata.effectiveReadingProgression !== F.rtl && this.pub.metadata.effectiveReadingProgression !== F.ltr)
7189
7192
  throw Error("Unsupported reading progression for EPUB");
7190
- this.spreader = new Gr(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) => {
7193
+ this.spreader = new jr(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 Gr(this), this.pub.readingOrder.items.forEach((a) => {
7191
7194
  const l = new Ir(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7192
7195
  this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === Pe.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
7193
7196
  });
@@ -7364,7 +7367,7 @@ class Zr {
7364
7367
  let n = this.pool.values(), r = n.next();
7365
7368
  for (; r.value; )
7366
7369
  await r.value.destroy(), r = n.next();
7367
- this.pool.clear(), this.blobs.forEach((o) => URL.revokeObjectURL(o)), this.injector?.dispose(), this.container.childNodes.forEach((o) => {
7370
+ this.pool.clear(), this.blobs.forEach((o) => o.reset()), this.blobs.clear(), this.injector?.dispose(), this.container.childNodes.forEach((o) => {
7368
7371
  (o.nodeType === Node.ELEMENT_NODE || o.nodeType === Node.TEXT_NODE) && o.remove();
7369
7372
  });
7370
7373
  }
@@ -7375,7 +7378,7 @@ class Zr {
7375
7378
  return t % 2 && !this.single && t++, t;
7376
7379
  }
7377
7380
  spreadPosition(t, e) {
7378
- return this.perPage < 2 || t.length < 2 ? j.center : e.href === t[0].href ? this.rtl ? j.right : j.left : this.rtl ? j.left : j.right;
7381
+ return this.perPage < 2 || t.length < 2 ? G.center : e.href === t[0].href ? this.rtl ? G.right : G.left : this.rtl ? G.left : G.right;
7379
7382
  }
7380
7383
  async waitForItem(t) {
7381
7384
  if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
@@ -7402,34 +7405,28 @@ class Zr {
7402
7405
  this.positions.forEach((d, p) => {
7403
7406
  (p > r + Ei || p < r - Ei) && (h.includes(d.href) || h.push(d.href)), p < r + Ci && p > r - Ci && (u.includes(d.href) || u.push(d.href));
7404
7407
  }), h.forEach(async (d) => {
7405
- u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload());
7406
- }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => URL.revokeObjectURL(d)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
7408
+ u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload(), this.blobs.get(d)?.reset());
7409
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => d.reset()), this.blobs.clear()), this.currentBaseURL = t.baseURL;
7407
7410
  const m = async (d) => {
7408
7411
  const p = t.readingOrder.findIndexWithHref(d), b = t.readingOrder.items[p];
7409
- if (b) {
7410
- if (!this.blobs.has(d)) {
7411
- const L = await new on(
7412
- t,
7413
- this.currentBaseURL || "",
7414
- b,
7415
- {
7416
- injector: this.injector
7417
- }
7418
- ).build(!0);
7419
- this.blobs.set(d, L);
7412
+ b && (this.blobs.has(d) || this.blobs.set(d, new on(
7413
+ t,
7414
+ this.currentBaseURL || "",
7415
+ b,
7416
+ {
7417
+ injector: this.injector
7420
7418
  }
7421
- this.delayedShow.has(d) || this.delayedShow.set(d, new Promise((w, L) => {
7422
- let Q = !1;
7423
- const hn = window.setTimeout(async () => {
7424
- this.delayedTimeout.set(d, 0);
7425
- const cn = this.makeSpread(this.reAlign(p)), dn = this.spreadPosition(cn, b), Fe = this.pool.get(d);
7426
- await Fe.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Fe.show(dn), this.delayedShow.delete(d), Q = !0, w();
7427
- }, $r);
7428
- setTimeout(() => {
7429
- !Q && this.delayedShow.has(d) && L(`Offscreen load timeout: ${d}`);
7430
- }, Xr), this.delayedTimeout.set(d, hn);
7431
- }));
7432
- }
7419
+ )), this.delayedShow.has(d) || this.delayedShow.set(d, new Promise((_, z) => {
7420
+ let Q = !1;
7421
+ const hn = window.setTimeout(async () => {
7422
+ this.delayedTimeout.set(d, 0);
7423
+ const cn = this.makeSpread(this.reAlign(p)), dn = this.spreadPosition(cn, b), Fe = this.pool.get(d);
7424
+ await Fe.load(i, await this.blobs.get(d).build(!0)), this.peripherals.isScaled || await Fe.show(dn), this.delayedShow.delete(d), Q = !0, _();
7425
+ }, $r);
7426
+ setTimeout(() => {
7427
+ !Q && this.delayedShow.has(d) && z(`Offscreen load timeout: ${d}`);
7428
+ }, Xr), this.delayedTimeout.set(d, hn);
7429
+ })));
7433
7430
  };
7434
7431
  try {
7435
7432
  await Promise.all(u.map((d) => m(d)));
@@ -7439,7 +7436,7 @@ class Zr {
7439
7436
  const y = [];
7440
7437
  for (const d of o) {
7441
7438
  const p = this.pool.get(d.href), b = this.blobs.get(d.href);
7442
- b && (this.cancelShowing(d.href), await p.load(i, b), await p.show(this.spreadPosition(o, d)), this.previousFrames.push(p), await p.activate(), y.push(p));
7439
+ b && (this.cancelShowing(d.href), await p.load(i, await b.build(!0)), await p.show(this.spreadPosition(o, d)), this.previousFrames.push(p), await p.activate(), y.push(p));
7443
7440
  }
7444
7441
  for (; this.previousFrames.length > 0; ) {
7445
7442
  const d = this.previousFrames.shift();
@@ -7505,7 +7502,7 @@ class Zr {
7505
7502
  }
7506
7503
  class Ot {
7507
7504
  constructor(t = {}) {
7508
- this.backgroundColor = N(t.backgroundColor), this.blendFilter = P(t.blendFilter), this.constraint = _(t.constraint), this.columnCount = _(t.columnCount), this.darkenFilter = pt(t.darkenFilter), this.deprecatedFontSize = P(t.deprecatedFontSize), this.fontFamily = N(t.fontFamily), this.fontSize = q(t.fontSize, jt.range), this.fontSizeNormalize = P(t.fontSizeNormalize), this.fontOpticalSizing = P(t.fontOpticalSizing), this.fontWeight = q(t.fontWeight, it.range), this.fontWidth = q(t.fontWidth, Gt.range), this.hyphens = P(t.hyphens), this.invertFilter = pt(t.invertFilter), this.invertGaijiFilter = pt(t.invertGaijiFilter), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = _(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = _(t.lineHeight), this.linkColor = N(t.linkColor), this.noRuby = P(t.noRuby), this.pageGutter = _(t.pageGutter), this.paragraphIndent = _(t.paragraphIndent), this.paragraphSpacing = _(t.paragraphSpacing), this.scroll = P(t.scroll), this.scrollPaddingTop = _(t.scrollPaddingTop), this.scrollPaddingBottom = _(t.scrollPaddingBottom), this.scrollPaddingLeft = _(t.scrollPaddingLeft), this.scrollPaddingRight = _(t.scrollPaddingRight), this.selectionBackgroundColor = N(t.selectionBackgroundColor), this.selectionTextColor = N(t.selectionTextColor), this.textAlign = ie(t.textAlign, J), this.textColor = N(t.textColor), this.textNormalization = P(t.textNormalization), this.visitedColor = N(t.visitedColor), this.wordSpacing = _(t.wordSpacing), this.optimalLineLength = _(t.optimalLineLength), this.maximalLineLength = _(t.maximalLineLength), this.minimalLineLength = _(t.minimalLineLength);
7505
+ this.backgroundColor = N(t.backgroundColor), this.blendFilter = P(t.blendFilter), this.constraint = v(t.constraint), this.columnCount = v(t.columnCount), this.darkenFilter = pt(t.darkenFilter), this.deprecatedFontSize = P(t.deprecatedFontSize), this.fontFamily = N(t.fontFamily), this.fontSize = q(t.fontSize, Gt.range), this.fontSizeNormalize = P(t.fontSizeNormalize), this.fontOpticalSizing = P(t.fontOpticalSizing), this.fontWeight = q(t.fontWeight, it.range), this.fontWidth = q(t.fontWidth, jt.range), this.hyphens = P(t.hyphens), this.invertFilter = pt(t.invertFilter), this.invertGaijiFilter = pt(t.invertGaijiFilter), this.iOSPatch = P(t.iOSPatch), this.iPadOSPatch = P(t.iPadOSPatch), this.letterSpacing = v(t.letterSpacing), this.ligatures = P(t.ligatures), this.lineHeight = v(t.lineHeight), this.linkColor = N(t.linkColor), this.noRuby = P(t.noRuby), this.pageGutter = v(t.pageGutter), this.paragraphIndent = v(t.paragraphIndent), this.paragraphSpacing = v(t.paragraphSpacing), this.scroll = P(t.scroll), this.scrollPaddingTop = v(t.scrollPaddingTop), this.scrollPaddingBottom = v(t.scrollPaddingBottom), this.scrollPaddingLeft = v(t.scrollPaddingLeft), this.scrollPaddingRight = v(t.scrollPaddingRight), this.selectionBackgroundColor = N(t.selectionBackgroundColor), this.selectionTextColor = N(t.selectionTextColor), this.textAlign = ie(t.textAlign, J), this.textColor = N(t.textColor), this.textNormalization = P(t.textNormalization), this.visitedColor = N(t.visitedColor), this.wordSpacing = v(t.wordSpacing), this.optimalLineLength = v(t.optimalLineLength), this.maximalLineLength = v(t.maximalLineLength), this.minimalLineLength = v(t.minimalLineLength);
7509
7506
  }
7510
7507
  static serialize(t) {
7511
7508
  const { ...e } = t;
@@ -7528,7 +7525,7 @@ class Ot {
7528
7525
  }
7529
7526
  class Jr {
7530
7527
  constructor(t) {
7531
- this.backgroundColor = N(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = _(t.constraint) || 0, this.columnCount = _(t.columnCount) || null, this.darkenFilter = pt(t.darkenFilter) ?? !1, this.deprecatedFontSize = P(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = N(t.fontFamily) || null, this.fontSize = q(t.fontSize, jt.range) || 1, this.fontSizeNormalize = P(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = P(t.fontOpticalSizing) ?? null, this.fontWeight = q(t.fontWeight, it.range) || null, this.fontWidth = q(t.fontWidth, Gt.range) || null, this.hyphens = P(t.hyphens) ?? null, this.invertFilter = pt(t.invertFilter) ?? !1, this.invertGaijiFilter = pt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : O.OS.iPadOS && O.iOSRequest === "desktop", this.letterSpacing = _(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = _(t.lineHeight) || null, this.linkColor = N(t.linkColor) || null, this.noRuby = P(t.noRuby) ?? !1, this.pageGutter = le(_(t.pageGutter), 20), this.paragraphIndent = _(t.paragraphIndent) ?? null, this.paragraphSpacing = _(t.paragraphSpacing) ?? null, this.scroll = P(t.scroll) ?? !1, this.scrollPaddingTop = _(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = _(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = _(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = _(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = N(t.selectionBackgroundColor) || null, this.selectionTextColor = N(t.selectionTextColor) || null, this.textAlign = ie(t.textAlign, J) || null, this.textColor = N(t.textColor) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.visitedColor = N(t.visitedColor) || null, this.wordSpacing = _(t.wordSpacing) || null, this.optimalLineLength = _(t.optimalLineLength) || 65, this.maximalLineLength = le(yr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = le(fr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = Ki(t.experiments) || null;
7528
+ this.backgroundColor = N(t.backgroundColor) || null, this.blendFilter = P(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = pt(t.darkenFilter) ?? !1, this.deprecatedFontSize = P(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = N(t.fontFamily) || null, this.fontSize = q(t.fontSize, Gt.range) || 1, this.fontSizeNormalize = P(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = P(t.fontOpticalSizing) ?? null, this.fontWeight = q(t.fontWeight, it.range) || null, this.fontWidth = q(t.fontWidth, jt.range) || null, this.hyphens = P(t.hyphens) ?? null, this.invertFilter = pt(t.invertFilter) ?? !1, this.invertGaijiFilter = pt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (L.OS.iOS || L.OS.iPadOS) && L.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : L.OS.iPadOS && L.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = P(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = N(t.linkColor) || null, this.noRuby = P(t.noRuby) ?? !1, this.pageGutter = le(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = P(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = N(t.selectionBackgroundColor) || null, this.selectionTextColor = N(t.selectionTextColor) || null, this.textAlign = ie(t.textAlign, J) || null, this.textColor = N(t.textColor) || null, this.textNormalization = P(t.textNormalization) ?? !1, this.visitedColor = N(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = le(yr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = le(fr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = Ki(t.experiments) || null;
7532
7529
  }
7533
7530
  }
7534
7531
  const Qr = "#FFFFFF", ts = "#121212", es = "#0000EE", is = "#551A8B", ns = "#b4d8fe", rs = "inherit", lt = {
@@ -7550,7 +7547,7 @@ class xi {
7550
7547
  this.preferences[t] = e;
7551
7548
  }
7552
7549
  get backgroundColor() {
7553
- return new T({
7550
+ return new k({
7554
7551
  initialValue: this.preferences.backgroundColor,
7555
7552
  effectiveValue: this.settings.backgroundColor || lt.RS__backgroundColor,
7556
7553
  isEffective: this.preferences.backgroundColor !== null,
@@ -7560,7 +7557,7 @@ class xi {
7560
7557
  });
7561
7558
  }
7562
7559
  get blendFilter() {
7563
- return new z({
7560
+ return new A({
7564
7561
  initialValue: this.preferences.blendFilter,
7565
7562
  effectiveValue: this.settings.blendFilter || !1,
7566
7563
  isEffective: this.preferences.blendFilter !== null,
@@ -7570,7 +7567,7 @@ class xi {
7570
7567
  });
7571
7568
  }
7572
7569
  get columnCount() {
7573
- return new T({
7570
+ return new k({
7574
7571
  initialValue: this.preferences.columnCount,
7575
7572
  effectiveValue: this.settings.columnCount || null,
7576
7573
  isEffective: this.layout !== S.fixed && !this.settings.scroll,
@@ -7580,7 +7577,7 @@ class xi {
7580
7577
  });
7581
7578
  }
7582
7579
  get constraint() {
7583
- return new T({
7580
+ return new k({
7584
7581
  initialValue: this.preferences.constraint,
7585
7582
  effectiveValue: this.preferences.constraint || 0,
7586
7583
  isEffective: !0,
@@ -7602,7 +7599,7 @@ class xi {
7602
7599
  });
7603
7600
  }
7604
7601
  get deprecatedFontSize() {
7605
- return new z({
7602
+ return new A({
7606
7603
  initialValue: this.preferences.deprecatedFontSize,
7607
7604
  effectiveValue: CSS.supports("zoom", "1") ? this.settings.deprecatedFontSize || !1 : !0,
7608
7605
  isEffective: this.layout !== S.fixed,
@@ -7612,7 +7609,7 @@ class xi {
7612
7609
  });
7613
7610
  }
7614
7611
  get fontFamily() {
7615
- return new T({
7612
+ return new k({
7616
7613
  initialValue: this.preferences.fontFamily,
7617
7614
  effectiveValue: this.settings.fontFamily || null,
7618
7615
  isEffective: this.layout !== S.fixed,
@@ -7629,12 +7626,12 @@ class xi {
7629
7626
  onChange: (t) => {
7630
7627
  this.updatePreference("fontSize", t || null);
7631
7628
  },
7632
- supportedRange: jt.range,
7633
- step: jt.step
7629
+ supportedRange: Gt.range,
7630
+ step: Gt.step
7634
7631
  });
7635
7632
  }
7636
7633
  get fontSizeNormalize() {
7637
- return new z({
7634
+ return new A({
7638
7635
  initialValue: this.preferences.fontSizeNormalize,
7639
7636
  effectiveValue: this.settings.fontSizeNormalize || !1,
7640
7637
  isEffective: this.layout !== S.fixed && this.preferences.fontSizeNormalize !== null,
@@ -7644,7 +7641,7 @@ class xi {
7644
7641
  });
7645
7642
  }
7646
7643
  get fontOpticalSizing() {
7647
- return new z({
7644
+ return new A({
7648
7645
  initialValue: this.preferences.fontOpticalSizing,
7649
7646
  effectiveValue: this.settings.fontOpticalSizing || !0,
7650
7647
  isEffective: this.layout !== S.fixed && this.preferences.fontOpticalSizing !== null,
@@ -7673,12 +7670,12 @@ class xi {
7673
7670
  onChange: (t) => {
7674
7671
  this.updatePreference("fontWidth", t || null);
7675
7672
  },
7676
- supportedRange: Gt.range,
7677
- step: Gt.step
7673
+ supportedRange: jt.range,
7674
+ step: jt.step
7678
7675
  });
7679
7676
  }
7680
7677
  get hyphens() {
7681
- return new z({
7678
+ return new A({
7682
7679
  initialValue: this.preferences.hyphens,
7683
7680
  effectiveValue: this.settings.hyphens || !1,
7684
7681
  isEffective: this.layout !== S.fixed && this.metadata?.effectiveReadingProgression === F.ltr && this.preferences.hyphens !== null,
@@ -7712,7 +7709,7 @@ class xi {
7712
7709
  });
7713
7710
  }
7714
7711
  get iOSPatch() {
7715
- return new z({
7712
+ return new A({
7716
7713
  initialValue: this.preferences.iOSPatch,
7717
7714
  effectiveValue: this.settings.iOSPatch || !1,
7718
7715
  isEffective: this.layout !== S.fixed,
@@ -7722,7 +7719,7 @@ class xi {
7722
7719
  });
7723
7720
  }
7724
7721
  get iPadOSPatch() {
7725
- return new z({
7722
+ return new A({
7726
7723
  initialValue: this.preferences.iPadOSPatch,
7727
7724
  effectiveValue: this.settings.iPadOSPatch || !1,
7728
7725
  isEffective: this.layout !== S.fixed,
@@ -7744,7 +7741,7 @@ class xi {
7744
7741
  });
7745
7742
  }
7746
7743
  get ligatures() {
7747
- return new z({
7744
+ return new A({
7748
7745
  initialValue: this.preferences.ligatures,
7749
7746
  effectiveValue: this.settings.ligatures || !0,
7750
7747
  isEffective: (() => {
@@ -7771,7 +7768,7 @@ class xi {
7771
7768
  });
7772
7769
  }
7773
7770
  get linkColor() {
7774
- return new T({
7771
+ return new k({
7775
7772
  initialValue: this.preferences.linkColor,
7776
7773
  effectiveValue: this.settings.linkColor || lt.RS__linkColor,
7777
7774
  isEffective: this.layout !== S.fixed && this.preferences.linkColor !== null,
@@ -7805,7 +7802,7 @@ class xi {
7805
7802
  });
7806
7803
  }
7807
7804
  get noRuby() {
7808
- return new z({
7805
+ return new A({
7809
7806
  initialValue: this.preferences.noRuby,
7810
7807
  effectiveValue: this.settings.noRuby || !1,
7811
7808
  isEffective: this.layout !== S.fixed && this.metadata?.languages?.includes("ja") || !1,
@@ -7827,7 +7824,7 @@ class xi {
7827
7824
  });
7828
7825
  }
7829
7826
  get pageGutter() {
7830
- return new T({
7827
+ return new k({
7831
7828
  initialValue: this.preferences.pageGutter,
7832
7829
  effectiveValue: this.settings.pageGutter,
7833
7830
  isEffective: this.layout !== S.fixed && !this.settings.scroll,
@@ -7861,7 +7858,7 @@ class xi {
7861
7858
  });
7862
7859
  }
7863
7860
  get scroll() {
7864
- return new z({
7861
+ return new A({
7865
7862
  initialValue: this.preferences.scroll,
7866
7863
  effectiveValue: this.settings.scroll || !1,
7867
7864
  isEffective: this.layout !== S.fixed,
@@ -7871,7 +7868,7 @@ class xi {
7871
7868
  });
7872
7869
  }
7873
7870
  get scrollPaddingTop() {
7874
- return new T({
7871
+ return new k({
7875
7872
  initialValue: this.preferences.scrollPaddingTop,
7876
7873
  effectiveValue: this.settings.scrollPaddingTop || 0,
7877
7874
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
@@ -7881,7 +7878,7 @@ class xi {
7881
7878
  });
7882
7879
  }
7883
7880
  get scrollPaddingBottom() {
7884
- return new T({
7881
+ return new k({
7885
7882
  initialValue: this.preferences.scrollPaddingBottom,
7886
7883
  effectiveValue: this.settings.scrollPaddingBottom || 0,
7887
7884
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
@@ -7891,7 +7888,7 @@ class xi {
7891
7888
  });
7892
7889
  }
7893
7890
  get scrollPaddingLeft() {
7894
- return new T({
7891
+ return new k({
7895
7892
  initialValue: this.preferences.scrollPaddingLeft,
7896
7893
  effectiveValue: this.settings.scrollPaddingLeft || 0,
7897
7894
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
@@ -7901,7 +7898,7 @@ class xi {
7901
7898
  });
7902
7899
  }
7903
7900
  get scrollPaddingRight() {
7904
- return new T({
7901
+ return new k({
7905
7902
  initialValue: this.preferences.scrollPaddingRight,
7906
7903
  effectiveValue: this.settings.scrollPaddingRight || 0,
7907
7904
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
@@ -7911,7 +7908,7 @@ class xi {
7911
7908
  });
7912
7909
  }
7913
7910
  get selectionBackgroundColor() {
7914
- return new T({
7911
+ return new k({
7915
7912
  initialValue: this.preferences.selectionBackgroundColor,
7916
7913
  effectiveValue: this.settings.selectionBackgroundColor || lt.RS__selectionBackgroundColor,
7917
7914
  isEffective: this.layout !== S.fixed && this.preferences.selectionBackgroundColor !== null,
@@ -7921,7 +7918,7 @@ class xi {
7921
7918
  });
7922
7919
  }
7923
7920
  get selectionTextColor() {
7924
- return new T({
7921
+ return new k({
7925
7922
  initialValue: this.preferences.selectionTextColor,
7926
7923
  effectiveValue: this.settings.selectionTextColor || lt.RS__selectionTextColor,
7927
7924
  isEffective: this.layout !== S.fixed && this.preferences.selectionTextColor !== null,
@@ -7942,7 +7939,7 @@ class xi {
7942
7939
  });
7943
7940
  }
7944
7941
  get textColor() {
7945
- return new T({
7942
+ return new k({
7946
7943
  initialValue: this.preferences.textColor,
7947
7944
  effectiveValue: this.settings.textColor || lt.RS__textColor,
7948
7945
  isEffective: this.layout !== S.fixed && this.preferences.textColor !== null,
@@ -7952,7 +7949,7 @@ class xi {
7952
7949
  });
7953
7950
  }
7954
7951
  get textNormalization() {
7955
- return new z({
7952
+ return new A({
7956
7953
  initialValue: this.preferences.textNormalization,
7957
7954
  effectiveValue: this.settings.textNormalization || !1,
7958
7955
  isEffective: this.layout !== S.fixed,
@@ -7962,7 +7959,7 @@ class xi {
7962
7959
  });
7963
7960
  }
7964
7961
  get visitedColor() {
7965
- return new T({
7962
+ return new k({
7966
7963
  initialValue: this.preferences.visitedColor,
7967
7964
  effectiveValue: this.settings.visitedColor || lt.RS__visitedColor,
7968
7965
  isEffective: this.layout !== S.fixed && this.preferences.visitedColor !== null,
@@ -7986,7 +7983,7 @@ class xi {
7986
7983
  }
7987
7984
  class Ri {
7988
7985
  constructor(t, e) {
7989
- 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 ? (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? O.OS.iPadOS && O.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;
7986
+ 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 ? (L.OS.iOS || L.OS.iPadOS) && L.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? L.OS.iPadOS && L.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;
7990
7987
  }
7991
7988
  }
7992
7989
  function Ut(s) {
@@ -9468,7 +9465,7 @@ const us = (s) => ({
9468
9465
  peripheral: s.peripheral || (() => {
9469
9466
  })
9470
9467
  });
9471
- class ln extends Gi {
9468
+ class ln extends ji {
9472
9469
  constructor(t, e, i, n = [], r = void 0, o = { preferences: {}, defaults: {} }) {
9473
9470
  super(), this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.reflowViewport = {
9474
9471
  readingOrder: [],
@@ -10078,7 +10075,7 @@ class ms {
10078
10075
  }
10079
10076
  }
10080
10077
  export {
10081
- z as BooleanPreference,
10078
+ A as BooleanPreference,
10082
10079
  Zi as EnumPreference,
10083
10080
  Jr as EpubDefaults,
10084
10081
  ln as EpubNavigator,
@@ -10089,8 +10086,8 @@ export {
10089
10086
  Br as FXLCoordinator,
10090
10087
  Ir as FXLFrameManager,
10091
10088
  Zr as FXLFramePoolManager,
10092
- jr as FXLPeripherals,
10093
- Gr as FXLSpreader,
10089
+ Gr as FXLPeripherals,
10090
+ jr as FXLSpreader,
10094
10091
  Ct as FrameComms,
10095
10092
  Fr as FrameManager,
10096
10093
  Dr as FramePoolManager,
@@ -10099,7 +10096,7 @@ export {
10099
10096
  bt as LineLengths,
10100
10097
  er as Navigator,
10101
10098
  Pe as Orientation,
10102
- T as Preference,
10099
+ k as Preference,
10103
10100
  ee as Properties,
10104
10101
  ss as RSProperties,
10105
10102
  R as RangePreference,
@@ -10108,7 +10105,7 @@ export {
10108
10105
  J as TextAlignment,
10109
10106
  an as UserProperties,
10110
10107
  Hr as VerticalThird,
10111
- Gi as VisualNavigator,
10108
+ ji as VisualNavigator,
10112
10109
  ms as WebAudioEngine,
10113
10110
  ir as WebPubBlobBuilder,
10114
10111
  gr as WebPubCSS,
@@ -10127,21 +10124,21 @@ export {
10127
10124
  pt as ensureFilter,
10128
10125
  fr as ensureLessThanOrEqual,
10129
10126
  yr as ensureMoreThanOrEqual,
10130
- _ as ensureNonNegative,
10127
+ v as ensureNonNegative,
10131
10128
  N as ensureString,
10132
10129
  q as ensureValueInRange,
10133
10130
  Me as experiments,
10134
10131
  ot as filterRangeConfig,
10135
- jt as fontSizeRangeConfig,
10132
+ Gt as fontSizeRangeConfig,
10136
10133
  it as fontWeightRangeConfig,
10137
- Gt as fontWidthRangeConfig,
10134
+ jt as fontWidthRangeConfig,
10138
10135
  $t as letterSpacingRangeConfig,
10139
10136
  Xt as lineHeightRangeConfig,
10140
10137
  at as lineLengthRangeConfig,
10141
10138
  Yt as paragraphIndentRangeConfig,
10142
10139
  qt as paragraphSpacingRangeConfig,
10143
10140
  Y as sML,
10144
- O as sMLWithRequest,
10141
+ L as sMLWithRequest,
10145
10142
  le as withFallback,
10146
10143
  Kt as wordSpacingRangeConfig,
10147
10144
  Zt as zoomRangeConfig