@readium/navigator 2.4.0-alpha.2 → 2.4.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -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,11 +909,11 @@ 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
  }
916
- class V {
916
+ class B {
917
917
  /**
918
918
  * Creates a [Link].
919
919
  */
@@ -925,13 +925,13 @@ class V {
925
925
  */
926
926
  static deserialize(t) {
927
927
  if (!(!t || typeof t.href != "string"))
928
- return new V({
928
+ return new B({
929
929
  href: t.href,
930
930
  templated: t.templated,
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),
@@ -970,7 +970,7 @@ class V {
970
970
  * See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
971
971
  */
972
972
  expandTemplate(t) {
973
- return new V({
973
+ return new B({
974
974
  href: new Xe(this.href).expand(t),
975
975
  templated: !1
976
976
  });
@@ -979,8 +979,8 @@ class V {
979
979
  * Makes a copy of this [Link] after merging in the given additional other [properties].
980
980
  */
981
981
  addProperties(t) {
982
- const e = V.deserialize(this.serialize());
983
- return e.properties = e.properties ? e.properties?.add(t) : new G(t), e;
982
+ const e = B.deserialize(this.serialize());
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 V {
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
  });
@@ -1010,7 +1010,7 @@ class Ft {
1010
1010
  static deserialize(t) {
1011
1011
  if (t && Array.isArray(t))
1012
1012
  return new Ft(
1013
- t.map((e) => V.deserialize(e)).filter((e) => e !== void 0)
1013
+ t.map((e) => B.deserialize(e)).filter((e) => e !== void 0)
1014
1014
  );
1015
1015
  }
1016
1016
  /**
@@ -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,28 +1320,28 @@ 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() {
1344
- return V.deserialize(this.otherProperties.authenticate);
1343
+ j.prototype.getAuthenticate = function() {
1344
+ return B.deserialize(this.otherProperties.authenticate);
1345
1345
  };
1346
1346
  const fn = "CssSelectorGenerator";
1347
1347
  function Ye(s = "unknown problem", ...t) {
@@ -1376,8 +1376,8 @@ bn([
1376
1376
  // Angular attributes
1377
1377
  "ng-*"
1378
1378
  ]);
1379
- const vn = Math.pow(2, 32), qe = () => Math.round(Math.random() * vn).toString(36), de = () => `${Math.round(performance.now())}-${qe()}-${qe()}`, ht = 1;
1380
- class wn {
1379
+ const wn = Math.pow(2, 32), qe = () => Math.round(Math.random() * wn).toString(36), de = () => `${Math.round(performance.now())}-${qe()}-${qe()}`, ht = 1;
1380
+ class vn {
1381
1381
  constructor(t) {
1382
1382
  this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = t, t.addEventListener("message", this.receiver);
1383
1383
  }
@@ -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 v = p * n + b;
1519
- if (v >= t.length)
1518
+ const _ = p * n + b;
1519
+ if (_ >= t.length)
1520
1520
  continue;
1521
- t.charCodeAt(v) === 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 v = t.length % n;
1544
- b = v === 0 ? n : v;
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);
@@ -2011,7 +2011,7 @@ function Mi(s, t, e) {
2011
2011
  const r = s[i], o = s[n];
2012
2012
  if (r === o)
2013
2013
  continue;
2014
- const a = B(r.top, o.top, t) && B(r.bottom, o.bottom, t), l = B(r.left, o.left, t) && B(r.right, o.right, t);
2014
+ const a = V(r.top, o.top, t) && V(r.bottom, o.bottom, t), l = V(r.left, o.left, t) && V(r.right, o.right, t);
2015
2015
  if (a && !l && Ni(r, o, t)) {
2016
2016
  const u = s.filter((y) => y !== r && y !== o), m = Ln(r, o);
2017
2017
  return u.push(m), Mi(
@@ -2052,7 +2052,7 @@ function kn(s, t, e) {
2052
2052
  return kt(s, t.left, t.top, e) && kt(s, t.right, t.top, e) && kt(s, t.left, t.bottom, e) && kt(s, t.right, t.bottom, e);
2053
2053
  }
2054
2054
  function kt(s, t, e, i) {
2055
- return (s.left < t || B(s.left, t, i)) && (s.right > t || B(s.right, t, i)) && (s.top < e || B(s.top, e, i)) && (s.bottom > e || B(s.bottom, e, i));
2055
+ return (s.left < t || V(s.left, t, i)) && (s.right > t || V(s.right, t, i)) && (s.top < e || V(s.top, e, i)) && (s.bottom > e || V(s.bottom, e, i));
2056
2056
  }
2057
2057
  function Ui(s) {
2058
2058
  for (let t = 0; t < s.length; t++)
@@ -2136,9 +2136,9 @@ function Tn(s, t) {
2136
2136
  };
2137
2137
  }
2138
2138
  function Ni(s, t, e) {
2139
- return (s.left < t.right || e >= 0 && B(s.left, t.right, e)) && (t.left < s.right || e >= 0 && B(t.left, s.right, e)) && (s.top < t.bottom || e >= 0 && B(s.top, t.bottom, e)) && (t.top < s.bottom || e >= 0 && B(t.top, s.bottom, e));
2139
+ return (s.left < t.right || e >= 0 && V(s.left, t.right, e)) && (t.left < s.right || e >= 0 && V(t.left, s.right, e)) && (s.top < t.bottom || e >= 0 && V(s.top, t.bottom, e)) && (t.top < s.bottom || e >= 0 && V(t.top, s.bottom, e));
2140
2140
  }
2141
- function B(s, t, e) {
2141
+ function V(s, t, e) {
2142
2142
  return Math.abs(s - t) <= e;
2143
2143
  }
2144
2144
  function Te(s) {
@@ -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 v = Math.floor(p.left / i) * i;
2333
- d.style.left = `${v + 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 v = Math.floor(p.left / r) * r;
2339
- d.style.left = `${v + 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();
@@ -2403,7 +2403,7 @@ class Nn {
2403
2403
  this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
2404
2404
  }
2405
2405
  }
2406
- const vt = class vt extends ft {
2406
+ const wt = class wt extends ft {
2407
2407
  constructor() {
2408
2408
  super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
2409
2409
  }
@@ -2428,7 +2428,7 @@ const vt = class vt extends ft {
2428
2428
  }, 50);
2429
2429
  }
2430
2430
  mount(t, e) {
2431
- return this.wnd = t, e.register("decorate", vt.moduleName, (i, n) => {
2431
+ return this.wnd = t, e.register("decorate", wt.moduleName, (i, n) => {
2432
2432
  const r = i;
2433
2433
  r.decoration && r.decoration.locator && (r.decoration.locator = H.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new Nn(
2434
2434
  t,
@@ -2468,12 +2468,12 @@ const vt = class vt extends ft {
2468
2468
  }), e.log("Decorator Mounted"), !0;
2469
2469
  }
2470
2470
  unmount(t, e) {
2471
- return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(vt.moduleName), this.resizeObserver.disconnect(), this.backgroundObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
2471
+ return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(wt.moduleName), this.resizeObserver.disconnect(), this.backgroundObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
2472
2472
  }
2473
2473
  };
2474
- vt.moduleName = "decorator";
2475
- let ge = vt;
2476
- const oi = "readium-snapper-style", wt = class wt extends ft {
2474
+ wt.moduleName = "decorator";
2475
+ let ge = wt;
2476
+ const oi = "readium-snapper-style", vt = class vt extends ft {
2477
2477
  constructor() {
2478
2478
  super(...arguments), this.protected = !1;
2479
2479
  }
@@ -2486,9 +2486,9 @@ const oi = "readium-snapper-style", wt = class wt extends ft {
2486
2486
  }
2487
2487
  mount(t, e) {
2488
2488
  const i = t.document.createElement("style");
2489
- return i.dataset.readium = "true", i.id = oi, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", wt.moduleName, (n, r) => {
2489
+ return i.dataset.readium = "true", i.id = oi, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", vt.moduleName, (n, r) => {
2490
2490
  this.protected = !0, i.textContent = this.buildStyles(), r(!0);
2491
- }), e.register("unprotect", wt.moduleName, (n, r) => {
2491
+ }), e.register("unprotect", vt.moduleName, (n, r) => {
2492
2492
  this.protected = !1, i.textContent = this.buildStyles(), r(!0);
2493
2493
  }), e.log("Snapper Mounted"), !0;
2494
2494
  }
@@ -2496,8 +2496,8 @@ const oi = "readium-snapper-style", wt = class wt extends ft {
2496
2496
  return t.document.getElementById(oi)?.remove(), e.log("Snapper Unmounted"), !0;
2497
2497
  }
2498
2498
  };
2499
- wt.moduleName = "snapper";
2500
- let Et = wt;
2499
+ vt.moduleName = "snapper";
2500
+ let Et = vt;
2501
2501
  function nt(s) {
2502
2502
  return s.document.body.dir.toLowerCase() === "rtl";
2503
2503
  }
@@ -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, v, L, Q) => L > Q ? v : b + (v - 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 v = b - d, L = m(this.overscroll, 0, v, y), Q = m(i, h, v, y);
2723
- n.scrollLeft = Q, this.overscroll !== 0 && (n.style.transform = `translate3d(${-L}px, 0px, 0px)`), v < 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.1",
3625
+ version: "2.4.0-alpha.4",
3626
3626
  hasFeature: (n, r = "") => {
3627
3627
  switch (n) {
3628
3628
  case "dom-manipulation":
@@ -3702,7 +3702,7 @@ const di = "readium-viewport", K = class K extends Ht {
3702
3702
  }
3703
3703
  };
3704
3704
  K.moduleName = "reflowable_setup";
3705
- let ve = K;
3705
+ let we = K;
3706
3706
  const ui = "readium-fixed-style", $ = class $ extends Ht {
3707
3707
  mount(t, e) {
3708
3708
  if (!super.mount(t, e)) return !1;
@@ -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",
@@ -3745,7 +3745,7 @@ const ui = "readium-fixed-style", $ = class $ extends Ht {
3745
3745
  }
3746
3746
  };
3747
3747
  $.moduleName = "fixed_setup";
3748
- let we = $;
3748
+ let ve = $;
3749
3749
  const Z = class Z extends ft {
3750
3750
  wndOnErr(t) {
3751
3751
  this.comms?.send("error", {
@@ -3836,8 +3836,8 @@ const Yn = [
3836
3836
  "print_protection"
3837
3837
  ], Bt = new Map([
3838
3838
  // All modules go here
3839
- we,
3840
3839
  ve,
3840
+ we,
3841
3841
  _e,
3842
3842
  Se,
3843
3843
  be,
@@ -3852,7 +3852,7 @@ class gt {
3852
3852
  * @param initialModules List of initial modules to load
3853
3853
  */
3854
3854
  constructor(t = window, e = []) {
3855
- this.loadedModules = [], this.wnd = t, this.comms = new wn(t);
3855
+ this.loadedModules = [], this.wnd = t, this.comms = new vn(t);
3856
3856
  const i = [...new Set(e)];
3857
3857
  if (i.length) {
3858
3858
  if (typeof t > "u")
@@ -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 v = this.blobs.get(d);
4375
- v && (this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v), 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 v = this.pool.get(d);
4378
+ const _ = this.pool.get(d);
4379
4379
  if (!this.blobs.has(d))
4380
- await v.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 v.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), v = o.charCodeAt(h + p);
4540
- if (b !== v)
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,
@@ -5300,7 +5300,7 @@ class tn {
5300
5300
  }
5301
5301
  }
5302
5302
  }
5303
- const mt = (s) => s.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Mt = (s) => s.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), vr = `/*!
5303
+ const mt = (s) => s.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Mt = (s) => s.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), wr = `/*!
5304
5304
  * Readium CSS v.2.0.0
5305
5305
  * Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
5306
5306
  * Use of this source code is governed by a BSD-style license which is detailed in the
@@ -5574,7 +5574,7 @@ const mt = (s) => s.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5574
5574
 
5575
5575
  :root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
5576
5576
  -webkit-text-zoom:normal;
5577
- }`, en = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', wr = `// WebPub-specific setup - no execution blocking needed
5577
+ }`, en = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', vr = `// WebPub-specific setup - no execution blocking needed
5578
5578
  window._readium_blockedEvents = [];
5579
5579
  window._readium_blockEvents = false; // WebPub doesn't need event blocking
5580
5580
  window._readium_eventBlocker = null;
@@ -5606,7 +5606,7 @@ function _r(s) {
5606
5606
  id: "webpub-execution",
5607
5607
  as: "script",
5608
5608
  target: "head",
5609
- blob: new Blob([mt(wr)], { type: "text/javascript" })
5609
+ blob: new Blob([mt(vr)], { type: "text/javascript" })
5610
5610
  }
5611
5611
  ], n = [
5612
5612
  // Onload Proxy - conditional (has executable scripts)
@@ -5622,7 +5622,7 @@ function _r(s) {
5622
5622
  id: "readium-css-webpub",
5623
5623
  as: "link",
5624
5624
  target: "head",
5625
- blob: new Blob([Mt(vr)], { type: "text/css" }),
5625
+ blob: new Blob([Mt(wr)], { type: "text/css" }),
5626
5626
  rel: "stylesheet"
5627
5627
  }
5628
5628
  ];
@@ -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: [],
@@ -6171,7 +6171,7 @@ class Ur extends Gi {
6171
6171
  }), !1, () => {
6172
6172
  });
6173
6173
  else if (a.startsWith("mailto:") || a.startsWith("tel:"))
6174
- this.listeners.handleLocator(new V({
6174
+ this.listeners.handleLocator(new B({
6175
6175
  href: a
6176
6176
  }).locator);
6177
6177
  else
@@ -6186,11 +6186,11 @@ class Ur extends Gi {
6186
6186
  l = Vt.join(Vt.dirname(this.currentLocation.href), a);
6187
6187
  const c = this.pub.readingOrder.findWithHref(l);
6188
6188
  c ? this.goLink(c, !1, () => {
6189
- }) : (console.warn(`Internal link not found in readingOrder: ${l}`), this.listeners.handleLocator(new V({
6189
+ }) : (console.warn(`Internal link not found in readingOrder: ${l}`), this.listeners.handleLocator(new B({
6190
6190
  href: a
6191
6191
  }).locator));
6192
6192
  } catch (l) {
6193
- console.warn(`Couldn't resolve internal link for ${a}: ${l}`), this.listeners.handleLocator(new V({
6193
+ console.warn(`Couldn't resolve internal link for ${a}: ${l}`), this.listeners.handleLocator(new B({
6194
6194
  href: a
6195
6195
  }).locator);
6196
6196
  }
@@ -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,38 +6392,52 @@ 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
- if (this.item.mediaType.isHTML)
6397
- return await this.buildHtmlFrame(t);
6398
- if (this.item.mediaType.isBitmap || this.item.mediaType.equals(g.SVG))
6399
- return await this.buildImageFrame();
6400
- throw Error("Unsupported frame mediatype " + this.item.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 (e.mediaType.isHTML) {
6403
+ const i = await this.buildHtmlFrame(t);
6404
+ return this.currentUrl = i, i;
6405
+ } else if (e.mediaType.isBitmap || e.mediaType.equals(g.SVG)) {
6406
+ const i = await this.buildImageFrame();
6407
+ return this.currentUrl = i, i;
6408
+ } else
6409
+ throw Error("Unsupported frame mediatype " + e.mediaType.string);
6401
6410
  }
6402
6411
  async buildHtmlFrame(t = !1) {
6403
- const e = await this.pub.get(this.item).readAsString();
6404
- if (!e) throw new Error(`Failed reading item ${this.item.href}`);
6405
- const i = new DOMParser().parseFromString(
6406
- e,
6407
- this.item.mediaType.string
6408
- ), n = i.querySelector("parsererror");
6409
- if (n) {
6410
- const r = n.querySelector("div");
6411
- throw new Error(`Failed parsing item ${this.item.href}: ${r?.textContent || n.textContent}`);
6412
+ const e = await this.currentResource.link(), i = await this.currentResource.readAsString();
6413
+ if (!i) throw new Error(`Failed reading item ${e.href}`);
6414
+ const n = new DOMParser().parseFromString(
6415
+ i,
6416
+ e.mediaType.string
6417
+ ), r = n.querySelector("parsererror");
6418
+ if (r) {
6419
+ const o = r.querySelector("div");
6420
+ throw new Error(`Failed parsing item ${e.href}: ${o?.textContent || r.textContent}`);
6412
6421
  }
6413
- return this.injector && await this.injector.injectForDocument(i, this.item), this.finalizeDOM(i, this.pub.baseURL, (await this.pub.get(this.item).link()).toURL(this.baseURL) || "", this.item.mediaType, t, this.cssProperties);
6422
+ return this.injector && await this.injector.injectForDocument(n, e), this.finalizeDOM(n, this.pub.baseURL, e.toURL(this.baseURL) || "", e.mediaType, t, this.cssProperties);
6414
6423
  }
6415
6424
  async buildImageFrame() {
6416
- const t = await this.pub.get(this.item).link(), e = t.toURL(this.baseURL) || "", i = document.implementation.createHTMLDocument(this.item.title || this.item.href);
6425
+ const t = await this.currentResource.link(), e = t.toURL(this.baseURL) || "", i = document.implementation.createHTMLDocument(t.title || t.href);
6417
6426
  if ((t?.height || 0) > 0 && (t?.width || 0) > 0) {
6418
6427
  const o = i.createElement("meta");
6419
6428
  o.name = "viewport", o.content = `width=${t.width}, height=${t.height}`, o.dataset.readium = "true", i.head.appendChild(o);
6420
6429
  }
6421
6430
  const n = document.createElement("img");
6422
- n.src = e || "", n.alt = this.item.title || "", n.decoding = "async", i.body.appendChild(n), this.injector && await this.injector.injectForDocument(i, this.item);
6431
+ n.src = e || "", n.alt = t.title || "", n.decoding = "async", i.body.appendChild(n), this.injector && await this.injector.injectForDocument(i, new B({
6432
+ // Temporary solution to address injector only expecting (X)HTML
6433
+ // documents for injection, which we are technically providing
6434
+ href: "readium-image-frame.xhtml",
6435
+ type: g.XHTML.string
6436
+ }));
6423
6437
  const r = i.createElement("style");
6424
6438
  return r.dataset.readium = "true", r.textContent = `
6425
6439
  html, body { width: 100%; height: 100%; margin: 0; padding: 0; font-size: 0; }
6426
- img { margin: 0; padding: 0; border: 0; }`, i.head.appendChild(r), this.finalizeDOM(i, this.pub.baseURL, e, this.item.mediaType, !0);
6440
+ img { margin: 0; padding: 0; border: 0; }`, i.head.appendChild(r), this.finalizeDOM(i, this.pub.baseURL, e, t.mediaType, !0);
6427
6441
  }
6428
6442
  setProperties(t, e) {
6429
6443
  for (const i in t) {
@@ -6558,7 +6572,7 @@ class Fr {
6558
6572
  return this.loader;
6559
6573
  }
6560
6574
  }
6561
- const vi = 5, wi = 3;
6575
+ const wi = 5, vi = 3;
6562
6576
  class Dr {
6563
6577
  constructor(t, e, i, n, r, o) {
6564
6578
  this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.positions = e, this.currentCssProperties = i, this.injector = n ?? null, this.contentProtectionConfig = r || {}, this.keyboardPeripheralsConfig = o || [];
@@ -6572,9 +6586,7 @@ class Dr {
6572
6586
  let n = this.pool.values(), r = n.next();
6573
6587
  for (; r.value; )
6574
6588
  await r.value.destroy(), r = n.next();
6575
- this.pool.clear(), this.blobs.forEach((o) => {
6576
- this.injector?.releaseBlobUrl?.(o), URL.revokeObjectURL(o);
6577
- }), this.injector?.dispose(), this.container.childNodes.forEach((o) => {
6589
+ this.pool.clear(), this.blobs.forEach((o) => o.reset()), this.blobs.clear(), this.injector?.dispose(), this.container.childNodes.forEach((o) => {
6578
6590
  (o.nodeType === Node.ELEMENT_NODE || o.nodeType === Node.TEXT_NODE) && o.remove();
6579
6591
  });
6580
6592
  }
@@ -6586,43 +6598,36 @@ class Dr {
6586
6598
  const a = new Promise(async (l, c) => {
6587
6599
  const h = [], u = [];
6588
6600
  this.positions.forEach((d, p) => {
6589
- (p > r + vi || p < r - vi) && (h.includes(d.href) || h.push(d.href)), p < r + wi && p > r - wi && (u.includes(d.href) || u.push(d.href));
6601
+ (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));
6590
6602
  }), h.forEach(async (d) => {
6591
6603
  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 }));
6592
- }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => {
6593
- this.injector?.releaseBlobUrl?.(d), URL.revokeObjectURL(d);
6594
- }), this.blobs.clear()), this.currentBaseURL = t.baseURL;
6604
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => d.reset()), this.blobs.clear()), this.currentBaseURL = t.baseURL;
6595
6605
  const m = async (d) => {
6596
- if (n && (this.blobs.forEach((v) => {
6597
- this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v);
6598
- }), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(d) && this.pendingUpdates.get(d)?.inPool === !1) {
6599
- const v = this.blobs.get(d);
6600
- v && (this.injector?.releaseBlobUrl?.(v), URL.revokeObjectURL(v), this.blobs.delete(d), this.pendingUpdates.delete(d));
6606
+ if (n && (this.blobs.forEach((_) => _.reset()), this.blobs.clear(), this.pendingUpdates.clear()), this.pendingUpdates.has(d) && this.pendingUpdates.get(d)?.inPool === !1) {
6607
+ const _ = this.blobs.get(d);
6608
+ _ && (_.reset(), this.blobs.delete(d), this.pendingUpdates.delete(d));
6601
6609
  }
6602
6610
  if (this.pool.has(d)) {
6603
- const v = this.pool.get(d);
6611
+ const _ = this.pool.get(d);
6604
6612
  if (!this.blobs.has(d))
6605
- await v.destroy(), this.pool.delete(d), this.pendingUpdates.delete(d);
6613
+ await _.destroy(), this.pool.delete(d), this.pendingUpdates.delete(d);
6606
6614
  else {
6607
- await v.load(i);
6615
+ await _.load(i);
6608
6616
  return;
6609
6617
  }
6610
6618
  }
6611
6619
  const p = t.readingOrder.findWithHref(d);
6612
6620
  if (!p) return;
6613
- if (!this.blobs.has(d)) {
6614
- const L = await new on(
6615
- t,
6616
- this.currentBaseURL || "",
6617
- p,
6618
- {
6619
- cssProperties: this.currentCssProperties,
6620
- injector: this.injector
6621
- }
6622
- ).build();
6623
- this.blobs.set(d, L);
6624
- }
6625
- const b = new Fr(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6621
+ this.blobs.has(d) || this.blobs.set(d, new on(
6622
+ t,
6623
+ this.currentBaseURL || "",
6624
+ p,
6625
+ {
6626
+ cssProperties: this.currentCssProperties,
6627
+ injector: this.injector
6628
+ }
6629
+ ));
6630
+ const b = new Fr(await this.blobs.get(d).build(), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
6626
6631
  d !== o && await b.hide(), this.container.appendChild(b.iframe), await b.load(i), this.pool.set(d, b);
6627
6632
  };
6628
6633
  try {
@@ -6738,10 +6743,10 @@ class Ir {
6738
6743
  const i = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
6739
6744
  this.frame.style.transform = `scale(${i})`;
6740
6745
  const n = this.frame.getBoundingClientRect(), r = this.wrapper.clientHeight - n.height;
6741
- if (this.frame.style.top = `${r / 2}px`, t === j.left) {
6746
+ if (this.frame.style.top = `${r / 2}px`, t === G.left) {
6742
6747
  const o = this.wrapper.clientWidth - n.width;
6743
6748
  this.frame.style.left = `${o}px`;
6744
- } else if (t === j.center) {
6749
+ } else if (t === G.center) {
6745
6750
  const o = this.wrapper.clientWidth - n.width;
6746
6751
  this.frame.style.left = `${o / 2}px`;
6747
6752
  } else
@@ -6910,7 +6915,7 @@ class Vr {
6910
6915
  }
6911
6916
  }
6912
6917
  const _i = 6, he = 1.02, Pi = 50;
6913
- class jr {
6918
+ class Gr {
6914
6919
  constructor(t, e = !1) {
6915
6920
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
6916
6921
  startX: 0,
@@ -7131,7 +7136,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
7131
7136
  }
7132
7137
  }
7133
7138
  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 || {});
7134
- class Gr {
7139
+ class jr {
7135
7140
  // TODO getter
7136
7141
  constructor(t) {
7137
7142
  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`);
@@ -7160,13 +7165,13 @@ class Gr {
7160
7165
  if (i.length > 1)
7161
7166
  return;
7162
7167
  const r = i[0], o = r.properties?.otherProperties.orientation;
7163
- 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;
7168
+ 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;
7164
7169
  }), this.shift || this.index(t, !0);
7165
7170
  }
7166
7171
  buildSpreads(t) {
7167
7172
  let e = [];
7168
7173
  t.items.forEach((i, n) => {
7169
- !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);
7174
+ !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);
7170
7175
  }), e.length > 0 && this.spreads.push(e);
7171
7176
  }
7172
7177
  currentSpread(t, e) {
@@ -7181,7 +7186,7 @@ class Zr {
7181
7186
  constructor(t, e, i, n, r, o) {
7182
7187
  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)
7183
7188
  throw Error("Unsupported reading progression for EPUB");
7184
- 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) => {
7189
+ 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) => {
7185
7190
  const l = new Ir(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7186
7191
  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;
7187
7192
  });
@@ -7358,7 +7363,7 @@ class Zr {
7358
7363
  let n = this.pool.values(), r = n.next();
7359
7364
  for (; r.value; )
7360
7365
  await r.value.destroy(), r = n.next();
7361
- this.pool.clear(), this.blobs.forEach((o) => URL.revokeObjectURL(o)), this.injector?.dispose(), this.container.childNodes.forEach((o) => {
7366
+ this.pool.clear(), this.blobs.forEach((o) => o.reset()), this.blobs.clear(), this.injector?.dispose(), this.container.childNodes.forEach((o) => {
7362
7367
  (o.nodeType === Node.ELEMENT_NODE || o.nodeType === Node.TEXT_NODE) && o.remove();
7363
7368
  });
7364
7369
  }
@@ -7369,7 +7374,7 @@ class Zr {
7369
7374
  return t % 2 && !this.single && t++, t;
7370
7375
  }
7371
7376
  spreadPosition(t, e) {
7372
- 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;
7377
+ 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;
7373
7378
  }
7374
7379
  async waitForItem(t) {
7375
7380
  if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
@@ -7396,34 +7401,28 @@ class Zr {
7396
7401
  this.positions.forEach((d, p) => {
7397
7402
  (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));
7398
7403
  }), h.forEach(async (d) => {
7399
- u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload());
7400
- }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => URL.revokeObjectURL(d)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
7404
+ u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload(), this.blobs.get(d)?.reset());
7405
+ }), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => d.reset()), this.blobs.clear()), this.currentBaseURL = t.baseURL;
7401
7406
  const m = async (d) => {
7402
7407
  const p = t.readingOrder.findIndexWithHref(d), b = t.readingOrder.items[p];
7403
- if (b) {
7404
- if (!this.blobs.has(d)) {
7405
- const L = await new on(
7406
- t,
7407
- this.currentBaseURL || "",
7408
- b,
7409
- {
7410
- injector: this.injector
7411
- }
7412
- ).build(!0);
7413
- this.blobs.set(d, L);
7408
+ b && (this.blobs.has(d) || this.blobs.set(d, new on(
7409
+ t,
7410
+ this.currentBaseURL || "",
7411
+ b,
7412
+ {
7413
+ injector: this.injector
7414
7414
  }
7415
- this.delayedShow.has(d) || this.delayedShow.set(d, new Promise((v, L) => {
7416
- let Q = !1;
7417
- const hn = window.setTimeout(async () => {
7418
- this.delayedTimeout.set(d, 0);
7419
- const cn = this.makeSpread(this.reAlign(p)), dn = this.spreadPosition(cn, b), Fe = this.pool.get(d);
7420
- await Fe.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Fe.show(dn), this.delayedShow.delete(d), Q = !0, v();
7421
- }, $r);
7422
- setTimeout(() => {
7423
- !Q && this.delayedShow.has(d) && L(`Offscreen load timeout: ${d}`);
7424
- }, Xr), this.delayedTimeout.set(d, hn);
7425
- }));
7426
- }
7415
+ )), this.delayedShow.has(d) || this.delayedShow.set(d, new Promise((_, z) => {
7416
+ let Q = !1;
7417
+ const hn = window.setTimeout(async () => {
7418
+ this.delayedTimeout.set(d, 0);
7419
+ const cn = this.makeSpread(this.reAlign(p)), dn = this.spreadPosition(cn, b), Fe = this.pool.get(d);
7420
+ await Fe.load(i, await this.blobs.get(d).build(!0)), this.peripherals.isScaled || await Fe.show(dn), this.delayedShow.delete(d), Q = !0, _();
7421
+ }, $r);
7422
+ setTimeout(() => {
7423
+ !Q && this.delayedShow.has(d) && z(`Offscreen load timeout: ${d}`);
7424
+ }, Xr), this.delayedTimeout.set(d, hn);
7425
+ })));
7427
7426
  };
7428
7427
  try {
7429
7428
  await Promise.all(u.map((d) => m(d)));
@@ -7433,7 +7432,7 @@ class Zr {
7433
7432
  const y = [];
7434
7433
  for (const d of o) {
7435
7434
  const p = this.pool.get(d.href), b = this.blobs.get(d.href);
7436
- 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));
7435
+ 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));
7437
7436
  }
7438
7437
  for (; this.previousFrames.length > 0; ) {
7439
7438
  const d = this.previousFrames.shift();
@@ -7499,7 +7498,7 @@ class Zr {
7499
7498
  }
7500
7499
  class Ot {
7501
7500
  constructor(t = {}) {
7502
- 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);
7501
+ 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);
7503
7502
  }
7504
7503
  static serialize(t) {
7505
7504
  const { ...e } = t;
@@ -7522,7 +7521,7 @@ class Ot {
7522
7521
  }
7523
7522
  class Jr {
7524
7523
  constructor(t) {
7525
- 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;
7524
+ 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;
7526
7525
  }
7527
7526
  }
7528
7527
  const Qr = "#FFFFFF", ts = "#121212", es = "#0000EE", is = "#551A8B", ns = "#b4d8fe", rs = "inherit", lt = {
@@ -7544,7 +7543,7 @@ class xi {
7544
7543
  this.preferences[t] = e;
7545
7544
  }
7546
7545
  get backgroundColor() {
7547
- return new T({
7546
+ return new k({
7548
7547
  initialValue: this.preferences.backgroundColor,
7549
7548
  effectiveValue: this.settings.backgroundColor || lt.RS__backgroundColor,
7550
7549
  isEffective: this.preferences.backgroundColor !== null,
@@ -7554,7 +7553,7 @@ class xi {
7554
7553
  });
7555
7554
  }
7556
7555
  get blendFilter() {
7557
- return new z({
7556
+ return new A({
7558
7557
  initialValue: this.preferences.blendFilter,
7559
7558
  effectiveValue: this.settings.blendFilter || !1,
7560
7559
  isEffective: this.preferences.blendFilter !== null,
@@ -7564,7 +7563,7 @@ class xi {
7564
7563
  });
7565
7564
  }
7566
7565
  get columnCount() {
7567
- return new T({
7566
+ return new k({
7568
7567
  initialValue: this.preferences.columnCount,
7569
7568
  effectiveValue: this.settings.columnCount || null,
7570
7569
  isEffective: this.layout !== S.fixed && !this.settings.scroll,
@@ -7574,7 +7573,7 @@ class xi {
7574
7573
  });
7575
7574
  }
7576
7575
  get constraint() {
7577
- return new T({
7576
+ return new k({
7578
7577
  initialValue: this.preferences.constraint,
7579
7578
  effectiveValue: this.preferences.constraint || 0,
7580
7579
  isEffective: !0,
@@ -7596,7 +7595,7 @@ class xi {
7596
7595
  });
7597
7596
  }
7598
7597
  get deprecatedFontSize() {
7599
- return new z({
7598
+ return new A({
7600
7599
  initialValue: this.preferences.deprecatedFontSize,
7601
7600
  effectiveValue: CSS.supports("zoom", "1") ? this.settings.deprecatedFontSize || !1 : !0,
7602
7601
  isEffective: this.layout !== S.fixed,
@@ -7606,7 +7605,7 @@ class xi {
7606
7605
  });
7607
7606
  }
7608
7607
  get fontFamily() {
7609
- return new T({
7608
+ return new k({
7610
7609
  initialValue: this.preferences.fontFamily,
7611
7610
  effectiveValue: this.settings.fontFamily || null,
7612
7611
  isEffective: this.layout !== S.fixed,
@@ -7623,12 +7622,12 @@ class xi {
7623
7622
  onChange: (t) => {
7624
7623
  this.updatePreference("fontSize", t || null);
7625
7624
  },
7626
- supportedRange: jt.range,
7627
- step: jt.step
7625
+ supportedRange: Gt.range,
7626
+ step: Gt.step
7628
7627
  });
7629
7628
  }
7630
7629
  get fontSizeNormalize() {
7631
- return new z({
7630
+ return new A({
7632
7631
  initialValue: this.preferences.fontSizeNormalize,
7633
7632
  effectiveValue: this.settings.fontSizeNormalize || !1,
7634
7633
  isEffective: this.layout !== S.fixed && this.preferences.fontSizeNormalize !== null,
@@ -7638,7 +7637,7 @@ class xi {
7638
7637
  });
7639
7638
  }
7640
7639
  get fontOpticalSizing() {
7641
- return new z({
7640
+ return new A({
7642
7641
  initialValue: this.preferences.fontOpticalSizing,
7643
7642
  effectiveValue: this.settings.fontOpticalSizing || !0,
7644
7643
  isEffective: this.layout !== S.fixed && this.preferences.fontOpticalSizing !== null,
@@ -7667,12 +7666,12 @@ class xi {
7667
7666
  onChange: (t) => {
7668
7667
  this.updatePreference("fontWidth", t || null);
7669
7668
  },
7670
- supportedRange: Gt.range,
7671
- step: Gt.step
7669
+ supportedRange: jt.range,
7670
+ step: jt.step
7672
7671
  });
7673
7672
  }
7674
7673
  get hyphens() {
7675
- return new z({
7674
+ return new A({
7676
7675
  initialValue: this.preferences.hyphens,
7677
7676
  effectiveValue: this.settings.hyphens || !1,
7678
7677
  isEffective: this.layout !== S.fixed && this.metadata?.effectiveReadingProgression === F.ltr && this.preferences.hyphens !== null,
@@ -7706,7 +7705,7 @@ class xi {
7706
7705
  });
7707
7706
  }
7708
7707
  get iOSPatch() {
7709
- return new z({
7708
+ return new A({
7710
7709
  initialValue: this.preferences.iOSPatch,
7711
7710
  effectiveValue: this.settings.iOSPatch || !1,
7712
7711
  isEffective: this.layout !== S.fixed,
@@ -7716,7 +7715,7 @@ class xi {
7716
7715
  });
7717
7716
  }
7718
7717
  get iPadOSPatch() {
7719
- return new z({
7718
+ return new A({
7720
7719
  initialValue: this.preferences.iPadOSPatch,
7721
7720
  effectiveValue: this.settings.iPadOSPatch || !1,
7722
7721
  isEffective: this.layout !== S.fixed,
@@ -7738,7 +7737,7 @@ class xi {
7738
7737
  });
7739
7738
  }
7740
7739
  get ligatures() {
7741
- return new z({
7740
+ return new A({
7742
7741
  initialValue: this.preferences.ligatures,
7743
7742
  effectiveValue: this.settings.ligatures || !0,
7744
7743
  isEffective: (() => {
@@ -7765,7 +7764,7 @@ class xi {
7765
7764
  });
7766
7765
  }
7767
7766
  get linkColor() {
7768
- return new T({
7767
+ return new k({
7769
7768
  initialValue: this.preferences.linkColor,
7770
7769
  effectiveValue: this.settings.linkColor || lt.RS__linkColor,
7771
7770
  isEffective: this.layout !== S.fixed && this.preferences.linkColor !== null,
@@ -7799,7 +7798,7 @@ class xi {
7799
7798
  });
7800
7799
  }
7801
7800
  get noRuby() {
7802
- return new z({
7801
+ return new A({
7803
7802
  initialValue: this.preferences.noRuby,
7804
7803
  effectiveValue: this.settings.noRuby || !1,
7805
7804
  isEffective: this.layout !== S.fixed && this.metadata?.languages?.includes("ja") || !1,
@@ -7821,7 +7820,7 @@ class xi {
7821
7820
  });
7822
7821
  }
7823
7822
  get pageGutter() {
7824
- return new T({
7823
+ return new k({
7825
7824
  initialValue: this.preferences.pageGutter,
7826
7825
  effectiveValue: this.settings.pageGutter,
7827
7826
  isEffective: this.layout !== S.fixed && !this.settings.scroll,
@@ -7855,7 +7854,7 @@ class xi {
7855
7854
  });
7856
7855
  }
7857
7856
  get scroll() {
7858
- return new z({
7857
+ return new A({
7859
7858
  initialValue: this.preferences.scroll,
7860
7859
  effectiveValue: this.settings.scroll || !1,
7861
7860
  isEffective: this.layout !== S.fixed,
@@ -7865,7 +7864,7 @@ class xi {
7865
7864
  });
7866
7865
  }
7867
7866
  get scrollPaddingTop() {
7868
- return new T({
7867
+ return new k({
7869
7868
  initialValue: this.preferences.scrollPaddingTop,
7870
7869
  effectiveValue: this.settings.scrollPaddingTop || 0,
7871
7870
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingTop !== null,
@@ -7875,7 +7874,7 @@ class xi {
7875
7874
  });
7876
7875
  }
7877
7876
  get scrollPaddingBottom() {
7878
- return new T({
7877
+ return new k({
7879
7878
  initialValue: this.preferences.scrollPaddingBottom,
7880
7879
  effectiveValue: this.settings.scrollPaddingBottom || 0,
7881
7880
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingBottom !== null,
@@ -7885,7 +7884,7 @@ class xi {
7885
7884
  });
7886
7885
  }
7887
7886
  get scrollPaddingLeft() {
7888
- return new T({
7887
+ return new k({
7889
7888
  initialValue: this.preferences.scrollPaddingLeft,
7890
7889
  effectiveValue: this.settings.scrollPaddingLeft || 0,
7891
7890
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingLeft !== null,
@@ -7895,7 +7894,7 @@ class xi {
7895
7894
  });
7896
7895
  }
7897
7896
  get scrollPaddingRight() {
7898
- return new T({
7897
+ return new k({
7899
7898
  initialValue: this.preferences.scrollPaddingRight,
7900
7899
  effectiveValue: this.settings.scrollPaddingRight || 0,
7901
7900
  isEffective: this.layout !== S.fixed && !!this.settings.scroll && this.preferences.scrollPaddingRight !== null,
@@ -7905,7 +7904,7 @@ class xi {
7905
7904
  });
7906
7905
  }
7907
7906
  get selectionBackgroundColor() {
7908
- return new T({
7907
+ return new k({
7909
7908
  initialValue: this.preferences.selectionBackgroundColor,
7910
7909
  effectiveValue: this.settings.selectionBackgroundColor || lt.RS__selectionBackgroundColor,
7911
7910
  isEffective: this.layout !== S.fixed && this.preferences.selectionBackgroundColor !== null,
@@ -7915,7 +7914,7 @@ class xi {
7915
7914
  });
7916
7915
  }
7917
7916
  get selectionTextColor() {
7918
- return new T({
7917
+ return new k({
7919
7918
  initialValue: this.preferences.selectionTextColor,
7920
7919
  effectiveValue: this.settings.selectionTextColor || lt.RS__selectionTextColor,
7921
7920
  isEffective: this.layout !== S.fixed && this.preferences.selectionTextColor !== null,
@@ -7936,7 +7935,7 @@ class xi {
7936
7935
  });
7937
7936
  }
7938
7937
  get textColor() {
7939
- return new T({
7938
+ return new k({
7940
7939
  initialValue: this.preferences.textColor,
7941
7940
  effectiveValue: this.settings.textColor || lt.RS__textColor,
7942
7941
  isEffective: this.layout !== S.fixed && this.preferences.textColor !== null,
@@ -7946,7 +7945,7 @@ class xi {
7946
7945
  });
7947
7946
  }
7948
7947
  get textNormalization() {
7949
- return new z({
7948
+ return new A({
7950
7949
  initialValue: this.preferences.textNormalization,
7951
7950
  effectiveValue: this.settings.textNormalization || !1,
7952
7951
  isEffective: this.layout !== S.fixed,
@@ -7956,7 +7955,7 @@ class xi {
7956
7955
  });
7957
7956
  }
7958
7957
  get visitedColor() {
7959
- return new T({
7958
+ return new k({
7960
7959
  initialValue: this.preferences.visitedColor,
7961
7960
  effectiveValue: this.settings.visitedColor || lt.RS__visitedColor,
7962
7961
  isEffective: this.layout !== S.fixed && this.preferences.visitedColor !== null,
@@ -7980,7 +7979,7 @@ class xi {
7980
7979
  }
7981
7980
  class Ri {
7982
7981
  constructor(t, e) {
7983
- this.backgroundColor = t.backgroundColor || e.backgroundColor || null, this.blendFilter = typeof t.blendFilter == "boolean" ? t.blendFilter : e.blendFilter ?? null, this.columnCount = t.columnCount !== void 0 ? t.columnCount : e.columnCount !== void 0 ? e.columnCount : null, this.constraint = t.constraint || e.constraint, this.darkenFilter = typeof t.darkenFilter == "boolean" ? t.darkenFilter : e.darkenFilter ?? null, this.deprecatedFontSize = typeof t.deprecatedFontSize == "boolean" ? t.deprecatedFontSize : e.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontSize = t.fontSize !== void 0 ? t.fontSize : e.fontSize !== void 0 ? e.fontSize : null, this.fontSizeNormalize = typeof t.fontSizeNormalize == "boolean" ? t.fontSizeNormalize : e.fontSizeNormalize ?? null, this.fontOpticalSizing = typeof t.fontOpticalSizing == "boolean" ? t.fontOpticalSizing : e.fontOpticalSizing ?? null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.fontWidth = t.fontWidth !== void 0 ? t.fontWidth : e.fontWidth !== void 0 ? e.fontWidth : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.invertFilter = typeof t.invertFilter == "boolean" ? t.invertFilter : e.invertFilter ?? null, this.invertGaijiFilter = typeof t.invertGaijiFilter == "boolean" ? t.invertGaijiFilter : e.invertGaijiFilter ?? null, this.iOSPatch = this.deprecatedFontSize || t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (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;
7982
+ 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;
7984
7983
  }
7985
7984
  }
7986
7985
  function Ut(s) {
@@ -9462,7 +9461,7 @@ const us = (s) => ({
9462
9461
  peripheral: s.peripheral || (() => {
9463
9462
  })
9464
9463
  });
9465
- class ln extends Gi {
9464
+ class ln extends ji {
9466
9465
  constructor(t, e, i, n = [], r = void 0, o = { preferences: {}, defaults: {} }) {
9467
9466
  super(), this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.reflowViewport = {
9468
9467
  readingOrder: [],
@@ -9637,17 +9636,17 @@ class ln extends Gi {
9637
9636
  }), !1, () => {
9638
9637
  });
9639
9638
  else if (a.startsWith("http://") || a.startsWith("https://") || a.startsWith("mailto:") || a.startsWith("tel:"))
9640
- this.listeners.handleLocator(new V({
9639
+ this.listeners.handleLocator(new B({
9641
9640
  href: a
9642
9641
  }).locator);
9643
9642
  else
9644
9643
  try {
9645
- this.goLink(new V({
9644
+ this.goLink(new B({
9646
9645
  href: Vt.join(Vt.dirname(this.currentLocation.href), a)
9647
9646
  }), !1, () => {
9648
9647
  });
9649
9648
  } catch (l) {
9650
- console.warn(`Couldn't go to link for ${a}: ${l}`), this.listeners.handleLocator(new V({
9649
+ console.warn(`Couldn't go to link for ${a}: ${l}`), this.listeners.handleLocator(new B({
9651
9650
  href: a
9652
9651
  }).locator);
9653
9652
  }
@@ -10072,7 +10071,7 @@ class ms {
10072
10071
  }
10073
10072
  }
10074
10073
  export {
10075
- z as BooleanPreference,
10074
+ A as BooleanPreference,
10076
10075
  Zi as EnumPreference,
10077
10076
  Jr as EpubDefaults,
10078
10077
  ln as EpubNavigator,
@@ -10083,8 +10082,8 @@ export {
10083
10082
  Br as FXLCoordinator,
10084
10083
  Ir as FXLFrameManager,
10085
10084
  Zr as FXLFramePoolManager,
10086
- jr as FXLPeripherals,
10087
- Gr as FXLSpreader,
10085
+ Gr as FXLPeripherals,
10086
+ jr as FXLSpreader,
10088
10087
  Ct as FrameComms,
10089
10088
  Fr as FrameManager,
10090
10089
  Dr as FramePoolManager,
@@ -10093,7 +10092,7 @@ export {
10093
10092
  bt as LineLengths,
10094
10093
  er as Navigator,
10095
10094
  Pe as Orientation,
10096
- T as Preference,
10095
+ k as Preference,
10097
10096
  ee as Properties,
10098
10097
  ss as RSProperties,
10099
10098
  R as RangePreference,
@@ -10102,7 +10101,7 @@ export {
10102
10101
  J as TextAlignment,
10103
10102
  an as UserProperties,
10104
10103
  Hr as VerticalThird,
10105
- Gi as VisualNavigator,
10104
+ ji as VisualNavigator,
10106
10105
  ms as WebAudioEngine,
10107
10106
  ir as WebPubBlobBuilder,
10108
10107
  gr as WebPubCSS,
@@ -10121,21 +10120,21 @@ export {
10121
10120
  pt as ensureFilter,
10122
10121
  fr as ensureLessThanOrEqual,
10123
10122
  yr as ensureMoreThanOrEqual,
10124
- _ as ensureNonNegative,
10123
+ v as ensureNonNegative,
10125
10124
  N as ensureString,
10126
10125
  q as ensureValueInRange,
10127
10126
  Me as experiments,
10128
10127
  ot as filterRangeConfig,
10129
- jt as fontSizeRangeConfig,
10128
+ Gt as fontSizeRangeConfig,
10130
10129
  it as fontWeightRangeConfig,
10131
- Gt as fontWidthRangeConfig,
10130
+ jt as fontWidthRangeConfig,
10132
10131
  $t as letterSpacingRangeConfig,
10133
10132
  Xt as lineHeightRangeConfig,
10134
10133
  at as lineLengthRangeConfig,
10135
10134
  Yt as paragraphIndentRangeConfig,
10136
10135
  qt as paragraphSpacingRangeConfig,
10137
10136
  Y as sML,
10138
- O as sMLWithRequest,
10137
+ L as sMLWithRequest,
10139
10138
  le as withFallback,
10140
10139
  Kt as wordSpacingRangeConfig,
10141
10140
  Zt as zoomRangeConfig