@file-viewer/web-full 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/flyfish-file-viewer-web-full.iife.js +10 -11643
- package/dist/flyfish-viewer-manifest.json +1 -1
- package/dist/global.d.ts +4 -2
- package/dist/global.js +4 -2
- package/dist/iife.d.ts +40 -0
- package/dist/iife.js +325 -0
- package/dist/renderers/archive.iife.js +358 -0
- package/dist/renderers/cad.iife.js +198 -0
- package/dist/renderers/data.iife.js +154 -0
- package/dist/renderers/drawing.iife.js +3389 -0
- package/dist/renderers/ebook.iife.js +95 -0
- package/dist/renderers/eda.iife.js +146 -0
- package/dist/renderers/email.iife.js +95 -0
- package/dist/renderers/geo.iife.js +30 -0
- package/dist/renderers/image.iife.js +88 -0
- package/dist/renderers/media.iife.js +89 -0
- package/dist/renderers/mindmap.iife.js +57 -0
- package/dist/renderers/model.iife.js +4288 -0
- package/dist/renderers/ofd.iife.js +31 -0
- package/dist/renderers/pdf.iife.js +2097 -0
- package/dist/renderers/presentation.iife.js +108 -0
- package/dist/renderers/spreadsheet.iife.js +121 -0
- package/dist/renderers/text.iife.js +284 -0
- package/dist/renderers/typst.iife.js +109 -0
- package/dist/renderers/word.iife.js +458 -0
- package/package.json +23 -3
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
(function(){var _u=Object.create,Sr=Object.defineProperty,wu=Object.getOwnPropertyDescriptor,yu=Object.getOwnPropertyNames,xu=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty,_e=(e,i)=>()=>(e&&(i=e(e=0)),i),Ae=(e,i)=>()=>(i||(e((i={exports:{}}).exports,i),e=null),i.exports),$i=(e,i)=>{let t={};for(var r in e)Sr(t,r,{get:e[r],enumerable:!0});return i||Sr(t,Symbol.toStringTag,{value:"Module"}),t},ku=(e,i,t,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(var n=yu(i),a=0,o=n.length,s;a<o;a++)s=n[a],!Eu.call(e,s)&&s!==t&&Sr(e,s,{get:(l=>i[l]).bind(null,s),enumerable:!(r=wu(i,s))||r.enumerable});return e},lt=(e,i,t)=>(t=e!=null?_u(xu(e)):{},ku(i||!e||!e.__esModule?Sr(t,"default",{value:e,enumerable:!0}):t,e)),Su=_e((()=>{})),Tu=_e((()=>{Su()})),In,Nn,On,Dn,jt,Cu,ui=_e((()=>{In=["zip","zipx","7z","rar","tar","gz","gzip","tgz","bz2","bzip2","tbz","tbz2","xz","txz","lzma","zst","tzst","cab","ar","cpio","iso","xar","lha","lzh","jar","war","ear","apk","cbz","cbr"],Nn=["glb","gltf","obj","stl","ply","fbx","dae","3ds","3mf","amf","usd","usda","usdc","usdz","kmz","step","stp","iges","igs","ifc","3dm","brep","pcd","wrl","vrml","xyz","vtk","vtp"],On=["txt","json","js","mjs","cjs","css","java","py","html","htm","jsx","ts","tsx","xml","log","vue","yaml","yml","ini","sh","bash","sql","go","rs","php","c","cpp","cc","h","hpp","cs","diff","patch","bundle","bdl","jsonc","json5","ipynb","toml","proto","hcl","tex","gv","http","react","rb","swift","kt"],Dn=["gif","jpg","jpeg","bmp","tiff","tif","png","svg","webp","avif","ico","heic","heif","jxl"],jt=[{id:"office-word-openxml",label:"Word OpenXML",category:"office",extensions:["docx","docm","dotx","dotm"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-word-binary",label:"Word Binary",category:"office",extensions:["doc","dot"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-presentation",label:"PowerPoint",category:"office",extensions:["pptx","pptm","potx","potm","ppsx","ppsm"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"open-document",label:"Open Document",category:"office",extensions:["rtf","odt","odp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"spreadsheet-openxml",label:"Spreadsheet",category:"office",extensions:["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!0}},{id:"pdf",label:"PDF",category:"document",extensions:["pdf"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:"provider"}},{id:"ofd",label:"OFD",category:"document",extensions:["ofd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"typst",label:"Typst",category:"document",extensions:["typ","typst"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"archive",label:"Archive",category:"archive",extensions:In,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!0}},{id:"email",label:"Email",category:"email",extensions:["eml","msg","mbox"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}},{id:"eda",label:"EDA",category:"eda",extensions:["olb","dra","gds","oas","oasis"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"cad",label:"CAD",category:"cad",extensions:["dxf","dwg","dwf","dwfx","xps"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"model",label:"3D Model",category:"model",extensions:Nn,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!1}},{id:"geo",label:"Geospatial",category:"geo",extensions:["geojson","kml","gpx","shp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"drawing",label:"Drawing",category:"drawing",extensions:["excalidraw","drawio","dio","mermaid","mmd","plantuml","puml"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"mindmap",label:"Mind Map",category:"mindmap",extensions:["xmind"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"epub",label:"EPUB",category:"ebook",extensions:["epub"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:"provider"}},{id:"umd",label:"UMD",category:"ebook",extensions:["umd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"image",label:"Image",category:"image",extensions:Dn,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"markdown",label:"Markdown",category:"markdown",extensions:["md","markdown"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"code",label:"Code and Text",category:"code",extensions:On,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"video",label:"Video",category:"media",extensions:["mp4","webm","m3u8"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"audio",label:"Audio",category:"media",extensions:["mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba","midi","mid"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"data-asset",label:"Data Asset",category:"asset",extensions:["ttf","otf","woff","woff2","psd","ai","eps","sqlite","wasm","parquet","avro","webarchive"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}}],Cu=Object.freeze(Array.from(new Set(jt.flatMap(e=>e.extensions))).sort())})),Au,Ru,Iu=_e((()=>{Au=["[data-viewer-anchor-id]",".pdfViewer .page",".docx-wrapper section",".docx p",".docx li",".docx table",".markdown-body h1",".markdown-body h2",".markdown-body h3",".markdown-body h4",".markdown-body h5",".markdown-body h6",".markdown-body p",".markdown-body li",".markdown-body pre",".markdown-body table","article h1","article h2","article h3","article h4","article h5","article h6","article p","article li","article pre","article table","pre code","p","li","tr","h1","h2","h3","h4","h5","h6","pre","table"].join(","),Ru=[".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match"].join(",")})),Ln,io,ro,Nu=_e((()=>{Ln=new WeakMap,io=(e,i)=>{Ln.set(e,i),e.dataset.viewerZoomProvider=e.dataset.viewerZoomProvider||"custom",e.__flyfishViewerZoomProvider=i},ro=e=>{e&&(Ln.delete(e),delete e.dataset.viewerZoomProvider,delete e.__flyfishViewerZoomProvider)}})),Yi=_e((()=>{Iu(),Nu()})),Ou,no=_e((()=>{Yi(),Ou=["script","style","textarea","input","select","button",".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match",".textLayer",".annotationLayer",".xfaLayer","svg","canvas","iframe","video","audio"].join(",")})),ao=_e((()=>{Yi(),no()})),so,zn=_e((()=>{Yi(),so=()=>{const e=new Set;return{emit(){e.forEach(i=>i())},subscribe(i){return e.add(i),()=>{e.delete(i)}}}}})),Tt,Tr=_e((()=>{Tt=e=>e.trim().replace(/^\./,"").toLowerCase()})),Du,oo,lo,Pn,ho,uo,co,Fn,fo,ii,Mn,Ei=_e((()=>{Du="zh-CN",oo={"toolbar.zoomGroup":"缩放控制","toolbar.zoomOut":"缩小预览","toolbar.zoomIn":"放大预览","toolbar.zoomReset":"还原比例","toolbar.download":"下载","toolbar.downloadTitle":"下载原始文件","toolbar.print":"打印","toolbar.printTitle":"打印完整渲染内容","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"导出当前渲染后的 HTML","state.ready.title":"预览完成","state.ready.message":"文件内容已完成渲染。","state.empty.title":"暂无文件","state.empty.message":"请选择文件或提供可访问的文件地址后开始预览。","state.unsupported.install.title":"需要装配预览能力","state.unsupported.install.message":"{extension} 格式已在支持矩阵中,但当前项目尚未装配 {rendererLabel} renderer。","state.unsupported.install.description":"推荐安装 {presetPackage},通过 options.preset / options.renderers 注入对应能力{rendererTip};Vite 项目也可以使用 @file-viewer/vite-plugin 自动发现已安装 preset。","state.unsupported.title":"暂不支持在线预览","state.unsupported.message":"不支持{extension}格式的在线预览,请下载后预览或转换为支持的格式。","state.unsupported.description":"支持 Office、PDF、OFD、Typst、压缩包、邮件、OLB/DRA、CAD、地理数据、3D 模型、Excalidraw、draw.io、EPUB、UMD、Markdown、代码/文本、图片、音视频、字体和数据资产的在线预览","state.error.title":"预览失败","preview.downloading":"正在下载文件资源...","preview.streamingPdf":"正在建立 PDF 流式预览...","preview.reading":"正在解析文件内容...","error.download":"下载失败","error.print":"打印失败","error.exportHtml":"导出 HTML 失败","error.noDownloadSource":"当前没有可下载的源文件","error.noExportContent":"当前没有可导出的预览内容","error.printUnavailable":"当前文件类型不支持完整打印,请下载原文件后在本地应用中打印","error.printWindowBlocked":"浏览器拦截了打印窗口","error.remoteDownload":"文件下载失败","error.localRead":"读取文件异常","error.load":"加载文件异常","error.stream":"加载 PDF 流式预览异常","error.beforeOperation":"操作前置校验失败","operation.download":"下载原始文件","operation.print":"打印完整渲染内容","operation.exportHtml":"导出渲染 HTML","operation.zoomIn":"放大预览","operation.zoomOut":"缩小预览","operation.zoomReset":"还原预览比例","pdf.toolbar.toggleNavigation":"切换导航窗格","pdf.toolbar.previousPage":"上一页","pdf.toolbar.nextPage":"下一页","pdf.toolbar.fitWidth":"适合宽度","pdf.toolbar.zoomOut":"缩小","pdf.toolbar.zoomIn":"放大","pdf.toolbar.rotateLeft":"向左旋转","pdf.toolbar.rotateRight":"向右旋转","pdf.nav.typeLabel":"PDF 导航类型","pdf.nav.pagesTab":"页面","pdf.nav.outlineTab":"目录","pdf.nav.pagesTitle":"页面导航","pdf.nav.outlineTitle":"目录导航","pdf.nav.pageCount":"{count} 页","pdf.nav.itemCount":"{count} 项","pdf.nav.pageLabel":"第 {page} 页","pdf.nav.outlineEmpty":"当前 PDF 没有可用目录","pdf.nav.outlineFallbackTitle":"目录 {index}","pdf.thumbnail.alt":"第 {page} 页缩略图","pdf.state.loading":"正在加载 PDF...","pdf.error.browserWindow":"PDF 预览需要浏览器窗口","pdf.error.missingSource":"PDF 缺少可读取的数据源","pdf.error.loadFailed":"PDF 加载失败","pdf.error.notLoaded":"PDF 尚未加载完成,请稍后再试","pdf.error.unloaded":"PDF 已卸载,无法继续打印","pdf.error.canvasUnavailable":"当前浏览器无法创建 PDF 打印画布","pdf.export.pageTitle":"{title} - 第 {page} 页","spreadsheet.loading.kicker":"Excel 表格","spreadsheet.loading.title":"正在解析 Excel 工作簿","spreadsheet.loading.hint":"正在准备工作表、样式和大数据视口,请稍候。","spreadsheet.loading.streaming":"正在平滑补充可视区数据","spreadsheet.tabs.ariaLabel":"工作表列表","spreadsheet.state.parsingWorkbook":"正在解析 Excel 工作簿,请耐心等待...","spreadsheet.state.preparingSheet":"正在准备工作表内容...","spreadsheet.state.preparingSheetNamed":"正在准备「{name}」...","spreadsheet.state.cachedRows":"已缓存 {cached} / {total} 行","spreadsheet.state.rows":"共 {rows} 行,按视口预取平滑加载","spreadsheet.state.rowsAndColumns":"共 {rows} 行,{cols} 列,按视口预取平滑加载","spreadsheet.error.parseFailed":"Excel 解析失败","spreadsheet.error.workerFailed":"Excel Worker 运行失败","archive.error.nestedUnsupported":"不支持 .{type} 格式的在线预览,请下载后预览或转换为支持的格式","archive.loading.readingDirectory":"正在读取压缩包目录...","archive.loading.readingDirectoryHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.search.placeholder":"筛选压缩包内文件","archive.preview.title":"压缩包内预览","archive.preview.chooseFile":"请选择一个文件","archive.preview.downloadFile":"下载文件","archive.error.title":"压缩包预览提示","archive.stats.summary":"{count} 个文件 · {size} · {previewable} 个可直接预览","archive.warning.encrypted":"检测到加密内容,当前在线预览不接收密码,建议下载后本地解压。","archive.empty.title":"选择左侧文件即可预览","archive.empty.message":"压缩包只读取目录;文件内容会在点击后按需解压,并在体积允许时缓存到 IndexedDB。","archive.loading.initializingCandidate":"正在初始化 {label}...","archive.loading.initializingCandidateHint":"如果当前服务器没有正确发布 Worker/WASM,会自动切换兼容模式。","archive.error.candidateInitTimeout":"{label} 初始化超时","archive.error.encryptedCheckTimeout":"{label} 加密检测超时","archive.loading.directoryReadyHint":"目录读取完成后,点击内部文件才会按需解压。","archive.error.candidateReadTimeout":"{label} 读取目录超时","archive.loading.workerFallback":"Worker 不可用,正在切换 ZIP/TAR 兼容模式...","archive.loading.workerFallbackHint":"兼容模式无需额外静态 Worker,适合手机 WebView 或本地临时服务器。","archive.notice.workerFallback":"当前环境的 libarchive Worker 未能启动,已自动切换到 ZIP/TAR/GZIP 兼容模式。RAR、7z 等格式仍建议发布 vendor/libarchive/worker-bundle.js 与 libarchive.wasm。","archive.error.tooLarge":"压缩包体积 {size} 超过安全上限 {limit},请下载后在本地解压。","archive.loading.initializingWorker":"正在初始化压缩包解析 Worker...","archive.loading.initializingWorkerHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.error.workerInitFailed":"压缩包 Worker 初始化失败","archive.error.entryTooLarge":"压缩包内文件 {name} 体积 {size} 超过预览上限 {limit}。","archive.loading.extracting":"正在按需解压 {name}...","archive.loading.rendering":"正在渲染 {name}...","archive.loading.exporting":"正在导出 {name}...","media.audio.title":"音频预览","media.audio.description":"使用浏览器原生播放器打开,兼容性取决于当前浏览器支持的音频编码。","media.audio.unsupported":"当前浏览器不支持音频播放。","media.video.title":"视频预览","media.video.unsupported":"当前浏览器不支持该视频格式。","media.video.hlsHint":"HLS 会优先使用原始 URL 加载分片;如果传入的是本地单文件清单,请确保分片地址可被浏览器访问。","media.midi.title":"MIDI 文件","media.midi.loading":"正在解析 MIDI 轨道...","media.midi.trackHeader":"轨道","media.midi.instrumentHeader":"乐器","media.midi.channelHeader":"通道","media.midi.noteCountHeader":"音符数","media.midi.durationHeader":"时长","media.midi.durationStat":"时长","media.midi.trackStat":"轨道","media.midi.noteStat":"音符","media.midi.parseFailed":"MIDI 解析失败","email.mbox.subject":"{filename} · 第 1 封","email.mbox.summary":"MBOX 共识别 {count} 封邮件,当前展示第 1 封。","email.error.title":"邮件预览提示","email.meta.from":"发件人","email.meta.to":"收件人","email.meta.cc":"抄送","email.meta.date":"时间","email.tabs.text":"正文","email.tabs.headers":"头信息","email.attachments.title":"附件","email.attachments.empty":"暂无附件","email.attachments.download":"下载附件","email.attachments.opening":"正在打开附件 {name}...","email.attachments.nestedUnavailable":"当前运行环境未提供附件嵌套预览入口,请下载 {name} 后查看。","email.loading.parsing":"正在解析邮件...","data.font.sample":"Flyfish Viewer 轻量预览 AaBbCc 1234567890","data.error.fontFaceUnsupported":"当前浏览器不支持 FontFace API","data.title.font":"字体文件预览","data.title.sqlite":"SQLite 数据库预览","data.title.parquet":"Parquet 列式数据预览","data.title.avro":"Avro 对象容器预览","data.title.wasm":"WebAssembly 模块预览","data.title.eps":"EPS 矢量文件摘要","data.title.ai":"Illustrator 文件摘要","data.title.webarchive":"WebArchive 摘要预览","data.title.summary":"数据资产摘要","data.label.format":"格式","data.label.size":"大小","data.label.rendering":"渲染方式","data.label.objects":"对象数","data.label.sampleTable":"示例表","data.label.rows":"行数","data.label.columns":"列数","data.label.sampleRows":"示例行","data.label.imports":"导入","data.label.exports":"导出","data.label.magic":"Magic","data.label.note":"说明","data.label.container":"容器","data.value.schemaRead":"已读取","data.value.schemaUnread":"未读取","data.note.aiSummary":"非 PDF-compatible AI 按摘要展示","data.note.postscriptSummary":"PostScript 摘要展示","data.note.webarchive":"安全提取可读片段,不执行网页脚本","data.image.alt":"资产预览","psd.title":"PSD 图层预览","psd.action.fit":"适合","psd.action.showAll":"全显","psd.action.hideAll":"全隐","psd.layers.title":"图层","psd.layers.redrawable":"{count} 可重绘","psd.layers.empty":"未发现可展示图层,使用合成图预览。","psd.layers.hidden":"隐藏","drawing.error.viewerLoadFailed":"diagrams.net viewer 加载失败","drawing.error.excalidrawEmpty":"Excalidraw 文件中没有可预览图元","drawing.error.excalidrawTimeout":"Excalidraw 官方导出超时,自动切换 rough.js 兼容渲染","drawing.error.drawioParseFailed":"Draw.io XML 解析失败:{message}","drawing.error.drawioNoModel":"当前 Draw.io 文件没有可直接渲染的 mxGraphModel。","drawing.error.drawioNoElements":"当前 Draw.io 文件没有可预览图元。","drawing.error.viewerInitFailed":"diagrams.net viewer 未正确初始化","drawing.error.drawioTimeout":"diagrams.net 官方 Viewer 加载超时,自动切换本地 SVG 预览","drawing.error.svgParseFailed":"SVG 解析失败","drawing.error.plantumlRenderFailed":"PlantUML SVG 渲染失败:{status}","drawing.title.excalidraw":"Excalidraw 官方 SVG 预览","drawing.title.mermaid":"Mermaid SVG 预览","drawing.title.plantuml":"PlantUML SVG 预览","drawing.title.drawio":"Draw.io 离线 SVG 预览","drawing.toolbar.zoomOut":"缩小","drawing.toolbar.zoomIn":"放大","drawing.toolbar.fit":"适合","drawing.toolbar.fitWidth":"适合宽度","drawing.state.loading":"正在加载绘图预览...","text.code.loadingHighlight":"正在加载高亮...","ebook.toc":"目录","ebook.reading":"阅读中","ebook.itemCount":"{count} 项","epub.title":"EPUB 电子书","epub.previousPage":"上一页","epub.nextPage":"下一页","epub.loading":"正在解析 EPUB...","epub.chapterFallback":"章节 {index}","epub.renderIncomplete":"EPUB 正文渲染未完成,请刷新后重试","umd.title":"UMD 电子书","umd.previousChapter":"上一章","umd.nextChapter":"下一章","umd.loading":"正在解析 UMD...","umd.emptyContent":"未解析到正文内容","umd.chapterFallback":"章节 {index}","umd.galleryFallback":"图集 {index}","umd.warningBodyTooShort":"UMD 正文长度小于声明长度,文件可能不完整","umd.error.unexpectedEnd":"UMD 文件结构不完整,读取时遇到意外结尾","umd.error.invalidFile":"不是有效的 UMD 电子书文件","typst.summaryRenderer":"Typst WASM 渲染器","typst.pageSummary.empty":"0 页","typst.pageSummary.ready":"{count} 页 / {width} x {height} pt","typst.status.compiling":"正在编译","typst.status.failed":"编译失败","typst.status.rendered":"已渲染","typst.loading.title":"正在解析 Typst","typst.loading.hint":"加载编译器并生成页面预览...","typst.error.title":"Typst 渲染失败","typst.error.timeout":"Typst WASM / 字体加载或编译超过 {seconds} 秒","typst.error.timeoutHint":"请检查 Typst compiler WASM、renderer WASM、字体目录的下载速度和缓存策略;弱网或跨境部署可通过 options.typst.renderTimeoutMs 调大浏览器端加载/编译超时。","typst.error.assetHint":"Typst 需要本地 compiler / renderer WASM 和字体目录。请运行 file-viewer-copy-assets,或配置 options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl,并确认服务器以 application/wasm 返回 WASM。","typst.error.svgParseFailed":"Typst SVG 解析失败","typst.error.wasmLoadFailed":"Typst WASM 加载失败","xmind.toolbar.zoomOut":"缩小","xmind.toolbar.zoomIn":"放大","xmind.toolbar.fit":"适合","xmind.toolbar.fitTitle":"适配画布","xmind.state.loading":"正在解析 XMind 脑图...","xmind.stats.nodes":"节点","xmind.stats.depth":"层级","xmind.stats.theme":"主题","xmind.stats.template":"模板","xmind.badge.paused":"暂停","xmind.badge.collapsed":"折叠","xmind.badge.floating":"浮动","xmind.badge.summary":"概要","xmind.badge.callout":"标注","xmind.imageResource":"图片资源: {name}","xmind.error.unrecognized":"无法识别 XMind 文件: ZIP 中未找到 content.json 或 content.xml","xmind.error.noCanvas":"XMind 文件中没有可预览的画布","cad.toolbar.fit":"适配","cad.toolbar.zoomOut":"缩小","cad.toolbar.zoomIn":"放大","cad.layers.title":"图层","cad.layers.count":"{count} 项","cad.inspector.title":"结构","cad.inspector.entities":"实体","cad.inspector.blocks":"块","cad.inspector.pages":"页面","cad.inspector.drawn":"绘制","cad.state.loadingViewer":"正在加载 CAD 预览器...","cad.state.parsing":"正在解析 CAD...","cad.error.parseFailed":"CAD 文件解析失败","image.alt":"图片","image.lightbox.alt":"图片预览","image.lightbox.close":"关闭图片预览","gitBundle.error.invalid":"当前文件不是标准 Git bundle。","gitBundle.error.missingPack":"Git bundle header 后未找到 PACK 数据。","gitBundle.notice.delta":"当前 bundle 包含 delta 压缩对象。预览器已在浏览器端解析常规 OFS_DELTA / REF_DELTA;若仍有缺失文件,通常是包体过大、对象过多或依赖外部 prerequisite。","gitBundle.title.history":"历史记录","gitBundle.title.fileTree":"文件树","gitBundle.file.choose":"选择文件查看内容","gitBundle.file.noTree":"当前 bundle 的 tree/blob 可能被 delta 压缩,暂未解析到可展开文件。","gitBundle.file.none":"未解析到文件","gitBundle.history.empty":"当前 bundle 未解析到 commit 对象,仅展示 refs 和 pack 摘要。","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"无法识别的 GeoJSON 数据","geo.error.xmlParseFailed":"XML 解析失败","geo.error.unsupported":"不支持 .{type} 地理格式","geo.title":"地理数据预览","geo.featureCount":"要素数","geo.bounds":"范围","geo.geometryTypes":"几何类型","geo.aria":"地理数据 SVG 预览","geo.loading":"正在解析地理数据...","model.toolbar.fit":"适配","model.toolbar.rotate":"旋转","model.toolbar.wireframe":"线框","model.toolbar.grid":"网格","model.toolbar.axes":"坐标","model.state.loadingSummary":"正在加载模型","model.state.loading":"正在解析 3D 模型...","model.state.loaded":"模型已加载","model.state.parseFailed":"模型解析失败","model.summary.meshes":"{count} 个网格","model.summary.points":"{count} 个点云","model.error.daeEmpty":"DAE 模型未解析出有效场景","model.error.unsupported":"暂不支持 .{type} 模型格式","model.error.parseFailed":"{type} 模型解析失败","model.notice.signature":"检测到文件签名: {signature}。","loading.generic.label":"文件内容","loading.generic.hint":"正在整理内容结构并生成预览。","loading.word.label":"Word 文档","loading.word.hint":"正在准备分页、文本样式和文档结构。","loading.wordWorker.hint":"正在通过 Worker 准备文档结构、文本样式和分页结果。","loading.sheet.label":"Excel 表格","loading.sheet.hint":"正在准备工作表、样式和可视区数据。","loading.csv.label":"表格数据","loading.csv.hint":"正在准备行列数据和基础样式。","loading.presentation.label":"PPT 演示文稿","loading.presentation.hint":"正在构建幻灯片布局和媒体内容。","loading.pdf.label":"PDF 文档","loading.pdf.hint":"正在载入页面位图、文本层和缩放视图。","loading.ofd.label":"OFD 版式文件","loading.ofd.hint":"正在解析国产版式文档和页面对象。","loading.archive.label":"压缩包","loading.archive.hint":"正在启动 Worker 并读取压缩包目录。","loading.email.label":"邮件文件","loading.email.hint":"正在解析邮件头、正文和附件。","loading.msg.hint":"正在解析 Outlook 邮件和附件。","loading.eda.label":"EDA 文件","loading.eda.hint":"正在读取 EDA 容器结构和可读属性。","loading.cad.label":"CAD 图纸","loading.cad.hint":"正在准备 CAD 图层、几何对象和画布视图。","loading.dwg.hint":"正在通过 Worker 加载 DWG 几何和 LibreDWG WASM。","loading.dwf.hint":"正在加载 DWF native renderer 与 W2D/W3D 图形。","loading.dwfx.hint":"正在加载 DWFx/XPS native renderer 与页面图形。","loading.xps.hint":"正在加载 XPS native renderer 与嵌入字体。","loading.drawio.label":"draw.io 图纸","loading.drawio.hint":"正在解析图元、连线和 SVG 预览。","loading.excalidraw.label":"Excalidraw 图纸","loading.excalidraw.hint":"正在解析手绘图元并生成安全 SVG。","loading.epub.label":"EPUB 电子书","loading.epub.hint":"正在解析目录、章节资源和阅读分页。","loading.umd.label":"UMD 电子书","loading.umd.hint":"正在解析移动电子书结构、目录和压缩正文。","loading.image.label":"图片文件","loading.image.hint":"正在解码像素数据并生成预览。","loading.video.label":"视频文件","loading.video.hint":"正在准备媒体资源和播放组件。","loading.audio.label":"音频文件","loading.audio.hint":"正在准备音频资源和播放控件。"},lo={"toolbar.zoomGroup":"Zoom controls","toolbar.zoomOut":"Zoom out","toolbar.zoomIn":"Zoom in","toolbar.zoomReset":"Reset zoom","toolbar.download":"Download","toolbar.downloadTitle":"Download the original file","toolbar.print":"Print","toolbar.printTitle":"Print the complete rendered document","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"Export the rendered HTML","state.ready.title":"Preview ready","state.ready.message":"The file has been rendered.","state.empty.title":"No file selected","state.empty.message":"Choose a file or provide an accessible URL to start previewing.","state.unsupported.install.title":"Preview capability required","state.unsupported.install.message":"{extension} is in the supported matrix, but {rendererLabel} renderer is not assembled in this project.","state.unsupported.install.description":"Install {presetPackage} and pass the capability through options.preset / options.renderers{rendererTip}. Vite projects can also use @file-viewer/vite-plugin to auto-discover installed presets.","state.unsupported.title":"Online preview is not supported yet","state.unsupported.message":"{extension} cannot be previewed online. Download it or convert it to a supported format.","state.unsupported.description":"Supports online preview for Office, PDF, OFD, Typst, archives, email, OLB/DRA, CAD, geospatial data, 3D models, Excalidraw, draw.io, EPUB, UMD, Markdown, code/text, images, audio/video, fonts, and structured data assets.","state.error.title":"Preview failed","preview.downloading":"Downloading file resources...","preview.streamingPdf":"Preparing streaming PDF preview...","preview.reading":"Parsing file content...","error.download":"Download failed","error.print":"Print failed","error.exportHtml":"HTML export failed","error.noDownloadSource":"There is no original file source to download.","error.noExportContent":"There is no rendered preview content to export.","error.printUnavailable":"This file type does not support full-document printing. Download the original file and print it locally.","error.printWindowBlocked":"The browser blocked the print window.","error.remoteDownload":"File download failed","error.localRead":"Failed to read local file","error.load":"Failed to load file","error.stream":"Failed to load streaming PDF preview","error.beforeOperation":"Before-operation check failed","operation.download":"Download original file","operation.print":"Print complete rendered content","operation.exportHtml":"Export rendered HTML","operation.zoomIn":"Zoom in","operation.zoomOut":"Zoom out","operation.zoomReset":"Reset preview zoom","pdf.toolbar.toggleNavigation":"Toggle navigation pane","pdf.toolbar.previousPage":"Previous page","pdf.toolbar.nextPage":"Next page","pdf.toolbar.fitWidth":"Fit to width","pdf.toolbar.zoomOut":"Zoom out","pdf.toolbar.zoomIn":"Zoom in","pdf.toolbar.rotateLeft":"Rotate left","pdf.toolbar.rotateRight":"Rotate right","pdf.nav.typeLabel":"PDF navigation type","pdf.nav.pagesTab":"Pages","pdf.nav.outlineTab":"Outline","pdf.nav.pagesTitle":"Page navigation","pdf.nav.outlineTitle":"Outline navigation","pdf.nav.pageCount":"{count} pages","pdf.nav.itemCount":"{count} items","pdf.nav.pageLabel":"Page {page}","pdf.nav.outlineEmpty":"This PDF has no available outline.","pdf.nav.outlineFallbackTitle":"Outline {index}","pdf.thumbnail.alt":"Page {page} thumbnail","pdf.state.loading":"Loading PDF...","pdf.error.browserWindow":"PDF preview requires a browser window","pdf.error.missingSource":"PDF has no readable data source","pdf.error.loadFailed":"Failed to load PDF","pdf.error.notLoaded":"The PDF is not loaded yet. Please try again later.","pdf.error.unloaded":"The PDF has been unloaded and cannot continue printing.","pdf.error.canvasUnavailable":"This browser cannot create a PDF print canvas.","pdf.export.pageTitle":"{title} - Page {page}","spreadsheet.loading.kicker":"Excel workbook","spreadsheet.loading.title":"Parsing Excel workbook","spreadsheet.loading.hint":"Preparing worksheets, styles, and virtualized viewport data.","spreadsheet.loading.streaming":"Loading visible worksheet data","spreadsheet.tabs.ariaLabel":"Worksheet list","spreadsheet.state.parsingWorkbook":"Parsing the Excel workbook. Please wait...","spreadsheet.state.preparingSheet":"Preparing worksheet content...","spreadsheet.state.preparingSheetNamed":"Preparing “{name}”...","spreadsheet.state.cachedRows":"Cached {cached} / {total} rows","spreadsheet.state.rows":"{rows} rows, loading smoothly by viewport","spreadsheet.state.rowsAndColumns":"{rows} rows, {cols} columns, loading smoothly by viewport","spreadsheet.error.parseFailed":"Failed to parse Excel","spreadsheet.error.workerFailed":"Excel Worker failed","archive.error.nestedUnsupported":".{type} cannot be previewed online. Download it or convert it to a supported format.","archive.loading.readingDirectory":"Reading archive directory...","archive.loading.readingDirectoryHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.search.placeholder":"Filter files inside the archive","archive.preview.title":"Archive entry preview","archive.preview.chooseFile":"Choose a file","archive.preview.downloadFile":"Download file","archive.error.title":"Archive preview notice","archive.stats.summary":"{count} files · {size} · {previewable} directly previewable","archive.warning.encrypted":"Encrypted content was detected. Online preview does not accept passwords; download and extract it locally.","archive.empty.title":"Choose a file from the left to preview","archive.empty.message":"The archive directory is read first. File contents are extracted on demand and cached in IndexedDB when size allows.","archive.loading.initializingCandidate":"Initializing {label}...","archive.loading.initializingCandidateHint":"If the server does not publish Worker/WASM assets correctly, the viewer falls back automatically.","archive.error.candidateInitTimeout":"{label} initialization timed out","archive.error.encryptedCheckTimeout":"{label} encryption check timed out","archive.loading.directoryReadyHint":"After the directory is ready, click an entry to extract it on demand.","archive.error.candidateReadTimeout":"{label} directory read timed out","archive.loading.workerFallback":"Worker unavailable. Switching to ZIP/TAR compatibility mode...","archive.loading.workerFallbackHint":"Compatibility mode needs no static Worker and works well in mobile WebViews or temporary local servers.","archive.notice.workerFallback":"The libarchive Worker could not start in this environment, so ZIP/TAR/GZIP compatibility mode is active. RAR, 7z, and similar formats should still publish vendor/libarchive/worker-bundle.js and libarchive.wasm.","archive.error.tooLarge":"Archive size {size} exceeds the safety limit {limit}. Download and extract it locally.","archive.loading.initializingWorker":"Initializing archive parsing Worker...","archive.loading.initializingWorkerHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.error.workerInitFailed":"Archive Worker initialization failed","archive.error.entryTooLarge":"Entry {name} is {size}, exceeding the preview limit {limit}.","archive.loading.extracting":"Extracting {name} on demand...","archive.loading.rendering":"Rendering {name}...","archive.loading.exporting":"Exporting {name}...","media.audio.title":"Audio preview","media.audio.description":"Opened with the browser-native audio player. Codec support depends on the current browser.","media.audio.unsupported":"This browser does not support audio playback.","media.video.title":"Video preview","media.video.unsupported":"This browser does not support this video format.","media.video.hlsHint":"HLS prefers the original URL for segment loading. If the input is a local single-file playlist, make sure segment URLs are reachable by the browser.","media.midi.title":"MIDI file","media.midi.loading":"Parsing MIDI tracks...","media.midi.trackHeader":"Track","media.midi.instrumentHeader":"Instrument","media.midi.channelHeader":"Channel","media.midi.noteCountHeader":"Notes","media.midi.durationHeader":"Duration","media.midi.durationStat":"Duration","media.midi.trackStat":"Tracks","media.midi.noteStat":"Notes","media.midi.parseFailed":"Failed to parse MIDI","email.mbox.subject":"{filename} · message 1","email.mbox.summary":"Detected {count} messages in the MBOX archive. Showing message 1.","email.error.title":"Email preview notice","email.meta.from":"From","email.meta.to":"To","email.meta.cc":"Cc","email.meta.date":"Date","email.tabs.text":"Body","email.tabs.headers":"Headers","email.attachments.title":"Attachments","email.attachments.empty":"No attachments","email.attachments.download":"Download attachment","email.attachments.opening":"Opening attachment {name}...","email.attachments.nestedUnavailable":"Nested attachment preview is not available in this environment. Download {name} to inspect it.","email.loading.parsing":"Parsing email...","data.font.sample":"Flyfish Viewer preview AaBbCc 1234567890","data.error.fontFaceUnsupported":"This browser does not support the FontFace API","data.title.font":"Font file preview","data.title.sqlite":"SQLite database preview","data.title.parquet":"Parquet columnar data preview","data.title.avro":"Avro object container preview","data.title.wasm":"WebAssembly module preview","data.title.eps":"EPS vector file summary","data.title.ai":"Illustrator file summary","data.title.webarchive":"WebArchive summary preview","data.title.summary":"Data asset summary","data.label.format":"Format","data.label.size":"Size","data.label.rendering":"Renderer","data.label.objects":"Objects","data.label.sampleTable":"Sample table","data.label.rows":"Rows","data.label.columns":"Columns","data.label.sampleRows":"Sample rows","data.label.imports":"Imports","data.label.exports":"Exports","data.label.magic":"Magic","data.label.note":"Note","data.label.container":"Container","data.value.schemaRead":"Read","data.value.schemaUnread":"Not read","data.note.aiSummary":"Non PDF-compatible AI is shown as a safe summary.","data.note.postscriptSummary":"PostScript summary preview","data.note.webarchive":"Readable fragments are extracted safely. Web scripts are not executed.","data.image.alt":"Asset preview","psd.title":"PSD layer preview","psd.action.fit":"Fit","psd.action.showAll":"Show all","psd.action.hideAll":"Hide all","psd.layers.title":"Layers","psd.layers.redrawable":"{count} redrawable","psd.layers.empty":"No displayable layers were found. Showing the composite image.","psd.layers.hidden":"hidden","drawing.error.viewerLoadFailed":"Failed to load the diagrams.net viewer","drawing.error.excalidrawEmpty":"This Excalidraw file has no previewable elements","drawing.error.excalidrawTimeout":"Official Excalidraw export timed out. Falling back to the rough.js renderer.","drawing.error.drawioParseFailed":"Failed to parse Draw.io XML: {message}","drawing.error.drawioNoModel":"This Draw.io file has no directly renderable mxGraphModel.","drawing.error.drawioNoElements":"This Draw.io file has no previewable elements.","drawing.error.viewerInitFailed":"The diagrams.net viewer was not initialized correctly","drawing.error.drawioTimeout":"Official diagrams.net Viewer timed out. Falling back to the local SVG preview.","drawing.error.svgParseFailed":"Failed to parse SVG","drawing.error.plantumlRenderFailed":"Failed to render PlantUML SVG: {status}","drawing.title.excalidraw":"Official Excalidraw SVG preview","drawing.title.mermaid":"Mermaid SVG preview","drawing.title.plantuml":"PlantUML SVG preview","drawing.title.drawio":"Draw.io offline SVG preview","drawing.toolbar.zoomOut":"Zoom out","drawing.toolbar.zoomIn":"Zoom in","drawing.toolbar.fit":"Fit","drawing.toolbar.fitWidth":"Fit width","drawing.state.loading":"Loading drawing preview...","text.code.loadingHighlight":"Loading syntax highlighting...","ebook.toc":"Table of contents","ebook.reading":"Reading","ebook.itemCount":"{count} items","epub.title":"EPUB ebook","epub.previousPage":"Previous","epub.nextPage":"Next","epub.loading":"Parsing EPUB...","epub.chapterFallback":"Chapter {index}","epub.renderIncomplete":"EPUB content did not finish rendering. Refresh and try again.","umd.title":"UMD ebook","umd.previousChapter":"Previous chapter","umd.nextChapter":"Next chapter","umd.loading":"Parsing UMD...","umd.emptyContent":"No readable body content was parsed.","umd.chapterFallback":"Chapter {index}","umd.galleryFallback":"Gallery {index}","umd.warningBodyTooShort":"The UMD body is shorter than declared and may be incomplete.","umd.error.unexpectedEnd":"The UMD structure is incomplete and ended unexpectedly.","umd.error.invalidFile":"This is not a valid UMD ebook file.","typst.summaryRenderer":"Typst WASM renderer","typst.pageSummary.empty":"0 pages","typst.pageSummary.ready":"{count} pages / {width} x {height} pt","typst.status.compiling":"Compiling","typst.status.failed":"Compilation failed","typst.status.rendered":"Rendered","typst.loading.title":"Parsing Typst","typst.loading.hint":"Loading the compiler and generating page previews...","typst.error.title":"Typst render failed","typst.error.timeout":"Typst WASM / font loading or compilation exceeded {seconds} seconds","typst.error.timeoutHint":"Check the download speed and cache strategy for the Typst compiler WASM, renderer WASM, and font directory. On weak networks or cross-region deployments, increase options.typst.renderTimeoutMs.","typst.error.assetHint":"Typst requires local compiler / renderer WASM files and a font directory. Run file-viewer-copy-assets, or configure options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl, and make sure the server returns WASM with application/wasm.","typst.error.svgParseFailed":"Failed to parse Typst SVG","typst.error.wasmLoadFailed":"Failed to load Typst WASM","xmind.toolbar.zoomOut":"Zoom out","xmind.toolbar.zoomIn":"Zoom in","xmind.toolbar.fit":"Fit","xmind.toolbar.fitTitle":"Fit canvas","xmind.state.loading":"Parsing XMind mind map...","xmind.stats.nodes":"Nodes","xmind.stats.depth":"Depth","xmind.stats.theme":"Theme","xmind.stats.template":"Template","xmind.badge.paused":"Paused","xmind.badge.collapsed":"Collapsed","xmind.badge.floating":"Floating","xmind.badge.summary":"Summary","xmind.badge.callout":"Callout","xmind.imageResource":"Image resource: {name}","xmind.error.unrecognized":"Unrecognized XMind file: content.json or content.xml was not found in the ZIP package.","xmind.error.noCanvas":"This XMind file has no previewable canvas.","cad.toolbar.fit":"Fit","cad.toolbar.zoomOut":"Zoom out","cad.toolbar.zoomIn":"Zoom in","cad.layers.title":"Layers","cad.layers.count":"{count} items","cad.inspector.title":"Structure","cad.inspector.entities":"Entities","cad.inspector.blocks":"Blocks","cad.inspector.pages":"Pages","cad.inspector.drawn":"Drawn","cad.state.loadingViewer":"Loading CAD viewer...","cad.state.parsing":"Parsing CAD...","cad.error.parseFailed":"Failed to parse CAD file","image.alt":"Image","image.lightbox.alt":"Image preview","image.lightbox.close":"Close image preview","gitBundle.error.invalid":"This file is not a valid Git bundle.","gitBundle.error.missingPack":"No PACK data was found after the Git bundle header.","gitBundle.notice.delta":"This bundle contains delta-compressed objects. The viewer resolves common OFS_DELTA / REF_DELTA objects in the browser. Missing files usually indicate a very large bundle, too many objects, or an external prerequisite.","gitBundle.title.history":"History","gitBundle.title.fileTree":"File tree","gitBundle.file.choose":"Select a file to inspect","gitBundle.file.noTree":"The tree/blob objects in this bundle may be delta-compressed, and no expandable files were parsed.","gitBundle.file.none":"No files parsed","gitBundle.history.empty":"No commit objects were parsed. Showing refs and pack summary only.","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"Unrecognized GeoJSON data","geo.error.xmlParseFailed":"Failed to parse XML","geo.error.unsupported":".{type} geospatial format is not supported","geo.title":"Geospatial preview","geo.featureCount":"Features","geo.bounds":"Bounds","geo.geometryTypes":"Geometry types","geo.aria":"Geospatial SVG preview","geo.loading":"Parsing geospatial data...","model.toolbar.fit":"Fit","model.toolbar.rotate":"Rotate","model.toolbar.wireframe":"Wireframe","model.toolbar.grid":"Grid","model.toolbar.axes":"Axes","model.state.loadingSummary":"Loading model","model.state.loading":"Parsing 3D model...","model.state.loaded":"Model loaded","model.state.parseFailed":"Failed to parse model","model.summary.meshes":"{count} meshes","model.summary.points":"{count} point clouds","model.error.daeEmpty":"The DAE model did not contain a valid scene.","model.error.unsupported":".{type} model format is not supported yet","model.error.parseFailed":"Failed to parse {type} model","model.notice.signature":"Detected file signature: {signature}.","loading.generic.label":"File content","loading.generic.hint":"Preparing content structure and preview.","loading.word.label":"Word document","loading.word.hint":"Preparing document structure, text styles, and layout.","loading.wordWorker.hint":"Preparing document structure, text styles, and layout in a Worker.","loading.sheet.label":"Excel workbook","loading.sheet.hint":"Preparing worksheets, styles, and viewport data.","loading.csv.label":"Tabular data","loading.csv.hint":"Preparing rows, columns, and basic styling.","loading.presentation.label":"PowerPoint deck","loading.presentation.hint":"Building slide layout and media content.","loading.pdf.label":"PDF document","loading.pdf.hint":"Loading page bitmaps, text layers, and zoom view.","loading.ofd.label":"OFD layout document","loading.ofd.hint":"Parsing OFD pages and layout objects.","loading.archive.label":"Archive","loading.archive.hint":"Starting Worker and reading archive entries.","loading.email.label":"Email file","loading.email.hint":"Parsing message headers, body, and attachments.","loading.msg.hint":"Parsing Outlook message and attachments.","loading.eda.label":"EDA file","loading.eda.hint":"Reading EDA container structure and properties.","loading.cad.label":"CAD drawing","loading.cad.hint":"Preparing CAD layers, geometry, and canvas view.","loading.dwg.hint":"Loading DWG geometry and LibreDWG WASM in a Worker.","loading.dwf.hint":"Loading native DWF renderer and W2D/W3D graphics.","loading.dwfx.hint":"Loading native DWFx/XPS renderer and page graphics.","loading.xps.hint":"Loading native XPS renderer and embedded fonts.","loading.drawio.label":"draw.io diagram","loading.drawio.hint":"Parsing shapes, connectors, and SVG preview.","loading.excalidraw.label":"Excalidraw scene","loading.excalidraw.hint":"Parsing hand-drawn elements and generating safe SVG.","loading.epub.label":"EPUB ebook","loading.epub.hint":"Parsing table of contents, chapter resources, and reading pages.","loading.umd.label":"UMD ebook","loading.umd.hint":"Parsing mobile ebook metadata, table of contents, and compressed chapters.","loading.image.label":"Image file","loading.image.hint":"Decoding pixels and generating preview.","loading.video.label":"Video file","loading.video.hint":"Preparing media resource and player.","loading.audio.label":"Audio file","loading.audio.hint":"Preparing audio resource and playback controls."},Pn=Object.freeze({"zh-CN":oo,"en-US":lo}),ho=()=>{var e;if(!(typeof navigator>"u"))return((e=navigator.languages)===null||e===void 0?void 0:e[0])||navigator.language},uo=e=>{const i=!e||e==="auto"?ho():e;return String(i||"zh-CN").toLowerCase().startsWith("zh")?"zh-CN":"en-US"},co=e=>{var i;return((i=e?.i18n)===null||i===void 0?void 0:i.messages)||e?.messages},Fn=e=>{var i;return uo(((i=e?.i18n)===null||i===void 0?void 0:i.locale)||e?.locale)},fo=(e,i={})=>e.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(t,r)=>{const n=i[r];return n==null?"":String(n)}),ii=(e,i,t={})=>{const r=Fn(e),n=co(e);return fo((typeof n=="function"?n(i,t,r):n?.[i])||Pn[r][i]||Pn["zh-CN"][i],t)},Mn=e=>(i,t)=>ii(e,i,t)})),Bn=_e((()=>{Ei()})),po,Cr,Ar=_e((()=>{ui(),Tr(),po=e=>({...e,extensions:e.extensions.map(Tt)}),Cr=(e=jt)=>{const i=new Map,t=new Map,r=n=>{const a=po(n),o=i.get(a.id);o&&o.extensions.forEach(s=>{var l;((l=t.get(s))===null||l===void 0?void 0:l.id)===o.id&&t.delete(s)}),i.set(a.id,a),a.extensions.forEach(s=>{const l=t.get(s);if(l&&l.id!==a.id)throw new Error(`File extension "${s}" is already registered by renderer "${l.id}".`);t.set(s,a)})};return e.forEach(r),{register:r,unregister(n){const a=i.get(n);return a?(a.extensions.forEach(o=>{var s;((s=t.get(o))===null||s===void 0?void 0:s.id)===n&&t.delete(o)}),i.delete(n),!0):!1},getById(n){return i.get(n)},getByExtension(n){return t.get(Tt(n))},hasExtension(n){return t.has(Tt(n))},list(){return Array.from(i.values())},listExtensions(){return Array.from(t.keys()).sort()}}}})),Un,Wn=_e((()=>{ui(),Ar(),Tr(),Un=({registry:e=Cr(jt),handlers:i,fallbackHandler:t,fallbackKey:r="error"})=>{const n=Array.from(i).reduce((l,h)=>(l.set(h.rendererId,h.handler),l),new Map),a=new Map,o=[];e.list().forEach(l=>{const h=n.get(l.id);if(!h){o.push(l.id);return}l.extensions.forEach(d=>{a.set(Tt(d),h)})}),t&&r&&a.set(Tt(r),t);const s=l=>a.get(Tt(l));return{handlersByRendererId:n,handlersByExtension:a,missingRendererIds:o,get:s,resolve(l){return s(l)||(r?s(r):void 0)},has(l){return a.has(Tt(l))},listExtensions(){return Array.from(a.keys()).sort()}}}})),Lu,zu,Pu,jn=_e((()=>{ui(),Lu=Object.freeze({download:!1,print:!1,exportHtml:!1,zoom:!1,zoomIn:!1,zoomOut:!1,zoomReset:!1}),zu=["pptx","pptm","potx","potm","ppsx","ppsm","ofd","dxf","dwg","dwf","dwfx","xps","excalidraw","drawio","dio","mermaid","mmd","plantuml","puml","umd","md","markdown","olb","dra",...On,...Dn],Pu=["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers",...In,"eml","msg","epub","mp4","mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba",...Nn]})),Ki=_e((()=>{jn(),Ei(),Bn()})),Fu,Hn,mo,go,vo,bo,_o,wo,yo,Zn,xo,Rr=_e((()=>{Tr(),ui(),Ei(),Fu=Object.freeze({downloading:"正在下载文件资源...",streamingPdf:"正在建立 PDF 流式预览...",reading:"正在解析文件内容..."}),Hn=Object.freeze({accent:"#5f6f82",soft:"rgba(95, 111, 130, 0.12)",badge:"DOC",label:"文件内容",hint:"正在整理内容结构并生成预览。"}),mo=e=>{const i=Tt(e);return i?`.${i}`:"当前"},go={"office-word-openxml":"@file-viewer/renderer-word","office-word-binary":"@file-viewer/renderer-word","office-presentation":"@file-viewer/renderer-presentation","open-document":"@file-viewer/renderer-word","spreadsheet-openxml":"@file-viewer/renderer-spreadsheet",pdf:"@file-viewer/renderer-pdf",ofd:"@file-viewer/renderer-ofd",typst:"@file-viewer/renderer-typst",archive:"@file-viewer/renderer-archive",email:"@file-viewer/renderer-email",eda:"@file-viewer/renderer-eda",cad:"@file-viewer/renderer-cad",model:"@file-viewer/renderer-3d",geo:"@file-viewer/renderer-geo",drawing:"@file-viewer/renderer-drawing",mindmap:"@file-viewer/renderer-mindmap",epub:"@file-viewer/renderer-epub",umd:"@file-viewer/renderer-epub",image:"@file-viewer/renderer-image",markdown:"@file-viewer/renderer-text",code:"@file-viewer/renderer-text",video:"@file-viewer/renderer-media",audio:"@file-viewer/renderer-media","data-asset":"@file-viewer/renderer-data"},vo=new Set(["office-word-openxml","office-word-binary","office-presentation","open-document","spreadsheet-openxml","pdf","ofd"]),bo=new Set(["image","markdown","code","video","audio"]),_o=new Set(["typst","archive","eda","cad","model","geo","drawing","mindmap","data-asset"]),wo=e=>vo.has(e.id)?{packageName:"@file-viewer/preset-office",vitePreset:"office",label:"Office preset"}:_o.has(e.id)?{packageName:"@file-viewer/preset-engineering",vitePreset:"engineering",label:"Engineering preset"}:bo.has(e.id)?{packageName:"@file-viewer/preset-lite",vitePreset:"lite",label:"Lite preset"}:{packageName:"@file-viewer/preset-all",vitePreset:"all",label:"Full preset"},yo=(e="")=>{const i=Tt(e),t=jt.find(n=>n.extensions.map(Tt).includes(i));if(!t)return null;const r=wo(t);return{extension:i,rendererId:t.id,rendererLabel:t.label,rendererCategory:t.category,rendererPackage:go[t.id],presetPackage:r.packageName,vitePreset:r.vitePreset,presetLabel:r.label}},Zn=({state:e,extension:i="",title:t,message:r,description:n,theme:a=Hn,recoverable:o})=>({state:e,extension:Tt(i),title:t,message:r,description:n,theme:a,recoverable:o}),xo=(e="",i=Hn,t)=>{const r=mo(e),n=yo(e);if(n){const a=Fn(t),o=n.rendererPackage?a==="zh-CN"?`;如果需要极致裁剪,也可以只安装 ${n.rendererPackage}`:`; for a strict custom cut, install only ${n.rendererPackage}`:"";return Zn({state:"unsupported",extension:e,title:ii(t,"state.unsupported.install.title"),message:ii(t,"state.unsupported.install.message",{extension:r,rendererLabel:n.rendererLabel}),description:ii(t,"state.unsupported.install.description",{extension:r,rendererLabel:n.rendererLabel,presetPackage:n.presetPackage,vitePreset:n.vitePreset,rendererTip:o}),theme:i,recoverable:!0})}return Zn({state:"unsupported",extension:e,title:ii(t,"state.unsupported.title"),message:ii(t,"state.unsupported.message",{extension:r}),description:ii(t,"state.unsupported.description"),theme:i,recoverable:!0})}})),Ir=_e((()=>{Ki(),Rr(),Ei()})),Eo,Vn,ko,So,To,Gn=_e((()=>{ui(),Wn(),Ar(),Ir(),Eo=(e,i)=>({rendered:e,destroy:()=>i?i():Vn(e)}),Vn=e=>{if(!e||typeof e!="object")return;const i=e;if(typeof i.unmount=="function")return i.unmount();if(typeof i.$destroy=="function")return i.$destroy();if(typeof i.destroy=="function")return i.destroy()},ko=({source:e,options:i,registerExportAdapter:t,renderContext:r})=>({filename:e.filename,url:e.url,streamUrl:e.url,options:i,registerExportAdapter:t,...r}),So=({handler:e,getTarget:i=n=>n.surface.container,createContext:t=ko,destroy:r})=>async n=>{const{source:a}=n;if(!a.buffer)throw new Error("FileRenderHandler renderer requires an ArrayBuffer source.");const o=i(n),s=await e(a.buffer,o,a.extension,t(n));return Eo(s,()=>r?r(s,n):Vn(s))},To=({definitions:e=jt,handlers:i,getTarget:t,createContext:r,destroy:n})=>{const a=Cr(e),o=Un({registry:a,handlers:i});return{registry:Cr(a.list().map(s=>{const l=o.handlersByRendererId.get(s.id);return l?{...s,load:So({handler:l,getTarget:t,createContext:r,destroy:n})}:s})),dispatcher:o,missingRendererIds:o.missingRendererIds}}})),Mu=$i({default:()=>Bu});async function Bu(e,i,t){const r=await Oo(e,t);let n=1,a=0;const o=so(),s=document.createElement("div");s.className="image-viewer",s.dataset.viewerZoomProvider="image";const l=document.createElement("div");l.className="image-stage";const h=document.createElement("img");h.alt="图片",h.src=r,l.append(h),s.append(l);const d=Lo(r),f=()=>d.open();h.addEventListener("click",f),document.body.append(d.element);const v=()=>{a=s.clientHeight||0,Xn(h,a,n),o.emit()},p=new ResizeObserver(v);p.observe(s);const y=()=>({scale:n,label:`${Math.round(n*100)}%`,canZoomIn:n<5,canZoomOut:n>.1,canReset:n!==1,minScale:.1,maxScale:5}),k=u=>(n=Do(u),Xn(h,a,n),o.emit(),y());return io(s,{zoomIn:()=>k(n+.15),zoomOut:()=>k(n-.15),resetZoom:()=>k(1),setZoom:k,getState:y,subscribe:o.subscribe}),i.replaceChildren(Ro(),s),v(),{$el:i,unmount(){ro(s),p.disconnect(),h.removeEventListener("click",f),d.destroy(),i.replaceChildren()}}}var Co,Ao,Ro,Io,No,Oo,Do,Xn,Lo,Uu=_e((()=>{Yi(),zn(),Co={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",heic:"image/heic",heif:"image/heif",ico:"image/x-icon",jxl:"image/jxl",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp"},Ao=`
|
|
2
|
+
.image-viewer{position:relative;width:100%;height:100%;overflow:auto;background:#eef1f4;box-sizing:border-box}
|
|
3
|
+
.image-stage{min-width:100%;min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}
|
|
4
|
+
.image-stage img{display:block;width:auto;max-width:none;margin:0 auto;border:0;box-shadow:0 18px 48px rgba(15,23,42,.16);background:#fff;cursor:zoom-in}
|
|
5
|
+
.image-lightbox{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:40px;background:rgba(15,23,42,.88);box-sizing:border-box}
|
|
6
|
+
.image-lightbox[hidden]{display:none}
|
|
7
|
+
.image-lightbox img{display:block;max-width:100%;max-height:100%;object-fit:contain;background:#fff;box-shadow:0 30px 80px rgba(0,0,0,.4);cursor:zoom-out}
|
|
8
|
+
.image-lightbox button{position:absolute;top:20px;right:20px;width:40px;height:40px;border:0;border-radius:999px;background:rgba(255,255,255,.92);color:#172033;font-size:24px;line-height:40px;cursor:pointer;box-shadow:0 12px 28px rgba(0,0,0,.18)}
|
|
9
|
+
.file-viewer[data-viewer-theme='dark'] .image-viewer{background:#101820}
|
|
10
|
+
@media (prefers-color-scheme:dark){.file-viewer[data-viewer-theme='system'] .image-viewer{background:#101820}}
|
|
11
|
+
@media (max-width:767px){.image-stage{padding:12px}.image-lightbox{padding:16px}.image-lightbox button{top:12px;right:12px}}
|
|
12
|
+
`,Ro=()=>{const e=document.createElement("style");return e.textContent=Ao,e},Io=e=>Co[(e||"").trim().toLowerCase()]||"image/*",No=async e=>await new Promise((i,t)=>{const r=new FileReader;r.onload=n=>{var a;const o=(a=n.target)===null||a===void 0?void 0:a.result;if(typeof o=="string"){i(o);return}t(new Error("Unable to read image data URL."))},r.onerror=()=>t(r.error||new Error("Unable to read image data URL.")),r.readAsDataURL(e)}),Oo=async(e,i)=>{const t=(i||"").trim().toLowerCase();if(t==="heic"||t==="heif")throw new Error("HEIC/HEIF image conversion has moved out of @file-viewer/core. Install and pass @file-viewer/renderer-image, or use @file-viewer/preset-all.");return No(new Blob([e],{type:Io(t)}))},Do=e=>Math.min(5,Math.max(.1,Number(e.toFixed(2)))),Xn=(e,i,t)=>{if(i>0){e.style.height=`${Math.max(1,Math.round(i*t))}px`;return}e.style.height=`${t*100}%`},Lo=e=>{const i=document.createElement("div");i.className="image-lightbox",i.hidden=!0,i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");const t=document.createElement("img");t.alt="Preview image",t.src=e;const r=document.createElement("button");r.type="button",r.setAttribute("aria-label","Close image preview"),r.textContent="x";const n=()=>{i.hidden=!0};return r.addEventListener("click",n),t.addEventListener("click",n),i.addEventListener("click",a=>{a.target===i&&n()}),i.append(t,r),{element:i,open(){i.hidden=!1},destroy(){r.removeEventListener("click",n),t.removeEventListener("click",n),i.remove()}}}})),zo,Nr,qn,Po,Fo,Mo,Bo,Uo,Wo,Or,Wu,ju,Hu,jo=_e((()=>{ui(),Gn(),Wn(),Rr(),zo=e=>({$el:e,unmount(){}}),Nr=[{rendererId:"image",handler:async(e,i,t)=>{const{default:r}=await Promise.resolve().then(()=>(Uu(),Mu));return r(e,i,t)}}],qn=["image"],Po=Nr.filter(e=>qn.includes(e.rendererId)),Fo=jt.filter(e=>qn.includes(e.id)),Mo=e=>e==="none"?[]:e==="lite"?Fo:jt,Bo=e=>e==="none"?[]:e==="lite"?Po:Nr,Uo=async(e,i,t)=>{const r=xo(t),n=document.createElement("div");n.style.textAlign="center",n.style.marginTop="80px";const a=document.createElement("div");if(a.textContent=r.message,n.appendChild(a),r.description){const o=document.createElement("div");o.textContent=r.description,n.appendChild(o)}return i.replaceChildren(n),zo(i)},Wo=(e={})=>{const i=e.builtinRenderers||"all",t=To({definitions:Mo(i),handlers:Bo(i)});return{...t,dispatcher:Un({registry:t.registry,handlers:Nr,fallbackHandler:Uo})}},Or=Wo(),Wu=Or.registry,ju=Or.dispatcher,Hu=Or.missingRendererIds})),Zu=_e((()=>{Ei()})),Vu=_e((()=>{Ki(),Ir()})),Gu=_e((()=>{Ki()})),Xu=_e((()=>{ao(),zn(),Bn(),jn(),Ki(),Ar(),Gn(),jo(),Ir(),Rr()})),$n=_e((()=>{Tu(),ui(),no(),ao(),zn(),Yi(),Bn(),Ei(),Ar(),jo(),jn(),Ki(),Zu(),Vu(),Gu(),Wn(),Gn(),Tr(),Rr(),Ir(),Xu()})),Ho=Ae(((e,i)=>{var t=void 0;i.exports=function(r){return r!==t&&r!==null}})),qu=Ae(((e,i)=>{var t=Ho(),r={object:!0,function:!0,undefined:!0};i.exports=function(n){return t(n)?hasOwnProperty.call(r,typeof n):!1}})),$u=Ae(((e,i)=>{var t=qu();i.exports=function(r){if(!t(r))return!1;try{return r.constructor?r.constructor.prototype===r:!1}catch{return!1}}})),Yu=Ae(((e,i)=>{var t=$u();i.exports=function(r){if(typeof r!="function"||!hasOwnProperty.call(r,"length"))return!1;try{if(typeof r.length!="number"||typeof r.call!="function"||typeof r.apply!="function")return!1}catch{return!1}return!t(r)}})),Ku=Ae(((e,i)=>{var t=Yu(),r=/^\s*class[\s{/}]/,n=Function.prototype.toString;i.exports=function(a){return!(!t(a)||r.test(n.call(a)))}})),Ju=Ae(((e,i)=>{i.exports=function(){var t=Object.assign,r;return typeof t!="function"?!1:(r={foo:"raz"},t(r,{bar:"dwa"},{trzy:"trzy"}),r.foo+r.bar+r.trzy==="razdwatrzy")}})),Qu=Ae(((e,i)=>{i.exports=function(){try{return!0}catch{return!1}}})),ec=Ae(((e,i)=>{i.exports=function(){}})),Yn=Ae(((e,i)=>{var t=ec()();i.exports=function(r){return r!==t&&r!==null}})),tc=Ae(((e,i)=>{var t=Yn(),r=Object.keys;i.exports=function(n){return r(t(n)?Object(n):n)}})),ic=Ae(((e,i)=>{i.exports=Qu()()?Object.keys:tc()})),rc=Ae(((e,i)=>{var t=Yn();i.exports=function(r){if(!t(r))throw new TypeError("Cannot use null or undefined");return r}})),nc=Ae(((e,i)=>{var t=ic(),r=rc(),n=Math.max;i.exports=function(a,o){var s,l,h=n(arguments.length,2),d;for(a=Object(r(a)),d=function(f){try{a[f]=o[f]}catch(v){s||(s=v)}},l=1;l<h;++l)o=arguments[l],t(o).forEach(d);if(s!==void 0)throw s;return a}})),ac=Ae(((e,i)=>{i.exports=Ju()()?Object.assign:nc()})),sc=Ae(((e,i)=>{var t=Yn(),r=Array.prototype.forEach,n=Object.create,a=function(o,s){var l;for(l in o)s[l]=o[l]};i.exports=function(o){var s=n(null);return r.call(arguments,function(l){t(l)&&a(Object(l),s)}),s}})),oc=Ae(((e,i)=>{var t="razdwatrzy";i.exports=function(){return typeof t.contains!="function"?!1:t.contains("dwa")===!0&&t.contains("foo")===!1}})),lc=Ae(((e,i)=>{var t=String.prototype.indexOf;i.exports=function(r){return t.call(this,r,arguments[1])>-1}})),hc=Ae(((e,i)=>{i.exports=oc()()?String.prototype.contains:lc()})),dc=Ae(((e,i)=>{var t=Ho(),r=Ku(),n=ac(),a=sc(),o=hc(),s=i.exports=function(l,h){var d,f,v,p,y;return arguments.length<2||typeof l!="string"?(p=h,h=l,l=null):p=arguments[2],t(l)?(d=o.call(l,"c"),f=o.call(l,"e"),v=o.call(l,"w")):(d=v=!0,f=!1),y={value:h,configurable:d,enumerable:f,writable:v},p?n(a(p),y):y};s.gs=function(l,h,d){var f,v,p,y;return typeof l!="string"?(p=d,d=h,h=l,l=null):p=arguments[3],t(h)?r(h)?t(d)?r(d)||(p=d,d=void 0):d=void 0:(p=h,h=d=void 0):h=void 0,t(l)?(f=o.call(l,"c"),v=o.call(l,"e")):(f=!0,v=!1),y={get:h,set:d,configurable:f,enumerable:v},p?n(a(p),y):y}})),uc=Ae(((e,i)=>{i.exports=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}})),Ht=Ae(((e,i)=>{var t=dc(),r=uc(),n=Function.prototype.apply,a=Function.prototype.call,o=Object.create,s=Object.defineProperty,l=Object.defineProperties,h=Object.prototype.hasOwnProperty,d={configurable:!0,enumerable:!1,writable:!0},f=function(g,E){var x;return r(E),h.call(this,"__ee__")?x=this.__ee__:(x=d.value=o(null),s(this,"__ee__",d),d.value=null),x[g]?typeof x[g]=="object"?x[g].push(E):x[g]=[x[g],E]:x[g]=E,this},v=function(g,E){var x,_;return r(E),_=this,f.call(this,g,x=function(){p.call(_,g,x),n.call(E,this,arguments)}),x.__eeOnceListener__=E,this},p=function(g,E){var x,_,I,A;if(r(E),!h.call(this,"__ee__"))return this;if(x=this.__ee__,!x[g])return this;if(_=x[g],typeof _=="object")for(A=0;I=_[A];++A)(I===E||I.__eeOnceListener__===E)&&(_.length===2?x[g]=_[A?0:1]:_.splice(A,1));else(_===E||_.__eeOnceListener__===E)&&delete x[g];return this},y=function(g){var E,x,_,I,A;if(h.call(this,"__ee__")&&(I=this.__ee__[g],!!I))if(typeof I=="object"){for(x=arguments.length,A=new Array(x-1),E=1;E<x;++E)A[E-1]=arguments[E];for(I=I.slice(),E=0;_=I[E];++E)n.call(_,this,A)}else switch(arguments.length){case 1:a.call(I,this);break;case 2:a.call(I,this,arguments[1]);break;case 3:a.call(I,this,arguments[1],arguments[2]);break;default:for(x=arguments.length,A=new Array(x-1),E=1;E<x;++E)A[E-1]=arguments[E];n.call(I,this,A)}},k={on:f,once:v,off:p,emit:y},u={on:t(f),once:t(v),off:t(p),emit:t(y)},m=l({},u);i.exports=e=function(g){return g==null?o(m):l(Object(g),u)},e.methods=k})),Dr=Ae((e=>{function i(n,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(n):n}var t=i({HTML:"text/html",isHTML:function(n){return n===t.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=i({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});e.freeze=i,e.MIME_TYPE=t,e.NAMESPACE=r})),Zo=Ae((e=>{var i=Dr().NAMESPACE;function t(T){return T!==""}function r(T){return T?T.split(/[\t\n\f\r ]+/).filter(t):[]}function n(T,R){return T.hasOwnProperty(R)||(T[R]=!0),T}function a(T){if(!T)return[];var R=r(T);return Object.keys(R.reduce(n,{}))}function o(T){return function(R){return T&&T.indexOf(R)!==-1}}function s(T,R){for(var B in T)R[B]=T[B]}function l(T,R){var B=T.prototype;if(!(B instanceof R)){let le=function(){};var X=le;le.prototype=R.prototype,le=new le,s(B,le),T.prototype=B=le}B.constructor!=T&&(typeof T!="function"&&console.error("unknown Class:"+T),B.constructor=T)}var h={},d=h.ELEMENT_NODE=1,f=h.ATTRIBUTE_NODE=2,v=h.TEXT_NODE=3,p=h.CDATA_SECTION_NODE=4,y=h.ENTITY_REFERENCE_NODE=5,k=h.ENTITY_NODE=6,u=h.PROCESSING_INSTRUCTION_NODE=7,m=h.COMMENT_NODE=8,g=h.DOCUMENT_NODE=9,E=h.DOCUMENT_TYPE_NODE=10,x=h.DOCUMENT_FRAGMENT_NODE=11,_=h.NOTATION_NODE=12,I={},A={};I.INDEX_SIZE_ERR=(A[1]="Index size error",1),I.DOMSTRING_SIZE_ERR=(A[2]="DOMString size error",2);var D=I.HIERARCHY_REQUEST_ERR=(A[3]="Hierarchy request error",3);I.WRONG_DOCUMENT_ERR=(A[4]="Wrong document",4),I.INVALID_CHARACTER_ERR=(A[5]="Invalid character",5),I.NO_DATA_ALLOWED_ERR=(A[6]="No data allowed",6),I.NO_MODIFICATION_ALLOWED_ERR=(A[7]="No modification allowed",7);var z=I.NOT_FOUND_ERR=(A[8]="Not found",8);I.NOT_SUPPORTED_ERR=(A[9]="Not supported",9);var O=I.INUSE_ATTRIBUTE_ERR=(A[10]="Attribute in use",10);I.INVALID_STATE_ERR=(A[11]="Invalid state",11),I.SYNTAX_ERR=(A[12]="Syntax error",12),I.INVALID_MODIFICATION_ERR=(A[13]="Invalid modification",13),I.NAMESPACE_ERR=(A[14]="Invalid namespace",14),I.INVALID_ACCESS_ERR=(A[15]="Invalid access",15);function F(T,R){if(R instanceof Error)var B=R;else B=this,Error.call(this,A[T]),this.message=A[T],Error.captureStackTrace&&Error.captureStackTrace(this,F);return B.code=T,R&&(this.message=this.message+": "+R),B}F.prototype=Error.prototype,s(I,F);function W(){}W.prototype={length:0,item:function(T){return this[T]||null},toString:function(T,R){for(var B=[],X=0;X<this.length;X++)ct(this[X],B,T,R);return B.join("")}};function q(T,R){this._node=T,this._refresh=R,re(this)}function re(T){var R=T._node._inc||T._node.ownerDocument._inc;if(T._inc!=R){var B=T._refresh(T._node);Bt(T,"length",B.length),s(B,T),T._inc=R}}q.prototype.item=function(T){return re(this),this[T]},l(q,W);function K(){}function de(T,R){for(var B=T.length;B--;)if(T[B]===R)return B}function ue(T,R,B,X){if(X?R[de(R,X)]=B:R[R.length++]=B,T){B.ownerElement=T;var le=T.ownerDocument;le&&(X&&Oe(le,T,X),Le(le,T,B))}}function te(T,R,B){var X=de(R,B);if(X>=0){for(var le=R.length-1;X<le;)R[X]=R[++X];if(R.length=le,T){var S=T.ownerDocument;S&&(Oe(S,T,B),B.ownerElement=null)}}else throw F(z,new Error(T.tagName+"@"+B))}K.prototype={length:0,item:W.prototype.item,getNamedItem:function(T){for(var R=this.length;R--;){var B=this[R];if(B.nodeName==T)return B}},setNamedItem:function(T){var R=T.ownerElement;if(R&&R!=this._ownerElement)throw new F(O);var B=this.getNamedItem(T.nodeName);return ue(this._ownerElement,this,T,B),B},setNamedItemNS:function(T){var R=T.ownerElement,B;if(R&&R!=this._ownerElement)throw new F(O);return B=this.getNamedItemNS(T.namespaceURI,T.localName),ue(this._ownerElement,this,T,B),B},removeNamedItem:function(T){var R=this.getNamedItem(T);return te(this._ownerElement,this,R),R},removeNamedItemNS:function(T,R){var B=this.getNamedItemNS(T,R);return te(this._ownerElement,this,B),B},getNamedItemNS:function(T,R){for(var B=this.length;B--;){var X=this[B];if(X.localName==R&&X.namespaceURI==T)return X}return null}};function fe(){}fe.prototype={hasFeature:function(T,R){return!0},createDocument:function(T,R,B){var X=new Ce;if(X.implementation=this,X.childNodes=new W,X.doctype=B||null,B&&X.appendChild(B),R){var le=X.createElementNS(T,R);X.appendChild(le)}return X},createDocumentType:function(T,R,B){var X=new Pe;return X.name=T,X.nodeName=T,X.publicId=R||"",X.systemId=B||"",X}};function ee(){}ee.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(T,R){return ge(this,T,R)},replaceChild:function(T,R){this.insertBefore(T,R),R&&this.removeChild(R)},removeChild:function(T){return ve(this,T)},appendChild:function(T){return this.insertBefore(T,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(T){return dt(this.ownerDocument||this,this,T)},normalize:function(){for(var T=this.firstChild;T;){var R=T.nextSibling;R&&R.nodeType==v&&T.nodeType==v?(this.removeChild(R),T.appendData(R.data)):(T.normalize(),T=R)}},isSupported:function(T,R){return this.ownerDocument.implementation.hasFeature(T,R)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(T){for(var R=this;R;){var B=R._nsMap;if(B){for(var X in B)if(B[X]==T)return X}R=R.nodeType==f?R.ownerDocument:R.parentNode}return null},lookupNamespaceURI:function(T){for(var R=this;R;){var B=R._nsMap;if(B&&T in B)return B[T];R=R.nodeType==f?R.ownerDocument:R.parentNode}return null},isDefaultNamespace:function(T){return this.lookupPrefix(T)==null}};function Se(T){return T=="<"&&"<"||T==">"&&">"||T=="&"&&"&"||T=='"'&&"""||"&#"+T.charCodeAt()+";"}s(h,ee),s(h,ee.prototype);function be(T,R){if(R(T))return!0;if(T=T.firstChild)do if(be(T,R))return!0;while(T=T.nextSibling)}function Ce(){}function Le(T,R,B){T&&T._inc++,B.namespaceURI===i.XMLNS&&(R._nsMap[B.prefix?B.localName:""]=B.value)}function Oe(T,R,B,X){T&&T._inc++,B.namespaceURI===i.XMLNS&&delete R._nsMap[B.prefix?B.localName:""]}function Re(T,R,B){if(T&&T._inc){T._inc++;var X=R.childNodes;if(B)X[X.length++]=B;else{for(var le=R.firstChild,S=0;le;)X[S++]=le,le=le.nextSibling;X.length=S}}}function ve(T,R){var B=R.previousSibling,X=R.nextSibling;return B?B.nextSibling=X:T.firstChild=X,X?X.previousSibling=B:T.lastChild=B,Re(T.ownerDocument,T),R}function ge(T,R,B){var X=R.parentNode;if(X&&X.removeChild(R),R.nodeType===x){var le=R.firstChild;if(le==null)return R;var S=R.lastChild}else le=S=R;var J=B?B.previousSibling:T.lastChild;le.previousSibling=J,S.nextSibling=B,J?J.nextSibling=le:T.firstChild=le,B==null?T.lastChild=S:B.previousSibling=S;do le.parentNode=T;while(le!==S&&(le=le.nextSibling));return Re(T.ownerDocument||T,T),R.nodeType==x&&(R.firstChild=R.lastChild=null),R}function Te(T,R){var B=R.parentNode;if(B){var X=T.lastChild;B.removeChild(R);var X=T.lastChild}var X=T.lastChild;return R.parentNode=T,R.previousSibling=X,R.nextSibling=null,X?X.nextSibling=R:T.firstChild=R,T.lastChild=R,Re(T.ownerDocument,T,R),R}Ce.prototype={nodeName:"#document",nodeType:g,doctype:null,documentElement:null,_inc:1,insertBefore:function(T,R){if(T.nodeType==x){for(var B=T.firstChild;B;){var X=B.nextSibling;this.insertBefore(B,R),B=X}return T}return this.documentElement==null&&T.nodeType==d&&(this.documentElement=T),ge(this,T,R),T.ownerDocument=this,T},removeChild:function(T){return this.documentElement==T&&(this.documentElement=null),ve(this,T)},importNode:function(T,R){return yt(this,T,R)},getElementById:function(T){var R=null;return be(this.documentElement,function(B){if(B.nodeType==d&&B.getAttribute("id")==T)return R=B,!0}),R},getElementsByClassName:function(T){var R=a(T);return new q(this,function(B){var X=[];return R.length>0&&be(B.documentElement,function(le){if(le!==B&&le.nodeType===d){var S=le.getAttribute("class");if(S){var J=T===S;if(!J){var ae=a(S);J=R.every(o(ae))}J&&X.push(le)}}}),X})},createElement:function(T){var R=new se;R.ownerDocument=this,R.nodeName=T,R.tagName=T,R.localName=T,R.childNodes=new W;var B=R.attributes=new K;return B._ownerElement=R,R},createDocumentFragment:function(){var T=new We;return T.ownerDocument=this,T.childNodes=new W,T},createTextNode:function(T){var R=new He;return R.ownerDocument=this,R.appendData(T),R},createComment:function(T){var R=new ze;return R.ownerDocument=this,R.appendData(T),R},createCDATASection:function(T){var R=new et;return R.ownerDocument=this,R.appendData(T),R},createProcessingInstruction:function(T,R){var B=new we;return B.ownerDocument=this,B.tagName=B.target=T,B.nodeValue=B.data=R,B},createAttribute:function(T){var R=new ce;return R.ownerDocument=this,R.name=T,R.nodeName=T,R.localName=T,R.specified=!0,R},createEntityReference:function(T){var R=new Qe;return R.ownerDocument=this,R.nodeName=T,R},createElementNS:function(T,R){var B=new se,X=R.split(":"),le=B.attributes=new K;return B.childNodes=new W,B.ownerDocument=this,B.nodeName=R,B.tagName=R,B.namespaceURI=T,X.length==2?(B.prefix=X[0],B.localName=X[1]):B.localName=R,le._ownerElement=B,B},createAttributeNS:function(T,R){var B=new ce,X=R.split(":");return B.ownerDocument=this,B.nodeName=R,B.name=R,B.namespaceURI=T,B.specified=!0,X.length==2?(B.prefix=X[0],B.localName=X[1]):B.localName=R,B}},l(Ce,ee);function se(){this._nsMap={}}se.prototype={nodeType:d,hasAttribute:function(T){return this.getAttributeNode(T)!=null},getAttribute:function(T){var R=this.getAttributeNode(T);return R&&R.value||""},getAttributeNode:function(T){return this.attributes.getNamedItem(T)},setAttribute:function(T,R){var B=this.ownerDocument.createAttribute(T);B.value=B.nodeValue=""+R,this.setAttributeNode(B)},removeAttribute:function(T){var R=this.getAttributeNode(T);R&&this.removeAttributeNode(R)},appendChild:function(T){return T.nodeType===x?this.insertBefore(T,null):Te(this,T)},setAttributeNode:function(T){return this.attributes.setNamedItem(T)},setAttributeNodeNS:function(T){return this.attributes.setNamedItemNS(T)},removeAttributeNode:function(T){return this.attributes.removeNamedItem(T.nodeName)},removeAttributeNS:function(T,R){var B=this.getAttributeNodeNS(T,R);B&&this.removeAttributeNode(B)},hasAttributeNS:function(T,R){return this.getAttributeNodeNS(T,R)!=null},getAttributeNS:function(T,R){var B=this.getAttributeNodeNS(T,R);return B&&B.value||""},setAttributeNS:function(T,R,B){var X=this.ownerDocument.createAttributeNS(T,R);X.value=X.nodeValue=""+B,this.setAttributeNode(X)},getAttributeNodeNS:function(T,R){return this.attributes.getNamedItemNS(T,R)},getElementsByTagName:function(T){return new q(this,function(R){var B=[];return be(R,function(X){X!==R&&X.nodeType==d&&(T==="*"||X.tagName==T)&&B.push(X)}),B})},getElementsByTagNameNS:function(T,R){return new q(this,function(B){var X=[];return be(B,function(le){le!==B&&le.nodeType===d&&(T==="*"||le.namespaceURI===T)&&(R==="*"||le.localName==R)&&X.push(le)}),X})}},Ce.prototype.getElementsByTagName=se.prototype.getElementsByTagName,Ce.prototype.getElementsByTagNameNS=se.prototype.getElementsByTagNameNS,l(se,ee);function ce(){}ce.prototype.nodeType=f,l(ce,ee);function xe(){}xe.prototype={data:"",substringData:function(T,R){return this.data.substring(T,T+R)},appendData:function(T){T=this.data+T,this.nodeValue=this.data=T,this.length=T.length},insertData:function(T,R){this.replaceData(T,0,R)},appendChild:function(T){throw new Error(A[D])},deleteData:function(T,R){this.replaceData(T,R,"")},replaceData:function(T,R,B){var X=this.data.substring(0,T),le=this.data.substring(T+R);B=X+B+le,this.nodeValue=this.data=B,this.length=B.length}},l(xe,ee);function He(){}He.prototype={nodeName:"#text",nodeType:v,splitText:function(T){var R=this.data,B=R.substring(T);R=R.substring(0,T),this.data=this.nodeValue=R,this.length=R.length;var X=this.ownerDocument.createTextNode(B);return this.parentNode&&this.parentNode.insertBefore(X,this.nextSibling),X}},l(He,xe);function ze(){}ze.prototype={nodeName:"#comment",nodeType:m},l(ze,xe);function et(){}et.prototype={nodeName:"#cdata-section",nodeType:p},l(et,xe);function Pe(){}Pe.prototype.nodeType=E,l(Pe,ee);function De(){}De.prototype.nodeType=_,l(De,ee);function Je(){}Je.prototype.nodeType=k,l(Je,ee);function Qe(){}Qe.prototype.nodeType=y,l(Qe,ee);function We(){}We.prototype.nodeName="#document-fragment",We.prototype.nodeType=x,l(We,ee);function we(){}we.prototype.nodeType=u,l(we,ee);function Ge(){}Ge.prototype.serializeToString=function(T,R,B){return gt.call(T,R,B)},ee.prototype.toString=gt;function gt(T,R){var B=[],X=this.nodeType==9&&this.documentElement||this,le=X.prefix,S=X.namespaceURI;if(S&&le==null){var le=X.lookupPrefix(S);if(le==null)var J=[{namespace:S,prefix:null}]}return ct(this,B,T,R,J),B.join("")}function wt(T,R,B){var X=T.prefix||"",le=T.namespaceURI;if(!le||X==="xml"&&le===i.XML||le===i.XMLNS)return!1;for(var S=B.length;S--;){var J=B[S];if(J.prefix===X)return J.namespace!==le}return!0}function at(T,R,B){T.push(" ",R,'="',B.replace(/[<&"]/g,Se),'"')}function ct(T,R,B,X,le){if(le||(le=[]),X)if(T=X(T),T){if(typeof T=="string"){R.push(T);return}}else return;switch(T.nodeType){case d:var S=T.attributes,J=S.length,U=T.firstChild,ae=T.tagName;B=i.isHTML(T.namespaceURI)||B;var M=ae;if(!B&&!T.prefix&&T.namespaceURI){for(var G,w=0;w<S.length;w++)if(S.item(w).name==="xmlns"){G=S.item(w).value;break}if(!G)for(var $=le.length-1;$>=0;$--){var c=le[$];if(c.prefix===""&&c.namespace===T.namespaceURI){G=c.namespace;break}}if(G!==T.namespaceURI)for(var $=le.length-1;$>=0;$--){var c=le[$];if(c.namespace===T.namespaceURI){c.prefix&&(M=c.prefix+":"+ae);break}}}R.push("<",M);for(var L=0;L<J;L++){var ie=S.item(L);ie.prefix=="xmlns"?le.push({prefix:ie.localName,namespace:ie.value}):ie.nodeName=="xmlns"&&le.push({prefix:"",namespace:ie.value})}for(var L=0;L<J;L++){var ie=S.item(L);if(wt(ie,B,le)){var b=ie.prefix||"",Y=ie.namespaceURI;at(R,b?"xmlns:"+b:"xmlns",Y),le.push({prefix:b,namespace:Y})}ct(ie,R,B,X,le)}if(ae===M&&wt(T,B,le)){var b=T.prefix||"",Y=T.namespaceURI;at(R,b?"xmlns:"+b:"xmlns",Y),le.push({prefix:b,namespace:Y})}if(U||B&&!/^(?:meta|link|img|br|hr|input)$/i.test(ae)){if(R.push(">"),B&&/^script$/i.test(ae))for(;U;)U.data?R.push(U.data):ct(U,R,B,X,le.slice()),U=U.nextSibling;else for(;U;)ct(U,R,B,X,le.slice()),U=U.nextSibling;R.push("</",M,">")}else R.push("/>");return;case g:case x:for(var U=T.firstChild;U;)ct(U,R,B,X,le.slice()),U=U.nextSibling;return;case f:return at(R,T.name,T.value);case v:return R.push(T.data.replace(/[<&]/g,Se).replace(/]]>/g,"]]>"));case p:return R.push("<![CDATA[",T.data,"]]>");case m:return R.push("<!--",T.data,"-->");case E:var V=T.publicId,ye=T.systemId;if(R.push("<!DOCTYPE ",T.name),V)R.push(" PUBLIC ",V),ye&&ye!="."&&R.push(" ",ye),R.push(">");else if(ye&&ye!=".")R.push(" SYSTEM ",ye,">");else{var Ne=T.internalSubset;Ne&&R.push(" [",Ne,"]"),R.push(">")}return;case u:return R.push("<?",T.target," ",T.data,"?>");case y:return R.push("&",T.nodeName,";");default:R.push("??",T.nodeName)}}function yt(T,R,B){var X;switch(R.nodeType){case d:X=R.cloneNode(!1),X.ownerDocument=T;case x:break;case f:B=!0;break}if(X||(X=R.cloneNode(!1)),X.ownerDocument=T,X.parentNode=null,B)for(var le=R.firstChild;le;)X.appendChild(yt(T,le,B)),le=le.nextSibling;return X}function dt(T,R,B){var X=new R.constructor;for(var le in R){var S=R[le];typeof S!="object"&&S!=X[le]&&(X[le]=S)}switch(R.childNodes&&(X.childNodes=new W),X.ownerDocument=T,X.nodeType){case d:var J=R.attributes,ae=X.attributes=new K,M=J.length;ae._ownerElement=X;for(var G=0;G<M;G++)X.setAttributeNode(dt(T,J.item(G),!0));break;case f:B=!0}if(B)for(var w=R.firstChild;w;)X.appendChild(dt(T,w,B)),w=w.nextSibling;return X}function Bt(T,R,B){T[R]=B}try{if(Object.defineProperty){let T=function(R){switch(R.nodeType){case d:case x:var B=[];for(R=R.firstChild;R;)R.nodeType!==7&&R.nodeType!==8&&B.push(T(R)),R=R.nextSibling;return B.join("");default:return R.nodeValue}};var Ut=T;Object.defineProperty(q.prototype,"length",{get:function(){return re(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return T(this)},set:function(R){switch(this.nodeType){case d:case x:for(;this.firstChild;)this.removeChild(this.firstChild);(R||String(R))&&this.appendChild(this.ownerDocument.createTextNode(R));break;default:this.data=R,this.value=R,this.nodeValue=R}}}),Bt=function(R,B,X){R["$$"+B]=X}}}catch{}e.DocumentType=Pe,e.DOMException=F,e.DOMImplementation=fe,e.Element=se,e.Node=ee,e.NodeList=W,e.XMLSerializer=Ge})),cc=Ae((e=>{var i=Dr().freeze;e.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),e.entityMap=e.HTML_ENTITIES})),fc=Ae((e=>{var i=Dr().NAMESPACE,t=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,r=new RegExp("[\\-\\.0-9"+t.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),n=new RegExp("^"+t.source+r.source+"*(?::"+t.source+r.source+"*)?$"),a=0,o=1,s=2,l=3,h=4,d=5,f=6,v=7;function p(O,F){this.message=O,this.locator=F,Error.captureStackTrace&&Error.captureStackTrace(this,p)}p.prototype=new Error,p.prototype.name=p.name;function y(){}y.prototype={parse:function(O,F,W){var q=this.domBuilder;q.startDocument(),_(F,F={}),k(O,F,W,q,this.errorHandler),q.endDocument()}};function k(O,F,W,q,re){function K(we){if(we>65535){we-=65536;var Ge=55296+(we>>10),gt=56320+(we&1023);return String.fromCharCode(Ge,gt)}else return String.fromCharCode(we)}function de(we){var Ge=we.slice(1,-1);return Ge in W?W[Ge]:Ge.charAt(0)==="#"?K(parseInt(Ge.substr(1).replace("x","0x"))):(re.error("entity not found:"+we),we)}function ue(we){if(we>Oe){var Ge=O.substring(Oe,we).replace(/&#?\w+;/g,de);be&&te(Oe),q.characters(Ge,0,we-Oe),Oe=we}}function te(we,Ge){for(;we>=ee&&(Ge=Se.exec(O));)fe=Ge.index,ee=fe+Ge[0].length,be.lineNumber++;be.columnNumber=we-fe+1}for(var fe=0,ee=0,Se=/.*(?:\r\n?|\n)|.*$/g,be=q.locator,Ce=[{currentNSMap:F}],Le={},Oe=0;;){try{var Re=O.indexOf("<",Oe);if(Re<0){if(!O.substr(Oe).match(/^\s*$/)){var ve=q.doc,ge=ve.createTextNode(O.substr(Oe));ve.appendChild(ge),q.currentElement=ge}return}switch(Re>Oe&&ue(Re),O.charAt(Re+1)){case"/":var Pe=O.indexOf(">",Re+3),Te=O.substring(Re+2,Pe).replace(/[ \t\n\r]+$/g,""),se=Ce.pop();Pe<0?(Te=O.substring(Re+2).replace(/[\s<].*/,""),re.error("end tag name: "+Te+" is not complete:"+se.tagName),Pe=Re+1+Te.length):Te.match(/\s</)&&(Te=Te.replace(/[\s<].*/,""),re.error("end tag name: "+Te+" maybe not complete"),Pe=Re+1+Te.length);var ce=se.localNSMap,xe=se.tagName==Te;if(xe||se.tagName&&se.tagName.toLowerCase()==Te.toLowerCase()){if(q.endElement(se.uri,se.localName,Te),ce)for(var He in ce)q.endPrefixMapping(He);xe||re.fatalError("end tag name: "+Te+" is not match the current start tagName:"+se.tagName)}else Ce.push(se);Pe++;break;case"?":be&&te(Re),Pe=A(O,Re,q);break;case"!":be&&te(Re),Pe=I(O,Re,q,re);break;default:be&&te(Re);var ze=new D,et=Ce[Ce.length-1].currentNSMap,Pe=m(O,Re,ze,et,de,re),De=ze.length;if(!ze.closed&&x(O,Pe,ze.tagName,Le)&&(ze.closed=!0,W.nbsp||re.warning("unclosed xml attribute")),be&&De){for(var Je=u(be,{}),Qe=0;Qe<De;Qe++){var We=ze[Qe];te(We.offset),We.locator=u(be,{})}q.locator=Je,g(ze,q,et)&&Ce.push(ze),q.locator=be}else g(ze,q,et)&&Ce.push(ze);i.isHTML(ze.uri)&&!ze.closed?Pe=E(O,Pe,ze.tagName,de,q):Pe++}}catch(we){if(we instanceof p)throw we;re.error("element parse error: "+we),Pe=-1}Pe>Oe?Oe=Pe:ue(Math.max(Re,Oe)+1)}}function u(O,F){return F.lineNumber=O.lineNumber,F.columnNumber=O.columnNumber,F}function m(O,F,W,q,re,K){function de(be,Ce,Le){W.attributeNames.hasOwnProperty(be)&&K.fatalError("Attribute "+be+" redefined"),W.addValue(be,Ce,Le)}for(var ue,te,fe=++F,ee=a;;){var Se=O.charAt(fe);switch(Se){case"=":if(ee===o)ue=O.slice(F,fe),ee=l;else if(ee===s)ee=l;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ee===l||ee===o)if(ee===o&&(K.warning('attribute value must after "="'),ue=O.slice(F,fe)),F=fe+1,fe=O.indexOf(Se,F),fe>0)te=O.slice(F,fe).replace(/&#?\w+;/g,re),de(ue,te,F-1),ee=d;else throw new Error("attribute value no end '"+Se+"' match");else if(ee==h)te=O.slice(F,fe).replace(/&#?\w+;/g,re),de(ue,te,F),K.warning('attribute "'+ue+'" missed start quot('+Se+")!!"),F=fe+1,ee=d;else throw new Error('attribute value must after "="');break;case"/":switch(ee){case a:W.setTagName(O.slice(F,fe));case d:case f:case v:ee=v,W.closed=!0;case h:case o:case s:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return K.error("unexpected end of input"),ee==a&&W.setTagName(O.slice(F,fe)),fe;case">":switch(ee){case a:W.setTagName(O.slice(F,fe));case d:case f:case v:break;case h:case o:te=O.slice(F,fe),te.slice(-1)==="/"&&(W.closed=!0,te=te.slice(0,-1));case s:ee===s&&(te=ue),ee==h?(K.warning('attribute "'+te+'" missed quot(")!'),de(ue,te.replace(/&#?\w+;/g,re),F)):((!i.isHTML(q[""])||!te.match(/^(?:disabled|checked|selected)$/i))&&K.warning('attribute "'+te+'" missed value!! "'+te+'" instead!!'),de(te,te,F));break;case l:throw new Error("attribute value missed!!")}return fe;case"":Se=" ";default:if(Se<=" ")switch(ee){case a:W.setTagName(O.slice(F,fe)),ee=f;break;case o:ue=O.slice(F,fe),ee=s;break;case h:var te=O.slice(F,fe).replace(/&#?\w+;/g,re);K.warning('attribute "'+te+'" missed quot(")!!'),de(ue,te,F);case d:ee=f;break}else switch(ee){case s:W.tagName,(!i.isHTML(q[""])||!ue.match(/^(?:disabled|checked|selected)$/i))&&K.warning('attribute "'+ue+'" missed value!! "'+ue+'" instead2!!'),de(ue,ue,F),F=fe,ee=o;break;case d:K.warning('attribute space is required"'+ue+'"!!');case f:ee=o,F=fe;break;case l:ee=h,F=fe;break;case v:throw new Error("elements closed character '/' and '>' must be connected to")}}fe++}}function g(O,F,W){for(var q=O.tagName,re=null,Se=O.length;Se--;){var K=O[Se],de=K.qName,ue=K.value,be=de.indexOf(":");if(be>0)var te=K.prefix=de.slice(0,be),fe=de.slice(be+1),ee=te==="xmlns"&&fe;else fe=de,te=null,ee=de==="xmlns"&&"";K.localName=fe,ee!==!1&&(re==null&&(re={},_(W,W={})),W[ee]=re[ee]=ue,K.uri=i.XMLNS,F.startPrefixMapping(ee,ue))}for(var Se=O.length;Se--;){K=O[Se];var te=K.prefix;te&&(te==="xml"&&(K.uri=i.XML),te!=="xmlns"&&(K.uri=W[te||""]))}var be=q.indexOf(":");be>0?(te=O.prefix=q.slice(0,be),fe=O.localName=q.slice(be+1)):(te=null,fe=O.localName=q);var Ce=O.uri=W[te||""];if(F.startElement(Ce,fe,q,O),O.closed){if(F.endElement(Ce,fe,q),re)for(te in re)F.endPrefixMapping(te)}else return O.currentNSMap=W,O.localNSMap=re,!0}function E(O,F,W,q,re){if(/^(?:script|textarea)$/i.test(W)){var K=O.indexOf("</"+W+">",F),de=O.substring(F+1,K);if(/[&<]/.test(de))return/^script$/i.test(W)?(re.characters(de,0,de.length),K):(de=de.replace(/&#?\w+;/g,q),re.characters(de,0,de.length),K)}return F+1}function x(O,F,W,q){var re=q[W];return re==null&&(re=O.lastIndexOf("</"+W+">"),re<F&&(re=O.lastIndexOf("</"+W)),q[W]=re),re<F}function _(O,F){for(var W in O)F[W]=O[W]}function I(O,F,W,q){switch(O.charAt(F+2)){case"-":if(O.charAt(F+3)==="-"){var re=O.indexOf("-->",F+4);return re>F?(W.comment(O,F+4,re-F-4),re+3):(q.error("Unclosed comment"),-1)}else return-1;default:if(O.substr(F+3,6)=="CDATA["){var re=O.indexOf("]]>",F+9);return W.startCDATA(),W.characters(O,F+9,re-F-9),W.endCDATA(),re+3}var K=z(O,F),de=K.length;if(de>1&&/!doctype/i.test(K[0][0])){var ue=K[1][0],te=!1,fe=!1;de>3&&(/^public$/i.test(K[2][0])?(te=K[3][0],fe=de>4&&K[4][0]):/^system$/i.test(K[2][0])&&(fe=K[3][0]));var ee=K[de-1];return W.startDTD(ue,te,fe),W.endDTD(),ee.index+ee[0].length}}return-1}function A(O,F,W){var q=O.indexOf("?>",F);if(q){var re=O.substring(F,q).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return re?(re[0].length,W.processingInstruction(re[1],re[2]),q+2):-1}return-1}function D(){this.attributeNames={}}D.prototype={setTagName:function(O){if(!n.test(O))throw new Error("invalid tagName:"+O);this.tagName=O},addValue:function(O,F,W){if(!n.test(O))throw new Error("invalid attribute:"+O);this.attributeNames[O]=this.length,this[this.length++]={qName:O,value:F,offset:W}},length:0,getLocalName:function(O){return this[O].localName},getLocator:function(O){return this[O].locator},getQName:function(O){return this[O].qName},getURI:function(O){return this[O].uri},getValue:function(O){return this[O].value}};function z(O,F){var W,q=[],re=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(re.lastIndex=F,re.exec(O);W=re.exec(O);)if(q.push(W),W[1])return q}e.XMLReader=y,e.ParseError=p})),pc=Ae((e=>{var i=Dr(),t=Zo(),r=cc(),n=fc(),a=t.DOMImplementation,o=i.NAMESPACE,s=n.ParseError,l=n.XMLReader;function h(u){this.options=u||{locator:{}}}h.prototype.parseFromString=function(u,m){var g=this.options,E=new l,x=g.domBuilder||new f,_=g.errorHandler,I=g.locator,A=g.xmlns||{},D=/\/x?html?$/.test(m),z=D?r.HTML_ENTITIES:r.XML_ENTITIES;return I&&x.setDocumentLocator(I),E.errorHandler=d(_,x,I),E.domBuilder=g.domBuilder||x,D&&(A[""]=o.HTML),A.xml=A.xml||o.XML,u&&typeof u=="string"?E.parse(u,A,z):E.errorHandler.error("invalid doc source"),x.doc};function d(u,m,g){if(!u){if(m instanceof f)return m;u=m}var E={},x=u instanceof Function;g=g||{};function _(I){var A=u[I];!A&&x&&(A=u.length==2?function(D){u(I,D)}:u),E[I]=A&&function(D){A("[xmldom "+I+"] "+D+p(g))}||function(){}}return _("warning"),_("error"),_("fatalError"),E}function f(){this.cdata=!1}function v(u,m){m.lineNumber=u.lineNumber,m.columnNumber=u.columnNumber}f.prototype={startDocument:function(){this.doc=new a().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(u,m,g,E){var x=this.doc,_=x.createElementNS(u,g||m),I=E.length;k(this,_),this.currentElement=_,this.locator&&v(this.locator,_);for(var A=0;A<I;A++){var u=E.getURI(A),D=E.getValue(A),g=E.getQName(A),z=x.createAttributeNS(u,g);this.locator&&v(E.getLocator(A),z),z.value=z.nodeValue=D,_.setAttributeNode(z)}},endElement:function(u,m,g){var E=this.currentElement;E.tagName,this.currentElement=E.parentNode},startPrefixMapping:function(u,m){},endPrefixMapping:function(u){},processingInstruction:function(u,m){var g=this.doc.createProcessingInstruction(u,m);this.locator&&v(this.locator,g),k(this,g)},ignorableWhitespace:function(u,m,g){},characters:function(u,m,g){if(u=y.apply(this,arguments),u){if(this.cdata)var E=this.doc.createCDATASection(u);else var E=this.doc.createTextNode(u);this.currentElement?this.currentElement.appendChild(E):/^\s*$/.test(u)&&this.doc.appendChild(E),this.locator&&v(this.locator,E)}},skippedEntity:function(u){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(u){(this.locator=u)&&(u.lineNumber=0)},comment:function(u,m,g){u=y.apply(this,arguments);var E=this.doc.createComment(u);this.locator&&v(this.locator,E),k(this,E)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(u,m,g){var E=this.doc.implementation;if(E&&E.createDocumentType){var x=E.createDocumentType(u,m,g);this.locator&&v(this.locator,x),k(this,x),this.doc.doctype=x}},warning:function(u){console.warn("[xmldom warning] "+u,p(this.locator))},error:function(u){console.error("[xmldom error] "+u,p(this.locator))},fatalError:function(u){throw new s(u,this.locator)}};function p(u){if(u)return`
|
|
13
|
+
@`+(u.systemId||"")+"#[line:"+u.lineNumber+",col:"+u.columnNumber+"]"}function y(u,m,g){return typeof u=="string"?u.substr(m,g):u.length>=m+g||m?new java.lang.String(u,m,g)+"":u}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(u){f.prototype[u]=function(){return null}});function k(u,m){u.currentElement?u.currentElement.appendChild(m):u.doc.appendChild(m)}e.__DOMHandler=f,e.DOMParser=h,e.DOMImplementation=t.DOMImplementation,e.XMLSerializer=t.XMLSerializer})),Vo=Ae((e=>{var i=Zo();e.DOMImplementation=i.DOMImplementation,e.XMLSerializer=i.XMLSerializer,e.DOMParser=pc().DOMParser})),mc=$i({RangeObject:()=>na,blob2base64:()=>el,borders:()=>Fr,bounds:()=>Pr,createBase64Url:()=>Qn,createBlob:()=>Yo,createBlobUrl:()=>Br,defaults:()=>qo,defer:()=>Fe,documentHeight:()=>gc,extend:()=>ut,filterChildren:()=>Ci,findChildren:()=>ta,getParentByTagName:()=>_c,indexOfElementNode:()=>$o,indexOfNode:()=>Jn,indexOfSorted:()=>zr,indexOfTextNode:()=>bc,insert:()=>vc,isElement:()=>Go,isFloat:()=>Xo,isNumber:()=>tt,isXml:()=>Ji,locationOf:()=>Si,nodeBounds:()=>Kn,parents:()=>ia,parse:()=>Zt,prefixed:()=>ki,qs:()=>Xe,qsa:()=>Kt,qsp:()=>Ti,querySelectorByType:()=>Wr,requestAnimationFrame:()=>jr,revokeBlobUrl:()=>Ko,sprint:()=>Ur,treeWalker:()=>Qo,type:()=>Jo,uuid:()=>Lr,walk:()=>ea,windowBounds:()=>Mr});function Lr(){var e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var t=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(i=="x"?t:t&7|8).toString(16)})}function gc(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function Go(e){return!!(e&&e.nodeType==1)}function tt(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Xo(e){let i=parseFloat(e);return tt(e)===!1?!1:typeof e=="string"&&e.indexOf(".")>-1?!0:Math.floor(i)!==i}function ki(e){var i=["Webkit","webkit","Moz","O","ms"],t=["-webkit-","-webkit-","-moz-","-o-","-ms-"],r=e.toLowerCase(),n=i.length;if(typeof document>"u"||typeof document.body.style[r]<"u")return e;for(var a=0;a<n;a++)if(typeof document.body.style[t[a]+r]<"u")return t[a]+r;return e}function qo(e){for(var i=1,t=arguments.length;i<t;i++){var r=arguments[i];for(var n in r)e[n]===void 0&&(e[n]=r[n])}return e}function ut(e){return[].slice.call(arguments,1).forEach(function(i){i&&Object.getOwnPropertyNames(i).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}),e}function vc(e,i,t){var r=Si(e,i,t);return i.splice(r,0,e),r}function Si(e,i,t,r,n){var a=r||0,o=n||i.length,s=parseInt(a+(o-a)/2),l;return t||(t=function(h,d){if(h>d)return 1;if(h<d)return-1;if(h==d)return 0}),o-a<=0?s:(l=t(i[s],e),o-a===1?l>=0?s:s+1:l===0?s:l===-1?Si(e,i,t,s,o):Si(e,i,t,a,s))}function zr(e,i,t,r,n){var a=r||0,o=n||i.length,s=parseInt(a+(o-a)/2),l;return t||(t=function(h,d){if(h>d)return 1;if(h<d)return-1;if(h==d)return 0}),o-a<=0?-1:(l=t(i[s],e),o-a===1?l===0?s:-1:l===0?s:l===-1?zr(e,i,t,s,o):zr(e,i,t,a,s))}function Pr(e){var i=window.getComputedStyle(e),t=["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],r=["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],n=0,a=0;return t.forEach(function(o){n+=parseFloat(i[o])||0}),r.forEach(function(o){a+=parseFloat(i[o])||0}),{height:a,width:n}}function Fr(e){var i=window.getComputedStyle(e),t=["paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],r=["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],n=0,a=0;return t.forEach(function(o){n+=parseFloat(i[o])||0}),r.forEach(function(o){a+=parseFloat(i[o])||0}),{height:a,width:n}}function Kn(e){let i,t=e.ownerDocument;if(e.nodeType==Node.TEXT_NODE){let r=t.createRange();r.selectNodeContents(e),i=r.getBoundingClientRect()}else i=e.getBoundingClientRect();return i}function Mr(){var e=window.innerWidth,i=window.innerHeight;return{top:0,left:0,right:e,bottom:i,width:e,height:i}}function Jn(e,i){for(var t=e.parentNode.childNodes,r,n=-1,a=0;a<t.length&&(r=t[a],r.nodeType===i&&n++,r!=e);a++);return n}function bc(e){return Jn(e,rl)}function $o(e){return Jn(e,il)}function Ji(e){return["xml","opf","ncx"].indexOf(e)>-1}function Yo(e,i){return new Blob([e],{type:i})}function Br(e,i){var t,r=Yo(e,i);return t=ra.createObjectURL(r),t}function Ko(e){return ra.revokeObjectURL(e)}function Qn(e,i){var t,r;if(typeof e=="string")return t=btoa(e),r="data:"+i+";base64,"+t,r}function Jo(e){return Object.prototype.toString.call(e).slice(8,-1)}function Zt(e,i,t){var r,n;return typeof DOMParser>"u"||t?n=tl.DOMParser:n=DOMParser,e.charCodeAt(0)===65279&&(e=e.slice(1)),r=new n().parseFromString(e,i),r}function Xe(e,i){var t;if(!e)throw new Error("No Element Provided");if(typeof e.querySelector<"u")return e.querySelector(i);if(t=e.getElementsByTagName(i),t.length)return t[0]}function Kt(e,i){return typeof e.querySelector<"u"?e.querySelectorAll(i):e.getElementsByTagName(i)}function Ti(e,i,t){var r,n;if(typeof e.querySelector<"u"){i+="[";for(var a in t)i+=a+"~='"+t[a]+"'";return i+="]",e.querySelector(i)}else if(r=e.getElementsByTagName(i),n=Array.prototype.slice.call(r,0).filter(function(o){for(var s in t)if(o.getAttribute(s)===t[s])return!0;return!1}),n)return n[0]}function Ur(e,i){typeof(e.ownerDocument||e).createTreeWalker<"u"?Qo(e,i,NodeFilter.SHOW_TEXT):ea(e,function(t){t&&t.nodeType===3&&i(t)},!0)}function Qo(e,i,t){var r=document.createTreeWalker(e,t,null,!1);let n;for(;n=r.nextNode();)i(n)}function ea(e,i){if(i(e))return!0;if(e=e.firstChild,e)do{if(ea(e,i))return!0;e=e.nextSibling}while(e)}function el(e){return new Promise(function(i,t){var r=new FileReader;r.readAsDataURL(e),r.onloadend=function(){i(r.result)}})}function Fe(){this.resolve=null,this.reject=null,this.id=Lr(),this.promise=new Promise((e,i)=>{this.resolve=e,this.reject=i}),Object.freeze(this)}function Wr(e,i,t){var r;if(typeof e.querySelector<"u"&&(r=e.querySelector(`${i}[*|type="${t}"]`)),!r||r.length===0){r=Kt(e,i);for(var n=0;n<r.length;n++)if(r[n].getAttributeNS("http://www.idpf.org/2007/ops","type")===t||r[n].getAttribute("epub:type")===t)return r[n]}else return r}function ta(e){for(var i=[],t=e.childNodes,r=0;r<t.length;r++){let n=t[r];n.nodeType===1&&i.push(n)}return i}function ia(e){for(var i=[e];e;e=e.parentNode)i.unshift(e);return i}function Ci(e,i,t){for(var r=[],n=e.childNodes,a=0;a<n.length;a++){let o=n[a];if(o.nodeType===1&&o.nodeName.toLowerCase()===i){if(t)return o;r.push(o)}}if(!t)return r}function _c(e,i){let t;if(!(e===null||i===""))for(t=e.parentNode;t.nodeType===1;){if(t.tagName.toLowerCase()===i)return t;t=t.parentNode}}var tl,jr,il,rl,ra,na,Ye=_e((()=>{tl=Vo(),jr=typeof window<"u"?window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame:!1,il=1,rl=3,ra=typeof URL<"u"?URL:typeof window<"u"?window.URL||window.webkitURL||window.mozURL:void 0,na=class{constructor(){this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}setStart(e,i){this.startContainer=e,this.startOffset=i,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()}setEnd(e,i){this.endContainer=e,this.endOffset=i,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()}collapse(e){this.collapsed=!0,e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset,this.commonAncestorContainer=this.startContainer.parentNode):(this.startContainer=this.endContainer,this.startOffset=this.endOffset,this.commonAncestorContainer=this.endOffset.parentNode)}selectNode(e){let i=e.parentNode,t=Array.prototype.indexOf.call(i.childNodes,e);this.setStart(i,t),this.setEnd(i,t+1)}selectNodeContents(e){e.childNodes[e.childNodes-1];let i=e.nodeType===3?e.textContent.length:parent.childNodes.length;this.setStart(e,0),this.setEnd(e,i)}_commonAncestorContainer(e,i){var t=ia(e||this.startContainer),r=ia(i||this.endContainer);if(t[0]==r[0]){for(var n=0;n<t.length;n++)if(t[n]!=r[n])return t[n-1]}}_checkCollapsed(){this.startContainer===this.endContainer&&this.startOffset===this.endOffset?this.collapsed=!0:this.collapsed=!1}toString(){}}})),Hr=Ae(((e,i)=>{if(!t)var t={cwd:function(){return"/"}};function r(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+s)}function n(s,l){for(var h="",d=-1,f=0,v,p=0;p<=s.length;++p){if(p<s.length)v=s.charCodeAt(p);else{if(v===47)break;v=47}if(v===47){if(!(d===p-1||f===1))if(d!==p-1&&f===2){if(h.length<2||h.charCodeAt(h.length-1)!==46||h.charCodeAt(h.length-2)!==46){if(h.length>2){for(var y=h.length-1,k=y;k>=0&&h.charCodeAt(k)!==47;--k);if(k!==y){k===-1?h="":h=h.slice(0,k),d=p,f=0;continue}}else if(h.length===2||h.length===1){h="",d=p,f=0;continue}}l&&(h.length>0?h+="/..":h="..")}else h.length>0?h+="/"+s.slice(d+1,p):h=s.slice(d+1,p);d=p,f=0}else v===46&&f!==-1?++f:f=-1}return h}function a(s,l){var h=l.dir||l.root,d=l.base||(l.name||"")+(l.ext||"");return h?h===l.root?h+d:h+s+d:d}var o={resolve:function(){for(var l="",h=!1,d,f=arguments.length-1;f>=-1&&!h;f--){var v;f>=0?v=arguments[f]:(d===void 0&&(d=t.cwd()),v=d),r(v),v.length!==0&&(l=v+"/"+l,h=v.charCodeAt(0)===47)}return l=n(l,!h),h?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(l){if(r(l),l.length===0)return".";var h=l.charCodeAt(0)===47,d=l.charCodeAt(l.length-1)===47;return l=n(l,!h),l.length===0&&!h&&(l="."),l.length>0&&d&&(l+="/"),h?"/"+l:l},isAbsolute:function(l){return r(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,h=0;h<arguments.length;++h){var d=arguments[h];r(d),d.length>0&&(l===void 0?l=d:l+="/"+d)}return l===void 0?".":o.normalize(l)},relative:function(l,h){if(r(l),r(h),l===h||(l=o.resolve(l),h=o.resolve(h),l===h))return"";for(var d=1;d<l.length&&l.charCodeAt(d)===47;++d);for(var f=l.length,v=f-d,p=1;p<h.length&&h.charCodeAt(p)===47;++p);for(var y=h.length-p,k=v<y?v:y,u=-1,m=0;m<=k;++m){if(m===k){if(y>k){if(h.charCodeAt(p+m)===47)return h.slice(p+m+1);if(m===0)return h.slice(p+m)}else v>k&&(l.charCodeAt(d+m)===47?u=m:m===0&&(u=0));break}var g=l.charCodeAt(d+m);if(g!==h.charCodeAt(p+m))break;g===47&&(u=m)}var E="";for(m=d+u+1;m<=f;++m)(m===f||l.charCodeAt(m)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+h.slice(p+u):(p+=u,h.charCodeAt(p)===47&&++p,h.slice(p))},_makeLong:function(l){return l},dirname:function(l){if(r(l),l.length===0)return".";for(var h=l.charCodeAt(0),d=h===47,f=-1,v=!0,p=l.length-1;p>=1;--p)if(h=l.charCodeAt(p),h===47){if(!v){f=p;break}}else v=!1;return f===-1?d?"/":".":d&&f===1?"//":l.slice(0,f)},basename:function(l,h){if(h!==void 0&&typeof h!="string")throw new TypeError('"ext" argument must be a string');r(l);var d=0,f=-1,v=!0,p;if(h!==void 0&&h.length>0&&h.length<=l.length){if(h.length===l.length&&h===l)return"";var y=h.length-1,k=-1;for(p=l.length-1;p>=0;--p){var u=l.charCodeAt(p);if(u===47){if(!v){d=p+1;break}}else k===-1&&(v=!1,k=p+1),y>=0&&(u===h.charCodeAt(y)?--y===-1&&(f=p):(y=-1,f=k))}return d===f?f=k:f===-1&&(f=l.length),l.slice(d,f)}else{for(p=l.length-1;p>=0;--p)if(l.charCodeAt(p)===47){if(!v){d=p+1;break}}else f===-1&&(v=!1,f=p+1);return f===-1?"":l.slice(d,f)}},extname:function(l){r(l);for(var h=-1,d=0,f=-1,v=!0,p=0,y=l.length-1;y>=0;--y){var k=l.charCodeAt(y);if(k===47){if(!v){d=y+1;break}continue}f===-1&&(v=!1,f=y+1),k===46?h===-1?h=y:p!==1&&(p=1):h!==-1&&(p=-1)}return h===-1||f===-1||p===0||p===1&&h===f-1&&h===d+1?"":l.slice(h,f)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('Parameter "pathObject" must be an object, not '+typeof l);return a("/",l)},parse:function(l){r(l);var h={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return h;var d=l.charCodeAt(0),f=d===47,v;f?(h.root="/",v=1):v=0;for(var p=-1,y=0,k=-1,u=!0,m=l.length-1,g=0;m>=v;--m){if(d=l.charCodeAt(m),d===47){if(!u){y=m+1;break}continue}k===-1&&(u=!1,k=m+1),d===46?p===-1?p=m:g!==1&&(g=1):p!==-1&&(g=-1)}return p===-1||k===-1||g===0||g===1&&p===k-1&&p===y+1?k!==-1&&(y===0&&f?h.base=h.name=l.slice(1,k):h.base=h.name=l.slice(y,k)):(y===0&&f?(h.name=l.slice(1,p),h.base=l.slice(1,k)):(h.name=l.slice(y,p),h.base=l.slice(y,k)),h.ext=l.slice(p,k)),y>0?h.dir=l.slice(0,y-1):f&&(h.dir="/"),h},sep:"/",delimiter:":",posix:null};i.exports=o})),Qi,Vt,ci=_e((()=>{Qi=lt(Hr()),Vt=class{constructor(e){var i,t;i=e.indexOf("://"),i>-1&&(e=new URL(e).pathname),t=this.parse(e),this.path=e,this.isDirectory(e)?this.directory=e:this.directory=t.dir+"/",this.filename=t.base,this.extension=t.ext.slice(1)}parse(e){return Qi.default.parse(e)}isAbsolute(e){return Qi.default.isAbsolute(e||this.path)}isDirectory(e){return e.charAt(e.length-1)==="/"}resolve(e){return Qi.default.resolve(this.directory,e)}relative(e){return e&&e.indexOf("://")>-1?e:Qi.default.relative(this.directory,e)}splitPath(e){return this.splitPathRe.exec(e).slice(1)}toString(){return this.path}}})),aa,Ct,Zr=_e((()=>{ci(),aa=lt(Hr()),Ct=class{constructor(e,i){var t=e.indexOf("://")>-1,r=e,n;if(this.Url=void 0,this.href=e,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=i,!t&&i!==!1&&typeof i!="string"&&window&&window.location&&(this.base=window.location.href),t||this.base)try{this.base?this.Url=new URL(e,this.base):this.Url=new URL(e),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,r=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch{this.Url=void 0,this.base&&(n=new Vt(this.base),r=n.resolve(r))}this.Path=new Vt(r),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(e){var i=e.indexOf("://")>-1,t;return i?e:(t=aa.default.resolve(this.directory,e),this.origin+t)}relative(e){return aa.default.relative(e,this.directory)}toString(){return this.href}}})),fi,Et,nl,Ze,At=_e((()=>{Ye(),fi=1,Et=3,nl=9,Ze=class qi{constructor(i,t,r){var n;if(this.str="",this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof qi))return new qi(i,t,r);if(typeof t=="string"?this.base=this.parseComponent(t):typeof t=="object"&&t.steps&&(this.base=t),n=this.checkType(i),n==="string")return this.str=i,ut(this,this.parse(i));if(n==="range")return ut(this,this.fromRange(i,this.base,r));if(n==="node")return ut(this,this.fromNode(i,this.base,r));if(n==="EpubCFI"&&i.path)return i;if(i)throw new TypeError("not a valid argument for EpubCFI");return this}checkType(i){return this.isCfiString(i)?"string":i&&typeof i=="object"&&(Jo(i)==="Range"||typeof i.startContainer<"u")?"range":i&&typeof i=="object"&&typeof i.nodeType<"u"?"node":i&&typeof i=="object"&&i instanceof qi?"EpubCFI":!1}parse(i){var t={spinePos:-1,range:!1,base:{},path:{},start:null,end:null},r,n,a;return typeof i!="string"?{spinePos:-1}:(i.indexOf("epubcfi(")===0&&i[i.length-1]===")"&&(i=i.slice(8,i.length-1)),r=this.getChapterComponent(i),r?(t.base=this.parseComponent(r),n=this.getPathComponent(i),t.path=this.parseComponent(n),a=this.getRange(i),a&&(t.range=!0,t.start=this.parseComponent(a[0]),t.end=this.parseComponent(a[1])),t.spinePos=t.base.steps[1].index,t):{spinePos:-1})}parseComponent(i){var t={steps:[],terminal:{offset:null,assertion:null}},r=i.split(":"),n=r[0].split("/"),a;return r.length>1&&(a=r[1],t.terminal=this.parseTerminal(a)),n[0]===""&&n.shift(),t.steps=n.map(function(o){return this.parseStep(o)}.bind(this)),t}parseStep(i){var t,r,n,a=i.match(/\[(.*)\]/),o;if(a&&a[1]&&(o=a[1]),r=parseInt(i),!isNaN(r))return r%2===0?(t="element",n=r/2-1):(t="text",n=(r-1)/2),{type:t,index:n,id:o||null}}parseTerminal(i){var t,r,n=i.match(/\[(.*)\]/);return n&&n[1]?(t=parseInt(i.split("[")[0]),r=n[1]):t=parseInt(i),tt(t)||(t=null),{offset:t,assertion:r}}getChapterComponent(i){return i.split("!")[0]}getPathComponent(i){var t=i.split("!");if(t[1])return t[1].split(",")[0]}getRange(i){var t=i.split(",");return t.length===3?[t[1],t[2]]:!1}getCharecterOffsetComponent(i){return i.split(":")[1]||""}joinSteps(i){return i?i.map(function(t){var r="";return t.type==="element"&&(r+=(t.index+1)*2),t.type==="text"&&(r+=1+2*t.index),t.id&&(r+="["+t.id+"]"),r}).join("/"):""}segmentString(i){var t="/";return t+=this.joinSteps(i.steps),i.terminal&&i.terminal.offset!=null&&(t+=":"+i.terminal.offset),i.terminal&&i.terminal.assertion!=null&&(t+="["+i.terminal.assertion+"]"),t}toString(){var i="epubcfi(";return i+=this.segmentString(this.base),i+="!",i+=this.segmentString(this.path),this.range&&this.start&&(i+=",",i+=this.segmentString(this.start)),this.range&&this.end&&(i+=",",i+=this.segmentString(this.end)),i+=")",i}compare(i,t){var r,n,a,o;if(typeof i=="string"&&(i=new qi(i)),typeof t=="string"&&(t=new qi(t)),i.spinePos>t.spinePos)return 1;if(i.spinePos<t.spinePos)return-1;i.range?(r=i.path.steps.concat(i.start.steps),a=i.start.terminal):(r=i.path.steps,a=i.path.terminal),t.range?(n=t.path.steps.concat(t.start.steps),o=t.start.terminal):(n=t.path.steps,o=t.path.terminal);for(var s=0;s<r.length;s++){if(!r[s])return-1;if(!n[s]||r[s].index>n[s].index)return 1;if(r[s].index<n[s].index)return-1}return r.length<n.length?-1:a.offset>o.offset?1:a.offset<o.offset?-1:0}step(i){var t=i.nodeType===Et?"text":"element";return{id:i.id,tagName:i.tagName,type:t,index:this.position(i)}}filteredStep(i,t){var r=this.filter(i,t),n;if(r)return n=r.nodeType===Et?"text":"element",{id:r.id,tagName:r.tagName,type:n,index:this.filteredPosition(r,t)}}pathTo(i,t,r){for(var n={steps:[],terminal:{offset:null,assertion:null}},a=i,o;a&&a.parentNode&&a.parentNode.nodeType!=nl;)r?o=this.filteredStep(a,r):o=this.step(a),o&&n.steps.unshift(o),a=a.parentNode;return t!=null&&t>=0&&(n.terminal.offset=t,n.steps[n.steps.length-1].type!="text"&&n.steps.push({type:"text",index:0})),n}equalStep(i,t){return!i||!t?!1:i.index===t.index&&i.id===t.id&&i.type===t.type}fromRange(i,t,r){var n={range:!1,base:{},path:{},start:null,end:null},a=i.startContainer,o=i.endContainer,s=i.startOffset,l=i.endOffset,h=!1;if(r&&(h=a.ownerDocument.querySelector("."+r)!=null),typeof t=="string"?(n.base=this.parseComponent(t),n.spinePos=n.base.steps[1].index):typeof t=="object"&&(n.base=t),i.collapsed)h&&(s=this.patchOffset(a,s,r)),n.path=this.pathTo(a,s,r);else{n.range=!0,h&&(s=this.patchOffset(a,s,r)),n.start=this.pathTo(a,s,r),h&&(l=this.patchOffset(o,l,r)),n.end=this.pathTo(o,l,r),n.path={steps:[],terminal:null};var d=n.start.steps.length,f;for(f=0;f<d&&this.equalStep(n.start.steps[f],n.end.steps[f]);f++)f===d-1?n.start.terminal===n.end.terminal&&(n.path.steps.push(n.start.steps[f]),n.range=!1):n.path.steps.push(n.start.steps[f]);n.start.steps=n.start.steps.slice(n.path.steps.length),n.end.steps=n.end.steps.slice(n.path.steps.length)}return n}fromNode(i,t,r){var n={range:!1,base:{},path:{},start:null,end:null};return typeof t=="string"?(n.base=this.parseComponent(t),n.spinePos=n.base.steps[1].index):typeof t=="object"&&(n.base=t),n.path=this.pathTo(i,null,r),n}filter(i,t){var r,n,a,o,s,l=!1;return i.nodeType===Et?(l=!0,a=i.parentNode,r=i.parentNode.classList.contains(t)):(l=!1,r=i.classList.contains(t)),r&&l?(o=a.previousSibling,s=a.nextSibling,o&&o.nodeType===Et?n=o:s&&s.nodeType===Et&&(n=s),n||i):r&&!l?!1:i}patchOffset(i,t,r){if(i.nodeType!=Et)throw new Error("Anchor must be a text node");var n=i,a=t;for(i.parentNode.classList.contains(r)&&(n=i.parentNode);n.previousSibling;){if(n.previousSibling.nodeType===fi)if(n.previousSibling.classList.contains(r))a+=n.previousSibling.textContent.length;else break;else a+=n.previousSibling.textContent.length;n=n.previousSibling}return a}normalizedMap(i,t,r){var n={},a=-1,o,s=i.length,l,h;for(o=0;o<s;o++)l=i[o].nodeType,l===fi&&i[o].classList.contains(r)&&(l=Et),o>0&&l===Et&&h===Et?n[o]=a:t===l&&(a=a+1,n[o]=a),h=l;return n}position(i){var t,r;return i.nodeType===fi?(t=i.parentNode.children,t||(t=ta(i.parentNode)),r=Array.prototype.indexOf.call(t,i)):(t=this.textNodes(i.parentNode),r=t.indexOf(i)),r}filteredPosition(i,t){var r,n,a;return i.nodeType===fi?(r=i.parentNode.children,a=this.normalizedMap(r,fi,t)):(r=i.parentNode.childNodes,i.parentNode.classList.contains(t)&&(i=i.parentNode,r=i.parentNode.childNodes),a=this.normalizedMap(r,Et,t)),n=Array.prototype.indexOf.call(r,i),a[n]}stepsToXpath(i){var t=[".","*"];return i.forEach(function(r){var n=r.index+1;r.id?t.push("*[position()="+n+" and @id='"+r.id+"']"):r.type==="text"?t.push("text()["+n+"]"):t.push("*["+n+"]")}),t.join("/")}stepsToQuerySelector(i){var t=["html"];return i.forEach(function(r){var n=r.index+1;r.id?t.push("#"+r.id):r.type==="text"||t.push("*:nth-child("+n+")")}),t.join(">")}textNodes(i,t){return Array.prototype.slice.call(i.childNodes).filter(function(r){return r.nodeType===Et?!0:!!(t&&r.classList.contains(t))})}walkToNode(i,t,r){var n=t||document,a=n.documentElement,o,s,l=i.length,h;for(h=0;h<l&&(s=i[h],s.type==="element"?s.id?a=n.getElementById(s.id):(o=a.children||ta(a),a=o[s.index]):s.type==="text"&&(a=this.textNodes(a,r)[s.index]),!!a);h++);return a}findNode(i,t,r){var n=t||document,a,o;return!r&&typeof n.evaluate<"u"?(o=this.stepsToXpath(i),a=n.evaluate(o,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue):r?a=this.walkToNode(i,n,r):a=this.walkToNode(i,n),a}fixMiss(i,t,r,n){var a=this.findNode(i.slice(0,-1),r,n),o=a.childNodes,s=this.normalizedMap(o,Et,n),l,h,d=i[i.length-1].index;for(let f in s){if(!s.hasOwnProperty(f))return;if(s[f]===d)if(l=o[f],h=l.textContent.length,t>h)t=t-h;else{l.nodeType===fi?a=l.childNodes[0]:a=l;break}}return{container:a,offset:t}}toRange(i,t){var r=i||document,n,a,o,s,l,h=this,d,f,v=t?r.querySelector("."+t)!=null:!1,p;if(typeof r.createRange<"u"?n=r.createRange():n=new na,h.range?(a=h.start,d=h.path.steps.concat(a.steps),s=this.findNode(d,r,v?t:null),o=h.end,f=h.path.steps.concat(o.steps),l=this.findNode(f,r,v?t:null)):(a=h.path,d=h.path.steps,s=this.findNode(h.path.steps,r,v?t:null)),s)try{a.terminal.offset!=null?n.setStart(s,a.terminal.offset):n.setStart(s,0)}catch{p=this.fixMiss(d,a.terminal.offset,r,v?t:null),n.setStart(p.container,p.offset)}else return console.log("No startContainer found for",this.toString()),null;if(l)try{o.terminal.offset!=null?n.setEnd(l,o.terminal.offset):n.setEnd(l,0)}catch{p=this.fixMiss(f,h.end.terminal.offset,r,v?t:null),n.setEnd(p.container,p.offset)}return n}isCfiString(i){return typeof i=="string"&&i.indexOf("epubcfi(")===0&&i[i.length-1]===")"}generateChapterComponent(i,t,r){var n=parseInt(t),a="/"+(i+1)*2+"/";return a+=(n+1)*2,r&&(a+="["+r+"]"),a}collapse(i){this.range&&(this.range=!1,i?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))}}})),Rt,sa=_e((()=>{Rt=class{constructor(e){this.context=e||this,this.hooks=[]}register(){for(var e=0;e<arguments.length;++e)if(typeof arguments[e]=="function")this.hooks.push(arguments[e]);else for(var i=0;i<arguments[e].length;++i)this.hooks.push(arguments[e][i])}deregister(e){let i;for(let t=0;t<this.hooks.length;t++)if(i=this.hooks[t],i===e){this.hooks.splice(t,1);break}}trigger(){var e=arguments,i=this.context,t=[];return this.hooks.forEach(function(r){try{var n=r.apply(i,e)}catch(a){console.log(a)}n&&typeof n.then=="function"&&t.push(n)}),Promise.all(t)}list(){return this.hooks}clear(){return this.hooks=[]}}}));function al(e,i){var t,r,n=i.url,a=n.indexOf("://")>-1;e&&(r=Xe(e,"head"),t=Xe(r,"base"),t||(t=e.createElement("base"),r.insertBefore(t,r.firstChild)),!a&&window&&window.location&&(n=window.location.origin+n),t.setAttribute("href",n))}function wc(e,i){var t,r,n=i.canonical;e&&(t=Xe(e,"head"),r=Xe(t,"link[rel='canonical']"),r?r.setAttribute("href",n):(r=e.createElement("link"),r.setAttribute("rel","canonical"),r.setAttribute("href",n),t.appendChild(r)))}function yc(e,i){var t,r,n=i.idref;e&&(t=Xe(e,"head"),r=Xe(t,"link[property='dc.identifier']"),r?r.setAttribute("content",n):(r=e.createElement("meta"),r.setAttribute("name","dc.identifier"),r.setAttribute("content",n),t.appendChild(r)))}function xc(e,i){var t=e.querySelectorAll("a[href]");if(t.length)for(var r=Xe(e.ownerDocument,"base"),n=r?r.getAttribute("href"):void 0,a=function(s){var l=s.getAttribute("href");if(l.indexOf("mailto:")!==0)if(l.indexOf("://")>-1)s.setAttribute("target","_blank");else{var h;try{h=new Ct(l,n)}catch{}s.onclick=function(){return h&&h.hash?i(h.Path.path+h.hash):i(h?h.Path.path:l),!1}}}.bind(this),o=0;o<t.length;o++)a(t[o])}function sl(e,i,t){return i.forEach(function(r,n){r&&t[n]&&(r=r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),e=e.replace(new RegExp(r,"g"),t[n]))}),e}var Vr=_e((()=>{Ye(),Zr(),ci()}));function er(e,i,t,r){var n=typeof window<"u"?window.URL:!1,a=n?"blob":"arraybuffer",o=new Fe,s=new XMLHttpRequest,l=XMLHttpRequest.prototype,h;"overrideMimeType"in l||Object.defineProperty(l,"overrideMimeType",{value:function(){}}),t&&(s.withCredentials=!0),s.onreadystatechange=f,s.onerror=d,s.open("GET",e,!0);for(h in r)s.setRequestHeader(h,r[h]);i=="json"&&s.setRequestHeader("Accept","application/json"),i||(i=new Vt(e).extension),i=="blob"&&(s.responseType=a),Ji(i)&&s.overrideMimeType("text/xml"),i=="xhtml",i=="html"||i=="htm",i=="binary"&&(s.responseType="arraybuffer"),s.send();function d(v){o.reject(v)}function f(){if(this.readyState===XMLHttpRequest.DONE){var v=!1;if((this.responseType===""||this.responseType==="document")&&(v=this.responseXML),this.status===200||this.status===0||v){var p;if(!this.response&&!v)return o.reject({status:this.status,message:"Empty Response",stack:new Error().stack}),o.promise;if(this.status===403)return o.reject({status:this.status,response:this.response,message:"Forbidden",stack:new Error().stack}),o.promise;v?p=this.responseXML:Ji(i)?p=Zt(this.response,"text/xml"):i=="xhtml"?p=Zt(this.response,"application/xhtml+xml"):i=="html"||i=="htm"?p=Zt(this.response,"text/html"):i=="json"?p=JSON.parse(this.response):i=="blob"?n?p=this.response:p=new Blob([this.response]):p=this.response,o.resolve(p)}else o.reject({status:this.status,message:this.response,stack:new Error().stack})}}return o.promise}var Gr=_e((()=>{Ye(),ci()})),ol,ll,Ec=_e((()=>{Ye(),At(),sa(),Vr(),Gr(),ol=Vo(),ll=class{constructor(e,i){this.idref=e.idref,this.linear=e.linear==="yes",this.properties=e.properties,this.index=e.index,this.href=e.href,this.url=e.url,this.canonical=e.canonical,this.next=e.next,this.prev=e.prev,this.cfiBase=e.cfiBase,i?this.hooks=i:(this.hooks={},this.hooks.serialize=new Rt(this),this.hooks.content=new Rt(this)),this.document=void 0,this.contents=void 0,this.output=void 0}load(e){var i=e||this.request||er,t=new Fe,r=t.promise;return this.contents?t.resolve(this.contents):i(this.url).then(function(n){return this.document=n,this.contents=n.documentElement,this.hooks.content.trigger(this.document,this)}.bind(this)).then(function(){t.resolve(this.contents)}.bind(this)).catch(function(n){t.reject(n)}),r}base(){return al(this.document,this)}render(e){var i=new Fe,t=i.promise;return this.output,this.load(e).then(function(r){var n=(typeof navigator<"u"&&navigator.userAgent||"").indexOf("Trident")>=0,a;typeof XMLSerializer>"u"||n?a=ol.DOMParser:a=XMLSerializer;var o=new a;return this.output=o.serializeToString(r),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){i.resolve(this.output)}.bind(this)).catch(function(r){i.reject(r)}),t}find(e){var i=this,t=[],r=e.toLowerCase(),n=function(a){for(var o=a.textContent.toLowerCase(),s=i.document.createRange(),l,h,d=-1,f,v=150;h!=-1;)h=o.indexOf(r,d+1),h!=-1&&(s=i.document.createRange(),s.setStart(a,h),s.setEnd(a,h+r.length),l=i.cfiFromRange(s),a.textContent.length<v?f=a.textContent:(f=a.textContent.substring(h-v/2,h+v/2),f="..."+f+"..."),t.push({cfi:l,excerpt:f})),d=h};return Ur(i.document,function(a){n(a)}),t}search(e,i=5){if(typeof document.createTreeWalker>"u")return this.find(e);let t=[];const r=150,n=this,a=e.toLowerCase(),o=function(d){const f=d.reduce((v,p)=>v+p.textContent,"").toLowerCase().indexOf(a);if(f!=-1){const p=f+a.length;let y=0,k=0;if(f<d[0].length){let u;for(;y<d.length-1&&(k+=d[y].length,!(p<=k));)y+=1;let m=d[0],g=d[y],E=n.document.createRange();E.setStart(m,f);let x=d.slice(0,y).reduce((I,A)=>I+A.textContent.length,0);E.setEnd(g,x>p?p:p-x),u=n.cfiFromRange(E);let _=d.slice(0,y+1).reduce((I,A)=>I+A.textContent,"");_.length>r&&(_=_.substring(f-r/2,f+r/2),_="..."+_+"..."),t.push({cfi:u,excerpt:_})}}},s=document.createTreeWalker(n.document,NodeFilter.SHOW_TEXT,null,!1);let l,h=[];for(;l=s.nextNode();)h.push(l),h.length==i&&(o(h.slice(0,i)),h=h.slice(1,i));return h.length>0&&o(h),t}reconcileLayoutSettings(e){var i={layout:e.layout,spread:e.spread,orientation:e.orientation};return this.properties.forEach(function(t){var r=t.replace("rendition:",""),n=r.indexOf("-"),a,o;n!=-1&&(a=r.slice(0,n),o=r.slice(n+1),i[a]=o)}),i}cfiFromRange(e){return new Ze(e,this.cfiBase).toString()}cfiFromElement(e){return new Ze(e,this.cfiBase).toString()}unload(){this.document=void 0,this.contents=void 0,this.output=void 0}destroy(){this.unload(),this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.idref=void 0,this.linear=void 0,this.properties=void 0,this.index=void 0,this.href=void 0,this.url=void 0,this.next=void 0,this.prev=void 0,this.cfiBase=void 0}}})),hl,kc=_e((()=>{At(),sa(),Ec(),Vr(),hl=class{constructor(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new Rt,this.hooks.content=new Rt,this.hooks.content.register(al),this.hooks.content.register(wc),this.hooks.content.register(yc),this.epubcfi=new Ze,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}unpack(e,i,t){this.items=e.spine,this.manifest=e.manifest,this.spineNodeIndex=e.spineNodeIndex,this.baseUrl=e.baseUrl||e.basePath||"",this.length=this.items.length,this.items.forEach((r,n)=>{var a=this.manifest[r.idref],o;r.index=n,r.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,r.index,r.id),r.href&&(r.url=i(r.href,!0),r.canonical=t(r.href)),a&&(r.href=a.href,r.url=i(r.href,!0),r.canonical=t(r.href),a.properties.length&&r.properties.push.apply(r.properties,a.properties)),r.linear==="yes"?(r.prev=function(){let s=r.index;for(;s>0;){let l=this.get(s-1);if(l&&l.linear)return l;s-=1}}.bind(this),r.next=function(){let s=r.index;for(;s<this.spineItems.length-1;){let l=this.get(s+1);if(l&&l.linear)return l;s+=1}}.bind(this)):(r.prev=function(){},r.next=function(){}),o=new ll(r,this.hooks),this.append(o)}),this.loaded=!0}get(e){var i=0;if(typeof e>"u")for(;i<this.spineItems.length;){let t=this.spineItems[i];if(t&&t.linear)break;i+=1}else this.epubcfi.isCfiString(e)?i=new Ze(e).spinePos:typeof e=="number"||isNaN(e)===!1?i=e:typeof e=="string"&&e.indexOf("#")===0?i=this.spineById[e.substring(1)]:typeof e=="string"&&(e=e.split("#")[0],i=this.spineByHref[e]||this.spineByHref[encodeURI(e)]);return this.spineItems[i]||null}append(e){var i=this.spineItems.length;return e.index=i,this.spineItems.push(e),this.spineByHref[decodeURI(e.href)]=i,this.spineByHref[encodeURI(e.href)]=i,this.spineByHref[e.href]=i,this.spineById[e.idref]=i,i}prepend(e){return this.spineByHref[e.href]=0,this.spineById[e.idref]=0,this.spineItems.forEach(function(i,t){i.index=t}),0}remove(e){var i=this.spineItems.indexOf(e);if(i>-1)return delete this.spineByHref[e.href],delete this.spineById[e.idref],this.spineItems.splice(i,1)}each(){return this.spineItems.forEach.apply(this.spineItems,arguments)}first(){let e=0;do{let i=this.get(e);if(i&&i.linear)return i;e+=1}while(e<this.spineItems.length)}last(){let e=this.spineItems.length-1;do{let i=this.get(e);if(i&&i.linear)return i;e-=1}while(e>=0)}destroy(){this.each(e=>e.destroy()),this.spineItems=void 0,this.spineByHref=void 0,this.spineById=void 0,this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.epubcfi=void 0,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}}})),Xr,oa=_e((()=>{Ye(),Xr=class{constructor(e){this._q=[],this.context=e,this.tick=jr,this.running=!1,this.paused=!1}enqueue(){var e,i,t,r=[].shift.call(arguments),n=arguments;if(!r)throw new Error("No Task Provided");return typeof r=="function"?(e=new Fe,i=e.promise,t={task:r,args:n,deferred:e,promise:i}):t={promise:r},this._q.push(t),this.paused==!1&&!this.running&&this.run(),t.promise}dequeue(){var e,i,t;if(this._q.length&&!this.paused){if(e=this._q.shift(),i=e.task,i)return t=i.apply(this.context,e.args),t&&typeof t.then=="function"?t.then(function(){e.deferred.resolve.apply(this.context,arguments)}.bind(this),function(){e.deferred.reject.apply(this.context,arguments)}.bind(this)):(e.deferred.resolve.apply(this.context,t),e.promise);if(e.promise)return e.promise}else return e=new Fe,e.deferred.resolve(),e.promise}dump(){for(;this._q.length;)this.dequeue()}run(){return this.running||(this.running=!0,this.defered=new Fe),this.tick.call(window,()=>{this._q.length?this.dequeue().then(function(){this.run()}.bind(this)):(this.defered.resolve(),this.running=void 0)}),this.paused==!0&&(this.paused=!1),this.defered.promise}flush(){if(this.running)return this.running;if(this._q.length)return this.running=this.dequeue().then(function(){return this.running=void 0,this.flush()}.bind(this)),this.running}clear(){this._q=[]}length(){return this._q.length}pause(){this.paused=!0}stop(){this._q=[],this.running=!1,this.paused=!0}}})),tr,me,zt=_e((()=>{tr=["keydown","keyup","keypressed","mouseup","mousedown","mousemove","click","touchend","touchstart","touchmove"],me={BOOK:{OPEN_FAILED:"openFailed"},CONTENTS:{EXPAND:"expand",RESIZE:"resize",SELECTED:"selected",SELECTED_RANGE:"selectedRange",LINK_CLICKED:"linkClicked"},LOCATIONS:{CHANGED:"changed"},MANAGERS:{RESIZE:"resize",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",ADDED:"added",SCROLL:"scroll",SCROLLED:"scrolled",REMOVED:"removed"},VIEWS:{AXIS:"axis",WRITING_MODE:"writingMode",LOAD_ERROR:"loaderror",RENDERED:"rendered",RESIZED:"resized",DISPLAYED:"displayed",SHOWN:"shown",HIDDEN:"hidden",MARK_CLICKED:"markClicked"},RENDITION:{STARTED:"started",ATTACHED:"attached",DISPLAYED:"displayed",DISPLAY_ERROR:"displayerror",RENDERED:"rendered",REMOVED:"removed",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",LOCATION_CHANGED:"locationChanged",RELOCATED:"relocated",MARK_CLICKED:"markClicked",SELECTED:"selected",LAYOUT:"layout"},LAYOUT:{UPDATED:"updated"},ANNOTATION:{ATTACH:"attach",DETACH:"detach"}}})),dl,la,Sc=_e((()=>{Ye(),oa(),At(),zt(),dl=lt(Ht()),la=class{constructor(e,i,t){this.spine=e,this.request=i,this.pause=t||100,this.q=new Xr(this),this.epubcfi=new Ze,this._locations=[],this._locationsWords=[],this.total=0,this.break=150,this._current=0,this._wordCounter=0,this.currentLocation="",this._currentCfi="",this.processingTimeout=void 0}generate(e){return e&&(this.break=e),this.q.pause(),this.spine.each(function(i){i.linear&&this.q.enqueue(this.process.bind(this),i)}.bind(this)),this.q.run().then(function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}.bind(this))}createRange(){return{startContainer:void 0,startOffset:void 0,endContainer:void 0,endOffset:void 0}}process(e){return e.load(this.request).then(function(i){var t=new Fe,r=this.parse(i,e.cfiBase);return this._locations=this._locations.concat(r),e.unload(),this.processingTimeout=setTimeout(()=>t.resolve(r),this.pause),t.promise}.bind(this))}parse(e,i,t){var r=[],n,a=e.ownerDocument,o=Xe(a,"body"),s=0,l,h=t||this.break,d=function(f){var v=f.length,p,y=0;if(f.textContent.trim().length===0)return!1;for(s==0&&(n=this.createRange(),n.startContainer=f,n.startOffset=0),p=h-s,p>v&&(s+=v,y=v);y<v;)if(p=h-s,s===0&&(y+=1,n=this.createRange(),n.startContainer=f,n.startOffset=y),y+p>=v)s+=v-y,y=v;else{y+=p,n.endContainer=f,n.endOffset=y;let k=new Ze(n,i).toString();r.push(k),s=0}l=f};if(Ur(o,d.bind(this)),n&&n.startContainer&&l){n.endContainer=l,n.endOffset=l.length;let f=new Ze(n,i).toString();r.push(f),s=0}return r}generateFromWords(e,i,t){var r=e?new Ze(e):void 0;return this.q.pause(),this._locationsWords=[],this._wordCounter=0,this.spine.each(function(n){n.linear&&(r?n.index>=r.spinePos&&this.q.enqueue(this.processWords.bind(this),n,i,r,t):this.q.enqueue(this.processWords.bind(this),n,i,r,t))}.bind(this)),this.q.run().then(function(){return this._currentCfi&&(this.currentLocation=this._currentCfi),this._locationsWords}.bind(this))}processWords(e,i,t,r){return r&&this._locationsWords.length>=r?Promise.resolve():e.load(this.request).then(function(n){var a=new Fe,o=this.parseWords(n,e,i,t),s=r-this._locationsWords.length;return this._locationsWords=this._locationsWords.concat(o.length>=r?o.slice(0,s):o),e.unload(),this.processingTimeout=setTimeout(()=>a.resolve(o),this.pause),a.promise}.bind(this))}countWords(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,`
|
|
14
|
+
`),e.split(" ").length}parseWords(e,i,t,r){var n=i.cfiBase,a=[],o=e.ownerDocument,s=Xe(o,"body"),l=t,h=r?r.spinePos!==i.index:!0,d;r&&i.index===r.spinePos&&(d=r.findNode(r.range?r.path.steps.concat(r.start.steps):r.path.steps,e.ownerDocument));var f=function(v){if(!h)if(v===d)h=!0;else return!1;if(v.textContent.length<10&&v.textContent.trim().length===0)return!1;var p=this.countWords(v.textContent),y,k=0;if(p===0)return!1;for(y=l-this._wordCounter,y>p&&(this._wordCounter+=p,k=p);k<p;)if(y=l-this._wordCounter,k+y>=p)this._wordCounter+=p-k,k=p;else{k+=y;let u=new Ze(v,n);a.push({cfi:u.toString(),wordCount:this._wordCounter}),this._wordCounter=0}};return Ur(s,f.bind(this)),a}locationFromCfi(e){let i;return Ze.prototype.isCfiString(e)&&(e=new Ze(e)),this._locations.length===0?-1:(i=Si(e,this._locations,this.epubcfi.compare),i>this.total?this.total:i)}percentageFromCfi(e){if(this._locations.length===0)return null;var i=this.locationFromCfi(e);return this.percentageFromLocation(i)}percentageFromLocation(e){return!e||!this.total?0:e/this.total}cfiFromLocation(e){var i=-1;return typeof e!="number"&&(e=parseInt(e)),e>=0&&e<this._locations.length&&(i=this._locations[e]),i}cfiFromPercentage(e){let i;if(e>1&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),e>=1){let t=new Ze(this._locations[this.total]);return t.collapse(),t.toString()}return i=Math.ceil(this.total*e),this.cfiFromLocation(i)}load(e){return typeof e=="string"?this._locations=JSON.parse(e):this._locations=e,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(e){var i;if(typeof e=="string")this._currentCfi=e;else if(typeof e=="number")this._current=e;else return;this._locations.length!==0&&(typeof e=="string"?(i=this.locationFromCfi(e),this._current=i):i=e,this.emit(me.LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(i)}))}get currentLocation(){return this._current}set currentLocation(e){this.setCurrent(e)}length(){return this._locations.length}destroy(){this.spine=void 0,this.request=void 0,this.pause=void 0,this.q.stop(),this.q=void 0,this.epubcfi=void 0,this._locations=void 0,this.total=void 0,this.break=void 0,this._current=void 0,this.currentLocation=void 0,this._currentCfi=void 0,clearTimeout(this.processingTimeout)}},(0,dl.default)(la.prototype)})),ul,cl,Tc=_e((()=>{ul=lt(Hr()),Ye(),cl=class{constructor(e){this.packagePath="",this.directory="",this.encoding="",e&&this.parse(e)}parse(e){var i;if(!e)throw new Error("Container File Not Found");if(i=Xe(e,"rootfile"),!i)throw new Error("No RootFile Found");this.packagePath=i.getAttribute("full-path"),this.directory=ul.default.dirname(this.packagePath),this.encoding=e.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}}})),ha,Cc=_e((()=>{Ye(),ha=class{constructor(e){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},e&&this.parse(e)}parse(e){var i,t,r;if(!e)throw new Error("Package File Not Found");if(i=Xe(e,"metadata"),!i)throw new Error("No Metadata Found");if(t=Xe(e,"manifest"),!t)throw new Error("No Manifest Found");if(r=Xe(e,"spine"),!r)throw new Error("No Spine Found");return this.manifest=this.parseManifest(t),this.navPath=this.findNavPath(t),this.ncxPath=this.findNcxPath(t,r),this.coverPath=this.findCoverPath(e),this.spineNodeIndex=$o(r),this.spine=this.parseSpine(r,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(e),this.metadata=this.parseMetadata(i),this.metadata.direction=r.getAttribute("page-progression-direction"),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}}parseMetadata(e){var i={};return i.title=this.getElementText(e,"title"),i.creator=this.getElementText(e,"creator"),i.description=this.getElementText(e,"description"),i.pubdate=this.getElementText(e,"date"),i.publisher=this.getElementText(e,"publisher"),i.identifier=this.getElementText(e,"identifier"),i.language=this.getElementText(e,"language"),i.rights=this.getElementText(e,"rights"),i.modified_date=this.getPropertyText(e,"dcterms:modified"),i.layout=this.getPropertyText(e,"rendition:layout"),i.orientation=this.getPropertyText(e,"rendition:orientation"),i.flow=this.getPropertyText(e,"rendition:flow"),i.viewport=this.getPropertyText(e,"rendition:viewport"),i.media_active_class=this.getPropertyText(e,"media:active-class"),i.spread=this.getPropertyText(e,"rendition:spread"),i}parseManifest(e){var i={},t=Kt(e,"item");return Array.prototype.slice.call(t).forEach(function(r){var n=r.getAttribute("id"),a=r.getAttribute("href")||"",o=r.getAttribute("media-type")||"",s=r.getAttribute("media-overlay")||"",l=r.getAttribute("properties")||"";i[n]={href:a,type:o,overlay:s,properties:l.length?l.split(" "):[]}}),i}parseSpine(e,i){var t=[],r=Kt(e,"itemref");return Array.prototype.slice.call(r).forEach(function(n,a){var o=n.getAttribute("idref"),s=n.getAttribute("properties")||"",l=s.length?s.split(" "):[],h={id:n.getAttribute("id"),idref:o,linear:n.getAttribute("linear")||"yes",properties:l,index:a};t.push(h)}),t}findUniqueIdentifier(e){var i=e.documentElement.getAttribute("unique-identifier");if(!i)return"";var t=e.getElementById(i);return t&&t.localName==="identifier"&&t.namespaceURI==="http://purl.org/dc/elements/1.1/"&&t.childNodes.length>0?t.childNodes[0].nodeValue.trim():""}findNavPath(e){var i=Ti(e,"item",{properties:"nav"});return i?i.getAttribute("href"):!1}findNcxPath(e,i){var t=Ti(e,"item",{"media-type":"application/x-dtbncx+xml"}),r;return t||(r=i.getAttribute("toc"),r&&(t=e.querySelector(`#${r}`))),t?t.getAttribute("href"):!1}findCoverPath(e){Xe(e,"package").getAttribute("version");var i=Ti(e,"item",{properties:"cover-image"});if(i)return i.getAttribute("href");var t=Ti(e,"meta",{name:"cover"});if(t){var r=t.getAttribute("content"),n=e.getElementById(r);return n?n.getAttribute("href"):""}else return!1}getElementText(e,i){var t=e.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/",i),r;return!t||t.length===0?"":(r=t[0],r.childNodes.length?r.childNodes[0].nodeValue:"")}getPropertyText(e,i){var t=Ti(e,"meta",{property:i});return t&&t.childNodes.length?t.childNodes[0].nodeValue:""}load(e){this.metadata=e.metadata;let i=e.readingOrder||e.spine;return this.spine=i.map((t,r)=>(t.index=r,t.linear=t.linear||"yes",t)),e.resources.forEach((t,r)=>{this.manifest[r]=t,t.rel&&t.rel[0]==="cover"&&(this.coverPath=t.href)}),this.spineNodeIndex=0,this.toc=e.toc.map((t,r)=>(t.label=t.title,t)),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex,toc:this.toc}}destroy(){this.manifest=void 0,this.navPath=void 0,this.ncxPath=void 0,this.coverPath=void 0,this.spineNodeIndex=void 0,this.spine=void 0,this.metadata=void 0}}})),qr,Ac=_e((()=>{Ye(),qr=class{constructor(e){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,e&&this.parse(e)}parse(e){let i=e.nodeType,t,r;i&&(t=Xe(e,"html"),r=Xe(e,"ncx")),i?t?(this.toc=this.parseNav(e),this.landmarks=this.parseLandmarks(e)):r&&(this.toc=this.parseNcx(e)):this.toc=this.load(e),this.length=0,this.unpack(this.toc)}unpack(e){for(var i,t=0;t<e.length;t++)i=e[t],i.href&&(this.tocByHref[i.href]=t),i.id&&(this.tocById[i.id]=t),this.length++,i.subitems.length&&this.unpack(i.subitems)}get(e){var i;return e?(e.indexOf("#")===0?i=this.tocById[e.substring(1)]:e in this.tocByHref&&(i=this.tocByHref[e]),this.getByIndex(e,i,this.toc)):this.toc}getByIndex(e,i,t){if(t.length===0)return;const r=t[i];if(r&&(e===r.id||e===r.href))return r;{let n;for(let a=0;a<t.length&&(n=this.getByIndex(e,i,t[a].subitems),!n);++a);return n}}landmark(e){var i;return e?(i=this.landmarksByType[e],this.landmarks[i]):this.landmarks}parseNav(e){var i=Wr(e,"nav","toc"),t=[];if(!i)return t;let r=Ci(i,"ol",!0);return r&&(t=this.parseNavList(r)),t}parseNavList(e,i){const t=[];if(!e||!e.children)return t;for(let r=0;r<e.children.length;r++){const n=this.navItem(e.children[r],i);n&&t.push(n)}return t}navItem(e,i){let t=e.getAttribute("id")||void 0,r=Ci(e,"a",!0)||Ci(e,"span",!0);if(!r)return;let n=r.getAttribute("href")||"";t||(t=n);let a=r.textContent||"",o=[],s=Ci(e,"ol",!0);return s&&(o=this.parseNavList(s,t)),{id:t,href:n,label:a,subitems:o,parent:i}}parseLandmarks(e){var i=Wr(e,"nav","landmarks"),t=i?Kt(i,"li"):[],r=t.length,n,a=[],o;if(!t||r===0)return a;for(n=0;n<r;++n)o=this.landmarkItem(t[n]),o&&(a.push(o),this.landmarksByType[o.type]=n);return a}landmarkItem(e){let i=Ci(e,"a",!0);if(!i)return;let t=i.getAttributeNS("http://www.idpf.org/2007/ops","type")||void 0;return{href:i.getAttribute("href")||"",label:i.textContent||"",type:t}}parseNcx(e){var i=Kt(e,"navPoint"),t=i.length,r,n={},a=[],o,s;if(!i||t===0)return a;for(r=0;r<t;++r)o=this.ncxItem(i[r]),n[o.id]=o,o.parent?(s=n[o.parent],s.subitems.push(o)):a.push(o);return a}ncxItem(e){var i=e.getAttribute("id")||!1,t=Xe(e,"content").getAttribute("src"),r=Xe(e,"navLabel"),n=r.textContent?r.textContent:"",a=[],o=e.parentNode,s;return o&&(o.nodeName==="navPoint"||o.nodeName.split(":").slice(-1)[0]==="navPoint")&&(s=o.getAttribute("id")),{id:i,href:t,label:n,subitems:a,parent:s}}load(e){return e.map(i=>(i.label=i.title,i.subitems=i.children?this.load(i.children):[],i))}forEach(e){return this.toc.forEach(e)}}}));function Rc(e){return e&&fl[e.split(".").pop().toLowerCase()]||pl}var Ai,fl,pl,pi,da=_e((()=>{Ai={application:{ecmascript:["es","ecma"],javascript:"js",ogg:"ogx",pdf:"pdf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],"rdf+xml":"rdf",smil:["smi","smil"],"xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","opf","ncx"],zip:"zip","x-httpd-eruby":"rhtml","x-latex":"latex","x-maker":["frm","maker","frame","fm","fb","book","fbdoc"],"x-object":"o","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","epub+zip":"epub","font-tdpfr":"pfr","inkml+xml":["ink","inkml"],json:"json","jsonml+json":"jsonml","mathml+xml":"mathml","metalink+xml":"metalink",mp4:"mp4s","omdoc+xml":"omdoc",oxps:"oxps","vnd.amazon.ebook":"azw",widget:"wgt","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-otf":"otf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-font-woff":"woff","x-mobipocket-ebook":["prc","mobi"],"x-mspublisher":"pub","x-nzb":"nzb","x-tgif":"obj","xaml+xml":"xaml","xml-dtd":"dtd","xproc+xml":"xpl","xslt+xml":"xslt","internet-property-stream":"acx","x-compress":"z","x-compressed":"tgz","x-gzip":"gz"},audio:{flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp2","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"x-aiff":["aif","aiff","aifc"],"x-ms-wma":"wma","x-wav":"wav",adpcm:"adp",mp4:"mp4a",webm:"weba","x-aac":"aac","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",mid:["mid","rmi"]},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"x-icon":"ico",bmp:"bmp",webp:"webp","x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod"},text:{"cache-manifest":["manifest","appcache"],css:"css",csv:"csv",html:["html","htm","shtml","stm"],mathml:"mml",plain:["txt","text","brf","conf","def","list","log","in","bas"],richtext:"rtx","tab-separated-values":"tsv","x-bibtex":"bib"},video:{mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv"}},fl=(function(){var e,i,t,r,n={};for(e in Ai)if(Ai.hasOwnProperty(e)){for(i in Ai[e])if(Ai[e].hasOwnProperty(i))if(t=Ai[e][i],typeof t=="string")n[t]=e+"/"+i;else for(r=0;r<t.length;r++)n[t[r]]=e+"/"+i}return n})(),pl="text/plain",pi={lookup:Rc}})),ml,gl,Ic=_e((()=>{Vr(),Ye(),Zr(),da(),ci(),ml=lt(Hr()),gl=class{constructor(e,i){this.settings={replacements:i&&i.replacements||"base64",archive:i&&i.archive,resolver:i&&i.resolver,request:i&&i.request},this.process(e)}process(e){this.manifest=e,this.resources=Object.keys(e).map(function(i){return e[i]}),this.replacementUrls=[],this.html=[],this.assets=[],this.css=[],this.urls=[],this.cssUrls=[],this.split(),this.splitUrls()}split(){this.html=this.resources.filter(function(e){if(e.type==="application/xhtml+xml"||e.type==="text/html")return!0}),this.assets=this.resources.filter(function(e){if(e.type!=="application/xhtml+xml"&&e.type!=="text/html")return!0}),this.css=this.resources.filter(function(e){if(e.type==="text/css")return!0})}splitUrls(){this.urls=this.assets.map(function(e){return e.href}.bind(this)),this.cssUrls=this.css.map(function(e){return e.href})}createUrl(e){var i=new Ct(e),t=pi.lookup(i.filename);return this.settings.archive?this.settings.archive.createUrl(e,{base64:this.settings.replacements==="base64"}):this.settings.replacements==="base64"?this.settings.request(e,"blob").then(r=>el(r)).then(r=>Qn(r,t)):this.settings.request(e,"blob").then(r=>Br(r,t))}replacements(){if(this.settings.replacements==="none")return new Promise(function(i){i(this.urls)}.bind(this));var e=this.urls.map(i=>{var t=this.settings.resolver(i);return this.createUrl(t).catch(r=>(console.error(r),null))});return Promise.all(e).then(i=>(this.replacementUrls=i.filter(t=>typeof t=="string"),i))}replaceCss(e,i){var t=[];return e=e||this.settings.archive,i=i||this.settings.resolver,this.cssUrls.forEach(function(r){var n=this.createCssFile(r,e,i).then(function(a){var o=this.urls.indexOf(r);o>-1&&(this.replacementUrls[o]=a)}.bind(this));t.push(n)}.bind(this)),Promise.all(t)}createCssFile(e){var i;if(ml.default.isAbsolute(e))return new Promise(function(a){a()});var t=this.settings.resolver(e),r;this.settings.archive?r=this.settings.archive.getText(t):r=this.settings.request(t,"text");var n=this.urls.map(a=>{var o=this.settings.resolver(a);return new Vt(t).relative(o)});return r?r.then(a=>(a=sl(a,n,this.replacementUrls),this.settings.replacements==="base64"?i=Qn(a,"text/css"):i=Br(a,"text/css"),i),a=>new Promise(function(o){o()})):new Promise(function(a){a()})}relativeTo(e,i){return i=i||this.settings.resolver,this.urls.map(function(t){var r=i(t);return new Vt(e).relative(r)}.bind(this))}get(e){var i=this.urls.indexOf(e);if(i!==-1)return this.replacementUrls.length?new Promise(function(t,r){t(this.replacementUrls[i])}.bind(this)):this.createUrl(e)}substitute(e,i){var t;return i?t=this.relativeTo(i):t=this.urls,sl(e,t,this.replacementUrls)}destroy(){this.settings=void 0,this.manifest=void 0,this.resources=void 0,this.replacementUrls=void 0,this.html=void 0,this.assets=void 0,this.css=void 0,this.urls=void 0,this.cssUrls=void 0}}})),$r,Nc=_e((()=>{At(),Ye(),$r=class{constructor(e){this.pages=[],this.locations=[],this.epubcfi=new Ze,this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,e&&(this.pageList=this.parse(e)),this.pageList&&this.pageList.length&&this.process(this.pageList)}parse(e){var i=Xe(e,"html"),t=Xe(e,"ncx");if(i)return this.parseNav(e);if(t)return this.parseNcx(e)}parseNav(e){var i=Wr(e,"nav","page-list"),t=i?Kt(i,"li"):[],r=t.length,n,a=[],o;if(!t||r===0)return a;for(n=0;n<r;++n)o=this.item(t[n]),a.push(o);return a}parseNcx(e){var i=[],t=0,r,n,a,o=0;if(n=Xe(e,"pageList"),!n||(a=Kt(n,"pageTarget"),o=a.length,!a||a.length===0))return i;for(t=0;t<o;++t)r=this.ncxItem(a[t]),i.push(r);return i}ncxItem(e){var i=Xe(Xe(e,"navLabel"),"text").textContent;return{href:Xe(e,"content").getAttribute("src"),page:parseInt(i,10)}}item(e){var i=Xe(e,"a"),t=i.getAttribute("href")||"",r=i.textContent||"",n=parseInt(r),a=t.indexOf("epubcfi"),o,s,l;return a!=-1?(o=t.split("#"),s=o[0],l=o.length>1?o[1]:!1,{cfi:l,href:t,packageUrl:s,page:n}):{href:t,page:n}}process(e){e.forEach(function(i){this.pages.push(i.page),i.cfi&&this.locations.push(i.cfi)},this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage}pageFromCfi(e){var i=-1;if(this.locations.length===0)return-1;var t=zr(e,this.locations,this.epubcfi.compare);return t!=-1?i=this.pages[t]:(t=Si(e,this.locations,this.epubcfi.compare),i=t-1>=0?this.pages[t-1]:this.pages[0],i!==void 0||(i=-1)),i}cfiFromPage(e){var i=-1;typeof e!="number"&&(e=parseInt(e));var t=this.pages.indexOf(e);return t!=-1&&(i=this.locations[t]),i}pageFromPercentage(e){return Math.round(this.totalPages*e)}percentageFromPage(e){var i=(e-this.firstPage)/this.totalPages;return Math.round(i*1e3)/1e3}percentageFromCfi(e){var i=this.pageFromCfi(e);return this.percentageFromPage(i)}destroy(){this.pages=void 0,this.locations=void 0,this.epubcfi=void 0,this.pageList=void 0,this.toc=void 0,this.ncx=void 0}}})),vl,Yr,bl=_e((()=>{Ye(),zt(),vl=lt(Ht()),Yr=class{constructor(e){this.settings=e,this.name=e.layout||"reflowable",this._spread=e.spread!=="none",this._minSpreadWidth=e.minSpreadWidth||800,this._evenSpreads=e.evenSpreads||!1,e.flow==="scrolled"||e.flow==="scrolled-continuous"||e.flow==="scrolled-doc"?this._flow="scrolled":this._flow="paginated",this.width=0,this.height=0,this.spreadWidth=0,this.delta=0,this.columnWidth=0,this.gap=0,this.divisor=1,this.props={name:this.name,spread:this._spread,flow:this._flow,width:0,height:0,spreadWidth:0,delta:0,columnWidth:0,gap:0,divisor:1}}flow(e){return typeof e<"u"&&(e==="scrolled"||e==="scrolled-continuous"||e==="scrolled-doc"?this._flow="scrolled":this._flow="paginated",this.update({flow:this._flow})),this._flow}spread(e,i){return e&&(this._spread=e!=="none",this.update({spread:this._spread})),i>=0&&(this._minSpreadWidth=i),this._spread}calculate(e,i,t){var r=1,n=t||0,a=e,o=i,s=Math.floor(a/12),l,h,d,f;this._spread&&a>=this._minSpreadWidth?r=2:r=1,this.name==="reflowable"&&this._flow==="paginated"&&!(t>=0)&&(n=s%2===0?s:s-1),this.name==="pre-paginated"&&(n=0),r>1?(l=a/r-n,d=l+n):(l=a,d=a),this.name==="pre-paginated"&&r>1&&(a=l),h=l*r+n,f=a,this.width=a,this.height=o,this.spreadWidth=h,this.pageWidth=d,this.delta=f,this.columnWidth=l,this.gap=n,this.divisor=r,this.update({width:a,height:o,spreadWidth:h,pageWidth:d,delta:f,columnWidth:l,gap:n,divisor:r})}format(e,i,t){var r;return this.name==="pre-paginated"?r=e.fit(this.columnWidth,this.height,i):this._flow==="paginated"?r=e.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):t&&t==="horizontal"?r=e.size(null,this.height):r=e.size(this.width,null),r}count(e,i){let t,r;return this.name==="pre-paginated"?(t=1,r=1):this._flow==="paginated"?(i=i||this.delta,t=Math.ceil(e/i),r=t*this.divisor):(i=i||this.height,t=Math.ceil(e/i),r=t),{spreads:t,pages:r}}update(e){if(Object.keys(e).forEach(i=>{this.props[i]===e[i]&&delete e[i]}),Object.keys(e).length>0){let i=ut(this.props,e);this.emit(me.LAYOUT.UPDATED,i,e)}}},(0,vl.default)(Yr.prototype)})),_l,Oc=_e((()=>{Zr(),_l=class{constructor(e){this.rendition=e,this._themes={default:{rules:{},url:"",serialized:""}},this._overrides={},this._current="default",this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}register(){if(arguments.length!==0){if(arguments.length===1&&typeof arguments[0]=="object")return this.registerThemes(arguments[0]);if(arguments.length===1&&typeof arguments[0]=="string")return this.default(arguments[0]);if(arguments.length===2&&typeof arguments[1]=="string")return this.registerUrl(arguments[0],arguments[1]);if(arguments.length===2&&typeof arguments[1]=="object")return this.registerRules(arguments[0],arguments[1])}}default(e){if(e){if(typeof e=="string")return this.registerUrl("default",e);if(typeof e=="object")return this.registerRules("default",e)}}registerThemes(e){for(var i in e)e.hasOwnProperty(i)&&(typeof e[i]=="string"?this.registerUrl(i,e[i]):this.registerRules(i,e[i]))}registerCss(e,i){this._themes[e]={serialized:i},(this._injected[e]||e=="default")&&this.update(e)}registerUrl(e,i){var t=new Ct(i);this._themes[e]={url:t.toString()},(this._injected[e]||e=="default")&&this.update(e)}registerRules(e,i){this._themes[e]={rules:i},(this._injected[e]||e=="default")&&this.update(e)}select(e){var i=this._current,t;this._current=e,this.update(e),t=this.rendition.getContents(),t.forEach(r=>{r.removeClass(i),r.addClass(e)})}update(e){this.rendition.getContents().forEach(i=>{this.add(e,i)})}inject(e){var i=[],t=this._themes,r;for(var n in t)t.hasOwnProperty(n)&&(n===this._current||n==="default")&&(r=t[n],(r.rules&&Object.keys(r.rules).length>0||r.url&&i.indexOf(r.url)===-1)&&this.add(n,e),this._injected.push(n));this._current!="default"&&e.addClass(this._current)}add(e,i){var t=this._themes[e];!t||!i||(t.url?i.addStylesheet(t.url):t.serialized?(i.addStylesheetCss(t.serialized,e),t.injected=!0):t.rules&&(i.addStylesheetRules(t.rules,e),t.injected=!0))}override(e,i,t){var r=this.rendition.getContents();this._overrides[e]={value:i,priority:t===!0},r.forEach(n=>{n.css(e,this._overrides[e].value,this._overrides[e].priority)})}removeOverride(e){var i=this.rendition.getContents();delete this._overrides[e],i.forEach(t=>{t.css(e)})}overrides(e){var i=this._overrides;for(var t in i)i.hasOwnProperty(t)&&e.css(t,i[t].value,i[t].priority)}fontSize(e){this.override("font-size",e)}font(e){this.override("font-family",e,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}}})),ir,wl=_e((()=>{At(),Ye(),ir=class{constructor(e,i,t,r=!1){this.layout=e,this.horizontal=t==="horizontal",this.direction=i||"ltr",this._dev=r}section(e){var i=this.findRanges(e);return this.rangeListToCfiList(e.section.cfiBase,i)}page(e,i,t,r){var n=e&&e.document?e.document.body:!1,a;if(n){if(a=this.rangePairToCfiPair(i,{start:this.findStart(n,t,r),end:this.findEnd(n,t,r)}),this._dev===!0){let o=e.document,s=new Ze(a.start).toRange(o),l=new Ze(a.end).toRange(o),h=o.defaultView.getSelection(),d=o.createRange();h.removeAllRanges(),d.setStart(s.startContainer,s.startOffset),d.setEnd(l.endContainer,l.endOffset),h.addRange(d)}return a}}walk(e,i){if(!(e&&e.nodeType===Node.TEXT_NODE)){var t={acceptNode:function(s){return s.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},r=t.acceptNode;r.acceptNode=t.acceptNode;for(var n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,r,!1),a,o;(a=n.nextNode())&&(o=i(a),!o););return o}}findRanges(e){for(var i=[],t=e.contents.scrollWidth(),r=Math.ceil(t/this.layout.spreadWidth)*this.layout.divisor,n=this.layout.columnWidth,a=this.layout.gap,o,s,l=0;l<r.pages;l++)o=(n+a)*l,s=n*(l+1)+a*l,i.push({start:this.findStart(e.document.body,o,s),end:this.findEnd(e.document.body,o,s)});return i}findStart(e,i,t){for(var r=[e],n,a,o=e;r.length;)if(n=r.shift(),a=this.walk(n,s=>{var l,h,d,f,v=Kn(s);if(this.horizontal&&this.direction==="ltr"){if(l=this.horizontal?v.left:v.top,h=this.horizontal?v.right:v.bottom,l>=i&&l<=t)return s;if(h>i)return s;o=s,r.push(s)}else if(this.horizontal&&this.direction==="rtl"){if(l=v.left,h=v.right,h<=t&&h>=i)return s;if(l<t)return s;o=s,r.push(s)}else{if(d=v.top,f=v.bottom,d>=i&&d<=t)return s;if(f>i)return s;o=s,r.push(s)}}),a)return this.findTextStartRange(a,i,t);return this.findTextStartRange(o,i,t)}findEnd(e,i,t){for(var r=[e],n,a=e,o;r.length;)if(n=r.shift(),o=this.walk(n,s=>{var l,h,d,f,v=Kn(s);if(this.horizontal&&this.direction==="ltr"){if(l=Math.round(v.left),h=Math.round(v.right),l>t&&a)return a;if(h>t)return s;a=s,r.push(s)}else if(this.horizontal&&this.direction==="rtl"){if(l=Math.round(this.horizontal?v.left:v.top),h=Math.round(this.horizontal?v.right:v.bottom),h<i&&a)return a;if(l<i)return s;a=s,r.push(s)}else{if(d=Math.round(v.top),f=Math.round(v.bottom),d>t&&a)return a;if(f>t)return s;a=s,r.push(s)}}),o)return this.findTextEndRange(o,i,t);return this.findTextEndRange(a,i,t)}findTextStartRange(e,i,t){for(var r=this.splitTextNodeIntoRanges(e),n,a,o,s,l,h=0;h<r.length;h++)if(n=r[h],a=n.getBoundingClientRect(),this.horizontal&&this.direction==="ltr"){if(o=a.left,o>=i)return n}else if(this.horizontal&&this.direction==="rtl"){if(l=a.right,l<=t)return n}else if(s=a.top,s>=i)return n;return r[0]}findTextEndRange(e,i,t){for(var r=this.splitTextNodeIntoRanges(e),n,a,o,s,l,h,d,f=0;f<r.length;f++){if(a=r[f],o=a.getBoundingClientRect(),this.horizontal&&this.direction==="ltr"){if(s=o.left,l=o.right,s>t&&n)return n;if(l>t)return a}else if(this.horizontal&&this.direction==="rtl"){if(s=o.left,l=o.right,l<i&&n)return n;if(s<i)return a}else{if(h=o.top,d=o.bottom,h>t&&n)return n;if(d>t)return a}n=a}return r[r.length-1]}splitTextNodeIntoRanges(e,i){var t=[],r=(e.textContent||"").trim(),n,a=e.ownerDocument,o=i||" ",s=r.indexOf(o);if(s===-1||e.nodeType!=Node.TEXT_NODE)return n=a.createRange(),n.selectNodeContents(e),[n];for(n=a.createRange(),n.setStart(e,0),n.setEnd(e,s),t.push(n),n=!1;s!=-1;)s=r.indexOf(o,s+1),s>0&&(n&&(n.setEnd(e,s),t.push(n)),n=a.createRange(),n.setStart(e,s+1));return n&&(n.setEnd(e,r.length),t.push(n)),t}rangePairToCfiPair(e,i){var t=i.start,r=i.end;return t.collapse(!0),r.collapse(!1),{start:new Ze(t,e).toString(),end:new Ze(r,e).toString()}}rangeListToCfiList(e,i){for(var t=[],r,n=0;n<i.length;n++)r=this.rangePairToCfiPair(e,i[n]),t.push(r);return t}axis(e){return e&&(this.horizontal=e==="horizontal"),this.horizontal}}})),yl,ua,xl,ca,El,rr,Kr=_e((()=>{yl=lt(Ht()),Ye(),At(),wl(),Vr(),zt(),ua=typeof navigator<"u",xl=ua&&/Chrome/.test(navigator.userAgent),ca=ua&&!xl&&/AppleWebKit/.test(navigator.userAgent),El=1,rr=class{constructor(e,i,t,r){this.epubcfi=new Ze,this.document=e,this.documentElement=this.document.documentElement,this.content=i||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.sectionIndex=r||0,this.cfiBase=t||"",this.epubReadingSystem("epub.js","0.3"),this.called=0,this.active=!0,this.listeners()}static get listenedEvents(){return tr}width(e){var i=this.content;return e&&tt(e)&&(e=e+"px"),e&&(i.style.width=e),parseInt(this.window.getComputedStyle(i).width)}height(e){var i=this.content;return e&&tt(e)&&(e=e+"px"),e&&(i.style.height=e),parseInt(this.window.getComputedStyle(i).height)}contentWidth(e){var i=this.content||this.document.body;return e&&tt(e)&&(e=e+"px"),e&&(i.style.width=e),parseInt(this.window.getComputedStyle(i).width)}contentHeight(e){var i=this.content||this.document.body;return e&&tt(e)&&(e=e+"px"),e&&(i.style.height=e),parseInt(this.window.getComputedStyle(i).height)}textWidth(){let e,i,t=this.document.createRange(),r=this.content||this.document.body,n=Fr(r);return t.selectNodeContents(r),e=t.getBoundingClientRect(),i=e.width,n&&n.width&&(i+=n.width),Math.round(i)}textHeight(){let e,i,t=this.document.createRange(),r=this.content||this.document.body;return t.selectNodeContents(r),e=t.getBoundingClientRect(),i=e.bottom,Math.round(i)}scrollWidth(){return this.documentElement.scrollWidth}scrollHeight(){return this.documentElement.scrollHeight}overflow(e){return e&&(this.documentElement.style.overflow=e),this.window.getComputedStyle(this.documentElement).overflow}overflowX(e){return e&&(this.documentElement.style.overflowX=e),this.window.getComputedStyle(this.documentElement).overflowX}overflowY(e){return e&&(this.documentElement.style.overflowY=e),this.window.getComputedStyle(this.documentElement).overflowY}css(e,i,t){var r=this.content||this.document.body;return i?r.style.setProperty(e,i,t?"important":""):r.style.removeProperty(e),this.window.getComputedStyle(r)[e]}viewport(e){var i=this.document.querySelector("meta[name='viewport']"),t={width:void 0,height:void 0,scale:void 0,minimum:void 0,maximum:void 0,scalable:void 0},r=[],n={};if(i&&i.hasAttribute("content")){let a=i.getAttribute("content"),o=a.match(/width\s*=\s*([^,]*)/),s=a.match(/height\s*=\s*([^,]*)/),l=a.match(/initial-scale\s*=\s*([^,]*)/),h=a.match(/minimum-scale\s*=\s*([^,]*)/),d=a.match(/maximum-scale\s*=\s*([^,]*)/),f=a.match(/user-scalable\s*=\s*([^,]*)/);o&&o.length&&typeof o[1]<"u"&&(t.width=o[1]),s&&s.length&&typeof s[1]<"u"&&(t.height=s[1]),l&&l.length&&typeof l[1]<"u"&&(t.scale=l[1]),h&&h.length&&typeof h[1]<"u"&&(t.minimum=h[1]),d&&d.length&&typeof d[1]<"u"&&(t.maximum=d[1]),f&&f.length&&typeof f[1]<"u"&&(t.scalable=f[1])}return n=qo(e||{},t),e&&(n.width&&r.push("width="+n.width),n.height&&r.push("height="+n.height),n.scale&&r.push("initial-scale="+n.scale),n.scalable==="no"?(r.push("minimum-scale="+n.scale),r.push("maximum-scale="+n.scale),r.push("user-scalable="+n.scalable)):(n.scalable&&r.push("user-scalable="+n.scalable),n.minimum&&r.push("minimum-scale="+n.minimum),n.maximum&&r.push("minimum-scale="+n.maximum)),i||(i=this.document.createElement("meta"),i.setAttribute("name","viewport"),this.document.querySelector("head").appendChild(i)),i.setAttribute("content",r.join(", ")),this.window.scrollTo(0,0)),n}expand(){this.emit(me.CONTENTS.EXPAND)}listeners(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),typeof ResizeObserver>"u"?(this.resizeListeners(),this.visibilityListeners()):this.resizeObservers(),this.linksHandler()}removeListeners(){this.removeEventListeners(),this.removeSelectionListeners(),this.observer&&this.observer.disconnect(),clearTimeout(this.expanding)}resizeCheck(){let e=this.textWidth(),i=this.textHeight();(e!=this._size.width||i!=this._size.height)&&(this._size={width:e,height:i},this.onResize&&this.onResize(this._size),this.emit(me.CONTENTS.RESIZE,this._size))}resizeListeners(){clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}visibilityListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.active===!1?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let e=this.content;e.style.transitionProperty="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",e.style.transitionDuration="0.001ms",e.style.transitionTimingFunction="linear",e.style.transitionDelay="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)}mediaQueryListeners(){for(var e=this.document.styleSheets,i=function(a){a.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this),t=0;t<e.length;t+=1){var r;try{r=e[t].cssRules}catch{return}if(!r)return;for(var n=0;n<r.length;n+=1)r[n].media&&this.window.matchMedia(r[n].media.mediaText).addListener(i)}}resizeObservers(){this.observer=new ResizeObserver(e=>{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(e=>{this.resizeCheck()}),this.observer.observe(this.document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}imageLoadListeners(){for(var e=this.document.querySelectorAll("img"),i,t=0;t<e.length;t++)i=e[t],typeof i.naturalWidth<"u"&&i.naturalWidth===0&&(i.onload=this.expand.bind(this))}fontLoadListeners(){!this.document||!this.document.fonts||this.document.fonts.ready.then(function(){this.resizeCheck()}.bind(this))}root(){return this.document?this.document.documentElement:null}locationOf(e,i){var t,r={left:0,top:0};if(!this.document)return r;if(this.epubcfi.isCfiString(e)){let n=new Ze(e).toRange(this.document,i);if(n){try{if(!n.endContainer||n.startContainer==n.endContainer&&n.startOffset==n.endOffset){let a=n.startContainer.textContent.indexOf(" ",n.startOffset);a==-1&&(a=n.startContainer.textContent.length),n.setEnd(n.startContainer,a)}}catch(a){console.error("setting end offset to start container length failed",a)}if(n.startContainer.nodeType===Node.ELEMENT_NODE)t=n.startContainer.getBoundingClientRect(),r.left=t.left,r.top=t.top;else if(ca){let a=n.startContainer,o=new Range;try{a.nodeType===El?t=a.getBoundingClientRect():n.startOffset+2<a.length?(o.setStart(a,n.startOffset),o.setEnd(a,n.startOffset+2),t=o.getBoundingClientRect()):n.startOffset-2>0?(o.setStart(a,n.startOffset-2),o.setEnd(a,n.startOffset),t=o.getBoundingClientRect()):t=a.parentNode.getBoundingClientRect()}catch(s){console.error(s,s.stack)}}else t=n.getBoundingClientRect()}}else if(typeof e=="string"&&e.indexOf("#")>-1){let n=e.substring(e.indexOf("#")+1),a=this.document.getElementById(n);if(a)if(ca){let o=new Range;o.selectNode(a),t=o.getBoundingClientRect()}else t=a.getBoundingClientRect()}return t&&(r.left=t.left,r.top=t.top),r}addStylesheet(e){return new Promise(function(i,t){var r,n=!1;if(!this.document){i(!1);return}if(r=this.document.querySelector("link[href='"+e+"']"),r){i(!0);return}r=this.document.createElement("link"),r.type="text/css",r.rel="stylesheet",r.href=e,r.onload=r.onreadystatechange=function(){!n&&(!this.readyState||this.readyState=="complete")&&(n=!0,setTimeout(()=>{i(!0)},1))},this.document.head.appendChild(r)}.bind(this))}_getStylesheetNode(e){var i;return e="epubjs-inserted-css-"+(e||""),this.document?(i=this.document.getElementById(e),i||(i=this.document.createElement("style"),i.id=e,this.document.head.appendChild(i)),i):!1}addStylesheetCss(e,i){if(!this.document||!e)return!1;var t=this._getStylesheetNode(i);return t.innerHTML=e,!0}addStylesheetRules(e,i){var t;if(!(!this.document||!e||e.length===0))if(t=this._getStylesheetNode(i).sheet,Object.prototype.toString.call(e)==="[object Array]")for(var r=0,n=e.length;r<n;r++){var a=1,o=e[r],s=e[r][0],l="";Object.prototype.toString.call(o[1][0])==="[object Array]"&&(o=o[1],a=0);for(var h=o.length;a<h;a++){var d=o[a];l+=d[0]+":"+d[1]+(d[2]?" !important":"")+`;
|
|
15
|
+
`}t.insertRule(s+"{"+l+"}",t.cssRules.length)}else Object.keys(e).forEach(f=>{const v=e[f];if(Array.isArray(v))v.forEach(p=>{const y=Object.keys(p).map(k=>`${k}:${p[k]}`).join(";");t.insertRule(`${f}{${y}}`,t.cssRules.length)});else{const p=Object.keys(v).map(y=>`${y}:${v[y]}`).join(";");t.insertRule(`${f}{${p}}`,t.cssRules.length)}})}addScript(e){return new Promise(function(i,t){var r,n=!1;if(!this.document){i(!1);return}r=this.document.createElement("script"),r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){!n&&(!this.readyState||this.readyState=="complete")&&(n=!0,setTimeout(function(){i(!0)},1))},this.document.head.appendChild(r)}.bind(this))}addClass(e){var i;this.document&&(i=this.content||this.document.body,i&&i.classList.add(e))}removeClass(e){var i;this.document&&(i=this.content||this.document.body,i&&i.classList.remove(e))}addEventListeners(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),tr.forEach(function(e){this.document.addEventListener(e,this._triggerEvent,{passive:!0})},this))}removeEventListeners(){this.document&&(tr.forEach(function(e){this.document.removeEventListener(e,this._triggerEvent,{passive:!0})},this),this._triggerEvent=void 0)}triggerEvent(e){this.emit(e.type,e)}addSelectionListeners(){this.document&&(this._onSelectionChange=this.onSelectionChange.bind(this),this.document.addEventListener("selectionchange",this._onSelectionChange,{passive:!0}))}removeSelectionListeners(){this.document&&(this.document.removeEventListener("selectionchange",this._onSelectionChange,{passive:!0}),this._onSelectionChange=void 0)}onSelectionChange(e){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var i=this.window.getSelection();this.triggerSelectedEvent(i)}.bind(this),250)}triggerSelectedEvent(e){var i,t;e&&e.rangeCount>0&&(i=e.getRangeAt(0),i.collapsed||(t=new Ze(i,this.cfiBase).toString(),this.emit(me.CONTENTS.SELECTED,t),this.emit(me.CONTENTS.SELECTED_RANGE,i)))}range(e,i){return new Ze(e).toRange(this.document,i)}cfiFromRange(e,i){return new Ze(e,this.cfiBase,i).toString()}cfiFromNode(e,i){return new Ze(e,this.cfiBase,i).toString()}map(e){return new ir(e).section()}size(e,i){var t={scale:1,scalable:"no"};this.layoutStyle("scrolling"),e>=0&&(this.width(e),t.width=e,this.css("padding","0 "+e/12+"px")),i>=0&&(this.height(i),t.height=i),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(t)}columns(e,i,t,r,n){let a=ki("column-axis"),o=ki("column-gap"),s=ki("column-width"),l=ki("column-fill"),h=this.writingMode().indexOf("vertical")===0?"vertical":"horizontal";this.layoutStyle("paginated"),n==="rtl"&&h==="horizontal"&&this.direction(n),this.width(e),this.height(i),this.viewport({width:e,height:i,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),h==="vertical"?(this.css("padding-top",r/2+"px",!0),this.css("padding-bottom",r/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px"),this.css(a,"vertical")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",r/2+"px",!0),this.css("padding-right",r/2+"px",!0),this.css(a,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(l,"auto"),this.css(o,r+"px"),this.css(s,t+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(e,i,t){var r="scale("+e+")",n="";this.css("transform-origin","top left"),(i>=0||t>=0)&&(n=" translate("+(i||0)+"px, "+(t||0)+"px )"),this.css("transform",r+n)}fit(e,i,t){var r=this.viewport(),n=parseInt(r.width),a=parseInt(r.height),o=e/n,s=i/a,l=o<s?o:s;if(this.layoutStyle("paginated"),this.width(n),this.height(a),this.overflow("hidden"),this.scaler(l,0,0),this.css("background-size",n*l+"px "+a*l+"px"),this.css("background-color","transparent"),t&&t.properties.includes("page-spread-left")){var h=e-n*l;this.css("margin-left",h+"px")}}direction(e){this.documentElement&&(this.documentElement.style.direction=e)}mapPage(e,i,t,r,n){return new ir(i,n).page(this,e,t,r)}linksHandler(){xc(this.content,e=>{this.emit(me.CONTENTS.LINK_CLICKED,e)})}writingMode(e){let i=ki("writing-mode");return e&&this.documentElement&&(this.documentElement.style[i]=e),this.window.getComputedStyle(this.documentElement)[i]||""}layoutStyle(e){return e&&(this._layoutStyle=e,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"}epubReadingSystem(e,i){return navigator.epubReadingSystem={name:e,version:i,layoutStyle:this.layoutStyle(),hasFeature:function(t){switch(t){case"dom-manipulation":return!0;case"layout-changes":return!0;case"touch-events":return!0;case"mouse-events":return!0;case"keyboard-events":return!0;case"spine-scripting":return!1;default:return!1}}},navigator.epubReadingSystem}destroy(){this.removeListeners()}},(0,yl.default)(rr.prototype)})),kl,Sl,fa,Dc=_e((()=>{kl=lt(Ht()),At(),zt(),Sl=class{constructor(e){this.rendition=e,this.highlights=[],this.underlines=[],this.marks=[],this._annotations={},this._annotationsBySectionIndex={},this.rendition.hooks.render.register(this.inject.bind(this)),this.rendition.hooks.unloaded.register(this.clear.bind(this))}add(e,i,t,r,n,a){let o=encodeURI(i+e),s=new Ze(i).spinePos,l=new fa({type:e,cfiRange:i,data:t,sectionIndex:s,cb:r,className:n,styles:a});return this._annotations[o]=l,s in this._annotationsBySectionIndex?this._annotationsBySectionIndex[s].push(o):this._annotationsBySectionIndex[s]=[o],this.rendition.views().forEach(h=>{l.sectionIndex===h.index&&l.attach(h)}),l}remove(e,i){let t=encodeURI(e+i);if(t in this._annotations){let r=this._annotations[t];if(i&&r.type!==i)return;this.rendition.views().forEach(n=>{this._removeFromAnnotationBySectionIndex(r.sectionIndex,t),r.sectionIndex===n.index&&r.detach(n)}),delete this._annotations[t]}}_removeFromAnnotationBySectionIndex(e,i){this._annotationsBySectionIndex[e]=this._annotationsAt(e).filter(t=>t!==i)}_annotationsAt(e){return this._annotationsBySectionIndex[e]}highlight(e,i,t,r,n){return this.add("highlight",e,i,t,r,n)}underline(e,i,t,r,n){return this.add("underline",e,i,t,r,n)}mark(e,i,t){return this.add("mark",e,i,t)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(e){let i=e.index;i in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[i].forEach(t=>{this._annotations[t].attach(e)})}clear(e){let i=e.index;i in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[i].forEach(t=>{this._annotations[t].detach(e)})}show(){}hide(){}},fa=class{constructor({type:e,cfiRange:i,data:t,sectionIndex:r,cb:n,className:a,styles:o}){this.type=e,this.cfiRange=i,this.data=t,this.sectionIndex=r,this.mark=void 0,this.cb=n,this.className=a,this.styles=o}update(e){this.data=e}attach(e){let{cfiRange:i,data:t,type:r,mark:n,cb:a,className:o,styles:s}=this,l;return r==="highlight"?l=e.highlight(i,t,a,o,s):r==="underline"?l=e.underline(i,t,a,o,s):r==="mark"&&(l=e.mark(i,t,a)),this.mark=l,this.emit(me.ANNOTATION.ATTACH,l),l}detach(e){let{cfiRange:i,type:t}=this,r;return e&&(t==="highlight"?r=e.unhighlight(i):t==="underline"?r=e.ununderline(i):t==="mark"&&(r=e.unmark(i))),this.mark=void 0,this.emit(me.ANNOTATION.DETACH,r),r}text(){}},(0,kl.default)(fa.prototype)})),Lc=Ae((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createElement=i;function i(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}e.default={createElement:i}})),zc=Ae((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.proxyMouse=i,e.clone=t,e.default={proxyMouse:i};function i(n,a){function o(d){for(var f=a.length-1;f>=0;f--){var v=a[f],p=d.clientX,y=d.clientY;if(d.touches&&d.touches.length&&(p=d.touches[0].clientX,y=d.touches[0].clientY),!!r(v,n,p,y)){v.dispatchEvent(t(d));break}}}if(n.nodeName==="iframe"||n.nodeName==="IFRAME")try{this.target=n.contentDocument}catch{this.target=n}else this.target=n;for(var s=["mouseup","mousedown","click","touchstart"],l=0;l<s.length;l++){var h=s[l];this.target.addEventListener(h,function(d){return o(d)},!1)}}function t(n){var a=Object.assign({},n,{bubbles:!1});try{return new MouseEvent(n.type,a)}catch{var o=document.createEvent("MouseEvents");return o.initMouseEvent(n.type,!1,a.cancelable,a.view,a.detail,a.screenX,a.screenY,a.clientX,a.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.button,a.relatedTarget),o}}function r(n,a,o,s){var l=a.getBoundingClientRect();function h(p,y,k){var u=p.top-l.top,m=p.left-l.left,g=u+p.height,E=m+p.width;return u<=k&&m<=y&&g>k&&E>y}if(!h(n.getBoundingClientRect(),o,s))return!1;for(var d=n.getClientRects(),f=0,v=d.length;f<v;f++)if(h(d[f],o,s))return!0;return!1}})),Pc=Ae((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Underline=e.Highlight=e.Mark=e.Pane=void 0;var i=function y(k,u,m){k===null&&(k=Function.prototype);var g=Object.getOwnPropertyDescriptor(k,u);if(g===void 0){var E=Object.getPrototypeOf(k);return E===null?void 0:y(E,u,m)}else{if("value"in g)return g.value;var x=g.get;return x===void 0?void 0:x.call(m)}},t=(function(){function y(k,u){for(var m=0;m<u.length;m++){var g=u[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(k,g.key,g)}}return function(k,u,m){return u&&y(k.prototype,u),m&&y(k,m),k}})(),r=a(Lc()),n=a(zc());function a(y){return y&&y.__esModule?y:{default:y}}function o(y,k){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:y}function s(y,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);y.prototype=Object.create(k&&k.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(y,k):y.__proto__=k)}function l(y,k){if(!(y instanceof k))throw new TypeError("Cannot call a class as a function")}e.Pane=(function(){function y(k){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document.body;l(this,y),this.target=k,this.element=r.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),n.default.proxyMouse(this.target,this.marks),this.container=u,this.container.appendChild(this.element),this.render()}return t(y,[{key:"addMark",value:function(u){var m=r.default.createElement("g");return this.element.appendChild(m),u.bind(m,this.container),this.marks.push(u),u.render(),u}},{key:"removeMark",value:function(u){var m=this.marks.indexOf(u);if(m!==-1){var g=u.unbind();this.element.removeChild(g),this.marks.splice(m,1)}}},{key:"render",value:function(){v(this.element,f(this.target,this.container));var u=!0,m=!1,g=void 0;try{for(var E=this.marks[Symbol.iterator](),x;!(u=(x=E.next()).done);u=!0)x.value.render()}catch(_){m=!0,g=_}finally{try{!u&&E.return&&E.return()}finally{if(m)throw g}}}}]),y})();var h=e.Mark=(function(){function y(){l(this,y),this.element=null}return t(y,[{key:"bind",value:function(u,m){this.element=u,this.container=m}},{key:"unbind",value:function(){var u=this.element;return this.element=null,u}},{key:"render",value:function(){}},{key:"dispatchEvent",value:function(u){this.element&&this.element.dispatchEvent(u)}},{key:"getBoundingClientRect",value:function(){return this.element.getBoundingClientRect()}},{key:"getClientRects",value:function(){for(var u=[],m=this.element.firstChild;m;)u.push(m.getBoundingClientRect()),m=m.nextSibling;return u}},{key:"filteredRanges",value:function(){var u=Array.from(this.range.getClientRects());return u.filter(function(m){for(var g=0;g<u.length;g++){if(u[g]===m)return!0;if(p(u[g],m))return!1}return!0})}}]),y})(),d=e.Highlight=(function(y){s(k,y);function k(u,m,g,E){l(this,k);var x=o(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return x.range=u,x.className=m,x.data=g||{},x.attributes=E||{},x}return t(k,[{key:"bind",value:function(m,g){i(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"bind",this).call(this,m,g);for(var E in this.data)this.data.hasOwnProperty(E)&&(this.element.dataset[E]=this.data[E]);for(var E in this.attributes)this.attributes.hasOwnProperty(E)&&this.element.setAttribute(E,this.attributes[E]);this.className&&this.element.classList.add(this.className)}},{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var m=this.element.ownerDocument.createDocumentFragment(),g=this.filteredRanges(),E=this.element.getBoundingClientRect(),x=this.container.getBoundingClientRect(),_=0,I=g.length;_<I;_++){var A=g[_],D=r.default.createElement("rect");D.setAttribute("x",A.left-E.left+x.left),D.setAttribute("y",A.top-E.top+x.top),D.setAttribute("height",A.height),D.setAttribute("width",A.width),m.appendChild(D)}this.element.appendChild(m)}}]),k})(h);e.Underline=(function(y){s(k,y);function k(u,m,g,E){return l(this,k),o(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,u,m,g,E))}return t(k,[{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var m=this.element.ownerDocument.createDocumentFragment(),g=this.filteredRanges(),E=this.element.getBoundingClientRect(),x=this.container.getBoundingClientRect(),_=0,I=g.length;_<I;_++){var A=g[_],D=r.default.createElement("rect");D.setAttribute("x",A.left-E.left+x.left),D.setAttribute("y",A.top-E.top+x.top),D.setAttribute("height",A.height),D.setAttribute("width",A.width),D.setAttribute("fill","none");var z=r.default.createElement("line");z.setAttribute("x1",A.left-E.left+x.left),z.setAttribute("x2",A.left-E.left+x.left+A.width),z.setAttribute("y1",A.top-E.top+x.top+A.height-1),z.setAttribute("y2",A.top-E.top+x.top+A.height-1),z.setAttribute("stroke-width",1),z.setAttribute("stroke","black"),z.setAttribute("stroke-linecap","square"),m.appendChild(D),m.appendChild(z)}this.element.appendChild(m)}}]),k})(d);function f(y,k){var u=k.getBoundingClientRect(),m=y.getBoundingClientRect();return{top:m.top-u.top,left:m.left-u.left,height:y.scrollHeight,width:y.scrollWidth}}function v(y,k){y.style.setProperty("top",k.top+"px","important"),y.style.setProperty("left",k.left+"px","important"),y.style.setProperty("height",k.height+"px","important"),y.style.setProperty("width",k.width+"px","important")}function p(y,k){return k.right<=y.right&&k.left>=y.left&&k.top>=y.top&&k.bottom<=y.bottom}})),Tl,nr,pa,Cl=_e((()=>{Tl=lt(Ht()),Ye(),At(),Kr(),zt(),nr=Pc(),pa=class{constructor(e,i){this.settings=ut({ignoreClass:"",axis:void 0,direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0,forceRight:!1,allowScriptedContent:!1,allowPopups:!1},i||{}),this.id="epubjs-view-"+Lr(),this.section=e,this.index=e.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new Ze,this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}container(e){var i=document.createElement("div");return i.classList.add("epub-view"),i.style.height="0px",i.style.width="0px",i.style.overflow="hidden",i.style.position="relative",i.style.display="block",e&&e=="horizontal"?i.style.flex="none":i.style.flex="initial",i}create(){return this.iframe?this.iframe:(this.element||(this.element=this.createContainer()),this.iframe=document.createElement("iframe"),this.iframe.id=this.id,this.iframe.scrolling="no",this.iframe.style.overflow="hidden",this.iframe.seamless="seamless",this.iframe.style.border="none",this.iframe.sandbox="allow-same-origin",this.settings.allowScriptedContent&&(this.iframe.sandbox+=" allow-scripts"),this.settings.allowPopups&&(this.iframe.sandbox+=" allow-popups"),this.iframe.setAttribute("enable-annotation","true"),this.resizing=!0,this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this.element.setAttribute("ref",this.index),this.added=!0,this.elementBounds=Pr(this.element),"srcdoc"in this.iframe?this.supportsSrcdoc=!0:this.supportsSrcdoc=!1,this.settings.method||(this.settings.method=this.supportsSrcdoc?"srcdoc":"write"),this.iframe)}render(e,i){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(e)),this.sectionRender.then(function(t){return this.load(t)}.bind(this)).then(function(){let t=this.contents.writingMode(),r;return this.settings.flow==="scrolled"?r=t.indexOf("vertical")===0?"horizontal":"vertical":r=t.indexOf("vertical")===0?"vertical":"horizontal",t.indexOf("vertical")===0&&this.settings.flow==="paginated"&&(this.layout.delta=this.layout.height),this.setAxis(r),this.emit(me.VIEWS.AXIS,r),this.setWritingMode(t),this.emit(me.VIEWS.WRITING_MODE,t),this.layout.format(this.contents,this.section,this.axis),this.addListeners(),new Promise((n,a)=>{this.expand(),this.settings.forceRight&&(this.element.style.marginLeft=this.width()+"px"),n()})}.bind(this),function(t){return this.emit(me.VIEWS.LOAD_ERROR,t),new Promise((r,n)=>{n(t)})}.bind(this)).then(function(){this.emit(me.VIEWS.RENDERED,this.section)}.bind(this))}reset(){this.iframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this._textWidth=void 0,this._contentWidth=void 0,this._textHeight=void 0,this._contentHeight=void 0),this._needsReframe=!0}size(e,i){var t=e||this.settings.width,r=i||this.settings.height;this.layout.name==="pre-paginated"?this.lock("both",t,r):this.settings.axis==="horizontal"?this.lock("height",t,r):this.lock("width",t,r),this.settings.width=t,this.settings.height=r}lock(e,i,t){var r=Fr(this.element),n;this.iframe?n=Fr(this.iframe):n={width:0,height:0},e=="width"&&tt(i)&&(this.lockedWidth=i-r.width-n.width),e=="height"&&tt(t)&&(this.lockedHeight=t-r.height-n.height),e==="both"&&tt(i)&&tt(t)&&(this.lockedWidth=i-r.width-n.width,this.lockedHeight=t-r.height-n.height),this.displayed&&this.iframe&&this.expand()}expand(e){var i=this.lockedWidth,t=this.lockedHeight,r;!this.iframe||this._expanding||(this._expanding=!0,this.layout.name==="pre-paginated"?(i=this.layout.columnWidth,t=this.layout.height):this.settings.axis==="horizontal"?(i=this.contents.textWidth(),i%this.layout.pageWidth>0&&(i=Math.ceil(i/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(r=i/this.layout.pageWidth,this.layout.divisor>1&&this.layout.name==="reflowable"&&r%2>0&&(i+=this.layout.pageWidth))):this.settings.axis==="vertical"&&(t=this.contents.textHeight(),this.settings.flow==="paginated"&&t%this.layout.height>0&&(t=Math.ceil(t/this.layout.height)*this.layout.height)),(this._needsReframe||i!=this._width||t!=this._height)&&this.reframe(i,t),this._expanding=!1)}reframe(e,i){var t;tt(e)&&(this.element.style.width=e+"px",this.iframe.style.width=e+"px",this._width=e),tt(i)&&(this.element.style.height=i+"px",this.iframe.style.height=i+"px",this._height=i),t={width:e,height:i,widthDelta:this.prevBounds?e-this.prevBounds.width:e,heightDelta:this.prevBounds?i-this.prevBounds.height:i},this.pane&&this.pane.render(),requestAnimationFrame(()=>{let r;for(let n in this.marks)this.marks.hasOwnProperty(n)&&(r=this.marks[n],this.placeMark(r.element,r.range))}),this.onResize(this,t),this.emit(me.VIEWS.RESIZED,t),this.prevBounds=t,this.elementBounds=Pr(this.element)}load(e){var i=new Fe,t=i.promise;if(!this.iframe)return i.reject(new Error("No Iframe Available")),t;if(this.iframe.onload=function(n){this.onLoad(n,i)}.bind(this),this.settings.method==="blobUrl")this.blobUrl=Br(e,"application/xhtml+xml"),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if(this.settings.method==="srcdoc")this.iframe.srcdoc=e,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return i.reject(new Error("No Document Available")),t;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var r=this;MSApp.execUnsafeLocalFunction(function(){r.iframe.contentDocument.write(e)})}else this.iframe.contentDocument.write(e);this.iframe.contentDocument.close()}return t}onLoad(e,i){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new rr(this.document,this.document.body,this.section.cfiBase,this.section.index),this.rendering=!1;var t=this.document.querySelector("link[rel='canonical']");t?t.setAttribute("href",this.section.canonical):(t=this.document.createElement("link"),t.setAttribute("rel","canonical"),t.setAttribute("href",this.section.canonical),this.document.querySelector("head").appendChild(t)),this.contents.on(me.CONTENTS.EXPAND,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),this.contents.on(me.CONTENTS.RESIZE,r=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),i.resolve(this.contents)}setLayout(e){this.layout=e,this.contents&&(this.layout.format(this.contents),this.expand())}setAxis(e){this.settings.axis=e,e=="horizontal"?this.element.style.flex="none":this.element.style.flex="initial",this.size()}setWritingMode(e){this.writingMode=e}addListeners(){}removeListeners(e){}display(e){var i=new Fe;return this.displayed?i.resolve(this):this.render(e).then(function(){this.emit(me.VIEWS.DISPLAYED,this),this.onDisplayed(this),this.displayed=!0,i.resolve(this)}.bind(this),function(t){i.reject(t,this)}),i.promise}show(){this.element.style.visibility="visible",this.iframe&&(this.iframe.style.visibility="visible",this.iframe.style.transform="translateZ(0)",this.iframe.offsetWidth,this.iframe.style.transform=null),this.emit(me.VIEWS.SHOWN,this)}hide(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit(me.VIEWS.HIDDEN,this)}offset(){return{top:this.element.offsetTop,left:this.element.offsetLeft}}width(){return this._width}height(){return this._height}position(){return this.element.getBoundingClientRect()}locationOf(e){this.iframe.getBoundingClientRect();var i=this.contents.locationOf(e,this.settings.ignoreClass);return{left:i.left,top:i.top}}onDisplayed(e){}onResize(e,i){}bounds(e){return(e||!this.elementBounds)&&(this.elementBounds=Pr(this.element)),this.elementBounds}highlight(e,i={},t,r="epubjs-hl",n={}){if(!this.contents)return;const a=Object.assign({fill:"yellow","fill-opacity":"0.3","mix-blend-mode":"multiply"},n);let o=this.contents.range(e),s=()=>{this.emit(me.VIEWS.MARK_CLICKED,e,i)};i.epubcfi=e,this.pane||(this.pane=new nr.Pane(this.iframe,this.element));let l=new nr.Highlight(o,r,i,a),h=this.pane.addMark(l);return this.highlights[e]={mark:h,element:h.element,listeners:[s,t]},h.element.setAttribute("ref",r),h.element.addEventListener("click",s),h.element.addEventListener("touchstart",s),t&&(h.element.addEventListener("click",t),h.element.addEventListener("touchstart",t)),h}underline(e,i={},t,r="epubjs-ul",n={}){if(!this.contents)return;const a=Object.assign({stroke:"black","stroke-opacity":"0.3","mix-blend-mode":"multiply"},n);let o=this.contents.range(e),s=()=>{this.emit(me.VIEWS.MARK_CLICKED,e,i)};i.epubcfi=e,this.pane||(this.pane=new nr.Pane(this.iframe,this.element));let l=new nr.Underline(o,r,i,a),h=this.pane.addMark(l);return this.underlines[e]={mark:h,element:h.element,listeners:[s,t]},h.element.setAttribute("ref",r),h.element.addEventListener("click",s),h.element.addEventListener("touchstart",s),t&&(h.element.addEventListener("click",t),h.element.addEventListener("touchstart",t)),h}mark(e,i={},t){if(!this.contents)return;if(e in this.marks)return this.marks[e];let r=this.contents.range(e);if(!r)return;let n=r.commonAncestorContainer,a=n.nodeType===1?n:n.parentNode,o=l=>{this.emit(me.VIEWS.MARK_CLICKED,e,i)};r.collapsed&&n.nodeType===1?(r=new Range,r.selectNodeContents(n)):r.collapsed&&(r=new Range,r.selectNodeContents(a));let s=this.document.createElement("a");return s.setAttribute("ref","epubjs-mk"),s.style.position="absolute",s.dataset.epubcfi=e,i&&Object.keys(i).forEach(l=>{s.dataset[l]=i[l]}),t&&(s.addEventListener("click",t),s.addEventListener("touchstart",t)),s.addEventListener("click",o),s.addEventListener("touchstart",o),this.placeMark(s,r),this.element.appendChild(s),this.marks[e]={element:s,range:r,listeners:[o,t]},a}placeMark(e,i){let t,r,n;if(this.layout.name==="pre-paginated"||this.settings.axis!=="horizontal"){let o=i.getBoundingClientRect();t=o.top,r=o.right}else{let o=i.getClientRects(),s;for(var a=0;a!=o.length;a++)s=o[a],(!n||s.left<n)&&(n=s.left,r=Math.ceil(n/this.layout.props.pageWidth)*this.layout.props.pageWidth-this.layout.gap/2,t=s.top)}e.style.top=`${t}px`,e.style.left=`${r}px`}unhighlight(e){let i;e in this.highlights&&(i=this.highlights[e],this.pane.removeMark(i.mark),i.listeners.forEach(t=>{t&&(i.element.removeEventListener("click",t),i.element.removeEventListener("touchstart",t))}),delete this.highlights[e])}ununderline(e){let i;e in this.underlines&&(i=this.underlines[e],this.pane.removeMark(i.mark),i.listeners.forEach(t=>{t&&(i.element.removeEventListener("click",t),i.element.removeEventListener("touchstart",t))}),delete this.underlines[e])}unmark(e){let i;e in this.marks&&(i=this.marks[e],this.element.removeChild(i.element),i.listeners.forEach(t=>{t&&(i.element.removeEventListener("click",t),i.element.removeEventListener("touchstart",t))}),delete this.marks[e])}destroy(){for(let e in this.highlights)this.unhighlight(e);for(let e in this.underlines)this.ununderline(e);for(let e in this.marks)this.unmark(e);this.blobUrl&&Ko(this.blobUrl),this.displayed&&(this.displayed=!1,this.removeListeners(),this.contents.destroy(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.pane&&(this.pane.element.remove(),this.pane=void 0),this.iframe=void 0,this.contents=void 0,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)}},(0,Tl.default)(pa.prototype)}));function Fc(){var e="reverse",i=Mc();return document.body.appendChild(i),i.scrollLeft>0?e="default":typeof Element<"u"&&Element.prototype.scrollIntoView?(i.children[0].children[1].scrollIntoView(),i.scrollLeft<0&&(e="negative")):(i.scrollLeft=1,i.scrollLeft===0&&(e="negative")),document.body.removeChild(i),e}function Mc(){var e=document.createElement("div");e.dir="rtl",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.top="0px",e.style.left="0px",e.style.overflow="hidden";var i=document.createElement("div");i.style.width="2px";var t=document.createElement("span");t.style.width="1px",t.style.display="inline-block";var r=document.createElement("span");return r.style.width="1px",r.style.display="inline-block",i.appendChild(t),i.appendChild(r),e.appendChild(i),e}var Bc=_e((()=>{})),ma=Ae(((e,i)=>{function t(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}i.exports=t})),Uc=Ae(((e,i)=>{var t=typeof global=="object"&&global&&global.Object===Object&&global;i.exports=t})),Al=Ae(((e,i)=>{var t=Uc(),r=typeof self=="object"&&self&&self.Object===Object&&self,n=t||r||Function("return this")();i.exports=n})),Wc=Ae(((e,i)=>{var t=Al(),r=function(){return t.Date.now()};i.exports=r})),jc=Ae(((e,i)=>{var t=/\s/;function r(n){for(var a=n.length;a--&&t.test(n.charAt(a)););return a}i.exports=r})),Hc=Ae(((e,i)=>{var t=jc(),r=/^\s+/;function n(a){return a&&a.slice(0,t(a)+1).replace(r,"")}i.exports=n})),Rl=Ae(((e,i)=>{var t=Al().Symbol;i.exports=t})),Zc=Ae(((e,i)=>{var t=Rl(),r=Object.prototype,n=r.hasOwnProperty,a=r.toString,o=t?t.toStringTag:void 0;function s(l){var h=n.call(l,o),d=l[o];try{l[o]=void 0;var f=!0}catch{}var v=a.call(l);return f&&(h?l[o]=d:delete l[o]),v}i.exports=s})),Vc=Ae(((e,i)=>{var t=Object.prototype.toString;function r(n){return t.call(n)}i.exports=r})),Gc=Ae(((e,i)=>{var t=Rl(),r=Zc(),n=Vc(),a="[object Null]",o="[object Undefined]",s=t?t.toStringTag:void 0;function l(h){return h==null?h===void 0?o:a:s&&s in Object(h)?r(h):n(h)}i.exports=l})),Xc=Ae(((e,i)=>{function t(r){return r!=null&&typeof r=="object"}i.exports=t})),qc=Ae(((e,i)=>{var t=Gc(),r=Xc(),n="[object Symbol]";function a(o){return typeof o=="symbol"||r(o)&&t(o)==n}i.exports=a})),$c=Ae(((e,i)=>{var t=Hc(),r=ma(),n=qc(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,h=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return a;if(r(f)){var v=typeof f.valueOf=="function"?f.valueOf():f;f=r(v)?v+"":v}if(typeof f!="string")return f===0?f:+f;f=t(f);var p=s.test(f);return p||l.test(f)?h(f.slice(2),p?2:8):o.test(f)?a:+f}i.exports=d})),Il=Ae(((e,i)=>{var t=ma(),r=Wc(),n=$c(),a="Expected a function",o=Math.max,s=Math.min;function l(h,d,f){var v,p,y,k,u,m,g=0,E=!1,x=!1,_=!0;if(typeof h!="function")throw new TypeError(a);d=n(d)||0,t(f)&&(E=!!f.leading,x="maxWait"in f,y=x?o(n(f.maxWait)||0,d):y,_="trailing"in f?!!f.trailing:_);function I(K){var de=v,ue=p;return v=p=void 0,g=K,k=h.apply(ue,de),k}function A(K){return g=K,u=setTimeout(O,d),E?I(K):k}function D(K){var de=K-m,ue=K-g,te=d-de;return x?s(te,y-ue):te}function z(K){var de=K-m,ue=K-g;return m===void 0||de>=d||de<0||x&&ue>=y}function O(){var K=r();if(z(K))return F(K);u=setTimeout(O,D(K))}function F(K){return u=void 0,_&&v?I(K):(v=p=void 0,k)}function W(){u!==void 0&&clearTimeout(u),g=0,v=m=p=u=void 0}function q(){return u===void 0?k:F(r())}function re(){var K=r(),de=z(K);if(v=arguments,p=this,m=K,de){if(u===void 0)return A(m);if(x)return clearTimeout(u),u=setTimeout(O,d),I(m)}return u===void 0&&(u=setTimeout(O,d)),k}return re.cancel=W,re.flush=q,re}i.exports=l})),Yc=Ae(((e,i)=>{var t=Il(),r=ma(),n="Expected a function";function a(o,s,l){var h=!0,d=!0;if(typeof o!="function")throw new TypeError(n);return r(l)&&(h="leading"in l?!!l.leading:h,d="trailing"in l?!!l.trailing:d),t(o,s,{leading:h,maxWait:s,trailing:d})}i.exports=a})),Nl,Ol,Kc=_e((()=>{Ye(),Nl=lt(Yc()),Ol=class{constructor(e){this.settings=e||{},this.id="epubjs-container-"+Lr(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(e){let i=e.height,t=e.width,r=e.overflow||!1,n=e.axis||"vertical",a=e.direction;ut(this.settings,e),e.height&&tt(e.height)&&(i=e.height+"px"),e.width&&tt(e.width)&&(t=e.width+"px");let o=document.createElement("div");return o.id=this.id,o.classList.add("epub-container"),o.style.wordSpacing="0",o.style.lineHeight="0",o.style.verticalAlign="top",o.style.position="relative",n==="horizontal"&&(o.style.display="flex",o.style.flexDirection="row",o.style.flexWrap="nowrap"),t&&(o.style.width=t),i&&(o.style.height=i),r&&(r==="scroll"&&n==="vertical"?(o.style["overflow-y"]=r,o.style["overflow-x"]="hidden"):r==="scroll"&&n==="horizontal"?(o.style["overflow-y"]="hidden",o.style["overflow-x"]=r):o.style.overflow=r),a&&(o.dir=a,o.style.direction=a),a&&this.settings.fullsize&&(document.body.style.direction=a),o}wrap(e){var i=document.createElement("div");return i.style.visibility="hidden",i.style.overflow="hidden",i.style.width="0",i.style.height="0",i.appendChild(e),i}getElement(e){var i;if(Go(e)?i=e:typeof e=="string"&&(i=document.getElementById(e)),!i)throw new Error("Not an Element");return i}attachTo(e){var i=this.getElement(e),t;if(i)return this.settings.hidden?t=this.wrapper:t=this.container,i.appendChild(t),this.element=i,i}getContainer(){return this.container}onResize(e){(!tt(this.settings.width)||!tt(this.settings.height))&&(this.resizeFunc=(0,Nl.default)(e,50),window.addEventListener("resize",this.resizeFunc,!1))}onOrientationChange(e){this.orientationChangeFunc=e,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)}size(e,i){var t;let r=e||this.settings.width,n=i||this.settings.height;e===null?(t=this.element.getBoundingClientRect(),t.width&&(e=Math.floor(t.width),this.container.style.width=e+"px")):tt(e)?this.container.style.width=e+"px":this.container.style.width=e,i===null?(t=t||this.element.getBoundingClientRect(),t.height&&(i=t.height,this.container.style.height=i+"px")):tt(i)?this.container.style.height=i+"px":this.container.style.height=i,tt(e)||(e=this.container.clientWidth),tt(i)||(i=this.container.clientHeight),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles["padding-left"])||0,right:parseFloat(this.containerStyles["padding-right"])||0,top:parseFloat(this.containerStyles["padding-top"])||0,bottom:parseFloat(this.containerStyles["padding-bottom"])||0};let a=Mr(),o=window.getComputedStyle(document.body),s={left:parseFloat(o["padding-left"])||0,right:parseFloat(o["padding-right"])||0,top:parseFloat(o["padding-top"])||0,bottom:parseFloat(o["padding-bottom"])||0};return r||(e=a.width-s.left-s.right),(this.settings.fullsize&&!n||!n)&&(i=a.height-s.top-s.bottom),{width:e-this.containerPadding.left-this.containerPadding.right,height:i-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let e;return this.container.style.overflow!=="visible"&&(e=this.container&&this.container.getBoundingClientRect()),!e||!e.width||!e.height?Mr():e}getSheet(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet}addStyleRules(e,i){var t="#"+this.id+" ",r="";this.sheet||(this.sheet=this.getSheet()),i.forEach(function(n){for(var a in n)n.hasOwnProperty(a)&&(r+=a+":"+n[a]+";")}),this.sheet.insertRule(t+e+" {"+r+"}",0)}axis(e){e==="horizontal"?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=e}direction(e){this.container&&(this.container.dir=e,this.container.style.direction=e),this.settings.fullsize&&(document.body.style.direction=e),this.settings.dir=e}overflow(e){this.container&&(e==="scroll"&&this.settings.axis==="vertical"?(this.container.style["overflow-y"]=e,this.container.style["overflow-x"]="hidden"):e==="scroll"&&this.settings.axis==="horizontal"?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=e):this.container.style.overflow=e),this.settings.overflow=e}destroy(){this.element&&(this.settings.hidden?this.wrapper:this.container,this.element.contains(this.container)&&this.element.removeChild(this.container),window.removeEventListener("resize",this.resizeFunc),window.removeEventListener("orientationChange",this.orientationChangeFunc))}}})),Dl,Jc=_e((()=>{Dl=class{constructor(e){this.container=e,this._views=[],this.length=0,this.hidden=!1}all(){return this._views}first(){return this._views[0]}last(){return this._views[this._views.length-1]}indexOf(e){return this._views.indexOf(e)}slice(){return this._views.slice.apply(this._views,arguments)}get(e){return this._views[e]}append(e){return this._views.push(e),this.container&&this.container.appendChild(e.element),this.length++,e}prepend(e){return this._views.unshift(e),this.container&&this.container.insertBefore(e.element,this.container.firstChild),this.length++,e}insert(e,i){return this._views.splice(i,0,e),this.container&&(i<this.container.children.length?this.container.insertBefore(e.element,this.container.children[i]):this.container.appendChild(e.element)),this.length++,e}remove(e){var i=this._views.indexOf(e);i>-1&&this._views.splice(i,1),this.destroy(e),this.length--}destroy(e){e.displayed&&e.destroy(),this.container&&this.container.removeChild(e.element),e=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var e,i=this.length;if(this.length){for(var t=0;t<i;t++)e=this._views[t],this.destroy(e);this._views=[],this.length=0}}find(e){for(var i,t=this.length,r=0;r<t;r++)if(i=this._views[r],i.displayed&&i.section.index==e.index)return i}displayed(){for(var e=[],i,t=this.length,r=0;r<t;r++)i=this._views[r],i.displayed&&e.push(i);return e}show(){for(var e,i=this.length,t=0;t<i;t++)e=this._views[t],e.displayed&&e.show();this.hidden=!1}hide(){for(var e,i=this.length,t=0;t<i;t++)e=this._views[t],e.displayed&&e.hide();this.hidden=!0}}})),Ll,ar,ga=_e((()=>{Ll=lt(Ht()),Ye(),Bc(),wl(),oa(),Kc(),Jc(),zt(),ar=class{constructor(e){this.name="default",this.optsSettings=e.settings,this.View=e.view,this.request=e.request,this.renditionQueue=e.queue,this.q=new Xr(this),this.settings=ut(this.settings||{},{infinite:!0,hidden:!1,width:void 0,height:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",ignoreClass:"",fullsize:void 0,allowScriptedContent:!1,allowPopups:!1}),ut(this.settings,e.settings||{}),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,method:this.settings.method,width:0,height:0,forceEvenPages:!0,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.rendered=!1}render(e,i){let t=e.tagName;typeof this.settings.fullsize>"u"&&t&&(t.toLowerCase()=="body"||t.toLowerCase()=="html")&&(this.settings.fullsize=!0),this.settings.fullsize&&(this.settings.overflow="visible",this.overflow=this.settings.overflow),this.settings.size=i,this.settings.rtlScrollType=Fc(),this.stage=new Ol({width:i.width,height:i.height,overflow:this.overflow,hidden:this.settings.hidden,axis:this.settings.axis,fullsize:this.settings.fullsize,direction:this.settings.direction}),this.stage.attachTo(e),this.container=this.stage.getContainer(),this.views=new Dl(this.container),this._bounds=this.bounds(),this._stageSize=this.stage.size(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.stage.onResize(this.onResized.bind(this)),this.stage.onOrientationChange(this.onOrientationChange.bind(this)),this.addEventListeners(),this.layout&&this.updateLayout(),this.rendered=!0}addEventListeners(){var e;window.addEventListener("unload",function(i){this.destroy()}.bind(this)),this.settings.fullsize?e=window:e=this.container,this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll)}removeEventListeners(){var e;this.settings.fullsize?e=window:e=this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}destroy(){clearTimeout(this.orientationTimeout),clearTimeout(this.resizeTimeout),clearTimeout(this.afterScrolled),this.clear(),this.removeEventListeners(),this.stage.destroy(),this.rendered=!1}onOrientationChange(e){let{orientation:i}=window;this.optsSettings.resizeOnOrientationChange&&this.resize(),clearTimeout(this.orientationTimeout),this.orientationTimeout=setTimeout(function(){this.orientationTimeout=void 0,this.optsSettings.resizeOnOrientationChange&&this.resize(),this.emit(me.MANAGERS.ORIENTATION_CHANGE,i)}.bind(this),500)}onResized(e){this.resize()}resize(e,i,t){let r=this.stage.size(e,i);if(this.winBounds=Mr(),this.orientationTimeout&&this.winBounds.width===this.winBounds.height){this._stageSize=void 0;return}this._stageSize&&this._stageSize.width===r.width&&this._stageSize.height===r.height||(this._stageSize=r,this._bounds=this.bounds(),this.clear(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.updateLayout(),this.emit(me.MANAGERS.RESIZED,{width:this._stageSize.width,height:this._stageSize.height},t))}createView(e,i){return new this.View(e,ut(this.viewSettings,{forceRight:i}))}handleNextPrePaginated(e,i,t){let r;if(this.layout.name==="pre-paginated"&&this.layout.divisor>1){if(e||i.index===0)return;if(r=i.next(),r&&!r.properties.includes("page-spread-left"))return t.call(this,r)}}display(e,i){var t=new Fe,r=t.promise;(i===e.href||tt(i))&&(i=void 0);var n=this.views.find(e);if(n&&e&&this.layout.name!=="pre-paginated"){let o=n.offset();if(this.settings.direction==="ltr")this.scrollTo(o.left,o.top,!0);else{let s=n.width();this.scrollTo(o.left+s,o.top,!0)}if(i){let s=n.locationOf(i),l=n.width();this.moveTo(s,l)}return t.resolve(),r}this.clear();let a=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&e.properties.includes("page-spread-right")&&(a=!0),this.add(e,a).then(function(o){if(i){let s=o.locationOf(i),l=o.width();this.moveTo(s,l)}}.bind(this),o=>{t.reject(o)}).then(function(){return this.handleNextPrePaginated(a,e,this.add)}.bind(this)).then(function(){this.views.show(),t.resolve()}.bind(this)),r}afterDisplayed(e){this.emit(me.MANAGERS.ADDED,e)}afterResized(e){this.emit(me.MANAGERS.RESIZE,e.section)}moveTo(e,i){var t=0,r=0;this.isPaginated?(t=Math.floor(e.left/this.layout.delta)*this.layout.delta,t+this.layout.delta>this.container.scrollWidth&&(t=this.container.scrollWidth-this.layout.delta),r=Math.floor(e.top/this.layout.delta)*this.layout.delta,r+this.layout.delta>this.container.scrollHeight&&(r=this.container.scrollHeight-this.layout.delta)):r=e.top,this.settings.direction==="rtl"&&(t=t+this.layout.delta,t=t-i),this.scrollTo(t,r,!0)}add(e,i){var t=this.createView(e,i);return this.views.append(t),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.on(me.VIEWS.AXIS,r=>{this.updateAxis(r)}),t.on(me.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),t.display(this.request)}append(e,i){var t=this.createView(e,i);return this.views.append(t),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.on(me.VIEWS.AXIS,r=>{this.updateAxis(r)}),t.on(me.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),t.display(this.request)}prepend(e,i){var t=this.createView(e,i);return t.on(me.VIEWS.RESIZED,r=>{this.counter(r)}),this.views.prepend(t),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.on(me.VIEWS.AXIS,r=>{this.updateAxis(r)}),t.on(me.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),t.display(this.request)}counter(e){this.settings.axis==="vertical"?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}next(){var e,i;let t=this.settings.direction;if(this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"&&(!t||t==="ltr")?(this.scrollLeft=this.container.scrollLeft,i=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,i<=this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):this.isPaginated&&this.settings.axis==="horizontal"&&t==="rtl"?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(i=this.container.scrollLeft,i>0?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):(i=this.container.scrollLeft+this.layout.delta*-1,i>this.container.scrollWidth*-1?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next())):this.isPaginated&&this.settings.axis==="vertical"?(this.scrollTop=this.container.scrollTop,this.container.scrollTop+this.container.offsetHeight<this.container.scrollHeight?this.scrollBy(0,this.layout.height,!0):e=this.views.last().section.next()):e=this.views.last().section.next(),e)){this.clear(),this.updateLayout();let r=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&e.properties.includes("page-spread-right")&&(r=!0),this.append(e,r).then(function(){return this.handleNextPrePaginated(r,e,this.append)}.bind(this),n=>n).then(function(){!this.isPaginated&&this.settings.axis==="horizontal"&&this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"&&this.scrollTo(this.container.scrollWidth,0,!0),this.views.show()}.bind(this))}}prev(){var e,i;let t=this.settings.direction;if(this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"&&(!t||t==="ltr")?(this.scrollLeft=this.container.scrollLeft,i=this.container.scrollLeft,i>0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):this.isPaginated&&this.settings.axis==="horizontal"&&t==="rtl"?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(i=this.container.scrollLeft+this.container.offsetWidth,i<this.container.scrollWidth?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):(i=this.container.scrollLeft,i<0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev())):this.isPaginated&&this.settings.axis==="vertical"?(this.scrollTop=this.container.scrollTop,this.container.scrollTop>0?this.scrollBy(0,-this.layout.height,!0):e=this.views.first().section.prev()):e=this.views.first().section.prev(),e)){this.clear(),this.updateLayout();let r=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&typeof e.prev()!="object"&&(r=!0),this.prepend(e,r).then(function(){var n;if(this.layout.name==="pre-paginated"&&this.layout.divisor>1&&(n=e.prev(),n))return this.prepend(n)}.bind(this),n=>n).then(function(){this.isPaginated&&this.settings.axis==="horizontal"&&(this.settings.direction==="rtl"?this.settings.rtlScrollType==="default"?this.scrollTo(0,0,!0):this.scrollTo(this.container.scrollWidth*-1+this.layout.delta,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}.bind(this))}}current(){var e=this.visible();return e.length?e[e.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.updateLayout(),this.isPaginated&&this.settings.axis==="horizontal"?this.location=this.paginatedLocation():this.location=this.scrolledLocation(),this.location}scrolledLocation(){let e=this.visible(),i=this.container.getBoundingClientRect(),t=i.height<window.innerHeight?i.height:window.innerHeight,r=i.width<window.innerWidth?i.width:window.innerWidth,n=this.settings.axis==="vertical";this.settings.direction;let a=0,o=0;return this.settings.fullsize&&(a=n?window.scrollY:window.scrollX),e.map(s=>{let{index:l,href:h}=s.section,d=s.position(),f=s.width(),v=s.height(),p,y,k,u;n?(p=a+i.top-d.top+o,y=p+t-o,u=this.layout.count(v,t).pages,k=t):(p=a+i.left-d.left+o,y=p+r-o,u=this.layout.count(f,r).pages,k=r);let m=Math.ceil(p/k),g=[],E=Math.ceil(y/k);if(this.settings.direction==="rtl"&&!n){let I=m;m=u-E,E=u-I}g=[];for(var x=m;x<=E;x++){let I=x+1;g.push(I)}let _=this.mapping.page(s.contents,s.section.cfiBase,p,y);return{index:l,href:h,pages:g,totalPages:u,mapping:_}})}paginatedLocation(){let e=this.visible(),i=this.container.getBoundingClientRect(),t=0,r=0;return this.settings.fullsize&&(t=window.scrollX),e.map(n=>{let{index:a,href:o}=n.section,s,l=n.position(),h=n.width(),d,f,v;this.settings.direction==="rtl"?(s=i.right-t,v=Math.min(Math.abs(s-l.left),this.layout.width)-r,f=l.width-(l.right-s)-r,d=f-v):(s=i.left+t,v=Math.min(l.right-s,this.layout.width)-r,d=s-l.left+r,f=d+v),r+=v;let p=this.mapping.page(n.contents,n.section.cfiBase,d,f),y=this.layout.count(h).pages,k=Math.floor(d/this.layout.pageWidth),u=[],m=Math.floor(f/this.layout.pageWidth);if(k<0&&(k=0,m=m+1),this.settings.direction==="rtl"){let E=k;k=y-m,m=y-E}for(var g=k+1;g<=m;g++){let E=g;u.push(E)}return{index:a,href:o,pages:u,totalPages:y,mapping:p}})}isVisible(e,i,t,r){var n=e.position(),a=r||this.bounds();return this.settings.axis==="horizontal"&&n.right>a.left-i&&n.left<a.right+t?!0:this.settings.axis==="vertical"&&n.bottom>a.top-i&&n.top<a.bottom+t}visible(){for(var e=this.bounds(),i=this.views.displayed(),t=i.length,r=[],n,a,o=0;o<t;o++)a=i[o],n=this.isVisible(a,0,0,e),n===!0&&r.push(a);return r}scrollBy(e,i,t){let r=this.settings.direction==="rtl"?-1:1;t&&(this.ignore=!0),this.settings.fullsize?window.scrollBy(e*r,i*r):(e&&(this.container.scrollLeft+=e*r),i&&(this.container.scrollTop+=i)),this.scrolled=!0}scrollTo(e,i,t){t&&(this.ignore=!0),this.settings.fullsize?window.scrollTo(e,i):(this.container.scrollLeft=e,this.container.scrollTop=i),this.scrolled=!0}onScroll(){let e,i;this.settings.fullsize?(e=window.scrollY,i=window.scrollX):(e=this.container.scrollTop,i=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=i,this.ignore?this.ignore=!1:(this.emit(me.MANAGERS.SCROLL,{top:e,left:i}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.emit(me.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),20))}bounds(){return this.stage.bounds()}applyLayout(e){this.layout=e,this.updateLayout(),this.views&&this.views.length>0&&this.layout.name==="pre-paginated"&&this.display(this.views.first().section)}updateLayout(){this.stage&&(this._stageSize=this.stage.size(),this.isPaginated?(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta/this.layout.divisor):this.layout.calculate(this._stageSize.width,this._stageSize.height),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}setLayout(e){this.viewSettings.layout=e,this.mapping=new ir(e.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach(function(i){i&&i.setLayout(e)})}updateWritingMode(e){this.writingMode=e}updateAxis(e,i){!i&&e===this.settings.axis||(this.settings.axis=e,this.stage&&this.stage.axis(e),this.viewSettings.axis=e,this.mapping&&(this.mapping=new ir(this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&(e==="vertical"?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))}updateFlow(e,i="auto"){let t=e==="paginated"||e==="auto";this.isPaginated=t,e==="scrolled-doc"||e==="scrolled-continuous"||e==="scrolled"?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=e,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=t?"hidden":i,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var e=[];return this.views&&this.views.forEach(function(i){const t=i&&i.contents;t&&e.push(t)}),e}direction(e="ltr"){this.settings.direction=e,this.stage&&this.stage.direction(e),this.viewSettings.direction=e,this.updateLayout()}isRendered(){return this.rendered}},(0,Ll.default)(ar.prototype)})),zl,Pl,Fl,Jr,Qc=_e((()=>{Ye(),zt(),zl=lt(Ht()),Pl=Math.PI/2,Fl={easeOutSine:function(e){return Math.sin(e*Pl)},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInOutQuint:function(e){return(e/=.5)<1?.5*Math.pow(e,5):.5*(Math.pow(e-2,5)+2)},easeInCubic:function(e){return Math.pow(e,3)}},Jr=class{constructor(e,i){this.settings=ut({duration:80,minVelocity:.2,minDistance:10,easing:Fl.easeInCubic},i||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(e)}setup(e){this.manager=e,this.layout=this.manager.layout,this.fullsize=this.manager.settings.fullsize,this.fullsize?(this.element=this.manager.stage.element,this.scroller=window,this.disableScroll()):(this.element=this.manager.stage.container,this.scroller=this.element,this.element.style.WebkitOverflowScrolling="touch"),this.manager.settings.offset=this.layout.width,this.manager.settings.afterScrolledTimeout=this.settings.duration*2,this.isVertical=this.manager.settings.axis==="vertical",!(!this.manager.isPaginated||this.isVertical)&&(this.touchCanceler=!1,this.resizeCanceler=!1,this.snapping=!1,this.scrollLeft,this.scrollTop,this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0,this.addListeners())}supportsTouch(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}disableScroll(){this.element.style.overflow="hidden"}enableScroll(){this.element.style.overflow=""}addListeners(){this._onResize=this.onResize.bind(this),window.addEventListener("resize",this._onResize),this._onScroll=this.onScroll.bind(this),this.scroller.addEventListener("scroll",this._onScroll),this._onTouchStart=this.onTouchStart.bind(this),this.scroller.addEventListener("touchstart",this._onTouchStart,{passive:!0}),this.on("touchstart",this._onTouchStart),this._onTouchMove=this.onTouchMove.bind(this),this.scroller.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.on("touchmove",this._onTouchMove),this._onTouchEnd=this.onTouchEnd.bind(this),this.scroller.addEventListener("touchend",this._onTouchEnd,{passive:!0}),this.on("touchend",this._onTouchEnd),this._afterDisplayed=this.afterDisplayed.bind(this),this.manager.on(me.MANAGERS.ADDED,this._afterDisplayed)}removeListeners(){window.removeEventListener("resize",this._onResize),this._onResize=void 0,this.scroller.removeEventListener("scroll",this._onScroll),this._onScroll=void 0,this.scroller.removeEventListener("touchstart",this._onTouchStart,{passive:!0}),this.off("touchstart",this._onTouchStart),this._onTouchStart=void 0,this.scroller.removeEventListener("touchmove",this._onTouchMove,{passive:!0}),this.off("touchmove",this._onTouchMove),this._onTouchMove=void 0,this.scroller.removeEventListener("touchend",this._onTouchEnd,{passive:!0}),this.off("touchend",this._onTouchEnd),this._onTouchEnd=void 0,this.manager.off(me.MANAGERS.ADDED,this._afterDisplayed),this._afterDisplayed=void 0}afterDisplayed(e){let i=e.contents;["touchstart","touchmove","touchend"].forEach(t=>{i.on(t,r=>this.triggerViewEvent(r,i))})}triggerViewEvent(e,i){this.emit(e.type,e,i)}onScroll(e){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop}onResize(e){this.resizeCanceler=!0}onTouchStart(e){let{screenX:i,screenY:t}=e.touches[0];this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=i,this.startTouchY=t,this.startTime=this.now()),this.endTouchX=i,this.endTouchY=t,this.endTime=this.now()}onTouchMove(e){let{screenX:i,screenY:t}=e.touches[0],r=Math.abs(t-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&r<10&&(this.element.scrollLeft-=i-this.endTouchX),this.endTouchX=i,this.endTouchY=t,this.endTime=this.now()}onTouchEnd(e){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;let i=this.wasSwiped();i!==0?this.snap(i):this.snap(),this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0}wasSwiped(){let e=this.layout.pageWidth*this.layout.divisor,i=this.endTouchX-this.startTouchX,t=Math.abs(i),r=i/(this.endTime-this.startTime),n=this.settings.minVelocity;if(t<=this.settings.minDistance||t>=e)return 0;if(r>n)return-1;if(r<-n)return 1}needsSnap(){return this.scrollLeft%(this.layout.pageWidth*this.layout.divisor)!==0}snap(e=0){let i=this.scrollLeft,t=this.layout.pageWidth*this.layout.divisor,r=Math.round(i/t)*t;return e&&(r+=e*t),this.smoothScrollTo(r)}smoothScrollTo(e){const i=new Fe,t=this.scrollLeft,r=this.now(),n=this.settings.duration,a=this.settings.easing;this.snapping=!0;function o(){const s=this.now(),l=Math.min(1,(s-r)/n);if(a(l),this.touchCanceler||this.resizeCanceler){this.resizeCanceler=!1,this.snapping=!1,i.resolve();return}l<1?(window.requestAnimationFrame(o.bind(this)),this.scrollTo(t+(e-t)*l,0)):(this.scrollTo(e,0),this.snapping=!1,i.resolve())}return o.call(this),i.promise}scrollTo(e=0,i=0){this.fullsize?window.scroll(e,i):(this.scroller.scrollLeft=e,this.scroller.scrollTop=i)}now(){return"now"in window.performance?performance.now():new Date().getTime()}destroy(){this.scroller&&(this.fullsize&&this.enableScroll(),this.removeListeners(),this.scroller=void 0)}},(0,zl.default)(Jr.prototype)})),Ml,Bl,Ul=_e((()=>{Ye(),ga(),Qc(),zt(),Ml=lt(Il()),Bl=class extends ar{constructor(e){super(e),this.name="continuous",this.settings=ut(this.settings||{},{infinite:!0,overflow:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",offset:500,offsetDelta:250,width:void 0,height:void 0,snap:!1,afterScrolledTimeout:10,allowScriptedContent:!1,allowPopups:!1}),ut(this.settings,e.settings||{}),e.settings.gap!="undefined"&&e.settings.gap===0&&(this.settings.gap=e.settings.gap),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,width:0,height:0,forceEvenPages:!1,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.scrollTop=0,this.scrollLeft=0}display(e,i){return ar.prototype.display.call(this,e,i).then(function(){return this.fill()}.bind(this))}fill(e){var i=e||new Fe;return this.q.enqueue(()=>this.check()).then(t=>{t?this.fill(i):i.resolve()}),i.promise}moveTo(e){var i=0,t=0;this.isPaginated?(i=Math.floor(e.left/this.layout.delta)*this.layout.delta,i+this.settings.offsetDelta):(t=e.top,e.top+this.settings.offsetDelta),(i>0||t>0)&&this.scrollBy(i,t,!0)}afterResized(e){this.emit(me.MANAGERS.RESIZE,e.section)}removeShownListeners(e){e.onDisplayed=function(){}}add(e){var i=this.createView(e);return this.views.append(i),i.on(me.VIEWS.RESIZED,t=>{i.expanded=!0}),i.on(me.VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(me.VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.display(this.request)}append(e){var i=this.createView(e);return i.on(me.VIEWS.RESIZED,t=>{i.expanded=!0}),i.on(me.VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(me.VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i}prepend(e){var i=this.createView(e);return i.on(me.VIEWS.RESIZED,t=>{this.counter(t),i.expanded=!0}),i.on(me.VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(me.VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),this.views.prepend(i),i.onDisplayed=this.afterDisplayed.bind(this),i}counter(e){this.settings.axis==="vertical"?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}update(e){for(var i=this.bounds(),t=this.views.all(),r=t.length,n=[],a=typeof e<"u"?e:this.settings.offset||0,o,s,l=new Fe,h=[],d=0;d<r;d++)if(s=t[d],o=this.isVisible(s,a,a,i),o===!0){if(s.displayed)s.show();else{let f=s.display(this.request).then(function(v){v.show()},v=>{s.hide()});h.push(f)}n.push(s)}else this.q.enqueue(s.destroy.bind(s)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout(function(){this.q.enqueue(this.trim.bind(this))}.bind(this),250);return h.length?Promise.all(h).catch(f=>{l.reject(f)}):(l.resolve(),l.promise)}check(e,i){var t=new Fe,r=[],n=this.settings.axis==="horizontal",a=this.settings.offset||0;e&&n&&(a=e),i&&!n&&(a=i);var o=this._bounds;let s=n?this.scrollLeft:this.scrollTop,l=n?Math.floor(o.width):o.height,h=n?this.container.scrollWidth:this.container.scrollHeight,d=this.writingMode&&this.writingMode.indexOf("vertical")===0?"vertical":"horizontal",f=this.settings.rtlScrollType,v=this.settings.direction==="rtl";this.settings.fullsize?(n&&v&&f==="negative"||!n&&v&&f==="default")&&(s=s*-1):(v&&f==="default"&&d==="horizontal"&&(s=h-l-s),v&&f==="negative"&&d==="horizontal"&&(s=s*-1));let p=()=>{let g=this.views.first(),E=g&&g.section.prev();E&&r.push(this.prepend(E))},y=()=>{let g=this.views.last(),E=g&&g.section.next();E&&r.push(this.append(E))},k=s+l+a,u=s-a;k>=h&&y(),u<0&&p();let m=r.map(g=>g.display(this.request));return r.length?Promise.all(m).then(()=>this.check()).then(()=>this.update(a),g=>g):(this.q.enqueue(function(){this.update()}.bind(this)),t.resolve(!1),t.promise)}trim(){for(var e=new Fe,i=this.views.displayed(),t=i[0],r=i[i.length-1],n=this.views.indexOf(t),a=this.views.indexOf(r),o=this.views.slice(0,n),s=this.views.slice(a+1),l=0;l<o.length-1;l++)this.erase(o[l],o);for(var h=1;h<s.length;h++)this.erase(s[h]);return e.resolve(),e.promise}erase(e,i){var t,r;this.settings.fullsize?(t=window.scrollY,r=window.scrollX):(t=this.container.scrollTop,r=this.container.scrollLeft);var n=e.bounds();this.views.remove(e),i&&(this.settings.axis==="vertical"?this.scrollTo(0,t-n.height,!0):this.settings.direction==="rtl"?this.settings.fullsize?this.scrollTo(r+Math.floor(n.width),0,!0):this.scrollTo(r,0,!0):this.scrollTo(r-Math.floor(n.width),0,!0))}addEventListeners(e){window.addEventListener("unload",function(i){this.ignore=!0,this.destroy()}.bind(this)),this.addScrollListeners(),this.isPaginated&&this.settings.snap&&(this.snapper=new Jr(this,this.settings.snap&&typeof this.settings.snap=="object"&&this.settings.snap))}addScrollListeners(){var e;this.tick=jr;let i=this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"?-1:1;this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.settings.fullsize?(e=window,this.scrollTop=window.scrollY*i,this.scrollLeft=window.scrollX*i):(e=this.container,this.scrollTop=this.container.scrollTop,this.scrollLeft=this.container.scrollLeft),this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll),this._scrolled=(0,Ml.default)(this.scrolled.bind(this),30),this.didScroll=!1}removeEventListeners(){var e;this.settings.fullsize?e=window:e=this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}onScroll(){let e,i,t=this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"?-1:1;this.settings.fullsize?(e=window.scrollY*t,i=window.scrollX*t):(e=this.container.scrollTop,i=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=i,this.ignore?this.ignore=!1:this._scrolled(),this.scrollDeltaVert+=Math.abs(e-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(i-this.prevScrollLeft),this.prevScrollTop=e,this.prevScrollLeft=i,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}.bind(this),150),clearTimeout(this.afterScrolled),this.didScroll=!1}scrolled(){this.q.enqueue(function(){return this.check()}.bind(this)),this.emit(me.MANAGERS.SCROLL,{top:this.scrollTop,left:this.scrollLeft}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.snapper&&this.snapper.supportsTouch&&this.snapper.needsSnap()||this.emit(me.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),this.settings.afterScrolledTimeout)}next(){let e=this.layout.props.name==="pre-paginated"&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"?this.scrollBy(e,0,!0):this.scrollBy(0,this.layout.height,!0),this.q.enqueue(function(){return this.check()}.bind(this)))}prev(){let e=this.layout.props.name==="pre-paginated"&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"?this.scrollBy(-e,0,!0):this.scrollBy(0,-this.layout.height,!0),this.q.enqueue(function(){return this.check()}.bind(this)))}updateFlow(e){this.rendered&&this.snapper&&(this.snapper.destroy(),this.snapper=void 0),super.updateFlow(e,"scroll"),this.rendered&&this.isPaginated&&this.settings.snap&&(this.snapper=new Jr(this,this.settings.snap&&typeof this.settings.snap=="object"&&this.settings.snap))}destroy(){super.destroy(),this.snapper&&this.snapper.destroy()}}})),Wl,sr,va=_e((()=>{Wl=lt(Ht()),Ye(),sa(),At(),oa(),bl(),Oc(),Kr(),Dc(),zt(),Cl(),ga(),Ul(),sr=class{constructor(e,i){this.settings=ut(this.settings||{},{width:null,height:null,ignoreClass:"",manager:"default",view:"iframe",flow:null,layout:null,spread:null,minSpreadWidth:800,stylesheet:null,resizeOnOrientationChange:!0,script:null,snap:!1,defaultDirection:"ltr",allowScriptedContent:!1,allowPopups:!1}),ut(this.settings,i),typeof this.settings.manager=="object"&&(this.manager=this.settings.manager),this.book=e,this.hooks={},this.hooks.display=new Rt(this),this.hooks.serialize=new Rt(this),this.hooks.content=new Rt(this),this.hooks.unloaded=new Rt(this),this.hooks.layout=new Rt(this),this.hooks.render=new Rt(this),this.hooks.show=new Rt(this),this.hooks.content.register(this.handleLinks.bind(this)),this.hooks.content.register(this.passEvents.bind(this)),this.hooks.content.register(this.adjustImages.bind(this)),this.book.spine.hooks.content.register(this.injectIdentifier.bind(this)),this.settings.stylesheet&&this.book.spine.hooks.content.register(this.injectStylesheet.bind(this)),this.settings.script&&this.book.spine.hooks.content.register(this.injectScript.bind(this)),this.themes=new _l(this),this.annotations=new Sl(this),this.epubcfi=new Ze,this.q=new Xr(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new Fe,this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(e){this.manager=e}requireManager(e){var i;return typeof e=="string"&&e==="default"?i=ar:typeof e=="string"&&e==="continuous"?i=Bl:i=e,i}requireView(e){var i;return typeof e=="string"&&e==="iframe"?i=pa:i=e,i}start(){switch(!this.settings.layout&&(this.book.package.metadata.layout==="pre-paginated"||this.book.displayOptions.fixedLayout==="true")&&(this.settings.layout="pre-paginated"),this.book.package.metadata.spread){case"none":this.settings.spread="none";break;case"both":this.settings.spread=!0;break}this.manager||(this.ViewManager=this.requireManager(this.settings.manager),this.View=this.requireView(this.settings.view),this.manager=new this.ViewManager({view:this.View,queue:this.q,request:this.book.load.bind(this.book),settings:this.settings})),this.direction(this.book.package.metadata.direction||this.settings.defaultDirection),this.settings.globalLayoutProperties=this.determineLayoutProperties(this.book.package.metadata),this.flow(this.settings.globalLayoutProperties.flow),this.layout(this.settings.globalLayoutProperties),this.manager.on(me.MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on(me.MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on(me.MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on(me.MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on(me.MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit(me.RENDITION.STARTED),this.starting.resolve()}attachTo(e){return this.q.enqueue(function(){this.manager.render(e,{width:this.settings.width,height:this.settings.height}),this.emit(me.RENDITION.ATTACHED)}.bind(this))}display(e){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,e)}_display(e){if(this.book){this.epubcfi.isCfiString(e);var i=new Fe,t=i.promise,r;return this.displaying=i,this.book.locations.length()&&Xo(e)&&(e=this.book.locations.cfiFromPercentage(parseFloat(e))),r=this.book.spine.get(e),r?(this.manager.display(r,e).then(()=>{i.resolve(r),this.displaying=void 0,this.emit(me.RENDITION.DISPLAYED,r),this.reportLocation()},n=>{this.emit(me.RENDITION.DISPLAY_ERROR,n)}),t):(i.reject(new Error("No Section Found")),t)}}afterDisplayed(e){e.on(me.VIEWS.MARK_CLICKED,(i,t)=>this.triggerMarkEvent(i,t,e.contents)),this.hooks.render.trigger(e,this).then(()=>{e.contents?this.hooks.content.trigger(e.contents,this).then(()=>{this.emit(me.RENDITION.RENDERED,e.section,e)}):this.emit(me.RENDITION.RENDERED,e.section,e)})}afterRemoved(e){this.hooks.unloaded.trigger(e,this).then(()=>{this.emit(me.RENDITION.REMOVED,e.section,e)})}onResized(e,i){this.emit(me.RENDITION.RESIZED,{width:e.width,height:e.height},i),this.location&&this.location.start&&this.display(i||this.location.start.cfi)}onOrientationChange(e){this.emit(me.RENDITION.ORIENTATION_CHANGE,e)}moveTo(e){this.manager.moveTo(e)}resize(e,i,t){e&&(this.settings.width=e),i&&(this.settings.height=i),this.manager.resize(e,i,t)}clear(){this.manager.clear()}next(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))}prev(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))}determineLayoutProperties(e){var i,t=this.settings.layout||e.layout||"reflowable",r=this.settings.spread||e.spread||"auto",n=this.settings.orientation||e.orientation||"auto",a=this.settings.flow||e.flow||"auto",o=e.viewport||"",s=this.settings.minSpreadWidth||e.minSpreadWidth||800,l=this.settings.direction||e.direction||"ltr";return(this.settings.width===0||this.settings.width>0)&&(this.settings.height===0||this.settings.height>0),i={layout:t,spread:r,orientation:n,flow:a,viewport:o,minSpreadWidth:s,direction:l},i}flow(e){var i=e;(e==="scrolled"||e==="scrolled-doc"||e==="scrolled-continuous")&&(i="scrolled"),(e==="auto"||e==="paginated")&&(i="paginated"),this.settings.flow=e,this._layout&&this._layout.flow(i),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(i),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(e){return e&&(this._layout=new Yr(e),this._layout.spread(e.spread,this.settings.minSpreadWidth),this._layout.on(me.LAYOUT.UPDATED,(i,t)=>{this.emit(me.RENDITION.LAYOUT,i,t)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(e,i){this.settings.spread=e,i&&(this.settings.minSpreadWidth=i),this._layout&&this._layout.spread(e,i),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(e){this.settings.direction=e||"ltr",this.manager&&this.manager.direction(this.settings.direction),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}reportLocation(){return this.q.enqueue(function(){requestAnimationFrame(function(){var t=this.manager.currentLocation();if(t&&t.then&&typeof t.then=="function")t.then(function(r){let n=this.located(r);!n||!n.start||!n.end||(this.location=n,this.emit(me.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(me.RENDITION.RELOCATED,this.location))}.bind(this));else if(t){let r=this.located(t);if(!r||!r.start||!r.end)return;this.location=r,this.emit(me.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(me.RENDITION.RELOCATED,this.location)}}.bind(this))}.bind(this))}currentLocation(){var e=this.manager.currentLocation();if(e&&e.then&&typeof e.then=="function")e.then(function(i){return this.located(i)}.bind(this));else if(e)return this.located(e)}located(e){if(!e.length)return{};let i=e[0],t=e[e.length-1],r={start:{index:i.index,href:i.href,cfi:i.mapping.start,displayed:{page:i.pages[0]||1,total:i.totalPages}},end:{index:t.index,href:t.href,cfi:t.mapping.end,displayed:{page:t.pages[t.pages.length-1]||1,total:t.totalPages}}},n=this.book.locations.locationFromCfi(i.mapping.start),a=this.book.locations.locationFromCfi(t.mapping.end);n!=null&&(r.start.location=n,r.start.percentage=this.book.locations.percentageFromLocation(n)),a!=null&&(r.end.location=a,r.end.percentage=this.book.locations.percentageFromLocation(a));let o=this.book.pageList.pageFromCfi(i.mapping.start),s=this.book.pageList.pageFromCfi(t.mapping.end);return o!=-1&&(r.start.page=o),s!=-1&&(r.end.page=s),t.index===this.book.spine.last().index&&r.end.displayed.page>=r.end.displayed.total&&(r.atEnd=!0),i.index===this.book.spine.first().index&&r.start.displayed.page===1&&(r.atStart=!0),r}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(e){tr.forEach(i=>{e.on(i,t=>this.triggerViewEvent(t,e))}),e.on(me.CONTENTS.SELECTED,i=>this.triggerSelectedEvent(i,e))}triggerViewEvent(e,i){this.emit(e.type,e,i)}triggerSelectedEvent(e,i){this.emit(me.RENDITION.SELECTED,e,i)}triggerMarkEvent(e,i,t){this.emit(me.RENDITION.MARK_CLICKED,e,i,t)}getRange(e,i){var t=new Ze(e),r=this.manager.visible().filter(function(n){if(t.spinePos===n.index)return!0});if(r.length)return r[0].contents.range(t,i)}adjustImages(e){if(this._layout.name==="pre-paginated")return new Promise(function(n){n()});let i=e.window.getComputedStyle(e.content,null),t=(e.content.offsetHeight-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)))*.95,r=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight);return e.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-r+"px":"100%")+"!important","max-height":t+"px!important","object-fit":"contain","page-break-inside":"avoid","break-inside":"avoid","box-sizing":"border-box"},svg:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-r+"px":"100%")+"!important","max-height":t+"px!important","page-break-inside":"avoid","break-inside":"avoid"}}),new Promise(function(n,a){setTimeout(function(){n()},1)})}getContents(){return this.manager?this.manager.getContents():[]}views(){return(this.manager?this.manager.views:void 0)||[]}handleLinks(e){e&&e.on(me.CONTENTS.LINK_CLICKED,i=>{let t=this.book.path.relative(i);this.display(t)})}injectStylesheet(e,i){let t=e.createElement("link");t.setAttribute("type","text/css"),t.setAttribute("rel","stylesheet"),t.setAttribute("href",this.settings.stylesheet),e.getElementsByTagName("head")[0].appendChild(t)}injectScript(e,i){let t=e.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",this.settings.script),t.textContent=" ",e.getElementsByTagName("head")[0].appendChild(t)}injectIdentifier(e,i){let t=this.book.packaging.metadata.identifier,r=e.createElement("meta");r.setAttribute("name","dc.relation.ispartof"),t&&r.setAttribute("content",t),e.getElementsByTagName("head")[0].appendChild(r)}},(0,Wl.default)(sr.prototype)})),ef=Ae(((e,i)=>{(function(t){if(typeof e=="object"&&typeof i<"u")i.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var r;typeof window<"u"?r=window:typeof global<"u"?r=global:typeof self<"u"?r=self:r=this,r.JSZip=t()}})(function(){return(function t(r,n,a){function o(h,d){if(!n[h]){if(!r[h]){var f=typeof require=="function"&&require;if(!d&&f)return f(h,!0);if(s)return s(h,!0);var v=new Error("Cannot find module '"+h+"'");throw v.code="MODULE_NOT_FOUND",v}var p=n[h]={exports:{}};r[h][0].call(p.exports,function(y){var k=r[h][1][y];return o(k||y)},p,p.exports,t,r,n,a)}return n[h].exports}for(var s=typeof require=="function"&&require,l=0;l<a.length;l++)o(a[l]);return o})({1:[function(t,r,n){"use strict";var a=t("./utils"),o=t("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(l){for(var h=[],d,f,v,p,y,k,u,m=0,g=l.length,E=g,x=a.getTypeOf(l)!=="string";m<l.length;)E=g-m,x?(d=l[m++],f=m<g?l[m++]:0,v=m<g?l[m++]:0):(d=l.charCodeAt(m++),f=m<g?l.charCodeAt(m++):0,v=m<g?l.charCodeAt(m++):0),p=d>>2,y=(d&3)<<4|f>>4,k=E>1?(f&15)<<2|v>>6:64,u=E>2?v&63:64,h.push(s.charAt(p)+s.charAt(y)+s.charAt(k)+s.charAt(u));return h.join("")},n.decode=function(l){var h,d,f,v,p,y,k,u=0,m=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");l=l.replace(/[^A-Za-z0-9+/=]/g,"");var E=l.length*3/4;if(l.charAt(l.length-1)===s.charAt(64)&&E--,l.charAt(l.length-2)===s.charAt(64)&&E--,E%1!==0)throw new Error("Invalid base64 input, bad content length.");var x;for(o.uint8array?x=new Uint8Array(E|0):x=new Array(E|0);u<l.length;)v=s.indexOf(l.charAt(u++)),p=s.indexOf(l.charAt(u++)),y=s.indexOf(l.charAt(u++)),k=s.indexOf(l.charAt(u++)),h=v<<2|p>>4,d=(p&15)<<4|y>>2,f=(y&3)<<6|k,x[m++]=h,y!==64&&(x[m++]=d),k!==64&&(x[m++]=f);return x}},{"./support":30,"./utils":32}],2:[function(t,r,n){"use strict";var a=t("./external"),o=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function h(d,f,v,p,y){this.compressedSize=d,this.uncompressedSize=f,this.crc32=v,this.compression=p,this.compressedContent=y}h.prototype={getContentWorker:function(){var d=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},h.createWorkerFrom=function(d,f,v){return d.pipe(new s).pipe(new l("uncompressedSize")).pipe(f.compressWorker(v)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=h},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,r,n){"use strict";var a=t("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},n.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,r,n){"use strict";var a=t("./utils");function o(){for(var d,f=[],v=0;v<256;v++){d=v;for(var p=0;p<8;p++)d=d&1?3988292384^d>>>1:d>>>1;f[v]=d}return f}var s=o();function l(d,f,v,p){var y=s,k=p+v;d=d^-1;for(var u=p;u<k;u++)d=d>>>8^y[(d^f[u])&255];return d^-1}function h(d,f,v,p){var y=s,k=p+v;d=d^-1;for(var u=p;u<k;u++)d=d>>>8^y[(d^f.charCodeAt(u))&255];return d^-1}r.exports=function(f,v){return typeof f>"u"||!f.length?0:a.getTypeOf(f)!=="string"?l(v|0,f,f.length,0):h(v|0,f,f.length,0)}},{"./utils":32}],5:[function(t,r,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(t,r,n){"use strict";var a=null;typeof Promise<"u"?a=Promise:a=t("lie"),r.exports={Promise:a}},{lie:37}],7:[function(t,r,n){"use strict";var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=t("pako"),s=t("./utils"),l=t("./stream/GenericWorker"),h=a?"uint8array":"array";n.magic="\b\0";function d(f,v){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=v,this.meta={}}s.inherits(d,l),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(h,f.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(v){f.push({data:v,meta:f.meta})}},n.compressWorker=function(f){return new d("Deflate",f)},n.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,r,n){"use strict";var a=t("../utils"),o=t("../stream/GenericWorker"),s=t("../utf8"),l=t("../crc32"),h=t("../signature"),d=function(m,g){var E="",x;for(x=0;x<g;x++)E+=String.fromCharCode(m&255),m=m>>>8;return E},f=function(m,g){var E=m;return m||(E=g?16893:33204),(E&65535)<<16},v=function(m){return(m||0)&63},p=function(m,g,E,x,_,I){var A=m.file,D=m.compression,z=I!==s.utf8encode,O=a.transformTo("string",I(A.name)),F=a.transformTo("string",s.utf8encode(A.name)),W=A.comment,q=a.transformTo("string",I(W)),re=a.transformTo("string",s.utf8encode(W)),K=F.length!==A.name.length,de=re.length!==W.length,ue,te,fe="",ee="",Se="",be=A.dir,Ce=A.date,Le={crc32:0,compressedSize:0,uncompressedSize:0};(!g||E)&&(Le.crc32=m.crc32,Le.compressedSize=m.compressedSize,Le.uncompressedSize=m.uncompressedSize);var Oe=0;g&&(Oe|=8),!z&&(K||de)&&(Oe|=2048);var Re=0,ve=0;be&&(Re|=16),_==="UNIX"?(ve=798,Re|=f(A.unixPermissions,be)):(ve=20,Re|=v(A.dosPermissions,be)),ue=Ce.getUTCHours(),ue=ue<<6,ue=ue|Ce.getUTCMinutes(),ue=ue<<5,ue=ue|Ce.getUTCSeconds()/2,te=Ce.getUTCFullYear()-1980,te=te<<4,te=te|Ce.getUTCMonth()+1,te=te<<5,te=te|Ce.getUTCDate(),K&&(ee=d(1,1)+d(l(O),4)+F,fe+="up"+d(ee.length,2)+ee),de&&(Se=d(1,1)+d(l(q),4)+re,fe+="uc"+d(Se.length,2)+Se);var ge="";return ge+=`
|
|
16
|
+
\0`,ge+=d(Oe,2),ge+=D.magic,ge+=d(ue,2),ge+=d(te,2),ge+=d(Le.crc32,4),ge+=d(Le.compressedSize,4),ge+=d(Le.uncompressedSize,4),ge+=d(O.length,2),ge+=d(fe.length,2),{fileRecord:h.LOCAL_FILE_HEADER+ge+O+fe,dirRecord:h.CENTRAL_FILE_HEADER+d(ve,2)+ge+d(q.length,2)+"\0\0\0\0"+d(Re,4)+d(x,4)+O+fe+q}},y=function(m,g,E,x,_){var I="",A=a.transformTo("string",_(x));return I=h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(m,2)+d(m,2)+d(g,4)+d(E,4)+d(A.length,2)+A,I},k=function(m){var g="";return g=h.DATA_DESCRIPTOR+d(m.crc32,4)+d(m.compressedSize,4)+d(m.uncompressedSize,4),g};function u(m,g,E,x){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=E,this.encodeFileName=x,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(m){var g=m.meta.percent||0,E=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,o.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:E?(g+100*(E-x-1))/E:100}}))},u.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var g=this.streamFiles&&!m.file.dir;if(g){var E=p(m,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:E.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(m){this.accumulate=!1;var g=this.streamFiles&&!m.file.dir,E=p(m,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(E.dirRecord),g)this.push({data:k(m),meta:{percent:100}});else for(this.push({data:E.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var m=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var E=this.bytesWritten-m,x=y(this.dirRecords.length,E,m,this.zipComment,this.encodeFileName);this.push({data:x,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(m){this._sources.push(m);var g=this;return m.on("data",function(E){g.processChunk(E)}),m.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),m.on("error",function(E){g.error(E)}),this},u.prototype.resume=function(){if(!o.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0},u.prototype.error=function(m){var g=this._sources;if(!o.prototype.error.call(this,m))return!1;for(var E=0;E<g.length;E++)try{g[E].error(m)}catch{}return!0},u.prototype.lock=function(){o.prototype.lock.call(this);for(var m=this._sources,g=0;g<m.length;g++)m[g].lock()},r.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,r,n){"use strict";var a=t("../compressions"),o=t("./ZipFileWorker"),s=function(l,h){var d=l||h,f=a[d];if(!f)throw new Error(d+" is not a valid compression method !");return f};n.generateWorker=function(l,h,d){var f=new o(h.streamFiles,d,h.platform,h.encodeFileName),v=0;try{l.forEach(function(p,y){v++;var k=s(y.options.compression,h.compression),u=y.options.compressionOptions||h.compressionOptions||{},m=y.dir,g=y.date;y._compressWorker(k,u).withStreamInfo("file",{name:p,dir:m,date:g,comment:y.comment||"",unixPermissions:y.unixPermissions,dosPermissions:y.dosPermissions}).pipe(f)}),f.entriesCount=v}catch(p){f.error(p)}return f}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,r,n){"use strict";function a(){if(!(this instanceof a))return new a;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new a;for(var s in this)typeof this[s]!="function"&&(o[s]=this[s]);return o}}a.prototype=t("./object"),a.prototype.loadAsync=t("./load"),a.support=t("./support"),a.defaults=t("./defaults"),a.version="3.10.1",a.loadAsync=function(o,s){return new a().loadAsync(o,s)},a.external=t("./external"),r.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,r,n){"use strict";var a=t("./utils"),o=t("./external"),s=t("./utf8"),l=t("./zipEntries"),h=t("./stream/Crc32Probe"),d=t("./nodejsUtils");function f(v){return new o.Promise(function(p,y){var k=v.decompressed.getContentWorker().pipe(new h);k.on("error",function(u){y(u)}).on("end",function(){k.streamInfo.crc32!==v.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):p()}).resume()})}r.exports=function(v,p){var y=this;return p=a.extend(p||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),d.isNode&&d.isStream(v)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",v,!0,p.optimizedBinaryString,p.base64).then(function(k){var u=new l(p);return u.load(k),u}).then(function(u){var m=[o.Promise.resolve(u)],g=u.files;if(p.checkCRC32)for(var E=0;E<g.length;E++)m.push(f(g[E]));return o.Promise.all(m)}).then(function(u){for(var m=u.shift(),g=m.files,E=0;E<g.length;E++){var x=g[E],_=x.fileNameStr,I=a.resolve(x.fileNameStr);y.file(I,x.decompressed,{binary:!0,optimizedBinaryString:!0,date:x.date,dir:x.dir,comment:x.fileCommentStr.length?x.fileCommentStr:null,unixPermissions:x.unixPermissions,dosPermissions:x.dosPermissions,createFolders:p.createFolders}),x.dir||(y.file(I).unsafeOriginalName=_)}return m.zipComment.length&&(y.comment=m.zipComment),y})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,r,n){"use strict";var a=t("../utils"),o=t("../stream/GenericWorker");function s(l,h){o.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(h)}a.inherits(s,o),s.prototype._bindStream=function(l){var h=this;this._stream=l,l.pause(),l.on("data",function(d){h.push({data:d,meta:{percent:0}})}).on("error",function(d){h.isPaused?this.generatedError=d:h.error(d)}).on("end",function(){h.isPaused?h._upstreamEnded=!0:h.end()})},s.prototype.pause=function(){return o.prototype.pause.call(this)?(this._stream.pause(),!0):!1},s.prototype.resume=function(){return o.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1},r.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,r,n){"use strict";var a=t("readable-stream").Readable;t("../utils").inherits(o,a);function o(s,l,h){a.call(this,l),this._helper=s;var d=this;s.on("data",function(f,v){d.push(f)||d._helper.pause(),h&&h(v)}).on("error",function(f){d.emit("error",f)}).on("end",function(){d.push(null)})}o.prototype._read=function(){this._helper.resume()},r.exports=o},{"../utils":32,"readable-stream":16}],14:[function(t,r,n){"use strict";r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(a,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,o);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,o)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var o=new Buffer(a);return o.fill(0),o},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(t,r,n){"use strict";var a=t("./utf8"),o=t("./utils"),s=t("./stream/GenericWorker"),l=t("./stream/StreamHelper"),h=t("./defaults"),d=t("./compressedObject"),f=t("./zipObject"),v=t("./generate"),p=t("./nodejsUtils"),y=t("./nodejs/NodejsStreamInputAdapter"),k=function(x,_,I){var A=o.getTypeOf(_),D,z=o.extend(I||{},h);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&z.unixPermissions&16384&&(z.dir=!0),z.dosPermissions&&z.dosPermissions&16&&(z.dir=!0),z.dir&&(x=m(x)),z.createFolders&&(D=u(x))&&g.call(this,D,!0);var O=A==="string"&&z.binary===!1&&z.base64===!1;(!I||typeof I.binary>"u")&&(z.binary=!O),(_ instanceof d&&_.uncompressedSize===0||z.dir||!_||_.length===0)&&(z.base64=!1,z.binary=!0,_="",z.compression="STORE",A="string");var F=null;_ instanceof d||_ instanceof s?F=_:p.isNode&&p.isStream(_)?F=new y(x,_):F=o.prepareContent(x,_,z.binary,z.optimizedBinaryString,z.base64);var W=new f(x,F,z);this.files[x]=W},u=function(x){x.slice(-1)==="/"&&(x=x.substring(0,x.length-1));var _=x.lastIndexOf("/");return _>0?x.substring(0,_):""},m=function(x){return x.slice(-1)!=="/"&&(x+="/"),x},g=function(x,_){return _=typeof _<"u"?_:h.createFolders,x=m(x),this.files[x]||k.call(this,x,null,{dir:!0,createFolders:_}),this.files[x]};function E(x){return Object.prototype.toString.call(x)==="[object RegExp]"}r.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(x){var _,I,A;for(_ in this.files)A=this.files[_],I=_.slice(this.root.length,_.length),I&&_.slice(0,this.root.length)===this.root&&x(I,A)},filter:function(x){var _=[];return this.forEach(function(I,A){x(I,A)&&_.push(A)}),_},file:function(x,_,I){if(arguments.length===1)if(E(x)){var A=x;return this.filter(function(z,O){return!O.dir&&A.test(z)})}else{var D=this.files[this.root+x];return D&&!D.dir?D:null}else x=this.root+x,k.call(this,x,_,I);return this},folder:function(x){if(!x)return this;if(E(x))return this.filter(function(D,z){return z.dir&&x.test(D)});var _=this.root+x,I=g.call(this,_),A=this.clone();return A.root=I.name,A},remove:function(x){x=this.root+x;var _=this.files[x];if(_||(x.slice(-1)!=="/"&&(x+="/"),_=this.files[x]),_&&!_.dir)delete this.files[x];else for(var I=this.filter(function(D,z){return z.name.slice(0,x.length)===x}),A=0;A<I.length;A++)delete this.files[I[A].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(x){var _,I={};try{if(I=o.extend(x||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode}),I.type=I.type.toLowerCase(),I.compression=I.compression.toUpperCase(),I.type==="binarystring"&&(I.type="string"),!I.type)throw new Error("No output type specified.");o.checkSupport(I.type),(I.platform==="darwin"||I.platform==="freebsd"||I.platform==="linux"||I.platform==="sunos")&&(I.platform="UNIX"),I.platform==="win32"&&(I.platform="DOS");var A=I.comment||this.comment||"";_=v.generateWorker(this,I,A)}catch(D){_=new s("error"),_.error(D)}return new l(_,I.type||"string",I.mimeType)},generateAsync:function(x,_){return this.generateInternalStream(x).accumulate(_)},generateNodeStream:function(x,_){return x=x||{},x.type||(x.type="nodebuffer"),this.generateInternalStream(x).toNodejsStream(_)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,r,n){"use strict";r.exports=t("stream")},{stream:void 0}],17:[function(t,r,n){"use strict";var a=t("./DataReader"),o=t("../utils");function s(l){a.call(this,l);for(var h=0;h<this.data.length;h++)l[h]=l[h]&255}o.inherits(s,a),s.prototype.byteAt=function(l){return this.data[this.zero+l]},s.prototype.lastIndexOfSignature=function(l){for(var h=l.charCodeAt(0),d=l.charCodeAt(1),f=l.charCodeAt(2),v=l.charCodeAt(3),p=this.length-4;p>=0;--p)if(this.data[p]===h&&this.data[p+1]===d&&this.data[p+2]===f&&this.data[p+3]===v)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(l){var h=l.charCodeAt(0),d=l.charCodeAt(1),f=l.charCodeAt(2),v=l.charCodeAt(3),p=this.readData(4);return h===p[0]&&d===p[1]&&f===p[2]&&v===p[3]},s.prototype.readData=function(l){if(this.checkOffset(l),l===0)return[];var h=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,h},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(t,r,n){"use strict";var a=t("../utils");function o(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var l=0,h;for(this.checkOffset(s),h=this.index+s-1;h>=this.index;h--)l=(l<<8)+this.byteAt(h);return this.index+=s,l},readString:function(s){return a.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC((s>>25&127)+1980,(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(s&31)<<1))}},r.exports=o},{"../utils":32}],19:[function(t,r,n){"use strict";var a=t("./Uint8ArrayReader"),o=t("../utils");function s(l){a.call(this,l)}o.inherits(s,a),s.prototype.readData=function(l){this.checkOffset(l);var h=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,h},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,r,n){"use strict";var a=t("./DataReader"),o=t("../utils");function s(l){a.call(this,l)}o.inherits(s,a),s.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},s.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},s.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},s.prototype.readData=function(l){this.checkOffset(l);var h=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,h},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(t,r,n){"use strict";var a=t("./ArrayReader"),o=t("../utils");function s(l){a.call(this,l)}o.inherits(s,a),s.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var h=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,h},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(t,r,n){"use strict";var a=t("../utils"),o=t("../support"),s=t("./ArrayReader"),l=t("./StringReader"),h=t("./NodeBufferReader"),d=t("./Uint8ArrayReader");r.exports=function(f){var v=a.getTypeOf(f);return a.checkSupport(v),v==="string"&&!o.uint8array?new l(f):v==="nodebuffer"?new h(f):o.uint8array?new d(a.transformTo("uint8array",f)):new s(a.transformTo("array",f))}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,r,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,r,n){"use strict";var a=t("./GenericWorker"),o=t("../utils");function s(l){a.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(s,a),s.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,r,n){"use strict";var a=t("./GenericWorker"),o=t("../crc32"),s=t("../utils");function l(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}s.inherits(l,a),l.prototype.processChunk=function(h){this.streamInfo.crc32=o(h.data,this.streamInfo.crc32||0),this.push(h)},r.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,r,n){"use strict";var a=t("../utils"),o=t("./GenericWorker");function s(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}a.inherits(s,o),s.prototype.processChunk=function(l){if(l){var h=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=h+l.data.length}o.prototype.processChunk.call(this,l)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,r,n){"use strict";var a=t("../utils"),o=t("./GenericWorker"),s=16*1024;function l(h){o.call(this,"DataWorker");var d=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,h.then(function(f){d.dataIsReady=!0,d.data=f,d.max=f&&f.length||0,d.type=a.getTypeOf(f),d.isPaused||d._tickAndRepeat()},function(f){d.error(f)})}a.inherits(l,o),l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return o.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0):!1},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var h=s,d=null,f=Math.min(this.max,this.index+h);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,f);break;case"uint8array":d=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":d=this.data.slice(this.index,f);break}return this.index=f,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(t,r,n){"use strict";function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return this.isFinished?!1:(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,s){return this._listeners[o].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,s){if(this._listeners[o])for(var l=0;l<this._listeners[o].length;l++)this._listeners[o][l].call(this,s)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var s=this;return o.on("data",function(l){s.processChunk(l)}),o.on("end",function(){s.end()}),o.on("error",function(l){s.error(l)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var o=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,s){return this.extraStreamInfo[o]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=a},{}],29:[function(t,r,n){"use strict";var a=t("../utils"),o=t("./ConvertWorker"),s=t("./GenericWorker"),l=t("../base64"),h=t("../support"),d=t("../external"),f=null;if(h.nodestream)try{f=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function v(u,m,g){switch(u){case"blob":return a.newBlob(a.transformTo("arraybuffer",m),g);case"base64":return l.encode(m);default:return a.transformTo(u,m)}}function p(u,m){var g,E=0,x=null,_=0;for(g=0;g<m.length;g++)_+=m[g].length;switch(u){case"string":return m.join("");case"array":return Array.prototype.concat.apply([],m);case"uint8array":for(x=new Uint8Array(_),g=0;g<m.length;g++)x.set(m[g],E),E+=m[g].length;return x;case"nodebuffer":return Buffer.concat(m);default:throw new Error("concat : unsupported type '"+u+"'")}}function y(u,m){return new d.Promise(function(g,E){var x=[],_=u._internalType,I=u._outputType,A=u._mimeType;u.on("data",function(D,z){x.push(D),m&&m(z)}).on("error",function(D){x=[],E(D)}).on("end",function(){try{g(v(I,p(_,x),A))}catch(D){E(D)}x=[]}).resume()})}function k(u,m,g){var E=m;switch(m){case"blob":case"arraybuffer":E="uint8array";break;case"base64":E="string";break}try{this._internalType=E,this._outputType=m,this._mimeType=g,a.checkSupport(E),this._worker=u.pipe(new o(E)),u.lock()}catch(x){this._worker=new s("error"),this._worker.error(x)}}k.prototype={accumulate:function(u){return y(this,u)},on:function(u,m){var g=this;return u==="data"?this._worker.on(u,function(E){m.call(g,E.data,E.meta)}):this._worker.on(u,function(){a.delay(m,arguments,g)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(u){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},u)}},r.exports=k},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,r,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",n.nodebuffer=typeof Buffer<"u",n.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")n.blob=!1;else{var a=new ArrayBuffer(0);try{n.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),n.blob=o.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!t("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(t,r,n){"use strict";for(var a=t("./utils"),o=t("./support"),s=t("./nodejsUtils"),l=t("./stream/GenericWorker"),h=new Array(256),d=0;d<256;d++)h[d]=d>=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;h[254]=h[254]=1;var f=function(u){var m,g,E,x,_,I=u.length,A=0;for(x=0;x<I;x++)g=u.charCodeAt(x),(g&64512)===55296&&x+1<I&&(E=u.charCodeAt(x+1),(E&64512)===56320&&(g=65536+(g-55296<<10)+(E-56320),x++)),A+=g<128?1:g<2048?2:g<65536?3:4;for(o.uint8array?m=new Uint8Array(A):m=new Array(A),_=0,x=0;_<A;x++)g=u.charCodeAt(x),(g&64512)===55296&&x+1<I&&(E=u.charCodeAt(x+1),(E&64512)===56320&&(g=65536+(g-55296<<10)+(E-56320),x++)),g<128?m[_++]=g:g<2048?(m[_++]=192|g>>>6,m[_++]=128|g&63):g<65536?(m[_++]=224|g>>>12,m[_++]=128|g>>>6&63,m[_++]=128|g&63):(m[_++]=240|g>>>18,m[_++]=128|g>>>12&63,m[_++]=128|g>>>6&63,m[_++]=128|g&63);return m},v=function(u,m){var g;for(m=m||u.length,m>u.length&&(m=u.length),g=m-1;g>=0&&(u[g]&192)===128;)g--;return g<0||g===0?m:g+h[u[g]]>m?g:m},p=function(u){var m,g,E,x,_=u.length,I=new Array(_*2);for(g=0,m=0;m<_;){if(E=u[m++],E<128){I[g++]=E;continue}if(x=h[E],x>4){I[g++]=65533,m+=x-1;continue}for(E&=x===2?31:x===3?15:7;x>1&&m<_;)E=E<<6|u[m++]&63,x--;if(x>1){I[g++]=65533;continue}E<65536?I[g++]=E:(E-=65536,I[g++]=55296|E>>10&1023,I[g++]=56320|E&1023)}return I.length!==g&&(I.subarray?I=I.subarray(0,g):I.length=g),a.applyFromCharCode(I)};n.utf8encode=function(m){return o.nodebuffer?s.newBufferFrom(m,"utf-8"):f(m)},n.utf8decode=function(m){return o.nodebuffer?a.transformTo("nodebuffer",m).toString("utf-8"):(m=a.transformTo(o.uint8array?"uint8array":"array",m),p(m))};function y(){l.call(this,"utf-8 decode"),this.leftOver=null}a.inherits(y,l),y.prototype.processChunk=function(u){var m=a.transformTo(o.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=m;m=new Uint8Array(g.length+this.leftOver.length),m.set(this.leftOver,0),m.set(g,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var E=v(m),x=m;E!==m.length&&(o.uint8array?(x=m.subarray(0,E),this.leftOver=m.subarray(E,m.length)):(x=m.slice(0,E),this.leftOver=m.slice(E,m.length))),this.push({data:n.utf8decode(x),meta:u.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=y;function k(){l.call(this,"utf-8 encode")}a.inherits(k,l),k.prototype.processChunk=function(u){this.push({data:n.utf8encode(u.data),meta:u.meta})},n.Utf8EncodeWorker=k},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,r,n){"use strict";var a=t("./support"),o=t("./base64"),s=t("./nodejsUtils"),l=t("./external");t("setimmediate");function h(u){var m=null;return a.uint8array?m=new Uint8Array(u.length):m=new Array(u.length),f(u,m)}n.newBlob=function(u,m){n.checkSupport("blob");try{return new Blob([u],{type:m})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(u),g.getBlob(m)}catch{throw new Error("Bug : can't construct the Blob.")}}};function d(u){return u}function f(u,m){for(var g=0;g<u.length;++g)m[g]=u.charCodeAt(g)&255;return m}var v={stringifyByChunk:function(u,m,g){var E=[],x=0,_=u.length;if(_<=g)return String.fromCharCode.apply(null,u);for(;x<_;)m==="array"||m==="nodebuffer"?E.push(String.fromCharCode.apply(null,u.slice(x,Math.min(x+g,_)))):E.push(String.fromCharCode.apply(null,u.subarray(x,Math.min(x+g,_)))),x+=g;return E.join("")},stringifyByChar:function(u){for(var m="",g=0;g<u.length;g++)m+=String.fromCharCode(u[g]);return m},applyCanBeUsed:{uint8array:(function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}})()}};function p(u){var m=65536,g=n.getTypeOf(u),E=!0;if(g==="uint8array"?E=v.applyCanBeUsed.uint8array:g==="nodebuffer"&&(E=v.applyCanBeUsed.nodebuffer),E)for(;m>1;)try{return v.stringifyByChunk(u,g,m)}catch{m=Math.floor(m/2)}return v.stringifyByChar(u)}n.applyFromCharCode=p;function y(u,m){for(var g=0;g<u.length;g++)m[g]=u[g];return m}var k={};k.string={string:d,array:function(u){return f(u,new Array(u.length))},arraybuffer:function(u){return k.string.uint8array(u).buffer},uint8array:function(u){return f(u,new Uint8Array(u.length))},nodebuffer:function(u){return f(u,s.allocBuffer(u.length))}},k.array={string:p,array:d,arraybuffer:function(u){return new Uint8Array(u).buffer},uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return s.newBufferFrom(u)}},k.arraybuffer={string:function(u){return p(new Uint8Array(u))},array:function(u){return y(new Uint8Array(u),new Array(u.byteLength))},arraybuffer:d,uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return s.newBufferFrom(new Uint8Array(u))}},k.uint8array={string:p,array:function(u){return y(u,new Array(u.length))},arraybuffer:function(u){return u.buffer},uint8array:d,nodebuffer:function(u){return s.newBufferFrom(u)}},k.nodebuffer={string:p,array:function(u){return y(u,new Array(u.length))},arraybuffer:function(u){return k.nodebuffer.uint8array(u).buffer},uint8array:function(u){return y(u,new Uint8Array(u.length))},nodebuffer:d},n.transformTo=function(u,m){return m||(m=""),u?(n.checkSupport(u),k[n.getTypeOf(m)][u](m)):m},n.resolve=function(u){for(var m=u.split("/"),g=[],E=0;E<m.length;E++){var x=m[E];x==="."||x===""&&E!==0&&E!==m.length-1||(x===".."?g.pop():g.push(x))}return g.join("/")},n.getTypeOf=function(u){if(typeof u=="string")return"string";if(Object.prototype.toString.call(u)==="[object Array]")return"array";if(a.nodebuffer&&s.isBuffer(u))return"nodebuffer";if(a.uint8array&&u instanceof Uint8Array)return"uint8array";if(a.arraybuffer&&u instanceof ArrayBuffer)return"arraybuffer"},n.checkSupport=function(u){if(!a[u.toLowerCase()])throw new Error(u+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(u){var m="",g,E;for(E=0;E<(u||"").length;E++)g=u.charCodeAt(E),m+="\\x"+(g<16?"0":"")+g.toString(16).toUpperCase();return m},n.delay=function(u,m,g){setImmediate(function(){u.apply(g||null,m||[])})},n.inherits=function(u,m){var g=function(){};g.prototype=m.prototype,u.prototype=new g},n.extend=function(){var u={},m,g;for(m=0;m<arguments.length;m++)for(g in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],g)&&typeof u[g]>"u"&&(u[g]=arguments[m][g]);return u},n.prepareContent=function(u,m,g,E,x){return l.Promise.resolve(m).then(function(_){return a.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new l.Promise(function(I,A){var D=new FileReader;D.onload=function(z){I(z.target.result)},D.onerror=function(z){A(z.target.error)},D.readAsArrayBuffer(_)}):_}).then(function(_){var I=n.getTypeOf(_);return I?(I==="arraybuffer"?_=n.transformTo("uint8array",_):I==="string"&&(x?_=o.decode(_):g&&E!==!0&&(_=h(_))),_):l.Promise.reject(new Error("Can't read the data of '"+u+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,r,n){"use strict";var a=t("./reader/readerFor"),o=t("./utils"),s=t("./signature"),l=t("./zipEntry"),h=t("./support");function d(f){this.files=[],this.loadOptions=f}d.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var v=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(v)+", expected "+o.pretty(f)+")")}},isSignature:function(f,v){var p=this.reader.index;this.reader.setIndex(f);var y=this.reader.readString(4)===v;return this.reader.setIndex(p),y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),v=h.uint8array?"uint8array":"array",p=o.transformTo(v,f);this.zipComment=this.loadOptions.decodeFileName(p)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f=this.zip64EndOfCentralSize-44,v=0,p,y,k;v<f;)p=this.reader.readInt(2),y=this.reader.readInt(4),k=this.reader.readData(y),this.zip64ExtensibleData[p]={id:p,length:y,value:k}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,v;for(f=0;f<this.files.length;f++)v=this.files[f],this.reader.setIndex(v.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),v.readLocalPart(this.reader),v.handleUTF8(),v.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)f=new l({zip64:this.zip64},this.loadOptions),f.readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var v=f;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,f=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),f<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var p=this.centralDirOffset+this.centralDirSize;this.zip64&&(p+=20,p+=12+this.zip64EndOfCentralSize);var y=v-p;if(y>0)this.isSignature(v,s.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" bytes.")},prepareReader:function(f){this.reader=a(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,r,n){"use strict";var a=t("./reader/readerFor"),o=t("./utils"),s=t("./compressedObject"),l=t("./crc32"),h=t("./utf8"),d=t("./compressions"),f=t("./support"),v=0,p=3,y=function(u){for(var m in d)if(Object.prototype.hasOwnProperty.call(d,m)&&d[m].magic===u)return d[m];return null};function k(u,m){this.options=u,this.loadOptions=m}k.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(u){var m,g;if(u.skip(22),this.fileNameLength=u.readInt(2),g=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(g),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(m=y(this.compressionMethod),m===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,m,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var m=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(m),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),u===v&&(this.dosPermissions=this.externalFileAttributes&63),u===p&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var m=u.index+this.extraFieldsLength,g,E,x;for(this.extraFields||(this.extraFields={});u.index+4<m;)g=u.readInt(2),E=u.readInt(2),x=u.readData(E),this.extraFields[g]={id:g,length:E,value:x};u.setIndex(m)},handleUTF8:function(){var u=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var g=o.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(g)}var E=this.findExtraFieldUnicodeComment();if(E!==null)this.fileCommentStr=E;else{var x=o.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(x)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var m=a(u.value);return m.readInt(1)!==1||l(this.fileName)!==m.readInt(4)?null:h.utf8decode(m.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var m=a(u.value);return m.readInt(1)!==1||l(this.fileComment)!==m.readInt(4)?null:h.utf8decode(m.readData(u.length-5))}return null}},r.exports=k},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,r,n){"use strict";var a=t("./stream/StreamHelper"),o=t("./stream/DataWorker"),s=t("./utf8"),l=t("./compressedObject"),h=t("./stream/GenericWorker"),d=function(y,k,u){this.name=y,this.dir=u.dir,this.date=u.date,this.comment=u.comment,this.unixPermissions=u.unixPermissions,this.dosPermissions=u.dosPermissions,this._data=k,this._dataBinary=u.binary,this.options={compression:u.compression,compressionOptions:u.compressionOptions}};d.prototype={internalStream:function(y){var k=null,u="string";try{if(!y)throw new Error("No output type specified.");u=y.toLowerCase();var m=u==="string"||u==="text";(u==="binarystring"||u==="text")&&(u="string"),k=this._decompressWorker();var g=!this._dataBinary;g&&!m&&(k=k.pipe(new s.Utf8EncodeWorker)),!g&&m&&(k=k.pipe(new s.Utf8DecodeWorker))}catch(E){k=new h("error"),k.error(E)}return new a(k,u,"")},async:function(y,k){return this.internalStream(y).accumulate(k)},nodeStream:function(y,k){return this.internalStream(y||"nodebuffer").toNodejsStream(k)},_compressWorker:function(y,k){if(this._data instanceof l&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var u=this._decompressWorker();return this._dataBinary||(u=u.pipe(new s.Utf8EncodeWorker)),l.createWorkerFrom(u,y,k)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof h?this._data:new o(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],v=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},p=0;p<f.length;p++)d.prototype[f[p]]=v;r.exports=d},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,r,n){(function(a){"use strict";var o=a.MutationObserver||a.WebKitMutationObserver,s;if(o){var l=0,h=new o(y),d=a.document.createTextNode("");h.observe(d,{characterData:!0}),s=function(){d.data=l=++l%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var f=new a.MessageChannel;f.port1.onmessage=y,s=function(){f.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?s=function(){var u=a.document.createElement("script");u.onreadystatechange=function(){y(),u.onreadystatechange=null,u.parentNode.removeChild(u),u=null},a.document.documentElement.appendChild(u)}:s=function(){setTimeout(y,0)};var v,p=[];function y(){v=!0;for(var u,m,g=p.length;g;){for(m=p,p=[],u=-1;++u<g;)m[u]();g=p.length}v=!1}r.exports=k;function k(u){p.push(u)===1&&!v&&s()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,r,n){"use strict";var a=t("immediate");function o(){}var s={},l=["REJECTED"],h=["FULFILLED"],d=["PENDING"];r.exports=f;function f(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,_!==o&&k(this,_)}f.prototype.finally=function(_){if(typeof _!="function")return this;var I=this.constructor;return this.then(A,D);function A(z){function O(){return z}return I.resolve(_()).then(O)}function D(z){function O(){throw z}return I.resolve(_()).then(O)}},f.prototype.catch=function(_){return this.then(null,_)},f.prototype.then=function(_,I){if(typeof _!="function"&&this.state===h||typeof I!="function"&&this.state===l)return this;var A=new this.constructor(o);return this.state!==d?p(A,this.state===h?_:I,this.outcome):this.queue.push(new v(A,_,I)),A};function v(_,I,A){this.promise=_,typeof I=="function"&&(this.onFulfilled=I,this.callFulfilled=this.otherCallFulfilled),typeof A=="function"&&(this.onRejected=A,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(_){s.resolve(this.promise,_)},v.prototype.otherCallFulfilled=function(_){p(this.promise,this.onFulfilled,_)},v.prototype.callRejected=function(_){s.reject(this.promise,_)},v.prototype.otherCallRejected=function(_){p(this.promise,this.onRejected,_)};function p(_,I,A){a(function(){var D;try{D=I(A)}catch(z){return s.reject(_,z)}D===_?s.reject(_,new TypeError("Cannot resolve promise with itself")):s.resolve(_,D)})}s.resolve=function(_,I){var A=u(y,I);if(A.status==="error")return s.reject(_,A.value);var D=A.value;if(D)k(_,D);else{_.state=h,_.outcome=I;for(var z=-1,O=_.queue.length;++z<O;)_.queue[z].callFulfilled(I)}return _},s.reject=function(_,I){_.state=l,_.outcome=I;for(var A=-1,D=_.queue.length;++A<D;)_.queue[A].callRejected(I);return _};function y(_){var I=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof I=="function")return function(){I.apply(_,arguments)}}function k(_,I){var A=!1;function D(W){A||(A=!0,s.reject(_,W))}function z(W){A||(A=!0,s.resolve(_,W))}function O(){I(z,D)}var F=u(O);F.status==="error"&&D(F.value)}function u(_,I){var A={};try{A.value=_(I),A.status="success"}catch(D){A.status="error",A.value=D}return A}f.resolve=m;function m(_){return _ instanceof this?_:s.resolve(new this(o),_)}f.reject=g;function g(_){var I=new this(o);return s.reject(I,_)}f.all=E;function E(_){var I=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=_.length,D=!1;if(!A)return this.resolve([]);for(var z=new Array(A),O=0,F=-1,W=new this(o);++F<A;)q(_[F],F);return W;function q(re,K){I.resolve(re).then(de,function(ue){D||(D=!0,s.reject(W,ue))});function de(ue){z[K]=ue,++O===A&&!D&&(D=!0,s.resolve(W,z))}}}f.race=x;function x(_){var I=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=_.length,D=!1;if(!A)return this.resolve([]);for(var z=-1,O=new this(o);++z<A;)F(_[z]);return O;function F(W){I.resolve(W).then(function(q){D||(D=!0,s.resolve(O,q))},function(q){D||(D=!0,s.reject(O,q))})}}},{immediate:36}],38:[function(t,r,n){"use strict";var a=t("./lib/utils/common").assign,o=t("./lib/deflate"),s=t("./lib/inflate"),l=t("./lib/zlib/constants"),h={};a(h,o,s,l),r.exports=h},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,r,n){"use strict";var a=t("./zlib/deflate"),o=t("./utils/common"),s=t("./utils/strings"),l=t("./zlib/messages"),h=t("./zlib/zstream"),d=Object.prototype.toString,f=0,v=4,p=0,y=1,k=2,u=-1,m=0,g=8;function E(A){if(!(this instanceof E))return new E(A);this.options=o.assign({level:u,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},A||{});var D=this.options;D.raw&&D.windowBits>0?D.windowBits=-D.windowBits:D.gzip&&D.windowBits>0&&D.windowBits<16&&(D.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var z=a.deflateInit2(this.strm,D.level,D.method,D.windowBits,D.memLevel,D.strategy);if(z!==p)throw new Error(l[z]);if(D.header&&a.deflateSetHeader(this.strm,D.header),D.dictionary){var O;if(typeof D.dictionary=="string"?O=s.string2buf(D.dictionary):d.call(D.dictionary)==="[object ArrayBuffer]"?O=new Uint8Array(D.dictionary):O=D.dictionary,z=a.deflateSetDictionary(this.strm,O),z!==p)throw new Error(l[z]);this._dict_set=!0}}E.prototype.push=function(A,D){var z=this.strm,O=this.options.chunkSize,F,W;if(this.ended)return!1;W=D===~~D?D:D===!0?v:f,typeof A=="string"?z.input=s.string2buf(A):d.call(A)==="[object ArrayBuffer]"?z.input=new Uint8Array(A):z.input=A,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new o.Buf8(O),z.next_out=0,z.avail_out=O),F=a.deflate(z,W),F!==y&&F!==p)return this.onEnd(F),this.ended=!0,!1;(z.avail_out===0||z.avail_in===0&&(W===v||W===k))&&(this.options.to==="string"?this.onData(s.buf2binstring(o.shrinkBuf(z.output,z.next_out))):this.onData(o.shrinkBuf(z.output,z.next_out)))}while((z.avail_in>0||z.avail_out===0)&&F!==y);return W===v?(F=a.deflateEnd(this.strm),this.onEnd(F),this.ended=!0,F===p):(W===k&&(this.onEnd(p),z.avail_out=0),!0)},E.prototype.onData=function(A){this.chunks.push(A)},E.prototype.onEnd=function(A){A===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};function x(A,D){var z=new E(D);if(z.push(A,!0),z.err)throw z.msg||l[z.err];return z.result}function _(A,D){return D=D||{},D.raw=!0,x(A,D)}function I(A,D){return D=D||{},D.gzip=!0,x(A,D)}n.Deflate=E,n.deflate=x,n.deflateRaw=_,n.gzip=I},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,r,n){"use strict";var a=t("./zlib/inflate"),o=t("./utils/common"),s=t("./utils/strings"),l=t("./zlib/constants"),h=t("./zlib/messages"),d=t("./zlib/zstream"),f=t("./zlib/gzheader"),v=Object.prototype.toString;function p(u){if(!(this instanceof p))return new p(u);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},u||{});var m=this.options;m.raw&&m.windowBits>=0&&m.windowBits<16&&(m.windowBits=-m.windowBits,m.windowBits===0&&(m.windowBits=-15)),m.windowBits>=0&&m.windowBits<16&&!(u&&u.windowBits)&&(m.windowBits+=32),m.windowBits>15&&m.windowBits<48&&(m.windowBits&15)===0&&(m.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var g=a.inflateInit2(this.strm,m.windowBits);if(g!==l.Z_OK)throw new Error(h[g]);this.header=new f,a.inflateGetHeader(this.strm,this.header)}p.prototype.push=function(u,m){var g=this.strm,E=this.options.chunkSize,x=this.options.dictionary,_,I,A,D,z,O,F=!1;if(this.ended)return!1;I=m===~~m?m:m===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof u=="string"?g.input=s.binstring2buf(u):v.call(u)==="[object ArrayBuffer]"?g.input=new Uint8Array(u):g.input=u,g.next_in=0,g.avail_in=g.input.length;do{if(g.avail_out===0&&(g.output=new o.Buf8(E),g.next_out=0,g.avail_out=E),_=a.inflate(g,l.Z_NO_FLUSH),_===l.Z_NEED_DICT&&x&&(typeof x=="string"?O=s.string2buf(x):v.call(x)==="[object ArrayBuffer]"?O=new Uint8Array(x):O=x,_=a.inflateSetDictionary(this.strm,O)),_===l.Z_BUF_ERROR&&F===!0&&(_=l.Z_OK,F=!1),_!==l.Z_STREAM_END&&_!==l.Z_OK)return this.onEnd(_),this.ended=!0,!1;g.next_out&&(g.avail_out===0||_===l.Z_STREAM_END||g.avail_in===0&&(I===l.Z_FINISH||I===l.Z_SYNC_FLUSH))&&(this.options.to==="string"?(A=s.utf8border(g.output,g.next_out),D=g.next_out-A,z=s.buf2string(g.output,A),g.next_out=D,g.avail_out=E-D,D&&o.arraySet(g.output,g.output,A,D,0),this.onData(z)):this.onData(o.shrinkBuf(g.output,g.next_out))),g.avail_in===0&&g.avail_out===0&&(F=!0)}while((g.avail_in>0||g.avail_out===0)&&_!==l.Z_STREAM_END);return _===l.Z_STREAM_END&&(I=l.Z_FINISH),I===l.Z_FINISH?(_=a.inflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===l.Z_OK):(I===l.Z_SYNC_FLUSH&&(this.onEnd(l.Z_OK),g.avail_out=0),!0)},p.prototype.onData=function(u){this.chunks.push(u)},p.prototype.onEnd=function(u){u===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg};function y(u,m){var g=new p(m);if(g.push(u,!0),g.err)throw g.msg||h[g.err];return g.result}function k(u,m){return m=m||{},m.raw=!0,y(u,m)}n.Inflate=p,n.inflate=y,n.inflateRaw=k,n.ungzip=y},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,r,n){"use strict";var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";n.assign=function(l){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var d=h.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var f in d)d.hasOwnProperty(f)&&(l[f]=d[f])}}return l},n.shrinkBuf=function(l,h){return l.length===h?l:l.subarray?l.subarray(0,h):(l.length=h,l)};var o={arraySet:function(l,h,d,f,v){if(h.subarray&&l.subarray){l.set(h.subarray(d,d+f),v);return}for(var p=0;p<f;p++)l[v+p]=h[d+p]},flattenChunks:function(l){var h,d,f=0,v,p,y;for(h=0,d=l.length;h<d;h++)f+=l[h].length;for(y=new Uint8Array(f),v=0,h=0,d=l.length;h<d;h++)p=l[h],y.set(p,v),v+=p.length;return y}},s={arraySet:function(l,h,d,f,v){for(var p=0;p<f;p++)l[v+p]=h[d+p]},flattenChunks:function(l){return[].concat.apply([],l)}};n.setTyped=function(l){l?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,o)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,s))},n.setTyped(a)},{}],42:[function(t,r,n){"use strict";var a=t("./common"),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var l=new a.Buf8(256),h=0;h<256;h++)l[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;l[254]=l[254]=1,n.string2buf=function(f){var v,p,y,k,u,m=f.length,g=0;for(k=0;k<m;k++)p=f.charCodeAt(k),(p&64512)===55296&&k+1<m&&(y=f.charCodeAt(k+1),(y&64512)===56320&&(p=65536+(p-55296<<10)+(y-56320),k++)),g+=p<128?1:p<2048?2:p<65536?3:4;for(v=new a.Buf8(g),u=0,k=0;u<g;k++)p=f.charCodeAt(k),(p&64512)===55296&&k+1<m&&(y=f.charCodeAt(k+1),(y&64512)===56320&&(p=65536+(p-55296<<10)+(y-56320),k++)),p<128?v[u++]=p:p<2048?(v[u++]=192|p>>>6,v[u++]=128|p&63):p<65536?(v[u++]=224|p>>>12,v[u++]=128|p>>>6&63,v[u++]=128|p&63):(v[u++]=240|p>>>18,v[u++]=128|p>>>12&63,v[u++]=128|p>>>6&63,v[u++]=128|p&63);return v};function d(f,v){if(v<65537&&(f.subarray&&s||!f.subarray&&o))return String.fromCharCode.apply(null,a.shrinkBuf(f,v));for(var p="",y=0;y<v;y++)p+=String.fromCharCode(f[y]);return p}n.buf2binstring=function(f){return d(f,f.length)},n.binstring2buf=function(f){for(var v=new a.Buf8(f.length),p=0,y=v.length;p<y;p++)v[p]=f.charCodeAt(p);return v},n.buf2string=function(f,v){var p,y,k,u,m=v||f.length,g=new Array(m*2);for(y=0,p=0;p<m;){if(k=f[p++],k<128){g[y++]=k;continue}if(u=l[k],u>4){g[y++]=65533,p+=u-1;continue}for(k&=u===2?31:u===3?15:7;u>1&&p<m;)k=k<<6|f[p++]&63,u--;if(u>1){g[y++]=65533;continue}k<65536?g[y++]=k:(k-=65536,g[y++]=55296|k>>10&1023,g[y++]=56320|k&1023)}return d(g,y)},n.utf8border=function(f,v){var p;for(v=v||f.length,v>f.length&&(v=f.length),p=v-1;p>=0&&(f[p]&192)===128;)p--;return p<0||p===0?v:p+l[f[p]]>v?p:v}},{"./common":41}],43:[function(t,r,n){"use strict";function a(o,s,l,h){for(var d=o&65535|0,f=o>>>16&65535|0,v=0;l!==0;){v=l>2e3?2e3:l,l-=v;do d=d+s[h++]|0,f=f+d|0;while(--v);d%=65521,f%=65521}return d|f<<16|0}r.exports=a},{}],44:[function(t,r,n){"use strict";r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,r,n){"use strict";function a(){for(var l,h=[],d=0;d<256;d++){l=d;for(var f=0;f<8;f++)l=l&1?3988292384^l>>>1:l>>>1;h[d]=l}return h}var o=a();function s(l,h,d,f){var v=o,p=f+d;l^=-1;for(var y=f;y<p;y++)l=l>>>8^v[(l^h[y])&255];return l^-1}r.exports=s},{}],46:[function(t,r,n){"use strict";var a=t("../utils/common"),o=t("./trees"),s=t("./adler32"),l=t("./crc32"),h=t("./messages"),d=0,f=1,v=3,p=4,y=5,k=0,u=1,m=-2,g=-3,E=-5,x=-1,_=1,I=2,A=3,D=4,z=0,O=2,F=8,W=9,q=15,re=8,K=286,de=30,ue=19,te=2*K+1,fe=15,ee=3,Se=258,be=Se+ee+1,Ce=32,Le=42,Oe=69,Re=73,ve=91,ge=103,Te=113,se=666,ce=1,xe=2,He=3,ze=4,et=3;function Pe(c,L){return c.msg=h[L],L}function De(c){return(c<<1)-(c>4?9:0)}function Je(c){for(var L=c.length;--L>=0;)c[L]=0}function Qe(c){var L=c.state,ie=L.pending;ie>c.avail_out&&(ie=c.avail_out),ie!==0&&(a.arraySet(c.output,L.pending_buf,L.pending_out,ie,c.next_out),c.next_out+=ie,L.pending_out+=ie,c.total_out+=ie,c.avail_out-=ie,L.pending-=ie,L.pending===0&&(L.pending_out=0))}function We(c,L){o._tr_flush_block(c,c.block_start>=0?c.block_start:-1,c.strstart-c.block_start,L),c.block_start=c.strstart,Qe(c.strm)}function we(c,L){c.pending_buf[c.pending++]=L}function Ge(c,L){c.pending_buf[c.pending++]=L>>>8&255,c.pending_buf[c.pending++]=L&255}function gt(c,L,ie,b){var Y=c.avail_in;return Y>b&&(Y=b),Y===0?0:(c.avail_in-=Y,a.arraySet(L,c.input,c.next_in,Y,ie),c.state.wrap===1?c.adler=s(c.adler,L,Y,ie):c.state.wrap===2&&(c.adler=l(c.adler,L,Y,ie)),c.next_in+=Y,c.total_in+=Y,Y)}function wt(c,L){var ie=c.max_chain_length,b=c.strstart,Y,U,V=c.prev_length,ye=c.nice_match,Ne=c.strstart>c.w_size-be?c.strstart-(c.w_size-be):0,he=c.window,Ot=c.w_mask,di=c.prev,$e=c.strstart+Se,Be=he[b+V-1],nt=he[b+V];c.prev_length>=c.good_match&&(ie>>=2),ye>c.lookahead&&(ye=c.lookahead);do if(Y=L,!(he[Y+V]!==nt||he[Y+V-1]!==Be||he[Y]!==he[b]||he[++Y]!==he[b+1])){b+=2,Y++;do;while(he[++b]===he[++Y]&&he[++b]===he[++Y]&&he[++b]===he[++Y]&&he[++b]===he[++Y]&&he[++b]===he[++Y]&&he[++b]===he[++Y]&&he[++b]===he[++Y]&&he[++b]===he[++Y]&&b<$e);if(U=Se-($e-b),b=$e-Se,U>V){if(c.match_start=L,V=U,U>=ye)break;Be=he[b+V-1],nt=he[b+V]}}while((L=di[L&Ot])>Ne&&--ie!==0);return V<=c.lookahead?V:c.lookahead}function at(c){var L=c.w_size,ie,b,Y,U,V;do{if(U=c.window_size-c.lookahead-c.strstart,c.strstart>=L+(L-be)){a.arraySet(c.window,c.window,L,L,0),c.match_start-=L,c.strstart-=L,c.block_start-=L,b=c.hash_size,ie=b;do Y=c.head[--ie],c.head[ie]=Y>=L?Y-L:0;while(--b);b=L,ie=b;do Y=c.prev[--ie],c.prev[ie]=Y>=L?Y-L:0;while(--b);U+=L}if(c.strm.avail_in===0)break;if(b=gt(c.strm,c.window,c.strstart+c.lookahead,U),c.lookahead+=b,c.lookahead+c.insert>=ee)for(V=c.strstart-c.insert,c.ins_h=c.window[V],c.ins_h=(c.ins_h<<c.hash_shift^c.window[V+1])&c.hash_mask;c.insert&&(c.ins_h=(c.ins_h<<c.hash_shift^c.window[V+ee-1])&c.hash_mask,c.prev[V&c.w_mask]=c.head[c.ins_h],c.head[c.ins_h]=V,V++,c.insert--,!(c.lookahead+c.insert<ee)););}while(c.lookahead<be&&c.strm.avail_in!==0)}function ct(c,L){var ie=65535;for(ie>c.pending_buf_size-5&&(ie=c.pending_buf_size-5);;){if(c.lookahead<=1){if(at(c),c.lookahead===0&&L===d)return ce;if(c.lookahead===0)break}c.strstart+=c.lookahead,c.lookahead=0;var b=c.block_start+ie;if((c.strstart===0||c.strstart>=b)&&(c.lookahead=c.strstart-b,c.strstart=b,We(c,!1),c.strm.avail_out===0)||c.strstart-c.block_start>=c.w_size-be&&(We(c,!1),c.strm.avail_out===0))return ce}return c.insert=0,L===p?(We(c,!0),c.strm.avail_out===0?He:ze):(c.strstart>c.block_start&&(We(c,!1),c.strm.avail_out===0),ce)}function yt(c,L){for(var ie,b;;){if(c.lookahead<be){if(at(c),c.lookahead<be&&L===d)return ce;if(c.lookahead===0)break}if(ie=0,c.lookahead>=ee&&(c.ins_h=(c.ins_h<<c.hash_shift^c.window[c.strstart+ee-1])&c.hash_mask,ie=c.prev[c.strstart&c.w_mask]=c.head[c.ins_h],c.head[c.ins_h]=c.strstart),ie!==0&&c.strstart-ie<=c.w_size-be&&(c.match_length=wt(c,ie)),c.match_length>=ee)if(b=o._tr_tally(c,c.strstart-c.match_start,c.match_length-ee),c.lookahead-=c.match_length,c.match_length<=c.max_lazy_match&&c.lookahead>=ee){c.match_length--;do c.strstart++,c.ins_h=(c.ins_h<<c.hash_shift^c.window[c.strstart+ee-1])&c.hash_mask,ie=c.prev[c.strstart&c.w_mask]=c.head[c.ins_h],c.head[c.ins_h]=c.strstart;while(--c.match_length!==0);c.strstart++}else c.strstart+=c.match_length,c.match_length=0,c.ins_h=c.window[c.strstart],c.ins_h=(c.ins_h<<c.hash_shift^c.window[c.strstart+1])&c.hash_mask;else b=o._tr_tally(c,0,c.window[c.strstart]),c.lookahead--,c.strstart++;if(b&&(We(c,!1),c.strm.avail_out===0))return ce}return c.insert=c.strstart<ee-1?c.strstart:ee-1,L===p?(We(c,!0),c.strm.avail_out===0?He:ze):c.last_lit&&(We(c,!1),c.strm.avail_out===0)?ce:xe}function dt(c,L){for(var ie,b,Y;;){if(c.lookahead<be){if(at(c),c.lookahead<be&&L===d)return ce;if(c.lookahead===0)break}if(ie=0,c.lookahead>=ee&&(c.ins_h=(c.ins_h<<c.hash_shift^c.window[c.strstart+ee-1])&c.hash_mask,ie=c.prev[c.strstart&c.w_mask]=c.head[c.ins_h],c.head[c.ins_h]=c.strstart),c.prev_length=c.match_length,c.prev_match=c.match_start,c.match_length=ee-1,ie!==0&&c.prev_length<c.max_lazy_match&&c.strstart-ie<=c.w_size-be&&(c.match_length=wt(c,ie),c.match_length<=5&&(c.strategy===_||c.match_length===ee&&c.strstart-c.match_start>4096)&&(c.match_length=ee-1)),c.prev_length>=ee&&c.match_length<=c.prev_length){Y=c.strstart+c.lookahead-ee,b=o._tr_tally(c,c.strstart-1-c.prev_match,c.prev_length-ee),c.lookahead-=c.prev_length-1,c.prev_length-=2;do++c.strstart<=Y&&(c.ins_h=(c.ins_h<<c.hash_shift^c.window[c.strstart+ee-1])&c.hash_mask,ie=c.prev[c.strstart&c.w_mask]=c.head[c.ins_h],c.head[c.ins_h]=c.strstart);while(--c.prev_length!==0);if(c.match_available=0,c.match_length=ee-1,c.strstart++,b&&(We(c,!1),c.strm.avail_out===0))return ce}else if(c.match_available){if(b=o._tr_tally(c,0,c.window[c.strstart-1]),b&&We(c,!1),c.strstart++,c.lookahead--,c.strm.avail_out===0)return ce}else c.match_available=1,c.strstart++,c.lookahead--}return c.match_available&&(b=o._tr_tally(c,0,c.window[c.strstart-1]),c.match_available=0),c.insert=c.strstart<ee-1?c.strstart:ee-1,L===p?(We(c,!0),c.strm.avail_out===0?He:ze):c.last_lit&&(We(c,!1),c.strm.avail_out===0)?ce:xe}function Bt(c,L){for(var ie,b,Y,U,V=c.window;;){if(c.lookahead<=Se){if(at(c),c.lookahead<=Se&&L===d)return ce;if(c.lookahead===0)break}if(c.match_length=0,c.lookahead>=ee&&c.strstart>0&&(Y=c.strstart-1,b=V[Y],b===V[++Y]&&b===V[++Y]&&b===V[++Y])){U=c.strstart+Se;do;while(b===V[++Y]&&b===V[++Y]&&b===V[++Y]&&b===V[++Y]&&b===V[++Y]&&b===V[++Y]&&b===V[++Y]&&b===V[++Y]&&Y<U);c.match_length=Se-(U-Y),c.match_length>c.lookahead&&(c.match_length=c.lookahead)}if(c.match_length>=ee?(ie=o._tr_tally(c,1,c.match_length-ee),c.lookahead-=c.match_length,c.strstart+=c.match_length,c.match_length=0):(ie=o._tr_tally(c,0,c.window[c.strstart]),c.lookahead--,c.strstart++),ie&&(We(c,!1),c.strm.avail_out===0))return ce}return c.insert=0,L===p?(We(c,!0),c.strm.avail_out===0?He:ze):c.last_lit&&(We(c,!1),c.strm.avail_out===0)?ce:xe}function Ut(c,L){for(var ie;;){if(c.lookahead===0&&(at(c),c.lookahead===0)){if(L===d)return ce;break}if(c.match_length=0,ie=o._tr_tally(c,0,c.window[c.strstart]),c.lookahead--,c.strstart++,ie&&(We(c,!1),c.strm.avail_out===0))return ce}return c.insert=0,L===p?(We(c,!0),c.strm.avail_out===0?He:ze):c.last_lit&&(We(c,!1),c.strm.avail_out===0)?ce:xe}function T(c,L,ie,b,Y){this.good_length=c,this.max_lazy=L,this.nice_length=ie,this.max_chain=b,this.func=Y}var R=[new T(0,0,0,0,ct),new T(4,4,8,4,yt),new T(4,5,16,8,yt),new T(4,6,32,32,yt),new T(4,4,16,16,dt),new T(8,16,32,32,dt),new T(8,16,128,128,dt),new T(8,32,128,256,dt),new T(32,128,258,1024,dt),new T(32,258,258,4096,dt)];function B(c){c.window_size=2*c.w_size,Je(c.head),c.max_lazy_match=R[c.level].max_lazy,c.good_match=R[c.level].good_length,c.nice_match=R[c.level].nice_length,c.max_chain_length=R[c.level].max_chain,c.strstart=0,c.block_start=0,c.lookahead=0,c.insert=0,c.match_length=c.prev_length=ee-1,c.match_available=0,c.ins_h=0}function X(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=F,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(te*2),this.dyn_dtree=new a.Buf16((2*de+1)*2),this.bl_tree=new a.Buf16((2*ue+1)*2),Je(this.dyn_ltree),Je(this.dyn_dtree),Je(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(fe+1),this.heap=new a.Buf16(2*K+1),Je(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*K+1),Je(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function le(c){var L;return!c||!c.state?Pe(c,m):(c.total_in=c.total_out=0,c.data_type=O,L=c.state,L.pending=0,L.pending_out=0,L.wrap<0&&(L.wrap=-L.wrap),L.status=L.wrap?Le:Te,c.adler=L.wrap===2?0:1,L.last_flush=d,o._tr_init(L),k)}function S(c){var L=le(c);return L===k&&B(c.state),L}function J(c,L){return!c||!c.state||c.state.wrap!==2?m:(c.state.gzhead=L,k)}function ae(c,L,ie,b,Y,U){if(!c)return m;var V=1;if(L===x&&(L=6),b<0?(V=0,b=-b):b>15&&(V=2,b-=16),Y<1||Y>W||ie!==F||b<8||b>15||L<0||L>9||U<0||U>D)return Pe(c,m);b===8&&(b=9);var ye=new X;return c.state=ye,ye.strm=c,ye.wrap=V,ye.gzhead=null,ye.w_bits=b,ye.w_size=1<<ye.w_bits,ye.w_mask=ye.w_size-1,ye.hash_bits=Y+7,ye.hash_size=1<<ye.hash_bits,ye.hash_mask=ye.hash_size-1,ye.hash_shift=~~((ye.hash_bits+ee-1)/ee),ye.window=new a.Buf8(ye.w_size*2),ye.head=new a.Buf16(ye.hash_size),ye.prev=new a.Buf16(ye.w_size),ye.lit_bufsize=1<<Y+6,ye.pending_buf_size=ye.lit_bufsize*4,ye.pending_buf=new a.Buf8(ye.pending_buf_size),ye.d_buf=1*ye.lit_bufsize,ye.l_buf=3*ye.lit_bufsize,ye.level=L,ye.strategy=U,ye.method=ie,S(c)}function M(c,L){return ae(c,L,F,q,re,z)}function G(c,L){var ie,b,Y,U;if(!c||!c.state||L>y||L<0)return c?Pe(c,m):m;if(b=c.state,!c.output||!c.input&&c.avail_in!==0||b.status===se&&L!==p)return Pe(c,c.avail_out===0?E:m);if(b.strm=c,ie=b.last_flush,b.last_flush=L,b.status===Le)if(b.wrap===2)c.adler=0,we(b,31),we(b,139),we(b,8),b.gzhead?(we(b,(b.gzhead.text?1:0)+(b.gzhead.hcrc?2:0)+(b.gzhead.extra?4:0)+(b.gzhead.name?8:0)+(b.gzhead.comment?16:0)),we(b,b.gzhead.time&255),we(b,b.gzhead.time>>8&255),we(b,b.gzhead.time>>16&255),we(b,b.gzhead.time>>24&255),we(b,b.level===9?2:b.strategy>=I||b.level<2?4:0),we(b,b.gzhead.os&255),b.gzhead.extra&&b.gzhead.extra.length&&(we(b,b.gzhead.extra.length&255),we(b,b.gzhead.extra.length>>8&255)),b.gzhead.hcrc&&(c.adler=l(c.adler,b.pending_buf,b.pending,0)),b.gzindex=0,b.status=Oe):(we(b,0),we(b,0),we(b,0),we(b,0),we(b,0),we(b,b.level===9?2:b.strategy>=I||b.level<2?4:0),we(b,et),b.status=Te);else{var V=F+(b.w_bits-8<<4)<<8,ye=-1;b.strategy>=I||b.level<2?ye=0:b.level<6?ye=1:b.level===6?ye=2:ye=3,V|=ye<<6,b.strstart!==0&&(V|=Ce),V+=31-V%31,b.status=Te,Ge(b,V),b.strstart!==0&&(Ge(b,c.adler>>>16),Ge(b,c.adler&65535)),c.adler=1}if(b.status===Oe)if(b.gzhead.extra){for(Y=b.pending;b.gzindex<(b.gzhead.extra.length&65535)&&!(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>Y&&(c.adler=l(c.adler,b.pending_buf,b.pending-Y,Y)),Qe(c),Y=b.pending,b.pending===b.pending_buf_size));)we(b,b.gzhead.extra[b.gzindex]&255),b.gzindex++;b.gzhead.hcrc&&b.pending>Y&&(c.adler=l(c.adler,b.pending_buf,b.pending-Y,Y)),b.gzindex===b.gzhead.extra.length&&(b.gzindex=0,b.status=Re)}else b.status=Re;if(b.status===Re)if(b.gzhead.name){Y=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>Y&&(c.adler=l(c.adler,b.pending_buf,b.pending-Y,Y)),Qe(c),Y=b.pending,b.pending===b.pending_buf_size)){U=1;break}b.gzindex<b.gzhead.name.length?U=b.gzhead.name.charCodeAt(b.gzindex++)&255:U=0,we(b,U)}while(U!==0);b.gzhead.hcrc&&b.pending>Y&&(c.adler=l(c.adler,b.pending_buf,b.pending-Y,Y)),U===0&&(b.gzindex=0,b.status=ve)}else b.status=ve;if(b.status===ve)if(b.gzhead.comment){Y=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>Y&&(c.adler=l(c.adler,b.pending_buf,b.pending-Y,Y)),Qe(c),Y=b.pending,b.pending===b.pending_buf_size)){U=1;break}b.gzindex<b.gzhead.comment.length?U=b.gzhead.comment.charCodeAt(b.gzindex++)&255:U=0,we(b,U)}while(U!==0);b.gzhead.hcrc&&b.pending>Y&&(c.adler=l(c.adler,b.pending_buf,b.pending-Y,Y)),U===0&&(b.status=ge)}else b.status=ge;if(b.status===ge&&(b.gzhead.hcrc?(b.pending+2>b.pending_buf_size&&Qe(c),b.pending+2<=b.pending_buf_size&&(we(b,c.adler&255),we(b,c.adler>>8&255),c.adler=0,b.status=Te)):b.status=Te),b.pending!==0){if(Qe(c),c.avail_out===0)return b.last_flush=-1,k}else if(c.avail_in===0&&De(L)<=De(ie)&&L!==p)return Pe(c,E);if(b.status===se&&c.avail_in!==0)return Pe(c,E);if(c.avail_in!==0||b.lookahead!==0||L!==d&&b.status!==se){var Ne=b.strategy===I?Ut(b,L):b.strategy===A?Bt(b,L):R[b.level].func(b,L);if((Ne===He||Ne===ze)&&(b.status=se),Ne===ce||Ne===He)return c.avail_out===0&&(b.last_flush=-1),k;if(Ne===xe&&(L===f?o._tr_align(b):L!==y&&(o._tr_stored_block(b,0,0,!1),L===v&&(Je(b.head),b.lookahead===0&&(b.strstart=0,b.block_start=0,b.insert=0))),Qe(c),c.avail_out===0))return b.last_flush=-1,k}return L!==p?k:b.wrap<=0?u:(b.wrap===2?(we(b,c.adler&255),we(b,c.adler>>8&255),we(b,c.adler>>16&255),we(b,c.adler>>24&255),we(b,c.total_in&255),we(b,c.total_in>>8&255),we(b,c.total_in>>16&255),we(b,c.total_in>>24&255)):(Ge(b,c.adler>>>16),Ge(b,c.adler&65535)),Qe(c),b.wrap>0&&(b.wrap=-b.wrap),b.pending!==0?k:u)}function w(c){var L;return!c||!c.state?m:(L=c.state.status,L!==Le&&L!==Oe&&L!==Re&&L!==ve&&L!==ge&&L!==Te&&L!==se?Pe(c,m):(c.state=null,L===Te?Pe(c,g):k))}function $(c,L){var ie=L.length,b,Y,U,V,ye,Ne,he,Ot;if(!c||!c.state||(b=c.state,V=b.wrap,V===2||V===1&&b.status!==Le||b.lookahead))return m;for(V===1&&(c.adler=s(c.adler,L,ie,0)),b.wrap=0,ie>=b.w_size&&(V===0&&(Je(b.head),b.strstart=0,b.block_start=0,b.insert=0),Ot=new a.Buf8(b.w_size),a.arraySet(Ot,L,ie-b.w_size,b.w_size,0),L=Ot,ie=b.w_size),ye=c.avail_in,Ne=c.next_in,he=c.input,c.avail_in=ie,c.next_in=0,c.input=L,at(b);b.lookahead>=ee;){Y=b.strstart,U=b.lookahead-(ee-1);do b.ins_h=(b.ins_h<<b.hash_shift^b.window[Y+ee-1])&b.hash_mask,b.prev[Y&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=Y,Y++;while(--U);b.strstart=Y,b.lookahead=ee-1,at(b)}return b.strstart+=b.lookahead,b.block_start=b.strstart,b.insert=b.lookahead,b.lookahead=0,b.match_length=b.prev_length=ee-1,b.match_available=0,c.next_in=Ne,c.input=he,c.avail_in=ye,b.wrap=V,k}n.deflateInit=M,n.deflateInit2=ae,n.deflateReset=S,n.deflateResetKeep=le,n.deflateSetHeader=J,n.deflate=G,n.deflateEnd=w,n.deflateSetDictionary=$,n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,r,n){"use strict";function a(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}r.exports=a},{}],48:[function(t,r,n){"use strict";var a=30,o=12;r.exports=function(l,h){var d,f,v,p,y,k,u,m,g,E,x,_,I,A,D,z,O,F,W,q,re,K,de,ue,te;d=l.state,f=l.next_in,ue=l.input,v=f+(l.avail_in-5),p=l.next_out,te=l.output,y=p-(h-l.avail_out),k=p+(l.avail_out-257),u=d.dmax,m=d.wsize,g=d.whave,E=d.wnext,x=d.window,_=d.hold,I=d.bits,A=d.lencode,D=d.distcode,z=(1<<d.lenbits)-1,O=(1<<d.distbits)-1;e:do{I<15&&(_+=ue[f++]<<I,I+=8,_+=ue[f++]<<I,I+=8),F=A[_&z];t:for(;;){if(W=F>>>24,_>>>=W,I-=W,W=F>>>16&255,W===0)te[p++]=F&65535;else if(W&16){q=F&65535,W&=15,W&&(I<W&&(_+=ue[f++]<<I,I+=8),q+=_&(1<<W)-1,_>>>=W,I-=W),I<15&&(_+=ue[f++]<<I,I+=8,_+=ue[f++]<<I,I+=8),F=D[_&O];i:for(;;){if(W=F>>>24,_>>>=W,I-=W,W=F>>>16&255,W&16){if(re=F&65535,W&=15,I<W&&(_+=ue[f++]<<I,I+=8,I<W&&(_+=ue[f++]<<I,I+=8)),re+=_&(1<<W)-1,re>u){l.msg="invalid distance too far back",d.mode=a;break e}if(_>>>=W,I-=W,W=p-y,re>W){if(W=re-W,W>g&&d.sane){l.msg="invalid distance too far back",d.mode=a;break e}if(K=0,de=x,E===0){if(K+=m-W,W<q){q-=W;do te[p++]=x[K++];while(--W);K=p-re,de=te}}else if(E<W){if(K+=m+E-W,W-=E,W<q){q-=W;do te[p++]=x[K++];while(--W);if(K=0,E<q){W=E,q-=W;do te[p++]=x[K++];while(--W);K=p-re,de=te}}}else if(K+=E-W,W<q){q-=W;do te[p++]=x[K++];while(--W);K=p-re,de=te}for(;q>2;)te[p++]=de[K++],te[p++]=de[K++],te[p++]=de[K++],q-=3;q&&(te[p++]=de[K++],q>1&&(te[p++]=de[K++]))}else{K=p-re;do te[p++]=te[K++],te[p++]=te[K++],te[p++]=te[K++],q-=3;while(q>2);q&&(te[p++]=te[K++],q>1&&(te[p++]=te[K++]))}}else if((W&64)===0){F=D[(F&65535)+(_&(1<<W)-1)];continue i}else{l.msg="invalid distance code",d.mode=a;break e}break}}else if((W&64)===0){F=A[(F&65535)+(_&(1<<W)-1)];continue t}else if(W&32){d.mode=o;break e}else{l.msg="invalid literal/length code",d.mode=a;break e}break}}while(f<v&&p<k);q=I>>3,f-=q,I-=q<<3,_&=(1<<I)-1,l.next_in=f,l.next_out=p,l.avail_in=f<v?5+(v-f):5-(f-v),l.avail_out=p<k?257+(k-p):257-(p-k),d.hold=_,d.bits=I}},{}],49:[function(t,r,n){"use strict";var a=t("../utils/common"),o=t("./adler32"),s=t("./crc32"),l=t("./inffast"),h=t("./inftrees"),d=0,f=1,v=2,p=4,y=5,k=6,u=0,m=1,g=2,E=-2,x=-3,_=-4,I=-5,A=8,D=1,z=2,O=3,F=4,W=5,q=6,re=7,K=8,de=9,ue=10,te=11,fe=12,ee=13,Se=14,be=15,Ce=16,Le=17,Oe=18,Re=19,ve=20,ge=21,Te=22,se=23,ce=24,xe=25,He=26,ze=27,et=28,Pe=29,De=30,Je=31,Qe=32,We=852,we=592,Ge=15;function gt(M){return(M>>>24&255)+(M>>>8&65280)+((M&65280)<<8)+((M&255)<<24)}function wt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function at(M){var G;return!M||!M.state?E:(G=M.state,M.total_in=M.total_out=G.total=0,M.msg="",G.wrap&&(M.adler=G.wrap&1),G.mode=D,G.last=0,G.havedict=0,G.dmax=32768,G.head=null,G.hold=0,G.bits=0,G.lencode=G.lendyn=new a.Buf32(We),G.distcode=G.distdyn=new a.Buf32(we),G.sane=1,G.back=-1,u)}function ct(M){var G;return!M||!M.state?E:(G=M.state,G.wsize=0,G.whave=0,G.wnext=0,at(M))}function yt(M,G){var w,$;return!M||!M.state||($=M.state,G<0?(w=0,G=-G):(w=(G>>4)+1,G<48&&(G&=15)),G&&(G<8||G>15))?E:($.window!==null&&$.wbits!==G&&($.window=null),$.wrap=w,$.wbits=G,ct(M))}function dt(M,G){var w,$;return M?($=new wt,M.state=$,$.window=null,w=yt(M,G),w!==u&&(M.state=null),w):E}function Bt(M){return dt(M,Ge)}var Ut=!0,T,R;function B(M){if(Ut){var G;for(T=new a.Buf32(512),R=new a.Buf32(32),G=0;G<144;)M.lens[G++]=8;for(;G<256;)M.lens[G++]=9;for(;G<280;)M.lens[G++]=7;for(;G<288;)M.lens[G++]=8;for(h(f,M.lens,0,288,T,0,M.work,{bits:9}),G=0;G<32;)M.lens[G++]=5;h(v,M.lens,0,32,R,0,M.work,{bits:5}),Ut=!1}M.lencode=T,M.lenbits=9,M.distcode=R,M.distbits=5}function X(M,G,w,$){var c,L=M.state;return L.window===null&&(L.wsize=1<<L.wbits,L.wnext=0,L.whave=0,L.window=new a.Buf8(L.wsize)),$>=L.wsize?(a.arraySet(L.window,G,w-L.wsize,L.wsize,0),L.wnext=0,L.whave=L.wsize):(c=L.wsize-L.wnext,c>$&&(c=$),a.arraySet(L.window,G,w-$,c,L.wnext),$-=c,$?(a.arraySet(L.window,G,w-$,$,0),L.wnext=$,L.whave=L.wsize):(L.wnext+=c,L.wnext===L.wsize&&(L.wnext=0),L.whave<L.wsize&&(L.whave+=c))),0}function le(M,G){var w,$,c,L,ie,b,Y,U,V,ye,Ne,he,Ot,di,$e=0,Be,nt,vt,pt,Vi,Gi,rt,xt,ot=new a.Buf8(4),Wt,Dt,Cn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!M||!M.state||!M.output||!M.input&&M.avail_in!==0)return E;w=M.state,w.mode===fe&&(w.mode=ee),ie=M.next_out,c=M.output,Y=M.avail_out,L=M.next_in,$=M.input,b=M.avail_in,U=w.hold,V=w.bits,ye=b,Ne=Y,xt=u;e:for(;;)switch(w.mode){case D:if(w.wrap===0){w.mode=ee;break}for(;V<16;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if(w.wrap&2&&U===35615){w.check=0,ot[0]=U&255,ot[1]=U>>>8&255,w.check=s(w.check,ot,2,0),U=0,V=0,w.mode=z;break}if(w.flags=0,w.head&&(w.head.done=!1),!(w.wrap&1)||(((U&255)<<8)+(U>>8))%31){M.msg="incorrect header check",w.mode=De;break}if((U&15)!==A){M.msg="unknown compression method",w.mode=De;break}if(U>>>=4,V-=4,rt=(U&15)+8,w.wbits===0)w.wbits=rt;else if(rt>w.wbits){M.msg="invalid window size",w.mode=De;break}w.dmax=1<<rt,M.adler=w.check=1,w.mode=U&512?ue:fe,U=0,V=0;break;case z:for(;V<16;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if(w.flags=U,(w.flags&255)!==A){M.msg="unknown compression method",w.mode=De;break}if(w.flags&57344){M.msg="unknown header flags set",w.mode=De;break}w.head&&(w.head.text=U>>8&1),w.flags&512&&(ot[0]=U&255,ot[1]=U>>>8&255,w.check=s(w.check,ot,2,0)),U=0,V=0,w.mode=O;case O:for(;V<32;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}w.head&&(w.head.time=U),w.flags&512&&(ot[0]=U&255,ot[1]=U>>>8&255,ot[2]=U>>>16&255,ot[3]=U>>>24&255,w.check=s(w.check,ot,4,0)),U=0,V=0,w.mode=F;case F:for(;V<16;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}w.head&&(w.head.xflags=U&255,w.head.os=U>>8),w.flags&512&&(ot[0]=U&255,ot[1]=U>>>8&255,w.check=s(w.check,ot,2,0)),U=0,V=0,w.mode=W;case W:if(w.flags&1024){for(;V<16;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}w.length=U,w.head&&(w.head.extra_len=U),w.flags&512&&(ot[0]=U&255,ot[1]=U>>>8&255,w.check=s(w.check,ot,2,0)),U=0,V=0}else w.head&&(w.head.extra=null);w.mode=q;case q:if(w.flags&1024&&(he=w.length,he>b&&(he=b),he&&(w.head&&(rt=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),a.arraySet(w.head.extra,$,L,he,rt)),w.flags&512&&(w.check=s(w.check,$,he,L)),b-=he,L+=he,w.length-=he),w.length))break e;w.length=0,w.mode=re;case re:if(w.flags&2048){if(b===0)break e;he=0;do rt=$[L+he++],w.head&&rt&&w.length<65536&&(w.head.name+=String.fromCharCode(rt));while(rt&&he<b);if(w.flags&512&&(w.check=s(w.check,$,he,L)),b-=he,L+=he,rt)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=K;case K:if(w.flags&4096){if(b===0)break e;he=0;do rt=$[L+he++],w.head&&rt&&w.length<65536&&(w.head.comment+=String.fromCharCode(rt));while(rt&&he<b);if(w.flags&512&&(w.check=s(w.check,$,he,L)),b-=he,L+=he,rt)break e}else w.head&&(w.head.comment=null);w.mode=de;case de:if(w.flags&512){for(;V<16;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if(U!==(w.check&65535)){M.msg="header crc mismatch",w.mode=De;break}U=0,V=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),M.adler=w.check=0,w.mode=fe;break;case ue:for(;V<32;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}M.adler=w.check=gt(U),U=0,V=0,w.mode=te;case te:if(w.havedict===0)return M.next_out=ie,M.avail_out=Y,M.next_in=L,M.avail_in=b,w.hold=U,w.bits=V,g;M.adler=w.check=1,w.mode=fe;case fe:if(G===y||G===k)break e;case ee:if(w.last){U>>>=V&7,V-=V&7,w.mode=ze;break}for(;V<3;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}switch(w.last=U&1,U>>>=1,V-=1,U&3){case 0:w.mode=Se;break;case 1:if(B(w),w.mode=ve,G===k){U>>>=2,V-=2;break e}break;case 2:w.mode=Le;break;case 3:M.msg="invalid block type",w.mode=De}U>>>=2,V-=2;break;case Se:for(U>>>=V&7,V-=V&7;V<32;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if((U&65535)!==(U>>>16^65535)){M.msg="invalid stored block lengths",w.mode=De;break}if(w.length=U&65535,U=0,V=0,w.mode=be,G===k)break e;case be:w.mode=Ce;case Ce:if(he=w.length,he){if(he>b&&(he=b),he>Y&&(he=Y),he===0)break e;a.arraySet(c,$,L,he,ie),b-=he,L+=he,Y-=he,ie+=he,w.length-=he;break}w.mode=fe;break;case Le:for(;V<14;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if(w.nlen=(U&31)+257,U>>>=5,V-=5,w.ndist=(U&31)+1,U>>>=5,V-=5,w.ncode=(U&15)+4,U>>>=4,V-=4,w.nlen>286||w.ndist>30){M.msg="too many length or distance symbols",w.mode=De;break}w.have=0,w.mode=Oe;case Oe:for(;w.have<w.ncode;){for(;V<3;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}w.lens[Cn[w.have++]]=U&7,U>>>=3,V-=3}for(;w.have<19;)w.lens[Cn[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,Wt={bits:w.lenbits},xt=h(d,w.lens,0,19,w.lencode,0,w.work,Wt),w.lenbits=Wt.bits,xt){M.msg="invalid code lengths set",w.mode=De;break}w.have=0,w.mode=Re;case Re:for(;w.have<w.nlen+w.ndist;){for(;$e=w.lencode[U&(1<<w.lenbits)-1],Be=$e>>>24,nt=$e>>>16&255,vt=$e&65535,!(Be<=V);){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if(vt<16)U>>>=Be,V-=Be,w.lens[w.have++]=vt;else{if(vt===16){for(Dt=Be+2;V<Dt;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if(U>>>=Be,V-=Be,w.have===0){M.msg="invalid bit length repeat",w.mode=De;break}rt=w.lens[w.have-1],he=3+(U&3),U>>>=2,V-=2}else if(vt===17){for(Dt=Be+3;V<Dt;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}U>>>=Be,V-=Be,rt=0,he=3+(U&7),U>>>=3,V-=3}else{for(Dt=Be+7;V<Dt;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}U>>>=Be,V-=Be,rt=0,he=11+(U&127),U>>>=7,V-=7}if(w.have+he>w.nlen+w.ndist){M.msg="invalid bit length repeat",w.mode=De;break}for(;he--;)w.lens[w.have++]=rt}}if(w.mode===De)break;if(w.lens[256]===0){M.msg="invalid code -- missing end-of-block",w.mode=De;break}if(w.lenbits=9,Wt={bits:w.lenbits},xt=h(f,w.lens,0,w.nlen,w.lencode,0,w.work,Wt),w.lenbits=Wt.bits,xt){M.msg="invalid literal/lengths set",w.mode=De;break}if(w.distbits=6,w.distcode=w.distdyn,Wt={bits:w.distbits},xt=h(v,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,Wt),w.distbits=Wt.bits,xt){M.msg="invalid distances set",w.mode=De;break}if(w.mode=ve,G===k)break e;case ve:w.mode=ge;case ge:if(b>=6&&Y>=258){M.next_out=ie,M.avail_out=Y,M.next_in=L,M.avail_in=b,w.hold=U,w.bits=V,l(M,Ne),ie=M.next_out,c=M.output,Y=M.avail_out,L=M.next_in,$=M.input,b=M.avail_in,U=w.hold,V=w.bits,w.mode===fe&&(w.back=-1);break}for(w.back=0;$e=w.lencode[U&(1<<w.lenbits)-1],Be=$e>>>24,nt=$e>>>16&255,vt=$e&65535,!(Be<=V);){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if(nt&&(nt&240)===0){for(pt=Be,Vi=nt,Gi=vt;$e=w.lencode[Gi+((U&(1<<pt+Vi)-1)>>pt)],Be=$e>>>24,nt=$e>>>16&255,vt=$e&65535,!(pt+Be<=V);){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}U>>>=pt,V-=pt,w.back+=pt}if(U>>>=Be,V-=Be,w.back+=Be,w.length=vt,nt===0){w.mode=He;break}if(nt&32){w.back=-1,w.mode=fe;break}if(nt&64){M.msg="invalid literal/length code",w.mode=De;break}w.extra=nt&15,w.mode=Te;case Te:if(w.extra){for(Dt=w.extra;V<Dt;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}w.length+=U&(1<<w.extra)-1,U>>>=w.extra,V-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=se;case se:for(;$e=w.distcode[U&(1<<w.distbits)-1],Be=$e>>>24,nt=$e>>>16&255,vt=$e&65535,!(Be<=V);){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if((nt&240)===0){for(pt=Be,Vi=nt,Gi=vt;$e=w.distcode[Gi+((U&(1<<pt+Vi)-1)>>pt)],Be=$e>>>24,nt=$e>>>16&255,vt=$e&65535,!(pt+Be<=V);){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}U>>>=pt,V-=pt,w.back+=pt}if(U>>>=Be,V-=Be,w.back+=Be,nt&64){M.msg="invalid distance code",w.mode=De;break}w.offset=vt,w.extra=nt&15,w.mode=ce;case ce:if(w.extra){for(Dt=w.extra;V<Dt;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}w.offset+=U&(1<<w.extra)-1,U>>>=w.extra,V-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){M.msg="invalid distance too far back",w.mode=De;break}w.mode=xe;case xe:if(Y===0)break e;if(he=Ne-Y,w.offset>he){if(he=w.offset-he,he>w.whave&&w.sane){M.msg="invalid distance too far back",w.mode=De;break}he>w.wnext?(he-=w.wnext,Ot=w.wsize-he):Ot=w.wnext-he,he>w.length&&(he=w.length),di=w.window}else di=c,Ot=ie-w.offset,he=w.length;he>Y&&(he=Y),Y-=he,w.length-=he;do c[ie++]=di[Ot++];while(--he);w.length===0&&(w.mode=ge);break;case He:if(Y===0)break e;c[ie++]=w.length,Y--,w.mode=ge;break;case ze:if(w.wrap){for(;V<32;){if(b===0)break e;b--,U|=$[L++]<<V,V+=8}if(Ne-=Y,M.total_out+=Ne,w.total+=Ne,Ne&&(M.adler=w.check=w.flags?s(w.check,c,Ne,ie-Ne):o(w.check,c,Ne,ie-Ne)),Ne=Y,(w.flags?U:gt(U))!==w.check){M.msg="incorrect data check",w.mode=De;break}U=0,V=0}w.mode=et;case et:if(w.wrap&&w.flags){for(;V<32;){if(b===0)break e;b--,U+=$[L++]<<V,V+=8}if(U!==(w.total&4294967295)){M.msg="incorrect length check",w.mode=De;break}U=0,V=0}w.mode=Pe;case Pe:xt=m;break e;case De:xt=x;break e;case Je:return _;case Qe:default:return E}return M.next_out=ie,M.avail_out=Y,M.next_in=L,M.avail_in=b,w.hold=U,w.bits=V,(w.wsize||Ne!==M.avail_out&&w.mode<De&&(w.mode<ze||G!==p))&&X(M,M.output,M.next_out,Ne-M.avail_out)?(w.mode=Je,_):(ye-=M.avail_in,Ne-=M.avail_out,M.total_in+=ye,M.total_out+=Ne,w.total+=Ne,w.wrap&&Ne&&(M.adler=w.check=w.flags?s(w.check,c,Ne,M.next_out-Ne):o(w.check,c,Ne,M.next_out-Ne)),M.data_type=w.bits+(w.last?64:0)+(w.mode===fe?128:0)+(w.mode===ve||w.mode===be?256:0),(ye===0&&Ne===0||G===p)&&xt===u&&(xt=I),xt)}function S(M){if(!M||!M.state)return E;var G=M.state;return G.window&&(G.window=null),M.state=null,u}function J(M,G){var w;return!M||!M.state||(w=M.state,(w.wrap&2)===0)?E:(w.head=G,G.done=!1,u)}function ae(M,G){var w=G.length,$,c,L;return!M||!M.state||($=M.state,$.wrap!==0&&$.mode!==te)?E:$.mode===te&&(c=1,c=o(c,G,w,0),c!==$.check)?x:(L=X(M,G,w,w),L?($.mode=Je,_):($.havedict=1,u))}n.inflateReset=ct,n.inflateReset2=yt,n.inflateResetKeep=at,n.inflateInit=Bt,n.inflateInit2=dt,n.inflate=le,n.inflateEnd=S,n.inflateGetHeader=J,n.inflateSetDictionary=ae,n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,r,n){"use strict";var a=t("../utils/common"),o=15,s=852,l=592,h=0,d=1,f=2,v=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],p=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],y=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],k=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(m,g,E,x,_,I,A,D){var z=D.bits,O=0,F=0,W=0,q=0,re=0,K=0,de=0,ue=0,te=0,fe=0,ee,Se,be,Ce,Le,Oe=null,Re=0,ve,ge=new a.Buf16(o+1),Te=new a.Buf16(o+1),se=null,ce=0,xe,He,ze;for(O=0;O<=o;O++)ge[O]=0;for(F=0;F<x;F++)ge[g[E+F]]++;for(re=z,q=o;q>=1&&ge[q]===0;q--);if(re>q&&(re=q),q===0)return _[I++]=20971520,_[I++]=20971520,D.bits=1,0;for(W=1;W<q&&ge[W]===0;W++);for(re<W&&(re=W),ue=1,O=1;O<=o;O++)if(ue<<=1,ue-=ge[O],ue<0)return-1;if(ue>0&&(m===h||q!==1))return-1;for(Te[1]=0,O=1;O<o;O++)Te[O+1]=Te[O]+ge[O];for(F=0;F<x;F++)g[E+F]!==0&&(A[Te[g[E+F]]++]=F);if(m===h?(Oe=se=A,ve=19):m===d?(Oe=v,Re-=257,se=p,ce-=257,ve=256):(Oe=y,se=k,ve=-1),fe=0,F=0,O=W,Le=I,K=re,de=0,be=-1,te=1<<re,Ce=te-1,m===d&&te>s||m===f&&te>l)return 1;for(;;){xe=O-de,A[F]<ve?(He=0,ze=A[F]):A[F]>ve?(He=se[ce+A[F]],ze=Oe[Re+A[F]]):(He=96,ze=0),ee=1<<O-de,Se=1<<K,W=Se;do Se-=ee,_[Le+(fe>>de)+Se]=xe<<24|He<<16|ze|0;while(Se!==0);for(ee=1<<O-1;feⅇ)ee>>=1;if(ee!==0?(fe&=ee-1,fe+=ee):fe=0,F++,--ge[O]===0){if(O===q)break;O=g[E+A[F]]}if(O>re&&(fe&Ce)!==be){for(de===0&&(de=re),Le+=W,K=O-de,ue=1<<K;K+de<q&&(ue-=ge[K+de],!(ue<=0));)K++,ue<<=1;if(te+=1<<K,m===d&&te>s||m===f&&te>l)return 1;be=fe&Ce,_[be]=re<<24|K<<16|Le-I|0}}return fe!==0&&(_[Le+fe]=O-de<<24|4194304),D.bits=re,0}},{"../utils/common":41}],51:[function(t,r,n){"use strict";r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,r,n){"use strict";var a=t("../utils/common"),o=4,s=0,l=1,h=2;function d(S){for(var J=S.length;--J>=0;)S[J]=0}var f=0,v=1,p=2,y=3,k=258,u=29,m=256,g=m+1+u,E=30,x=19,_=2*g+1,I=15,A=16,D=7,z=256,O=16,F=17,W=18,q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],re=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],de=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ue=512,te=new Array((g+2)*2);d(te);var fe=new Array(E*2);d(fe);var ee=new Array(ue);d(ee);var Se=new Array(k-y+1);d(Se);var be=new Array(u);d(be);var Ce=new Array(E);d(Ce);function Le(S,J,ae,M,G){this.static_tree=S,this.extra_bits=J,this.extra_base=ae,this.elems=M,this.max_length=G,this.has_stree=S&&S.length}var Oe,Re,ve;function ge(S,J){this.dyn_tree=S,this.max_code=0,this.stat_desc=J}function Te(S){return S<256?ee[S]:ee[256+(S>>>7)]}function se(S,J){S.pending_buf[S.pending++]=J&255,S.pending_buf[S.pending++]=J>>>8&255}function ce(S,J,ae){S.bi_valid>A-ae?(S.bi_buf|=J<<S.bi_valid&65535,se(S,S.bi_buf),S.bi_buf=J>>A-S.bi_valid,S.bi_valid+=ae-A):(S.bi_buf|=J<<S.bi_valid&65535,S.bi_valid+=ae)}function xe(S,J,ae){ce(S,ae[J*2],ae[J*2+1])}function He(S,J){var ae=0;do ae|=S&1,S>>>=1,ae<<=1;while(--J>0);return ae>>>1}function ze(S){S.bi_valid===16?(se(S,S.bi_buf),S.bi_buf=0,S.bi_valid=0):S.bi_valid>=8&&(S.pending_buf[S.pending++]=S.bi_buf&255,S.bi_buf>>=8,S.bi_valid-=8)}function et(S,J){var ae=J.dyn_tree,M=J.max_code,G=J.stat_desc.static_tree,w=J.stat_desc.has_stree,$=J.stat_desc.extra_bits,c=J.stat_desc.extra_base,L=J.stat_desc.max_length,ie,b,Y,U,V,ye,Ne=0;for(U=0;U<=I;U++)S.bl_count[U]=0;for(ae[S.heap[S.heap_max]*2+1]=0,ie=S.heap_max+1;ie<_;ie++)b=S.heap[ie],U=ae[ae[b*2+1]*2+1]+1,U>L&&(U=L,Ne++),ae[b*2+1]=U,!(b>M)&&(S.bl_count[U]++,V=0,b>=c&&(V=$[b-c]),ye=ae[b*2],S.opt_len+=ye*(U+V),w&&(S.static_len+=ye*(G[b*2+1]+V)));if(Ne!==0){do{for(U=L-1;S.bl_count[U]===0;)U--;S.bl_count[U]--,S.bl_count[U+1]+=2,S.bl_count[L]--,Ne-=2}while(Ne>0);for(U=L;U!==0;U--)for(b=S.bl_count[U];b!==0;)Y=S.heap[--ie],!(Y>M)&&(ae[Y*2+1]!==U&&(S.opt_len+=(U-ae[Y*2+1])*ae[Y*2],ae[Y*2+1]=U),b--)}}function Pe(S,J,ae){var M=new Array(I+1),G=0,w,$;for(w=1;w<=I;w++)M[w]=G=G+ae[w-1]<<1;for($=0;$<=J;$++){var c=S[$*2+1];c!==0&&(S[$*2]=He(M[c]++,c))}}function De(){var S,J,ae,M,G,w=new Array(I+1);for(ae=0,M=0;M<u-1;M++)for(be[M]=ae,S=0;S<1<<q[M];S++)Se[ae++]=M;for(Se[ae-1]=M,G=0,M=0;M<16;M++)for(Ce[M]=G,S=0;S<1<<re[M];S++)ee[G++]=M;for(G>>=7;M<E;M++)for(Ce[M]=G<<7,S=0;S<1<<re[M]-7;S++)ee[256+G++]=M;for(J=0;J<=I;J++)w[J]=0;for(S=0;S<=143;)te[S*2+1]=8,S++,w[8]++;for(;S<=255;)te[S*2+1]=9,S++,w[9]++;for(;S<=279;)te[S*2+1]=7,S++,w[7]++;for(;S<=287;)te[S*2+1]=8,S++,w[8]++;for(Pe(te,g+1,w),S=0;S<E;S++)fe[S*2+1]=5,fe[S*2]=He(S,5);Oe=new Le(te,q,m+1,g,I),Re=new Le(fe,re,0,E,I),ve=new Le(new Array(0),K,0,x,D)}function Je(S){var J;for(J=0;J<g;J++)S.dyn_ltree[J*2]=0;for(J=0;J<E;J++)S.dyn_dtree[J*2]=0;for(J=0;J<x;J++)S.bl_tree[J*2]=0;S.dyn_ltree[z*2]=1,S.opt_len=S.static_len=0,S.last_lit=S.matches=0}function Qe(S){S.bi_valid>8?se(S,S.bi_buf):S.bi_valid>0&&(S.pending_buf[S.pending++]=S.bi_buf),S.bi_buf=0,S.bi_valid=0}function We(S,J,ae,M){Qe(S),M&&(se(S,ae),se(S,~ae)),a.arraySet(S.pending_buf,S.window,J,ae,S.pending),S.pending+=ae}function we(S,J,ae,M){var G=J*2,w=ae*2;return S[G]<S[w]||S[G]===S[w]&&M[J]<=M[ae]}function Ge(S,J,ae){for(var M=S.heap[ae],G=ae<<1;G<=S.heap_len&&(G<S.heap_len&&we(J,S.heap[G+1],S.heap[G],S.depth)&&G++,!we(J,M,S.heap[G],S.depth));)S.heap[ae]=S.heap[G],ae=G,G<<=1;S.heap[ae]=M}function gt(S,J,ae){var M,G,w=0,$,c;if(S.last_lit!==0)do M=S.pending_buf[S.d_buf+w*2]<<8|S.pending_buf[S.d_buf+w*2+1],G=S.pending_buf[S.l_buf+w],w++,M===0?xe(S,G,J):($=Se[G],xe(S,$+m+1,J),c=q[$],c!==0&&(G-=be[$],ce(S,G,c)),M--,$=Te(M),xe(S,$,ae),c=re[$],c!==0&&(M-=Ce[$],ce(S,M,c)));while(w<S.last_lit);xe(S,z,J)}function wt(S,J){var ae=J.dyn_tree,M=J.stat_desc.static_tree,G=J.stat_desc.has_stree,w=J.stat_desc.elems,$,c,L=-1,ie;for(S.heap_len=0,S.heap_max=_,$=0;$<w;$++)ae[$*2]!==0?(S.heap[++S.heap_len]=L=$,S.depth[$]=0):ae[$*2+1]=0;for(;S.heap_len<2;)ie=S.heap[++S.heap_len]=L<2?++L:0,ae[ie*2]=1,S.depth[ie]=0,S.opt_len--,G&&(S.static_len-=M[ie*2+1]);for(J.max_code=L,$=S.heap_len>>1;$>=1;$--)Ge(S,ae,$);ie=w;do $=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Ge(S,ae,1),c=S.heap[1],S.heap[--S.heap_max]=$,S.heap[--S.heap_max]=c,ae[ie*2]=ae[$*2]+ae[c*2],S.depth[ie]=(S.depth[$]>=S.depth[c]?S.depth[$]:S.depth[c])+1,ae[$*2+1]=ae[c*2+1]=ie,S.heap[1]=ie++,Ge(S,ae,1);while(S.heap_len>=2);S.heap[--S.heap_max]=S.heap[1],et(S,J),Pe(ae,L,S.bl_count)}function at(S,J,ae){var M,G=-1,w,$=J[1],c=0,L=7,ie=4;for($===0&&(L=138,ie=3),J[(ae+1)*2+1]=65535,M=0;M<=ae;M++)w=$,$=J[(M+1)*2+1],!(++c<L&&w===$)&&(c<ie?S.bl_tree[w*2]+=c:w!==0?(w!==G&&S.bl_tree[w*2]++,S.bl_tree[O*2]++):c<=10?S.bl_tree[F*2]++:S.bl_tree[W*2]++,c=0,G=w,$===0?(L=138,ie=3):w===$?(L=6,ie=3):(L=7,ie=4))}function ct(S,J,ae){var M,G=-1,w,$=J[1],c=0,L=7,ie=4;for($===0&&(L=138,ie=3),M=0;M<=ae;M++)if(w=$,$=J[(M+1)*2+1],!(++c<L&&w===$)){if(c<ie)do xe(S,w,S.bl_tree);while(--c!==0);else w!==0?(w!==G&&(xe(S,w,S.bl_tree),c--),xe(S,O,S.bl_tree),ce(S,c-3,2)):c<=10?(xe(S,F,S.bl_tree),ce(S,c-3,3)):(xe(S,W,S.bl_tree),ce(S,c-11,7));c=0,G=w,$===0?(L=138,ie=3):w===$?(L=6,ie=3):(L=7,ie=4)}}function yt(S){var J;for(at(S,S.dyn_ltree,S.l_desc.max_code),at(S,S.dyn_dtree,S.d_desc.max_code),wt(S,S.bl_desc),J=x-1;J>=3&&S.bl_tree[de[J]*2+1]===0;J--);return S.opt_len+=3*(J+1)+5+5+4,J}function dt(S,J,ae,M){var G;for(ce(S,J-257,5),ce(S,ae-1,5),ce(S,M-4,4),G=0;G<M;G++)ce(S,S.bl_tree[de[G]*2+1],3);ct(S,S.dyn_ltree,J-1),ct(S,S.dyn_dtree,ae-1)}function Bt(S){var J=4093624447,ae;for(ae=0;ae<=31;ae++,J>>>=1)if(J&1&&S.dyn_ltree[ae*2]!==0)return s;if(S.dyn_ltree[18]!==0||S.dyn_ltree[20]!==0||S.dyn_ltree[26]!==0)return l;for(ae=32;ae<m;ae++)if(S.dyn_ltree[ae*2]!==0)return l;return s}var Ut=!1;function T(S){Ut||(De(),Ut=!0),S.l_desc=new ge(S.dyn_ltree,Oe),S.d_desc=new ge(S.dyn_dtree,Re),S.bl_desc=new ge(S.bl_tree,ve),S.bi_buf=0,S.bi_valid=0,Je(S)}function R(S,J,ae,M){ce(S,(f<<1)+(M?1:0),3),We(S,J,ae,!0)}function B(S){ce(S,v<<1,3),xe(S,z,te),ze(S)}function X(S,J,ae,M){var G,w,$=0;S.level>0?(S.strm.data_type===h&&(S.strm.data_type=Bt(S)),wt(S,S.l_desc),wt(S,S.d_desc),$=yt(S),G=S.opt_len+3+7>>>3,w=S.static_len+3+7>>>3,w<=G&&(G=w)):G=w=ae+5,ae+4<=G&&J!==-1?R(S,J,ae,M):S.strategy===o||w===G?(ce(S,(v<<1)+(M?1:0),3),gt(S,te,fe)):(ce(S,(p<<1)+(M?1:0),3),dt(S,S.l_desc.max_code+1,S.d_desc.max_code+1,$+1),gt(S,S.dyn_ltree,S.dyn_dtree)),Je(S),M&&Qe(S)}function le(S,J,ae){return S.pending_buf[S.d_buf+S.last_lit*2]=J>>>8&255,S.pending_buf[S.d_buf+S.last_lit*2+1]=J&255,S.pending_buf[S.l_buf+S.last_lit]=ae&255,S.last_lit++,J===0?S.dyn_ltree[ae*2]++:(S.matches++,J--,S.dyn_ltree[(Se[ae]+m+1)*2]++,S.dyn_dtree[Te(J)*2]++),S.last_lit===S.lit_bufsize-1}n._tr_init=T,n._tr_stored_block=R,n._tr_flush_block=X,n._tr_tally=le,n._tr_align=B},{"../utils/common":41}],53:[function(t,r,n){"use strict";function a(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}r.exports=a},{}],54:[function(t,r,n){(function(a){(function(o,s){"use strict";if(o.setImmediate)return;var l=1,h={},d=!1,f=o.document,v;function p(D){typeof D!="function"&&(D=new Function(""+D));for(var z=new Array(arguments.length-1),O=0;O<z.length;O++)z[O]=arguments[O+1];return h[l]={callback:D,args:z},v(l),l++}function y(D){delete h[D]}function k(D){var z=D.callback,O=D.args;switch(O.length){case 0:z();break;case 1:z(O[0]);break;case 2:z(O[0],O[1]);break;case 3:z(O[0],O[1],O[2]);break;default:z.apply(s,O);break}}function u(D){if(d)setTimeout(u,0,D);else{var z=h[D];if(z){d=!0;try{k(z)}finally{y(D),d=!1}}}}function m(){v=function(D){process.nextTick(function(){u(D)})}}function g(){if(o.postMessage&&!o.importScripts){var D=!0,z=o.onmessage;return o.onmessage=function(){D=!1},o.postMessage("","*"),o.onmessage=z,D}}function E(){var D="setImmediate$"+Math.random()+"$",z=function(O){O.source===o&&typeof O.data=="string"&&O.data.indexOf(D)===0&&u(+O.data.slice(D.length))};o.addEventListener?o.addEventListener("message",z,!1):o.attachEvent("onmessage",z),v=function(O){o.postMessage(D+O,"*")}}function x(){var D=new MessageChannel;D.port1.onmessage=function(z){var O=z.data;u(O)},v=function(z){D.port2.postMessage(z)}}function _(){var D=f.documentElement;v=function(z){var O=f.createElement("script");O.onreadystatechange=function(){u(z),O.onreadystatechange=null,D.removeChild(O),O=null},D.appendChild(O)}}function I(){v=function(D){setTimeout(u,0,D)}}var A=Object.getPrototypeOf&&Object.getPrototypeOf(o);A=A&&A.setTimeout?A:o,{}.toString.call(o.process)==="[object process]"?m():g()?E():o.MessageChannel?x():f&&"onreadystatechange"in f.createElement("script")?_():I(),A.setImmediate=p,A.clearImmediate=y})(typeof self>"u"?typeof a>"u"?this:a:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})),jl,Hl,tf=_e((()=>{Ye(),Gr(),da(),ci(),jl=lt(ef()),Hl=class{constructor(){this.zip=void 0,this.urlCache={},this.checkRequirements()}checkRequirements(){try{this.zip=new jl.default}catch{throw new Error("JSZip lib not loaded")}}open(e,i){return this.zip.loadAsync(e,{base64:i})}openUrl(e,i){return er(e,"binary").then(function(t){return this.zip.loadAsync(t,{base64:i})}.bind(this))}request(e,i){var t=new Fe,r,n=new Vt(e);return i||(i=n.extension),i=="blob"?r=this.getBlob(e):r=this.getText(e),r?r.then(function(a){let o=this.handleResponse(a,i);t.resolve(o)}.bind(this)):t.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),t.promise}handleResponse(e,i){var t;return i=="json"?t=JSON.parse(e):Ji(i)?t=Zt(e,"text/xml"):i=="xhtml"?t=Zt(e,"application/xhtml+xml"):i=="html"||i=="htm"?t=Zt(e,"text/html"):t=e,t}getBlob(e,i){var t=window.decodeURIComponent(e.substr(1)),r=this.zip.file(t);if(r)return i=i||pi.lookup(r.name),r.async("uint8array").then(function(n){return new Blob([n],{type:i})})}getText(e,i){var t=window.decodeURIComponent(e.substr(1)),r=this.zip.file(t);if(r)return r.async("string").then(function(n){return n})}getBase64(e,i){var t=window.decodeURIComponent(e.substr(1)),r=this.zip.file(t);if(r)return i=i||pi.lookup(r.name),r.async("base64").then(function(n){return"data:"+i+";base64,"+n})}createUrl(e,i){var t=new Fe,r=window.URL||window.webkitURL||window.mozURL,n,a,o=i&&i.base64;return e in this.urlCache?(t.resolve(this.urlCache[e]),t.promise):(o?(a=this.getBase64(e),a&&a.then(function(s){this.urlCache[e]=s,t.resolve(s)}.bind(this))):(a=this.getBlob(e),a&&a.then(function(s){n=r.createObjectURL(s),this.urlCache[e]=n,t.resolve(n)}.bind(this))),a||t.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),t.promise)}revokeUrl(e){var i=window.URL||window.webkitURL||window.mozURL,t=this.urlCache[e];t&&i.revokeObjectURL(t)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let i in this.urlCache)e.revokeObjectURL(i);this.zip=void 0,this.urlCache={}}}})),rf=Ae(((e,i)=>{(function(t){if(typeof e=="object"&&typeof i<"u")i.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var r;typeof window<"u"?r=window:typeof global<"u"?r=global:typeof self<"u"?r=self:r=this,r.localforage=t()}})(function(){return(function t(r,n,a){function o(h,d){if(!n[h]){if(!r[h]){var f=typeof require=="function"&&require;if(!d&&f)return f(h,!0);if(s)return s(h,!0);var v=new Error("Cannot find module '"+h+"'");throw v.code="MODULE_NOT_FOUND",v}var p=n[h]={exports:{}};r[h][0].call(p.exports,function(y){var k=r[h][1][y];return o(k||y)},p,p.exports,t,r,n,a)}return n[h].exports}for(var s=typeof require=="function"&&require,l=0;l<a.length;l++)o(a[l]);return o})({1:[function(t,r,n){(function(a){"use strict";var o=a.MutationObserver||a.WebKitMutationObserver,s;if(o){var l=0,h=new o(y),d=a.document.createTextNode("");h.observe(d,{characterData:!0}),s=function(){d.data=l=++l%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var f=new a.MessageChannel;f.port1.onmessage=y,s=function(){f.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?s=function(){var u=a.document.createElement("script");u.onreadystatechange=function(){y(),u.onreadystatechange=null,u.parentNode.removeChild(u),u=null},a.document.documentElement.appendChild(u)}:s=function(){setTimeout(y,0)};var v,p=[];function y(){v=!0;for(var u,m,g=p.length;g;){for(m=p,p=[],u=-1;++u<g;)m[u]();g=p.length}v=!1}r.exports=k;function k(u){p.push(u)===1&&!v&&s()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,r,n){"use strict";var a=t(1);function o(){}var s={},l=["REJECTED"],h=["FULFILLED"],d=["PENDING"];r.exports=f;function f(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,_!==o&&k(this,_)}f.prototype.catch=function(_){return this.then(null,_)},f.prototype.then=function(_,I){if(typeof _!="function"&&this.state===h||typeof I!="function"&&this.state===l)return this;var A=new this.constructor(o);return this.state!==d?p(A,this.state===h?_:I,this.outcome):this.queue.push(new v(A,_,I)),A};function v(_,I,A){this.promise=_,typeof I=="function"&&(this.onFulfilled=I,this.callFulfilled=this.otherCallFulfilled),typeof A=="function"&&(this.onRejected=A,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(_){s.resolve(this.promise,_)},v.prototype.otherCallFulfilled=function(_){p(this.promise,this.onFulfilled,_)},v.prototype.callRejected=function(_){s.reject(this.promise,_)},v.prototype.otherCallRejected=function(_){p(this.promise,this.onRejected,_)};function p(_,I,A){a(function(){var D;try{D=I(A)}catch(z){return s.reject(_,z)}D===_?s.reject(_,new TypeError("Cannot resolve promise with itself")):s.resolve(_,D)})}s.resolve=function(_,I){var A=u(y,I);if(A.status==="error")return s.reject(_,A.value);var D=A.value;if(D)k(_,D);else{_.state=h,_.outcome=I;for(var z=-1,O=_.queue.length;++z<O;)_.queue[z].callFulfilled(I)}return _},s.reject=function(_,I){_.state=l,_.outcome=I;for(var A=-1,D=_.queue.length;++A<D;)_.queue[A].callRejected(I);return _};function y(_){var I=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof I=="function")return function(){I.apply(_,arguments)}}function k(_,I){var A=!1;function D(W){A||(A=!0,s.reject(_,W))}function z(W){A||(A=!0,s.resolve(_,W))}function O(){I(z,D)}var F=u(O);F.status==="error"&&D(F.value)}function u(_,I){var A={};try{A.value=_(I),A.status="success"}catch(D){A.status="error",A.value=D}return A}f.resolve=m;function m(_){return _ instanceof this?_:s.resolve(new this(o),_)}f.reject=g;function g(_){var I=new this(o);return s.reject(I,_)}f.all=E;function E(_){var I=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=_.length,D=!1;if(!A)return this.resolve([]);for(var z=new Array(A),O=0,F=-1,W=new this(o);++F<A;)q(_[F],F);return W;function q(re,K){I.resolve(re).then(de,function(ue){D||(D=!0,s.reject(W,ue))});function de(ue){z[K]=ue,++O===A&&!D&&(D=!0,s.resolve(W,z))}}}f.race=x;function x(_){var I=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=_.length,D=!1;if(!A)return this.resolve([]);for(var z=-1,O=new this(o);++z<A;)F(_[z]);return O;function F(W){I.resolve(W).then(function(q){D||(D=!0,s.resolve(O,q))},function(q){D||(D=!0,s.reject(O,q))})}}},{1:1}],3:[function(t,r,n){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=t(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,r,n){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C};function o(C,P){if(!(C instanceof P))throw new TypeError("Cannot call a class as a function")}function s(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var l=s();function h(){try{if(!l||!l.open)return!1;var C=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),P=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!C||P)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function d(C,P){C=C||[],P=P||{};try{return new Blob(C,P)}catch(Z){if(Z.name!=="TypeError")throw Z;for(var N=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),j=0;j<C.length;j+=1)N.append(C[j]);return N.getBlob(P.type)}}typeof Promise>"u"&&t(3);var f=Promise;function v(C,P){P&&C.then(function(N){P(null,N)},function(N){P(N)})}function p(C,P,N){typeof P=="function"&&C.then(P),typeof N=="function"&&C.catch(N)}function y(C){return typeof C!="string"&&(console.warn(C+" used as a key, but it is not a string."),C=String(C)),C}function k(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var u="local-forage-detect-blob-support",m=void 0,g={},E=Object.prototype.toString,x="readonly",_="readwrite";function I(C){for(var P=C.length,N=new ArrayBuffer(P),j=new Uint8Array(N),Z=0;Z<P;Z++)j[Z]=C.charCodeAt(Z);return N}function A(C){return new f(function(P){var N=C.transaction(u,_),j=d([""]);N.objectStore(u).put(j,"key"),N.onabort=function(Z){Z.preventDefault(),Z.stopPropagation(),P(!1)},N.oncomplete=function(){var Z=navigator.userAgent.match(/Chrome\/(\d+)/);P(navigator.userAgent.match(/Edge\//)||!Z||parseInt(Z[1],10)>=43)}}).catch(function(){return!1})}function D(C){return typeof m=="boolean"?f.resolve(m):A(C).then(function(P){return m=P,m})}function z(C){var P=g[C.name],N={};N.promise=new f(function(j,Z){N.resolve=j,N.reject=Z}),P.deferredOperations.push(N),P.dbReady?P.dbReady=P.dbReady.then(function(){return N.promise}):P.dbReady=N.promise}function O(C){var P=g[C.name].deferredOperations.pop();if(P)return P.resolve(),P.promise}function F(C,P){var N=g[C.name].deferredOperations.pop();if(N)return N.reject(P),N.promise}function W(C,P){return new f(function(N,j){if(g[C.name]=g[C.name]||be(),C.db)if(P)z(C),C.db.close();else return N(C.db);var Z=[C.name];P&&Z.push(C.version);var H=l.open.apply(l,Z);P&&(H.onupgradeneeded=function(Q){var ne=H.result;try{ne.createObjectStore(C.storeName),Q.oldVersion<=1&&ne.createObjectStore(u)}catch(oe){if(oe.name==="ConstraintError")console.warn('The database "'+C.name+'" has been upgraded from version '+Q.oldVersion+" to version "+Q.newVersion+', but the storage "'+C.storeName+'" already exists.');else throw oe}}),H.onerror=function(Q){Q.preventDefault(),j(H.error)},H.onsuccess=function(){var Q=H.result;Q.onversionchange=function(ne){ne.target.close()},N(Q),O(C)}})}function q(C){return W(C,!1)}function re(C){return W(C,!0)}function K(C,P){if(!C.db)return!0;var N=!C.db.objectStoreNames.contains(C.storeName),j=C.version<C.db.version,Z=C.version>C.db.version;if(j&&(C.version!==P&&console.warn('The database "'+C.name+`" can't be downgraded from version `+C.db.version+" to version "+C.version+"."),C.version=C.db.version),Z||N){if(N){var H=C.db.version+1;H>C.version&&(C.version=H)}return!0}return!1}function de(C){return new f(function(P,N){var j=new FileReader;j.onerror=N,j.onloadend=function(Z){P({__local_forage_encoded_blob:!0,data:btoa(Z.target.result||""),type:C.type})},j.readAsBinaryString(C)})}function ue(C){return d([I(atob(C.data))],{type:C.type})}function te(C){return C&&C.__local_forage_encoded_blob}function fe(C){var P=this,N=P._initReady().then(function(){var j=g[P._dbInfo.name];if(j&&j.dbReady)return j.dbReady});return p(N,C,C),N}function ee(C){z(C);for(var P=g[C.name],N=P.forages,j=0;j<N.length;j++){var Z=N[j];Z._dbInfo.db&&(Z._dbInfo.db.close(),Z._dbInfo.db=null)}return C.db=null,q(C).then(function(H){return C.db=H,K(C)?re(C):H}).then(function(H){C.db=P.db=H;for(var Q=0;Q<N.length;Q++)N[Q]._dbInfo.db=H}).catch(function(H){throw F(C,H),H})}function Se(C,P,N,j){j===void 0&&(j=1);try{N(null,C.db.transaction(C.storeName,P))}catch(Z){if(j>0&&(!C.db||Z.name==="InvalidStateError"||Z.name==="NotFoundError"))return f.resolve().then(function(){if(!C.db||Z.name==="NotFoundError"&&!C.db.objectStoreNames.contains(C.storeName)&&C.version<=C.db.version)return C.db&&(C.version=C.db.version+1),re(C)}).then(function(){return ee(C).then(function(){Se(C,P,N,j-1)})}).catch(N);N(Z)}}function be(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ce(C){var P=this,N={db:null};if(C)for(var j in C)N[j]=C[j];var Z=g[N.name];Z||(Z=be(),g[N.name]=Z),Z.forages.push(P),P._initReady||(P._initReady=P.ready,P.ready=fe);var H=[];function Q(){return f.resolve()}for(var ne=0;ne<Z.forages.length;ne++){var oe=Z.forages[ne];oe!==P&&H.push(oe._initReady().catch(Q))}var pe=Z.forages.slice(0);return f.all(H).then(function(){return N.db=Z.db,q(N)}).then(function(ke){return N.db=ke,K(N,P._defaultConfig.version)?re(N):ke}).then(function(ke){N.db=Z.db=ke,P._dbInfo=N;for(var Ee=0;Ee<pe.length;Ee++){var Ie=pe[Ee];Ie!==P&&(Ie._dbInfo.db=N.db,Ie._dbInfo.version=N.version)}})}function Le(C,P){var N=this;C=y(C);var j=new f(function(Z,H){N.ready().then(function(){Se(N._dbInfo,x,function(Q,ne){if(Q)return H(Q);try{var oe=ne.objectStore(N._dbInfo.storeName).get(C);oe.onsuccess=function(){var pe=oe.result;pe===void 0&&(pe=null),te(pe)&&(pe=ue(pe)),Z(pe)},oe.onerror=function(){H(oe.error)}}catch(pe){H(pe)}})}).catch(H)});return v(j,P),j}function Oe(C,P){var N=this,j=new f(function(Z,H){N.ready().then(function(){Se(N._dbInfo,x,function(Q,ne){if(Q)return H(Q);try{var oe=ne.objectStore(N._dbInfo.storeName).openCursor(),pe=1;oe.onsuccess=function(){var ke=oe.result;if(ke){var Ee=ke.value;te(Ee)&&(Ee=ue(Ee));var Ie=C(Ee,ke.key,pe++);Ie!==void 0?Z(Ie):ke.continue()}else Z()},oe.onerror=function(){H(oe.error)}}catch(ke){H(ke)}})}).catch(H)});return v(j,P),j}function Re(C,P,N){var j=this;C=y(C);var Z=new f(function(H,Q){var ne;j.ready().then(function(){return ne=j._dbInfo,E.call(P)==="[object Blob]"?D(ne.db).then(function(oe){return oe?P:de(P)}):P}).then(function(oe){Se(j._dbInfo,_,function(pe,ke){if(pe)return Q(pe);try{var Ee=ke.objectStore(j._dbInfo.storeName);oe===null&&(oe=void 0);var Ie=Ee.put(oe,C);ke.oncomplete=function(){oe===void 0&&(oe=null),H(oe)},ke.onabort=ke.onerror=function(){Q(Ie.error?Ie.error:Ie.transaction.error)}}catch(Ve){Q(Ve)}})}).catch(Q)});return v(Z,N),Z}function ve(C,P){var N=this;C=y(C);var j=new f(function(Z,H){N.ready().then(function(){Se(N._dbInfo,_,function(Q,ne){if(Q)return H(Q);try{var oe=ne.objectStore(N._dbInfo.storeName).delete(C);ne.oncomplete=function(){Z()},ne.onerror=function(){H(oe.error)},ne.onabort=function(){H(oe.error?oe.error:oe.transaction.error)}}catch(pe){H(pe)}})}).catch(H)});return v(j,P),j}function ge(C){var P=this,N=new f(function(j,Z){P.ready().then(function(){Se(P._dbInfo,_,function(H,Q){if(H)return Z(H);try{var ne=Q.objectStore(P._dbInfo.storeName).clear();Q.oncomplete=function(){j()},Q.onabort=Q.onerror=function(){Z(ne.error?ne.error:ne.transaction.error)}}catch(oe){Z(oe)}})}).catch(Z)});return v(N,C),N}function Te(C){var P=this,N=new f(function(j,Z){P.ready().then(function(){Se(P._dbInfo,x,function(H,Q){if(H)return Z(H);try{var ne=Q.objectStore(P._dbInfo.storeName).count();ne.onsuccess=function(){j(ne.result)},ne.onerror=function(){Z(ne.error)}}catch(oe){Z(oe)}})}).catch(Z)});return v(N,C),N}function se(C,P){var N=this,j=new f(function(Z,H){if(C<0){Z(null);return}N.ready().then(function(){Se(N._dbInfo,x,function(Q,ne){if(Q)return H(Q);try{var oe=ne.objectStore(N._dbInfo.storeName),pe=!1,ke=oe.openKeyCursor();ke.onsuccess=function(){var Ee=ke.result;if(!Ee){Z(null);return}C===0||pe?Z(Ee.key):(pe=!0,Ee.advance(C))},ke.onerror=function(){H(ke.error)}}catch(Ee){H(Ee)}})}).catch(H)});return v(j,P),j}function ce(C){var P=this,N=new f(function(j,Z){P.ready().then(function(){Se(P._dbInfo,x,function(H,Q){if(H)return Z(H);try{var ne=Q.objectStore(P._dbInfo.storeName).openKeyCursor(),oe=[];ne.onsuccess=function(){var pe=ne.result;if(!pe){j(oe);return}oe.push(pe.key),pe.continue()},ne.onerror=function(){Z(ne.error)}}catch(pe){Z(pe)}})}).catch(Z)});return v(N,C),N}function xe(C,P){P=k.apply(this,arguments);var N=this.config();C=typeof C!="function"&&C||{},C.name||(C.name=C.name||N.name,C.storeName=C.storeName||N.storeName);var j=this,Z;if(!C.name)Z=f.reject("Invalid arguments");else{var H=C.name===N.name&&j._dbInfo.db?f.resolve(j._dbInfo.db):q(C).then(function(Q){var ne=g[C.name],oe=ne.forages;ne.db=Q;for(var pe=0;pe<oe.length;pe++)oe[pe]._dbInfo.db=Q;return Q});C.storeName?Z=H.then(function(Q){if(Q.objectStoreNames.contains(C.storeName)){var ne=Q.version+1;z(C);var oe=g[C.name],pe=oe.forages;Q.close();for(var ke=0;ke<pe.length;ke++){var Ee=pe[ke];Ee._dbInfo.db=null,Ee._dbInfo.version=ne}return new f(function(Ie,Ve){var Ue=l.open(C.name,ne);Ue.onerror=function(Lt){Ue.result.close(),Ve(Lt)},Ue.onupgradeneeded=function(){Ue.result.deleteObjectStore(C.storeName)},Ue.onsuccess=function(){var Lt=Ue.result;Lt.close(),Ie(Lt)}}).then(function(Ie){oe.db=Ie;for(var Ve=0;Ve<pe.length;Ve++){var Ue=pe[Ve];Ue._dbInfo.db=Ie,O(Ue._dbInfo)}}).catch(function(Ie){throw(F(C,Ie)||f.resolve()).catch(function(){}),Ie})}}):Z=H.then(function(Q){z(C);var ne=g[C.name],oe=ne.forages;Q.close();for(var pe=0;pe<oe.length;pe++){var ke=oe[pe];ke._dbInfo.db=null}return new f(function(Ee,Ie){var Ve=l.deleteDatabase(C.name);Ve.onerror=function(){var Ue=Ve.result;Ue&&Ue.close(),Ie(Ve.error)},Ve.onblocked=function(){console.warn('dropInstance blocked for database "'+C.name+'" until all open connections are closed')},Ve.onsuccess=function(){var Ue=Ve.result;Ue&&Ue.close(),Ee(Ue)}}).then(function(Ee){ne.db=Ee;for(var Ie=0;Ie<oe.length;Ie++){var Ve=oe[Ie];O(Ve._dbInfo)}}).catch(function(Ee){throw(F(C,Ee)||f.resolve()).catch(function(){}),Ee})})}return v(Z,P),Z}var He={_driver:"asyncStorage",_initStorage:Ce,_support:h(),iterate:Oe,getItem:Le,setItem:Re,removeItem:ve,clear:ge,length:Te,key:se,keys:ce,dropInstance:xe};function ze(){return typeof openDatabase=="function"}var et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe="~~local_forage_type~",De=/^~~local_forage_type~([^~]+)~/,Je="__lfsc__:",Qe=Je.length,We="arbf",we="blob",Ge="si08",gt="ui08",wt="uic8",at="si16",ct="si32",yt="ur16",dt="ui32",Bt="fl32",Ut="fl64",T=Qe+We.length,R=Object.prototype.toString;function B(C){var P=C.length*.75,N=C.length,j,Z=0,H,Q,ne,oe;C[C.length-1]==="="&&(P--,C[C.length-2]==="="&&P--);var pe=new ArrayBuffer(P),ke=new Uint8Array(pe);for(j=0;j<N;j+=4)H=et.indexOf(C[j]),Q=et.indexOf(C[j+1]),ne=et.indexOf(C[j+2]),oe=et.indexOf(C[j+3]),ke[Z++]=H<<2|Q>>4,ke[Z++]=(Q&15)<<4|ne>>2,ke[Z++]=(ne&3)<<6|oe&63;return pe}function X(C){var P=new Uint8Array(C),N="",j;for(j=0;j<P.length;j+=3)N+=et[P[j]>>2],N+=et[(P[j]&3)<<4|P[j+1]>>4],N+=et[(P[j+1]&15)<<2|P[j+2]>>6],N+=et[P[j+2]&63];return P.length%3===2?N=N.substring(0,N.length-1)+"=":P.length%3===1&&(N=N.substring(0,N.length-2)+"=="),N}function le(C,P){var N="";if(C&&(N=R.call(C)),C&&(N==="[object ArrayBuffer]"||C.buffer&&R.call(C.buffer)==="[object ArrayBuffer]")){var j,Z=Je;C instanceof ArrayBuffer?(j=C,Z+=We):(j=C.buffer,N==="[object Int8Array]"?Z+=Ge:N==="[object Uint8Array]"?Z+=gt:N==="[object Uint8ClampedArray]"?Z+=wt:N==="[object Int16Array]"?Z+=at:N==="[object Uint16Array]"?Z+=yt:N==="[object Int32Array]"?Z+=ct:N==="[object Uint32Array]"?Z+=dt:N==="[object Float32Array]"?Z+=Bt:N==="[object Float64Array]"?Z+=Ut:P(new Error("Failed to get type for BinaryArray"))),P(Z+X(j))}else if(N==="[object Blob]"){var H=new FileReader;H.onload=function(){var Q=Pe+C.type+"~"+X(this.result);P(Je+we+Q)},H.readAsArrayBuffer(C)}else try{P(JSON.stringify(C))}catch(Q){console.error("Couldn't convert value into a JSON string: ",C),P(null,Q)}}function S(C){if(C.substring(0,Qe)!==Je)return JSON.parse(C);var P=C.substring(T),N=C.substring(Qe,T),j;if(N===we&&De.test(P)){var Z=P.match(De);j=Z[1],P=P.substring(Z[0].length)}var H=B(P);switch(N){case We:return H;case we:return d([H],{type:j});case Ge:return new Int8Array(H);case gt:return new Uint8Array(H);case wt:return new Uint8ClampedArray(H);case at:return new Int16Array(H);case yt:return new Uint16Array(H);case ct:return new Int32Array(H);case dt:return new Uint32Array(H);case Bt:return new Float32Array(H);case Ut:return new Float64Array(H);default:throw new Error("Unkown type: "+N)}}var J={serialize:le,deserialize:S,stringToBuffer:B,bufferToString:X};function ae(C,P,N,j){C.executeSql("CREATE TABLE IF NOT EXISTS "+P.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],N,j)}function M(C){var P=this,N={db:null};if(C)for(var j in C)N[j]=typeof C[j]!="string"?C[j].toString():C[j];var Z=new f(function(H,Q){try{N.db=openDatabase(N.name,String(N.version),N.description,N.size)}catch(ne){return Q(ne)}N.db.transaction(function(ne){ae(ne,N,function(){P._dbInfo=N,H()},function(oe,pe){Q(pe)})},Q)});return N.serializer=J,Z}function G(C,P,N,j,Z,H){C.executeSql(N,j,Z,function(Q,ne){ne.code===ne.SYNTAX_ERR?Q.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[P.storeName],function(oe,pe){pe.rows.length?H(oe,ne):ae(oe,P,function(){oe.executeSql(N,j,Z,H)},H)},H):H(Q,ne)},H)}function w(C,P){var N=this;C=y(C);var j=new f(function(Z,H){N.ready().then(function(){var Q=N._dbInfo;Q.db.transaction(function(ne){G(ne,Q,"SELECT * FROM "+Q.storeName+" WHERE key = ? LIMIT 1",[C],function(oe,pe){var ke=pe.rows.length?pe.rows.item(0).value:null;ke&&(ke=Q.serializer.deserialize(ke)),Z(ke)},function(oe,pe){H(pe)})})}).catch(H)});return v(j,P),j}function $(C,P){var N=this,j=new f(function(Z,H){N.ready().then(function(){var Q=N._dbInfo;Q.db.transaction(function(ne){G(ne,Q,"SELECT * FROM "+Q.storeName,[],function(oe,pe){for(var ke=pe.rows,Ee=ke.length,Ie=0;Ie<Ee;Ie++){var Ve=ke.item(Ie),Ue=Ve.value;if(Ue&&(Ue=Q.serializer.deserialize(Ue)),Ue=C(Ue,Ve.key,Ie+1),Ue!==void 0){Z(Ue);return}}Z()},function(oe,pe){H(pe)})})}).catch(H)});return v(j,P),j}function c(C,P,N,j){var Z=this;C=y(C);var H=new f(function(Q,ne){Z.ready().then(function(){P===void 0&&(P=null);var oe=P,pe=Z._dbInfo;pe.serializer.serialize(P,function(ke,Ee){Ee?ne(Ee):pe.db.transaction(function(Ie){G(Ie,pe,"INSERT OR REPLACE INTO "+pe.storeName+" (key, value) VALUES (?, ?)",[C,ke],function(){Q(oe)},function(Ve,Ue){ne(Ue)})},function(Ie){if(Ie.code===Ie.QUOTA_ERR){if(j>0){Q(c.apply(Z,[C,oe,N,j-1]));return}ne(Ie)}})})}).catch(ne)});return v(H,N),H}function L(C,P,N){return c.apply(this,[C,P,N,1])}function ie(C,P){var N=this;C=y(C);var j=new f(function(Z,H){N.ready().then(function(){var Q=N._dbInfo;Q.db.transaction(function(ne){G(ne,Q,"DELETE FROM "+Q.storeName+" WHERE key = ?",[C],function(){Z()},function(oe,pe){H(pe)})})}).catch(H)});return v(j,P),j}function b(C){var P=this,N=new f(function(j,Z){P.ready().then(function(){var H=P._dbInfo;H.db.transaction(function(Q){G(Q,H,"DELETE FROM "+H.storeName,[],function(){j()},function(ne,oe){Z(oe)})})}).catch(Z)});return v(N,C),N}function Y(C){var P=this,N=new f(function(j,Z){P.ready().then(function(){var H=P._dbInfo;H.db.transaction(function(Q){G(Q,H,"SELECT COUNT(key) as c FROM "+H.storeName,[],function(ne,oe){var pe=oe.rows.item(0).c;j(pe)},function(ne,oe){Z(oe)})})}).catch(Z)});return v(N,C),N}function U(C,P){var N=this,j=new f(function(Z,H){N.ready().then(function(){var Q=N._dbInfo;Q.db.transaction(function(ne){G(ne,Q,"SELECT key FROM "+Q.storeName+" WHERE id = ? LIMIT 1",[C+1],function(oe,pe){Z(pe.rows.length?pe.rows.item(0).key:null)},function(oe,pe){H(pe)})})}).catch(H)});return v(j,P),j}function V(C){var P=this,N=new f(function(j,Z){P.ready().then(function(){var H=P._dbInfo;H.db.transaction(function(Q){G(Q,H,"SELECT key FROM "+H.storeName,[],function(ne,oe){for(var pe=[],ke=0;ke<oe.rows.length;ke++)pe.push(oe.rows.item(ke).key);j(pe)},function(ne,oe){Z(oe)})})}).catch(Z)});return v(N,C),N}function ye(C){return new f(function(P,N){C.transaction(function(j){j.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(Z,H){for(var Q=[],ne=0;ne<H.rows.length;ne++)Q.push(H.rows.item(ne).name);P({db:C,storeNames:Q})},function(Z,H){N(H)})},function(j){N(j)})})}function Ne(C,P){P=k.apply(this,arguments);var N=this.config();C=typeof C!="function"&&C||{},C.name||(C.name=C.name||N.name,C.storeName=C.storeName||N.storeName);var j=this,Z;return C.name?Z=new f(function(H){var Q;C.name===N.name?Q=j._dbInfo.db:Q=openDatabase(C.name,"","",0),C.storeName?H({db:Q,storeNames:[C.storeName]}):H(ye(Q))}).then(function(H){return new f(function(Q,ne){H.db.transaction(function(oe){function pe(Ve){return new f(function(Ue,Lt){oe.executeSql("DROP TABLE IF EXISTS "+Ve,[],function(){Ue()},function(Rn,kr){Lt(kr)})})}for(var ke=[],Ee=0,Ie=H.storeNames.length;Ee<Ie;Ee++)ke.push(pe(H.storeNames[Ee]));f.all(ke).then(function(){Q()}).catch(function(Ve){ne(Ve)})},function(oe){ne(oe)})})}):Z=f.reject("Invalid arguments"),v(Z,P),Z}var he={_driver:"webSQLStorage",_initStorage:M,_support:ze(),iterate:$,getItem:w,setItem:L,removeItem:ie,clear:b,length:Y,key:U,keys:V,dropInstance:Ne};function Ot(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function di(C,P){var N=C.name+"/";return C.storeName!==P.storeName&&(N+=C.storeName+"/"),N}function $e(){var C="_localforage_support_test";try{return localStorage.setItem(C,!0),localStorage.removeItem(C),!1}catch{return!0}}function Be(){return!$e()||localStorage.length>0}function nt(C){var P=this,N={};if(C)for(var j in C)N[j]=C[j];return N.keyPrefix=di(C,P._defaultConfig),Be()?(P._dbInfo=N,N.serializer=J,f.resolve()):f.reject()}function vt(C){var P=this,N=P.ready().then(function(){for(var j=P._dbInfo.keyPrefix,Z=localStorage.length-1;Z>=0;Z--){var H=localStorage.key(Z);H.indexOf(j)===0&&localStorage.removeItem(H)}});return v(N,C),N}function pt(C,P){var N=this;C=y(C);var j=N.ready().then(function(){var Z=N._dbInfo,H=localStorage.getItem(Z.keyPrefix+C);return H&&(H=Z.serializer.deserialize(H)),H});return v(j,P),j}function Vi(C,P){var N=this,j=N.ready().then(function(){for(var Z=N._dbInfo,H=Z.keyPrefix,Q=H.length,ne=localStorage.length,oe=1,pe=0;pe<ne;pe++){var ke=localStorage.key(pe);if(ke.indexOf(H)===0){var Ee=localStorage.getItem(ke);if(Ee&&(Ee=Z.serializer.deserialize(Ee)),Ee=C(Ee,ke.substring(Q),oe++),Ee!==void 0)return Ee}}});return v(j,P),j}function Gi(C,P){var N=this,j=N.ready().then(function(){var Z=N._dbInfo,H;try{H=localStorage.key(C)}catch{H=null}return H&&(H=H.substring(Z.keyPrefix.length)),H});return v(j,P),j}function rt(C){var P=this,N=P.ready().then(function(){for(var j=P._dbInfo,Z=localStorage.length,H=[],Q=0;Q<Z;Q++){var ne=localStorage.key(Q);ne.indexOf(j.keyPrefix)===0&&H.push(ne.substring(j.keyPrefix.length))}return H});return v(N,C),N}function xt(C){var P=this.keys().then(function(N){return N.length});return v(P,C),P}function ot(C,P){var N=this;C=y(C);var j=N.ready().then(function(){var Z=N._dbInfo;localStorage.removeItem(Z.keyPrefix+C)});return v(j,P),j}function Wt(C,P,N){var j=this;C=y(C);var Z=j.ready().then(function(){P===void 0&&(P=null);var H=P;return new f(function(Q,ne){var oe=j._dbInfo;oe.serializer.serialize(P,function(pe,ke){if(ke)ne(ke);else try{localStorage.setItem(oe.keyPrefix+C,pe),Q(H)}catch(Ee){(Ee.name==="QuotaExceededError"||Ee.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ne(Ee),ne(Ee)}})})});return v(Z,N),Z}function Dt(C,P){if(P=k.apply(this,arguments),C=typeof C!="function"&&C||{},!C.name){var N=this.config();C.name=C.name||N.name,C.storeName=C.storeName||N.storeName}var j=this,Z;return C.name?Z=new f(function(H){C.storeName?H(di(C,j._defaultConfig)):H(C.name+"/")}).then(function(H){for(var Q=localStorage.length-1;Q>=0;Q--){var ne=localStorage.key(Q);ne.indexOf(H)===0&&localStorage.removeItem(ne)}}):Z=f.reject("Invalid arguments"),v(Z,P),Z}var Cn={_driver:"localStorageWrapper",_initStorage:nt,_support:Ot(),iterate:Vi,getItem:pt,setItem:Wt,removeItem:ot,clear:vt,length:xt,key:Gi,keys:rt,dropInstance:Dt},Of=function(P,N){return P===N||typeof P=="number"&&typeof N=="number"&&isNaN(P)&&isNaN(N)},Df=function(P,N){for(var j=P.length,Z=0;Z<j;){if(Of(P[Z],N))return!0;Z++}return!1},gu=Array.isArray||function(C){return Object.prototype.toString.call(C)==="[object Array]"},Er={},vu={},Xi={INDEXEDDB:He,WEBSQL:he,LOCALSTORAGE:Cn},Lf=[Xi.INDEXEDDB._driver,Xi.WEBSQL._driver,Xi.LOCALSTORAGE._driver],An=["dropInstance"],Qs=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(An),zf={description:"",driver:Lf.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Pf(C,P){C[P]=function(){var N=arguments;return C.ready().then(function(){return C[P].apply(C,N)})}}function eo(){for(var C=1;C<arguments.length;C++){var P=arguments[C];if(P)for(var N in P)P.hasOwnProperty(N)&&(gu(P[N])?arguments[0][N]=P[N].slice():arguments[0][N]=P[N])}return arguments[0]}r.exports=new((function(){function C(P){o(this,C);for(var N in Xi)if(Xi.hasOwnProperty(N)){var j=Xi[N],Z=j._driver;this[N]=Z,Er[Z]||this.defineDriver(j)}this._defaultConfig=eo({},zf),this._config=eo({},this._defaultConfig,P),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return C.prototype.config=function(N){if((typeof N>"u"?"undefined":a(N))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var j in N){if(j==="storeName"&&(N[j]=N[j].replace(/\W/g,"_")),j==="version"&&typeof N[j]!="number")return new Error("Database version must be a number.");this._config[j]=N[j]}return"driver"in N&&N.driver?this.setDriver(this._config.driver):!0}else return typeof N=="string"?this._config[N]:this._config},C.prototype.defineDriver=function(N,j,Z){var H=new f(function(Q,ne){try{var oe=N._driver,pe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!N._driver){ne(pe);return}for(var ke=Qs.concat("_initStorage"),Ee=0,Ie=ke.length;Ee<Ie;Ee++){var Ve=ke[Ee];if((!Df(An,Ve)||N[Ve])&&typeof N[Ve]!="function"){ne(pe);return}}(function(){for(var Rn=function(Mf){return function(){var Bf=new Error("Method "+Mf+" is not implemented by the current driver"),bu=f.reject(Bf);return v(bu,arguments[arguments.length-1]),bu}},kr=0,Ff=An.length;kr<Ff;kr++){var to=An[kr];N[to]||(N[to]=Rn(to))}})();var Ue=function(Rn){Er[oe]&&console.info("Redefining LocalForage driver: "+oe),Er[oe]=N,vu[oe]=Rn,Q()};"_support"in N?N._support&&typeof N._support=="function"?N._support().then(Ue,ne):Ue(!!N._support):Ue(!0)}catch(Lt){ne(Lt)}});return p(H,j,Z),H},C.prototype.driver=function(){return this._driver||null},C.prototype.getDriver=function(N,j,Z){var H=Er[N]?f.resolve(Er[N]):f.reject(new Error("Driver not found."));return p(H,j,Z),H},C.prototype.getSerializer=function(N){var j=f.resolve(J);return p(j,N),j},C.prototype.ready=function(N){var j=this,Z=j._driverSet.then(function(){return j._ready===null&&(j._ready=j._initDriver()),j._ready});return p(Z,N,N),Z},C.prototype.setDriver=function(N,j,Z){var H=this;gu(N)||(N=[N]);var Q=this._getSupportedDrivers(N);function ne(){H._config.driver=H.driver()}function oe(Ee){return H._extend(Ee),ne(),H._ready=H._initStorage(H._config),H._ready}function pe(Ee){return function(){var Ie=0;function Ve(){for(;Ie<Ee.length;){var Ue=Ee[Ie];return Ie++,H._dbInfo=null,H._ready=null,H.getDriver(Ue).then(oe).catch(Ve)}ne();var Lt=new Error("No available storage method found.");return H._driverSet=f.reject(Lt),H._driverSet}return Ve()}}var ke=this._driverSet!==null?this._driverSet.catch(function(){return f.resolve()}):f.resolve();return this._driverSet=ke.then(function(){var Ee=Q[0];return H._dbInfo=null,H._ready=null,H.getDriver(Ee).then(function(Ie){H._driver=Ie._driver,ne(),H._wrapLibraryMethodsWithReady(),H._initDriver=pe(Q)})}).catch(function(){ne();var Ee=new Error("No available storage method found.");return H._driverSet=f.reject(Ee),H._driverSet}),p(this._driverSet,j,Z),this._driverSet},C.prototype.supports=function(N){return!!vu[N]},C.prototype._extend=function(N){eo(this,N)},C.prototype._getSupportedDrivers=function(N){for(var j=[],Z=0,H=N.length;Z<H;Z++){var Q=N[Z];this.supports(Q)&&j.push(Q)}return j},C.prototype._wrapLibraryMethodsWithReady=function(){for(var N=0,j=Qs.length;N<j;N++)Pf(this,Qs[N])},C.prototype.createInstance=function(N){return new C(N)},C})())},{3:3}]},{},[4])(4)})})),Zl,ba,_a,nf=_e((()=>{Ye(),Gr(),da(),ci(),Zl=lt(Ht()),ba=lt(rf()),_a=class{constructor(e,i,t){this.urlCache={},this.storage=void 0,this.name=e,this.requester=i||er,this.resolver=t,this.online=!0,this.checkRequirements(),this.addListeners()}checkRequirements(){try{let e;typeof ba.default>"u"&&(e=ba.default),this.storage=e.createInstance({name:this.name})}catch{throw new Error("localForage lib not loaded")}}addListeners(){this._status=this.status.bind(this),window.addEventListener("online",this._status),window.addEventListener("offline",this._status)}removeListeners(){window.removeEventListener("online",this._status),window.removeEventListener("offline",this._status),this._status=void 0}status(e){let i=navigator.onLine;this.online=i,i?this.emit("online",this):this.emit("offline",this)}add(e,i){let t=e.resources.map(r=>{let{href:n}=r,a=this.resolver(n),o=window.encodeURIComponent(a);return this.storage.getItem(o).then(s=>!s||i?this.requester(a,"binary").then(l=>this.storage.setItem(o,l)):s)});return Promise.all(t)}put(e,i,t){let r=window.encodeURIComponent(e);return this.storage.getItem(r).then(n=>n||this.requester(e,"binary",i,t).then(a=>this.storage.setItem(r,a)))}request(e,i,t,r){return this.online?this.requester(e,i,t,r).then(n=>(this.put(e),n)):this.retrieve(e,i)}retrieve(e,i){new Fe;var t,r=new Vt(e);return i||(i=r.extension),i=="blob"?t=this.getBlob(e):t=this.getText(e),t.then(n=>{var a=new Fe,o;return n?(o=this.handleResponse(n,i),a.resolve(o)):a.reject({message:"File not found in storage: "+e,stack:new Error().stack}),a.promise})}handleResponse(e,i){var t;return i=="json"?t=JSON.parse(e):Ji(i)?t=Zt(e,"text/xml"):i=="xhtml"?t=Zt(e,"application/xhtml+xml"):i=="html"||i=="htm"?t=Zt(e,"text/html"):t=e,t}getBlob(e,i){let t=window.encodeURIComponent(e);return this.storage.getItem(t).then(function(r){if(r)return i=i||pi.lookup(e),new Blob([r],{type:i})})}getText(e,i){let t=window.encodeURIComponent(e);return i=i||pi.lookup(e),this.storage.getItem(t).then(function(r){var n=new Fe,a=new FileReader,o;if(r)return o=new Blob([r],{type:i}),a.addEventListener("loadend",()=>{n.resolve(a.result)}),a.readAsText(o,i),n.promise})}getBase64(e,i){let t=window.encodeURIComponent(e);return i=i||pi.lookup(e),this.storage.getItem(t).then(r=>{var n=new Fe,a=new FileReader,o;if(r)return o=new Blob([r],{type:i}),a.addEventListener("loadend",()=>{n.resolve(a.result)}),a.readAsDataURL(o,i),n.promise})}createUrl(e,i){var t=new Fe,r=window.URL||window.webkitURL||window.mozURL,n,a,o=i&&i.base64;return e in this.urlCache?(t.resolve(this.urlCache[e]),t.promise):(o?(a=this.getBase64(e),a&&a.then(function(s){this.urlCache[e]=s,t.resolve(s)}.bind(this))):(a=this.getBlob(e),a&&a.then(function(s){n=r.createObjectURL(s),this.urlCache[e]=n,t.resolve(n)}.bind(this))),a||t.reject({message:"File not found in storage: "+e,stack:new Error().stack}),t.promise)}revokeUrl(e){var i=window.URL||window.webkitURL||window.mozURL,t=this.urlCache[e];t&&i.revokeObjectURL(t)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let i in this.urlCache)e.revokeObjectURL(i);this.urlCache={},this.removeListeners()}},(0,Zl.default)(_a.prototype)})),Qr,af=_e((()=>{Ye(),Qr=class{constructor(e){this.interactive="",this.fixedLayout="",this.openToSpread="",this.orientationLock="",e&&this.parse(e)}parse(e){if(!e)return this;const i=Xe(e,"display_options");return i?(Kt(i,"option").forEach(t=>{let r="";switch(t.childNodes.length&&(r=t.childNodes[0].nodeValue),t.attributes.name.value){case"interactive":this.interactive=r;break;case"fixed-layout":this.fixedLayout=r;break;case"open-to-spread":this.openToSpread=r;break;case"orientation-lock":this.orientationLock=r;break}}),this):this}destroy(){this.interactive=void 0,this.fixedLayout=void 0,this.openToSpread=void 0,this.orientationLock=void 0}}})),Vl,wa,Gl,It,or,Xl=_e((()=>{Vl=lt(Ht()),Ye(),Zr(),ci(),kc(),Sc(),Tc(),Cc(),Ac(),Ic(),Nc(),va(),tf(),Gr(),At(),nf(),af(),zt(),wa="META-INF/container.xml",Gl="META-INF/com.apple.ibooks.display-options.xml",It={BINARY:"binary",BASE64:"base64",EPUB:"epub",OPF:"opf",MANIFEST:"json",DIRECTORY:"directory"},or=class{constructor(e,i){typeof i>"u"&&typeof e!="string"&&!(e instanceof Blob)&&!(e instanceof ArrayBuffer)&&(i=e,e=void 0),this.settings=ut(this.settings||{},{requestMethod:void 0,requestCredentials:void 0,requestHeaders:void 0,encoding:void 0,replacements:void 0,canonical:void 0,openAs:void 0,store:void 0}),ut(this.settings,i),this.opening=new Fe,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new Fe,spine:new Fe,metadata:new Fe,cover:new Fe,navigation:new Fe,pageList:new Fe,resources:new Fe,displayOptions:new Fe},this.loaded={manifest:this.loading.manifest.promise,spine:this.loading.spine.promise,metadata:this.loading.metadata.promise,cover:this.loading.cover.promise,navigation:this.loading.navigation.promise,pageList:this.loading.pageList.promise,resources:this.loading.resources.promise,displayOptions:this.loading.displayOptions.promise},this.ready=Promise.all([this.loaded.manifest,this.loaded.spine,this.loaded.metadata,this.loaded.cover,this.loaded.navigation,this.loaded.resources,this.loaded.displayOptions]),this.isRendered=!1,this.request=this.settings.requestMethod||er,this.spine=new hl,this.locations=new la(this.spine,this.load.bind(this)),this.navigation=void 0,this.pageList=void 0,this.url=void 0,this.path=void 0,this.archived=!1,this.archive=void 0,this.storage=void 0,this.resources=void 0,this.rendition=void 0,this.container=void 0,this.packaging=void 0,this.displayOptions=void 0,this.settings.store&&this.store(this.settings.store),e&&this.open(e,this.settings.openAs).catch(t=>{var r=new Error("Cannot load book at "+e);this.emit(me.BOOK.OPEN_FAILED,r)})}open(e,i){var t,r=i||this.determineType(e);return r===It.BINARY?(this.archived=!0,this.url=new Ct("/",""),t=this.openEpub(e)):r===It.BASE64?(this.archived=!0,this.url=new Ct("/",""),t=this.openEpub(e,r)):r===It.EPUB?(this.archived=!0,this.url=new Ct("/",""),t=this.request(e,"binary",this.settings.requestCredentials,this.settings.requestHeaders).then(this.openEpub.bind(this))):r==It.OPF?(this.url=new Ct(e),t=this.openPackaging(this.url.Path.toString())):r==It.MANIFEST?(this.url=new Ct(e),t=this.openManifest(this.url.Path.toString())):(this.url=new Ct(e),t=this.openContainer(wa).then(this.openPackaging.bind(this))),t}openEpub(e,i){return this.unarchive(e,i||this.settings.encoding).then(()=>this.openContainer(wa)).then(t=>this.openPackaging(t))}openContainer(e){return this.load(e).then(i=>(this.container=new cl(i),this.resolve(this.container.packagePath)))}openPackaging(e){return this.path=new Vt(e),this.load(e).then(i=>(this.packaging=new ha(i),this.unpack(this.packaging)))}openManifest(e){return this.path=new Vt(e),this.load(e).then(i=>(this.packaging=new ha,this.packaging.load(i),this.unpack(this.packaging)))}load(e){var i=this.resolve(e);return this.archived?this.archive.request(i):this.request(i,null,this.settings.requestCredentials,this.settings.requestHeaders)}resolve(e,i){if(e){var t=e;return e.indexOf("://")>-1?e:(this.path&&(t=this.path.resolve(e)),i!=!1&&this.url&&(t=this.url.resolve(t)),t)}}canonical(e){var i=e;return e?(this.settings.canonical?i=this.settings.canonical(e):i=this.resolve(e,!0),i):""}determineType(e){var i,t,r;if(this.settings.encoding==="base64")return It.BASE64;if(typeof e!="string")return It.BINARY;if(i=new Ct(e),t=i.path(),r=t.extension,r&&(r=r.replace(/\?.*$/,"")),!r)return It.DIRECTORY;if(r==="epub")return It.EPUB;if(r==="opf")return It.OPF;if(r==="json")return It.MANIFEST}unpack(e){this.package=e,this.packaging.metadata.layout===""?this.load(this.url.resolve(Gl)).then(i=>{this.displayOptions=new Qr(i),this.loading.displayOptions.resolve(this.displayOptions)}).catch(i=>{this.displayOptions=new Qr,this.loading.displayOptions.resolve(this.displayOptions)}):(this.displayOptions=new Qr,this.loading.displayOptions.resolve(this.displayOptions)),this.spine.unpack(this.packaging,this.resolve.bind(this),this.canonical.bind(this)),this.resources=new gl(this.packaging.manifest,{archive:this.archive,resolver:this.resolve.bind(this),request:this.request.bind(this),replacements:this.settings.replacements||(this.archived?"blobUrl":"base64")}),this.loadNavigation(this.packaging).then(()=>{this.loading.navigation.resolve(this.navigation)}),this.packaging.coverPath&&(this.cover=this.resolve(this.packaging.coverPath)),this.loading.manifest.resolve(this.packaging.manifest),this.loading.metadata.resolve(this.packaging.metadata),this.loading.spine.resolve(this.spine),this.loading.cover.resolve(this.cover),this.loading.resources.resolve(this.resources),this.loading.pageList.resolve(this.pageList),this.isOpen=!0,this.archived||this.settings.replacements&&this.settings.replacements!="none"?this.replacements().then(()=>{this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}).catch(i=>{console.error(i)}):this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}loadNavigation(e){let i=e.navPath||e.ncxPath,t=e.toc;return t?new Promise((r,n)=>{this.navigation=new qr(t),e.pageList&&(this.pageList=new $r(e.pageList)),r(this.navigation)}):i?this.load(i,"xml").then(r=>(this.navigation=new qr(r),this.pageList=new $r(r),this.navigation)):new Promise((r,n)=>{this.navigation=new qr,this.pageList=new $r,r(this.navigation)})}section(e){return this.spine.get(e)}renderTo(e,i){return this.rendition=new sr(this,i),this.rendition.attachTo(e),this.rendition}setRequestCredentials(e){this.settings.requestCredentials=e}setRequestHeaders(e){this.settings.requestHeaders=e}unarchive(e,i){return this.archive=new Hl,this.archive.open(e,i)}store(e){let i=this.settings.replacements&&this.settings.replacements!=="none",t=this.url,r=this.settings.requestMethod||er.bind(this);return this.storage=new _a(e,r,this.resolve.bind(this)),this.request=this.storage.request.bind(this.storage),this.opened.then(()=>{this.archived&&(this.storage.requester=this.archive.request.bind(this.archive));let n=(a,o)=>{o.output=this.resources.substitute(a,o.url)};this.resources.settings.replacements=i||"blobUrl",this.resources.replacements().then(()=>this.resources.replaceCss()),this.storage.on("offline",()=>{this.url=new Ct("/",""),this.spine.hooks.serialize.register(n)}),this.storage.on("online",()=>{this.url=t,this.spine.hooks.serialize.deregister(n)})}),this.storage}coverUrl(){return this.loaded.cover.then(()=>this.cover?this.archived?this.archive.createUrl(this.cover):this.cover:null)}replacements(){return this.spine.hooks.serialize.register((e,i)=>{i.output=this.resources.substitute(e,i.url)}),this.resources.replacements().then(()=>this.resources.replaceCss())}getRange(e){var i=new Ze(e),t=this.spine.get(i.spinePos),r=this.load.bind(this);return t?t.load(r).then(function(n){return i.toRange(t.document)}):new Promise((n,a)=>{a("CFI could not be found")})}key(e){return`epubjs:0.3:${e||this.packaging.metadata.identifier||this.url.filename}`}destroy(){this.opened=void 0,this.loading=void 0,this.loaded=void 0,this.ready=void 0,this.isOpen=!1,this.isRendered=!1,this.spine&&this.spine.destroy(),this.locations&&this.locations.destroy(),this.pageList&&this.pageList.destroy(),this.archive&&this.archive.destroy(),this.resources&&this.resources.destroy(),this.container&&this.container.destroy(),this.packaging&&this.packaging.destroy(),this.rendition&&this.rendition.destroy(),this.displayOptions&&this.displayOptions.destroy(),this.spine=void 0,this.locations=void 0,this.pageList=void 0,this.archive=void 0,this.resources=void 0,this.container=void 0,this.packaging=void 0,this.rendition=void 0,this.navigation=void 0,this.url=void 0,this.path=void 0,this.archived=!1}},(0,Vl.default)(or.prototype)}));function mi(e,i){return new or(e,i)}var sf=_e((()=>{Xl(),va(),At(),Kr(),Ye(),zt(),Cl(),ga(),Ul(),mi.VERSION="0.3",typeof global<"u"&&(global.EPUBJS_VERSION="0.3"),mi.Book=or,mi.Rendition=sr,mi.Contents=rr,mi.CFI=Ze,mi.utils=mc})),of=$i({Book:()=>or,Contents:()=>rr,EpubCFI:()=>Ze,Layout:()=>Yr,Rendition:()=>sr,default:()=>ql}),ql,lf=_e((()=>{Xl(),At(),va(),Kr(),bl(),sf(),ql=mi})),hf=$i({default:()=>df});async function df(e,i,t){const r=Mn(t?.options);let n,a,o=!1,s=!0,l="loading",h=r("epub.title"),d="",f=[],v="",p=null,y=!0,k=!1;const u=new Set,m=[],g=it("div","epub-viewer"),E=it("div","epub-toolbar"),x=it("button","epub-icon-button");x.type="button",x.title=r("ebook.toc"),x.append(it("span"));const _=it("div","epub-title"),I=it("strong",void 0,h),A=it("span",void 0,r("ebook.reading"));_.append(I,A);const D=it("div","epub-actions"),z=it("button","epub-button",r("epub.previousPage")),O=it("span","epub-progress",r("ebook.reading")),F=it("button","epub-button",r("epub.nextPage"));z.type="button",F.type="button",D.append(z,O,F),E.append(x,_,D);const W=it("div","epub-body"),q=it("aside","epub-toc"),re=it("div","epub-toc-head"),K=it("span",void 0,r("ebook.itemCount",{count:0}));re.append(it("strong",void 0,r("ebook.toc")),K);const de=it("div","epub-toc-list");q.append(re,de);const ue=it("main","epub-stage-wrap"),te=it("div","epub-stage"),fe=it("div","epub-state",r("epub.loading"));ue.append(te,fe),W.append(q,ue),g.append(E,W),i.replaceChildren(Yl(),g);const ee=(se,ce,xe)=>{se.addEventListener(ce,xe),m.push(()=>se.removeEventListener(ce,xe))},Se=()=>{var se;if(!v)return"";const ce=f.find(xe=>xe.href===v);return ce?ce.label:((se=f.find(xe=>v.includes(xe.href.split("#")[0])))===null||se===void 0?void 0:se.label)||""},be=()=>typeof p=="number"?`${p}%`:Se()||r("ebook.reading"),Ce=()=>{g.classList.toggle("epub-viewer--toc-hidden",!s),q.hidden=!s,x.classList.toggle("active",s),I.textContent=h,A.textContent=d||be(),O.textContent=be(),z.disabled=l!=="ready"||y,F.disabled=l!=="ready"||k,fe.hidden=l==="ready",fe.classList.toggle("error",l==="error"),K.textContent=r("ebook.itemCount",{count:f.length}),Array.from(de.querySelectorAll(".epub-toc-item")).forEach(se=>{se.classList.toggle("active",se.dataset.href===v)})},Le=()=>{de.replaceChildren(),f.forEach(se=>{const ce=it("button","epub-toc-item",se.label);ce.type="button",ce.dataset.href=se.href,ce.style.paddingLeft=`${12+se.depth*14}px`,ee(ce,"click",()=>{a?.display(se.href),s=!1,Ce()}),de.append(ce)}),Ce()},Oe=se=>{var ce,xe;y=!!se?.atStart,k=!!se?.atEnd,v=((ce=se?.start)===null||ce===void 0?void 0:ce.href)||"",typeof((xe=se?.start)===null||xe===void 0?void 0:xe.percentage)=="number"&&(p=Math.round(se.start.percentage*100)),Ce()},Re=se=>new Promise(ce=>{const xe=window.setTimeout(()=>{u.delete(xe),ce(void 0)},se);u.add(xe)}),ve=()=>{var se;try{const ce=te.querySelector("iframe"),xe=(se=ce?.contentDocument)===null||se===void 0?void 0:se.body;return xe?!!(xe.innerText.trim()||xe.querySelector("img, svg, canvas")):!1}catch{return!1}},ge=async()=>{for(let se=0;se<20;se+=1){if(o||ve())return ve();await Re(100)}return ve()},Te=async()=>{l="loading",fe.textContent=r("epub.loading"),Ce();try{const{default:se}=await Promise.resolve().then(()=>(lf(),of));if(o)return;n=se(e.slice(0),{openAs:"binary",replacements:"blobUrl"}),a=n.renderTo(te,{allowScriptedContent:!1,flow:"scrolled",height:"100%",manager:"continuous",resizeOnOrientationChange:!0,spread:"none",width:"100%"}),a.themes.default({body:{color:"#172033",fontFamily:'Georgia, "Times New Roman", serif',lineHeight:"1.72",padding:"0 8px"},img:{maxWidth:"100%"},html:{height:"auto",overflow:"auto"}}),a.on("relocated",Oe),await n.ready;const ce=await n.loaded.metadata.catch(()=>{});h=en(ce?.title,h),d=en(ce?.creator,"");const xe=await n.loaded.navigation.catch(()=>{});if(f=ya(xe?.toc,He=>r("epub.chapterFallback",{index:He})),Le(),await a.display(Kl(f)),!await ge())throw new Error(r("epub.renderIncomplete"));if(o)return;l="ready",Ce(),n.locations.generate(1200).catch(()=>{})}catch(se){console.error(se),l="error",fe.textContent=se instanceof Error?se.message:String(se),Ce()}};return ee(x,"click",()=>{s=!s,Ce()}),ee(z,"click",()=>{a?.prev()}),ee(F,"click",()=>{a?.next()}),Ce(),Te(),{$el:g,unmount(){o=!0,u.forEach(se=>window.clearTimeout(se)),u.clear(),a&&(a.off("relocated",Oe),a.destroy(),a=void 0),n?.destroy(),n=void 0,m.splice(0).forEach(se=>se()),i.replaceChildren()}}}var $l,Yl,it,en,ya,Kl,uf=_e((()=>{$n(),$l=`
|
|
17
|
+
.epub-viewer{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;background:#eef1f4;color:#172033;box-sizing:border-box}
|
|
18
|
+
.epub-viewer *{box-sizing:border-box}
|
|
19
|
+
.epub-toolbar{flex-shrink:0;display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(15,23,42,.08);background:rgba(255,255,255,.92)}
|
|
20
|
+
.epub-title{min-width:0;display:flex;flex-direction:column;gap:3px}
|
|
21
|
+
.epub-title strong,.epub-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
22
|
+
.epub-title strong{font-size:14px}
|
|
23
|
+
.epub-title span{color:#64748b;font-size:12px}
|
|
24
|
+
.epub-icon-button,.epub-button{height:36px;border:1px solid rgba(15,23,42,.08);background:#fff;color:#172033;font:inherit;cursor:pointer}
|
|
25
|
+
.epub-icon-button{width:40px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px}
|
|
26
|
+
.epub-icon-button span,.epub-icon-button span::before,.epub-icon-button span::after{width:16px;height:2px;display:block;border-radius:999px;background:currentColor}
|
|
27
|
+
.epub-icon-button span{position:relative}
|
|
28
|
+
.epub-icon-button span::before,.epub-icon-button span::after{content:'';position:absolute;left:0}
|
|
29
|
+
.epub-icon-button span::before{top:-5px}
|
|
30
|
+
.epub-icon-button span::after{top:5px}
|
|
31
|
+
.epub-icon-button.active{border-color:rgba(37,99,235,.24);background:rgba(37,99,235,.08);color:#1d4ed8}
|
|
32
|
+
.epub-actions{display:flex;align-items:center;gap:8px}
|
|
33
|
+
.epub-button{min-width:68px;padding:0 12px;border-radius:8px;font-size:13px;font-weight:700}
|
|
34
|
+
.epub-button:disabled{color:#94a3b8;cursor:not-allowed}
|
|
35
|
+
.epub-progress{min-width:58px;color:#64748b;font-size:12px;text-align:center}
|
|
36
|
+
.epub-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(180px,240px) minmax(0,1fr)}
|
|
37
|
+
.epub-viewer--toc-hidden .epub-body{grid-template-columns:minmax(0,1fr)}
|
|
38
|
+
.epub-toc{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid rgba(15,23,42,.08);background:rgba(255,255,255,.8)}
|
|
39
|
+
.epub-toc[hidden]{display:none}
|
|
40
|
+
.epub-toc-head{flex-shrink:0;display:flex;justify-content:space-between;gap:8px;padding:12px;color:#172033;font-size:13px}
|
|
41
|
+
.epub-toc-head span{color:#64748b}
|
|
42
|
+
.epub-toc-list{flex:1;min-height:0;overflow:auto;padding:0 8px 10px}
|
|
43
|
+
.epub-toc-item{width:100%;min-height:34px;border:0;border-radius:8px;background:transparent;color:#475569;font:inherit;font-size:12px;text-align:left;cursor:pointer}
|
|
44
|
+
.epub-toc-item:hover,.epub-toc-item.active{background:rgba(37,99,235,.08);color:#1d4ed8}
|
|
45
|
+
.epub-stage-wrap{position:relative;min-width:0;min-height:0;padding:18px;overflow:hidden}
|
|
46
|
+
.epub-stage{width:100%;height:100%;overflow-x:hidden;overflow-y:auto;border-radius:8px;background:#fff;box-shadow:0 18px 45px rgba(15,23,42,.12),inset 0 0 0 1px rgba(15,23,42,.06)}
|
|
47
|
+
.epub-stage .epub-container{width:100%!important;max-width:100%;overflow-x:hidden!important;overflow-y:auto!important}
|
|
48
|
+
.epub-stage iframe{max-width:100%}
|
|
49
|
+
.epub-state{position:absolute;inset:18px;display:flex;align-items:center;justify-content:center;border-radius:8px;background:rgba(255,255,255,.92);color:#64748b;font-size:14px}
|
|
50
|
+
.epub-state[hidden]{display:none!important}
|
|
51
|
+
.epub-state.error{color:#b42318}
|
|
52
|
+
.file-viewer[data-viewer-theme='dark'] .epub-viewer{background:#172033;color:#e5eef8}
|
|
53
|
+
.file-viewer[data-viewer-theme='dark'] .epub-toolbar,.file-viewer[data-viewer-theme='dark'] .epub-toc,.file-viewer[data-viewer-theme='dark'] .epub-stage{background:#fff;color:#172033}
|
|
54
|
+
@media (prefers-color-scheme:dark){.file-viewer[data-viewer-theme='system'] .epub-viewer{background:#172033;color:#e5eef8}.file-viewer[data-viewer-theme='system'] .epub-toolbar,.file-viewer[data-viewer-theme='system'] .epub-toc,.file-viewer[data-viewer-theme='system'] .epub-stage{background:#fff;color:#172033}}
|
|
55
|
+
@media (max-width:720px){.epub-toolbar{grid-template-columns:40px minmax(0,1fr)}.epub-actions{grid-column:1/-1;justify-content:space-between}.epub-body{position:relative;grid-template-columns:minmax(0,1fr)}.epub-toc{position:absolute;z-index:5;top:0;bottom:0;left:0;width:min(82vw,280px);box-shadow:18px 0 40px rgba(15,23,42,.16)}.epub-stage-wrap{padding:12px}}
|
|
56
|
+
`,Yl=()=>{const e=document.createElement("style");return e.textContent=$l,e},it=(e,i,t)=>{const r=document.createElement(e);return i&&(r.className=i),t!==void 0&&(r.textContent=t),r},en=(e,i)=>typeof e=="string"&&e.trim()?e.trim():i,ya=(e,i,t=0)=>Array.isArray(e)?e.flatMap((r,n)=>{const a=r,o=typeof a.href=="string"?a.href:"",s=en(a.label||a.title,i(n+1)),l=ya(a.subitems||a.children,i,t+1);return o?[{depth:t,href:o,id:`${t}-${n}-${o}`,label:s},...l]:l}):[],Kl=e=>{var i;const t=e.find(n=>{const a=n.label.toLowerCase();return/(^|\s)(chapter|part|book|prologue|preface|introduction)\b/.test(a)||/第[一二三四五六七八九十百千0-9]+[章节回部卷篇]/.test(n.label)});if(t)return t.href;const r=e.find(n=>{const a=`${n.label} ${n.href}`.toLowerCase();return!/(cover|titlepage|title-page|copyright|license|toc|contents|nav|table-of-contents|wrap0000)/.test(a)});return r?.href||((i=e[0])===null||i===void 0?void 0:i.href)}}));function Ri(e){let i=e.length;for(;--i>=0;)e[i]=0}function xa(e,i,t,r,n){this.static_tree=e,this.extra_bits=i,this.extra_base=t,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}function Ea(e,i){this.dyn_tree=e,this.max_code=0,this.stat_desc=i}function Gt(e,i,t,r,n){this.good_length=e,this.max_lazy=i,this.nice_length=t,this.max_chain=r,this.func=n}function cf(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=fr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Mh*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ei(this.dyn_ltree),ei(this.dyn_dtree),ei(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ei(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ei(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ff(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function lr(e){this.options=pr.assign({level:hd,method:ud,chunkSize:16384,windowBits:15,memLevel:8,strategy:dd},e||{});let i=this.options;i.raw&&i.windowBits>0?i.windowBits=-i.windowBits:i.gzip&&i.windowBits>0&&i.windowBits<16&&(i.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new is,this.strm.avail_out=0;let t=Ui.deflateInit2(this.strm,i.level,i.method,i.windowBits,i.memLevel,i.strategy);if(t!==mr)throw new Error(ri[t]);if(i.header&&Ui.deflateSetHeader(this.strm,i.header),i.dictionary){let r;if(typeof i.dictionary=="string"?r=ji.string2buf(i.dictionary):rs.call(i.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(i.dictionary):r=i.dictionary,t=Ui.deflateSetDictionary(this.strm,r),t!==mr)throw new Error(ri[t]);this._dict_set=!0}}function ka(e,i){const t=new lr(i);if(t.push(e,!0),t.err)throw t.msg||ri[t.err];return t.result}function pf(e,i){return i=i||{},i.raw=!0,ka(e,i)}function mf(e,i){return i=i||{},i.gzip=!0,ka(e,i)}function gf(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function vf(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}function hr(e){this.options=pr.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(e&&e.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15)===0&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new is,this.strm.avail_out=0;let t=$t.inflateInit2(this.strm,i.windowBits);if(t!==Zi)throw new Error(ri[t]);if(this.header=new Ld,$t.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=ji.string2buf(i.dictionary):Gs.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=$t.inflateSetDictionary(this.strm,i.dictionary),t!==Zi)))throw new Error(ri[t])}function Sa(e,i){const t=new hr(i);if(t.push(e),t.err)throw t.msg||ri[t.err];return t.result}function bf(e,i){return i=i||{},i.raw=!0,Sa(e,i)}var Jl,Ta,Ca,Ql,eh,Aa,th,Ra,tn,Ia,gi,rn,Na,Ii,nn,ih,an,Oa,Da,La,sn,dr,rh,za,nh,Xt,Ni,Oi,Di,on,ur,ah,sh,oh,Pa,Li,mt,Pt,Fa,lh,hh,Ma,dh,Ba,Ua,Wa,ln,ja,hn,Ha,Za,uh,ch,fh,Va,ph,Ga,mh,gh,vh,bh,_h,zi,wh,yh,xh,st,ri,vi,Eh,dn,kh,Jt,Sh,Qt,Th,Ch,kt,Xa,ht,qa,Ft,Ah,un,Rh,Ih,cr,Nh,Oh,Dh,Lh,fr,zh,Ph,Fh,Mh,Me,ni,Mt,Bh,bi,cn,fn,pn,mn,gn,ai,Pi,ft,_i,si,wi,Uh,oi,$a,ei,Wh,jh,ti,bt,_t,je,Fi,vn,Ya,yi,Ka,bn,xi,Hh,Zh,Mi,Vh,Bi,Ja,Qa,Gh,es,Xh,qh,$h,Yh,Ui,Kh,Jh,Qh,pr,ts,Wi,ed,td,id,rd,ji,is,rs,nd,ad,sd,od,mr,ld,hd,dd,ud,cd,gr,fd,pd,vr,ns,as,ss,_n,os,md,gd,vd,bd,_d,Hi,wd,ls,hs,ds,yd,br,li,xd,Ed,St,us,cs,kd,fs,_r,ps,ms,gs,vs,bs,_s,ws,ys,xs,wr,qt,wn,Es,yn,ks,Ss,Ts,Cs,yr,xr,As,Rs,Is,Ns,Os,xn,Ds,Ls,Ke,zs,Ps,Sd,Td,Cd,Fs,hi,Ms,Bs,Us,Ws,Ad,js,Hs,Zs,Rd,Vs,Id,Nd,Od,Dd,$t,Ld,Gs,zd,Pd,Zi,En,kn,Fd,Xs,Md,Bd,_f,wf,yf,xf,Ef,Ud,Wd,kf,jd,Hd,Sf=_e((()=>{Jl=4,Ta=0,Ca=1,Ql=2,eh=0,Aa=1,th=2,Ra=29,tn=256,Ia=286,gi=30,rn=19,Na=573,Ii=15,nn=16,ih=7,an=256,Oa=16,Da=17,La=18,sn=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),dr=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),rh=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),za=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nh=512,Xt=new Array(288*2),Ri(Xt),Ni=new Array(gi*2),Ri(Ni),Oi=new Array(nh),Ri(Oi),Di=new Array(256),Ri(Di),on=new Array(Ra),Ri(on),ur=new Array(gi),Ri(ur),Pa=e=>e<256?Oi[e]:Oi[256+(e>>>7)],Li=(e,i)=>{e.pending_buf[e.pending++]=i&255,e.pending_buf[e.pending++]=i>>>8&255},mt=(e,i,t)=>{e.bi_valid>nn-t?(e.bi_buf|=i<<e.bi_valid&65535,Li(e,e.bi_buf),e.bi_buf=i>>nn-e.bi_valid,e.bi_valid+=t-nn):(e.bi_buf|=i<<e.bi_valid&65535,e.bi_valid+=t)},Pt=(e,i,t)=>{mt(e,t[i*2],t[i*2+1])},Fa=(e,i)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--i>0);return t>>>1},lh=e=>{e.bi_valid===16?(Li(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},hh=(e,i)=>{const t=i.dyn_tree,r=i.max_code,n=i.stat_desc.static_tree,a=i.stat_desc.has_stree,o=i.stat_desc.extra_bits,s=i.stat_desc.extra_base,l=i.stat_desc.max_length;let h,d,f,v,p,y,k=0;for(v=0;v<=Ii;v++)e.bl_count[v]=0;for(t[e.heap[e.heap_max]*2+1]=0,h=e.heap_max+1;h<Na;h++)d=e.heap[h],v=t[t[d*2+1]*2+1]+1,v>l&&(v=l,k++),t[d*2+1]=v,!(d>r)&&(e.bl_count[v]++,p=0,d>=s&&(p=o[d-s]),y=t[d*2],e.opt_len+=y*(v+p),a&&(e.static_len+=y*(n[d*2+1]+p)));if(k!==0){do{for(v=l-1;e.bl_count[v]===0;)v--;e.bl_count[v]--,e.bl_count[v+1]+=2,e.bl_count[l]--,k-=2}while(k>0);for(v=l;v!==0;v--)for(d=e.bl_count[v];d!==0;)f=e.heap[--h],!(f>r)&&(t[f*2+1]!==v&&(e.opt_len+=(v-t[f*2+1])*t[f*2],t[f*2+1]=v),d--)}},Ma=(e,i,t)=>{const r=new Array(16);let n=0,a,o;for(a=1;a<=Ii;a++)n=n+t[a-1]<<1,r[a]=n;for(o=0;o<=i;o++){let s=e[o*2+1];s!==0&&(e[o*2]=Fa(r[s]++,s))}},dh=()=>{let e,i,t,r,n;const a=new Array(16);for(t=0,r=0;r<Ra-1;r++)for(on[r]=t,e=0;e<1<<sn[r];e++)Di[t++]=r;for(Di[t-1]=r,n=0,r=0;r<16;r++)for(ur[r]=n,e=0;e<1<<dr[r];e++)Oi[n++]=r;for(n>>=7;r<gi;r++)for(ur[r]=n<<7,e=0;e<1<<dr[r]-7;e++)Oi[256+n++]=r;for(i=0;i<=Ii;i++)a[i]=0;for(e=0;e<=143;)Xt[e*2+1]=8,e++,a[8]++;for(;e<=255;)Xt[e*2+1]=9,e++,a[9]++;for(;e<=279;)Xt[e*2+1]=7,e++,a[7]++;for(;e<=287;)Xt[e*2+1]=8,e++,a[8]++;for(Ma(Xt,287,a),e=0;e<gi;e++)Ni[e*2+1]=5,Ni[e*2]=Fa(e,5);ah=new xa(Xt,sn,257,Ia,Ii),sh=new xa(Ni,dr,0,gi,Ii),oh=new xa(new Array(0),rh,0,rn,ih)},Ba=e=>{let i;for(i=0;i<Ia;i++)e.dyn_ltree[i*2]=0;for(i=0;i<gi;i++)e.dyn_dtree[i*2]=0;for(i=0;i<rn;i++)e.bl_tree[i*2]=0;e.dyn_ltree[an*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Ua=e=>{e.bi_valid>8?Li(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Wa=(e,i,t,r)=>{const n=i*2,a=t*2;return e[n]<e[a]||e[n]===e[a]&&r[i]<=r[t]},ln=(e,i,t)=>{const r=e.heap[t];let n=t<<1;for(;n<=e.heap_len&&(n<e.heap_len&&Wa(i,e.heap[n+1],e.heap[n],e.depth)&&n++,!Wa(i,r,e.heap[n],e.depth));)e.heap[t]=e.heap[n],t=n,n<<=1;e.heap[t]=r},ja=(e,i,t)=>{let r,n,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,n=e.pending_buf[e.sym_buf+a++],r===0?Pt(e,n,i):(o=Di[n],Pt(e,o+tn+1,i),s=sn[o],s!==0&&(n-=on[o],mt(e,n,s)),r--,o=Pa(r),Pt(e,o,t),s=dr[o],s!==0&&(r-=ur[o],mt(e,r,s)));while(a<e.sym_next);Pt(e,an,i)},hn=(e,i)=>{const t=i.dyn_tree,r=i.stat_desc.static_tree,n=i.stat_desc.has_stree,a=i.stat_desc.elems;let o,s,l=-1,h;for(e.heap_len=0,e.heap_max=Na,o=0;o<a;o++)t[o*2]!==0?(e.heap[++e.heap_len]=l=o,e.depth[o]=0):t[o*2+1]=0;for(;e.heap_len<2;)h=e.heap[++e.heap_len]=l<2?++l:0,t[h*2]=1,e.depth[h]=0,e.opt_len--,n&&(e.static_len-=r[h*2+1]);for(i.max_code=l,o=e.heap_len>>1;o>=1;o--)ln(e,t,o);h=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ln(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,t[h*2]=t[o*2]+t[s*2],e.depth[h]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,t[o*2+1]=t[s*2+1]=h,e.heap[1]=h++,ln(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],hh(e,i),Ma(t,l,e.bl_count)},Ha=(e,i,t)=>{let r,n=-1,a,o=i[1],s=0,l=7,h=4;for(o===0&&(l=138,h=3),i[(t+1)*2+1]=65535,r=0;r<=t;r++)a=o,o=i[(r+1)*2+1],!(++s<l&&a===o)&&(s<h?e.bl_tree[a*2]+=s:a!==0?(a!==n&&e.bl_tree[a*2]++,e.bl_tree[Oa*2]++):s<=10?e.bl_tree[Da*2]++:e.bl_tree[La*2]++,s=0,n=a,o===0?(l=138,h=3):a===o?(l=6,h=3):(l=7,h=4))},Za=(e,i,t)=>{let r,n=-1,a,o=i[1],s=0,l=7,h=4;for(o===0&&(l=138,h=3),r=0;r<=t;r++)if(a=o,o=i[(r+1)*2+1],!(++s<l&&a===o)){if(s<h)do Pt(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==n&&(Pt(e,a,e.bl_tree),s--),Pt(e,Oa,e.bl_tree),mt(e,s-3,2)):s<=10?(Pt(e,Da,e.bl_tree),mt(e,s-3,3)):(Pt(e,La,e.bl_tree),mt(e,s-11,7));s=0,n=a,o===0?(l=138,h=3):a===o?(l=6,h=3):(l=7,h=4)}},uh=e=>{let i;for(Ha(e,e.dyn_ltree,e.l_desc.max_code),Ha(e,e.dyn_dtree,e.d_desc.max_code),hn(e,e.bl_desc),i=rn-1;i>=3&&e.bl_tree[za[i]*2+1]===0;i--);return e.opt_len+=3*(i+1)+5+5+4,i},ch=(e,i,t,r)=>{let n;for(mt(e,i-257,5),mt(e,t-1,5),mt(e,r-4,4),n=0;n<r;n++)mt(e,e.bl_tree[za[n]*2+1],3);Za(e,e.dyn_ltree,i-1),Za(e,e.dyn_dtree,t-1)},fh=e=>{let i=4093624447,t;for(t=0;t<=31;t++,i>>>=1)if(i&1&&e.dyn_ltree[t*2]!==0)return Ta;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Ca;for(t=32;t<tn;t++)if(e.dyn_ltree[t*2]!==0)return Ca;return Ta},Va=!1,ph=e=>{Va||(dh(),Va=!0),e.l_desc=new Ea(e.dyn_ltree,ah),e.d_desc=new Ea(e.dyn_dtree,sh),e.bl_desc=new Ea(e.bl_tree,oh),e.bi_buf=0,e.bi_valid=0,Ba(e)},Ga=(e,i,t,r)=>{mt(e,(eh<<1)+(r?1:0),3),Ua(e),Li(e,t),Li(e,~t),t&&e.pending_buf.set(e.window.subarray(i,i+t),e.pending),e.pending+=t},mh=e=>{mt(e,Aa<<1,3),Pt(e,an,Xt),lh(e)},gh=(e,i,t,r)=>{let n,a,o=0;e.level>0?(e.strm.data_type===Ql&&(e.strm.data_type=fh(e)),hn(e,e.l_desc),hn(e,e.d_desc),o=uh(e),n=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=n&&(n=a)):n=a=t+5,t+4<=n&&i!==-1?Ga(e,i,t,r):e.strategy===Jl||a===n?(mt(e,(Aa<<1)+(r?1:0),3),ja(e,Xt,Ni)):(mt(e,(th<<1)+(r?1:0),3),ch(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),ja(e,e.dyn_ltree,e.dyn_dtree)),Ba(e),r&&Ua(e)},vh=(e,i,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=i,e.pending_buf[e.sym_buf+e.sym_next++]=i>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,i===0?e.dyn_ltree[t*2]++:(e.matches++,i--,e.dyn_ltree[(Di[t]+tn+1)*2]++,e.dyn_dtree[Pa(i)*2]++),e.sym_next===e.sym_end),bh={_tr_init:ph,_tr_stored_block:Ga,_tr_flush_block:gh,_tr_tally:vh,_tr_align:mh},_h=(e,i,t,r)=>{let n=e&65535|0,a=e>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do n=n+i[r++]|0,a=a+n|0;while(--o);n%=65521,a%=65521}return n|a<<16|0},zi=_h,wh=()=>{let e,i=[];for(var t=0;t<256;t++){e=t;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;i[t]=e}return i},yh=new Uint32Array(wh()),xh=(e,i,t,r)=>{const n=yh,a=r+t;e^=-1;for(let o=r;o<a;o++)e=e>>>8^n[(e^i[o])&255];return e^-1},st=xh,ri={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},vi={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:Eh,_tr_stored_block:dn,_tr_flush_block:kh,_tr_tally:Jt,_tr_align:Sh}=bh,{Z_NO_FLUSH:Qt,Z_PARTIAL_FLUSH:Th,Z_FULL_FLUSH:Ch,Z_FINISH:kt,Z_BLOCK:Xa,Z_OK:ht,Z_STREAM_END:qa,Z_STREAM_ERROR:Ft,Z_DATA_ERROR:Ah,Z_BUF_ERROR:un,Z_DEFAULT_COMPRESSION:Rh,Z_FILTERED:Ih,Z_HUFFMAN_ONLY:cr,Z_RLE:Nh,Z_FIXED:Oh,Z_DEFAULT_STRATEGY:Dh,Z_UNKNOWN:Lh,Z_DEFLATED:fr}=vi,zh=9,Ph=15,Fh=8,Mh=573,Me=3,ni=258,Mt=262,Bh=32,bi=42,cn=57,fn=69,pn=73,mn=91,gn=103,ai=113,Pi=666,ft=1,_i=2,si=3,wi=4,Uh=3,oi=(e,i)=>(e.msg=ri[i],i),$a=e=>e*2-(e>4?9:0),ei=e=>{let i=e.length;for(;--i>=0;)e[i]=0},Wh=e=>{let i,t,r,n=e.w_size;i=e.hash_size,r=i;do t=e.head[--r],e.head[r]=t>=n?t-n:0;while(--i);i=n,r=i;do t=e.prev[--r],e.prev[r]=t>=n?t-n:0;while(--i)},jh=(e,i,t)=>(i<<e.hash_shift^t)&e.hash_mask,ti=jh,bt=e=>{const i=e.state;let t=i.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(i.pending_buf.subarray(i.pending_out,i.pending_out+t),e.next_out),e.next_out+=t,i.pending_out+=t,e.total_out+=t,e.avail_out-=t,i.pending-=t,i.pending===0&&(i.pending_out=0))},_t=(e,i)=>{kh(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,i),e.block_start=e.strstart,bt(e.strm)},je=(e,i)=>{e.pending_buf[e.pending++]=i},Fi=(e,i)=>{e.pending_buf[e.pending++]=i>>>8&255,e.pending_buf[e.pending++]=i&255},vn=(e,i,t,r)=>{let n=e.avail_in;return n>r&&(n=r),n===0?0:(e.avail_in-=n,i.set(e.input.subarray(e.next_in,e.next_in+n),t),e.state.wrap===1?e.adler=zi(e.adler,i,n,t):e.state.wrap===2&&(e.adler=st(e.adler,i,n,t)),e.next_in+=n,e.total_in+=n,n)},Ya=(e,i)=>{let t=e.max_chain_length,r=e.strstart,n,a,o=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-Mt?e.strstart-(e.w_size-Mt):0,h=e.window,d=e.w_mask,f=e.prev,v=e.strstart+ni;let p=h[r+o-1],y=h[r+o];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(n=i,!(h[n+o]!==y||h[n+o-1]!==p||h[n]!==h[r]||h[++n]!==h[r+1])){r+=2,n++;do;while(h[++r]===h[++n]&&h[++r]===h[++n]&&h[++r]===h[++n]&&h[++r]===h[++n]&&h[++r]===h[++n]&&h[++r]===h[++n]&&h[++r]===h[++n]&&h[++r]===h[++n]&&r<v);if(a=ni-(v-r),r=v-ni,a>o){if(e.match_start=i,o=a,a>=s)break;p=h[r+o-1],y=h[r+o]}}while((i=f[i&d])>l&&--t!==0);return o<=e.lookahead?o:e.lookahead},yi=e=>{const i=e.w_size;let t,r,n;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=i+(i-Mt)&&(e.window.set(e.window.subarray(i,i+i-r),0),e.match_start-=i,e.strstart-=i,e.block_start-=i,e.insert>e.strstart&&(e.insert=e.strstart),Wh(e),r+=i),e.strm.avail_in===0)break;if(t=vn(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=t,e.lookahead+e.insert>=Me)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=ti(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=ti(e,e.ins_h,e.window[n+Me-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<Me)););}while(e.lookahead<Mt&&e.strm.avail_in!==0)},Ka=(e,i)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,n,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>a&&(r=a),r<t&&(r===0&&i!==kt||i===Qt||r!==n+e.strm.avail_in)))break;o=i===kt&&r===n+e.strm.avail_in?1:0,dn(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,bt(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(vn(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?wi:i!==Qt&&i!==kt&&e.strm.avail_in===0&&e.strstart===e.block_start?_i:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(vn(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,t=a>e.w_size?e.w_size:a,n=e.strstart-e.block_start,(n>=t||(n||i===kt)&&i!==Qt&&e.strm.avail_in===0&&n<=a)&&(r=n>a?a:n,o=i===kt&&e.strm.avail_in===0&&r===n?1:0,dn(e,e.block_start,r,o),e.block_start+=r,bt(e.strm)),o?si:ft)},bn=(e,i)=>{let t,r;for(;;){if(e.lookahead<Mt){if(yi(e),e.lookahead<Mt&&i===Qt)return ft;if(e.lookahead===0)break}if(t=0,e.lookahead>=Me&&(e.ins_h=ti(e,e.ins_h,e.window[e.strstart+Me-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-Mt&&(e.match_length=Ya(e,t)),e.match_length>=Me)if(r=Jt(e,e.strstart-e.match_start,e.match_length-Me),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Me){e.match_length--;do e.strstart++,e.ins_h=ti(e,e.ins_h,e.window[e.strstart+Me-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ti(e,e.ins_h,e.window[e.strstart+1]);else r=Jt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(_t(e,!1),e.strm.avail_out===0))return ft}return e.insert=e.strstart<Me-1?e.strstart:Me-1,i===kt?(_t(e,!0),e.strm.avail_out===0?si:wi):e.sym_next&&(_t(e,!1),e.strm.avail_out===0)?ft:_i},xi=(e,i)=>{let t,r,n;for(;;){if(e.lookahead<Mt){if(yi(e),e.lookahead<Mt&&i===Qt)return ft;if(e.lookahead===0)break}if(t=0,e.lookahead>=Me&&(e.ins_h=ti(e,e.ins_h,e.window[e.strstart+Me-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Me-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-Mt&&(e.match_length=Ya(e,t),e.match_length<=5&&(e.strategy===Ih||e.match_length===Me&&e.strstart-e.match_start>4096)&&(e.match_length=Me-1)),e.prev_length>=Me&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-Me,r=Jt(e,e.strstart-1-e.prev_match,e.prev_length-Me),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=ti(e,e.ins_h,e.window[e.strstart+Me-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Me-1,e.strstart++,r&&(_t(e,!1),e.strm.avail_out===0))return ft}else if(e.match_available){if(r=Jt(e,0,e.window[e.strstart-1]),r&&_t(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return ft}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Jt(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Me-1?e.strstart:Me-1,i===kt?(_t(e,!0),e.strm.avail_out===0?si:wi):e.sym_next&&(_t(e,!1),e.strm.avail_out===0)?ft:_i},Hh=(e,i)=>{let t,r,n,a;const o=e.window;for(;;){if(e.lookahead<=ni){if(yi(e),e.lookahead<=ni&&i===Qt)return ft;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Me&&e.strstart>0&&(n=e.strstart-1,r=o[n],r===o[++n]&&r===o[++n]&&r===o[++n])){a=e.strstart+ni;do;while(r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&n<a);e.match_length=ni-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Me?(t=Jt(e,1,e.match_length-Me),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=Jt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(_t(e,!1),e.strm.avail_out===0))return ft}return e.insert=0,i===kt?(_t(e,!0),e.strm.avail_out===0?si:wi):e.sym_next&&(_t(e,!1),e.strm.avail_out===0)?ft:_i},Zh=(e,i)=>{let t;for(;;){if(e.lookahead===0&&(yi(e),e.lookahead===0)){if(i===Qt)return ft;break}if(e.match_length=0,t=Jt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(_t(e,!1),e.strm.avail_out===0))return ft}return e.insert=0,i===kt?(_t(e,!0),e.strm.avail_out===0?si:wi):e.sym_next&&(_t(e,!1),e.strm.avail_out===0)?ft:_i},Mi=[new Gt(0,0,0,0,Ka),new Gt(4,4,8,4,bn),new Gt(4,5,16,8,bn),new Gt(4,6,32,32,bn),new Gt(4,4,16,16,xi),new Gt(8,16,32,32,xi),new Gt(8,16,128,128,xi),new Gt(8,32,128,256,xi),new Gt(32,128,258,1024,xi),new Gt(32,258,258,4096,xi)],Vh=e=>{e.window_size=2*e.w_size,ei(e.head),e.max_lazy_match=Mi[e.level].max_lazy,e.good_match=Mi[e.level].good_length,e.nice_match=Mi[e.level].nice_length,e.max_chain_length=Mi[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Me-1,e.match_available=0,e.ins_h=0},Bi=e=>{if(!e)return 1;const i=e.state;return!i||i.strm!==e||i.status!==bi&&i.status!==cn&&i.status!==fn&&i.status!==pn&&i.status!==mn&&i.status!==gn&&i.status!==ai&&i.status!==Pi?1:0},Ja=e=>{if(Bi(e))return oi(e,Ft);e.total_in=e.total_out=0,e.data_type=Lh;const i=e.state;return i.pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap===2?cn:i.wrap?bi:ai,e.adler=i.wrap===2?0:1,i.last_flush=-2,Eh(i),ht},Qa=e=>{const i=Ja(e);return i===ht&&Vh(e.state),i},Gh=(e,i)=>Bi(e)||e.state.wrap!==2?Ft:(e.state.gzhead=i,ht),es=(e,i,t,r,n,a)=>{if(!e)return Ft;let o=1;if(i===Rh&&(i=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),n<1||n>zh||t!==fr||r<8||r>15||i<0||i>9||a<0||a>Oh||r===8&&o!==1)return oi(e,Ft);r===8&&(r=9);const s=new cf;return e.state=s,s.strm=e,s.status=bi,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Me-1)/Me),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=i,s.strategy=a,s.method=t,Qa(e)},Xh=(e,i)=>es(e,i,fr,Ph,Fh,Dh),qh=(e,i)=>{if(Bi(e)||i>Xa||i<0)return e?oi(e,Ft):Ft;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===Pi&&i!==kt)return oi(e,e.avail_out===0?un:Ft);const r=t.last_flush;if(t.last_flush=i,t.pending!==0){if(bt(e),e.avail_out===0)return t.last_flush=-1,ht}else if(e.avail_in===0&&$a(i)<=$a(r)&&i!==kt)return oi(e,un);if(t.status===Pi&&e.avail_in!==0)return oi(e,un);if(t.status===bi&&t.wrap===0&&(t.status=ai),t.status===bi){let n=fr+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=cr||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,n|=a<<6,t.strstart!==0&&(n|=Bh),n+=31-n%31,Fi(t,n),t.strstart!==0&&(Fi(t,e.adler>>>16),Fi(t,e.adler&65535)),e.adler=1,t.status=ai,bt(e),t.pending!==0)return t.last_flush=-1,ht}if(t.status===cn){if(e.adler=0,je(t,31),je(t,139),je(t,8),t.gzhead)je(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),je(t,t.gzhead.time&255),je(t,t.gzhead.time>>8&255),je(t,t.gzhead.time>>16&255),je(t,t.gzhead.time>>24&255),je(t,t.level===9?2:t.strategy>=cr||t.level<2?4:0),je(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(je(t,t.gzhead.extra.length&255),je(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=st(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=fn;else if(je(t,0),je(t,0),je(t,0),je(t,0),je(t,0),je(t,t.level===9?2:t.strategy>=cr||t.level<2?4:0),je(t,Uh),t.status=ai,bt(e),t.pending!==0)return t.last_flush=-1,ht}if(t.status===fn){if(t.gzhead.extra){let n=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>n&&(e.adler=st(e.adler,t.pending_buf,t.pending-n,n)),t.gzindex+=s,bt(e),t.pending!==0)return t.last_flush=-1,ht;n=0,a-=s}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>n&&(e.adler=st(e.adler,t.pending_buf,t.pending-n,n)),t.gzindex=0}t.status=pn}if(t.status===pn){if(t.gzhead.name){let n=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>n&&(e.adler=st(e.adler,t.pending_buf,t.pending-n,n)),bt(e),t.pending!==0)return t.last_flush=-1,ht;n=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,je(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>n&&(e.adler=st(e.adler,t.pending_buf,t.pending-n,n)),t.gzindex=0}t.status=mn}if(t.status===mn){if(t.gzhead.comment){let n=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>n&&(e.adler=st(e.adler,t.pending_buf,t.pending-n,n)),bt(e),t.pending!==0)return t.last_flush=-1,ht;n=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,je(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>n&&(e.adler=st(e.adler,t.pending_buf,t.pending-n,n))}t.status=gn}if(t.status===gn){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(bt(e),t.pending!==0))return t.last_flush=-1,ht;je(t,e.adler&255),je(t,e.adler>>8&255),e.adler=0}if(t.status=ai,bt(e),t.pending!==0)return t.last_flush=-1,ht}if(e.avail_in!==0||t.lookahead!==0||i!==Qt&&t.status!==Pi){let n=t.level===0?Ka(t,i):t.strategy===cr?Zh(t,i):t.strategy===Nh?Hh(t,i):Mi[t.level].func(t,i);if((n===si||n===wi)&&(t.status=Pi),n===ft||n===si)return e.avail_out===0&&(t.last_flush=-1),ht;if(n===_i&&(i===Th?Sh(t):i!==Xa&&(dn(t,0,0,!1),i===Ch&&(ei(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),bt(e),e.avail_out===0))return t.last_flush=-1,ht}return i!==kt?ht:t.wrap<=0?qa:(t.wrap===2?(je(t,e.adler&255),je(t,e.adler>>8&255),je(t,e.adler>>16&255),je(t,e.adler>>24&255),je(t,e.total_in&255),je(t,e.total_in>>8&255),je(t,e.total_in>>16&255),je(t,e.total_in>>24&255)):(Fi(t,e.adler>>>16),Fi(t,e.adler&65535)),bt(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?ht:qa)},$h=e=>{if(Bi(e))return Ft;const i=e.state.status;return e.state=null,i===ai?oi(e,Ah):ht},Yh=(e,i)=>{let t=i.length;if(Bi(e))return Ft;const r=e.state,n=r.wrap;if(n===2||n===1&&r.status!==bi||r.lookahead)return Ft;if(n===1&&(e.adler=zi(e.adler,i,t,0)),r.wrap=0,t>=r.w_size){n===0&&(ei(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(i.subarray(t-r.w_size,t),0),i=l,t=r.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=i,yi(r);r.lookahead>=Me;){let l=r.strstart,h=r.lookahead-(Me-1);do r.ins_h=ti(r,r.ins_h,r.window[l+Me-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--h);r.strstart=l,r.lookahead=Me-1,yi(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Me-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=n,ht},Ui={deflateInit:Xh,deflateInit2:es,deflateReset:Qa,deflateResetKeep:Ja,deflateSetHeader:Gh,deflate:qh,deflateEnd:$h,deflateSetDictionary:Yh,deflateInfo:"pako deflate (from Nodeca project)"},Kh=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),Jh=function(e){const i=Array.prototype.slice.call(arguments,1);for(;i.length;){const t=i.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const r in t)Kh(t,r)&&(e[r]=t[r])}}return e},Qh=e=>{let i=0;for(let r=0,n=e.length;r<n;r++)i+=e[r].length;const t=new Uint8Array(i);for(let r=0,n=0,a=e.length;r<a;r++){let o=e[r];t.set(o,n),n+=o.length}return t},pr={assign:Jh,flattenChunks:Qh},ts=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ts=!1}Wi=new Uint8Array(256);for(let e=0;e<256;e++)Wi[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Wi[254]=Wi[254]=1,ed=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let i,t,r,n,a,o=e.length,s=0;for(n=0;n<o;n++)t=e.charCodeAt(n),(t&64512)===55296&&n+1<o&&(r=e.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),s+=t<128?1:t<2048?2:t<65536?3:4;for(i=new Uint8Array(s),a=0,n=0;a<s;n++)t=e.charCodeAt(n),(t&64512)===55296&&n+1<o&&(r=e.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),t<128?i[a++]=t:t<2048?(i[a++]=192|t>>>6,i[a++]=128|t&63):t<65536?(i[a++]=224|t>>>12,i[a++]=128|t>>>6&63,i[a++]=128|t&63):(i[a++]=240|t>>>18,i[a++]=128|t>>>12&63,i[a++]=128|t>>>6&63,i[a++]=128|t&63);return i},td=(e,i)=>{if(i<65534&&e.subarray&&ts)return String.fromCharCode.apply(null,e.length===i?e:e.subarray(0,i));let t="";for(let r=0;r<i;r++)t+=String.fromCharCode(e[r]);return t},id=(e,i)=>{const t=i||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,i));let r,n;const a=new Array(t*2);for(n=0,r=0;r<t;){let o=e[r++];if(o<128){a[n++]=o;continue}let s=Wi[o];if(s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<t;)o=o<<6|e[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return td(a,n)},rd=(e,i)=>{i=i||e.length,i>e.length&&(i=e.length);let t=i-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?i:t+Wi[e[t]]>i?t:i},ji={string2buf:ed,buf2string:id,utf8border:rd},is=ff,rs=Object.prototype.toString,{Z_NO_FLUSH:nd,Z_SYNC_FLUSH:ad,Z_FULL_FLUSH:sd,Z_FINISH:od,Z_OK:mr,Z_STREAM_END:ld,Z_DEFAULT_COMPRESSION:hd,Z_DEFAULT_STRATEGY:dd,Z_DEFLATED:ud}=vi,lr.prototype.push=function(e,i){const t=this.strm,r=this.options.chunkSize;let n,a;if(this.ended)return!1;for(i===~~i?a=i:a=i===!0?od:nd,typeof e=="string"?t.input=ji.string2buf(e):rs.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),(a===ad||a===sd)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(n=Ui.deflate(t,a),n===ld)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),n=Ui.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===mr;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},lr.prototype.onData=function(e){this.chunks.push(e)},lr.prototype.onEnd=function(e){e===mr&&(this.result=pr.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},cd={Deflate:lr,deflate:ka,deflateRaw:pf,gzip:mf,constants:vi},gr=16209,fd=16191,pd=function(i,t){let r,n,a,o,s,l,h,d,f,v,p,y,k,u,m,g,E,x,_,I,A,D,z,O;const F=i.state;r=i.next_in,z=i.input,n=r+(i.avail_in-5),a=i.next_out,O=i.output,o=a-(t-i.avail_out),s=a+(i.avail_out-257),l=F.dmax,h=F.wsize,d=F.whave,f=F.wnext,v=F.window,p=F.hold,y=F.bits,k=F.lencode,u=F.distcode,m=(1<<F.lenbits)-1,g=(1<<F.distbits)-1;e:do{y<15&&(p+=z[r++]<<y,y+=8,p+=z[r++]<<y,y+=8),E=k[p&m];t:for(;;){if(x=E>>>24,p>>>=x,y-=x,x=E>>>16&255,x===0)O[a++]=E&65535;else if(x&16){_=E&65535,x&=15,x&&(y<x&&(p+=z[r++]<<y,y+=8),_+=p&(1<<x)-1,p>>>=x,y-=x),y<15&&(p+=z[r++]<<y,y+=8,p+=z[r++]<<y,y+=8),E=u[p&g];i:for(;;){if(x=E>>>24,p>>>=x,y-=x,x=E>>>16&255,x&16){if(I=E&65535,x&=15,y<x&&(p+=z[r++]<<y,y+=8,y<x&&(p+=z[r++]<<y,y+=8)),I+=p&(1<<x)-1,I>l){i.msg="invalid distance too far back",F.mode=gr;break e}if(p>>>=x,y-=x,x=a-o,I>x){if(x=I-x,x>d&&F.sane){i.msg="invalid distance too far back",F.mode=gr;break e}if(A=0,D=v,f===0){if(A+=h-x,x<_){_-=x;do O[a++]=v[A++];while(--x);A=a-I,D=O}}else if(f<x){if(A+=h+f-x,x-=f,x<_){_-=x;do O[a++]=v[A++];while(--x);if(A=0,f<_){x=f,_-=x;do O[a++]=v[A++];while(--x);A=a-I,D=O}}}else if(A+=f-x,x<_){_-=x;do O[a++]=v[A++];while(--x);A=a-I,D=O}for(;_>2;)O[a++]=D[A++],O[a++]=D[A++],O[a++]=D[A++],_-=3;_&&(O[a++]=D[A++],_>1&&(O[a++]=D[A++]))}else{A=a-I;do O[a++]=O[A++],O[a++]=O[A++],O[a++]=O[A++],_-=3;while(_>2);_&&(O[a++]=O[A++],_>1&&(O[a++]=O[A++]))}}else if((x&64)===0){E=u[(E&65535)+(p&(1<<x)-1)];continue i}else{i.msg="invalid distance code",F.mode=gr;break e}break}}else if((x&64)===0){E=k[(E&65535)+(p&(1<<x)-1)];continue t}else if(x&32){F.mode=fd;break e}else{i.msg="invalid literal/length code",F.mode=gr;break e}break}}while(r<n&&a<s);_=y>>3,r-=_,y-=_<<3,p&=(1<<y)-1,i.next_in=r,i.next_out=a,i.avail_in=r<n?5+(n-r):5-(r-n),i.avail_out=a<s?257+(s-a):257-(a-s),F.hold=p,F.bits=y},vr=15,ns=852,as=592,ss=0,_n=1,os=2,md=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),gd=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),vd=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),bd=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),_d=(e,i,t,r,n,a,o,s)=>{const l=s.bits;let h=0,d=0,f=0,v=0,p=0,y=0,k=0,u=0,m=0,g=0,E,x,_,I,A,D=null,z;const O=new Uint16Array(16),F=new Uint16Array(16);let W=null,q,re,K;for(h=0;h<=vr;h++)O[h]=0;for(d=0;d<r;d++)O[i[t+d]]++;for(p=l,v=vr;v>=1&&O[v]===0;v--);if(p>v&&(p=v),v===0)return n[a++]=20971520,n[a++]=20971520,s.bits=1,0;for(f=1;f<v&&O[f]===0;f++);for(p<f&&(p=f),u=1,h=1;h<=vr;h++)if(u<<=1,u-=O[h],u<0)return-1;if(u>0&&(e===ss||v!==1))return-1;for(F[1]=0,h=1;h<vr;h++)F[h+1]=F[h]+O[h];for(d=0;d<r;d++)i[t+d]!==0&&(o[F[i[t+d]]++]=d);if(e===ss?(D=W=o,z=20):e===_n?(D=md,W=gd,z=257):(D=vd,W=bd,z=0),g=0,d=0,h=f,A=a,y=p,k=0,_=-1,m=1<<p,I=m-1,e===_n&&m>ns||e===os&&m>as)return 1;for(;;){q=h-k,o[d]+1<z?(re=0,K=o[d]):o[d]>=z?(re=W[o[d]-z],K=D[o[d]-z]):(re=96,K=0),E=1<<h-k,x=1<<y,f=x;do x-=E,n[A+(g>>k)+x]=q<<24|re<<16|K|0;while(x!==0);for(E=1<<h-1;g&E;)E>>=1;if(E!==0?(g&=E-1,g+=E):g=0,d++,--O[h]===0){if(h===v)break;h=i[t+o[d]]}if(h>p&&(g&I)!==_){for(k===0&&(k=p),A+=f,y=h-k,u=1<<y;y+k<v&&(u-=O[y+k],!(u<=0));)y++,u<<=1;if(m+=1<<y,e===_n&&m>ns||e===os&&m>as)return 1;_=g&I,n[_]=p<<24|y<<16|A-a|0}}return g!==0&&(n[A+g]=h-k<<24|4194304),s.bits=p,0},Hi=_d,wd=0,ls=1,hs=2,{Z_FINISH:ds,Z_BLOCK:yd,Z_TREES:br,Z_OK:li,Z_STREAM_END:xd,Z_NEED_DICT:Ed,Z_STREAM_ERROR:St,Z_DATA_ERROR:us,Z_MEM_ERROR:cs,Z_BUF_ERROR:kd,Z_DEFLATED:fs}=vi,_r=16180,ps=16181,ms=16182,gs=16183,vs=16184,bs=16185,_s=16186,ws=16187,ys=16188,xs=16189,wr=16190,qt=16191,wn=16192,Es=16193,yn=16194,ks=16195,Ss=16196,Ts=16197,Cs=16198,yr=16199,xr=16200,As=16201,Rs=16202,Is=16203,Ns=16204,Os=16205,xn=16206,Ds=16207,Ls=16208,Ke=16209,zs=16210,Ps=16211,Sd=852,Td=592,Cd=15,Fs=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),hi=e=>{if(!e)return 1;const i=e.state;return!i||i.strm!==e||i.mode<_r||i.mode>Ps?1:0},Ms=e=>{if(hi(e))return St;const i=e.state;return e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=i.wrap&1),i.mode=_r,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(Sd),i.distcode=i.distdyn=new Int32Array(Td),i.sane=1,i.back=-1,li},Bs=e=>{if(hi(e))return St;const i=e.state;return i.wsize=0,i.whave=0,i.wnext=0,Ms(e)},Us=(e,i)=>{let t;if(hi(e))return St;const r=e.state;return i<0?(t=0,i=-i):(t=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?St:(r.window!==null&&r.wbits!==i&&(r.window=null),r.wrap=t,r.wbits=i,Bs(e))},Ws=(e,i)=>{if(!e)return St;const t=new gf;e.state=t,t.strm=e,t.window=null,t.mode=_r;const r=Us(e,i);return r!==li&&(e.state=null),r},Ad=e=>Ws(e,Cd),js=!0,Rd=e=>{if(js){Hs=new Int32Array(512),Zs=new Int32Array(32);let i=0;for(;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(Hi(ls,e.lens,0,288,Hs,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;Hi(hs,e.lens,0,32,Zs,0,e.work,{bits:5}),js=!1}e.lencode=Hs,e.lenbits=9,e.distcode=Zs,e.distbits=5},Vs=(e,i,t,r)=>{let n;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(i.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>r&&(n=r),a.window.set(i.subarray(t-r,t-r+n),a.wnext),r-=n,r?(a.window.set(i.subarray(t-r,t),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},Id=(e,i)=>{let t,r,n,a,o,s,l,h,d,f,v,p,y,k,u=0,m,g,E,x,_,I,A,D;const z=new Uint8Array(4);let O,F;const W=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(hi(e)||!e.output||!e.input&&e.avail_in!==0)return St;t=e.state,t.mode===qt&&(t.mode=wn),o=e.next_out,n=e.output,l=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,h=t.hold,d=t.bits,f=s,v=l,D=li;e:for(;;)switch(t.mode){case _r:if(t.wrap===0){t.mode=wn;break}for(;d<16;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if(t.wrap&2&&h===35615){t.wbits===0&&(t.wbits=15),t.check=0,z[0]=h&255,z[1]=h>>>8&255,t.check=st(t.check,z,2,0),h=0,d=0,t.mode=ps;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((h&255)<<8)+(h>>8))%31){e.msg="incorrect header check",t.mode=Ke;break}if((h&15)!==fs){e.msg="unknown compression method",t.mode=Ke;break}if(h>>>=4,d-=4,A=(h&15)+8,t.wbits===0&&(t.wbits=A),A>15||A>t.wbits){e.msg="invalid window size",t.mode=Ke;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=h&512?xs:qt,h=0,d=0;break;case ps:for(;d<16;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if(t.flags=h,(t.flags&255)!==fs){e.msg="unknown compression method",t.mode=Ke;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=Ke;break}t.head&&(t.head.text=h>>8&1),t.flags&512&&t.wrap&4&&(z[0]=h&255,z[1]=h>>>8&255,t.check=st(t.check,z,2,0)),h=0,d=0,t.mode=ms;case ms:for(;d<32;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}t.head&&(t.head.time=h),t.flags&512&&t.wrap&4&&(z[0]=h&255,z[1]=h>>>8&255,z[2]=h>>>16&255,z[3]=h>>>24&255,t.check=st(t.check,z,4,0)),h=0,d=0,t.mode=gs;case gs:for(;d<16;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}t.head&&(t.head.xflags=h&255,t.head.os=h>>8),t.flags&512&&t.wrap&4&&(z[0]=h&255,z[1]=h>>>8&255,t.check=st(t.check,z,2,0)),h=0,d=0,t.mode=vs;case vs:if(t.flags&1024){for(;d<16;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}t.length=h,t.head&&(t.head.extra_len=h),t.flags&512&&t.wrap&4&&(z[0]=h&255,z[1]=h>>>8&255,t.check=st(t.check,z,2,0)),h=0,d=0}else t.head&&(t.head.extra=null);t.mode=bs;case bs:if(t.flags&1024&&(p=t.length,p>s&&(p=s),p&&(t.head&&(A=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(a,a+p),A)),t.flags&512&&t.wrap&4&&(t.check=st(t.check,r,p,a)),s-=p,a+=p,t.length-=p),t.length))break e;t.length=0,t.mode=_s;case _s:if(t.flags&2048){if(s===0)break e;p=0;do A=r[a+p++],t.head&&A&&t.length<65536&&(t.head.name+=String.fromCharCode(A));while(A&&p<s);if(t.flags&512&&t.wrap&4&&(t.check=st(t.check,r,p,a)),s-=p,a+=p,A)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=ws;case ws:if(t.flags&4096){if(s===0)break e;p=0;do A=r[a+p++],t.head&&A&&t.length<65536&&(t.head.comment+=String.fromCharCode(A));while(A&&p<s);if(t.flags&512&&t.wrap&4&&(t.check=st(t.check,r,p,a)),s-=p,a+=p,A)break e}else t.head&&(t.head.comment=null);t.mode=ys;case ys:if(t.flags&512){for(;d<16;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if(t.wrap&4&&h!==(t.check&65535)){e.msg="header crc mismatch",t.mode=Ke;break}h=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=qt;break;case xs:for(;d<32;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}e.adler=t.check=Fs(h),h=0,d=0,t.mode=wr;case wr:if(t.havedict===0)return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,t.hold=h,t.bits=d,Ed;e.adler=t.check=1,t.mode=qt;case qt:if(i===yd||i===br)break e;case wn:if(t.last){h>>>=d&7,d-=d&7,t.mode=xn;break}for(;d<3;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}switch(t.last=h&1,h>>>=1,d-=1,h&3){case 0:t.mode=Es;break;case 1:if(Rd(t),t.mode=yr,i===br){h>>>=2,d-=2;break e}break;case 2:t.mode=Ss;break;case 3:e.msg="invalid block type",t.mode=Ke}h>>>=2,d-=2;break;case Es:for(h>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if((h&65535)!==(h>>>16^65535)){e.msg="invalid stored block lengths",t.mode=Ke;break}if(t.length=h&65535,h=0,d=0,t.mode=yn,i===br)break e;case yn:t.mode=ks;case ks:if(p=t.length,p){if(p>s&&(p=s),p>l&&(p=l),p===0)break e;n.set(r.subarray(a,a+p),o),s-=p,a+=p,l-=p,o+=p,t.length-=p;break}t.mode=qt;break;case Ss:for(;d<14;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if(t.nlen=(h&31)+257,h>>>=5,d-=5,t.ndist=(h&31)+1,h>>>=5,d-=5,t.ncode=(h&15)+4,h>>>=4,d-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=Ke;break}t.have=0,t.mode=Ts;case Ts:for(;t.have<t.ncode;){for(;d<3;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}t.lens[W[t.have++]]=h&7,h>>>=3,d-=3}for(;t.have<19;)t.lens[W[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,O={bits:t.lenbits},D=Hi(wd,t.lens,0,19,t.lencode,0,t.work,O),t.lenbits=O.bits,D){e.msg="invalid code lengths set",t.mode=Ke;break}t.have=0,t.mode=Cs;case Cs:for(;t.have<t.nlen+t.ndist;){for(;u=t.lencode[h&(1<<t.lenbits)-1],m=u>>>24,g=u>>>16&255,E=u&65535,!(m<=d);){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if(E<16)h>>>=m,d-=m,t.lens[t.have++]=E;else{if(E===16){for(F=m+2;d<F;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if(h>>>=m,d-=m,t.have===0){e.msg="invalid bit length repeat",t.mode=Ke;break}A=t.lens[t.have-1],p=3+(h&3),h>>>=2,d-=2}else if(E===17){for(F=m+3;d<F;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}h>>>=m,d-=m,A=0,p=3+(h&7),h>>>=3,d-=3}else{for(F=m+7;d<F;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}h>>>=m,d-=m,A=0,p=11+(h&127),h>>>=7,d-=7}if(t.have+p>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=Ke;break}for(;p--;)t.lens[t.have++]=A}}if(t.mode===Ke)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=Ke;break}if(t.lenbits=9,O={bits:t.lenbits},D=Hi(ls,t.lens,0,t.nlen,t.lencode,0,t.work,O),t.lenbits=O.bits,D){e.msg="invalid literal/lengths set",t.mode=Ke;break}if(t.distbits=6,t.distcode=t.distdyn,O={bits:t.distbits},D=Hi(hs,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,O),t.distbits=O.bits,D){e.msg="invalid distances set",t.mode=Ke;break}if(t.mode=yr,i===br)break e;case yr:t.mode=xr;case xr:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,t.hold=h,t.bits=d,pd(e,v),o=e.next_out,n=e.output,l=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,h=t.hold,d=t.bits,t.mode===qt&&(t.back=-1);break}for(t.back=0;u=t.lencode[h&(1<<t.lenbits)-1],m=u>>>24,g=u>>>16&255,E=u&65535,!(m<=d);){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if(g&&(g&240)===0){for(x=m,_=g,I=E;u=t.lencode[I+((h&(1<<x+_)-1)>>x)],m=u>>>24,g=u>>>16&255,E=u&65535,!(x+m<=d);){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}h>>>=x,d-=x,t.back+=x}if(h>>>=m,d-=m,t.back+=m,t.length=E,g===0){t.mode=Os;break}if(g&32){t.back=-1,t.mode=qt;break}if(g&64){e.msg="invalid literal/length code",t.mode=Ke;break}t.extra=g&15,t.mode=As;case As:if(t.extra){for(F=t.extra;d<F;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}t.length+=h&(1<<t.extra)-1,h>>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Rs;case Rs:for(;u=t.distcode[h&(1<<t.distbits)-1],m=u>>>24,g=u>>>16&255,E=u&65535,!(m<=d);){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if((g&240)===0){for(x=m,_=g,I=E;u=t.distcode[I+((h&(1<<x+_)-1)>>x)],m=u>>>24,g=u>>>16&255,E=u&65535,!(x+m<=d);){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}h>>>=x,d-=x,t.back+=x}if(h>>>=m,d-=m,t.back+=m,g&64){e.msg="invalid distance code",t.mode=Ke;break}t.offset=E,t.extra=g&15,t.mode=Is;case Is:if(t.extra){for(F=t.extra;d<F;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}t.offset+=h&(1<<t.extra)-1,h>>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=Ke;break}t.mode=Ns;case Ns:if(l===0)break e;if(p=v-l,t.offset>p){if(p=t.offset-p,p>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=Ke;break}p>t.wnext?(p-=t.wnext,y=t.wsize-p):y=t.wnext-p,p>t.length&&(p=t.length),k=t.window}else k=n,y=o-t.offset,p=t.length;p>l&&(p=l),l-=p,t.length-=p;do n[o++]=k[y++];while(--p);t.length===0&&(t.mode=xr);break;case Os:if(l===0)break e;n[o++]=t.length,l--,t.mode=xr;break;case xn:if(t.wrap){for(;d<32;){if(s===0)break e;s--,h|=r[a++]<<d,d+=8}if(v-=l,e.total_out+=v,t.total+=v,t.wrap&4&&v&&(e.adler=t.check=t.flags?st(t.check,n,v,o-v):zi(t.check,n,v,o-v)),v=l,t.wrap&4&&(t.flags?h:Fs(h))!==t.check){e.msg="incorrect data check",t.mode=Ke;break}h=0,d=0}t.mode=Ds;case Ds:if(t.wrap&&t.flags){for(;d<32;){if(s===0)break e;s--,h+=r[a++]<<d,d+=8}if(t.wrap&4&&h!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=Ke;break}h=0,d=0}t.mode=Ls;case Ls:D=xd;break e;case Ke:D=us;break e;case zs:return cs;case Ps:default:return St}return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,t.hold=h,t.bits=d,(t.wsize||v!==e.avail_out&&t.mode<Ke&&(t.mode<xn||i!==ds))&&Vs(e,e.output,e.next_out,v-e.avail_out),f-=e.avail_in,v-=e.avail_out,e.total_in+=f,e.total_out+=v,t.total+=v,t.wrap&4&&v&&(e.adler=t.check=t.flags?st(t.check,n,v,e.next_out-v):zi(t.check,n,v,e.next_out-v)),e.data_type=t.bits+(t.last?64:0)+(t.mode===qt?128:0)+(t.mode===yr||t.mode===yn?256:0),(f===0&&v===0||i===ds)&&D===li&&(D=kd),D},Nd=e=>{if(hi(e))return St;let i=e.state;return i.window&&(i.window=null),e.state=null,li},Od=(e,i)=>{if(hi(e))return St;const t=e.state;return(t.wrap&2)===0?St:(t.head=i,i.done=!1,li)},Dd=(e,i)=>{const t=i.length;let r,n,a;return hi(e)||(r=e.state,r.wrap!==0&&r.mode!==wr)?St:r.mode===wr&&(n=1,n=zi(n,i,t,0),n!==r.check)?us:(a=Vs(e,i,t,t),a?(r.mode=zs,cs):(r.havedict=1,li))},$t={inflateReset:Bs,inflateReset2:Us,inflateResetKeep:Ms,inflateInit:Ad,inflateInit2:Ws,inflate:Id,inflateEnd:Nd,inflateGetHeader:Od,inflateSetDictionary:Dd,inflateInfo:"pako inflate (from Nodeca project)"},Ld=vf,Gs=Object.prototype.toString,{Z_NO_FLUSH:zd,Z_FINISH:Pd,Z_OK:Zi,Z_STREAM_END:En,Z_NEED_DICT:kn,Z_STREAM_ERROR:Fd,Z_DATA_ERROR:Xs,Z_MEM_ERROR:Md}=vi,hr.prototype.push=function(e,i){const t=this.strm,r=this.options.chunkSize,n=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(i===~~i?o=i:o=i===!0?Pd:zd,Gs.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),a=$t.inflate(t,o),a===kn&&n&&(a=$t.inflateSetDictionary(t,n),a===Zi?a=$t.inflate(t,o):a===Xs&&(a=kn));t.avail_in>0&&a===En&&t.state.wrap>0&&e[t.next_in]!==0;)$t.inflateReset(t),a=$t.inflate(t,o);switch(a){case Fd:case Xs:case kn:case Md:return this.onEnd(a),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||a===En))if(this.options.to==="string"){let l=ji.utf8border(t.output,t.next_out),h=t.next_out-l,d=ji.buf2string(t.output,l);t.next_out=h,t.avail_out=r-h,h&&t.output.set(t.output.subarray(l,l+h),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Zi&&s===0)){if(a===En)return a=$t.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},hr.prototype.onData=function(e){this.chunks.push(e)},hr.prototype.onEnd=function(e){e===Zi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=pr.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},Bd={Inflate:hr,inflate:Sa,inflateRaw:bf,ungzip:Sa,constants:vi},{Deflate:_f,deflate:wf,deflateRaw:yf,gzip:xf}=cd,{Inflate:Ef,inflate:Ud,inflateRaw:Wd,ungzip:kf}=Bd,jd=Ud,Hd=Wd})),Zd,Vd,Gd,Xd,qe,qd,Sn,qs,Yt,$d,Yd,Kd,Jd,Qd,eu,$s,tu,iu,ru,Ys,nu,au,Tf=_e((()=>{Sf(),Zd=3734674313,Vd=35,Gd=36,Xd=5,qe={VERSION:1,TITLE:2,AUTHOR:3,YEAR:4,MONTH:5,DAY:6,CATEGORY:7,PUBLISHER:8,VENDOR:9,CID:10,CONTENT_LENGTH:11,IMAGE:14,MIXED_IMAGE:15,TEXT_SEGMENT_INDEX:129,COVER:130,CHAPTER_OFFSETS:131,CHAPTER_TITLES:132,PAGE_OFFSETS:135,SPLASH:241},qd=class{constructor(e){this.offset=0,this.bytes=new Uint8Array(e),this.view=new DataView(e)}get remaining(){return this.bytes.length-this.offset}peek(){return this.remaining>0?this.bytes[this.offset]:void 0}readUint8(){this.ensure(1);const e=this.view.getUint8(this.offset);return this.offset+=1,e}readUint16(){this.ensure(2);const e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readUint32(){this.ensure(4);const e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readBytes(e){const i=Math.max(0,Math.min(e,this.remaining)),t=this.offset;return this.offset+=i,this.bytes.slice(t,t+i)}ensure(e){if(this.remaining<e)throw new Error("UMD 文件结构不完整,读取时遇到意外结尾")}},Sn=(e,i=0)=>e.length<i+4?0:new DataView(e.buffer,e.byteOffset+i,4).getUint32(0,!0),qs=e=>{if(!e.length)return"";if(typeof TextDecoder=="function")return new TextDecoder("utf-16le").decode(e);let i="";for(let t=0;t+1<e.length;t+=2)i+=String.fromCharCode(e[t]|e[t+1]<<8);return i},Yt=e=>qs(e).replace(/\u0000+$/g,"").trim(),$d=e=>e.replace(/\u0000+$/g,"").replace(/\u2029/g,`
|
|
57
|
+
`).replace(/\r\n?/g,`
|
|
58
|
+
`),Yd=(e,i=0)=>{const t=e.reduce((o,s)=>o+s.length,0),r=i>0?Math.min(i,t):t,n=new Uint8Array(r);let a=0;for(const o of e){if(a>=r)break;const s=o.subarray(0,Math.min(o.length,r-a));n.set(s,a),a+=s.length}return n},Kd=e=>{try{return jd(e)}catch{return Hd(e)}},Jd=e=>{const i=[];let t=0;for(;t<e.length;){const r=e[t];if(t+=1,!r||t+r>e.length)break;i.push(Yt(e.subarray(t,t+r))),t+=r}return i},Qd=e=>{const i=[],t=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let r=0;r+4<=e.length;r+=4)i.push(t.getUint32(r,!0));return i},eu=e=>e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71?{extension:"png",mimeType:"image/png"}:e.length>=3&&e[0]===255&&e[1]===216&&e[2]===255?{extension:"jpg",mimeType:"image/jpeg"}:e.length>=6&&e[0]===71&&e[1]===73&&e[2]===70?{extension:"gif",mimeType:"image/gif"}:e.length>=2&&e[0]===66&&e[1]===77?{extension:"bmp",mimeType:"image/bmp"}:e.length>=12&&e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80?{extension:"webp",mimeType:"image/webp"}:{extension:"bin",mimeType:"application/octet-stream"},$s=(e,i,t)=>{const{extension:r,mimeType:n}=eu(e);return{bytes:e,extension:r,id:`${i}-${t}-${e.length}`,mimeType:n}},tu=e=>e===1?"text":e===2?"comic":e===3?"mixed":"unknown",iu=({day:e,month:i,year:t})=>[t,i,e].filter(Boolean).join("-"),ru=(e,i,t)=>{if(!e.length)return[];const r=(i.length?i:[0]).map(n=>Math.max(0,Math.min(n,e.length))).filter((n,a,o)=>a===0||n>o[a-1]);return r.map((n,a)=>{const o=a+1<r.length?r[a+1]:e.length,s=n-n%2,l=o-o%2;return{content:$d(qs(e.subarray(s,l))),end:l,id:`chapter-${a}-${s}`,images:[],start:s,title:t[a]||`章节 ${a+1}`}})},Ys=(e,i,t)=>{if(!e.length)return[];const r=(i.length?i:[0]).map(n=>Math.max(0,Math.min(n,e.length))).filter((n,a,o)=>a===0||n>o[a-1]);return r.map((n,a)=>{const o=a+1<r.length?r[a+1]:e.length;return{content:"",end:o,id:`image-chapter-${a}-${n}`,images:e.slice(n,o),start:n,title:t[a]||`图集 ${a+1}`}})},nu=e=>e.map((i,t)=>({content:"",end:t,id:`empty-chapter-${t}`,images:[],start:t,title:i||`章节 ${t+1}`})),au=e=>{const i=new qd(e),t={author:"",category:"",day:"",month:"",publishedAt:"",publisher:"",title:"",vendor:"",year:""},r=new Map,n=[],a=[],o=[];let s=0,l=[],h=[],d=0,f,v=0;if(i.readUint32()!==Zd)throw new Error("不是有效的 UMD 电子书文件");for(;i.remaining>0&&i.peek()===Vd;){i.readUint8();const k=i.readUint16(),u=i.readUint8(),m=Math.max(0,i.readUint8()-Xd),g=i.readBytes(m),E=k===qe.CID||k===qe.SPLASH?s:k;switch(k){case qe.VERSION:v=g[0]||u;break;case qe.TITLE:t.title=Yt(g);break;case qe.AUTHOR:t.author=Yt(g);break;case qe.YEAR:t.year=Yt(g);break;case qe.MONTH:t.month=Yt(g);break;case qe.DAY:t.day=Yt(g);break;case qe.CATEGORY:t.category=Yt(g);break;case qe.PUBLISHER:t.publisher=Yt(g);break;case qe.VENDOR:t.vendor=Yt(g);break;case qe.CONTENT_LENGTH:d=Sn(g);break;case qe.TEXT_SEGMENT_INDEX:case qe.CHAPTER_OFFSETS:case qe.CHAPTER_TITLES:case qe.PAGE_OFFSETS:r.set(k,Sn(g));break;case qe.COVER:r.set(k,Sn(g,1));break;case qe.IMAGE:case qe.MIXED_IMAGE:v=v||(k===qe.MIXED_IMAGE?3:2);break;default:break}for(s=E||s;i.peek()===Gd;){i.readUint8();const x=i.readUint32(),_=Math.max(0,i.readUint32()-9),I=i.readBytes(_);switch(E){case qe.COVER:f=$s(I,"cover",x);break;case qe.CHAPTER_OFFSETS:l=Qd(I);break;case qe.CHAPTER_TITLES:x===r.get(qe.CHAPTER_TITLES)?h=Jd(I):a.push(I);break;case qe.IMAGE:case qe.MIXED_IMAGE:o.push($s(I,"image",o.length));break;default:break}}}const p=Yd(a.map(k=>{try{return Kd(k)}catch(u){return n.push(u instanceof Error?u.message:String(u)),new Uint8Array}}),d);d>p.length&&a.length&&n.push("UMD 正文长度小于声明长度,文件可能不完整");let y=ru(p,l,h);return y.length?o.length&&v!==1&&(y=Ys(o,l,h)):y=Ys(o,l,h),!y.length&&h.length&&(y=nu(h)),t.publishedAt=iu(t),{author:t.author,category:t.category,chapters:y,contentLength:d||p.length,cover:f,kind:tu(v),publishedAt:t.publishedAt,publisher:t.publisher,rawType:v,title:t.title||"UMD 电子书",vendor:t.vendor,warnings:n}}})),Cf=$i({default:()=>Af});async function Af(e,i,t){const r=Mn(t?.options),{localize:n,localizeJoinedWarnings:a}=lu(r),o=new Map;let s=null,l=0,h=!0,d=!1;const f=ou(),v=document.createElement("div");v.className="umd-viewer";const p=document.createElement("div");p.className="umd-toolbar";const y=document.createElement("button");y.type="button",y.className="umd-icon-button active",y.title=r("ebook.toc"),y.appendChild(document.createElement("span"));const k=document.createElement("div");k.className="umd-title";const u=Nt(k,"strong",r("umd.title")),m=Nt(k,"span",r("ebook.reading")),g=document.createElement("div");g.className="umd-actions";const E=Tn(r("umd.previousChapter"),"umd-button"),x=document.createElement("span");x.className="umd-progress",x.textContent="0/0";const _=Tn(r("umd.nextChapter"),"umd-button");g.append(E,x,_),p.append(y,k,g);const I=document.createElement("div");I.className="umd-body";const A=document.createElement("aside");A.className="umd-toc";const D=document.createElement("div");D.className="umd-toc-head",Nt(D,"strong",r("ebook.toc"));const z=Nt(D,"span",r("ebook.itemCount",{count:0})),O=document.createElement("div");O.className="umd-toc-list",A.append(D,O);const F=document.createElement("main");F.className="umd-stage-wrap";const W=document.createElement("article");W.className="umd-stage";const q=document.createElement("div");q.className="umd-state",q.textContent=r("umd.loading"),F.append(W,q),I.append(A,F),v.append(p,I),i.replaceChildren(f,v);const re=()=>{o.forEach(ve=>URL.revokeObjectURL(ve)),o.clear()},K=ve=>{if(!ve)return"";const ge=o.get(ve.id);if(ge)return ge;const Te=URL.createObjectURL(new Blob([hu(ve)],{type:ve.mimeType}));return o.set(ve.id,Te),Te},de=()=>s?.chapters[l],ue=()=>{const ve=de(),ge=s?.chapters.length||0;u.textContent=s?.title?n(s.title):r("umd.title"),m.textContent=n(Ks(s,r("ebook.reading"),ve)),x.textContent=ge?`${l+1}/${ge}`:"0/0",E.disabled=!s||l<=0,_.disabled=!s||!ge||l>=ge-1,y.classList.toggle("active",h),v.classList.toggle("umd-viewer--toc-hidden",!h),z.textContent=r("ebook.itemCount",{count:ge})},te=()=>{W.scrollTo({top:0})},fe=()=>{O.replaceChildren(),s?.chapters.forEach((ve,ge)=>{const Te=Tn(n(ve.title),"umd-toc-item");Te.classList.toggle("active",ge===l),Te.addEventListener("click",()=>{l=ge,h=!1,be(),te()}),O.appendChild(Te)})},ee=ve=>{if(!s)return;const ge=K(s.cover),Te=Ks(s,r("ebook.reading"));if(!ge&&!Te)return;const se=document.createElement("header");if(se.className="umd-book-head",ge){const He=document.createElement("img");He.src=ge,He.alt=n(s.title),se.appendChild(He)}const ce=document.createElement("div");Nt(ce,"h1",n(s.title)),Te&&Nt(ce,"p",Te);const xe=[s.publisher,s.vendor].filter(Boolean).join(" / ");xe&&Nt(ce,"p",xe),se.appendChild(ce),ve.appendChild(se)},Se=ve=>{const ge=document.createElement("section");if(ge.className="umd-chapter",ge.dataset.viewerAnchorId=ve.id,Nt(ge,"h2",n(ve.title)),ve.images.length){const Te=document.createElement("div");Te.className="umd-image-list",ve.images.forEach(se=>{const ce=document.createElement("figure"),xe=document.createElement("img");xe.src=K(se),xe.alt=n(ve.title),ce.appendChild(xe),Te.appendChild(ce)}),ge.appendChild(Te)}return ve.content?Nt(ge,"div",ve.content,"umd-text"):ve.images.length||Nt(ge,"div",r("umd.emptyContent"),"umd-empty"),ge},be=()=>{ue(),fe(),q.hidden=!0,W.replaceChildren(),ee(W);const ve=de();ve&&W.appendChild(Se(ve));const ge=s?a(s.warnings):"";ge&&Nt(W,"div",ge,"umd-warning")},Ce=ve=>{ue(),q.hidden=!1,q.classList.add("error"),q.textContent=ve},Le=()=>{h=!h,ue()},Oe=()=>{!s||l<=0||(l-=1,be(),te())},Re=()=>{const ve=s?.chapters.length||0;!s||l>=ve-1||(l+=1,be(),te())};y.addEventListener("click",Le),E.addEventListener("click",Oe),_.addEventListener("click",Re);try{s=au(e.slice(0)),d||(l=0,be())}catch(ve){d||(console.error(ve),Ce(ve instanceof Error?n(ve.message):String(ve)))}return{$el:i,unmount(){d=!0,y.removeEventListener("click",Le),E.removeEventListener("click",Oe),_.removeEventListener("click",Re),re(),i.replaceChildren()}}}var su,ou,Nt,Tn,Ks,lu,hu,Rf=_e((()=>{$n(),Tf(),su=`
|
|
59
|
+
.umd-viewer{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;background:#eef1f4;color:#172033;box-sizing:border-box}
|
|
60
|
+
.umd-toolbar{flex-shrink:0;display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(15,23,42,.08);background:rgba(255,255,255,.94);box-sizing:border-box}
|
|
61
|
+
.umd-title{min-width:0;display:flex;flex-direction:column;gap:3px}
|
|
62
|
+
.umd-title strong,.umd-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
63
|
+
.umd-title strong{font-size:14px}.umd-title span{color:#64748b;font-size:12px}
|
|
64
|
+
.umd-icon-button,.umd-button{height:36px;border:1px solid rgba(15,23,42,.08);background:#fff;color:#172033;font:inherit;cursor:pointer}
|
|
65
|
+
.umd-icon-button{width:40px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px}
|
|
66
|
+
.umd-icon-button span,.umd-icon-button span::before,.umd-icon-button span::after{width:16px;height:2px;display:block;border-radius:999px;background:currentColor}
|
|
67
|
+
.umd-icon-button span{position:relative}.umd-icon-button span::before,.umd-icon-button span::after{content:'';position:absolute;left:0}.umd-icon-button span::before{top:-5px}.umd-icon-button span::after{top:5px}
|
|
68
|
+
.umd-icon-button.active{border-color:rgba(2,132,199,.24);background:rgba(2,132,199,.08);color:#0369a1}
|
|
69
|
+
.umd-actions{display:flex;align-items:center;gap:8px}.umd-button{min-width:68px;padding:0 12px;border-radius:8px;font-size:13px;font-weight:700}.umd-button:disabled{color:#94a3b8;cursor:not-allowed}
|
|
70
|
+
.umd-progress{min-width:58px;color:#64748b;font-size:12px;text-align:center}
|
|
71
|
+
.umd-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(180px,240px) minmax(0,1fr)}
|
|
72
|
+
.umd-viewer--toc-hidden .umd-body{grid-template-columns:minmax(0,1fr)}
|
|
73
|
+
.umd-toc{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid rgba(15,23,42,.08);background:rgba(255,255,255,.82)}
|
|
74
|
+
.umd-viewer--toc-hidden .umd-toc{display:none}
|
|
75
|
+
.umd-toc-head{flex-shrink:0;display:flex;justify-content:space-between;gap:8px;padding:12px;color:#172033;font-size:13px}.umd-toc-head span{color:#64748b}
|
|
76
|
+
.umd-toc-list{flex:1;min-height:0;overflow:auto;padding:0 8px 10px}
|
|
77
|
+
.umd-toc-item{width:100%;min-height:34px;padding:7px 10px;border:0;border-radius:8px;background:transparent;color:#475569;font:inherit;font-size:12px;text-align:left;cursor:pointer}
|
|
78
|
+
.umd-toc-item:hover,.umd-toc-item.active{background:rgba(2,132,199,.08);color:#0369a1}
|
|
79
|
+
.umd-stage-wrap{position:relative;min-width:0;min-height:0;padding:18px;overflow:hidden;box-sizing:border-box}
|
|
80
|
+
.umd-stage{width:100%;height:100%;overflow:auto;border-radius:8px;background:#fffef8;box-shadow:0 18px 45px rgba(15,23,42,.12),inset 0 0 0 1px rgba(15,23,42,.06);box-sizing:border-box}
|
|
81
|
+
.umd-book-head{display:flex;gap:20px;max-width:820px;margin:0 auto;padding:32px 34px 8px;box-sizing:border-box}.umd-book-head img{width:96px;max-height:136px;object-fit:cover;border-radius:6px;box-shadow:0 12px 26px rgba(15,23,42,.16)}.umd-book-head div{min-width:0}
|
|
82
|
+
.umd-book-head h1{margin:0;color:#111827;font-size:24px;line-height:1.3}.umd-book-head p{margin:8px 0 0;color:#64748b;font-size:13px;line-height:1.6}
|
|
83
|
+
.umd-chapter{max-width:820px;margin:0 auto;padding:28px 34px 56px;box-sizing:border-box}.umd-chapter h2{margin:0 0 22px;color:#111827;font-size:22px;line-height:1.35}
|
|
84
|
+
.umd-text{color:#1f2937;font-family:Georgia,'Times New Roman','Songti SC',SimSun,serif;font-size:17px;line-height:1.86;white-space:pre-wrap;word-break:break-word}
|
|
85
|
+
.umd-image-list{display:grid;gap:18px}.umd-image-list figure{margin:0;text-align:center}.umd-image-list img{max-width:100%;height:auto;border-radius:6px;box-shadow:0 10px 24px rgba(15,23,42,.12)}
|
|
86
|
+
.umd-empty,.umd-warning{color:#64748b;font-size:14px;line-height:1.7}.umd-warning{max-width:820px;margin:-28px auto 36px;padding:0 34px;color:#b45309;box-sizing:border-box}
|
|
87
|
+
.umd-state{position:absolute;inset:18px;display:flex;align-items:center;justify-content:center;border-radius:8px;background:rgba(255,255,255,.92);color:#64748b;font-size:14px}.umd-state[hidden]{display:none!important}.umd-state.error{color:#b42318}
|
|
88
|
+
.file-viewer[data-viewer-theme='dark'] .umd-viewer{background:#101820;color:#e5edf6}.file-viewer[data-viewer-theme='dark'] .umd-toolbar,.file-viewer[data-viewer-theme='dark'] .umd-toc{background:rgba(15,23,42,.92);border-color:rgba(148,163,184,.18)}
|
|
89
|
+
.file-viewer[data-viewer-theme='dark'] .umd-stage{background:#111827;box-shadow:0 18px 45px rgba(0,0,0,.35),inset 0 0 0 1px rgba(148,163,184,.16)}
|
|
90
|
+
.file-viewer[data-viewer-theme='dark'] .umd-book-head h1,.file-viewer[data-viewer-theme='dark'] .umd-chapter h2,.file-viewer[data-viewer-theme='dark'] .umd-text,.file-viewer[data-viewer-theme='dark'] .umd-toc-head{color:#e5edf6}
|
|
91
|
+
.file-viewer[data-viewer-theme='dark'] .umd-title span,.file-viewer[data-viewer-theme='dark'] .umd-book-head p,.file-viewer[data-viewer-theme='dark'] .umd-toc-head span,.file-viewer[data-viewer-theme='dark'] .umd-progress{color:#94a3b8}
|
|
92
|
+
.file-viewer[data-viewer-theme='dark'] .umd-button,.file-viewer[data-viewer-theme='dark'] .umd-icon-button{background:#172033;color:#e5edf6;border-color:rgba(148,163,184,.18)}
|
|
93
|
+
@media (prefers-color-scheme:dark){.file-viewer[data-viewer-theme='system'] .umd-viewer{background:#101820;color:#e5edf6}.file-viewer[data-viewer-theme='system'] .umd-toolbar,.file-viewer[data-viewer-theme='system'] .umd-toc{background:rgba(15,23,42,.92);border-color:rgba(148,163,184,.18)}.file-viewer[data-viewer-theme='system'] .umd-stage{background:#111827;box-shadow:0 18px 45px rgba(0,0,0,.35),inset 0 0 0 1px rgba(148,163,184,.16)}.file-viewer[data-viewer-theme='system'] .umd-book-head h1,.file-viewer[data-viewer-theme='system'] .umd-chapter h2,.file-viewer[data-viewer-theme='system'] .umd-text,.file-viewer[data-viewer-theme='system'] .umd-toc-head{color:#e5edf6}.file-viewer[data-viewer-theme='system'] .umd-title span,.file-viewer[data-viewer-theme='system'] .umd-book-head p,.file-viewer[data-viewer-theme='system'] .umd-toc-head span,.file-viewer[data-viewer-theme='system'] .umd-progress{color:#94a3b8}.file-viewer[data-viewer-theme='system'] .umd-button,.file-viewer[data-viewer-theme='system'] .umd-icon-button{background:#172033;color:#e5edf6;border-color:rgba(148,163,184,.18)}}
|
|
94
|
+
@media (max-width:720px){.umd-toolbar{grid-template-columns:40px minmax(0,1fr)}.umd-actions{grid-column:1/-1;justify-content:space-between}.umd-body{position:relative;grid-template-columns:minmax(0,1fr)}.umd-toc{position:absolute;z-index:5;top:0;bottom:0;left:0;width:min(82vw,280px);box-shadow:18px 0 40px rgba(15,23,42,.16)}.umd-stage-wrap{padding:12px}.umd-book-head{padding:24px 20px 0}.umd-chapter{padding:24px 20px 42px}}
|
|
95
|
+
`,ou=()=>{const e=document.createElement("style");return e.textContent=su,e},Nt=(e,i,t,r)=>{const n=document.createElement(i);return r&&(n.className=r),n.textContent=t,e.appendChild(n),n},Tn=(e,i)=>{const t=document.createElement("button");return t.type="button",t.className=i,t.textContent=e,t},Ks=(e,i,t)=>e?[e.author,e.category,e.publishedAt].filter(Boolean).join(" / ")||t?.title||i:t?.title||i,lu=e=>{const i=t=>{if(t==="UMD 电子书")return e("umd.title");const r=/^章节\s+(\d+)$/.exec(t);if(r)return e("umd.chapterFallback",{index:r[1]});const n=/^图集\s+(\d+)$/.exec(t);return n?e("umd.galleryFallback",{index:n[1]}):t==="UMD 正文长度小于声明长度,文件可能不完整"?e("umd.warningBodyTooShort"):t==="UMD 文件结构不完整,读取时遇到意外结尾"?e("umd.error.unexpectedEnd"):t==="不是有效的 UMD 电子书文件"?e("umd.error.invalidFile"):t};return{localize:i,localizeJoinedWarnings(t){return t.filter(Boolean).map(i).join(";")}}},hu=e=>{const i=new Uint8Array(e.bytes.byteLength);return i.set(e.bytes),i}}));$n();var du=jt.find(e=>e.id==="epub"),uu=jt.find(e=>e.id==="umd");if(!du||!uu)throw new Error("@file-viewer/renderer-epub could not locate the shared ebook format definitions.");var cu=du,fu=uu,If=(e,i,t,r)=>Promise.resolve().then(()=>(uf(),hf)).then(({default:n})=>n(e,i,r)),Nf=(e,i,t,r)=>Promise.resolve().then(()=>(Rf(),Cf)).then(({default:n})=>n(e,i,r)),Js={id:"file-viewer-renderer-epub",label:"Flyfish File Viewer ebook renderer",definitions:[cu,fu],handlers:[{rendererId:cu.id,handler:If},{rendererId:fu.id,handler:Nf}]},pu=globalThis,mu=pu.FlyfishFileViewerWebFullRenderers||(pu.FlyfishFileViewerWebFullRenderers={});mu.ebook=Js,mu[Js.id]=Js})();
|