@readium/navigator 2.5.0 → 2.5.2-beta.1
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/{ReadiumCSS-after-AX2xHXM6.js → ReadiumCSS-after-CPAYSG9F.js} +7 -6
- package/dist/{ReadiumCSS-after-DwG-6hYO.js → ReadiumCSS-after-CVNJvQab.js} +4 -4
- package/dist/{ReadiumCSS-after-Djsq77vV.js → ReadiumCSS-after-Cpw6SSeZ.js} +12 -11
- package/dist/{ReadiumCSS-after-DIfxADJu.js → ReadiumCSS-after-DBPN8It0.js} +4 -4
- package/dist/{ReadiumCSS-before-BA9Irzag.js → ReadiumCSS-before-CA1r4W7i.js} +1 -1
- package/dist/{ReadiumCSS-before-B8zaPxhu.js → ReadiumCSS-before-D5x0zuZP.js} +1 -1
- package/dist/{ReadiumCSS-before-DKjdmFso.js → ReadiumCSS-before-DXNoxSjL.js} +1 -1
- package/dist/{ReadiumCSS-before-Cz5-ynli.js → ReadiumCSS-before-DtkzLMzT.js} +1 -1
- package/dist/{ReadiumCSS-default-BGrBd7Sk.js → ReadiumCSS-default-BMLfH2r9.js} +1 -1
- package/dist/{ReadiumCSS-default-DsgDIxGa.js → ReadiumCSS-default-BTgk8NbH.js} +1 -1
- package/dist/{ReadiumCSS-default-DzJEDDcb.js → ReadiumCSS-default-C7kHIm6s.js} +1 -1
- package/dist/{ReadiumCSS-default-CcWmjgaR.js → ReadiumCSS-default-C_BHdXWz.js} +1 -1
- package/dist/index.js +598 -564
- package/dist/index.umd.cjs +77 -74
- package/package.json +1 -1
- package/src/epub/EpubNavigator.ts +15 -3
- package/src/epub/css/Properties.ts +0 -1
- package/src/webpub/WebPubNavigator.ts +12 -4
- package/types/src/epub/EpubNavigator.d.ts +5 -2
- package/types/src/epub/css/Properties.d.ts +0 -1
- package/types/src/webpub/WebPubNavigator.d.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ const S = class S {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
S.EPUB_A11Y_10_WCAG_20_A = new S("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"), S.EPUB_A11Y_10_WCAG_20_AA = new S("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"), S.EPUB_A11Y_10_WCAG_20_AAA = new S("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"), S.EPUB_A11Y_11_WCAG_20_A = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"), S.EPUB_A11Y_11_WCAG_20_AA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"), S.EPUB_A11Y_11_WCAG_20_AAA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"), S.EPUB_A11Y_11_WCAG_21_A = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"), S.EPUB_A11Y_11_WCAG_21_AA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"), S.EPUB_A11Y_11_WCAG_21_AAA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"), S.EPUB_A11Y_11_WCAG_22_A = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"), S.EPUB_A11Y_11_WCAG_22_AA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"), S.EPUB_A11Y_11_WCAG_22_AAA = new S("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");
|
|
38
|
-
let
|
|
38
|
+
let Ze = S;
|
|
39
39
|
const C = class C {
|
|
40
40
|
constructor(t) {
|
|
41
41
|
this.value = t;
|
|
@@ -55,7 +55,7 @@ const C = class C {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
C.AUDITORY = new C("auditory"), C.CHART_ON_VISUAL = new C("chartOnVisual"), C.CHEM_ON_VISUAL = new C("chemOnVisual"), C.COLOR_DEPENDENT = new C("colorDependent"), C.DIAGRAM_ON_VISUAL = new C("diagramOnVisual"), C.MATH_ON_VISUAL = new C("mathOnVisual"), C.MUSIC_ON_VISUAL = new C("musicOnVisual"), C.TACTILE = new C("tactile"), C.TEXT_ON_VISUAL = new C("textOnVisual"), C.TEXTUAL = new C("textual"), C.VISUAL = new C("visual");
|
|
58
|
-
let
|
|
58
|
+
let Qe = C;
|
|
59
59
|
const D = class D {
|
|
60
60
|
constructor(t) {
|
|
61
61
|
if (typeof t == "string") {
|
|
@@ -91,7 +91,7 @@ const D = class D {
|
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
D.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]), D.AUDITORY = new D("auditory"), D.TACTILE = new D("tactile"), D.TEXTUAL = new D("textual"), D.VISUAL = new D("visual");
|
|
94
|
-
let
|
|
94
|
+
let ti = D;
|
|
95
95
|
const y = class y {
|
|
96
96
|
constructor(t) {
|
|
97
97
|
this.value = t;
|
|
@@ -131,8 +131,8 @@ const L = class L {
|
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
L.FLASHING = new L("flashing"), L.NO_FLASHING_HAZARD = new L("noFlashingHazard"), L.UNKNOWN_FLASHING_HAZARD = new L("unknownFlashingHazard"), L.MOTION_SIMULATION = new L("motionSimulation"), L.NO_MOTION_SIMULATION_HAZARD = new L("noMotionSimulationHazard"), L.UNKNOWN_MOTION_SIMULATION_HAZARD = new L("unknownMotionSimulationHazard"), L.SOUND = new L("sound"), L.NO_SOUND_HAZARD = new L("noSoundHazard"), L.UNKNOWN_SOUND_HAZARD = new L("unknownSoundHazard"), L.UNKNOWN = new L("unknown"), L.NONE = new L("none");
|
|
134
|
-
let
|
|
135
|
-
const
|
|
134
|
+
let ei = L;
|
|
135
|
+
const k = class k {
|
|
136
136
|
constructor(t) {
|
|
137
137
|
this.value = t;
|
|
138
138
|
}
|
|
@@ -141,7 +141,7 @@ const O = class O {
|
|
|
141
141
|
*/
|
|
142
142
|
static deserialize(t) {
|
|
143
143
|
if (!(!t || typeof t != "string"))
|
|
144
|
-
return new
|
|
144
|
+
return new k(t);
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
147
|
* Serializes an [Exemption] to its RWPM JSON representation.
|
|
@@ -150,11 +150,11 @@ const O = class O {
|
|
|
150
150
|
return this.value;
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
|
-
|
|
154
|
-
let
|
|
155
|
-
const ii = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], Ln = /* @__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"}}`), xn = {
|
|
156
|
-
publication:
|
|
157
|
-
},
|
|
153
|
+
k.NONE = new k("none"), k.DOCUMENTED = new k("documented"), k.LEGAL = new k("legal"), k.TEMPORARY = new k("temporary"), k.TECHNICAL = new k("technical"), k.EAA_DISPROPORTIONATE_BURDEN = new k("eaa-disproportionate-burden"), k.EAA_FUNDAMENTAL_ALTERATION = new k("eaa-fundamental-alteration"), k.EAA_MICROENTERPRISE = new k("eaa-microenterprise"), k.EAA_TECHNICAL_IMPOSSIBILITY = new k("eaa-technical-impossibility"), k.EAA_TEMPORARY = new k("eaa-temporary");
|
|
154
|
+
let ii = k;
|
|
155
|
+
const ni = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], xn = /* @__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"}}`), kn = {
|
|
156
|
+
publication: xn
|
|
157
|
+
}, si = {
|
|
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 ii = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], Ln = /* @__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
|
-
},
|
|
168
|
+
}, ri = kn?.publication?.metadata?.accessibility?.["display-guide"] || {};
|
|
169
169
|
class gt {
|
|
170
170
|
constructor() {
|
|
171
|
-
this.currentLocaleCode = "en", this.locale =
|
|
171
|
+
this.currentLocaleCode = "en", this.locale = ri, this.loadedLocales = {}, this.loadedLocales.en = ri;
|
|
172
172
|
}
|
|
173
173
|
static getInstance() {
|
|
174
174
|
return gt.instance || (gt.instance = new gt()), gt.instance;
|
|
@@ -179,14 +179,14 @@ class gt {
|
|
|
179
179
|
* @returns Promise indicating if the locale was loaded successfully
|
|
180
180
|
*/
|
|
181
181
|
async loadLocale(t) {
|
|
182
|
-
if (!
|
|
182
|
+
if (!ni.includes(t))
|
|
183
183
|
return console.warn(`Locale '${t}' is not enabled`), !1;
|
|
184
184
|
if (t in this.loadedLocales)
|
|
185
185
|
return !0;
|
|
186
186
|
try {
|
|
187
|
-
if (!(t in
|
|
187
|
+
if (!(t in si))
|
|
188
188
|
return console.warn(`Locale file not found for: ${t}`), !1;
|
|
189
|
-
const n = (await
|
|
189
|
+
const n = (await si[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;
|
|
@@ -220,7 +220,7 @@ class gt {
|
|
|
220
220
|
* Gets a list of available locale codes
|
|
221
221
|
*/
|
|
222
222
|
getAvailableLocales() {
|
|
223
|
-
return
|
|
223
|
+
return ni;
|
|
224
224
|
}
|
|
225
225
|
getNestedValue(t, e) {
|
|
226
226
|
const i = e.split(".");
|
|
@@ -311,10 +311,10 @@ Object.defineProperty(G.prototype, "encryption", {
|
|
|
311
311
|
function On(r) {
|
|
312
312
|
return r && Array.isArray(r) ? r : void 0;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Gi(r) {
|
|
315
315
|
return r && typeof r == "string" ? [r] : On(r);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function oi(r) {
|
|
318
318
|
return typeof r == "string" ? new Date(r) : void 0;
|
|
319
319
|
}
|
|
320
320
|
function Ut(r) {
|
|
@@ -323,7 +323,7 @@ function Ut(r) {
|
|
|
323
323
|
function V(r) {
|
|
324
324
|
return Ut(r) !== void 0 && Math.sign(r) >= 0 ? r : void 0;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Rn(r) {
|
|
327
327
|
const t = new Array();
|
|
328
328
|
return r.forEach((e) => t.push(e)), t;
|
|
329
329
|
}
|
|
@@ -786,7 +786,7 @@ class m {
|
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
|
-
class
|
|
789
|
+
class ai {
|
|
790
790
|
constructor(t) {
|
|
791
791
|
this.uri = t, this.parameters = this.getParameters(t);
|
|
792
792
|
}
|
|
@@ -836,7 +836,7 @@ class _ {
|
|
|
836
836
|
return Object.entries(t).forEach(([a, l]) => {
|
|
837
837
|
o.has(a) || s.set(a, l);
|
|
838
838
|
}), new _({
|
|
839
|
-
fragments:
|
|
839
|
+
fragments: Gi(t.fragments || t.fragment),
|
|
840
840
|
progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
|
|
841
841
|
totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
|
|
842
842
|
position: n !== void 0 && n > 0 ? n : void 0,
|
|
@@ -941,7 +941,7 @@ class $ {
|
|
|
941
941
|
size: V(t.size),
|
|
942
942
|
duration: V(t.duration),
|
|
943
943
|
bitrate: V(t.bitrate),
|
|
944
|
-
languages:
|
|
944
|
+
languages: Gi(t.language),
|
|
945
945
|
alternates: Ht.deserialize(t.alternate),
|
|
946
946
|
children: Ht.deserialize(t.children)
|
|
947
947
|
});
|
|
@@ -951,7 +951,7 @@ class $ {
|
|
|
951
951
|
*/
|
|
952
952
|
serialize() {
|
|
953
953
|
const t = { href: this.href };
|
|
954
|
-
return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel =
|
|
954
|
+
return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = Rn(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.size !== void 0 && (t.size = this.size), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
|
|
955
955
|
}
|
|
956
956
|
/** MediaType of the linked resource. */
|
|
957
957
|
get mediaType() {
|
|
@@ -968,14 +968,14 @@ class $ {
|
|
|
968
968
|
}
|
|
969
969
|
/** List of URI template parameter keys, if the `Link` is templated. */
|
|
970
970
|
get templateParameters() {
|
|
971
|
-
return this.templated ? new
|
|
971
|
+
return this.templated ? new ai(this.href).parameters : /* @__PURE__ */ new Set();
|
|
972
972
|
}
|
|
973
973
|
/** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
|
|
974
974
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
975
975
|
*/
|
|
976
976
|
expandTemplate(t) {
|
|
977
977
|
return new $({
|
|
978
|
-
href: new
|
|
978
|
+
href: new ai(this.href).expand(t),
|
|
979
979
|
templated: !1
|
|
980
980
|
});
|
|
981
981
|
}
|
|
@@ -1095,7 +1095,7 @@ class Ht {
|
|
|
1095
1095
|
return this.items.filter((t) => t.type);
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
-
var
|
|
1098
|
+
var Yi = /* @__PURE__ */ ((r) => (r.EPUB = "https://readium.org/webpub-manifest/profiles/epub", r.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", r.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", r.PDF = "https://readium.org/webpub-manifest/profiles/pdf", r))(Yi || {}), N = /* @__PURE__ */ ((r) => (r.ltr = "ltr", r.rtl = "rtl", r))(N || {});
|
|
1099
1099
|
G.prototype.getContains = function() {
|
|
1100
1100
|
return new Set(this.otherProperties.contains || []);
|
|
1101
1101
|
};
|
|
@@ -1308,8 +1308,8 @@ class Ue {
|
|
|
1308
1308
|
if (t && t.state)
|
|
1309
1309
|
return new Ue({
|
|
1310
1310
|
state: t.state,
|
|
1311
|
-
since:
|
|
1312
|
-
until:
|
|
1311
|
+
since: oi(t.since),
|
|
1312
|
+
until: oi(t.until)
|
|
1313
1313
|
});
|
|
1314
1314
|
}
|
|
1315
1315
|
/**
|
|
@@ -1343,41 +1343,41 @@ G.prototype.getAvailability = function() {
|
|
|
1343
1343
|
G.prototype.getAuthenticate = function() {
|
|
1344
1344
|
return $.deserialize(this.otherProperties.authenticate);
|
|
1345
1345
|
};
|
|
1346
|
-
const
|
|
1347
|
-
function
|
|
1348
|
-
console.warn(`${
|
|
1346
|
+
const An = "CssSelectorGenerator";
|
|
1347
|
+
function li(r = "unknown problem", ...t) {
|
|
1348
|
+
console.warn(`${An}: ${r}`, ...t);
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function Tn(r) {
|
|
1351
1351
|
return r instanceof RegExp;
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function Mn(r) {
|
|
1354
1354
|
return r.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1356
|
+
function Nn(r) {
|
|
1357
1357
|
const t = r.map((e) => {
|
|
1358
|
-
if (
|
|
1358
|
+
if (Tn(e))
|
|
1359
1359
|
return (i) => e.test(i);
|
|
1360
1360
|
if (typeof e == "function")
|
|
1361
1361
|
return (i) => {
|
|
1362
1362
|
const n = e(i);
|
|
1363
|
-
return typeof n != "boolean" ? (
|
|
1363
|
+
return typeof n != "boolean" ? (li("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
|
|
1364
1364
|
};
|
|
1365
1365
|
if (typeof e == "string") {
|
|
1366
|
-
const i = new RegExp("^" +
|
|
1366
|
+
const i = new RegExp("^" + Mn(e) + "$");
|
|
1367
1367
|
return (n) => i.test(n);
|
|
1368
1368
|
}
|
|
1369
|
-
return
|
|
1369
|
+
return li("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
1370
1370
|
});
|
|
1371
1371
|
return (e) => t.some((i) => i(e));
|
|
1372
1372
|
}
|
|
1373
|
-
|
|
1373
|
+
Nn([
|
|
1374
1374
|
"class",
|
|
1375
1375
|
"id",
|
|
1376
1376
|
// Angular attributes
|
|
1377
1377
|
"ng-*"
|
|
1378
1378
|
]);
|
|
1379
|
-
const
|
|
1380
|
-
class
|
|
1379
|
+
const zn = Math.pow(2, 32), hi = () => Math.round(Math.random() * zn).toString(36), we = () => `${Math.round(performance.now())}-${hi()}-${hi()}`, ft = 1;
|
|
1380
|
+
class In {
|
|
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
|
}
|
|
@@ -1469,15 +1469,15 @@ class zn {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
class Et {
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function ci(r) {
|
|
1473
1473
|
return r.split("").reverse().join("");
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const i =
|
|
1475
|
+
function Dn(r, t, e) {
|
|
1476
|
+
const i = ci(t);
|
|
1477
1477
|
return e.map((n) => {
|
|
1478
|
-
const s = Math.max(0, n.end - t.length - n.errors), o =
|
|
1478
|
+
const s = Math.max(0, n.end - t.length - n.errors), o = ci(r.slice(s, n.end));
|
|
1479
1479
|
return {
|
|
1480
|
-
start:
|
|
1480
|
+
start: qi(o, i, n.errors).reduce((l, h) => n.end - h.end < l ? n.end - h.end : l, n.end),
|
|
1481
1481
|
end: n.end,
|
|
1482
1482
|
errors: n.errors
|
|
1483
1483
|
};
|
|
@@ -1486,14 +1486,14 @@ function In(r, t, e) {
|
|
|
1486
1486
|
function de(r) {
|
|
1487
1487
|
return (r | -r) >> 31 & 1;
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function di(r, t, e, i) {
|
|
1490
1490
|
let n = r.P[e], s = r.M[e];
|
|
1491
1491
|
const o = i >>> 31, a = t[e] | o, l = a | s, h = (a & n) + n ^ n | a;
|
|
1492
1492
|
let c = s | ~(h | n), u = n & h;
|
|
1493
1493
|
const p = de(c & r.lastRowMask[e]) - de(u & r.lastRowMask[e]);
|
|
1494
1494
|
return c <<= 1, u <<= 1, u |= o, c |= de(i) - o, n = u | ~(l | c), s = c & l, r.P[e] = n, r.M[e] = s, p;
|
|
1495
1495
|
}
|
|
1496
|
-
function
|
|
1496
|
+
function qi(r, t, e) {
|
|
1497
1497
|
if (t.length === 0)
|
|
1498
1498
|
return [];
|
|
1499
1499
|
e = Math.min(e, t.length);
|
|
@@ -1535,7 +1535,7 @@ function Yi(r, t, e) {
|
|
|
1535
1535
|
g < h.length ? d = h[g] : (d = l.get(g), typeof d > "u" && (d = a));
|
|
1536
1536
|
let f = 0;
|
|
1537
1537
|
for (let w = 0; w <= c; w += 1)
|
|
1538
|
-
f =
|
|
1538
|
+
f = di(o, d, w, f), u[w] += f;
|
|
1539
1539
|
if (u[c] - f <= e && c < s && (d[c + 1] & 1 || f < 0)) {
|
|
1540
1540
|
c += 1, o.P[c] = -1, o.M[c] = 0;
|
|
1541
1541
|
let w;
|
|
@@ -1544,7 +1544,7 @@ function Yi(r, t, e) {
|
|
|
1544
1544
|
w = P === 0 ? n : P;
|
|
1545
1545
|
} else
|
|
1546
1546
|
w = n;
|
|
1547
|
-
u[c] = u[c - 1] + w - f +
|
|
1547
|
+
u[c] = u[c - 1] + w - f + di(o, d, c, f);
|
|
1548
1548
|
} else
|
|
1549
1549
|
for (; c > 0 && u[c] >= e + n; )
|
|
1550
1550
|
c -= 1;
|
|
@@ -1556,11 +1556,11 @@ function Yi(r, t, e) {
|
|
|
1556
1556
|
}
|
|
1557
1557
|
return i;
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1560
|
-
const i =
|
|
1561
|
-
return
|
|
1559
|
+
function Fn(r, t, e) {
|
|
1560
|
+
const i = qi(r, t, e);
|
|
1561
|
+
return Dn(r, t, i);
|
|
1562
1562
|
}
|
|
1563
|
-
function
|
|
1563
|
+
function Ki(r, t, e) {
|
|
1564
1564
|
let i = 0;
|
|
1565
1565
|
const n = [];
|
|
1566
1566
|
for (; i !== -1; )
|
|
@@ -1569,25 +1569,25 @@ function qi(r, t, e) {
|
|
|
1569
1569
|
end: i + t.length,
|
|
1570
1570
|
errors: 0
|
|
1571
1571
|
}), i += 1);
|
|
1572
|
-
return n.length > 0 ? n :
|
|
1572
|
+
return n.length > 0 ? n : Fn(r, t, e);
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1575
|
-
return t.length === 0 || r.length === 0 ? 0 : 1 -
|
|
1574
|
+
function ui(r, t) {
|
|
1575
|
+
return t.length === 0 || r.length === 0 ? 0 : 1 - Ki(r, t, t.length)[0].errors / t.length;
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function Wn(r, t, e = {}) {
|
|
1578
1578
|
if (t.length === 0)
|
|
1579
1579
|
return null;
|
|
1580
|
-
const i = Math.min(256, t.length / 2), n =
|
|
1580
|
+
const i = Math.min(256, t.length / 2), n = Ki(r, t, i);
|
|
1581
1581
|
if (n.length === 0)
|
|
1582
1582
|
return null;
|
|
1583
1583
|
const s = (a) => {
|
|
1584
|
-
const p = 1 - a.errors / t.length, g = e.prefix ?
|
|
1584
|
+
const p = 1 - a.errors / t.length, g = e.prefix ? ui(
|
|
1585
1585
|
r.slice(
|
|
1586
1586
|
Math.max(0, a.start - e.prefix.length),
|
|
1587
1587
|
a.start
|
|
1588
1588
|
),
|
|
1589
1589
|
e.prefix
|
|
1590
|
-
) : 1, d = e.suffix ?
|
|
1590
|
+
) : 1, d = e.suffix ? ui(
|
|
1591
1591
|
r.slice(a.end, a.end + e.suffix.length),
|
|
1592
1592
|
e.suffix
|
|
1593
1593
|
) : 1;
|
|
@@ -1610,7 +1610,7 @@ function ve(r, t, e) {
|
|
|
1610
1610
|
const o = n.length - s.length;
|
|
1611
1611
|
return e === 2 ? t - o : t + o;
|
|
1612
1612
|
}
|
|
1613
|
-
function
|
|
1613
|
+
function pi(r, t) {
|
|
1614
1614
|
const e = r.commonAncestorContainer.ownerDocument.createNodeIterator(
|
|
1615
1615
|
r.commonAncestorContainer,
|
|
1616
1616
|
NodeFilter.SHOW_TEXT
|
|
@@ -1632,7 +1632,7 @@ function ui(r, t) {
|
|
|
1632
1632
|
return { node: s, offset: o };
|
|
1633
1633
|
throw new RangeError("No text nodes with non-whitespace text found in range");
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Un(r) {
|
|
1636
1636
|
if (!r.toString().trim().length)
|
|
1637
1637
|
throw new RangeError("Range contains no non-whitespace text");
|
|
1638
1638
|
if (r.startContainer.nodeType !== Node.TEXT_NODE)
|
|
@@ -1658,7 +1658,7 @@ function Wn(r) {
|
|
|
1658
1658
|
if (n.start >= 0 && (t.setStart(r.startContainer, n.start), e = !0), n.end > 0 && (t.setEnd(r.endContainer, n.end), i = !0), e && i)
|
|
1659
1659
|
return t;
|
|
1660
1660
|
if (!e) {
|
|
1661
|
-
const { node: s, offset: o } =
|
|
1661
|
+
const { node: s, offset: o } = pi(
|
|
1662
1662
|
t,
|
|
1663
1663
|
1
|
|
1664
1664
|
/* Forwards */
|
|
@@ -1666,7 +1666,7 @@ function Wn(r) {
|
|
|
1666
1666
|
s && o >= 0 && t.setStart(s, o);
|
|
1667
1667
|
}
|
|
1668
1668
|
if (!i) {
|
|
1669
|
-
const { node: s, offset: o } =
|
|
1669
|
+
const { node: s, offset: o } = pi(
|
|
1670
1670
|
t,
|
|
1671
1671
|
2
|
|
1672
1672
|
/* Backwards */
|
|
@@ -1675,7 +1675,7 @@ function Wn(r) {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
return t;
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function Ji(r) {
|
|
1679
1679
|
switch (r.nodeType) {
|
|
1680
1680
|
case Node.ELEMENT_NODE:
|
|
1681
1681
|
case Node.TEXT_NODE:
|
|
@@ -1684,13 +1684,13 @@ function Ki(r) {
|
|
|
1684
1684
|
return 0;
|
|
1685
1685
|
}
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1687
|
+
function fi(r) {
|
|
1688
1688
|
let t = r.previousSibling, e = 0;
|
|
1689
1689
|
for (; t; )
|
|
1690
|
-
e +=
|
|
1690
|
+
e += Ji(t), t = t.previousSibling;
|
|
1691
1691
|
return e;
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function Zi(r, ...t) {
|
|
1694
1694
|
let e = t.shift();
|
|
1695
1695
|
const i = r.ownerDocument.createNodeIterator(
|
|
1696
1696
|
r,
|
|
@@ -1722,7 +1722,7 @@ class K {
|
|
|
1722
1722
|
throw new Error("Parent is not an ancestor of current element");
|
|
1723
1723
|
let e = this.element, i = this.offset;
|
|
1724
1724
|
for (; e !== t; )
|
|
1725
|
-
i +=
|
|
1725
|
+
i += fi(e), e = e.parentElement;
|
|
1726
1726
|
return new K(e, i);
|
|
1727
1727
|
}
|
|
1728
1728
|
/**
|
|
@@ -1744,7 +1744,7 @@ class K {
|
|
|
1744
1744
|
*/
|
|
1745
1745
|
resolve(t = {}) {
|
|
1746
1746
|
try {
|
|
1747
|
-
return
|
|
1747
|
+
return Zi(this.element, this.offset)[0];
|
|
1748
1748
|
} catch (e) {
|
|
1749
1749
|
if (this.offset === 0 && t.direction !== void 0) {
|
|
1750
1750
|
const i = document.createTreeWalker(
|
|
@@ -1787,7 +1787,7 @@ class K {
|
|
|
1787
1787
|
throw new Error("Text node offset is out of range");
|
|
1788
1788
|
if (!t.parentElement)
|
|
1789
1789
|
throw new Error("Text node has no parent");
|
|
1790
|
-
const i =
|
|
1790
|
+
const i = fi(t) + e;
|
|
1791
1791
|
return new K(t.parentElement, i);
|
|
1792
1792
|
}
|
|
1793
1793
|
case Node.ELEMENT_NODE: {
|
|
@@ -1795,7 +1795,7 @@ class K {
|
|
|
1795
1795
|
throw new Error("Child node offset is out of range");
|
|
1796
1796
|
let i = 0;
|
|
1797
1797
|
for (let n = 0; n < e; n++)
|
|
1798
|
-
i +=
|
|
1798
|
+
i += Ji(t.childNodes[n]);
|
|
1799
1799
|
return new K(t, i);
|
|
1800
1800
|
}
|
|
1801
1801
|
default:
|
|
@@ -1829,7 +1829,7 @@ class et {
|
|
|
1829
1829
|
*/
|
|
1830
1830
|
toRange() {
|
|
1831
1831
|
let t, e;
|
|
1832
|
-
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] =
|
|
1832
|
+
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = Zi(
|
|
1833
1833
|
this.start.element,
|
|
1834
1834
|
this.start.offset,
|
|
1835
1835
|
this.end.offset
|
|
@@ -1868,7 +1868,7 @@ class et {
|
|
|
1868
1868
|
* whitespace
|
|
1869
1869
|
*/
|
|
1870
1870
|
static trimmedRange(t) {
|
|
1871
|
-
return
|
|
1871
|
+
return Un(et.fromRange(t).toRange());
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
1874
|
class jt {
|
|
@@ -1932,7 +1932,7 @@ class $t {
|
|
|
1932
1932
|
return this.toPositionAnchor(t).toRange();
|
|
1933
1933
|
}
|
|
1934
1934
|
toPositionAnchor(t = {}) {
|
|
1935
|
-
const e = this.root.textContent, i =
|
|
1935
|
+
const e = this.root.textContent, i = Wn(e, this.exact, {
|
|
1936
1936
|
...this.context,
|
|
1937
1937
|
hint: t.hint
|
|
1938
1938
|
});
|
|
@@ -1941,7 +1941,7 @@ class $t {
|
|
|
1941
1941
|
return new jt(this.root, i.start, i.end);
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
1944
|
-
function
|
|
1944
|
+
function Bn(r) {
|
|
1945
1945
|
const t = r.tagName.toUpperCase();
|
|
1946
1946
|
return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
|
|
1947
1947
|
}
|
|
@@ -1970,7 +1970,7 @@ function It(r, t) {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
if (n) {
|
|
1972
1972
|
const s = r.createRange();
|
|
1973
|
-
return n.childNodes.length === 0 ||
|
|
1973
|
+
return n.childNodes.length === 0 || Bn(n) ? (s.selectNode(n), s) : (s.setStartBefore(n), s.setEndAfter(n), s);
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
1976
|
} catch (e) {
|
|
@@ -1978,7 +1978,7 @@ function It(r, t) {
|
|
|
1978
1978
|
}
|
|
1979
1979
|
return null;
|
|
1980
1980
|
}
|
|
1981
|
-
function
|
|
1981
|
+
function Hn(r, t) {
|
|
1982
1982
|
let e = r.getClientRects();
|
|
1983
1983
|
e.length || r.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = r.commonAncestorContainer.getClientRects());
|
|
1984
1984
|
const i = 1, n = [];
|
|
@@ -1991,10 +1991,10 @@ function Bn(r, t) {
|
|
|
1991
1991
|
top: h.top,
|
|
1992
1992
|
width: h.width
|
|
1993
1993
|
});
|
|
1994
|
-
const s =
|
|
1994
|
+
const s = Qi(
|
|
1995
1995
|
n,
|
|
1996
1996
|
i
|
|
1997
|
-
), o =
|
|
1997
|
+
), o = jn(s, i), a = tn(o), l = 4;
|
|
1998
1998
|
for (let h = a.length - 1; h >= 0; h--) {
|
|
1999
1999
|
const c = a[h];
|
|
2000
2000
|
if (!(c.width * c.height > l))
|
|
@@ -2005,16 +2005,16 @@ function Bn(r, t) {
|
|
|
2005
2005
|
}
|
|
2006
2006
|
return a;
|
|
2007
2007
|
}
|
|
2008
|
-
function
|
|
2008
|
+
function Qi(r, t, e) {
|
|
2009
2009
|
for (let i = 0; i < r.length; i++)
|
|
2010
2010
|
for (let n = i + 1; n < r.length; n++) {
|
|
2011
2011
|
const s = r[i], o = r[n];
|
|
2012
2012
|
if (s === o)
|
|
2013
2013
|
continue;
|
|
2014
2014
|
const a = j(s.top, o.top, t) && j(s.bottom, o.bottom, t), l = j(s.left, o.left, t) && j(s.right, o.right, t);
|
|
2015
|
-
if (a && !l &&
|
|
2016
|
-
const u = r.filter((g) => g !== s && g !== o), p =
|
|
2017
|
-
return u.push(p),
|
|
2015
|
+
if (a && !l && en(s, o, t)) {
|
|
2016
|
+
const u = r.filter((g) => g !== s && g !== o), p = Vn(s, o);
|
|
2017
|
+
return u.push(p), Qi(
|
|
2018
2018
|
u,
|
|
2019
2019
|
t
|
|
2020
2020
|
);
|
|
@@ -2022,7 +2022,7 @@ function Zi(r, t, e) {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
return r;
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2025
|
+
function Vn(r, t) {
|
|
2026
2026
|
const e = Math.min(r.left, t.left), i = Math.max(r.right, t.right), n = Math.min(r.top, t.top), s = Math.max(r.bottom, t.bottom);
|
|
2027
2027
|
return {
|
|
2028
2028
|
bottom: s,
|
|
@@ -2033,7 +2033,7 @@ function Hn(r, t) {
|
|
|
2033
2033
|
width: i - e
|
|
2034
2034
|
};
|
|
2035
2035
|
}
|
|
2036
|
-
function
|
|
2036
|
+
function jn(r, t) {
|
|
2037
2037
|
const e = new Set(r);
|
|
2038
2038
|
for (const i of r) {
|
|
2039
2039
|
if (!(i.width > 1 && i.height > 1)) {
|
|
@@ -2041,40 +2041,40 @@ function Vn(r, t) {
|
|
|
2041
2041
|
continue;
|
|
2042
2042
|
}
|
|
2043
2043
|
for (const s of r)
|
|
2044
|
-
if (i !== s && e.has(s) &&
|
|
2044
|
+
if (i !== s && e.has(s) && $n(s, i, t)) {
|
|
2045
2045
|
e.delete(i);
|
|
2046
2046
|
break;
|
|
2047
2047
|
}
|
|
2048
2048
|
}
|
|
2049
2049
|
return Array.from(e);
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2051
|
+
function $n(r, t, e) {
|
|
2052
2052
|
return Dt(r, t.left, t.top, e) && Dt(r, t.right, t.top, e) && Dt(r, t.left, t.bottom, e) && Dt(r, t.right, t.bottom, e);
|
|
2053
2053
|
}
|
|
2054
2054
|
function Dt(r, t, e, i) {
|
|
2055
2055
|
return (r.left < t || j(r.left, t, i)) && (r.right > t || j(r.right, t, i)) && (r.top < e || j(r.top, e, i)) && (r.bottom > e || j(r.bottom, e, i));
|
|
2056
2056
|
}
|
|
2057
|
-
function
|
|
2057
|
+
function tn(r) {
|
|
2058
2058
|
for (let t = 0; t < r.length; t++)
|
|
2059
2059
|
for (let e = t + 1; e < r.length; e++) {
|
|
2060
2060
|
const i = r[t], n = r[e];
|
|
2061
|
-
if (i !== n &&
|
|
2061
|
+
if (i !== n && en(i, n, -1)) {
|
|
2062
2062
|
let s = [], o;
|
|
2063
|
-
const a =
|
|
2063
|
+
const a = mi(i, n);
|
|
2064
2064
|
if (a.length === 1)
|
|
2065
2065
|
s = a, o = i;
|
|
2066
2066
|
else {
|
|
2067
|
-
const h =
|
|
2067
|
+
const h = mi(n, i);
|
|
2068
2068
|
a.length < h.length ? (s = a, o = i) : (s = h, o = n);
|
|
2069
2069
|
}
|
|
2070
2070
|
const l = r.filter((h) => h !== o);
|
|
2071
|
-
return Array.prototype.push.apply(l, s),
|
|
2071
|
+
return Array.prototype.push.apply(l, s), tn(l);
|
|
2072
2072
|
}
|
|
2073
2073
|
}
|
|
2074
2074
|
return r;
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2077
|
-
const e =
|
|
2076
|
+
function mi(r, t) {
|
|
2077
|
+
const e = Xn(t, r);
|
|
2078
2078
|
if (e.height === 0 || e.width === 0)
|
|
2079
2079
|
return [r];
|
|
2080
2080
|
const i = [];
|
|
@@ -2124,7 +2124,7 @@ function fi(r, t) {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
return i;
|
|
2126
2126
|
}
|
|
2127
|
-
function
|
|
2127
|
+
function Xn(r, t) {
|
|
2128
2128
|
const e = Math.max(r.left, t.left), i = Math.min(r.right, t.right), n = Math.max(r.top, t.top), s = Math.min(r.bottom, t.bottom);
|
|
2129
2129
|
return {
|
|
2130
2130
|
bottom: s,
|
|
@@ -2135,7 +2135,7 @@ function $n(r, t) {
|
|
|
2135
2135
|
width: Math.max(0, i - e)
|
|
2136
2136
|
};
|
|
2137
2137
|
}
|
|
2138
|
-
function
|
|
2138
|
+
function en(r, t, e) {
|
|
2139
2139
|
return (r.left < t.right || e >= 0 && j(r.left, t.right, e)) && (t.left < r.right || e >= 0 && j(t.left, r.right, e)) && (r.top < t.bottom || e >= 0 && j(r.top, t.bottom, e)) && (t.top < r.bottom || e >= 0 && j(t.top, r.bottom, e));
|
|
2140
2140
|
}
|
|
2141
2141
|
function j(r, t, e) {
|
|
@@ -2147,7 +2147,7 @@ function Be(r) {
|
|
|
2147
2147
|
Object.hasOwn(e, i) && !Number.isNaN(Number.parseInt(i)) && (t[e[i]] = e.getPropertyValue(e[i]));
|
|
2148
2148
|
return t;
|
|
2149
2149
|
}
|
|
2150
|
-
function
|
|
2150
|
+
function nn(r, t) {
|
|
2151
2151
|
const e = Be(r);
|
|
2152
2152
|
Object.keys(e).forEach((i) => {
|
|
2153
2153
|
t.hasOwnProperty(i) || re(r, i);
|
|
@@ -2165,7 +2165,7 @@ function re(r, t) {
|
|
|
2165
2165
|
r.document.documentElement.style.removeProperty(t);
|
|
2166
2166
|
}
|
|
2167
2167
|
let Ft = null, pe = null, _t = 0;
|
|
2168
|
-
const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(),
|
|
2168
|
+
const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Gn = () => {
|
|
2169
2169
|
if (!Ft)
|
|
2170
2170
|
if (typeof OffscreenCanvas < "u")
|
|
2171
2171
|
Ft = new OffscreenCanvas(5, 5), pe = Ft.getContext("2d", {
|
|
@@ -2180,7 +2180,7 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Xn
|
|
|
2180
2180
|
});
|
|
2181
2181
|
}
|
|
2182
2182
|
return pe;
|
|
2183
|
-
},
|
|
2183
|
+
}, Yn = (r) => {
|
|
2184
2184
|
if (!r) return !0;
|
|
2185
2185
|
const t = r.trim().toLowerCase();
|
|
2186
2186
|
return t.startsWith("var(") || [
|
|
@@ -2207,9 +2207,9 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Xn
|
|
|
2207
2207
|
const e = t ? `${r}|${t}` : r, i = ct.get(e);
|
|
2208
2208
|
if (i !== void 0)
|
|
2209
2209
|
return i ?? mt;
|
|
2210
|
-
if (
|
|
2210
|
+
if (Yn(r))
|
|
2211
2211
|
return Wt(r, "Unsupported color format or special value."), ct.set(e, null), mt;
|
|
2212
|
-
const n =
|
|
2212
|
+
const n = Gn();
|
|
2213
2213
|
if (!n)
|
|
2214
2214
|
return Wt(r, "Could not get canvas context."), ct.set(e, null), mt;
|
|
2215
2215
|
try {
|
|
@@ -2229,24 +2229,24 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Xn
|
|
|
2229
2229
|
}, fe = (r) => {
|
|
2230
2230
|
const t = r / 255;
|
|
2231
2231
|
return t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
|
|
2232
|
-
},
|
|
2232
|
+
}, gi = (r) => {
|
|
2233
2233
|
const t = fe(r.r), e = fe(r.g), i = fe(r.b);
|
|
2234
2234
|
return 0.2126 * t + 0.7152 * e + 0.0722 * i;
|
|
2235
|
-
},
|
|
2236
|
-
const e = typeof r == "string" ? Se(r) : r, i = typeof t == "string" ? Se(t) : t, n =
|
|
2235
|
+
}, yi = (r, t) => {
|
|
2236
|
+
const e = typeof r == "string" ? Se(r) : r, i = typeof t == "string" ? Se(t) : t, n = gi(e), s = gi(i), o = Math.max(n, s), a = Math.min(n, s);
|
|
2237
2237
|
return (o + 0.05) / (a + 0.05);
|
|
2238
2238
|
}, Pe = (r, t = null) => {
|
|
2239
|
-
const e = Se(r, t), i =
|
|
2239
|
+
const e = Se(r, t), i = yi(e, { r: 255, g: 255, b: 255, a: 1 }), n = yi(e, { r: 0, g: 0, b: 0, a: 1 });
|
|
2240
2240
|
return i > n;
|
|
2241
|
-
},
|
|
2242
|
-
class
|
|
2241
|
+
}, qn = (r, t = null) => Pe(r, t) ? "white" : "black", bi = "#FFFF00", Kn = () => "Highlight" in window, wi = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
2242
|
+
class Jn {
|
|
2243
2243
|
/**
|
|
2244
2244
|
* Creates a DecorationGroup object
|
|
2245
2245
|
* @param id Unique HTML ID-adhering name of the group
|
|
2246
2246
|
* @param name Human-readable name of the group
|
|
2247
2247
|
*/
|
|
2248
2248
|
constructor(t, e, i, n) {
|
|
2249
|
-
this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0,
|
|
2249
|
+
this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Kn() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
|
|
2250
2250
|
}
|
|
2251
2251
|
get activeable() {
|
|
2252
2252
|
return this.activateable;
|
|
@@ -2265,7 +2265,7 @@ class Kn {
|
|
|
2265
2265
|
return;
|
|
2266
2266
|
}
|
|
2267
2267
|
const n = i.commonAncestorContainer;
|
|
2268
|
-
n.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (
|
|
2268
|
+
n.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (wi.includes(n.nodeName.toUpperCase()) && this.notTextFlag?.set(e, !0), i.cloneContents().querySelector(wi.join(", ").toLowerCase()) && this.notTextFlag?.set(e, !0), (n.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(e, !0));
|
|
2269
2269
|
const s = {
|
|
2270
2270
|
decoration: t,
|
|
2271
2271
|
id: e,
|
|
@@ -2306,10 +2306,10 @@ class Kn {
|
|
|
2306
2306
|
experimentalLayout(t) {
|
|
2307
2307
|
const [e, i] = this.requireContainer(!0);
|
|
2308
2308
|
i.add(t.range);
|
|
2309
|
-
const n = ue(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), s = t.decoration?.style?.tint ??
|
|
2309
|
+
const n = ue(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), s = t.decoration?.style?.tint ?? bi;
|
|
2310
2310
|
e.innerHTML = `
|
|
2311
2311
|
::highlight(${this.id}) {
|
|
2312
|
-
color: ${
|
|
2312
|
+
color: ${qn(s, n)};
|
|
2313
2313
|
background-color: ${s};
|
|
2314
2314
|
}`;
|
|
2315
2315
|
}
|
|
@@ -2347,7 +2347,7 @@ class Kn {
|
|
|
2347
2347
|
data-readium="true"
|
|
2348
2348
|
class="readium-highlight"
|
|
2349
2349
|
style="${[
|
|
2350
|
-
`background-color: ${t.decoration?.style?.tint ??
|
|
2350
|
+
`background-color: ${t.decoration?.style?.tint ?? bi} !important`,
|
|
2351
2351
|
//"opacity: 0.3 !important",
|
|
2352
2352
|
`mix-blend-mode: ${p ? "exclusion" : "multiply"} !important`,
|
|
2353
2353
|
"opacity: 1 !important",
|
|
@@ -2361,7 +2361,7 @@ class Kn {
|
|
|
2361
2361
|
const d = g.cloneNode(!0);
|
|
2362
2362
|
d.style.setProperty("pointer-events", "none"), h(d, c, c), e.append(d);
|
|
2363
2363
|
} else {
|
|
2364
|
-
let d =
|
|
2364
|
+
let d = Hn(
|
|
2365
2365
|
t.range
|
|
2366
2366
|
);
|
|
2367
2367
|
d = d.sort((f, w) => f.top < w.top ? -1 : f.top > w.top ? 1 : 0);
|
|
@@ -2403,7 +2403,7 @@ class Kn {
|
|
|
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
|
|
2406
|
+
const Ot = class Ot extends Et {
|
|
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,9 +2428,9 @@ const kt = class kt extends Et {
|
|
|
2428
2428
|
}, 50);
|
|
2429
2429
|
}
|
|
2430
2430
|
mount(t, e) {
|
|
2431
|
-
return this.wnd = t, e.register("decorate",
|
|
2431
|
+
return this.wnd = t, e.register("decorate", Ot.moduleName, (i, n) => {
|
|
2432
2432
|
const s = i;
|
|
2433
|
-
s.decoration && s.decoration.locator && (s.decoration.locator = I.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new
|
|
2433
|
+
s.decoration && s.decoration.locator && (s.decoration.locator = I.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new Jn(
|
|
2434
2434
|
t,
|
|
2435
2435
|
e,
|
|
2436
2436
|
`readium-decoration-${this.lastGroupId++}`,
|
|
@@ -2468,12 +2468,12 @@ const kt = class kt extends Et {
|
|
|
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(
|
|
2471
|
+
return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(Ot.moduleName), this.resizeObserver.disconnect(), this.backgroundObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
|
|
2472
2472
|
}
|
|
2473
2473
|
};
|
|
2474
|
-
|
|
2475
|
-
let Ee =
|
|
2476
|
-
const
|
|
2474
|
+
Ot.moduleName = "decorator";
|
|
2475
|
+
let Ee = Ot;
|
|
2476
|
+
const vi = "readium-snapper-style", Rt = class Rt extends Et {
|
|
2477
2477
|
constructor() {
|
|
2478
2478
|
super(...arguments), this.protected = !1;
|
|
2479
2479
|
}
|
|
@@ -2486,37 +2486,37 @@ const wi = "readium-snapper-style", Rt = class Rt extends Et {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
mount(t, e) {
|
|
2488
2488
|
const i = t.document.createElement("style");
|
|
2489
|
-
return i.dataset.readium = "true", i.id =
|
|
2489
|
+
return i.dataset.readium = "true", i.id = vi, i.textContent = this.buildStyles(), t.document.head.appendChild(i), e.register("protect", Rt.moduleName, (n, s) => {
|
|
2490
2490
|
this.protected = !0, i.textContent = this.buildStyles(), s(!0);
|
|
2491
2491
|
}), e.register("unprotect", Rt.moduleName, (n, s) => {
|
|
2492
2492
|
this.protected = !1, i.textContent = this.buildStyles(), s(!0);
|
|
2493
2493
|
}), e.log("Snapper Mounted"), !0;
|
|
2494
2494
|
}
|
|
2495
2495
|
unmount(t, e) {
|
|
2496
|
-
return t.document.getElementById(
|
|
2496
|
+
return t.document.getElementById(vi)?.remove(), e.log("Snapper Unmounted"), !0;
|
|
2497
2497
|
}
|
|
2498
2498
|
};
|
|
2499
2499
|
Rt.moduleName = "snapper";
|
|
2500
2500
|
let St = Rt;
|
|
2501
|
-
function
|
|
2501
|
+
function Zn(r) {
|
|
2502
2502
|
return (r.document.documentElement.dir || r.document.body.dir).toLowerCase() === "rtl";
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function Qn(r) {
|
|
2505
2505
|
return (r.getComputedStyle(r.document.documentElement).writingMode || r.getComputedStyle(r.document.body).writingMode) === "vertical-lr";
|
|
2506
2506
|
}
|
|
2507
|
-
function
|
|
2507
|
+
function sn(r) {
|
|
2508
2508
|
return parseInt(
|
|
2509
2509
|
r.getComputedStyle(
|
|
2510
2510
|
r.document.documentElement
|
|
2511
2511
|
).getPropertyValue("column-count")
|
|
2512
2512
|
);
|
|
2513
2513
|
}
|
|
2514
|
-
function
|
|
2514
|
+
function Si(r) {
|
|
2515
2515
|
const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
|
|
2516
2516
|
return r.clientHeight - e - i;
|
|
2517
2517
|
}
|
|
2518
|
-
function
|
|
2519
|
-
const t =
|
|
2518
|
+
function Pi(r) {
|
|
2519
|
+
const t = sn(r);
|
|
2520
2520
|
if (!t)
|
|
2521
2521
|
return !1;
|
|
2522
2522
|
const e = r.document.querySelectorAll("div[id^='readium-virtual-page']");
|
|
@@ -2526,7 +2526,7 @@ function Si(r) {
|
|
|
2526
2526
|
if (l > 0)
|
|
2527
2527
|
for (let h = 0; h < l; h++) {
|
|
2528
2528
|
const c = r.document.createElement("div");
|
|
2529
|
-
c.setAttribute("id", `readium-virtual-page-${h}`), c.dataset.readium = "true", CSS.supports("break-before", "column") ? c.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (c.style.breakInside = "avoid-column"), c.style.height =
|
|
2529
|
+
c.setAttribute("id", `readium-virtual-page-${h}`), c.dataset.readium = "true", CSS.supports("break-before", "column") ? c.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (c.style.breakInside = "avoid-column"), c.style.height = Si(r.document.documentElement) + "px"), c.innerHTML = "​", r.document.body.appendChild(c);
|
|
2530
2530
|
}
|
|
2531
2531
|
return i !== l;
|
|
2532
2532
|
}
|
|
@@ -2534,15 +2534,16 @@ function He(r) {
|
|
|
2534
2534
|
const t = r.document.createElement("style");
|
|
2535
2535
|
t.appendChild(r.document.createTextNode("*{}")), r.document.body.appendChild(t), r.document.body.removeChild(t);
|
|
2536
2536
|
}
|
|
2537
|
-
function
|
|
2537
|
+
function ts(r) {
|
|
2538
2538
|
return r < 0.5 ? 2 * r * r : -1 + (4 - 2 * r) * r;
|
|
2539
2539
|
}
|
|
2540
|
-
function
|
|
2540
|
+
function O(r) {
|
|
2541
2541
|
const t = r.getSelection();
|
|
2542
2542
|
t && t.removeAllRanges();
|
|
2543
2543
|
}
|
|
2544
|
-
const
|
|
2544
|
+
const es = [
|
|
2545
2545
|
"a",
|
|
2546
|
+
"area",
|
|
2546
2547
|
"audio",
|
|
2547
2548
|
"button",
|
|
2548
2549
|
"canvas",
|
|
@@ -2554,12 +2555,18 @@ const ts = [
|
|
|
2554
2555
|
"submit",
|
|
2555
2556
|
"textarea",
|
|
2556
2557
|
"video"
|
|
2557
|
-
];
|
|
2558
|
-
function
|
|
2559
|
-
return
|
|
2558
|
+
], is = ["dialog", "radiogroup", "radio", "menu", "menuitem"];
|
|
2559
|
+
function Ve(r) {
|
|
2560
|
+
return ns(r) ? null : rn(r) ? r : r.parentElement ? Ve(r.parentElement) : null;
|
|
2561
|
+
}
|
|
2562
|
+
function ns(r) {
|
|
2563
|
+
return r ? r.closest("[inert]") !== null || r.hasAttribute("disabled") : !0;
|
|
2564
|
+
}
|
|
2565
|
+
function rn(r) {
|
|
2566
|
+
return r ? r.role && is.includes(r.role) || r.tabIndex >= 0 ? !0 : es.includes(r.nodeName.toLowerCase()) || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" : !1;
|
|
2560
2567
|
}
|
|
2561
2568
|
function oe(r, t) {
|
|
2562
|
-
const e =
|
|
2569
|
+
const e = on(r, r.document.body, t), i = r._readium_cssSelectorGenerator.getCssSelector(e, {
|
|
2563
2570
|
selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
|
|
2564
2571
|
});
|
|
2565
2572
|
return new I({
|
|
@@ -2575,15 +2582,15 @@ function oe(r, t) {
|
|
|
2575
2582
|
})
|
|
2576
2583
|
});
|
|
2577
2584
|
}
|
|
2578
|
-
function
|
|
2585
|
+
function on(r, t, e) {
|
|
2579
2586
|
for (var i = 0; i < t.children.length; i++) {
|
|
2580
2587
|
const n = t.children[i];
|
|
2581
|
-
if (!
|
|
2582
|
-
return
|
|
2588
|
+
if (!os(n) && ss(r, n, e))
|
|
2589
|
+
return rs(r, n) ? n : on(r, n, e);
|
|
2583
2590
|
}
|
|
2584
2591
|
return t;
|
|
2585
2592
|
}
|
|
2586
|
-
function
|
|
2593
|
+
function ss(r, t, e) {
|
|
2587
2594
|
if (t === document.body || t === document.documentElement)
|
|
2588
2595
|
return !0;
|
|
2589
2596
|
if (!document || !document.documentElement || !document.body)
|
|
@@ -2591,11 +2598,11 @@ function es(r, t, e) {
|
|
|
2591
2598
|
const i = t.getBoundingClientRect();
|
|
2592
2599
|
return e ? i.bottom > 0 && i.top < r.innerHeight : i.right > 0 && i.left < r.innerWidth;
|
|
2593
2600
|
}
|
|
2594
|
-
function
|
|
2601
|
+
function rs(r, t) {
|
|
2595
2602
|
const e = t.getBoundingClientRect();
|
|
2596
2603
|
return e.top >= 0 && e.left >= 0 && e.bottom <= r.innerHeight && e.right <= r.innerWidth;
|
|
2597
2604
|
}
|
|
2598
|
-
function
|
|
2605
|
+
function os(r) {
|
|
2599
2606
|
const t = getComputedStyle(r);
|
|
2600
2607
|
if (t) {
|
|
2601
2608
|
const e = t.getPropertyValue("display");
|
|
@@ -2604,7 +2611,7 @@ function ns(r) {
|
|
|
2604
2611
|
}
|
|
2605
2612
|
return !1;
|
|
2606
2613
|
}
|
|
2607
|
-
const
|
|
2614
|
+
const as = {
|
|
2608
2615
|
maxVelocity: 200,
|
|
2609
2616
|
// Reasonable default for human-like scrolling (pixels/ms)
|
|
2610
2617
|
minVariance: 0.01,
|
|
@@ -2615,7 +2622,7 @@ const ss = {
|
|
|
2615
2622
|
// Reasonable default for detecting patterns
|
|
2616
2623
|
maxConsistentScrolls: 15
|
|
2617
2624
|
// Balanced threshold for flagging
|
|
2618
|
-
},
|
|
2625
|
+
}, je = {
|
|
2619
2626
|
maxVelocity: 200,
|
|
2620
2627
|
// Extremely fast scrolling (pixels/ms)
|
|
2621
2628
|
minVariance: 1e-5,
|
|
@@ -2626,11 +2633,11 @@ const ss = {
|
|
|
2626
2633
|
// Only trigger on near-perfect patterns
|
|
2627
2634
|
maxConsistentScrolls: 20
|
|
2628
2635
|
// Need many consistent scrolls
|
|
2629
|
-
},
|
|
2636
|
+
}, an = {
|
|
2630
2637
|
maxSelectionsPerSecond: 500,
|
|
2631
2638
|
minVariance: 50,
|
|
2632
2639
|
historySize: 20
|
|
2633
|
-
},
|
|
2640
|
+
}, ls = {
|
|
2634
2641
|
enabled: !0,
|
|
2635
2642
|
maxSelectionPercent: 0.1,
|
|
2636
2643
|
minThreshold: 100,
|
|
@@ -2639,7 +2646,7 @@ const ss = {
|
|
|
2639
2646
|
};
|
|
2640
2647
|
class ae {
|
|
2641
2648
|
constructor(t = {}) {
|
|
2642
|
-
this.history = [], this.consistentScrollCount = 0, this.options = { ...
|
|
2649
|
+
this.history = [], this.consistentScrollCount = 0, this.options = { ...as, ...t };
|
|
2643
2650
|
}
|
|
2644
2651
|
analyze(t, e, i) {
|
|
2645
2652
|
if (i <= 0) return !1;
|
|
@@ -2670,7 +2677,7 @@ class ae {
|
|
|
2670
2677
|
this.history = [], this.consistentScrollCount = 0;
|
|
2671
2678
|
}
|
|
2672
2679
|
}
|
|
2673
|
-
const
|
|
2680
|
+
const Ei = "readium-column-snapper-style", hs = 200, F = class F extends St {
|
|
2674
2681
|
constructor() {
|
|
2675
2682
|
super(...arguments), this.isSnapProtectionEnabled = !1, this.patternAnalyzer = null, this.lastTurnTime = 0, this.rtl = !1, 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);
|
|
2676
2683
|
}
|
|
@@ -2726,10 +2733,10 @@ const Pi = "readium-column-snapper-style", os = 200, F = class F extends St {
|
|
|
2726
2733
|
}
|
|
2727
2734
|
// Snaps the current offset to the page width.
|
|
2728
2735
|
snapCurrentOffset(t = !1, e = !1) {
|
|
2729
|
-
const i = this.doc(), n =
|
|
2736
|
+
const i = this.doc(), n = sn(this.wnd), s = this.cachedScrollWidth - this.wnd.innerWidth, o = Math.min(Math.max(0, this.normScroll()), s), a = this.dragOffset(), l = this.rtl ? -a : a, h = this.wnd.innerWidth / 3 * (l > 0 ? 2 : 1), c = Math.min(s, Math.max(0, this.snapNormOffset(o + h))), u = this.rtl ? -c : c, p = this.rtl ? -o : o, g = u > p ? "right" : "left";
|
|
2730
2737
|
if (this.checkSuspiciousSnap(g, Math.abs(u - p)), t && u !== p) {
|
|
2731
2738
|
this.snappingCancelled = !1;
|
|
2732
|
-
const d = (R, Y, lt, ht) => lt > ht ? Y : R + (Y - R) *
|
|
2739
|
+
const d = (R, Y, lt, ht) => lt > ht ? Y : R + (Y - R) * ts(lt / ht), f = hs * n;
|
|
2733
2740
|
let w;
|
|
2734
2741
|
const P = (R) => {
|
|
2735
2742
|
if (this.snappingCancelled) return;
|
|
@@ -2775,7 +2782,7 @@ const Pi = "readium-column-snapper-style", os = 200, F = class F extends St {
|
|
|
2775
2782
|
}
|
|
2776
2783
|
onTouchMove(t) {
|
|
2777
2784
|
if (this.touchState === 0) return;
|
|
2778
|
-
this.touchState === 1 && (this.touchState = 2,
|
|
2785
|
+
this.touchState === 1 && (this.touchState = 2, O(this.wnd)), this.endingX = t.touches[0].clientX;
|
|
2779
2786
|
const e = this.dragOffset(), i = this.alreadyScrollLeft + e, n = this.rtl ? -(this.cachedScrollWidth - this.wnd.innerWidth) : 0, s = this.rtl ? 0 : this.cachedScrollWidth - this.wnd.innerWidth;
|
|
2780
2787
|
i < n ? (this.overscroll = i, this.doc().style.transform = `translate3d(${-this.overscroll}px, 0px, 0px)`) : i > s ? (this.overscroll = i, this.doc().style.transform = `translate3d(${-i}px, 0px, 0px)`) : (this.overscroll = 0, this.doc().style.removeProperty("transform"), this.doc().scrollLeft = i);
|
|
2781
2788
|
}
|
|
@@ -2803,10 +2810,10 @@ const Pi = "readium-column-snapper-style", os = 200, F = class F extends St {
|
|
|
2803
2810
|
});
|
|
2804
2811
|
}
|
|
2805
2812
|
mount(t, e) {
|
|
2806
|
-
if (this.wnd = t, this.comms = e, this.rtl =
|
|
2813
|
+
if (this.wnd = t, this.comms = e, this.rtl = Zn(t), !super.mount(t, e)) return !1;
|
|
2807
2814
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
2808
2815
|
const i = t.document.createElement("style");
|
|
2809
|
-
i.dataset.readium = "true", i.id =
|
|
2816
|
+
i.dataset.readium = "true", i.id = Ei, i.textContent = `
|
|
2810
2817
|
@keyframes readium-bounce-l-animation {
|
|
2811
2818
|
0%, 100% {transform: translate3d(0, 0, 0);}
|
|
2812
2819
|
50% {transform: translate3d(-50px, 0, 0);}
|
|
@@ -2842,14 +2849,14 @@ const Pi = "readium-column-snapper-style", os = 200, F = class F extends St {
|
|
|
2842
2849
|
}
|
|
2843
2850
|
`, t.document.head.appendChild(i), this.resizeObserver = new ResizeObserver(() => {
|
|
2844
2851
|
t.requestAnimationFrame(() => {
|
|
2845
|
-
t &&
|
|
2852
|
+
t && Pi(t);
|
|
2846
2853
|
}), this.onWidthChange();
|
|
2847
2854
|
}), this.resizeObserver.observe(t.document.body), this.mutationObserver = new MutationObserver((o) => {
|
|
2848
2855
|
for (const a of o)
|
|
2849
2856
|
if (a.target === this.wnd.document.documentElement) {
|
|
2850
2857
|
const l = a.oldValue, h = a.target.getAttribute("style"), c = /transform\s*:\s*([^;]+)/, u = l?.match(c), p = h?.match(c);
|
|
2851
2858
|
(!u && !p || u && !p || u && p && u[1] !== p[1]) && (t.requestAnimationFrame(() => {
|
|
2852
|
-
t &&
|
|
2859
|
+
t && Pi(t);
|
|
2853
2860
|
}), this.onWidthChange());
|
|
2854
2861
|
} else
|
|
2855
2862
|
t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth);
|
|
@@ -2874,7 +2881,7 @@ const Pi = "readium-column-snapper-style", os = 200, F = class F extends St {
|
|
|
2874
2881
|
this.wnd.requestAnimationFrame(() => {
|
|
2875
2882
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2876
2883
|
const c = (this.cachedScrollWidth - t.innerWidth) * l;
|
|
2877
|
-
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c) : this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(),
|
|
2884
|
+
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c) : this.doc().scrollLeft = this.snapOffset(c), this.reportProgress(), O(this.wnd), a(!0);
|
|
2878
2885
|
});
|
|
2879
2886
|
}), e.register("go_id", F.moduleName, (o, a) => {
|
|
2880
2887
|
const l = t.document.getElementById(o);
|
|
@@ -2883,7 +2890,7 @@ const Pi = "readium-column-snapper-style", os = 200, F = class F extends St {
|
|
|
2883
2890
|
return;
|
|
2884
2891
|
}
|
|
2885
2892
|
this.wnd.requestAnimationFrame(() => {
|
|
2886
|
-
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(l.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(),
|
|
2893
|
+
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(l.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(), O(this.wnd), a(!0);
|
|
2887
2894
|
});
|
|
2888
2895
|
}), e.register("go_text", F.moduleName, (o, a) => {
|
|
2889
2896
|
let l;
|
|
@@ -2903,34 +2910,34 @@ const Pi = "readium-column-snapper-style", os = 200, F = class F extends St {
|
|
|
2903
2910
|
return;
|
|
2904
2911
|
}
|
|
2905
2912
|
this.wnd.requestAnimationFrame(() => {
|
|
2906
|
-
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(c.getBoundingClientRect().left + t.scrollX), this.reportProgress(),
|
|
2913
|
+
this.rtl ? this.doc().scrollLeft = -this.snapNormOffset(c.getBoundingClientRect().left + t.scrollX) : this.doc().scrollLeft = this.snapOffset(c.getBoundingClientRect().left + t.scrollX), this.reportProgress(), O(this.wnd), a(!0);
|
|
2907
2914
|
});
|
|
2908
2915
|
}), e.register("go_end", F.moduleName, (o, a) => {
|
|
2909
2916
|
this.wnd.requestAnimationFrame(() => {
|
|
2910
2917
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2911
2918
|
let l;
|
|
2912
2919
|
if (this.rtl ? l = -this.snapNormOffset(this.cachedScrollWidth - t.innerWidth) : l = this.snapOffset(this.cachedScrollWidth), this.doc().scrollLeft === l) return a(!1);
|
|
2913
|
-
this.doc().scrollLeft = l, this.reportProgress(),
|
|
2920
|
+
this.doc().scrollLeft = l, this.reportProgress(), O(this.wnd), a(!0);
|
|
2914
2921
|
});
|
|
2915
2922
|
}), e.register("go_start", F.moduleName, (o, a) => {
|
|
2916
2923
|
this.wnd.requestAnimationFrame(() => {
|
|
2917
2924
|
if (this.doc().scrollLeft === 0) return a(!1);
|
|
2918
|
-
this.doc().scrollLeft = 0, this.reportProgress(),
|
|
2925
|
+
this.doc().scrollLeft = 0, this.reportProgress(), O(this.wnd), a(!0);
|
|
2919
2926
|
});
|
|
2920
2927
|
}), e.register("go_prev", F.moduleName, (o, a) => {
|
|
2921
2928
|
this.wnd.requestAnimationFrame(() => {
|
|
2922
2929
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2923
2930
|
let l;
|
|
2924
|
-
this.rtl ? l = s(this.normScroll() - t.innerWidth) : l = n(t.scrollX - t.innerWidth), this.reportProgress(), l && (
|
|
2931
|
+
this.rtl ? l = s(this.normScroll() - t.innerWidth) : l = n(t.scrollX - t.innerWidth), this.reportProgress(), l && (O(this.wnd), this.checkSuspiciousSnap("left", this.wnd.innerWidth)), a(l);
|
|
2925
2932
|
});
|
|
2926
2933
|
}), e.register("go_next", F.moduleName, (o, a) => {
|
|
2927
2934
|
this.wnd.requestAnimationFrame(() => {
|
|
2928
2935
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
2929
2936
|
let l;
|
|
2930
|
-
this.rtl ? l = s(this.normScroll() + t.innerWidth) : l = n(t.scrollX + t.innerWidth), this.reportProgress(), l && (
|
|
2937
|
+
this.rtl ? l = s(this.normScroll() + t.innerWidth) : l = n(t.scrollX + t.innerWidth), this.reportProgress(), l && (O(this.wnd), this.checkSuspiciousSnap("right", this.wnd.innerWidth)), a(l);
|
|
2931
2938
|
});
|
|
2932
2939
|
}), e.register("unfocus", F.moduleName, (o, a) => {
|
|
2933
|
-
this.snappingCancelled = !0,
|
|
2940
|
+
this.snappingCancelled = !0, O(this.wnd), a(!0);
|
|
2934
2941
|
}), e.register("shake", F.moduleName, (o, a) => {
|
|
2935
2942
|
this.shake(), a(!0);
|
|
2936
2943
|
}), e.register("focus", F.moduleName, (o, a) => {
|
|
@@ -2944,12 +2951,12 @@ const Pi = "readium-column-snapper-style", os = 200, F = class F extends St {
|
|
|
2944
2951
|
}), e.log("ColumnSnapper Mounted"), !0;
|
|
2945
2952
|
}
|
|
2946
2953
|
unmount(t, e) {
|
|
2947
|
-
return this.snappingCancelled = !0, e.unregisterAll(F.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isSnapProtectionEnabled = !1), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), t.document.getElementById(
|
|
2954
|
+
return this.snappingCancelled = !0, e.unregisterAll(F.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isSnapProtectionEnabled = !1), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), t.document.getElementById(Ei)?.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
|
|
2948
2955
|
}
|
|
2949
2956
|
};
|
|
2950
2957
|
F.moduleName = "column_snapper";
|
|
2951
2958
|
let _e = F;
|
|
2952
|
-
const
|
|
2959
|
+
const _i = "readium-scroll-snapper-style", U = class U extends St {
|
|
2953
2960
|
constructor() {
|
|
2954
2961
|
super(...arguments), this.patternAnalyzer = null, this.lastScrollTime = 0, this.isScrollProtectionEnabled = !1, this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = (t) => {
|
|
2955
2962
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -2995,12 +3002,12 @@ const Ei = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
2995
3002
|
});
|
|
2996
3003
|
}
|
|
2997
3004
|
enableScrollProtection() {
|
|
2998
|
-
this.patternAnalyzer || (this.patternAnalyzer = new ae(
|
|
3005
|
+
this.patternAnalyzer || (this.patternAnalyzer = new ae(je), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
|
|
2999
3006
|
}
|
|
3000
3007
|
mount(t, e) {
|
|
3001
3008
|
this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
|
|
3002
3009
|
const i = t.document.createElement("style");
|
|
3003
|
-
return i.dataset.readium = "true", i.id =
|
|
3010
|
+
return i.dataset.readium = "true", i.id = _i, i.textContent = `
|
|
3004
3011
|
* {
|
|
3005
3012
|
scrollbar-width: none; /* for Firefox */
|
|
3006
3013
|
}
|
|
@@ -3025,7 +3032,7 @@ const Ei = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3025
3032
|
return;
|
|
3026
3033
|
}
|
|
3027
3034
|
this.wnd.requestAnimationFrame(() => {
|
|
3028
|
-
this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(),
|
|
3035
|
+
this.doc().scrollTop = this.doc().offsetHeight * o, this.reportProgress(), O(this.wnd), s(!0);
|
|
3029
3036
|
});
|
|
3030
3037
|
}), e.register("go_id", U.moduleName, (n, s) => {
|
|
3031
3038
|
const o = t.document.getElementById(n);
|
|
@@ -3034,7 +3041,7 @@ const Ei = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3034
3041
|
return;
|
|
3035
3042
|
}
|
|
3036
3043
|
this.wnd.requestAnimationFrame(() => {
|
|
3037
|
-
this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(),
|
|
3044
|
+
this.doc().scrollTop = o.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), s(!0);
|
|
3038
3045
|
});
|
|
3039
3046
|
}), e.register("go_text", U.moduleName, (n, s) => {
|
|
3040
3047
|
let o;
|
|
@@ -3054,7 +3061,7 @@ const Ei = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3054
3061
|
return;
|
|
3055
3062
|
}
|
|
3056
3063
|
this.wnd.requestAnimationFrame(() => {
|
|
3057
|
-
this.doc().scrollTop = l.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(),
|
|
3064
|
+
this.doc().scrollTop = l.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), s(!0);
|
|
3058
3065
|
});
|
|
3059
3066
|
}), e.register("go_start", U.moduleName, (n, s) => {
|
|
3060
3067
|
if (this.doc().scrollTop === 0) return s(!1);
|
|
@@ -3063,7 +3070,7 @@ const Ei = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3063
3070
|
if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return s(!1);
|
|
3064
3071
|
this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), s(!0);
|
|
3065
3072
|
}), e.register("unfocus", U.moduleName, (n, s) => {
|
|
3066
|
-
|
|
3073
|
+
O(this.wnd), s(!0);
|
|
3067
3074
|
}), e.register("scroll_protection", U.moduleName, (n, s) => {
|
|
3068
3075
|
this.enableScrollProtection(), s(!0);
|
|
3069
3076
|
}), e.register([
|
|
@@ -3077,7 +3084,7 @@ const Ei = "readium-scroll-snapper-style", U = class U extends St {
|
|
|
3077
3084
|
}), e.log("ScrollSnapper Mounted"), !0;
|
|
3078
3085
|
}
|
|
3079
3086
|
unmount(t, e) {
|
|
3080
|
-
return e.unregisterAll(U.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(
|
|
3087
|
+
return e.unregisterAll(U.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(_i)?.remove(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("ScrollSnapper Unmounted"), !0;
|
|
3081
3088
|
}
|
|
3082
3089
|
};
|
|
3083
3090
|
U.moduleName = "scroll_snapper";
|
|
@@ -3128,7 +3135,7 @@ const B = class B extends St {
|
|
|
3128
3135
|
});
|
|
3129
3136
|
}
|
|
3130
3137
|
enableScrollProtection() {
|
|
3131
|
-
this.patternAnalyzer || (this.patternAnalyzer = new ae(
|
|
3138
|
+
this.patternAnalyzer || (this.patternAnalyzer = new ae(je), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
|
|
3132
3139
|
}
|
|
3133
3140
|
mount(t, e) {
|
|
3134
3141
|
return this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), this.resizeObserver = new ResizeObserver(() => {
|
|
@@ -3148,7 +3155,7 @@ const B = class B extends St {
|
|
|
3148
3155
|
return;
|
|
3149
3156
|
}
|
|
3150
3157
|
this.wnd.requestAnimationFrame(() => {
|
|
3151
|
-
this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(),
|
|
3158
|
+
this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), O(this.wnd), n(!0);
|
|
3152
3159
|
});
|
|
3153
3160
|
}), e.register("go_id", B.moduleName, (i, n) => {
|
|
3154
3161
|
const s = t.document.getElementById(i);
|
|
@@ -3157,7 +3164,7 @@ const B = class B extends St {
|
|
|
3157
3164
|
return;
|
|
3158
3165
|
}
|
|
3159
3166
|
this.wnd.requestAnimationFrame(() => {
|
|
3160
|
-
this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(),
|
|
3167
|
+
this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), n(!0);
|
|
3161
3168
|
});
|
|
3162
3169
|
}), e.register("go_text", B.moduleName, (i, n) => {
|
|
3163
3170
|
let s;
|
|
@@ -3177,7 +3184,7 @@ const B = class B extends St {
|
|
|
3177
3184
|
return;
|
|
3178
3185
|
}
|
|
3179
3186
|
this.wnd.requestAnimationFrame(() => {
|
|
3180
|
-
this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(),
|
|
3187
|
+
this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), O(this.wnd), n(!0);
|
|
3181
3188
|
});
|
|
3182
3189
|
}), e.register("go_start", B.moduleName, (i, n) => {
|
|
3183
3190
|
if (this.doc().scrollTop === 0) return n(!1);
|
|
@@ -3186,7 +3193,7 @@ const B = class B extends St {
|
|
|
3186
3193
|
if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight) return n(!1);
|
|
3187
3194
|
this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), n(!0);
|
|
3188
3195
|
}), e.register("unfocus", B.moduleName, (i, n) => {
|
|
3189
|
-
|
|
3196
|
+
O(this.wnd), n(!0);
|
|
3190
3197
|
}), e.register("scroll_protection", B.moduleName, (i, n) => {
|
|
3191
3198
|
this.enableScrollProtection(), n(!0);
|
|
3192
3199
|
}), e.register([
|
|
@@ -3205,7 +3212,7 @@ const B = class B extends St {
|
|
|
3205
3212
|
};
|
|
3206
3213
|
B.moduleName = "webpub_snapper";
|
|
3207
3214
|
let Le = B;
|
|
3208
|
-
class
|
|
3215
|
+
class cs {
|
|
3209
3216
|
constructor(t, e) {
|
|
3210
3217
|
this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
|
|
3211
3218
|
}
|
|
@@ -3245,8 +3252,8 @@ class as {
|
|
|
3245
3252
|
this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.copyHistory = [], this.options.enabled = !1;
|
|
3246
3253
|
}
|
|
3247
3254
|
}
|
|
3248
|
-
class
|
|
3249
|
-
constructor(t =
|
|
3255
|
+
class ds {
|
|
3256
|
+
constructor(t = an) {
|
|
3250
3257
|
this.options = t, this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
|
|
3251
3258
|
}
|
|
3252
3259
|
analyze(t) {
|
|
@@ -3287,7 +3294,7 @@ class ls {
|
|
|
3287
3294
|
this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
|
|
3288
3295
|
}
|
|
3289
3296
|
}
|
|
3290
|
-
class
|
|
3297
|
+
class ln {
|
|
3291
3298
|
/**
|
|
3292
3299
|
* Checks if the given keyboard event matches any of the provided key combinations
|
|
3293
3300
|
*/
|
|
@@ -3311,16 +3318,18 @@ class an {
|
|
|
3311
3318
|
* Creates a standardized activity event for keyboard shortcuts
|
|
3312
3319
|
*/
|
|
3313
3320
|
createActivityEvent(t, e, i, n) {
|
|
3314
|
-
let s;
|
|
3321
|
+
let s, o;
|
|
3315
3322
|
if (n) {
|
|
3316
|
-
const
|
|
3317
|
-
|
|
3318
|
-
text:
|
|
3319
|
-
x:
|
|
3320
|
-
y:
|
|
3321
|
-
width:
|
|
3322
|
-
height:
|
|
3323
|
+
const a = n.getSelection(), l = a?.toString() || "", c = (l && a?.rangeCount ? a.getRangeAt(0)?.getClientRects() : null)?.[0];
|
|
3324
|
+
c && l && (s = {
|
|
3325
|
+
text: l,
|
|
3326
|
+
x: c.x,
|
|
3327
|
+
y: c.y,
|
|
3328
|
+
width: c.width,
|
|
3329
|
+
height: c.height
|
|
3323
3330
|
});
|
|
3331
|
+
const u = n.document.activeElement;
|
|
3332
|
+
u && u !== n.document.body && (o = Ve(u)?.outerHTML);
|
|
3324
3333
|
}
|
|
3325
3334
|
return {
|
|
3326
3335
|
type: e,
|
|
@@ -3333,7 +3342,8 @@ class an {
|
|
|
3333
3342
|
shiftKey: t.shiftKey,
|
|
3334
3343
|
metaKey: t.metaKey,
|
|
3335
3344
|
targetFrameSrc: i,
|
|
3336
|
-
selectedText: s
|
|
3345
|
+
selectedText: s,
|
|
3346
|
+
interactiveElement: o
|
|
3337
3347
|
};
|
|
3338
3348
|
}
|
|
3339
3349
|
/**
|
|
@@ -3359,6 +3369,11 @@ class an {
|
|
|
3359
3369
|
return (o) => {
|
|
3360
3370
|
for (const a of s)
|
|
3361
3371
|
if (this.match(o, [a])) {
|
|
3372
|
+
const l = a.suppressOnInteractiveElement;
|
|
3373
|
+
if (l) {
|
|
3374
|
+
const h = document.activeElement;
|
|
3375
|
+
if (Array.isArray(l) ? l.some((c) => h?.matches(c)) : rn(h)) return;
|
|
3376
|
+
}
|
|
3362
3377
|
o.preventDefault(), o.stopPropagation(), a.handler(o);
|
|
3363
3378
|
return;
|
|
3364
3379
|
}
|
|
@@ -3367,7 +3382,7 @@ class an {
|
|
|
3367
3382
|
}
|
|
3368
3383
|
const yt = class yt extends Et {
|
|
3369
3384
|
constructor() {
|
|
3370
|
-
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
|
|
3385
|
+
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 ln(), this.keyDownHandler = null, this.preventBulkCopy = (t) => {
|
|
3371
3386
|
if (!this.isBulkCopyProtectionEnabled || !this.bulkCopyProtector)
|
|
3372
3387
|
return !0;
|
|
3373
3388
|
if (!this.bulkCopyProtector.shouldAllowCopy(t)) {
|
|
@@ -3490,16 +3505,16 @@ const yt = class yt extends Et {
|
|
|
3490
3505
|
}
|
|
3491
3506
|
addBulkCopyProtection(t = {}) {
|
|
3492
3507
|
if (this.isBulkCopyProtectionEnabled || !this.wnd) return;
|
|
3493
|
-
const e =
|
|
3494
|
-
this.bulkCopyProtector = new
|
|
3508
|
+
const e = ls, i = t ? { ...e, ...t } : e;
|
|
3509
|
+
this.bulkCopyProtector = new cs(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
|
|
3495
3510
|
}
|
|
3496
3511
|
removeBulkCopyProtection() {
|
|
3497
3512
|
!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);
|
|
3498
3513
|
}
|
|
3499
3514
|
addSelectionMonitoring(t) {
|
|
3500
3515
|
if (this.isSelectionMonitoringEnabled || !this.wnd) return;
|
|
3501
|
-
const e = t ||
|
|
3502
|
-
this.selectionAnalyzer = new
|
|
3516
|
+
const e = t || an;
|
|
3517
|
+
this.selectionAnalyzer = new ds(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
|
|
3503
3518
|
}
|
|
3504
3519
|
removeSelectionMonitoring() {
|
|
3505
3520
|
!this.isSelectionMonitoringEnabled || !this.wnd || (this.wnd.document.removeEventListener("selectionchange", this.handleSelection), this.selectionAnalyzer?.clear(), this.selectionAnalyzer = null, this.isSelectionMonitoringEnabled = !1);
|
|
@@ -3532,7 +3547,7 @@ const yt = class yt extends Et {
|
|
|
3532
3547
|
y: t.clientY * i,
|
|
3533
3548
|
targetFrameSrc: this.wnd.location.href,
|
|
3534
3549
|
targetElement: t.target.outerHTML,
|
|
3535
|
-
interactiveElement:
|
|
3550
|
+
interactiveElement: Ve(t.target)?.outerHTML,
|
|
3536
3551
|
cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(t.target)
|
|
3537
3552
|
}), this.pointerMoved = !1;
|
|
3538
3553
|
}
|
|
@@ -3641,7 +3656,7 @@ const At = class At extends Et {
|
|
|
3641
3656
|
), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
|
|
3642
3657
|
value: {
|
|
3643
3658
|
name: "readium-ts-toolkit",
|
|
3644
|
-
version: "2.5.
|
|
3659
|
+
version: "2.5.2-beta.1",
|
|
3645
3660
|
hasFeature: (n, s = "") => {
|
|
3646
3661
|
switch (n) {
|
|
3647
3662
|
case "dom-manipulation":
|
|
@@ -3690,7 +3705,7 @@ const At = class At extends Et {
|
|
|
3690
3705
|
};
|
|
3691
3706
|
At.moduleName = "setup";
|
|
3692
3707
|
let Xt = At;
|
|
3693
|
-
const
|
|
3708
|
+
const Ci = "readium-viewport", Z = class Z extends Xt {
|
|
3694
3709
|
onViewportWidthChanged(t) {
|
|
3695
3710
|
const e = t.target;
|
|
3696
3711
|
Tt(e, "--RS__viewportWidth", `${e.innerWidth}px`);
|
|
@@ -3698,7 +3713,7 @@ const _i = "readium-viewport", Z = class Z extends Xt {
|
|
|
3698
3713
|
mount(t, e) {
|
|
3699
3714
|
if (!super.mount(t, e)) return !1;
|
|
3700
3715
|
const i = t.document.createElement("meta");
|
|
3701
|
-
return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id",
|
|
3716
|
+
return i.dataset.readium = "true", i.setAttribute("name", "viewport"), i.setAttribute("id", Ci), i.setAttribute(
|
|
3702
3717
|
"content",
|
|
3703
3718
|
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
|
|
3704
3719
|
), t.document.head.appendChild(i), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
|
|
@@ -3706,7 +3721,7 @@ const _i = "readium-viewport", Z = class Z extends Xt {
|
|
|
3706
3721
|
}), e.register("get_properties", Z.moduleName, (n, s) => {
|
|
3707
3722
|
Be(t), s(!0);
|
|
3708
3723
|
}), e.register("update_properties", Z.moduleName, (n, s) => {
|
|
3709
|
-
n["--RS__viewportWidth"] = `${t.innerWidth}px`,
|
|
3724
|
+
n["--RS__viewportWidth"] = `${t.innerWidth}px`, nn(t, n), s(!0);
|
|
3710
3725
|
}), e.register("set_property", Z.moduleName, (n, s) => {
|
|
3711
3726
|
const o = n;
|
|
3712
3727
|
Tt(t, o[0], o[1]), s(!0);
|
|
@@ -3717,17 +3732,17 @@ const _i = "readium-viewport", Z = class Z extends Xt {
|
|
|
3717
3732
|
}), e.log("ReflowableSetup Mounted"), !0;
|
|
3718
3733
|
}
|
|
3719
3734
|
unmount(t, e) {
|
|
3720
|
-
return e.unregisterAll(Z.moduleName), t.document.head.querySelector(`#${
|
|
3735
|
+
return e.unregisterAll(Z.moduleName), t.document.head.querySelector(`#${Ci}`)?.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
|
|
3721
3736
|
}
|
|
3722
3737
|
};
|
|
3723
3738
|
Z.moduleName = "reflowable_setup";
|
|
3724
|
-
let
|
|
3725
|
-
const
|
|
3739
|
+
let ke = Z;
|
|
3740
|
+
const Li = "readium-fixed-style", q = class q extends Xt {
|
|
3726
3741
|
mount(t, e) {
|
|
3727
3742
|
if (!super.mount(t, e)) return !1;
|
|
3728
3743
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
3729
3744
|
const i = t.document.createElement("style");
|
|
3730
|
-
return i.id =
|
|
3745
|
+
return i.id = Li, i.dataset.readium = "true", i.textContent = `
|
|
3731
3746
|
html, body {
|
|
3732
3747
|
text-size-adjust: none;
|
|
3733
3748
|
-ms-text-size-adjust: none;
|
|
@@ -3745,7 +3760,7 @@ const Ci = "readium-fixed-style", q = class q extends Xt {
|
|
|
3745
3760
|
}), e.register("remove_property", q.moduleName, (n, s) => {
|
|
3746
3761
|
re(t, n), s(!0);
|
|
3747
3762
|
}), e.register("first_visible_locator", q.moduleName, (n, s) => s(!1)), e.register("unfocus", q.moduleName, (n, s) => {
|
|
3748
|
-
|
|
3763
|
+
O(t), s(!0);
|
|
3749
3764
|
}), e.register([
|
|
3750
3765
|
"focus",
|
|
3751
3766
|
"go_next",
|
|
@@ -3760,11 +3775,11 @@ const Ci = "readium-fixed-style", q = class q extends Xt {
|
|
|
3760
3775
|
}), e.log("FixedSetup Mounted"), !0;
|
|
3761
3776
|
}
|
|
3762
3777
|
unmount(t, e) {
|
|
3763
|
-
return e.unregisterAll(q.moduleName), t.document.getElementById(
|
|
3778
|
+
return e.unregisterAll(q.moduleName), t.document.getElementById(Li)?.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
|
|
3764
3779
|
}
|
|
3765
3780
|
};
|
|
3766
3781
|
q.moduleName = "fixed_setup";
|
|
3767
|
-
let
|
|
3782
|
+
let Oe = q;
|
|
3768
3783
|
const Q = class Q extends Et {
|
|
3769
3784
|
wndOnErr(t) {
|
|
3770
3785
|
this.comms?.send("error", {
|
|
@@ -3782,7 +3797,7 @@ const Q = class Q extends Et {
|
|
|
3782
3797
|
), e.register("get_properties", Q.moduleName, (i, n) => {
|
|
3783
3798
|
Be(t), n(!0);
|
|
3784
3799
|
}), e.register("update_properties", Q.moduleName, (i, n) => {
|
|
3785
|
-
|
|
3800
|
+
nn(t, i), n(!0);
|
|
3786
3801
|
}), e.register("set_property", Q.moduleName, (i, n) => {
|
|
3787
3802
|
const s = i;
|
|
3788
3803
|
Tt(t, s[0], s[1]), n(!0);
|
|
@@ -3799,7 +3814,7 @@ const Q = class Q extends Et {
|
|
|
3799
3814
|
Q.moduleName = "webpub_setup";
|
|
3800
3815
|
let Re = Q;
|
|
3801
3816
|
var nt;
|
|
3802
|
-
let
|
|
3817
|
+
let us = (nt = class extends Et {
|
|
3803
3818
|
constructor() {
|
|
3804
3819
|
super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
|
|
3805
3820
|
}
|
|
@@ -3835,7 +3850,7 @@ let hs = (nt = class extends Et {
|
|
|
3835
3850
|
return this.beforePrintHandler && (t.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null), this.comms?.unregisterAll(nt.moduleName), this.configApplied = !1, !0;
|
|
3836
3851
|
}
|
|
3837
3852
|
}, nt.moduleName = "print_protection", nt);
|
|
3838
|
-
const
|
|
3853
|
+
const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
3839
3854
|
constructor() {
|
|
3840
3855
|
super(...arguments), this.patternAnalyzer = null, this.lastScrollTime = 0, this.isScrollProtectionEnabled = !1, this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.resizeDebounce = null, this.verticalLR = !1, this.handleScroll = (t) => {
|
|
3841
3856
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -3887,12 +3902,12 @@ const Li = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3887
3902
|
});
|
|
3888
3903
|
}
|
|
3889
3904
|
enableScrollProtection() {
|
|
3890
|
-
this.patternAnalyzer || (this.patternAnalyzer = new ae(
|
|
3905
|
+
this.patternAnalyzer || (this.patternAnalyzer = new ae(je), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
|
|
3891
3906
|
}
|
|
3892
3907
|
mount(t, e) {
|
|
3893
|
-
this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.verticalLR =
|
|
3908
|
+
this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.verticalLR = Qn(t), this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
|
|
3894
3909
|
const i = t.document.createElement("style");
|
|
3895
|
-
return i.dataset.readium = "true", i.id =
|
|
3910
|
+
return i.dataset.readium = "true", i.id = xi, i.textContent = `
|
|
3896
3911
|
* {
|
|
3897
3912
|
scrollbar-width: none;
|
|
3898
3913
|
}
|
|
@@ -3921,7 +3936,7 @@ const Li = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3921
3936
|
}
|
|
3922
3937
|
this.wnd.requestAnimationFrame(() => {
|
|
3923
3938
|
const a = this.scrollable() * o;
|
|
3924
|
-
this.doc().scrollLeft = this.verticalLR ? a : -a, this.reportProgress(),
|
|
3939
|
+
this.doc().scrollLeft = this.verticalLR ? a : -a, this.reportProgress(), O(this.wnd), s(!0);
|
|
3925
3940
|
});
|
|
3926
3941
|
}), e.register("go_id", H.moduleName, (n, s) => {
|
|
3927
3942
|
const o = t.document.getElementById(n);
|
|
@@ -3930,7 +3945,7 @@ const Li = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3930
3945
|
return;
|
|
3931
3946
|
}
|
|
3932
3947
|
this.wnd.requestAnimationFrame(() => {
|
|
3933
|
-
this.doc().scrollLeft += o.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(),
|
|
3948
|
+
this.doc().scrollLeft += o.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
|
|
3934
3949
|
});
|
|
3935
3950
|
}), e.register("go_text", H.moduleName, (n, s) => {
|
|
3936
3951
|
let o;
|
|
@@ -3948,7 +3963,7 @@ const Li = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3948
3963
|
return;
|
|
3949
3964
|
}
|
|
3950
3965
|
this.wnd.requestAnimationFrame(() => {
|
|
3951
|
-
this.doc().scrollLeft += l.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(),
|
|
3966
|
+
this.doc().scrollLeft += l.getBoundingClientRect().left - t.innerWidth / 2, this.reportProgress(), O(this.wnd), s(!0);
|
|
3952
3967
|
});
|
|
3953
3968
|
}), e.register("go_start", H.moduleName, (n, s) => {
|
|
3954
3969
|
if (this.doc().scrollLeft === 0) return s(!1);
|
|
@@ -3960,7 +3975,7 @@ const Li = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3960
3975
|
"go_next",
|
|
3961
3976
|
"go_prev"
|
|
3962
3977
|
], H.moduleName, (n, s) => s(!1)), e.register("unfocus", H.moduleName, (n, s) => {
|
|
3963
|
-
|
|
3978
|
+
O(this.wnd), s(!0);
|
|
3964
3979
|
}), e.register("scroll_protection", H.moduleName, (n, s) => {
|
|
3965
3980
|
this.enableScrollProtection(), s(!0);
|
|
3966
3981
|
}), e.register("focus", H.moduleName, (n, s) => {
|
|
@@ -3971,17 +3986,17 @@ const Li = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3971
3986
|
}), e.log("CJKVerticalSnapper Mounted"), !0;
|
|
3972
3987
|
}
|
|
3973
3988
|
unmount(t, e) {
|
|
3974
|
-
return e.unregisterAll(H.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(
|
|
3989
|
+
return e.unregisterAll(H.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), t.document.getElementById(xi)?.remove(), this.patternAnalyzer && (this.patternAnalyzer.clear(), this.patternAnalyzer = null, this.isScrollProtectionEnabled = !1), e.log("CJKVerticalSnapper Unmounted"), !0;
|
|
3975
3990
|
}
|
|
3976
3991
|
};
|
|
3977
3992
|
H.moduleName = "cjk_vertical_snapper";
|
|
3978
3993
|
let Ae = H;
|
|
3979
|
-
const
|
|
3994
|
+
const ps = [
|
|
3980
3995
|
"fixed_setup",
|
|
3981
3996
|
"decorator",
|
|
3982
3997
|
"peripherals",
|
|
3983
3998
|
"print_protection"
|
|
3984
|
-
],
|
|
3999
|
+
], fs = [
|
|
3985
4000
|
"reflowable_setup",
|
|
3986
4001
|
"decorator",
|
|
3987
4002
|
"peripherals",
|
|
@@ -3989,7 +4004,7 @@ const cs = [
|
|
|
3989
4004
|
"scroll_snapper",
|
|
3990
4005
|
"cjk_vertical_snapper",
|
|
3991
4006
|
"print_protection"
|
|
3992
|
-
],
|
|
4007
|
+
], ms = [
|
|
3993
4008
|
"webpub_setup",
|
|
3994
4009
|
"webpub_snapper",
|
|
3995
4010
|
"decorator",
|
|
@@ -3997,8 +4012,8 @@ const cs = [
|
|
|
3997
4012
|
"print_protection"
|
|
3998
4013
|
], Te = new Map([
|
|
3999
4014
|
// All modules go here
|
|
4000
|
-
ke,
|
|
4001
4015
|
Oe,
|
|
4016
|
+
ke,
|
|
4002
4017
|
Re,
|
|
4003
4018
|
Le,
|
|
4004
4019
|
xe,
|
|
@@ -4006,7 +4021,7 @@ const cs = [
|
|
|
4006
4021
|
_e,
|
|
4007
4022
|
Ce,
|
|
4008
4023
|
Ae,
|
|
4009
|
-
|
|
4024
|
+
us
|
|
4010
4025
|
].map((r) => [r.moduleName, r]));
|
|
4011
4026
|
class Pt {
|
|
4012
4027
|
/**
|
|
@@ -4014,7 +4029,7 @@ class Pt {
|
|
|
4014
4029
|
* @param initialModules List of initial modules to load
|
|
4015
4030
|
*/
|
|
4016
4031
|
constructor(t = window, e = []) {
|
|
4017
|
-
this.loadedModules = [], this.wnd = t, this.comms = new
|
|
4032
|
+
this.loadedModules = [], this.wnd = t, this.comms = new In(t);
|
|
4018
4033
|
const i = [...new Set(e)];
|
|
4019
4034
|
if (i.length) {
|
|
4020
4035
|
if (typeof t > "u")
|
|
@@ -4058,64 +4073,74 @@ class Pt {
|
|
|
4058
4073
|
this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
|
|
4059
4074
|
}
|
|
4060
4075
|
}
|
|
4061
|
-
const
|
|
4076
|
+
const gs = {
|
|
4062
4077
|
type: "developer_tools",
|
|
4063
4078
|
keyCombos: [
|
|
4064
4079
|
{ keyCode: 73, meta: !0, alt: !0 },
|
|
4065
|
-
// I
|
|
4080
|
+
// Cmd+Option+I
|
|
4081
|
+
{ keyCode: 73, ctrl: !0, shift: !0 },
|
|
4082
|
+
// Ctrl+Shift+I
|
|
4066
4083
|
{ keyCode: 74, meta: !0, alt: !0 },
|
|
4067
|
-
// J
|
|
4084
|
+
// Cmd+Option+J
|
|
4085
|
+
{ keyCode: 74, ctrl: !0, shift: !0 },
|
|
4086
|
+
// Ctrl+Shift+J
|
|
4068
4087
|
{ keyCode: 85, meta: !0, alt: !0 },
|
|
4069
|
-
// U
|
|
4088
|
+
// Cmd+Option+U
|
|
4070
4089
|
{ keyCode: 67, meta: !0, alt: !0 },
|
|
4071
|
-
// C
|
|
4090
|
+
// Cmd+Option+C
|
|
4072
4091
|
{ keyCode: 67, meta: !0, shift: !0 },
|
|
4073
|
-
//
|
|
4092
|
+
// Cmd+Shift+C
|
|
4074
4093
|
{ keyCode: 67, ctrl: !0, shift: !0 },
|
|
4075
|
-
//
|
|
4094
|
+
// Ctrl+Shift+C
|
|
4095
|
+
{ keyCode: 65, meta: !0, alt: !0 },
|
|
4096
|
+
// Cmd+Option+A
|
|
4097
|
+
{ keyCode: 84, meta: !0, shift: !0, alt: !0 },
|
|
4098
|
+
// Cmd+Shift+Option+T
|
|
4099
|
+
{ keyCode: 67, shift: !0, alt: !0 },
|
|
4100
|
+
// Shift+Option+C
|
|
4076
4101
|
{ keyCode: 123 },
|
|
4077
4102
|
// F12
|
|
4078
4103
|
{ keyCode: 123, shift: !0 },
|
|
4079
|
-
// F12
|
|
4104
|
+
// Shift+F12
|
|
4080
4105
|
{ keyCode: 123, ctrl: !0, shift: !0 },
|
|
4081
|
-
//
|
|
4106
|
+
// Ctrl+Shift+F12
|
|
4082
4107
|
{ keyCode: 123, meta: !0, alt: !0 }
|
|
4083
|
-
//
|
|
4108
|
+
// Cmd+Option+F12
|
|
4084
4109
|
]
|
|
4085
|
-
},
|
|
4110
|
+
}, ys = {
|
|
4086
4111
|
type: "select_all",
|
|
4087
4112
|
keyCombos: [
|
|
4088
4113
|
{ keyCode: 65, meta: !0 },
|
|
4089
|
-
//
|
|
4114
|
+
// Cmd+A
|
|
4090
4115
|
{ keyCode: 65, ctrl: !0 }
|
|
4091
|
-
//
|
|
4116
|
+
// Ctrl+A
|
|
4092
4117
|
]
|
|
4093
|
-
},
|
|
4118
|
+
}, bs = {
|
|
4094
4119
|
type: "print",
|
|
4095
4120
|
keyCombos: [
|
|
4096
4121
|
{ keyCode: 80, meta: !0 },
|
|
4097
|
-
//
|
|
4122
|
+
// Cmd+P
|
|
4098
4123
|
{ keyCode: 80, ctrl: !0 },
|
|
4099
|
-
//
|
|
4124
|
+
// Ctrl+P
|
|
4100
4125
|
{ keyCode: 80, meta: !0, shift: !0 },
|
|
4101
|
-
//
|
|
4126
|
+
// Cmd+Shift+P
|
|
4102
4127
|
{ keyCode: 80, ctrl: !0, shift: !0 },
|
|
4103
|
-
//
|
|
4128
|
+
// Ctrl+Shift+P
|
|
4104
4129
|
{ keyCode: 80, meta: !0, alt: !0 },
|
|
4105
|
-
//
|
|
4130
|
+
// Cmd+Alt+P
|
|
4106
4131
|
{ keyCode: 80, ctrl: !0, alt: !0 }
|
|
4107
|
-
//
|
|
4132
|
+
// Ctrl+Alt+P
|
|
4108
4133
|
]
|
|
4109
|
-
},
|
|
4134
|
+
}, ws = {
|
|
4110
4135
|
type: "save",
|
|
4111
4136
|
keyCombos: [
|
|
4112
4137
|
{ keyCode: 83, meta: !0 },
|
|
4113
|
-
//
|
|
4138
|
+
// Cmd+S
|
|
4114
4139
|
{ keyCode: 83, ctrl: !0 }
|
|
4115
|
-
//
|
|
4140
|
+
// Ctrl+S
|
|
4116
4141
|
]
|
|
4117
4142
|
};
|
|
4118
|
-
class
|
|
4143
|
+
class hn {
|
|
4119
4144
|
/**
|
|
4120
4145
|
* Merges keyboard peripherals from content protection config with user-provided peripherals
|
|
4121
4146
|
* Content protection peripherals are added first for priority, then user peripherals are added only if they don't conflict
|
|
@@ -4124,7 +4149,7 @@ class ln {
|
|
|
4124
4149
|
const i = [], n = e.filter(
|
|
4125
4150
|
(s) => !["developer_tools", "select_all", "print", "save"].includes(s.type)
|
|
4126
4151
|
);
|
|
4127
|
-
t.disableSelectAll && i.push(
|
|
4152
|
+
t.disableSelectAll && i.push(ys), t.disableSave && i.push(ws), t.monitorDevTools && i.push(gs), t.protectPrinting?.disable && i.push(bs);
|
|
4128
4153
|
for (const s of n) {
|
|
4129
4154
|
const o = s.keyCombos.filter(
|
|
4130
4155
|
(a) => !i.some(
|
|
@@ -4141,7 +4166,7 @@ class ln {
|
|
|
4141
4166
|
return i;
|
|
4142
4167
|
}
|
|
4143
4168
|
}
|
|
4144
|
-
class
|
|
4169
|
+
class cn extends hn {
|
|
4145
4170
|
/**
|
|
4146
4171
|
* Moves to the left content portion (eg. page) relative to the reading progression direction.
|
|
4147
4172
|
*/
|
|
@@ -4155,9 +4180,9 @@ class hn extends ln {
|
|
|
4155
4180
|
this.readingProgression === N.ltr ? this.goForward(t, e) : this.readingProgression === N.rtl && this.goBackward(t, e);
|
|
4156
4181
|
}
|
|
4157
4182
|
}
|
|
4158
|
-
class
|
|
4183
|
+
class vs extends hn {
|
|
4159
4184
|
}
|
|
4160
|
-
class
|
|
4185
|
+
class Ss {
|
|
4161
4186
|
constructor(t, e, i, n) {
|
|
4162
4187
|
this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
|
|
4163
4188
|
}
|
|
@@ -4207,7 +4232,7 @@ class bs {
|
|
|
4207
4232
|
return n + o;
|
|
4208
4233
|
}
|
|
4209
4234
|
}
|
|
4210
|
-
const
|
|
4235
|
+
const Ps = 1e4;
|
|
4211
4236
|
class Mt {
|
|
4212
4237
|
constructor(t, e) {
|
|
4213
4238
|
this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
|
|
@@ -4218,7 +4243,7 @@ class Mt {
|
|
|
4218
4243
|
}
|
|
4219
4244
|
this.gc = setInterval(() => {
|
|
4220
4245
|
this.registry.forEach((i, n) => {
|
|
4221
|
-
performance.now() - i.time >
|
|
4246
|
+
performance.now() - i.time > Ps && (console.warn(n, "event for", i.key, "was never handled!"), this.registry.delete(n));
|
|
4222
4247
|
});
|
|
4223
4248
|
}, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
|
|
4224
4249
|
}
|
|
@@ -4287,12 +4312,12 @@ class Mt {
|
|
|
4287
4312
|
), o;
|
|
4288
4313
|
}
|
|
4289
4314
|
}
|
|
4290
|
-
const
|
|
4291
|
-
RS__oldStyleTf:
|
|
4292
|
-
},
|
|
4293
|
-
class
|
|
4315
|
+
const Es = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", _s = {
|
|
4316
|
+
RS__oldStyleTf: Es
|
|
4317
|
+
}, Cs = 16, ki = _s.RS__oldStyleTf;
|
|
4318
|
+
class kt {
|
|
4294
4319
|
constructor(t) {
|
|
4295
|
-
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize ||
|
|
4320
|
+
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Cs, this._fontFace = t.fontFace || ki, this._sample = t.sample || null, this._padding = t.padding ?? 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = kt.approximateWordSpaces(this._optimalChars, this._sample);
|
|
4296
4321
|
}
|
|
4297
4322
|
updateMultipliers() {
|
|
4298
4323
|
this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1;
|
|
@@ -4301,7 +4326,7 @@ class Ot {
|
|
|
4301
4326
|
// Not filtering because pretty much everything can
|
|
4302
4327
|
// trigger a recomputation anyway.
|
|
4303
4328
|
update(t) {
|
|
4304
|
-
t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace ||
|
|
4329
|
+
t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || ki), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.padding !== void 0 && (this._padding = t.padding ?? 0), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces = kt.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
|
|
4305
4330
|
}
|
|
4306
4331
|
get baseFontSize() {
|
|
4307
4332
|
return this._baseFontSize;
|
|
@@ -4357,17 +4382,17 @@ class Ot {
|
|
|
4357
4382
|
if (e.font = `${this._baseFontSize}px ${t}`, this._sample && this._sample.length >= this._optimalChars && (i = this._sample.slice(0, this._optimalChars)), Object.hasOwn(e, "letterSpacing") && Object.hasOwn(e, "wordSpacing"))
|
|
4358
4383
|
return e.letterSpacing = this._letterSpacing.toString() + "px", e.wordSpacing = this._wordSpacing.toString() + "px", e.measureText(i).width;
|
|
4359
4384
|
{
|
|
4360
|
-
const n = this._letterSpacing * (this._optimalChars - 1), s = this._wordSpacing *
|
|
4385
|
+
const n = this._letterSpacing * (this._optimalChars - 1), s = this._wordSpacing * kt.approximateWordSpaces(this._optimalChars, this._sample);
|
|
4361
4386
|
return e.measureText(i).width + n + s;
|
|
4362
4387
|
}
|
|
4363
4388
|
} else
|
|
4364
4389
|
return this.getLineLengthFallback();
|
|
4365
4390
|
}
|
|
4366
4391
|
}
|
|
4367
|
-
const
|
|
4368
|
-
class
|
|
4392
|
+
const dn = () => typeof navigator > "u" ? "" : navigator.userAgent || "", un = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
|
|
4393
|
+
class pn {
|
|
4369
4394
|
constructor() {
|
|
4370
|
-
const t =
|
|
4395
|
+
const t = un(), e = dn(), i = (s) => (typeof s == "string" || typeof s == "number") && s ? String(s).replace(/_/g, ".").split(".").map((o) => parseInt(o) || 0) : [], n = (s = "") => {
|
|
4371
4396
|
if (!s) return [];
|
|
4372
4397
|
const o = new RegExp("^.*" + s + "[ :\\/]?(\\d+([\\._]\\d+)*).*$");
|
|
4373
4398
|
return o.test(e) ? i(e.replace(o, "$1")) : [];
|
|
@@ -4398,16 +4423,16 @@ class un {
|
|
|
4398
4423
|
}, []) };
|
|
4399
4424
|
}
|
|
4400
4425
|
}
|
|
4401
|
-
class
|
|
4426
|
+
class Ls extends pn {
|
|
4402
4427
|
get iOSRequest() {
|
|
4403
|
-
const t =
|
|
4428
|
+
const t = un(), e = dn();
|
|
4404
4429
|
if (this.OS.iOS && !this.OS.iPadOS)
|
|
4405
4430
|
return "mobile";
|
|
4406
4431
|
if (this.OS.iPadOS)
|
|
4407
4432
|
return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
|
|
4408
4433
|
}
|
|
4409
4434
|
}
|
|
4410
|
-
const J = new
|
|
4435
|
+
const J = new pn(), T = new Ls();
|
|
4411
4436
|
function bt(r) {
|
|
4412
4437
|
const t = r.languages?.[0]?.toLowerCase(), e = r.readingProgression;
|
|
4413
4438
|
if (t) {
|
|
@@ -4418,7 +4443,7 @@ function bt(r) {
|
|
|
4418
4443
|
}
|
|
4419
4444
|
return "ltr";
|
|
4420
4445
|
}
|
|
4421
|
-
class
|
|
4446
|
+
class xs {
|
|
4422
4447
|
constructor(t, e = {}, i = []) {
|
|
4423
4448
|
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];
|
|
4424
4449
|
}
|
|
@@ -4509,7 +4534,7 @@ class _s {
|
|
|
4509
4534
|
return this.loader;
|
|
4510
4535
|
}
|
|
4511
4536
|
}
|
|
4512
|
-
class
|
|
4537
|
+
class ks {
|
|
4513
4538
|
constructor(t, e, i, n = {}, s = []) {
|
|
4514
4539
|
this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.currentCssProperties = e, this.injector = i, this.contentProtectionConfig = n, this.keyboardPeripheralsConfig = [...s];
|
|
4515
4540
|
}
|
|
@@ -4560,7 +4585,7 @@ class Cs {
|
|
|
4560
4585
|
const f = t.readingOrder.findWithHref(d);
|
|
4561
4586
|
if (!f) return;
|
|
4562
4587
|
if (!this.blobs.has(d)) {
|
|
4563
|
-
const R = await new
|
|
4588
|
+
const R = await new Ss(
|
|
4564
4589
|
t,
|
|
4565
4590
|
this.currentBaseURL || "",
|
|
4566
4591
|
f,
|
|
@@ -4571,7 +4596,7 @@ class Cs {
|
|
|
4571
4596
|
).build();
|
|
4572
4597
|
this.blobs.set(d, R);
|
|
4573
4598
|
}
|
|
4574
|
-
const w = new
|
|
4599
|
+
const w = new xs(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
4575
4600
|
d !== o && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(d, w);
|
|
4576
4601
|
};
|
|
4577
4602
|
try {
|
|
@@ -4626,7 +4651,7 @@ class Cs {
|
|
|
4626
4651
|
}
|
|
4627
4652
|
}
|
|
4628
4653
|
var me, Oi;
|
|
4629
|
-
function
|
|
4654
|
+
function Os() {
|
|
4630
4655
|
if (Oi) return me;
|
|
4631
4656
|
Oi = 1;
|
|
4632
4657
|
function r(n) {
|
|
@@ -4813,11 +4838,11 @@ function Ls() {
|
|
|
4813
4838
|
};
|
|
4814
4839
|
return i.posix = i, me = i, me;
|
|
4815
4840
|
}
|
|
4816
|
-
var Gt =
|
|
4817
|
-
const
|
|
4818
|
-
experimentalHeaderFiltering:
|
|
4819
|
-
experimentalZoom:
|
|
4820
|
-
},
|
|
4841
|
+
var Gt = Os();
|
|
4842
|
+
const Rs = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, As = { description: "Attemps to filter out elements that are sized using viewport units and should not be scaled directly e.g. tables, images, iframes, etc.", scope: "RS", value: "readium-experimentalZoom-on" }, Ts = {
|
|
4843
|
+
experimentalHeaderFiltering: Rs,
|
|
4844
|
+
experimentalZoom: As
|
|
4845
|
+
}, $e = Ts;
|
|
4821
4846
|
var tt = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(tt || {});
|
|
4822
4847
|
const dt = {
|
|
4823
4848
|
range: [0, 100],
|
|
@@ -4889,7 +4914,7 @@ class le {
|
|
|
4889
4914
|
return `${t}rem`;
|
|
4890
4915
|
}
|
|
4891
4916
|
}
|
|
4892
|
-
class
|
|
4917
|
+
class fn extends le {
|
|
4893
4918
|
constructor(t) {
|
|
4894
4919
|
super(), this.a11yNormalize = t.a11yNormalize ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.fontFamily = t.fontFamily ?? null, this.fontWeight = t.fontWeight ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.textAlign = t.textAlign ?? null, this.wordSpacing = t.wordSpacing ?? null, this.zoom = t.zoom ?? null;
|
|
4895
4920
|
}
|
|
@@ -4898,18 +4923,18 @@ class pn extends le {
|
|
|
4898
4923
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), this.zoom !== null && (t["--USER__zoom"] = this.toPercentage(this.zoom, !0)), t;
|
|
4899
4924
|
}
|
|
4900
4925
|
}
|
|
4901
|
-
class
|
|
4926
|
+
class Ms extends le {
|
|
4902
4927
|
constructor(t) {
|
|
4903
4928
|
super(), this.experiments = t.experiments ?? null;
|
|
4904
4929
|
}
|
|
4905
4930
|
toCSSProperties() {
|
|
4906
4931
|
const t = {};
|
|
4907
4932
|
return this.experiments && this.experiments.forEach((e) => {
|
|
4908
|
-
t["--RS__" + e] =
|
|
4933
|
+
t["--RS__" + e] = $e[e].value;
|
|
4909
4934
|
}), t;
|
|
4910
4935
|
}
|
|
4911
4936
|
}
|
|
4912
|
-
class
|
|
4937
|
+
class Ns {
|
|
4913
4938
|
constructor(t) {
|
|
4914
4939
|
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
|
|
4915
4940
|
}
|
|
@@ -4932,13 +4957,13 @@ class As {
|
|
|
4932
4957
|
wordSpacing: t.wordSpacing,
|
|
4933
4958
|
zoom: t.zoom
|
|
4934
4959
|
};
|
|
4935
|
-
this.userProperties = new
|
|
4960
|
+
this.userProperties = new fn(e);
|
|
4936
4961
|
}
|
|
4937
4962
|
}
|
|
4938
|
-
function
|
|
4963
|
+
function zs(r, t) {
|
|
4939
4964
|
return r == null || t == null || r <= t ? r : void 0;
|
|
4940
4965
|
}
|
|
4941
|
-
function
|
|
4966
|
+
function Is(r, t) {
|
|
4942
4967
|
return r == null || t == null || r >= t ? r : void 0;
|
|
4943
4968
|
}
|
|
4944
4969
|
function W(r) {
|
|
@@ -4969,9 +4994,9 @@ function z(r, t) {
|
|
|
4969
4994
|
function ge(r, t) {
|
|
4970
4995
|
return r === void 0 ? t : r;
|
|
4971
4996
|
}
|
|
4972
|
-
function
|
|
4997
|
+
function mn(r) {
|
|
4973
4998
|
if (r !== void 0)
|
|
4974
|
-
return r === null ? null : r.filter((t) => t in
|
|
4999
|
+
return r === null ? null : r.filter((t) => t in $e);
|
|
4975
5000
|
}
|
|
4976
5001
|
class Nt {
|
|
4977
5002
|
constructor(t = {}) {
|
|
@@ -4996,12 +5021,12 @@ class Nt {
|
|
|
4996
5021
|
return new Nt(e);
|
|
4997
5022
|
}
|
|
4998
5023
|
}
|
|
4999
|
-
class
|
|
5024
|
+
class Ds {
|
|
5000
5025
|
constructor(t) {
|
|
5001
|
-
this.fontFamily = W(t.fontFamily) || null, this.fontWeight = z(t.fontWeight, st.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = he(t.textAlign, tt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = z(t.zoom, ee.range) || 1, this.experiments =
|
|
5026
|
+
this.fontFamily = W(t.fontFamily) || null, this.fontWeight = z(t.fontWeight, st.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = he(t.textAlign, tt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = z(t.zoom, ee.range) || 1, this.experiments = mn(t.experiments) ?? null;
|
|
5002
5027
|
}
|
|
5003
5028
|
}
|
|
5004
|
-
class
|
|
5029
|
+
class Ri {
|
|
5005
5030
|
constructor(t, e, i) {
|
|
5006
5031
|
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 ? (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? T.OS.iPadOS && T.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.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;
|
|
5007
5032
|
}
|
|
@@ -5051,7 +5076,7 @@ class A extends M {
|
|
|
5051
5076
|
this._value = !this._value, this._onChange(this._value);
|
|
5052
5077
|
}
|
|
5053
5078
|
}
|
|
5054
|
-
class
|
|
5079
|
+
class gn extends M {
|
|
5055
5080
|
constructor({
|
|
5056
5081
|
initialValue: t = null,
|
|
5057
5082
|
effectiveValue: e,
|
|
@@ -5132,7 +5157,7 @@ class x extends M {
|
|
|
5132
5157
|
this._value = null;
|
|
5133
5158
|
}
|
|
5134
5159
|
}
|
|
5135
|
-
class
|
|
5160
|
+
class Ai {
|
|
5136
5161
|
constructor(t, e, i) {
|
|
5137
5162
|
this.preferences = t, this.settings = e, this.metadata = i;
|
|
5138
5163
|
}
|
|
@@ -5268,7 +5293,7 @@ class Ri {
|
|
|
5268
5293
|
});
|
|
5269
5294
|
}
|
|
5270
5295
|
get textAlign() {
|
|
5271
|
-
return new
|
|
5296
|
+
return new gn({
|
|
5272
5297
|
initialValue: this.preferences.textAlign,
|
|
5273
5298
|
effectiveValue: this.settings.textAlign || tt.start,
|
|
5274
5299
|
isEffective: this.isDisplayTransformable,
|
|
@@ -5313,7 +5338,7 @@ class Ri {
|
|
|
5313
5338
|
});
|
|
5314
5339
|
}
|
|
5315
5340
|
}
|
|
5316
|
-
const
|
|
5341
|
+
const yn = (r) => {
|
|
5317
5342
|
if ("blob" in r && r.blob.type)
|
|
5318
5343
|
return r.blob.type;
|
|
5319
5344
|
if (r.as === "script")
|
|
@@ -5323,22 +5348,22 @@ const gn = (r) => {
|
|
|
5323
5348
|
if (t.endsWith(".css")) return "text/css";
|
|
5324
5349
|
if ([".js", ".mjs", ".cjs"].some((e) => t.endsWith(e))) return "text/javascript";
|
|
5325
5350
|
}
|
|
5326
|
-
},
|
|
5351
|
+
}, bn = (r, t) => {
|
|
5327
5352
|
t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
|
|
5328
5353
|
e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && r.setAttribute(e, "") : r.setAttribute(e, i));
|
|
5329
5354
|
});
|
|
5330
|
-
},
|
|
5355
|
+
}, Fs = (r, t, e) => {
|
|
5331
5356
|
const i = r.createElement("script");
|
|
5332
5357
|
i.dataset.readium = "true", t.id && (i.id = t.id);
|
|
5333
|
-
const n = t.type ||
|
|
5334
|
-
return n && (i.type = n),
|
|
5335
|
-
},
|
|
5358
|
+
const n = t.type || yn(t);
|
|
5359
|
+
return n && (i.type = n), bn(i, t), i.src = e, i;
|
|
5360
|
+
}, Ti = (r, t, e) => {
|
|
5336
5361
|
const i = r.createElement("link");
|
|
5337
5362
|
i.dataset.readium = "true", t.id && (i.id = t.id), t.rel && (i.rel = t.rel);
|
|
5338
|
-
const n = t.type ||
|
|
5339
|
-
return n && (i.type = n),
|
|
5363
|
+
const n = t.type || yn(t);
|
|
5364
|
+
return n && (i.type = n), bn(i, t), i.href = e, i;
|
|
5340
5365
|
};
|
|
5341
|
-
class
|
|
5366
|
+
class wn {
|
|
5342
5367
|
constructor(t) {
|
|
5343
5368
|
this.blobStore = /* @__PURE__ */ new Map(), this.createdBlobUrls = /* @__PURE__ */ new Set(), this.allowedDomains = [], this.injectableIdCounter = 0, this.allowedDomains = (t.allowedDomains || []).map((e) => {
|
|
5344
5369
|
try {
|
|
@@ -5419,14 +5444,14 @@ class bn {
|
|
|
5419
5444
|
...e.attributes,
|
|
5420
5445
|
as: e.as
|
|
5421
5446
|
}
|
|
5422
|
-
}, s =
|
|
5447
|
+
}, s = Ti(t, n, i);
|
|
5423
5448
|
t.head.appendChild(s);
|
|
5424
5449
|
}
|
|
5425
5450
|
createElement(t, e, i) {
|
|
5426
5451
|
if (e.as === "script")
|
|
5427
|
-
return
|
|
5452
|
+
return Fs(t, e, i);
|
|
5428
5453
|
if (e.as === "link")
|
|
5429
|
-
return
|
|
5454
|
+
return Ti(t, e, i);
|
|
5430
5455
|
throw new Error(`Unsupported element type: ${e.as}`);
|
|
5431
5456
|
}
|
|
5432
5457
|
async applyRule(t, e) {
|
|
@@ -5483,8 +5508,8 @@ class bn {
|
|
|
5483
5508
|
}
|
|
5484
5509
|
}
|
|
5485
5510
|
}
|
|
5486
|
-
const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ct = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "),
|
|
5487
|
-
* Readium CSS v.2.0.
|
|
5511
|
+
const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ct = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), Ws = `/*!
|
|
5512
|
+
* Readium CSS v.2.0.0
|
|
5488
5513
|
* Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
|
|
5489
5514
|
* Use of this source code is governed by a BSD-style license which is detailed in the
|
|
5490
5515
|
* LICENSE file present in the project repository where this source code is maintained.
|
|
@@ -5533,11 +5558,11 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5533
5558
|
:root[style*="--USER__bodyHyphens"] li,
|
|
5534
5559
|
:root[style*="--USER__bodyHyphens"] div,
|
|
5535
5560
|
:root[style*="--USER__bodyHyphens"] dd{
|
|
5536
|
-
-webkit-hyphens:
|
|
5537
|
-
-moz-hyphens:
|
|
5538
|
-
-ms-hyphens:
|
|
5539
|
-
-epub-hyphens:
|
|
5540
|
-
hyphens:
|
|
5561
|
+
-webkit-hyphens:inherit;
|
|
5562
|
+
-moz-hyphens:inherit;
|
|
5563
|
+
-ms-hyphens:inherit;
|
|
5564
|
+
-epub-hyphens:inherit;
|
|
5565
|
+
hyphens:inherit;
|
|
5541
5566
|
}
|
|
5542
5567
|
|
|
5543
5568
|
:root[style*="--USER__fontFamily"]{
|
|
@@ -5617,7 +5642,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5617
5642
|
:root[style*="--USER__lineHeight"] p,
|
|
5618
5643
|
:root[style*="--USER__lineHeight"] li,
|
|
5619
5644
|
:root[style*="--USER__lineHeight"] div{
|
|
5620
|
-
line-height:
|
|
5645
|
+
line-height:inherit;
|
|
5621
5646
|
}
|
|
5622
5647
|
|
|
5623
5648
|
:root[style*="--USER__paraSpacing"] p{
|
|
@@ -5637,7 +5662,8 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5637
5662
|
text-indent:var(--USER__paraIndent) !important;
|
|
5638
5663
|
}
|
|
5639
5664
|
|
|
5640
|
-
:root[style*="--USER__paraIndent"] p
|
|
5665
|
+
:root[style*="--USER__paraIndent"] p *,
|
|
5666
|
+
:root[style*="--USER__paraIndent"] p:first-letter{
|
|
5641
5667
|
text-indent:0 !important;
|
|
5642
5668
|
}
|
|
5643
5669
|
|
|
@@ -5652,7 +5678,7 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5652
5678
|
:root[style*="--USER__wordSpacing"] div,
|
|
5653
5679
|
:root[style*="--USER__wordSpacing"] dt,
|
|
5654
5680
|
:root[style*="--USER__wordSpacing"] dd{
|
|
5655
|
-
word-spacing:var(--USER__wordSpacing)
|
|
5681
|
+
word-spacing:var(--USER__wordSpacing);
|
|
5656
5682
|
}
|
|
5657
5683
|
|
|
5658
5684
|
:root[style*="--USER__letterSpacing"] h1,
|
|
@@ -5666,8 +5692,8 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5666
5692
|
:root[style*="--USER__letterSpacing"] div,
|
|
5667
5693
|
:root[style*="--USER__letterSpacing"] dt,
|
|
5668
5694
|
:root[style*="--USER__letterSpacing"] dd{
|
|
5669
|
-
letter-spacing:var(--USER__letterSpacing)
|
|
5670
|
-
font-variant:none
|
|
5695
|
+
letter-spacing:var(--USER__letterSpacing);
|
|
5696
|
+
font-variant:none;
|
|
5671
5697
|
}
|
|
5672
5698
|
|
|
5673
5699
|
:root[style*="--USER__fontWeight"] body{
|
|
@@ -5756,11 +5782,11 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5756
5782
|
|
|
5757
5783
|
:root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
|
|
5758
5784
|
-webkit-text-zoom:normal;
|
|
5759
|
-
}`,
|
|
5785
|
+
}`, vn = '!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})()));', Us = `// WebPub-specific setup - no execution blocking needed
|
|
5760
5786
|
window._readium_blockedEvents = [];
|
|
5761
5787
|
window._readium_blockEvents = false; // WebPub doesn't need event blocking
|
|
5762
5788
|
window._readium_eventBlocker = null;
|
|
5763
|
-
`,
|
|
5789
|
+
`, Sn = `(function() {
|
|
5764
5790
|
if(window.onload) window.onload = new Proxy(window.onload, {
|
|
5765
5791
|
apply: function(target, receiver, args) {
|
|
5766
5792
|
if(!window._readium_blockEvents) {
|
|
@@ -5774,21 +5800,21 @@ window._readium_eventBlocker = null;
|
|
|
5774
5800
|
});
|
|
5775
5801
|
})();
|
|
5776
5802
|
`;
|
|
5777
|
-
function
|
|
5803
|
+
function Bs(r) {
|
|
5778
5804
|
const t = r.filter((s) => s.mediaType.isHTML).map((s) => s.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
|
|
5779
5805
|
// CSS Selector Generator - always injected
|
|
5780
5806
|
{
|
|
5781
5807
|
id: "css-selector-generator",
|
|
5782
5808
|
as: "script",
|
|
5783
5809
|
target: "head",
|
|
5784
|
-
blob: new Blob([vt(
|
|
5810
|
+
blob: new Blob([vt(vn)], { type: "text/javascript" })
|
|
5785
5811
|
},
|
|
5786
5812
|
// WebPub Execution - always injected (sets up event blocking to false)
|
|
5787
5813
|
{
|
|
5788
5814
|
id: "webpub-execution",
|
|
5789
5815
|
as: "script",
|
|
5790
5816
|
target: "head",
|
|
5791
|
-
blob: new Blob([vt(
|
|
5817
|
+
blob: new Blob([vt(Us)], { type: "text/javascript" })
|
|
5792
5818
|
}
|
|
5793
5819
|
], n = [
|
|
5794
5820
|
// Onload Proxy - conditional (has executable scripts)
|
|
@@ -5796,7 +5822,7 @@ function Fs(r) {
|
|
|
5796
5822
|
id: "onload-proxy",
|
|
5797
5823
|
as: "script",
|
|
5798
5824
|
target: "head",
|
|
5799
|
-
blob: new Blob([vt(
|
|
5825
|
+
blob: new Blob([vt(Sn)], { type: "text/javascript" }),
|
|
5800
5826
|
condition: (s) => !!(s.querySelector("script") || s.querySelector("body[onload]:not(body[onload=''])"))
|
|
5801
5827
|
},
|
|
5802
5828
|
// Readium CSS WebPub - always injected
|
|
@@ -5804,7 +5830,7 @@ function Fs(r) {
|
|
|
5804
5830
|
id: "readium-css-webpub",
|
|
5805
5831
|
as: "link",
|
|
5806
5832
|
target: "head",
|
|
5807
|
-
blob: new Blob([Ct(
|
|
5833
|
+
blob: new Blob([Ct(Ws)], { type: "text/css" }),
|
|
5808
5834
|
rel: "stylesheet"
|
|
5809
5835
|
}
|
|
5810
5836
|
];
|
|
@@ -5816,7 +5842,7 @@ function Fs(r) {
|
|
|
5816
5842
|
}
|
|
5817
5843
|
];
|
|
5818
5844
|
}
|
|
5819
|
-
class
|
|
5845
|
+
class Hs {
|
|
5820
5846
|
constructor(t) {
|
|
5821
5847
|
if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
|
|
5822
5848
|
throw new Error("onDetected callback is required");
|
|
@@ -5848,11 +5874,11 @@ class Ws {
|
|
|
5848
5874
|
this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
|
|
5849
5875
|
}
|
|
5850
5876
|
}
|
|
5851
|
-
let
|
|
5852
|
-
function
|
|
5853
|
-
return ++
|
|
5877
|
+
let Vs = 0;
|
|
5878
|
+
function js() {
|
|
5879
|
+
return ++Vs;
|
|
5854
5880
|
}
|
|
5855
|
-
const
|
|
5881
|
+
const $s = `
|
|
5856
5882
|
onmessage = function(event) {
|
|
5857
5883
|
var action = event.data;
|
|
5858
5884
|
var startTime = performance.now()
|
|
@@ -5863,7 +5889,7 @@ onmessage = function(event) {
|
|
|
5863
5889
|
time: performance.now() - startTime
|
|
5864
5890
|
})
|
|
5865
5891
|
}
|
|
5866
|
-
`,
|
|
5892
|
+
`, Ke = class Ke {
|
|
5867
5893
|
constructor(t, e) {
|
|
5868
5894
|
this.callbacks = /* @__PURE__ */ new Map(), this.worker = t, this.blobUrl = e, this.worker.onmessage = (i) => {
|
|
5869
5895
|
const n = i.data, s = n.id, o = this.callbacks.get(n.id);
|
|
@@ -5873,7 +5899,7 @@ onmessage = function(event) {
|
|
|
5873
5899
|
}, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
|
|
5874
5900
|
}
|
|
5875
5901
|
async send(t, ...e) {
|
|
5876
|
-
const i =
|
|
5902
|
+
const i = js();
|
|
5877
5903
|
return new Promise((n, s) => {
|
|
5878
5904
|
this.callbacks.set(i, n), this.worker.postMessage({
|
|
5879
5905
|
id: i,
|
|
@@ -5888,14 +5914,14 @@ onmessage = function(event) {
|
|
|
5888
5914
|
this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
|
|
5889
5915
|
}
|
|
5890
5916
|
};
|
|
5891
|
-
|
|
5892
|
-
let se =
|
|
5893
|
-
function
|
|
5917
|
+
Ke.workerScript = $s;
|
|
5918
|
+
let se = Ke;
|
|
5919
|
+
function Xe(r) {
|
|
5894
5920
|
return typeof window < "u" && console ? console[r] : (...t) => {
|
|
5895
5921
|
};
|
|
5896
5922
|
}
|
|
5897
|
-
const
|
|
5898
|
-
async function
|
|
5923
|
+
const Xs = Xe("log"), Mi = Xe("table"), Gs = Xe("clear");
|
|
5924
|
+
async function Ni() {
|
|
5899
5925
|
if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
|
|
5900
5926
|
try {
|
|
5901
5927
|
return await Promise.race([
|
|
@@ -5907,10 +5933,10 @@ async function Mi() {
|
|
|
5907
5933
|
}
|
|
5908
5934
|
return !1;
|
|
5909
5935
|
}
|
|
5910
|
-
function
|
|
5936
|
+
function Ys(r) {
|
|
5911
5937
|
return r.excludes.some((t) => t()) ? !1 : r.includes.some((t) => t());
|
|
5912
5938
|
}
|
|
5913
|
-
class
|
|
5939
|
+
class qs {
|
|
5914
5940
|
constructor(t = {}) {
|
|
5915
5941
|
if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
|
|
5916
5942
|
onDetected: t.onDetected || (() => {
|
|
@@ -5956,11 +5982,11 @@ class Xs {
|
|
|
5956
5982
|
return (await this.workerConsole.table(t)).time;
|
|
5957
5983
|
} catch {
|
|
5958
5984
|
const i = performance.now();
|
|
5959
|
-
return
|
|
5985
|
+
return Mi(t), performance.now() - i;
|
|
5960
5986
|
}
|
|
5961
5987
|
else {
|
|
5962
5988
|
const e = performance.now();
|
|
5963
|
-
return
|
|
5989
|
+
return Mi(t), performance.now() - e;
|
|
5964
5990
|
}
|
|
5965
5991
|
}
|
|
5966
5992
|
/**
|
|
@@ -5972,14 +5998,14 @@ class Xs {
|
|
|
5972
5998
|
return (await this.workerConsole.log(t)).time;
|
|
5973
5999
|
{
|
|
5974
6000
|
const e = performance.now();
|
|
5975
|
-
return
|
|
6001
|
+
return Xs(t), performance.now() - e;
|
|
5976
6002
|
}
|
|
5977
6003
|
}
|
|
5978
6004
|
/**
|
|
5979
6005
|
* Check if performance-based detection is enabled for current browser
|
|
5980
6006
|
*/
|
|
5981
6007
|
isPerformanceDetectionEnabled() {
|
|
5982
|
-
return
|
|
6008
|
+
return Ys({
|
|
5983
6009
|
includes: [
|
|
5984
6010
|
() => !!J.UA.Chrome,
|
|
5985
6011
|
() => !!J.UA.Chromium,
|
|
@@ -6002,14 +6028,14 @@ class Xs {
|
|
|
6002
6028
|
if (!this.isPerformanceDetectionEnabled())
|
|
6003
6029
|
return !1;
|
|
6004
6030
|
const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
|
|
6005
|
-
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() :
|
|
6031
|
+
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Gs(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Ni() : t > this.maxPrintTime * 10;
|
|
6006
6032
|
}
|
|
6007
6033
|
/**
|
|
6008
6034
|
* Debugger-based detection (fallback method)
|
|
6009
6035
|
* WARNING: This method impacts user experience
|
|
6010
6036
|
*/
|
|
6011
6037
|
async checkDebuggerBased() {
|
|
6012
|
-
if (!this.isDebuggerDetectionEnabled() || await
|
|
6038
|
+
if (!this.isDebuggerDetectionEnabled() || await Ni())
|
|
6013
6039
|
return !1;
|
|
6014
6040
|
const t = performance.now();
|
|
6015
6041
|
try {
|
|
@@ -6057,7 +6083,7 @@ class Xs {
|
|
|
6057
6083
|
this.intervalId && (clearInterval(this.intervalId), this.intervalId = void 0), this.workerConsole && (this.workerConsole.destroy(), this.workerConsole = void 0), this.isOpen = !1, this.checkCount = 0;
|
|
6058
6084
|
}
|
|
6059
6085
|
}
|
|
6060
|
-
class
|
|
6086
|
+
class Ks {
|
|
6061
6087
|
constructor(t) {
|
|
6062
6088
|
if (this.detected = !1, !t.onDetected)
|
|
6063
6089
|
throw new Error("onDetected callback is required");
|
|
@@ -6092,7 +6118,7 @@ class Gs {
|
|
|
6092
6118
|
this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
|
|
6093
6119
|
}
|
|
6094
6120
|
}
|
|
6095
|
-
class
|
|
6121
|
+
class Js {
|
|
6096
6122
|
constructor(t = {}) {
|
|
6097
6123
|
this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
|
|
6098
6124
|
}
|
|
@@ -6118,7 +6144,7 @@ class Ys {
|
|
|
6118
6144
|
this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
|
|
6119
6145
|
}
|
|
6120
6146
|
}
|
|
6121
|
-
class
|
|
6147
|
+
class Zs {
|
|
6122
6148
|
constructor(t = {}) {
|
|
6123
6149
|
this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
|
|
6124
6150
|
}
|
|
@@ -6138,7 +6164,7 @@ class qs {
|
|
|
6138
6164
|
}
|
|
6139
6165
|
}
|
|
6140
6166
|
const ot = "readium:navigator:suspiciousActivity";
|
|
6141
|
-
class
|
|
6167
|
+
class Ge {
|
|
6142
6168
|
dispatchSuspiciousActivity(t, e) {
|
|
6143
6169
|
const i = new CustomEvent(ot, {
|
|
6144
6170
|
detail: {
|
|
@@ -6150,7 +6176,7 @@ class Xe {
|
|
|
6150
6176
|
window.dispatchEvent(i);
|
|
6151
6177
|
}
|
|
6152
6178
|
constructor(t = {}) {
|
|
6153
|
-
t.monitorDevTools && (this.devToolsDetector = new
|
|
6179
|
+
t.monitorDevTools && (this.devToolsDetector = new qs({
|
|
6154
6180
|
onDetected: () => {
|
|
6155
6181
|
this.dispatchSuspiciousActivity("developer_tools", {
|
|
6156
6182
|
targetFrameSrc: "",
|
|
@@ -6163,20 +6189,20 @@ class Xe {
|
|
|
6163
6189
|
metaKey: !1
|
|
6164
6190
|
});
|
|
6165
6191
|
}
|
|
6166
|
-
})), t.checkAutomation && (this.automationDetector = new
|
|
6192
|
+
})), t.checkAutomation && (this.automationDetector = new Hs({
|
|
6167
6193
|
onDetected: (e) => {
|
|
6168
6194
|
this.dispatchSuspiciousActivity("automation_detected", { tool: e });
|
|
6169
6195
|
}
|
|
6170
|
-
})), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new
|
|
6196
|
+
})), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Ks({
|
|
6171
6197
|
onDetected: (e) => {
|
|
6172
6198
|
this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
|
|
6173
6199
|
}
|
|
6174
|
-
})), t.protectPrinting?.disable && (this.printProtector = new
|
|
6200
|
+
})), t.protectPrinting?.disable && (this.printProtector = new Js({
|
|
6175
6201
|
...t.protectPrinting,
|
|
6176
6202
|
onPrintAttempt: () => {
|
|
6177
6203
|
this.dispatchSuspiciousActivity("print", {});
|
|
6178
6204
|
}
|
|
6179
|
-
})), t.disableContextMenu && (this.contextMenuProtector = new
|
|
6205
|
+
})), t.disableContextMenu && (this.contextMenuProtector = new Zs({
|
|
6180
6206
|
onContextMenuBlocked: (e) => {
|
|
6181
6207
|
this.dispatchSuspiciousActivity("context_menu", e);
|
|
6182
6208
|
}
|
|
@@ -6187,9 +6213,9 @@ class Xe {
|
|
|
6187
6213
|
}
|
|
6188
6214
|
}
|
|
6189
6215
|
const at = "readium:navigator:keyboardPeripheral";
|
|
6190
|
-
class
|
|
6216
|
+
class Ye {
|
|
6191
6217
|
constructor(t = {}) {
|
|
6192
|
-
this.keyManager = new
|
|
6218
|
+
this.keyManager = new ln(), this.setupKeyboardPeripherals(t.keyboardPeripherals || []);
|
|
6193
6219
|
}
|
|
6194
6220
|
setupKeyboardPeripherals(t) {
|
|
6195
6221
|
if (t.length > 0) {
|
|
@@ -6212,7 +6238,7 @@ class Ge {
|
|
|
6212
6238
|
this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = void 0);
|
|
6213
6239
|
}
|
|
6214
6240
|
}
|
|
6215
|
-
const
|
|
6241
|
+
const Qs = (r) => ({
|
|
6216
6242
|
frameLoaded: r.frameLoaded || (() => {
|
|
6217
6243
|
}),
|
|
6218
6244
|
positionChanged: r.positionChanged || (() => {
|
|
@@ -6235,27 +6261,27 @@ const Ks = (r) => ({
|
|
|
6235
6261
|
peripheral: r.peripheral || (() => {
|
|
6236
6262
|
})
|
|
6237
6263
|
});
|
|
6238
|
-
class
|
|
6264
|
+
class tr extends cn {
|
|
6239
6265
|
constructor(t, e, i, n = void 0, s = { preferences: {}, defaults: {} }) {
|
|
6240
6266
|
super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
|
|
6241
6267
|
readingOrder: [],
|
|
6242
6268
|
progressions: /* @__PURE__ */ new Map(),
|
|
6243
6269
|
positions: null
|
|
6244
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
6245
|
-
rsProperties: new
|
|
6246
|
-
userProperties: new
|
|
6270
|
+
}, this.pub = e, this.container = t, this.listeners = Qs(i), this._preferences = new Nt(s.preferences), this._defaults = new Ds(s.defaults), this._settings = new Ri(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new Ns({
|
|
6271
|
+
rsProperties: new Ms({ experiments: this._settings.experiments || null }),
|
|
6272
|
+
userProperties: new fn({ zoom: this._settings.zoom })
|
|
6247
6273
|
});
|
|
6248
|
-
const o =
|
|
6249
|
-
if (this._injector = new
|
|
6274
|
+
const o = Bs(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
|
|
6275
|
+
if (this._injector = new wn({
|
|
6250
6276
|
rules: [...o, ...a.rules],
|
|
6251
6277
|
allowedDomains: a.allowedDomains
|
|
6252
6278
|
}), this._contentProtection = s.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
6253
6279
|
this._contentProtection,
|
|
6254
6280
|
s.keyboardPeripherals || []
|
|
6255
|
-
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new
|
|
6281
|
+
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ge(this._contentProtection), this._suspiciousActivityListener = (l) => {
|
|
6256
6282
|
const { type: h, ...c } = l.detail;
|
|
6257
6283
|
h === "context_menu" ? this.listeners.contextMenu(c) : this.listeners.contentProtection(h, c);
|
|
6258
|
-
}, window.addEventListener(ot, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new
|
|
6284
|
+
}, window.addEventListener(ot, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new Ye({
|
|
6259
6285
|
keyboardPeripherals: this._keyboardPeripherals
|
|
6260
6286
|
}), this._keyboardPeripheralListener = (l) => {
|
|
6261
6287
|
const h = l.detail;
|
|
@@ -6270,7 +6296,7 @@ class Js extends hn {
|
|
|
6270
6296
|
async load() {
|
|
6271
6297
|
await this.updateCSS(!1);
|
|
6272
6298
|
const t = this.compileCSSProperties(this._css);
|
|
6273
|
-
this.framePool = new
|
|
6299
|
+
this.framePool = new ks(
|
|
6274
6300
|
this.container,
|
|
6275
6301
|
t,
|
|
6276
6302
|
this._injector,
|
|
@@ -6283,13 +6309,13 @@ class Js extends hn {
|
|
|
6283
6309
|
return Object.freeze({ ...this._settings });
|
|
6284
6310
|
}
|
|
6285
6311
|
get preferencesEditor() {
|
|
6286
|
-
return this._preferencesEditor === null && (this._preferencesEditor = new
|
|
6312
|
+
return this._preferencesEditor === null && (this._preferencesEditor = new Ai(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
|
|
6287
6313
|
}
|
|
6288
6314
|
async submitPreferences(t) {
|
|
6289
6315
|
this._preferences = this._preferences.merging(t), await this.applyPreferences();
|
|
6290
6316
|
}
|
|
6291
6317
|
async applyPreferences() {
|
|
6292
|
-
this._settings = new
|
|
6318
|
+
this._settings = new Ri(this._preferences, this._defaults, this.hasDisplayTransformability), this._preferencesEditor !== null && (this._preferencesEditor = new Ai(this._preferences, this.settings, this.pub.metadata)), await this.updateCSS(!0);
|
|
6293
6319
|
}
|
|
6294
6320
|
async updateCSS(t) {
|
|
6295
6321
|
this._css.update(this._settings), t && await this.commitCSS(this._css);
|
|
@@ -6341,42 +6367,42 @@ class Js extends hn {
|
|
|
6341
6367
|
case "tap":
|
|
6342
6368
|
const n = e;
|
|
6343
6369
|
if (n.interactiveElement) {
|
|
6344
|
-
const
|
|
6370
|
+
const l = new DOMParser().parseFromString(
|
|
6345
6371
|
n.interactiveElement,
|
|
6346
6372
|
"text/html"
|
|
6347
6373
|
).body.children[0];
|
|
6348
|
-
if (
|
|
6349
|
-
const
|
|
6350
|
-
if (
|
|
6374
|
+
if (l.nodeType === l.ELEMENT_NODE && l.nodeName === "A" && l.hasAttribute("href")) {
|
|
6375
|
+
const h = l.attributes.getNamedItem("href")?.value;
|
|
6376
|
+
if (h.startsWith("#"))
|
|
6351
6377
|
this.go(this.currentLocation.copyWithLocations({
|
|
6352
|
-
fragments: [
|
|
6378
|
+
fragments: [h.substring(1)]
|
|
6353
6379
|
}), !1, () => {
|
|
6354
6380
|
});
|
|
6355
|
-
else if (
|
|
6381
|
+
else if (h.startsWith("mailto:") || h.startsWith("tel:"))
|
|
6356
6382
|
this.listeners.handleLocator(new $({
|
|
6357
|
-
href:
|
|
6383
|
+
href: h
|
|
6358
6384
|
}).locator);
|
|
6359
6385
|
else
|
|
6360
6386
|
try {
|
|
6361
|
-
let
|
|
6362
|
-
if (
|
|
6363
|
-
|
|
6387
|
+
let c;
|
|
6388
|
+
if (h.startsWith("http://") || h.startsWith("https://"))
|
|
6389
|
+
c = h;
|
|
6364
6390
|
else if (this.currentLocation.href.startsWith("http://") || this.currentLocation.href.startsWith("https://")) {
|
|
6365
|
-
const
|
|
6366
|
-
|
|
6391
|
+
const p = new URL(this.currentLocation.href);
|
|
6392
|
+
c = new URL(h, p).href;
|
|
6367
6393
|
} else
|
|
6368
|
-
|
|
6369
|
-
const
|
|
6370
|
-
|
|
6371
|
-
}) : (console.warn(`Internal link not found in readingOrder: ${
|
|
6372
|
-
href:
|
|
6394
|
+
c = Gt.join(Gt.dirname(this.currentLocation.href), h);
|
|
6395
|
+
const u = this.pub.readingOrder.findWithHref(c);
|
|
6396
|
+
u ? this.goLink(u, !1, () => {
|
|
6397
|
+
}) : (console.warn(`Internal link not found in readingOrder: ${c}`), this.listeners.handleLocator(new $({
|
|
6398
|
+
href: h
|
|
6373
6399
|
}).locator));
|
|
6374
|
-
} catch (
|
|
6375
|
-
console.warn(`Couldn't resolve internal link for ${
|
|
6376
|
-
href:
|
|
6400
|
+
} catch (c) {
|
|
6401
|
+
console.warn(`Couldn't resolve internal link for ${h}: ${c}`), this.listeners.handleLocator(new $({
|
|
6402
|
+
href: h
|
|
6377
6403
|
}).locator);
|
|
6378
6404
|
}
|
|
6379
|
-
} else console.log("Clicked on",
|
|
6405
|
+
} else console.log("Clicked on", l);
|
|
6380
6406
|
} else if (t === "click" ? this.listeners.click(n) : this.listeners.tap(n)) break;
|
|
6381
6407
|
break;
|
|
6382
6408
|
case "scroll":
|
|
@@ -6396,7 +6422,11 @@ class Js extends hn {
|
|
|
6396
6422
|
this.listeners.contextMenu(e);
|
|
6397
6423
|
break;
|
|
6398
6424
|
case "keyboard_peripherals":
|
|
6399
|
-
|
|
6425
|
+
const o = e, a = { ...o, interactiveElement: void 0 };
|
|
6426
|
+
o.interactiveElement && (a.interactiveElement = new DOMParser().parseFromString(
|
|
6427
|
+
o.interactiveElement,
|
|
6428
|
+
"text/html"
|
|
6429
|
+
).body.children[0]), this.listeners.peripheral(a);
|
|
6400
6430
|
break;
|
|
6401
6431
|
case "log":
|
|
6402
6432
|
console.log(this.framePool.currentFrames[0]?.source?.split("/")[3], ...e);
|
|
@@ -6407,7 +6437,7 @@ class Js extends hn {
|
|
|
6407
6437
|
}
|
|
6408
6438
|
}
|
|
6409
6439
|
determineModules() {
|
|
6410
|
-
const t =
|
|
6440
|
+
const t = ms.slice(), e = bt(this.pub.metadata);
|
|
6411
6441
|
return e === "cjk-vertical" || e === "mongolian-vertical" ? t.map((i) => i === "webpub_snapper" ? "cjk_vertical_snapper" : i) : t;
|
|
6412
6442
|
}
|
|
6413
6443
|
attachListener() {
|
|
@@ -6546,7 +6576,7 @@ class Js extends hn {
|
|
|
6546
6576
|
});
|
|
6547
6577
|
}
|
|
6548
6578
|
}
|
|
6549
|
-
const
|
|
6579
|
+
const Dr = tr, er = (r) => {
|
|
6550
6580
|
const t = r.join(" ");
|
|
6551
6581
|
return [
|
|
6552
6582
|
// 'self' is useless because the document is loaded from a blob: URL
|
|
@@ -6571,7 +6601,7 @@ const Nr = Js, Zs = (r) => {
|
|
|
6571
6601
|
//`report-uri ?`,
|
|
6572
6602
|
].join("; ");
|
|
6573
6603
|
};
|
|
6574
|
-
class
|
|
6604
|
+
class Pn {
|
|
6575
6605
|
constructor(t, e, i, n) {
|
|
6576
6606
|
this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
|
|
6577
6607
|
}
|
|
@@ -6625,7 +6655,7 @@ class Sn {
|
|
|
6625
6655
|
u.href = i, u.dataset.readium = "true", t.head.firstChild.before(u);
|
|
6626
6656
|
}
|
|
6627
6657
|
const c = t.createElement("meta");
|
|
6628
|
-
return c.httpEquiv = "Content-Security-Policy", c.content =
|
|
6658
|
+
return c.httpEquiv = "Content-Security-Policy", c.content = er(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
|
|
6629
6659
|
new Blob([new XMLSerializer().serializeToString(t)], {
|
|
6630
6660
|
type: n.isHTML ? n.string : "application/xhtml+xml"
|
|
6631
6661
|
// Fallback to XHTML
|
|
@@ -6633,7 +6663,7 @@ class Sn {
|
|
|
6633
6663
|
);
|
|
6634
6664
|
}
|
|
6635
6665
|
}
|
|
6636
|
-
class
|
|
6666
|
+
class En {
|
|
6637
6667
|
constructor(t, e = {}, i = []) {
|
|
6638
6668
|
this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
|
|
6639
6669
|
}
|
|
@@ -6733,8 +6763,8 @@ class Pn {
|
|
|
6733
6763
|
return this.loader;
|
|
6734
6764
|
}
|
|
6735
6765
|
}
|
|
6736
|
-
const
|
|
6737
|
-
class
|
|
6766
|
+
const zi = 5, Ii = 3;
|
|
6767
|
+
class ir {
|
|
6738
6768
|
constructor(t, e, i, n, s, o) {
|
|
6739
6769
|
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 = s || {}, this.keyboardPeripheralsConfig = o || [];
|
|
6740
6770
|
}
|
|
@@ -6761,7 +6791,7 @@ class Qs {
|
|
|
6761
6791
|
const a = new Promise(async (l, h) => {
|
|
6762
6792
|
const c = [], u = [];
|
|
6763
6793
|
this.positions.forEach((d, f) => {
|
|
6764
|
-
(f > s +
|
|
6794
|
+
(f > s + zi || f < s - zi) && (c.includes(d.href) || c.push(d.href)), f < s + Ii && f > s - Ii && (u.includes(d.href) || u.push(d.href));
|
|
6765
6795
|
}), c.forEach(async (d) => {
|
|
6766
6796
|
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 }));
|
|
6767
6797
|
}), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => {
|
|
@@ -6786,7 +6816,7 @@ class Qs {
|
|
|
6786
6816
|
const f = t.readingOrder.findWithHref(d);
|
|
6787
6817
|
if (!f) return;
|
|
6788
6818
|
if (!this.blobs.has(d)) {
|
|
6789
|
-
const R = await new
|
|
6819
|
+
const R = await new Pn(
|
|
6790
6820
|
t,
|
|
6791
6821
|
this.currentBaseURL || "",
|
|
6792
6822
|
f,
|
|
@@ -6797,7 +6827,7 @@ class Qs {
|
|
|
6797
6827
|
).build();
|
|
6798
6828
|
this.blobs.set(d, R);
|
|
6799
6829
|
}
|
|
6800
|
-
const w = new
|
|
6830
|
+
const w = new En(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
6801
6831
|
d !== o && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(d, w);
|
|
6802
6832
|
};
|
|
6803
6833
|
try {
|
|
@@ -6851,7 +6881,7 @@ class Qs {
|
|
|
6851
6881
|
}), t;
|
|
6852
6882
|
}
|
|
6853
6883
|
}
|
|
6854
|
-
class
|
|
6884
|
+
class nr {
|
|
6855
6885
|
constructor(t, e, i, n = {}, s = []) {
|
|
6856
6886
|
this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...s], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = i, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === N.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
|
|
6857
6887
|
}
|
|
@@ -7017,8 +7047,8 @@ class tr {
|
|
|
7017
7047
|
return this.loader;
|
|
7018
7048
|
}
|
|
7019
7049
|
}
|
|
7020
|
-
var
|
|
7021
|
-
class
|
|
7050
|
+
var sr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(sr || {}), rr = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(rr || {});
|
|
7051
|
+
class or {
|
|
7022
7052
|
constructor() {
|
|
7023
7053
|
this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
|
|
7024
7054
|
}
|
|
@@ -7066,7 +7096,7 @@ class nr {
|
|
|
7066
7096
|
};
|
|
7067
7097
|
}
|
|
7068
7098
|
}
|
|
7069
|
-
class
|
|
7099
|
+
class ar {
|
|
7070
7100
|
constructor() {
|
|
7071
7101
|
this._DOM = {
|
|
7072
7102
|
show: !1,
|
|
@@ -7084,8 +7114,8 @@ class sr {
|
|
|
7084
7114
|
return this._DOM;
|
|
7085
7115
|
}
|
|
7086
7116
|
}
|
|
7087
|
-
const
|
|
7088
|
-
class
|
|
7117
|
+
const Di = 6, ye = 1.02, Fi = 50;
|
|
7118
|
+
class lr {
|
|
7089
7119
|
constructor(t, e = !1) {
|
|
7090
7120
|
this.dragState = 0, this.minimumMoved = !1, this.pan = {
|
|
7091
7121
|
startX: 0,
|
|
@@ -7104,7 +7134,7 @@ class rr {
|
|
|
7104
7134
|
target: { X: 0, Y: 0 },
|
|
7105
7135
|
touchN: 0,
|
|
7106
7136
|
startTranslate: { X: 0, Y: 0 }
|
|
7107
|
-
}, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new
|
|
7137
|
+
}, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new or(), this.attachEvents(), e && (this.debugger = new ar());
|
|
7108
7138
|
}
|
|
7109
7139
|
get scale() {
|
|
7110
7140
|
return this._scale;
|
|
@@ -7200,7 +7230,7 @@ class rr {
|
|
|
7200
7230
|
*/
|
|
7201
7231
|
touchendHandler(t) {
|
|
7202
7232
|
if (t.stopPropagation(), !t.touches || t.touches.length === 0)
|
|
7203
|
-
this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) >
|
|
7233
|
+
this.pan.endX && !this.isScaled ? (this.pinch.touchN && (this.pan.endX = this.pan.startX), this.updateAfterDrag()) : !this.pinch.touchN && Math.abs(this.pan.overscrollX) > Fi && Math.abs(this.pan.overscrollY) < Fi / 2 && (this.pan.startX = 0, this.pan.endX = -this.pan.overscrollX, this.updateAfterDrag()), this.dragState = 0, this.minimumMoved = !1, this.clearPinch(), this.debugger?.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch1.style.display = "none", this.debugger.DOM.touch2.style.display = "none");
|
|
7204
7234
|
else if (t.touches.length === 1) {
|
|
7205
7235
|
this.dragState = 1, t.touches[0].identifier !== this.pan.touchID && (this.pan.touchID = t.touches[0].identifier), this.debugger?.show && (this.debugger.DOM.center.style.display = "none", this.debugger.DOM.touch2.style.display = "none", this.debugger.DOM.pinchTarget.style.display = "none");
|
|
7206
7236
|
const e = this.startTouch(t);
|
|
@@ -7223,7 +7253,7 @@ class rr {
|
|
|
7223
7253
|
if (this.dragState === 2 && i) {
|
|
7224
7254
|
if (this.pinch.touchN++, this.pinch.touchN < 4) return;
|
|
7225
7255
|
let o = i / this.pinch.startDistance * this.scale;
|
|
7226
|
-
o >=
|
|
7256
|
+
o >= Di && (o = Di), o <= ye && (o = 1), this.scale = o, this.pinch.startDistance = i, n = !0;
|
|
7227
7257
|
}
|
|
7228
7258
|
if (this.pan.letItGo === !1 && (this.pan.letItGo = Math.abs(this.pan.startY - e.Y) < Math.abs(this.pan.startX - e.X)), this.debugger?.show && (this.debugger.DOM.touch1.style.top = `${e.Y - 10}px`, this.debugger.DOM.touch1.style.left = `${e.X - 10}px`, this.debugger.DOM.touch1.innerText = `${e.X.toFixed(2)},${e.Y.toFixed(2)}`), this.dragState > 0 && this.isScaled || this.dragState > 1) {
|
|
7229
7259
|
if (this.dragState === 1) {
|
|
@@ -7306,7 +7336,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
|
|
|
7306
7336
|
}
|
|
7307
7337
|
}
|
|
7308
7338
|
var Me = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(Me || {}), Ne = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(Ne || {});
|
|
7309
|
-
class
|
|
7339
|
+
class hr {
|
|
7310
7340
|
// TODO getter
|
|
7311
7341
|
constructor(t) {
|
|
7312
7342
|
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`);
|
|
@@ -7351,13 +7381,13 @@ class or {
|
|
|
7351
7381
|
return this.spreads.find((e) => e.includes(t)) || void 0;
|
|
7352
7382
|
}
|
|
7353
7383
|
}
|
|
7354
|
-
const
|
|
7355
|
-
class
|
|
7384
|
+
const Wi = 8, Ui = 5, cr = 300, dr = 15e3, ur = 250, pr = 150, fr = 500;
|
|
7385
|
+
class mr {
|
|
7356
7386
|
constructor(t, e, i, n, s, o) {
|
|
7357
7387
|
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 = s || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Ne.auto, this.pub.metadata.effectiveReadingProgression !== N.rtl && this.pub.metadata.effectiveReadingProgression !== N.ltr)
|
|
7358
7388
|
throw Error("Unsupported reading progression for EPUB");
|
|
7359
|
-
this.spreader = new
|
|
7360
|
-
const l = new
|
|
7389
|
+
this.spreader = new hr(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 lr(this), this.pub.readingOrder.items.forEach((a) => {
|
|
7390
|
+
const l = new nr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
7361
7391
|
this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === Me.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
|
|
7362
7392
|
});
|
|
7363
7393
|
}
|
|
@@ -7382,7 +7412,7 @@ class ur {
|
|
|
7382
7412
|
const a = this.spreader.findByLink(o);
|
|
7383
7413
|
i.update(this.spreadPosition(a, o));
|
|
7384
7414
|
});
|
|
7385
|
-
},
|
|
7415
|
+
}, ur);
|
|
7386
7416
|
}
|
|
7387
7417
|
/**
|
|
7388
7418
|
* It is important that these values be cached to avoid spamming them on redraws, they are expensive.
|
|
@@ -7409,7 +7439,7 @@ class ur {
|
|
|
7409
7439
|
let i = "0";
|
|
7410
7440
|
this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
|
|
7411
7441
|
const n = {
|
|
7412
|
-
transition: t ? `all ${e ?
|
|
7442
|
+
transition: t ? `all ${e ? pr : fr}ms ease-out` : "all 0ms ease-out",
|
|
7413
7443
|
marginRight: this.rtl ? i : "0",
|
|
7414
7444
|
marginLeft: this.rtl ? "0" : i,
|
|
7415
7445
|
width: `${this.width / this.perPage * this.length}px`,
|
|
@@ -7569,7 +7599,7 @@ class ur {
|
|
|
7569
7599
|
const a = new Promise(async (l, h) => {
|
|
7570
7600
|
const c = [], u = [];
|
|
7571
7601
|
this.positions.forEach((d, f) => {
|
|
7572
|
-
(f > s +
|
|
7602
|
+
(f > s + Wi || f < s - Wi) && (c.includes(d.href) || c.push(d.href)), f < s + Ui && f > s - Ui && (u.includes(d.href) || u.push(d.href));
|
|
7573
7603
|
}), c.forEach(async (d) => {
|
|
7574
7604
|
u.includes(d) || this.pool.has(d) && (this.cancelShowing(d), await this.pool.get(d)?.unload());
|
|
7575
7605
|
}), this.currentBaseURL !== void 0 && t.baseURL !== this.currentBaseURL && (this.blobs.forEach((d) => URL.revokeObjectURL(d)), this.blobs.clear()), this.currentBaseURL = t.baseURL;
|
|
@@ -7577,7 +7607,7 @@ class ur {
|
|
|
7577
7607
|
const f = t.readingOrder.findIndexWithHref(d), w = t.readingOrder.items[f];
|
|
7578
7608
|
if (w) {
|
|
7579
7609
|
if (!this.blobs.has(d)) {
|
|
7580
|
-
const R = await new
|
|
7610
|
+
const R = await new Pn(
|
|
7581
7611
|
t,
|
|
7582
7612
|
this.currentBaseURL || "",
|
|
7583
7613
|
w,
|
|
@@ -7591,12 +7621,12 @@ class ur {
|
|
|
7591
7621
|
let Y = !1;
|
|
7592
7622
|
const lt = window.setTimeout(async () => {
|
|
7593
7623
|
this.delayedTimeout.set(d, 0);
|
|
7594
|
-
const ht = this.makeSpread(this.reAlign(f)),
|
|
7595
|
-
await
|
|
7596
|
-
},
|
|
7624
|
+
const ht = this.makeSpread(this.reAlign(f)), Ln = this.spreadPosition(ht, w), Je = this.pool.get(d);
|
|
7625
|
+
await Je.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Je.show(Ln), this.delayedShow.delete(d), Y = !0, P();
|
|
7626
|
+
}, cr);
|
|
7597
7627
|
setTimeout(() => {
|
|
7598
7628
|
!Y && this.delayedShow.has(d) && R(`Offscreen load timeout: ${d}`);
|
|
7599
|
-
},
|
|
7629
|
+
}, dr), this.delayedTimeout.set(d, lt);
|
|
7600
7630
|
}));
|
|
7601
7631
|
}
|
|
7602
7632
|
};
|
|
@@ -7695,20 +7725,20 @@ class zt {
|
|
|
7695
7725
|
return new zt(e);
|
|
7696
7726
|
}
|
|
7697
7727
|
}
|
|
7698
|
-
class
|
|
7728
|
+
class gr {
|
|
7699
7729
|
constructor(t) {
|
|
7700
|
-
this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = wt(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = z(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = z(t.fontWeight, st.range) || null, this.fontWidth = z(t.fontWidth, qt.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = wt(t.invertFilter) ?? !1, this.invertGaijiFilter = wt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = ge(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = he(t.textAlign, tt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = ge(
|
|
7730
|
+
this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = wt(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = z(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = z(t.fontWeight, st.range) || null, this.fontWidth = z(t.fontWidth, qt.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = wt(t.invertFilter) ?? !1, this.invertGaijiFilter = wt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = ge(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = he(t.textAlign, tt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = ge(Is(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ge(zs(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = mn(t.experiments) || null;
|
|
7701
7731
|
}
|
|
7702
7732
|
}
|
|
7703
|
-
const
|
|
7704
|
-
RS__backgroundColor:
|
|
7705
|
-
RS__textColor:
|
|
7706
|
-
RS__linkColor:
|
|
7707
|
-
RS__visitedColor:
|
|
7708
|
-
RS__selectionBackgroundColor:
|
|
7709
|
-
RS__selectionTextColor:
|
|
7733
|
+
const yr = "#FFFFFF", br = "#121212", wr = "#0000EE", vr = "#551A8B", Sr = "#b4d8fe", Pr = "inherit", pt = {
|
|
7734
|
+
RS__backgroundColor: yr,
|
|
7735
|
+
RS__textColor: br,
|
|
7736
|
+
RS__linkColor: wr,
|
|
7737
|
+
RS__visitedColor: vr,
|
|
7738
|
+
RS__selectionBackgroundColor: Sr,
|
|
7739
|
+
RS__selectionTextColor: Pr
|
|
7710
7740
|
};
|
|
7711
|
-
class
|
|
7741
|
+
class Bi {
|
|
7712
7742
|
constructor(t, e, i) {
|
|
7713
7743
|
this.preferences = t, this.settings = e, this.metadata = i, this.layout = this.metadata?.effectiveLayout || b.reflowable;
|
|
7714
7744
|
}
|
|
@@ -8100,7 +8130,7 @@ class Ui {
|
|
|
8100
8130
|
});
|
|
8101
8131
|
}
|
|
8102
8132
|
get textAlign() {
|
|
8103
|
-
return new
|
|
8133
|
+
return new gn({
|
|
8104
8134
|
initialValue: this.preferences.textAlign,
|
|
8105
8135
|
effectiveValue: this.settings.textAlign || tt.start,
|
|
8106
8136
|
isEffective: this.layout !== b.fixed && this.preferences.textAlign !== null,
|
|
@@ -8153,7 +8183,7 @@ class Ui {
|
|
|
8153
8183
|
});
|
|
8154
8184
|
}
|
|
8155
8185
|
}
|
|
8156
|
-
class
|
|
8186
|
+
class Hi {
|
|
8157
8187
|
constructor(t, e) {
|
|
8158
8188
|
this.backgroundColor = t.backgroundColor || e.backgroundColor || null, this.blendFilter = typeof t.blendFilter == "boolean" ? t.blendFilter : e.blendFilter ?? null, this.columnCount = t.columnCount !== void 0 ? t.columnCount : e.columnCount !== void 0 ? e.columnCount : null, this.constraint = t.constraint || e.constraint, this.darkenFilter = typeof t.darkenFilter == "boolean" ? t.darkenFilter : e.darkenFilter ?? null, this.deprecatedFontSize = typeof t.deprecatedFontSize == "boolean" ? t.deprecatedFontSize : e.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontSize = t.fontSize !== void 0 ? t.fontSize : e.fontSize !== void 0 ? e.fontSize : null, this.fontSizeNormalize = typeof t.fontSizeNormalize == "boolean" ? t.fontSizeNormalize : e.fontSizeNormalize ?? null, this.fontOpticalSizing = typeof t.fontOpticalSizing == "boolean" ? t.fontOpticalSizing : e.fontOpticalSizing ?? null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.fontWidth = t.fontWidth !== void 0 ? t.fontWidth : e.fontWidth !== void 0 ? e.fontWidth : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.invertFilter = typeof t.invertFilter == "boolean" ? t.invertFilter : e.invertFilter ?? null, this.invertGaijiFilter = typeof t.invertGaijiFilter == "boolean" ? t.invertGaijiFilter : e.invertGaijiFilter ?? null, this.iOSPatch = this.deprecatedFontSize || t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? T.OS.iPadOS && T.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.linkColor = t.linkColor || e.linkColor || null, this.maximalLineLength = t.maximalLineLength === null ? null : t.maximalLineLength || e.maximalLineLength || null, this.minimalLineLength = t.minimalLineLength === null ? null : t.minimalLineLength || e.minimalLineLength || null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.optimalLineLength = t.optimalLineLength || e.optimalLineLength, this.pageGutter = t.pageGutter !== void 0 ? t.pageGutter : e.pageGutter !== void 0 ? e.pageGutter : null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.scroll = typeof t.scroll == "boolean" ? t.scroll : e.scroll ?? null, this.scrollPaddingTop = t.scrollPaddingTop !== void 0 ? t.scrollPaddingTop : e.scrollPaddingTop !== void 0 ? e.scrollPaddingTop : null, this.scrollPaddingBottom = t.scrollPaddingBottom !== void 0 ? t.scrollPaddingBottom : e.scrollPaddingBottom !== void 0 ? e.scrollPaddingBottom : null, this.scrollPaddingLeft = t.scrollPaddingLeft !== void 0 ? t.scrollPaddingLeft : e.scrollPaddingLeft !== void 0 ? e.scrollPaddingLeft : null, this.scrollPaddingRight = t.scrollPaddingRight !== void 0 ? t.scrollPaddingRight : e.scrollPaddingRight !== void 0 ? e.scrollPaddingRight : null, this.selectionBackgroundColor = t.selectionBackgroundColor || e.selectionBackgroundColor || null, this.selectionTextColor = t.selectionTextColor || e.selectionTextColor || null, this.textAlign = t.textAlign || e.textAlign || null, this.textColor = t.textColor || e.textColor || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null, this.experiments = e.experiments || null;
|
|
8159
8189
|
}
|
|
@@ -8162,11 +8192,11 @@ function Lt(r) {
|
|
|
8162
8192
|
const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
|
|
8163
8193
|
return r.clientWidth - e - i;
|
|
8164
8194
|
}
|
|
8165
|
-
function
|
|
8195
|
+
function Er(r) {
|
|
8166
8196
|
const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
|
|
8167
8197
|
return r.clientHeight - e - i;
|
|
8168
8198
|
}
|
|
8169
|
-
class
|
|
8199
|
+
class _n extends le {
|
|
8170
8200
|
constructor(t) {
|
|
8171
8201
|
super(), this.a11yNormalize = t.a11yNormalize ?? null, this.backgroundColor = t.backgroundColor ?? null, this.blendFilter = t.blendFilter ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.colCount = t.colCount ?? null, this.darkenFilter = t.darkenFilter ?? null, this.deprecatedFontSize = t.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily ?? null, this.fontOpticalSizing = t.fontOpticalSizing ?? null, this.fontSize = t.fontSize ?? null, this.fontSizeNormalize = t.fontSizeNormalize ?? null, this.fontWeight = t.fontWeight ?? null, this.fontWidth = t.fontWidth ?? null, this.invertFilter = t.invertFilter ?? null, this.invertGaijiFilter = t.invertGaijiFilter ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.lineLength = t.lineLength ?? null, this.linkColor = t.linkColor ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.textAlign = t.textAlign ?? null, this.textColor = t.textColor ?? null, this.view = t.view ?? null, this.visitedColor = t.visitedColor ?? null, this.wordSpacing = t.wordSpacing ?? null;
|
|
8172
8202
|
}
|
|
@@ -8175,18 +8205,18 @@ class En extends le {
|
|
|
8175
8205
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.backgroundColor && (t["--USER__backgroundColor"] = this.backgroundColor), this.blendFilter && (t["--USER__blendFilter"] = this.toFlag("blend")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.colCount && (t["--USER__colCount"] = this.toUnitless(this.colCount)), this.darkenFilter === !0 ? t["--USER__darkenFilter"] = this.toFlag("darken") : typeof this.darkenFilter == "number" && (t["--USER__darkenFilter"] = this.toPercentage(this.darkenFilter)), this.deprecatedFontSize && (t["--USER__fontSizeImplementation"] = this.toFlag("deprecatedFontSize")), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontOpticalSizing != null && (t["--USER__fontOpticalSizing"] = this.fontOpticalSizing), this.fontSize != null && (t["--USER__fontSize"] = this.toPercentage(this.fontSize, !0)), this.fontSizeNormalize && (t["--USER__fontSizeNormalize"] = this.toFlag("normalize")), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.fontWidth != null && (t["--USER__fontWidth"] = typeof this.fontWidth == "string" ? this.fontWidth : this.toUnitless(this.fontWidth)), this.invertFilter === !0 ? t["--USER__invertFilter"] = this.toFlag("invert") : typeof this.invertFilter == "number" && (t["--USER__invertFilter"] = this.toPercentage(this.invertFilter)), this.invertGaijiFilter === !0 ? t["--USER__invertGaiji"] = this.toFlag("invertGaiji") : typeof this.invertGaijiFilter == "number" && (t["--USER__invertGaiji"] = this.toPercentage(this.invertGaijiFilter)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.lineLength != null && (t["--USER__lineLength"] = this.toPx(this.lineLength)), this.linkColor && (t["--USER__linkColor"] = this.linkColor), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.selectionBackgroundColor && (t["--USER__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--USER__selectionTextColor"] = this.selectionTextColor), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.textColor && (t["--USER__textColor"] = this.textColor), this.view && (t["--USER__view"] = this.toFlag(this.view)), this.visitedColor && (t["--USER__visitedColor"] = this.visitedColor), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), t;
|
|
8176
8206
|
}
|
|
8177
8207
|
}
|
|
8178
|
-
class
|
|
8208
|
+
class _r extends le {
|
|
8179
8209
|
constructor(t) {
|
|
8180
8210
|
super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingLeft = t.scrollPaddingLeft ?? null, this.scrollPaddingRight = t.scrollPaddingRight ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null, this.experiments = t.experiments ?? null;
|
|
8181
8211
|
}
|
|
8182
8212
|
toCSSProperties() {
|
|
8183
8213
|
const t = {};
|
|
8184
8214
|
return this.backgroundColor && (t["--RS__backgroundColor"] = this.backgroundColor), this.baseFontFamily && (t["--RS__baseFontFamily"] = this.baseFontFamily), this.baseFontSize != null && (t["--RS__baseFontSize"] = this.toRem(this.baseFontSize)), this.baseLineHeight != null && (t["--RS__baseLineHeight"] = this.toUnitless(this.baseLineHeight)), this.boxSizingMedia && (t["--RS__boxSizingMedia"] = this.boxSizingMedia), this.boxSizingTable && (t["--RS__boxSizingTable"] = this.boxSizingTable), this.colWidth != null && (t["--RS__colWidth"] = this.colWidth), this.colCount != null && (t["--RS__colCount"] = this.toUnitless(this.colCount)), this.colGap != null && (t["--RS__colGap"] = this.toPx(this.colGap)), this.codeFontFamily && (t["--RS__codeFontFamily"] = this.codeFontFamily), this.compFontFamily && (t["--RS__compFontFamily"] = this.compFontFamily), this.defaultLineLength != null && (t["--RS__defaultLineLength"] = this.toPx(this.defaultLineLength)), this.flowSpacing != null && (t["--RS__flowSpacing"] = this.toRem(this.flowSpacing)), this.humanistTf && (t["--RS__humanistTf"] = this.humanistTf), this.linkColor && (t["--RS__linkColor"] = this.linkColor), this.maxMediaWidth && (t["--RS__maxMediaWidth"] = this.toVw(this.maxMediaWidth)), this.maxMediaHeight && (t["--RS__maxMediaHeight"] = this.toVh(this.maxMediaHeight)), this.modernTf && (t["--RS__modernTf"] = this.modernTf), this.monospaceTf && (t["--RS__monospaceTf"] = this.monospaceTf), this.noOverflow && (t["--RS__disableOverflow"] = this.toFlag("noOverflow")), this.noVerticalPagination && (t["--RS__disablePagination"] = this.toFlag("noVerticalPagination")), this.oldStyleTf && (t["--RS__oldStyleTf"] = this.oldStyleTf), this.pageGutter != null && (t["--RS__pageGutter"] = this.toPx(this.pageGutter)), this.paraIndent != null && (t["--RS__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--RS__paraSpacing"] = this.toRem(this.paraSpacing)), this.primaryColor && (t["--RS__primaryColor"] = this.primaryColor), this.sansSerifJa && (t["--RS__sans-serif-ja"] = this.sansSerifJa), this.sansSerifJaV && (t["--RS__sans-serif-ja-v"] = this.sansSerifJaV), this.sansTf && (t["--RS__sansTf"] = this.sansTf), this.scrollPaddingBottom != null && (t["--RS__scrollPaddingBottom"] = this.toPx(this.scrollPaddingBottom)), this.scrollPaddingLeft != null && (t["--RS__scrollPaddingLeft"] = this.toPx(this.scrollPaddingLeft)), this.scrollPaddingRight != null && (t["--RS__scrollPaddingRight"] = this.toPx(this.scrollPaddingRight)), this.scrollPaddingTop != null && (t["--RS__scrollPaddingTop"] = this.toPx(this.scrollPaddingTop)), this.secondaryColor && (t["--RS__secondaryColor"] = this.secondaryColor), this.selectionBackgroundColor && (t["--RS__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--RS__selectionTextColor"] = this.selectionTextColor), this.serifJa && (t["--RS__serif-ja"] = this.serifJa), this.serifJaV && (t["--RS__serif-ja-v"] = this.serifJaV), this.textColor && (t["--RS__textColor"] = this.textColor), this.typeScale && (t["--RS__typeScale"] = this.toUnitless(this.typeScale)), this.visitedColor && (t["--RS__visitedColor"] = this.visitedColor), this.experiments && this.experiments.forEach((e) => {
|
|
8185
|
-
t["--RS__" + e] =
|
|
8215
|
+
t["--RS__" + e] = $e[e].value;
|
|
8186
8216
|
}), t;
|
|
8187
8217
|
}
|
|
8188
8218
|
}
|
|
8189
|
-
class
|
|
8219
|
+
class Cr {
|
|
8190
8220
|
constructor(t) {
|
|
8191
8221
|
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.isCJKVertical = t.isCJKVertical ?? !1, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Lt(this.containerParent);
|
|
8192
8222
|
}
|
|
@@ -8236,7 +8266,7 @@ class Pr {
|
|
|
8236
8266
|
visitedColor: t.visitedColor,
|
|
8237
8267
|
wordSpacing: t.wordSpacing
|
|
8238
8268
|
};
|
|
8239
|
-
this.userProperties = new
|
|
8269
|
+
this.userProperties = new _n(i);
|
|
8240
8270
|
}
|
|
8241
8271
|
updateLayout(t, e, i, n) {
|
|
8242
8272
|
return this.isCJKVertical ? this.computeCJKVerticalLength(t, e) : i ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, n);
|
|
@@ -8300,7 +8330,7 @@ class Pr {
|
|
|
8300
8330
|
};
|
|
8301
8331
|
}
|
|
8302
8332
|
computeCJKVerticalLength(t, e) {
|
|
8303
|
-
const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(
|
|
8333
|
+
const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(Er(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
|
|
8304
8334
|
return { colCount: void 0, effectiveContainerWidth: i, effectiveLineLength: o };
|
|
8305
8335
|
}
|
|
8306
8336
|
// This behaves as paginate where colCount = 1
|
|
@@ -8327,7 +8357,7 @@ class Pr {
|
|
|
8327
8357
|
this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
|
|
8328
8358
|
}
|
|
8329
8359
|
}
|
|
8330
|
-
const
|
|
8360
|
+
const Lr = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
|
|
8331
8361
|
// For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
|
|
8332
8362
|
// The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
|
|
8333
8363
|
(function() {
|
|
@@ -8393,21 +8423,21 @@ const Er = `// Note: we aren't blocking some of the events right now to try and
|
|
|
8393
8423
|
window.addEventListener("load", window._readium_eventBlocker, true);
|
|
8394
8424
|
})();
|
|
8395
8425
|
`;
|
|
8396
|
-
async function
|
|
8426
|
+
async function xr(r, t) {
|
|
8397
8427
|
const e = r.effectiveLayout === b.fixed, i = t.filter((a) => a.mediaType.isHTML).map((a) => a.href), n = i.length > 0 ? i : [/\.xhtml$/, /\.html$/], s = [
|
|
8398
8428
|
// CSS Selector Generator - always injected
|
|
8399
8429
|
{
|
|
8400
8430
|
id: "css-selector-generator",
|
|
8401
8431
|
as: "script",
|
|
8402
8432
|
target: "head",
|
|
8403
|
-
blob: new Blob([vt(
|
|
8433
|
+
blob: new Blob([vt(vn)], { type: "text/javascript" })
|
|
8404
8434
|
},
|
|
8405
8435
|
// Execution Prevention - conditional (has executable scripts)
|
|
8406
8436
|
{
|
|
8407
8437
|
id: "execution-prevention",
|
|
8408
8438
|
as: "script",
|
|
8409
8439
|
target: "head",
|
|
8410
|
-
blob: new Blob([vt(
|
|
8440
|
+
blob: new Blob([vt(Lr)], { type: "text/javascript" }),
|
|
8411
8441
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
8412
8442
|
}
|
|
8413
8443
|
], o = [
|
|
@@ -8416,7 +8446,7 @@ async function _r(r, t) {
|
|
|
8416
8446
|
id: "onload-proxy",
|
|
8417
8447
|
as: "script",
|
|
8418
8448
|
target: "head",
|
|
8419
|
-
blob: new Blob([vt(
|
|
8449
|
+
blob: new Blob([vt(Sn)], { type: "text/javascript" }),
|
|
8420
8450
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
8421
8451
|
}
|
|
8422
8452
|
];
|
|
@@ -8426,18 +8456,18 @@ async function _r(r, t) {
|
|
|
8426
8456
|
switch (a) {
|
|
8427
8457
|
case "rtl": {
|
|
8428
8458
|
const [u, p, g] = await Promise.all([
|
|
8429
|
-
import("./ReadiumCSS-before-
|
|
8430
|
-
import("./ReadiumCSS-default-
|
|
8431
|
-
import("./ReadiumCSS-after-
|
|
8459
|
+
import("./ReadiumCSS-before-D5x0zuZP.js"),
|
|
8460
|
+
import("./ReadiumCSS-default-C_BHdXWz.js"),
|
|
8461
|
+
import("./ReadiumCSS-after-CPAYSG9F.js")
|
|
8432
8462
|
]);
|
|
8433
8463
|
l = u.default, h = p.default, c = g.default;
|
|
8434
8464
|
break;
|
|
8435
8465
|
}
|
|
8436
8466
|
case "cjk-horizontal": {
|
|
8437
8467
|
const [u, p, g] = await Promise.all([
|
|
8438
|
-
import("./ReadiumCSS-before-
|
|
8439
|
-
import("./ReadiumCSS-default-
|
|
8440
|
-
import("./ReadiumCSS-after-
|
|
8468
|
+
import("./ReadiumCSS-before-DtkzLMzT.js"),
|
|
8469
|
+
import("./ReadiumCSS-default-BTgk8NbH.js"),
|
|
8470
|
+
import("./ReadiumCSS-after-CVNJvQab.js")
|
|
8441
8471
|
]);
|
|
8442
8472
|
l = u.default, h = p.default, c = g.default;
|
|
8443
8473
|
break;
|
|
@@ -8448,18 +8478,18 @@ async function _r(r, t) {
|
|
|
8448
8478
|
// same stylesheet set per the Readium CSS spec.
|
|
8449
8479
|
case "mongolian-vertical": {
|
|
8450
8480
|
const [u, p, g] = await Promise.all([
|
|
8451
|
-
import("./ReadiumCSS-before-
|
|
8452
|
-
import("./ReadiumCSS-default-
|
|
8453
|
-
import("./ReadiumCSS-after-
|
|
8481
|
+
import("./ReadiumCSS-before-DXNoxSjL.js"),
|
|
8482
|
+
import("./ReadiumCSS-default-BMLfH2r9.js"),
|
|
8483
|
+
import("./ReadiumCSS-after-DBPN8It0.js")
|
|
8454
8484
|
]);
|
|
8455
8485
|
l = u.default, h = p.default, c = g.default;
|
|
8456
8486
|
break;
|
|
8457
8487
|
}
|
|
8458
8488
|
default: {
|
|
8459
8489
|
const [u, p, g] = await Promise.all([
|
|
8460
|
-
import("./ReadiumCSS-before-
|
|
8461
|
-
import("./ReadiumCSS-default-
|
|
8462
|
-
import("./ReadiumCSS-after-
|
|
8490
|
+
import("./ReadiumCSS-before-CA1r4W7i.js"),
|
|
8491
|
+
import("./ReadiumCSS-default-C7kHIm6s.js"),
|
|
8492
|
+
import("./ReadiumCSS-after-Cpw6SSeZ.js")
|
|
8463
8493
|
]);
|
|
8464
8494
|
l = u.default, h = p.default, c = g.default;
|
|
8465
8495
|
break;
|
|
@@ -8508,7 +8538,7 @@ async function _r(r, t) {
|
|
|
8508
8538
|
}
|
|
8509
8539
|
];
|
|
8510
8540
|
}
|
|
8511
|
-
const
|
|
8541
|
+
const kr = (r) => ({
|
|
8512
8542
|
frameLoaded: r.frameLoaded || (() => {
|
|
8513
8543
|
}),
|
|
8514
8544
|
positionChanged: r.positionChanged || (() => {
|
|
@@ -8533,18 +8563,18 @@ const Cr = (r) => ({
|
|
|
8533
8563
|
peripheral: r.peripheral || (() => {
|
|
8534
8564
|
})
|
|
8535
8565
|
});
|
|
8536
|
-
class
|
|
8566
|
+
class Cn extends cn {
|
|
8537
8567
|
constructor(t, e, i, n = [], s = void 0, o = { preferences: {}, defaults: {} }) {
|
|
8538
8568
|
super(), this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.reflowViewport = {
|
|
8539
8569
|
readingOrder: [],
|
|
8540
8570
|
progressions: /* @__PURE__ */ new Map(),
|
|
8541
8571
|
positions: null
|
|
8542
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
8572
|
+
}, this.pub = e, this.container = t, this.listeners = kr(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new zt(o.preferences), this._defaults = new gr(o.defaults), this._settings = new Hi(this._preferences, this._defaults);
|
|
8543
8573
|
const a = bt(e.metadata), l = a === "cjk-horizontal", h = a === "cjk-vertical", u = h || a === "mongolian-vertical", p = l || h;
|
|
8544
|
-
this._css = new
|
|
8545
|
-
rsProperties: new
|
|
8546
|
-
userProperties: new
|
|
8547
|
-
lineLengths: new
|
|
8574
|
+
this._css = new Cr({
|
|
8575
|
+
rsProperties: new _r({ noVerticalPagination: u || void 0 }),
|
|
8576
|
+
userProperties: new _n({}),
|
|
8577
|
+
lineLengths: new kt({
|
|
8548
8578
|
optimalChars: this._settings.optimalLineLength,
|
|
8549
8579
|
minChars: this._settings.minimalLineLength,
|
|
8550
8580
|
maxChars: this._settings.maximalLineLength,
|
|
@@ -8558,13 +8588,13 @@ class _n extends hn {
|
|
|
8558
8588
|
container: t,
|
|
8559
8589
|
constraint: this._settings.constraint,
|
|
8560
8590
|
isCJKVertical: u
|
|
8561
|
-
}), this._layout =
|
|
8591
|
+
}), this._layout = Cn.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = xr(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
8562
8592
|
this._contentProtection,
|
|
8563
8593
|
o.keyboardPeripherals || []
|
|
8564
|
-
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new
|
|
8594
|
+
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ge(this._contentProtection), this._suspiciousActivityListener = (g) => {
|
|
8565
8595
|
const { type: d, ...f } = g.detail;
|
|
8566
8596
|
d === "context_menu" ? this.listeners.contextMenu(f) : this.listeners.contentProtection(d, f);
|
|
8567
|
-
}, window.addEventListener(ot, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new
|
|
8597
|
+
}, window.addEventListener(ot, this._suspiciousActivityListener)), this._keyboardPeripherals.length > 0 && (this._keyboardPeripheralsManager = new Ye({
|
|
8568
8598
|
keyboardPeripherals: this._keyboardPeripherals
|
|
8569
8599
|
}), this._keyboardPeripheralListener = (g) => {
|
|
8570
8600
|
const d = g.detail;
|
|
@@ -8573,7 +8603,7 @@ class _n extends hn {
|
|
|
8573
8603
|
}
|
|
8574
8604
|
static determineLayout(t, e) {
|
|
8575
8605
|
const i = t.metadata.effectiveLayout;
|
|
8576
|
-
if (i === b.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(
|
|
8606
|
+
if (i === b.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || t.metadata?.conformsTo?.includes(Yi.DIVINA))
|
|
8577
8607
|
return b.fixed;
|
|
8578
8608
|
if (i === b.scrolled)
|
|
8579
8609
|
return b.scrolled;
|
|
@@ -8583,13 +8613,13 @@ class _n extends hn {
|
|
|
8583
8613
|
async load() {
|
|
8584
8614
|
if (this.positions?.length || (this.positions = await this.pub.positionsFromManifest()), !this._injector) {
|
|
8585
8615
|
const t = await this._readiumRulesPromise;
|
|
8586
|
-
this._injector = new
|
|
8616
|
+
this._injector = new wn({
|
|
8587
8617
|
rules: [...t, ...this._injectablesConfig.rules],
|
|
8588
8618
|
allowedDomains: this._injectablesConfig.allowedDomains
|
|
8589
8619
|
});
|
|
8590
8620
|
}
|
|
8591
8621
|
if (this._layout === b.fixed)
|
|
8592
|
-
this.framePool = new
|
|
8622
|
+
this.framePool = new mr(
|
|
8593
8623
|
this.container,
|
|
8594
8624
|
this.positions,
|
|
8595
8625
|
this.pub,
|
|
@@ -8602,7 +8632,7 @@ class _n extends hn {
|
|
|
8602
8632
|
else {
|
|
8603
8633
|
await this.updateCSS(!1);
|
|
8604
8634
|
const t = this.compileCSSProperties(this._css);
|
|
8605
|
-
this.framePool = new
|
|
8635
|
+
this.framePool = new ir(
|
|
8606
8636
|
this.container,
|
|
8607
8637
|
this.positions,
|
|
8608
8638
|
t,
|
|
@@ -8622,14 +8652,14 @@ class _n extends hn {
|
|
|
8622
8652
|
}
|
|
8623
8653
|
}
|
|
8624
8654
|
get preferencesEditor() {
|
|
8625
|
-
return this._preferencesEditor === null && (this._preferencesEditor = new
|
|
8655
|
+
return this._preferencesEditor === null && (this._preferencesEditor = new Bi(this._preferences, this.settings, this.pub.metadata)), this._preferencesEditor;
|
|
8626
8656
|
}
|
|
8627
8657
|
async submitPreferences(t) {
|
|
8628
8658
|
this._preferences = this._preferences.merging(t), await this.applyPreferences();
|
|
8629
8659
|
}
|
|
8630
8660
|
async applyPreferences() {
|
|
8631
8661
|
const t = this._settings;
|
|
8632
|
-
this._settings = new
|
|
8662
|
+
this._settings = new Hi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new Bi(this._preferences, this.settings, this.pub.metadata)), this._layout === b.fixed ? this.handleFXLPrefs(t, this._settings) : await this.updateCSS(!0);
|
|
8633
8663
|
}
|
|
8634
8664
|
// TODO: fit, etc.
|
|
8635
8665
|
handleFXLPrefs(t, e) {
|
|
@@ -8672,7 +8702,7 @@ class _n extends hn {
|
|
|
8672
8702
|
* TODO remove when settings management is incorporated
|
|
8673
8703
|
*/
|
|
8674
8704
|
get _cframes() {
|
|
8675
|
-
return (this.framePool?.currentFrames ?? []).filter((t) => !(t instanceof
|
|
8705
|
+
return (this.framePool?.currentFrames ?? []).filter((t) => !(t instanceof En && t.isDestroyed));
|
|
8676
8706
|
}
|
|
8677
8707
|
/**
|
|
8678
8708
|
* Exposed to the public to compensate for lack of implemented readium conveniences
|
|
@@ -8709,42 +8739,42 @@ class _n extends hn {
|
|
|
8709
8739
|
case "tap":
|
|
8710
8740
|
const n = e;
|
|
8711
8741
|
if (n.interactiveElement) {
|
|
8712
|
-
const
|
|
8742
|
+
const l = new DOMParser().parseFromString(
|
|
8713
8743
|
n.interactiveElement,
|
|
8714
8744
|
"text/html"
|
|
8715
8745
|
).body.children[0];
|
|
8716
|
-
if (
|
|
8717
|
-
const
|
|
8718
|
-
if (
|
|
8746
|
+
if (l.nodeType === l.ELEMENT_NODE && l.nodeName === "A" && l.hasAttribute("href")) {
|
|
8747
|
+
const h = l.attributes.getNamedItem("href")?.value;
|
|
8748
|
+
if (h.startsWith("#"))
|
|
8719
8749
|
this.go(this.currentLocation.copyWithLocations({
|
|
8720
|
-
fragments: [
|
|
8750
|
+
fragments: [h.substring(1)]
|
|
8721
8751
|
}), !1, () => {
|
|
8722
8752
|
});
|
|
8723
|
-
else if (
|
|
8753
|
+
else if (h.startsWith("http://") || h.startsWith("https://") || h.startsWith("mailto:") || h.startsWith("tel:"))
|
|
8724
8754
|
this.listeners.handleLocator(new $({
|
|
8725
|
-
href:
|
|
8755
|
+
href: h
|
|
8726
8756
|
}).locator);
|
|
8727
8757
|
else
|
|
8728
8758
|
try {
|
|
8729
8759
|
this.goLink(new $({
|
|
8730
|
-
href: Gt.join(Gt.dirname(this.currentLocation.href),
|
|
8760
|
+
href: Gt.join(Gt.dirname(this.currentLocation.href), h)
|
|
8731
8761
|
}), !1, () => {
|
|
8732
8762
|
});
|
|
8733
|
-
} catch (
|
|
8734
|
-
console.warn(`Couldn't go to link for ${
|
|
8735
|
-
href:
|
|
8763
|
+
} catch (c) {
|
|
8764
|
+
console.warn(`Couldn't go to link for ${h}: ${c}`), this.listeners.handleLocator(new $({
|
|
8765
|
+
href: h
|
|
8736
8766
|
}).locator);
|
|
8737
8767
|
}
|
|
8738
|
-
} else console.log("Clicked on",
|
|
8768
|
+
} else console.log("Clicked on", l);
|
|
8739
8769
|
} else {
|
|
8740
8770
|
if (this._layout === b.fixed && this.framePool.doNotDisturb && (n.doNotDisturb = !0), this._layout === b.fixed && (this.currentProgression === N.rtl || this.currentProgression === N.ltr) && this.framePool.currentFrames.length > 1) {
|
|
8741
|
-
const
|
|
8742
|
-
n.targetFrameSrc ===
|
|
8771
|
+
const c = this.framePool.currentFrames;
|
|
8772
|
+
n.targetFrameSrc === c[this.currentProgression === N.rtl ? 0 : 1]?.source && (n.x += (c[this.currentProgression === N.rtl ? 1 : 0]?.iframe.contentWindow?.innerWidth ?? 0) * window.devicePixelRatio);
|
|
8743
8773
|
}
|
|
8744
8774
|
if (t === "click" ? this.listeners.click(n) : this.listeners.tap(n)) break;
|
|
8745
|
-
const
|
|
8746
|
-
n.x >=
|
|
8747
|
-
}) : n.x >
|
|
8775
|
+
const h = (this._cframes.length === 2 ? this._cframes[0].window.innerWidth + this._cframes[1].window.innerWidth : this._cframes[0].window.innerWidth) * window.devicePixelRatio / 4;
|
|
8776
|
+
n.x >= h && n.x <= h * 3 && this.listeners.miscPointer(1), n.x < h ? this.goLeft(!1, () => {
|
|
8777
|
+
}) : n.x > h * 3 && this.goRight(!1, () => {
|
|
8748
8778
|
});
|
|
8749
8779
|
}
|
|
8750
8780
|
break;
|
|
@@ -8776,7 +8806,11 @@ class _n extends hn {
|
|
|
8776
8806
|
this.listeners.contextMenu(e);
|
|
8777
8807
|
break;
|
|
8778
8808
|
case "keyboard_peripherals":
|
|
8779
|
-
|
|
8809
|
+
const o = e, a = { ...o, interactiveElement: void 0 };
|
|
8810
|
+
o.interactiveElement && (a.interactiveElement = new DOMParser().parseFromString(
|
|
8811
|
+
o.interactiveElement,
|
|
8812
|
+
"text/html"
|
|
8813
|
+
).body.children[0]), this.listeners.peripheral(a);
|
|
8780
8814
|
break;
|
|
8781
8815
|
case "log":
|
|
8782
8816
|
console.log(this._cframes[0]?.source?.split("/")[3], ...e);
|
|
@@ -8789,8 +8823,8 @@ class _n extends hn {
|
|
|
8789
8823
|
determineModules() {
|
|
8790
8824
|
let t = Array.from(Te.keys());
|
|
8791
8825
|
if (this._layout === b.fixed)
|
|
8792
|
-
return t.filter((n) =>
|
|
8793
|
-
t = t.filter((n) =>
|
|
8826
|
+
return t.filter((n) => ps.includes(n));
|
|
8827
|
+
t = t.filter((n) => fs.includes(n));
|
|
8794
8828
|
const e = bt(this.pub.metadata);
|
|
8795
8829
|
if (e === "cjk-vertical" || e === "mongolian-vertical")
|
|
8796
8830
|
return t.filter((n) => n !== "column_snapper" && n !== "scroll_snapper");
|
|
@@ -8988,7 +9022,7 @@ class _n extends hn {
|
|
|
8988
9022
|
return this.go(t.locator, e, i);
|
|
8989
9023
|
}
|
|
8990
9024
|
}
|
|
8991
|
-
const
|
|
9025
|
+
const Or = `// PreservePitchProcessor.js
|
|
8992
9026
|
// AudioWorklet processor for pitch preservation via pitch shifting.
|
|
8993
9027
|
//
|
|
8994
9028
|
// Architecture:
|
|
@@ -9203,17 +9237,17 @@ class PreservePitchProcessor extends AudioWorkletProcessor {
|
|
|
9203
9237
|
|
|
9204
9238
|
registerProcessor('preserve-pitch-processor', PreservePitchProcessor);
|
|
9205
9239
|
`;
|
|
9206
|
-
class
|
|
9240
|
+
class qe {
|
|
9207
9241
|
constructor(t) {
|
|
9208
9242
|
this.workletNode = null, this.url = null, this.ctx = t;
|
|
9209
9243
|
}
|
|
9210
9244
|
static async createWorklet(t) {
|
|
9211
|
-
const { ctx: e, pitchFactor: i, modulePath: n } = t, s = new
|
|
9245
|
+
const { ctx: e, pitchFactor: i, modulePath: n } = t, s = new qe(e);
|
|
9212
9246
|
try {
|
|
9213
9247
|
if (n)
|
|
9214
9248
|
await e.audioWorklet.addModule(n);
|
|
9215
9249
|
else {
|
|
9216
|
-
const o = new Blob([
|
|
9250
|
+
const o = new Blob([Or], { type: "text/javascript" });
|
|
9217
9251
|
s.url = URL.createObjectURL(o), await e.audioWorklet.addModule(s.url);
|
|
9218
9252
|
}
|
|
9219
9253
|
} catch (o) {
|
|
@@ -9233,7 +9267,7 @@ class Ye {
|
|
|
9233
9267
|
this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
|
|
9234
9268
|
}
|
|
9235
9269
|
}
|
|
9236
|
-
class
|
|
9270
|
+
class Rr {
|
|
9237
9271
|
constructor(t) {
|
|
9238
9272
|
this.audioContext = null, this.sourceNode = null, this.gainNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.isStoppedValue = !1, this.worklet = null, this.webAudioActive = !1, this.boundOnCanPlayThrough = this.onCanPlayThrough.bind(this), this.boundOnTimeUpdate = this.onTimeUpdate.bind(this), this.boundOnError = this.onError.bind(this), this.boundOnEnded = this.onEnded.bind(this), this.boundOnStalled = this.onStalled.bind(this), this.boundOnEmptied = this.onEmptied.bind(this), this.boundOnSuspend = this.onSuspend.bind(this), this.boundOnWaiting = this.onWaiting.bind(this), this.boundOnLoadedMetadata = this.onLoadedMetadata.bind(this), this.boundOnSeeking = this.onSeeking.bind(this), this.boundOnSeeked = this.onSeeked.bind(this), this.boundOnPlay = this.onPlay.bind(this), this.boundOnPlaying = this.onPlaying.bind(this), this.boundOnPause = this.onPause.bind(this), this.boundOnProgress = this.onProgress.bind(this), this.playback = t.playback, this.mediaElement = document.createElement("audio"), this.mediaElement.addEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.addEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.addEventListener("error", this.boundOnError), this.mediaElement.addEventListener("ended", this.boundOnEnded), this.mediaElement.addEventListener("stalled", this.boundOnStalled), this.mediaElement.addEventListener("emptied", this.boundOnEmptied), this.mediaElement.addEventListener("suspend", this.boundOnSuspend), this.mediaElement.addEventListener("waiting", this.boundOnWaiting), this.mediaElement.addEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.addEventListener("seeking", this.boundOnSeeking), this.mediaElement.addEventListener("seeked", this.boundOnSeeked), this.mediaElement.addEventListener("play", this.boundOnPlay), this.mediaElement.addEventListener("playing", this.boundOnPlaying), this.mediaElement.addEventListener("pause", this.boundOnPause), this.mediaElement.addEventListener("progress", this.boundOnProgress), this.mediaElement.currentTime = this.playback.state.currentTime;
|
|
9239
9273
|
}
|
|
@@ -9415,7 +9449,7 @@ class xr {
|
|
|
9415
9449
|
*/
|
|
9416
9450
|
setPlaybackRate(t, e) {
|
|
9417
9451
|
this.mediaElement.playbackRate = t, e ? "preservesPitch" in this.mediaElement ? this.mediaElement.preservesPitch = !0 : this.activateWebAudio().then(() => {
|
|
9418
|
-
this.worklet ? this.worklet.updatePitchFactor(1 / t) :
|
|
9452
|
+
this.worklet ? this.worklet.updatePitchFactor(1 / t) : qe.createWorklet({
|
|
9419
9453
|
ctx: this.getOrCreateAudioContext(),
|
|
9420
9454
|
pitchFactor: 1
|
|
9421
9455
|
}).then((i) => {
|
|
@@ -9510,17 +9544,17 @@ class ce {
|
|
|
9510
9544
|
return new ce(e);
|
|
9511
9545
|
}
|
|
9512
9546
|
}
|
|
9513
|
-
class
|
|
9547
|
+
class Ar {
|
|
9514
9548
|
constructor(t = {}) {
|
|
9515
9549
|
this.volume = z(t.volume, ie.range) ?? 1, this.playbackRate = z(t.playbackRate, ne.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = z(t.skipBackwardInterval, it.range) ?? 10, this.skipForwardInterval = z(t.skipForwardInterval, it.range) ?? 10, this.pollInterval = v(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
|
|
9516
9550
|
}
|
|
9517
9551
|
}
|
|
9518
|
-
class
|
|
9552
|
+
class Vi {
|
|
9519
9553
|
constructor(t, e) {
|
|
9520
9554
|
this.volume = t.volume ?? e.volume, this.playbackRate = t.playbackRate ?? e.playbackRate, this.preservePitch = t.preservePitch ?? e.preservePitch, this.skipBackwardInterval = t.skipBackwardInterval ?? e.skipBackwardInterval, this.skipForwardInterval = t.skipForwardInterval ?? e.skipForwardInterval, this.pollInterval = t.pollInterval ?? e.pollInterval, this.autoPlay = t.autoPlay ?? e.autoPlay, this.enableMediaSession = t.enableMediaSession ?? e.enableMediaSession;
|
|
9521
9555
|
}
|
|
9522
9556
|
}
|
|
9523
|
-
class
|
|
9557
|
+
class ji {
|
|
9524
9558
|
constructor(t, e) {
|
|
9525
9559
|
this.preferences = t, this.settings = e;
|
|
9526
9560
|
}
|
|
@@ -9619,8 +9653,8 @@ class Vi {
|
|
|
9619
9653
|
});
|
|
9620
9654
|
}
|
|
9621
9655
|
}
|
|
9622
|
-
const
|
|
9623
|
-
class
|
|
9656
|
+
const $i = 1, Xi = 1;
|
|
9657
|
+
class Tr {
|
|
9624
9658
|
constructor(t, e, i = {}) {
|
|
9625
9659
|
this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes(), i.disableRemotePlayback && (this._audioEngine.getMediaElement().disableRemotePlayback = !0);
|
|
9626
9660
|
}
|
|
@@ -9672,7 +9706,7 @@ class kr {
|
|
|
9672
9706
|
for (let n = 0; n < e.length; n++) {
|
|
9673
9707
|
if (n === t) continue;
|
|
9674
9708
|
const s = this.pickPlayableHref(e[n]);
|
|
9675
|
-
n >= t -
|
|
9709
|
+
n >= t - Xi && n <= t + Xi ? (this.ensure(s), i.add(s)) : n >= t - $i && n <= t + $i && this.pool.has(s) && i.add(s);
|
|
9676
9710
|
}
|
|
9677
9711
|
for (const [n, s] of this.pool)
|
|
9678
9712
|
i.has(n) || (s.removeAttribute("src"), s.load(), this.pool.delete(n));
|
|
@@ -9697,7 +9731,7 @@ class kr {
|
|
|
9697
9731
|
this.pool.clear();
|
|
9698
9732
|
}
|
|
9699
9733
|
}
|
|
9700
|
-
class
|
|
9734
|
+
class Mr {
|
|
9701
9735
|
constructor(t = {}) {
|
|
9702
9736
|
this.dragstartHandler = (e) => {
|
|
9703
9737
|
e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
|
|
@@ -9713,7 +9747,7 @@ class Rr {
|
|
|
9713
9747
|
document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("dragover", this.dragoverHandler, !0), document.removeEventListener("drop", this.dropHandler, !0), window.removeEventListener("unload", this.unloadHandler);
|
|
9714
9748
|
}
|
|
9715
9749
|
}
|
|
9716
|
-
class
|
|
9750
|
+
class Nr {
|
|
9717
9751
|
constructor(t = {}) {
|
|
9718
9752
|
this.copyHandler = (e) => {
|
|
9719
9753
|
e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
|
|
@@ -9723,16 +9757,16 @@ class Ar {
|
|
|
9723
9757
|
document.removeEventListener("copy", this.copyHandler, !0), window.removeEventListener("unload", this.unloadHandler);
|
|
9724
9758
|
}
|
|
9725
9759
|
}
|
|
9726
|
-
class
|
|
9760
|
+
class zr extends Ge {
|
|
9727
9761
|
constructor(t = {}) {
|
|
9728
|
-
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new
|
|
9762
|
+
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new Mr({
|
|
9729
9763
|
onDragDetected: (e) => {
|
|
9730
9764
|
this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
|
|
9731
9765
|
},
|
|
9732
9766
|
onDropDetected: (e, i) => {
|
|
9733
9767
|
this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
|
|
9734
9768
|
}
|
|
9735
|
-
})), t.protectCopy && (this.copyProtector = new
|
|
9769
|
+
})), t.protectCopy && (this.copyProtector = new Nr({
|
|
9736
9770
|
onCopyBlocked: () => {
|
|
9737
9771
|
this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
|
|
9738
9772
|
}
|
|
@@ -9742,7 +9776,7 @@ class Tr extends Xe {
|
|
|
9742
9776
|
super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
|
|
9743
9777
|
}
|
|
9744
9778
|
}
|
|
9745
|
-
const
|
|
9779
|
+
const Ir = (r) => ({
|
|
9746
9780
|
trackLoaded: r.trackLoaded ?? (() => {
|
|
9747
9781
|
}),
|
|
9748
9782
|
positionChanged: r.positionChanged ?? (() => {
|
|
@@ -9774,12 +9808,12 @@ const Mr = (r) => ({
|
|
|
9774
9808
|
remotePlaybackStateChanged: r.remotePlaybackStateChanged ?? (() => {
|
|
9775
9809
|
})
|
|
9776
9810
|
});
|
|
9777
|
-
class
|
|
9811
|
+
class Fr extends vs {
|
|
9778
9812
|
constructor(t, e, i, n = {
|
|
9779
9813
|
preferences: {},
|
|
9780
9814
|
defaults: {}
|
|
9781
9815
|
}) {
|
|
9782
|
-
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners =
|
|
9816
|
+
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners = Ir(e), this._preferences = new ce(n.preferences), this._defaults = new Ar(n.defaults), this._settings = new Vi(this._preferences, this._defaults), t.readingOrder.items.length === 0)
|
|
9783
9817
|
throw new Error("AudioNavigator: publication has an empty reading order");
|
|
9784
9818
|
if (i)
|
|
9785
9819
|
this.currentLocation = this.ensureLocatorLocations(i);
|
|
@@ -9800,7 +9834,7 @@ class zr extends ys {
|
|
|
9800
9834
|
const s = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(s);
|
|
9801
9835
|
if (o === -1)
|
|
9802
9836
|
throw new Error(`AudioNavigator: initial href "${s}" not found in reading order`);
|
|
9803
|
-
const a = this.currentLocation.locations?.time() || 0, l = new
|
|
9837
|
+
const a = this.currentLocation.locations?.time() || 0, l = new Rr({
|
|
9804
9838
|
playback: {
|
|
9805
9839
|
state: {
|
|
9806
9840
|
currentTime: a,
|
|
@@ -9810,17 +9844,17 @@ class zr extends ys {
|
|
|
9810
9844
|
index: o
|
|
9811
9845
|
}
|
|
9812
9846
|
});
|
|
9813
|
-
this.pool = new
|
|
9847
|
+
this.pool = new Tr(l, t, n.contentProtection);
|
|
9814
9848
|
const h = n.contentProtection || {};
|
|
9815
9849
|
this._contentProtection = h;
|
|
9816
9850
|
const c = this.mergeKeyboardPeripherals(
|
|
9817
9851
|
h,
|
|
9818
9852
|
n.keyboardPeripherals || []
|
|
9819
9853
|
);
|
|
9820
|
-
(h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new
|
|
9854
|
+
(h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new zr(h), this._suspiciousActivityListener = (u) => {
|
|
9821
9855
|
const { type: p, ...g } = u.detail;
|
|
9822
9856
|
p === "context_menu" ? this.listeners.contextMenu(g) : this.listeners.contentProtection(p, g);
|
|
9823
|
-
}, window.addEventListener(ot, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new
|
|
9857
|
+
}, window.addEventListener(ot, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new Ye({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
|
|
9824
9858
|
this.listeners.peripheral(u.detail);
|
|
9825
9859
|
}, window.addEventListener(at, this._keyboardPeripheralListener)), this.setupEventListeners(), this._isNavigating = !0, this.pool.setCurrentAudio(o, "forward"), this.applyPreferences(), this.waitForLoadedAndSeeked(a).then(() => {
|
|
9826
9860
|
this._isNavigating = !1, this.listeners.trackLoaded(this.pool.audioEngine.getMediaElement()), this._notifyTimelineChange(this.currentLocator), this.listeners.positionChanged(this.currentLocator), this._setupRemotePlayback();
|
|
@@ -9832,13 +9866,13 @@ class zr extends ys {
|
|
|
9832
9866
|
return this._settings;
|
|
9833
9867
|
}
|
|
9834
9868
|
get preferencesEditor() {
|
|
9835
|
-
return this._preferencesEditor === null && (this._preferencesEditor = new
|
|
9869
|
+
return this._preferencesEditor === null && (this._preferencesEditor = new ji(this._preferences, this.settings)), this._preferencesEditor;
|
|
9836
9870
|
}
|
|
9837
9871
|
async submitPreferences(t) {
|
|
9838
9872
|
this._preferences = this._preferences.merging(t), this.applyPreferences();
|
|
9839
9873
|
}
|
|
9840
9874
|
applyPreferences() {
|
|
9841
|
-
this._settings = new
|
|
9875
|
+
this._settings = new Vi(this._preferences, this._defaults), this._preferencesEditor !== null && (this._preferencesEditor = new ji(this._preferences, this.settings)), this.pool.audioEngine.setVolume(this._settings.volume), this.pool.audioEngine.setPlaybackRate(this._settings.playbackRate, this._settings.preservePitch), this.positionPollInterval !== null && this.startPositionPolling(), this._settings.enableMediaSession && !this._mediaSessionEnabled ? (this._mediaSessionEnabled = !0, this.setupMediaSession()) : !this._settings.enableMediaSession && this._mediaSessionEnabled && (this._mediaSessionEnabled = !1, this.destroyMediaSession());
|
|
9842
9876
|
}
|
|
9843
9877
|
get publication() {
|
|
9844
9878
|
return this.pub;
|
|
@@ -10134,65 +10168,65 @@ class zr extends ys {
|
|
|
10134
10168
|
}
|
|
10135
10169
|
}
|
|
10136
10170
|
export {
|
|
10137
|
-
|
|
10138
|
-
|
|
10171
|
+
Ar as AudioDefaults,
|
|
10172
|
+
Fr as AudioNavigator,
|
|
10139
10173
|
ce as AudioPreferences,
|
|
10140
|
-
|
|
10141
|
-
|
|
10174
|
+
ji as AudioPreferencesEditor,
|
|
10175
|
+
Vi as AudioSettings,
|
|
10142
10176
|
A as BooleanPreference,
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10177
|
+
gn as EnumPreference,
|
|
10178
|
+
gr as EpubDefaults,
|
|
10179
|
+
Cn as EpubNavigator,
|
|
10146
10180
|
zt as EpubPreferences,
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10181
|
+
Bi as EpubPreferencesEditor,
|
|
10182
|
+
Hi as EpubSettings,
|
|
10183
|
+
Dr as ExperimentalWebPubNavigator,
|
|
10184
|
+
or as FXLCoordinator,
|
|
10185
|
+
nr as FXLFrameManager,
|
|
10186
|
+
mr as FXLFramePoolManager,
|
|
10187
|
+
lr as FXLPeripherals,
|
|
10188
|
+
hr as FXLSpreader,
|
|
10155
10189
|
Mt as FrameComms,
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10190
|
+
En as FrameManager,
|
|
10191
|
+
ir as FramePoolManager,
|
|
10192
|
+
sr as HorizontalThird,
|
|
10193
|
+
wn as Injector,
|
|
10194
|
+
kt as LineLengths,
|
|
10195
|
+
vs as MediaNavigator,
|
|
10196
|
+
hn as Navigator,
|
|
10163
10197
|
Me as Orientation,
|
|
10164
10198
|
M as Preference,
|
|
10165
10199
|
le as Properties,
|
|
10166
|
-
|
|
10200
|
+
_r as RSProperties,
|
|
10167
10201
|
x as RangePreference,
|
|
10168
|
-
|
|
10202
|
+
Cr as ReadiumCSS,
|
|
10169
10203
|
Ne as Spread,
|
|
10170
10204
|
tt as TextAlignment,
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10205
|
+
_n as UserProperties,
|
|
10206
|
+
rr as VerticalThird,
|
|
10207
|
+
cn as VisualNavigator,
|
|
10208
|
+
Rr as WebAudioEngine,
|
|
10209
|
+
Ss as WebPubBlobBuilder,
|
|
10210
|
+
Ns as WebPubCSS,
|
|
10211
|
+
Ds as WebPubDefaults,
|
|
10212
|
+
xs as WebPubFrameManager,
|
|
10213
|
+
ks as WebPubFramePoolManager,
|
|
10214
|
+
tr as WebPubNavigator,
|
|
10181
10215
|
Nt as WebPubPreferences,
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10216
|
+
Ai as WebPubPreferencesEditor,
|
|
10217
|
+
Ri as WebPubSettings,
|
|
10218
|
+
Ms as WebRSProperties,
|
|
10219
|
+
fn as WebUserProperties,
|
|
10186
10220
|
E as ensureBoolean,
|
|
10187
10221
|
he as ensureEnumValue,
|
|
10188
|
-
|
|
10222
|
+
mn as ensureExperiment,
|
|
10189
10223
|
wt as ensureFilter,
|
|
10190
|
-
|
|
10191
|
-
|
|
10224
|
+
zs as ensureLessThanOrEqual,
|
|
10225
|
+
Is as ensureMoreThanOrEqual,
|
|
10192
10226
|
v as ensureNonNegative,
|
|
10193
10227
|
W as ensureString,
|
|
10194
10228
|
z as ensureValueInRange,
|
|
10195
|
-
|
|
10229
|
+
$e as experiments,
|
|
10196
10230
|
dt as filterRangeConfig,
|
|
10197
10231
|
Yt as fontSizeRangeConfig,
|
|
10198
10232
|
st as fontWeightRangeConfig,
|