@readium/shared
Version:
Shared models to be used across other Readium projects and implementations in Typescript
1 lines • 181 kB
JavaScript
(function(c,J){typeof exports=="object"&&typeof module<"u"?J(exports):typeof define=="function"&&define.amd?define(["exports"],J):(c=typeof globalThis<"u"?globalThis:c||self,J(c.shared={}))})(this,(function(c){"use strict";class J{close(){}links(){return[]}get(e){throw Error("This is an empty fetcher")}}class ui{constructor(e,t){this.client=e||window.fetch.bind(window),this.baseUrl=t}links(){return[]}get(e){const t=e.toURL(this.baseUrl);if(t===void 0)throw Error(`Invalid HREF: ${e.href}`);return new dt(this.client,e,t)}close(){}}class dt{constructor(e,t,i){this.client=e||window.fetch.bind(window),this._link=t,this.url=i}async headResponse(){if(this._headResponse)return this._headResponse;const e=await this.client(this.url,{method:"HEAD"});if(!e.ok)throw new Error(`http HEAD request for ${this.url} failed with HTTP status code ${e.status}`);return this._headResponse=e,e}close(){}async link(){return this._link}async read(e){if(e)throw new Error("http read range not implemented!");const t=await this.client(this.url);if(!t.ok)throw new Error(`http GET request for ${this.url} failed with HTTP status code ${t.status}`);return new Uint8Array(await t.arrayBuffer())}async length(){const t=(await this.headResponse()).headers.get("content-length");if(t===null||t==="")throw new Error("length for resource unavailable");return parseInt(t)}async readAsJSON(){const e=await this.client(this.url);if(!e.ok)throw new Error(`http GET request for ${this.url} failed with HTTP status code ${e.status}`);return await e.json()}async readAsString(){const e=await this.client(this.url);if(!e.ok)throw new Error(`http GET request for ${this.url} failed with HTTP status code ${e.status}`);return await e.text()}async readAsXML(){const e=await this.client(this.url);if(!e.ok)throw new Error(`http GET request for ${this.url} failed with HTTP status code ${e.status}`);return new DOMParser().parseFromString(await e.text(),"application/xml")}}class hi{constructor(e,t){this.start=e,this.endInclusive=t}}class pi{readAsString(){return this.read().then(e=>e===void 0?e:new TextDecoder().decode(e))}readAsJSON(){return this.readAsString().then(e=>e===void 0?e:JSON.parse(e))}readAsXML(){return this.readAsString().then(e=>e===void 0?e:new DOMParser().parseFromString(e,"text/xml"))}}class F{constructor(e={}){this.conformsTo=e.conformsTo??[],this.certification=e.certification??null,this.summary=e.summary??null,this.accessMode=e.accessMode??[],this.accessModeSufficient=e.accessModeSufficient??[],this.feature=e.feature??[],this.hazard=e.hazard??[],this.exemption=e.exemption??[]}static deserialize(e){if(!e||typeof e!="object")return;const t=e;return new F({conformsTo:t.conformsTo?t.conformsTo.map(i=>ve.deserialize(i)).filter(i=>i!==void 0):void 0,certification:t.certification?ye.deserialize(t.certification):void 0,summary:t.summary,accessMode:t.accessMode?t.accessMode.map(i=>N.deserialize(i)).filter(i=>i!==void 0):void 0,accessModeSufficient:t.accessModeSufficient?t.accessModeSufficient.map(i=>Ae.deserialize(i)).filter(i=>i!==void 0):void 0,feature:t.feature?t.feature.map(i=>y.deserialize(i)).filter(i=>i!==void 0):void 0,hazard:t.hazard?t.hazard.map(i=>P.deserialize(i)).filter(i=>i!==void 0):void 0,exemption:t.exemption?t.exemption.map(i=>ke.deserialize(i)).filter(i=>i!==void 0):void 0})}serialize(){const e={};return this.conformsTo?.length>0&&(e.conformsTo=this.conformsTo.map(t=>t.serialize())),this.certification!==void 0&&this.certification!==null&&(e.certification=this.certification.serialize()),this.summary!==void 0&&this.summary!==null&&(e.summary=this.summary),this.accessMode?.length>0&&(e.accessMode=this.accessMode.map(t=>t.serialize())),this.accessModeSufficient?.length>0&&(e.accessModeSufficient=this.accessModeSufficient.map(t=>t.serialize())),this.feature?.length>0&&(e.feature=this.feature.map(t=>t.serialize())),this.hazard?.length>0&&(e.hazard=this.hazard.map(t=>t.serialize())),this.exemption?.length>0&&(e.exemption=this.exemption.map(t=>t.serialize())),e}}const v=class v{constructor(e){this.uri=e}static deserialize(e){if(!(!e||typeof e!="string"))return new v(e)}serialize(){return this.uri}get isWCAGLevelA(){return this===v.EPUB_A11Y_10_WCAG_20_A||this===v.EPUB_A11Y_11_WCAG_20_A||this===v.EPUB_A11Y_11_WCAG_21_A||this===v.EPUB_A11Y_11_WCAG_22_A}get isWCAGLevelAA(){return this===v.EPUB_A11Y_10_WCAG_20_AA||this===v.EPUB_A11Y_11_WCAG_20_AA||this===v.EPUB_A11Y_11_WCAG_21_AA||this===v.EPUB_A11Y_11_WCAG_22_AA}get isWCAGLevelAAA(){return this===v.EPUB_A11Y_10_WCAG_20_AAA||this===v.EPUB_A11Y_11_WCAG_20_AAA||this===v.EPUB_A11Y_11_WCAG_21_AAA||this===v.EPUB_A11Y_11_WCAG_22_AAA}};v.EPUB_A11Y_10_WCAG_20_A=new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"),v.EPUB_A11Y_10_WCAG_20_AA=new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"),v.EPUB_A11Y_10_WCAG_20_AAA=new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"),v.EPUB_A11Y_11_WCAG_20_A=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"),v.EPUB_A11Y_11_WCAG_20_AA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"),v.EPUB_A11Y_11_WCAG_20_AAA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"),v.EPUB_A11Y_11_WCAG_21_A=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"),v.EPUB_A11Y_11_WCAG_21_AA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"),v.EPUB_A11Y_11_WCAG_21_AAA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"),v.EPUB_A11Y_11_WCAG_22_A=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"),v.EPUB_A11Y_11_WCAG_22_AA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"),v.EPUB_A11Y_11_WCAG_22_AAA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");let ve=v;class ye{constructor(e=null,t=null,i=null){this.certifiedBy=e,this.credential=t,this.report=i}static deserialize(e){if(!(!e||typeof e!="object"))return new ye(e.certifiedBy,e.credential,e.report)}serialize(){const e={};return this.certifiedBy&&(e.certifiedBy=this.certifiedBy),this.credential&&(e.credential=this.credential),this.report&&(e.report=this.report),e}}const k=class k{constructor(e){this.value=e}static deserialize(e){if(!(!e||typeof e!="string"))return new k(e)}serialize(){return this.value}};k.AUDITORY=new k("auditory"),k.CHART_ON_VISUAL=new k("chartOnVisual"),k.CHEM_ON_VISUAL=new k("chemOnVisual"),k.COLOR_DEPENDENT=new k("colorDependent"),k.DIAGRAM_ON_VISUAL=new k("diagramOnVisual"),k.MATH_ON_VISUAL=new k("mathOnVisual"),k.MUSIC_ON_VISUAL=new k("musicOnVisual"),k.TACTILE=new k("tactile"),k.TEXT_ON_VISUAL=new k("textOnVisual"),k.TEXTUAL=new k("textual"),k.VISUAL=new k("visual");let N=k;const C=class C{constructor(e){if(typeof e=="string"){if(!C.VALID_MODES.has(e.toLowerCase()))return;this.value=e.toLowerCase()}else{const t=e.filter(i=>C.VALID_MODES.has(i.toLowerCase()));if(t.length===0)return;this.value=Array.from(new Set(t))}}static deserialize(e){if(!e)return;if(typeof e=="string")return new C(e);if(!Array.isArray(e))return;const t=e.filter(i=>i?C.VALID_MODES.has(i.toLowerCase()):!1);if(t.length!==0)return new C(t)}serialize(){return this.value}};C.VALID_MODES=new Set(["auditory","tactile","textual","visual"]),C.AUDITORY=new C("auditory"),C.TACTILE=new C("tactile"),C.TEXTUAL=new C("textual"),C.VISUAL=new C("visual");let Ae=C;const d=class d{constructor(e){this.value=e}static deserialize(e){if(!(!e||typeof e!="string"))return new d(e)}serialize(){return this.value}};d.NONE=new d("none"),d.ANNOTATIONS=new d("annotations"),d.ARIA=new d("ARIA"),d.INDEX=new d("index"),d.PAGE_BREAK_MARKERS=new d("pageBreakMarkers"),d.PAGE_NAVIGATION=new d("pageNavigation"),d.PRINT_PAGE_NUMBERS=new d("printPageNumbers"),d.READING_ORDER=new d("readingOrder"),d.STRUCTURAL_NAVIGATION=new d("structuralNavigation"),d.TABLE_OF_CONTENTS=new d("tableOfContents"),d.TAGGED_PDF=new d("taggedPDF"),d.ALTERNATIVE_TEXT=new d("alternativeText"),d.AUDIO_DESCRIPTION=new d("audioDescription"),d.CAPTIONS=new d("captions"),d.CLOSED_CAPTIONS=new d("closedCaptions"),d.DESCRIBED_MATH=new d("describedMath"),d.LONG_DESCRIPTION=new d("longDescription"),d.OPEN_CAPTIONS=new d("openCaptions"),d.SIGN_LANGUAGE=new d("signLanguage"),d.TRANSCRIPT=new d("transcript"),d.DISPLAY_TRANSFORMABILITY=new d("displayTransformability"),d.SYNCHRONIZED_AUDIO_TEXT=new d("synchronizedAudioText"),d.TIMING_CONTROL=new d("timingControl"),d.UNLOCKED=new d("unlocked"),d.CHEM_ML=new d("ChemML"),d.LATEX=new d("latex"),d.LATEX_CHEMISTRY=new d("latex-chemistry"),d.MATH_ML=new d("MathML"),d.MATH_ML_CHEMISTRY=new d("MathML-chemistry"),d.TTS_MARKUP=new d("ttsMarkup"),d.HIGH_CONTRAST_AUDIO=new d("highContrastAudio"),d.HIGH_CONTRAST_DISPLAY=new d("highContrastDisplay"),d.LARGE_PRINT=new d("largePrint"),d.BRAILLE=new d("braille"),d.TACTILE_GRAPHIC=new d("tactileGraphic"),d.TACTILE_OBJECT=new d("tactileObject"),d.FULL_RUBY_ANNOTATIONS=new d("fullRubyAnnotations"),d.HORIZONTAL_WRITING=new d("horizontalWriting"),d.RUBY_ANNOTATIONS=new d("rubyAnnotations"),d.VERTICAL_WRITING=new d("verticalWriting"),d.WITH_ADDITIONAL_WORD_SEGMENTATION=new d("withAdditionalWordSegmentation"),d.WITHOUT_ADDITIONAL_WORD_SEGMENTATION=new d("withoutAdditionalWordSegmentation");let y=d;const w=class w{constructor(e){this.value=e}static deserialize(e){if(!(!e||typeof e!="string"))return new w(e)}serialize(){return this.value}};w.FLASHING=new w("flashing"),w.NO_FLASHING_HAZARD=new w("noFlashingHazard"),w.UNKNOWN_FLASHING_HAZARD=new w("unknownFlashingHazard"),w.MOTION_SIMULATION=new w("motionSimulation"),w.NO_MOTION_SIMULATION_HAZARD=new w("noMotionSimulationHazard"),w.UNKNOWN_MOTION_SIMULATION_HAZARD=new w("unknownMotionSimulationHazard"),w.SOUND=new w("sound"),w.NO_SOUND_HAZARD=new w("noSoundHazard"),w.UNKNOWN_SOUND_HAZARD=new w("unknownSoundHazard"),w.UNKNOWN=new w("unknown"),w.NONE=new w("none");let P=w;const S=class S{constructor(e){this.value=e}static deserialize(e){if(!(!e||typeof e!="string"))return new S(e)}serialize(){return this.value}};S.NONE=new S("none"),S.DOCUMENTED=new S("documented"),S.LEGAL=new S("legal"),S.TEMPORARY=new S("temporary"),S.TECHNICAL=new S("technical"),S.EAA_DISPROPORTIONATE_BURDEN=new S("eaa-disproportionate-burden"),S.EAA_FUNDAMENTAL_ALTERATION=new S("eaa-fundamental-alteration"),S.EAA_MICROENTERPRISE=new S("eaa-microenterprise"),S.EAA_TECHNICAL_IMPOSSIBILITY=new S("eaa-technical-impossibility"),S.EAA_TEMPORARY=new S("eaa-temporary");let ke=S;const ut=["en","ar","da","fr","it","pt_PT","sv"],mi={publication: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"}}`)},ht={fr:()=>Promise.resolve().then(()=>es),ar:()=>Promise.resolve().then(()=>ts),da:()=>Promise.resolve().then(()=>is),it:()=>Promise.resolve().then(()=>ns),pt_PT:()=>Promise.resolve().then(()=>ss),sv:()=>Promise.resolve().then(()=>rs)},pt=mi?.publication?.metadata?.accessibility?.["display-guide"]||{};class Z{constructor(){this.currentLocaleCode="en",this.locale=pt,this.loadedLocales={},this.loadedLocales.en=pt}static getInstance(){return Z.instance||(Z.instance=new Z),Z.instance}async loadLocale(e){if(!ut.includes(e))return console.warn(`Locale '${e}' is not enabled`),!1;if(e in this.loadedLocales)return!0;try{if(!(e in ht))return console.warn(`Locale file not found for: ${e}`),!1;const s=(await ht[e]()).default?.publication?.metadata?.accessibility?.["display-guide"];return s?(this.loadedLocales[e]=s,!0):(console.warn(`No accessibility strings found in locale ${e}`),!1)}catch(t){return console.warn(`Failed to load locale ${e}:`,t),!1}}registerLocale(e,t){if(!e||typeof e!="string")throw new Error("Locale code must be a non-empty string");this.loadedLocales[e]=t}async setLocale(e){return e in this.loadedLocales||await this.loadLocale(e),e in this.loadedLocales?(this.locale=this.loadedLocales[e],this.currentLocaleCode=e,!0):(console.warn(`Locale '${e}' is not available`),!1)}getCurrentLocale(){return this.currentLocaleCode}getAvailableLocales(){return ut}getNestedValue(e,t){const i=t.split(".");let s=e;for(const r of i){if(s==null)return;s=s[r]}return s}getString(e){let t=this.getNestedValue(this.locale,e);return t===void 0&&this.currentLocaleCode!=="en"&&(t=this.getNestedValue(this.loadedLocales.en,e)),t!==void 0?typeof t=="string"?{compact:t,descriptive:t}:t:(console.warn(`Missing localization for key: ${e}`),{compact:"",descriptive:""})}}const m=Z.getInstance();var $=(n=>(n.reflowable="reflowable",n.fixed="fixed",n.scrolled="scrolled",n))($||{}),mt=(n=>(n.Unknown="unknown",n.Modifiable="modifiable",n.Unmodifiable="unmodifiable",n))(mt||{}),ft=(n=>(n.NoMetadata="noMetadata",n.Readable="readable",n.NotFully="notFully",n.Unreadable="unreadable",n))(ft||{}),gt=(n=>(n.NoMetadata="noMetadata",n.Synchronized="synchronized",n.AudioOnly="audioOnly",n.AudioComplementary="audioComplementary",n))(gt||{});class we{constructor(e="unknown",t="noMetadata",i=!1,s="noMetadata"){this.id="ways-of-reading.title",this.visualAdjustments=e,this.nonvisualReading=t,this.nonvisualReadingAltText=i,this.prerecordedAudio=s,this.shouldDisplay=!0;const r=m.getString(this.id);this.title=r.compact,this.statements=[];const a=e==="modifiable"?"ways-of-reading.visual-adjustments.modifiable":e==="unmodifiable"?"ways-of-reading.visual-adjustments.unmodifiable":"ways-of-reading.visual-adjustments.unknown",o=m.getString(a);this.statements.push({id:a,compactString:o.compact,descriptiveString:o.descriptive});let u="";t==="readable"?u="ways-of-reading.nonvisual-reading.readable":t==="notFully"?u="ways-of-reading.nonvisual-reading.not-fully":t==="unreadable"?u="ways-of-reading.nonvisual-reading.none":t==="noMetadata"&&(u="ways-of-reading.nonvisual-reading.no-metadata");const g=m.getString(u);if(this.statements.push({id:u,compactString:g.compact,descriptiveString:g.descriptive}),i){const b=m.getString("ways-of-reading.nonvisual-reading.alt-text");this.statements.push({id:"ways-of-reading.nonvisual-reading.alt-text",compactString:b.compact,descriptiveString:b.descriptive})}let f="";s==="synchronized"?f="ways-of-reading.prerecorded-audio.synchronized":s==="audioOnly"?f="ways-of-reading.prerecorded-audio.only":s==="audioComplementary"?f="ways-of-reading.prerecorded-audio.complementary":s==="noMetadata"&&(f="ways-of-reading.prerecorded-audio.no-metadata");const h=m.getString(f);this.statements.push({id:f,compactString:h.compact,descriptiveString:h.descriptive})}static fromPublication(e){const t=e.metadata.accessibility??new F,i=t.feature??[],s=e.metadata.layout===$.fixed,r=i.some(p=>p.value===y.DISPLAY_TRANSFORMABILITY.value)?"modifiable":s?"unmodifiable":"unknown",a=t.accessMode??[],o=t.accessModeSufficient??[],u=a.length>0&&a.every(p=>p.value===N.TEXTUAL.value)||o.some(p=>{const x=p.value;return Array.isArray(x)?x.every(B=>B===N.TEXTUAL.value):x===N.TEXTUAL.value}),g=a.some(p=>p.value===N.TEXTUAL.value)||o.some(p=>{const x=p.value;return Array.isArray(x)?x.some(B=>B===N.TEXTUAL.value):x===N.TEXTUAL.value}),f=!(a.length===0&&o.length===0)&&!a.some(p=>p.value===N.TEXTUAL.value)&&!o.some(p=>{const x=p.value;return Array.isArray(x)?x.some(B=>B===N.TEXTUAL.value):x===N.TEXTUAL.value}),h=i.some(p=>[y.LONG_DESCRIPTION.value,y.ALTERNATIVE_TEXT.value,y.DESCRIBED_MATH.value,y.TRANSCRIPT.value].includes(p.value)),b=u?"readable":g||h?"notFully":f?"unreadable":"noMetadata",A=h,D=i.some(p=>p.value===y.SYNCHRONIZED_AUDIO_TEXT.value)?"synchronized":o.some(p=>{const x=p.value;return Array.isArray(x)?x.some(B=>B===N.AUDITORY.value):x===N.AUDITORY.value})?"audioOnly":a.some(p=>p.value===N.AUDITORY.value)?"audioComplementary":"noMetadata";return new we(r,b,A,D)}}class Se{constructor(e=!1,t=!1,i=!1,s=!1){this.id="navigation.title",this.tableOfContents=e,this.index=t,this.headings=i,this.page=s,this.noMetadata=!e&&!t&&!i&&!s;const r=m.getString(this.id);if(this.title=r.compact,this.shouldDisplay=!this.noMetadata,this.statements=[],e){const a=m.getString("navigation.toc");this.statements.push({id:"navigation.toc",compactString:a.compact,descriptiveString:a.descriptive})}if(t){const a=m.getString("navigation.index");this.statements.push({id:"navigation.index",compactString:a.compact,descriptiveString:a.descriptive})}if(i){const a=m.getString("navigation.structural");this.statements.push({id:"navigation.structural",compactString:a.compact,descriptiveString:a.descriptive})}if(s){const a=m.getString("navigation.page-navigation");this.statements.push({id:"navigation.page-navigation",compactString:a.compact,descriptiveString:a.descriptive})}if(this.statements.length===0){const a=m.getString("navigation.no-metadata");this.statements.push({id:"navigation.no-metadata",compactString:a.compact,descriptiveString:a.descriptive})}}static fromPublication(e){const i=(e.metadata.accessibility??new F).feature??[];return new Se(i.some(s=>s.value===y.TABLE_OF_CONTENTS.value),i.some(s=>s.value===y.INDEX.value),i.some(s=>s.value===y.STRUCTURAL_NAVIGATION.value),i.some(s=>s.value===y.PAGE_NAVIGATION.value))}}var bt=(n=>(n.Math="math",n.Chemistry="chemistry",n.Music="music",n.Diagram="diagram",n.Chart="chart",n.Graph="graph",n.Table="table",n.Image="image",n))(bt||{});class Ee{constructor(e=!1,t=!1,i=!1,s=!1,r=!1,a=!1,o=!1,u=!1,g=!1){this.id="rich-content.title",this.extendedAltTextDescriptions=e,this.mathFormula=t,this.mathFormulaAsMathML=i,this.mathFormulaAsLaTeX=s,this.chemicalFormulaAsMathML=r,this.chemicalFormulaAsLaTeX=a,this.closedCaptions=o,this.openCaptions=u,this.transcript=g,this.noMetadata=!e&&!t&&!i&&!s&&!r&&!a&&!o&&!u&&!g,this.shouldDisplay=!this.noMetadata;const f=m.getString(this.id);if(this.title=f.compact,this.statements=[],e){const h=m.getString("rich-content.extended-descriptions");this.statements.push({id:"rich-content.extended-descriptions",compactString:h.compact,descriptiveString:h.descriptive})}if(t){const h=m.getString("rich-content.accessible-math-described");this.statements.push({id:"rich-content.accessible-math-described",compactString:h.compact,descriptiveString:h.descriptive})}if(i){const h=m.getString("rich-content.math-as-mathml");this.statements.push({id:"rich-content.math-as-mathml",compactString:h.compact,descriptiveString:h.descriptive})}if(s){const h=m.getString("rich-content.accessible-math-as-latex");this.statements.push({id:"rich-content.accessible-math-as-latex",compactString:h.compact,descriptiveString:h.descriptive})}if(r){const h=m.getString("rich-content.accessible-chemistry-as-mathml");this.statements.push({id:"rich-content.accessible-chemistry-as-mathml",compactString:h.compact,descriptiveString:h.descriptive})}if(a){const h=m.getString("rich-content.accessible-chemistry-as-latex");this.statements.push({id:"rich-content.accessible-chemistry-as-latex",compactString:h.compact,descriptiveString:h.descriptive})}if(o){const h=m.getString("rich-content.closed-captions");this.statements.push({id:"rich-content.closed-captions",compactString:h.compact,descriptiveString:h.descriptive})}if(u){const h=m.getString("rich-content.open-captions");this.statements.push({id:"rich-content.open-captions",compactString:h.compact,descriptiveString:h.descriptive})}if(g){const h=m.getString("rich-content.transcript");this.statements.push({id:"rich-content.transcript",compactString:h.compact,descriptiveString:h.descriptive})}if(this.statements.length===0){const h=m.getString("rich-content.unknown");this.statements.push({id:"rich-content.unknown",compactString:h.compact,descriptiveString:h.descriptive})}}static fromPublication(e){const i=(e.metadata.accessibility??new F).feature??[];return new Ee(i.some(s=>s.value===y.LONG_DESCRIPTION.value),i.some(s=>s.value===y.DESCRIBED_MATH.value),i.some(s=>s.value===y.MATH_ML.value),i.some(s=>s.value===y.LATEX.value),i.some(s=>s.value===y.MATH_ML_CHEMISTRY.value),i.some(s=>s.value===y.LATEX_CHEMISTRY.value),i.some(s=>s.value===y.CLOSED_CAPTIONS.value),i.some(s=>s.value===y.OPEN_CAPTIONS.value),i.some(s=>s.value===y.TRANSCRIPT.value))}}class Ie{constructor(e=!1,t=!1,i=!1,s=!1,r=!1,a=!1,o=!1,u=!1,g=!1,f=!1,h=!1,b=!1,A=!1){this.id="additional-accessibility-information.title",this.pageBreakMarkers=e,this.aria=t,this.audioDescriptions=i,this.braille=s,this.rubyAnnotations=r,this.fullRubyAnnotations=a,this.highAudioContrast=o,this.highDisplayContrast=u,this.largePrint=g,this.signLanguage=f,this.tactileGraphics=h,this.tactileObjects=b,this.textToSpeechHinting=A,this.noMetadata=!e&&!t&&!i&&!s&&!r&&!a&&!o&&!u&&!g&&!f&&!h&&!b&&!A,this.shouldDisplay=!this.noMetadata;const D=m.getString(this.id);if(this.title=D.compact,this.statements=[],e){const p=m.getString("additional-accessibility-information.page-breaks");this.statements.push({id:"additional-accessibility-information.page-breaks",compactString:p.compact,descriptiveString:p.descriptive})}if(t){const p=m.getString("additional-accessibility-information.aria");this.statements.push({id:"additional-accessibility-information.aria",compactString:p.compact,descriptiveString:p.descriptive})}if(i){const p=m.getString("additional-accessibility-information.audio-descriptions");this.statements.push({id:"additional-accessibility-information.audio-descriptions",compactString:p.compact,descriptiveString:p.descriptive})}if(s){const p=m.getString("additional-accessibility-information.braille");this.statements.push({id:"additional-accessibility-information.braille",compactString:p.compact,descriptiveString:p.descriptive})}if(r){const p=m.getString("additional-accessibility-information.ruby-annotations");this.statements.push({id:"additional-accessibility-information.ruby-annotations",compactString:p.compact,descriptiveString:p.descriptive})}if(a){const p=m.getString("additional-accessibility-information.full-ruby-annotations");this.statements.push({id:"additional-accessibility-information.full-ruby-annotations",compactString:p.compact,descriptiveString:p.descriptive})}if(o){const p=m.getString("additional-accessibility-information.high-contrast-between-foreground-and-background-audio");this.statements.push({id:"additional-accessibility-information.high-contrast-between-foreground-and-background-audio",compactString:p.compact,descriptiveString:p.descriptive})}if(u){const p=m.getString("additional-accessibility-information.high-contrast-between-text-and-background");this.statements.push({id:"additional-accessibility-information.high-contrast-between-text-and-background",compactString:p.compact,descriptiveString:p.descriptive})}if(g){const p=m.getString("additional-accessibility-information.large-print");this.statements.push({id:"additional-accessibility-information.large-print",compactString:p.compact,descriptiveString:p.descriptive})}if(f){const p=m.getString("additional-accessibility-information.sign-language");this.statements.push({id:"additional-accessibility-information.sign-language",compactString:p.compact,descriptiveString:p.descriptive})}if(h){const p=m.getString("additional-accessibility-information.tactile-graphics");this.statements.push({id:"additional-accessibility-information.tactile-graphics",compactString:p.compact,descriptiveString:p.descriptive})}if(b){const p=m.getString("additional-accessibility-information.tactile-objects");this.statements.push({id:"additional-accessibility-information.tactile-objects",compactString:p.compact,descriptiveString:p.descriptive})}if(A){const p=m.getString("additional-accessibility-information.text-to-speech-hinting");this.statements.push({id:"additional-accessibility-information.text-to-speech-hinting",compactString:p.compact,descriptiveString:p.descriptive})}}static fromPublication(e){const i=(e.metadata.accessibility??new F).feature??[];return new Ie(i.some(s=>s.value===y.PAGE_BREAK_MARKERS.value||s.value===y.PRINT_PAGE_NUMBERS.value),i.some(s=>s.value===y.ARIA.value),i.some(s=>s.value===y.AUDIO_DESCRIPTION.value),i.some(s=>s.value===y.BRAILLE.value),i.some(s=>s.value===y.RUBY_ANNOTATIONS.value),i.some(s=>s.value===y.FULL_RUBY_ANNOTATIONS.value),i.some(s=>s.value===y.HIGH_CONTRAST_AUDIO.value),i.some(s=>s.value===y.HIGH_CONTRAST_DISPLAY.value),i.some(s=>s.value===y.LARGE_PRINT.value),i.some(s=>s.value===y.SIGN_LANGUAGE.value),i.some(s=>s.value===y.TACTILE_GRAPHIC.value),i.some(s=>s.value===y.TACTILE_OBJECT.value),i.some(s=>s.value===y.TTS_MARKUP.value))}}var vt=(n=>(n.yes="yes",n.no="no",n.unknown="unknown",n.noMetadata="noMetadata",n))(vt||{});class Te{constructor(e="unknown",t="unknown",i="unknown"){this.id="hazards.title",this.flashing=e,this.motion=t,this.sound=i;const s=m.getString(this.id);if(this.title=s.compact,this.noMetadata=e==="noMetadata"&&t==="noMetadata"&&i==="noMetadata",this.noHazards=e==="no"&&t==="no"&&i==="no",this.unknown=e==="unknown"&&t==="unknown"&&i==="unknown",this.shouldDisplay=!this.noMetadata,this.statements=[],this.noHazards){const r=m.getString("hazards.none");this.statements.push({id:"hazards.none",compactString:r.compact,descriptiveString:r.descriptive})}else if(this.unknown){const r=m.getString("hazards.unknown");this.statements.push({id:"hazards.unknown",compactString:r.compact,descriptiveString:r.descriptive})}else if(this.noMetadata){const r=m.getString("hazards.no-metadata");this.statements.push({id:"hazards.no-metadata",compactString:r.compact,descriptiveString:r.descriptive})}else{if(e==="yes"){const r=m.getString("hazards.flashing");this.statements.push({id:"hazards.flashing",compactString:r.compact,descriptiveString:r.descriptive})}else if(e==="unknown"){const r=m.getString("hazards.flashing-unknown");this.statements.push({id:"hazards.flashing-unknown",compactString:r.compact,descriptiveString:r.descriptive})}else if(e==="no"){const r=m.getString("hazards.flashing-none");this.statements.push({id:"hazards.flashing-none",compactString:r.compact,descriptiveString:r.descriptive})}if(t==="yes"){const r=m.getString("hazards.motion");this.statements.push({id:"hazards.motion",compactString:r.compact,descriptiveString:r.descriptive})}else if(t==="unknown"){const r=m.getString("hazards.motion-unknown");this.statements.push({id:"hazards.motion-unknown",compactString:r.compact,descriptiveString:r.descriptive})}else if(t==="no"){const r=m.getString("hazards.motion-none");this.statements.push({id:"hazards.motion-none",compactString:r.compact,descriptiveString:r.descriptive})}if(i==="yes"){const r=m.getString("hazards.sound");this.statements.push({id:"hazards.sound",compactString:r.compact,descriptiveString:r.descriptive})}else if(i==="unknown"){const r=m.getString("hazards.sound-unknown");this.statements.push({id:"hazards.sound-unknown",compactString:r.compact,descriptiveString:r.descriptive})}else if(i==="no"){const r=m.getString("hazards.sound-none");this.statements.push({id:"hazards.sound-none",compactString:r.compact,descriptiveString:r.descriptive})}}}static fromPublication(e){const t=e.metadata.accessibility?.hazard??[];let i;t.some(o=>o.value===P.NONE.value)?i="no":t.some(o=>o.value===P.UNKNOWN.value)?i="unknown":i="noMetadata";let s;t.some(o=>o.value===P.FLASHING.value)?s="yes":t.some(o=>o.value===P.NO_FLASHING_HAZARD.value)?s="no":t.some(o=>o.value===P.UNKNOWN_FLASHING_HAZARD.value)?s="unknown":s=i;let r;t.some(o=>o.value===P.MOTION_SIMULATION.value)?r="yes":t.some(o=>o.value===P.NO_MOTION_SIMULATION_HAZARD.value)?r="no":t.some(o=>o.value===P.UNKNOWN_MOTION_SIMULATION_HAZARD.value)?r="unknown":r=i;let a;return t.some(o=>o.value===P.SOUND.value)?a="yes":t.some(o=>o.value===P.NO_SOUND_HAZARD.value)?a="no":t.some(o=>o.value===P.UNKNOWN_SOUND_HAZARD.value)?a="unknown":a=i,new Te(s,r,a)}}class Le{constructor(e=[]){this.id="conformance.title",this.profiles=e,this.shouldDisplay=!0;const t=m.getString(this.id);if(this.title=t.compact,this.statements=[],e.length===0){const i=m.getString("conformance.no");this.statements.push({id:"conformance.no",compactString:i.compact,descriptiveString:i.descriptive});return}if(e.some(i=>i.isWCAGLevelAAA)){const i=m.getString("conformance.aaa");this.statements.push({id:"conformance.aaa",compactString:i.compact,descriptiveString:i.descriptive})}else if(e.some(i=>i.isWCAGLevelAA)){const i=m.getString("conformance.aa");this.statements.push({id:"conformance.aa",compactString:i.compact,descriptiveString:i.descriptive})}else if(e.some(i=>i.isWCAGLevelA)){const i=m.getString("conformance.a");this.statements.push({id:"conformance.a",compactString:i.compact,descriptiveString:i.descriptive})}else{const i=m.getString("conformance.unknown-standard");this.statements.push({id:"conformance.unknown-standard",compactString:i.compact,descriptiveString:i.descriptive})}}static fromPublication(e){const t=e.metadata.accessibility?.conformsTo??[];return new Le(t)}}class ze{constructor(e=!1){this.id="legal-considerations.title",this.exemption=e,this.shouldDisplay=this.exemption;const t=m.getString(this.id);if(this.title=t.compact,this.statements=[],e){const i=m.getString("legal-considerations.exempt");this.statements.push({id:"legal-considerations.exempt",compactString:i.compact,descriptiveString:i.descriptive})}else{const i=m.getString("legal-considerations.no-metadata");this.statements.push({id:"legal-considerations.no-metadata",compactString:i.compact,descriptiveString:i.descriptive})}}static fromPublication(e){const i=(e.metadata.accessibility?.exemption??[]).length>0;return new ze(i)}}class xe{constructor(e){this.id="accessibility-summary.title",this.shouldDisplay=!0;const t=m.getString(this.id);this.title=t.compact;const i=e.metadata.accessibility?.summary;if(this.statements=[],this.shouldDisplay&&i)this.statements.push({id:"accessibility-summary.summary",compactString:i,descriptiveString:i});else{const s=m.getString("accessibility-summary.no-metadata");this.statements.push({id:"accessibility-summary.no-metadata",compactString:s.compact,descriptiveString:s.descriptive})}}static fromPublication(e){return new xe(e)}}class fi{constructor(e){this.waysOfReading=we.fromPublication(e),this.navigation=Se.fromPublication(e),this.richContent=Ee.fromPublication(e),this.additionalInformation=Ie.fromPublication(e),this.hazards=Te.fromPublication(e),this.conformance=Le.fromPublication(e),this.legal=ze.fromPublication(e),this.accessibilitySummary=xe.fromPublication(e),this.fields=[this.waysOfReading,this.navigation,this.richContent,this.additionalInformation,this.hazards,this.conformance,this.legal,this.accessibilitySummary]}}class Ne{constructor(e){this.algorithm=e.algorithm,this.compression=e.compression,this.originalLength=e.originalLength,this.profile=e.profile,this.scheme=e.scheme}static deserialize(e){if(e&&e.algorithm)return new Ne({algorithm:e.algorithm,compression:e.compression,originalLength:e.originalLength,profile:e.profile,scheme:e.scheme})}serialize(){const e={algorithm:this.algorithm};return this.compression!==void 0&&(e.compression=this.compression),this.originalLength!==void 0&&(e.originalLength=this.originalLength),this.profile!==void 0&&(e.profile=this.profile),this.scheme!==void 0&&(e.scheme=this.scheme),e}}var Oe=(n=>(n.left="left",n.right="right",n.center="center",n))(Oe||{});class _{constructor(e){this.otherProperties=e}get page(){return this.otherProperties.page}static deserialize(e){if(e)return new _(e)}serialize(){return this.otherProperties}add(e){const t=Object.assign({},this.otherProperties);for(const i in e)t[i]=e[i];return new _(t)}}Object.defineProperty(_.prototype,"encryption",{get:function(){return Ne.deserialize(this.otherProperties.encrypted)}});class Ce{constructor(e){this.activeClass=e.activeClass,this.playbackActiveClass=e.playbackActiveClass}static deserialize(e){if(e)return new Ce({activeClass:e.activeClass,playbackActiveClass:e.playbackActiveClass})}serialize(){const e={};return this.activeClass&&(e.activeClass=this.activeClass),this.playbackActiveClass&&(e.playbackActiveClass=this.playbackActiveClass),e}}function yt(n){return n&&Array.isArray(n)?n:void 0}function H(n){return n&&typeof n=="string"?[n]:yt(n)}function ne(n){return typeof n=="string"?new Date(n):void 0}function Y(n){return isNaN(n)?void 0:n}function T(n){return Y(n)!==void 0&&Math.sign(n)>=0?n:void 0}function se(n){const e=new Array;return n.forEach(t=>e.push(t)),e}class X{constructor(e){this.value=e.value,this.scheme=e.scheme}static deserialize(e){if(e){if(typeof e=="string")return new X({value:e});if(typeof e=="object"&&e.value)return new X({value:e.value,scheme:e.scheme})}}serialize(){return this.scheme?{value:this.value,scheme:this.scheme}:this.value}}class l{constructor(e){let t,i,s=e.mediaType.replace(/\s/g,"").split(";");const r=s[0].split("/");if(r.length===2){if(t=r[0].toLowerCase().trim(),i=r[1].toLowerCase().trim(),t.length===0||i.length===0)throw new Error("Invalid media type")}else throw new Error("Invalid media type");const a={};for(let b=1;b<s.length;b++){const A=s[b].split("=");if(A.length===2){const D=A[0].toLocaleLowerCase(),p=D==="charset"?A[1].toUpperCase():A[1];a[D]=p}}const o={},u=Object.keys(a);u.sort((b,A)=>b.localeCompare(A)),u.forEach(b=>o[b]=a[b]);let g="";for(const b in o){const A=o[b];g+=`;${b}=${A}`}const f=`${t}/${i}${g}`,h=o.encoding;this.string=f,this.type=t,this.subtype=i,this.parameters=o,this.encoding=h,this.name=e.name,this.fileExtension=e.fileExtension}static parse(e){return new l(e)}get structuredSyntaxSuffix(){const e=this.subtype.split("+");return e.length>1?`+${e[e.length-1]}`:void 0}get charset(){return this.parameters.charset}contains(e){const t=typeof e=="string"?l.parse({mediaType:e}):e;if(!((this.type==="*"||this.type===t.type)&&(this.subtype==="*"||this.subtype===t.subtype)))return!1;const i=new Set(Object.entries(this.parameters).map(([r,a])=>`${r}=${a}`)),s=new Set(Object.entries(t.parameters).map(([r,a])=>`${r}=${a}`));for(const r of Array.from(i.values()))if(!s.has(r))return!1;return!0}matches(e){const t=typeof e=="string"?l.parse({mediaType:e}):e;return this.contains(t)||t.contains(this)}matchesAny(...e){for(const t of e)if(this.matches(t))return!0;return!1}equals(e){return this.string===e.string}get isZIP(){return this.matchesAny(l.ZIP,l.LCP_PROTECTED_AUDIOBOOK,l.LCP_PROTECTED_PDF)||this.structuredSyntaxSuffix==="+zip"}get isJSON(){return this.matchesAny(l.JSON)||this.structuredSyntaxSuffix==="+json"}get isOPDS(){return this.matchesAny(l.OPDS1,l.OPDS1_ENTRY,l.OPDS2,l.OPDS2_PUBLICATION,l.OPDS_AUTHENTICATION)||this.structuredSyntaxSuffix==="+json"}get isHTML(){return this.matchesAny(l.HTML,l.XHTML)}get isBitmap(){return this.matchesAny(l.BMP,l.GIF,l.JPEG,l.PNG,l.TIFF,l.WEBP)}get isAudio(){return this.type==="audio"}get isVideo(){return this.type==="video"}get isRWPM(){return this.matchesAny(l.READIUM_AUDIOBOOK_MANIFEST,l.DIVINA_MANIFEST,l.READIUM_WEBPUB_MANIFEST)}get isPublication(){return this.matchesAny(l.READIUM_AUDIOBOOK,l.READIUM_AUDIOBOOK_MANIFEST,l.CBZ,l.DIVINA,l.DIVINA_MANIFEST,l.EPUB,l.LCP_PROTECTED_AUDIOBOOK,l.LCP_PROTECTED_PDF,l.LPF,l.PDF,l.W3C_WPUB_MANIFEST,l.READIUM_WEBPUB,l.READIUM_WEBPUB_MANIFEST,l.ZAB)}static get AAC(){return l.parse({mediaType:"audio/aac",fileExtension:"aac"})}static get ACSM(){return l.parse({mediaType:"application/vnd.adobe.adept+xml",name:"Adobe Content Server Message",fileExtension:"acsm"})}static get AIFF(){return l.parse({mediaType:"audio/aiff",fileExtension:"aiff"})}static get AVI(){return l.parse({mediaType:"video/x-msvideo",fileExtension:"avi"})}static get BINARY(){return l.parse({mediaType:"application/octet-stream"})}static get BMP(){return l.parse({mediaType:"image/bmp",fileExtension:"bmp"})}static get CBZ(){return l.parse({mediaType:"application/vnd.comicbook+zip",name:"Comic Book Archive",fileExtension:"cbz"})}static get CSS(){return l.parse({mediaType:"text/css",fileExtension:"css"})}static get DIVINA(){return l.parse({mediaType:"application/divina+zip",name:"Digital Visual Narratives",fileExtension:"divina"})}static get DIVINA_MANIFEST(){return l.parse({mediaType:"application/divina+json",name:"Digital Visual Narratives",fileExtension:"json"})}static get EPUB(){return l.parse({mediaType:"application/epub+zip",name:"EPUB",fileExtension:"epub"})}static get GIF(){return l.parse({mediaType:"image/gif",fileExtension:"gif"})}static get GZ(){return l.parse({mediaType:"application/gzip",fileExtension:"gz"})}static get HTML(){return l.parse({mediaType:"text/html",fileExtension:"html"})}static get JAVASCRIPT(){return l.parse({mediaType:"text/javascript",fileExtension:"js"})}static get JPEG(){return l.parse({mediaType:"image/jpeg",fileExtension:"jpeg"})}static get JSON(){return l.parse({mediaType:"application/json"})}static get LCP_LICENSE_DOCUMENT(){return l.parse({mediaType:"application/vnd.readium.lcp.license.v1.0+json",name:"LCP License",fileExtension:"lcpl"})}static get LCP_PROTECTED_AUDIOBOOK(){return l.parse({mediaType:"application/audiobook+lcp",name:"LCP Protected Audiobook",fileExtension:"lcpa"})}static get LCP_PROTECTED_PDF(){return l.parse({mediaType:"application/pdf+lcp",name:"LCP Protected PDF",fileExtension:"lcpdf"})}static get LCP_STATUS_DOCUMENT(){return l.parse({mediaType:"application/vnd.readium.license.status.v1.0+json"})}static get LPF(){return l.parse({mediaType:"application/lpf+zip",fileExtension:"lpf"})}static get MP3(){return l.parse({mediaType:"audio/mpeg",fileExtension:"mp3"})}static get MPEG(){return l.parse({mediaType:"video/mpeg",fileExtension:"mpeg"})}static get NCX(){return l.parse({mediaType:"application/x-dtbncx+xml",fileExtension:"ncx"})}static get OGG(){return l.parse({mediaType:"audio/ogg",fileExtension:"oga"})}static get OGV(){return l.parse({mediaType:"video/ogg",fileExtension:"ogv"})}static get OPDS1(){return l.parse({mediaType:"application/atom+xml;profile=opds-catalog"})}static get OPDS1_ENTRY(){return l.parse({mediaType:"application/atom+xml;type=entry;profile=opds-catalog"})}static get OPDS2(){return l.parse({mediaType:"application/opds+json"})}static get OPDS2_PUBLICATION(){return l.parse({mediaType:"application/opds-publication+json"})}static get OPDS_AUTHENTICATION(){return l.parse({mediaType:"application/opds-authentication+json"})}static get OPUS(){return l.parse({mediaType:"audio/opus",fileExtension:"opus"})}static get OTF(){return l.parse({mediaType:"font/otf",fileExtension:"otf"})}static get PDF(){return l.parse({mediaType:"application/pdf",name:"PDF",fileExtension:"pdf"})}static get PNG(){return l.parse({mediaType:"image/png",fileExtension:"png"})}static get READIUM_AUDIOBOOK(){return l.parse({mediaType:"application/audiobook+zip",name:"Readium Audiobook",fileExtension:"audiobook"})}static get READIUM_AUDIOBOOK_MANIFEST(){return l.parse({mediaType:"application/audiobook+json",name:"Readium Audiobook",fileExtension:"json"})}static get READIUM_CONTENT_DOCUMENT(){return l.parse({mediaType:"application/vnd.readium.content+json",name:"Readium Content Document",fileExtension:"json"})}static get READIUM_GUIDED_NAVIGATION_DOCUMENT(){return l.parse({mediaType:"application/guided-navigation+json",name:"Readium Guided Navigation Document",fileExtension:"json"})}static get READIUM_POSITION_LIST(){return l.parse({mediaType:"application/vnd.readium.position-list+json",name:"Readium Position List",fileExtension:"json"})}static get READIUM_WEBPUB(){return l.parse({mediaType:"application/webpub+zip",name:"Readium Web Publication",fileExtension:"webpub"})}static get READIUM_WEBPUB_MANIFEST(){return l.parse({mediaType:"application/webpub+json",name:"Readium Web Publication",fileExtension:"json"})}static get SMIL(){return l.parse({mediaType:"application/smil+xml",fileExtension:"smil"})}static get SVG(){return l.parse({mediaType:"image/svg+xml",fileExtension:"svg"})}static get TEXT(){return l.parse({mediaType:"text/plain",fileExtension:"txt"})}static get TIFF(){return l.parse({mediaType:"image/tiff",fileExtension:"tiff"})}static get TTF(){return l.parse({mediaType:"font/ttf",fileExtension:"ttf"})}static get W3C_WPUB_MANIFEST(){return l.parse({mediaType:"application/x.readium.w3c.wpub+json",name:"Web Publication",fileExtension:"json"})}static get WAV(){return l.parse({mediaType:"audio/wav",fileExtension:"wav"})}static get WEBM_AUDIO(){return l.parse({mediaType:"audio/webm",fileExtension:"webm"})}static get WEBM_VIDEO(){return l.parse({mediaType