@eternalheart/vue-file-preview 1.3.1 → 1.3.2

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/lib/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var su=Object.defineProperty;var ba=C=>{throw TypeError(C)};var ou=(C,w,t)=>w in C?su(C,w,{enumerable:!0,configurable:!0,writable:!0,value:t}):C[w]=t;var De=(C,w,t)=>ou(C,typeof w!="symbol"?w+"":w,t),po=(C,w,t)=>w.has(C)||ba("Cannot "+t);var Z=(C,w,t)=>(po(C,w,"read from private field"),t?t.call(C):w.get(C)),mt=(C,w,t)=>w.has(C)?ba("Cannot add the same private member more than once"):w instanceof WeakSet?w.add(C):w.set(C,t),gt=(C,w,t,h)=>(po(C,w,"write to private field"),h?h.call(C,t):w.set(C,t),t),ht=(C,w,t)=>(po(C,w,"access private method"),t);var Ei=(C,w,t,h)=>({set _(d){gt(C,w,d,t)},get _(){return Z(C,w,h)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("vue"),Ot=require("lucide-vue-next"),au=require("jszip"),lu=require("pdfjs-dist/build/pdf.mjs"),cu=require("mammoth"),uu=require("x-data-spreadsheet"),mo=require("pptx-preview"),fu=require("@kenjiuno/msgreader"),hu=require("@likecoin/epub-ts"),du=require("video.js"),pu=require("markdown-it"),ra=require("shiki");function mu(C){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const t in C)if(t!=="default"){const h=Object.getOwnPropertyDescriptor(C,t);Object.defineProperty(w,t,h.get?h:{enumerable:!0,get:()=>C[t]})}}return w.default=C,Object.freeze(w)}const va=mu(lu),gu="1.3.1",bu={version:gu};function vu(C){try{const w=new URL(C).pathname.split("/").pop()||"file";return decodeURIComponent(w)}catch{const w=C.split("/").pop()||"file";return decodeURIComponent(w)}}function Oi(C){var w;const t=((w=C.split(".").pop())==null?void 0:w.toLowerCase())||"";return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",ogv:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",mkv:"video/x-matroska",m4v:"video/x-m4v","3gp":"video/3gpp",flv:"video/x-flv",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",aac:"audio/aac",flac:"audio/flac",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ppt:"application/vnd.ms-powerpoint",msg:"application/vnd.ms-outlook",mobi:"application/x-mobipocket-ebook",azw:"application/vnd.amazon.ebook",azw3:"application/vnd.amazon.ebook",kf8:"application/vnd.amazon.ebook",txt:"text/plain",md:"text/markdown",markdown:"text/markdown",json:"application/json",xml:"application/xml",html:"text/html",css:"text/css",js:"text/javascript",ts:"text/typescript",jsx:"text/javascript",tsx:"text/typescript",py:"text/x-python",java:"text/x-java",cpp:"text/x-c++src",c:"text/x-csrc",cs:"text/x-csharp",php:"text/x-php",rb:"text/x-ruby",go:"text/x-go",rs:"text/x-rust",yaml:"text/yaml",yml:"text/yaml",toml:"text/toml",ini:"text/plain",env:"text/plain",diff:"text/x-diff",patch:"text/x-diff",log:"text/plain",csv:"text/csv",tsv:"text/tab-separated-values",srt:"application/x-subrip",vtt:"text/vtt",zip:"application/zip"}[t]||"application/octet-stream"}function Ml(C,w=0){if(C instanceof File)return{id:`file-${Date.now()}-${w}`,name:C.name,url:URL.createObjectURL(C),type:C.type||Oi(C.name),size:C.size};if(typeof C=="string"){const t=vu(C);return{id:`url-${Date.now()}-${w}`,name:t,url:C,type:Oi(t)}}return{id:C.id||`link-${Date.now()}-${w}`,name:C.name,url:C.url,type:C.type||Oi(C.name),size:C.size}}function Al(C){return C.map((w,t)=>Ml(w,t))}function na(C){var w;const t=((w=C.name.split(".").pop())==null?void 0:w.toLowerCase())||"",h=C.type.toLowerCase();if(h.startsWith("image/")||["jpg","jpeg","png","gif","webp","svg"].includes(t))return"image";if(h.includes("pdf")||t==="pdf")return"pdf";if(h.includes("wordprocessingml")||t==="docx")return"docx";if(h.includes("spreadsheetml")||t==="xlsx")return"xlsx";if(h.includes("presentationml")||t==="pptx"||t==="ppt")return"pptx";if(h.includes("ms-outlook")||t==="msg")return"msg";if(h.includes("epub")||t==="epub")return"epub";if(["mobi","azw","azw3","kf8"].includes(t)||h==="application/x-mobipocket-ebook"||h==="application/vnd.amazon.ebook")return"mobi";if(["csv","tsv"].includes(t)||h==="text/csv"||h==="text/tab-separated-values")return"csv";if(t==="xml"||h==="application/xml"||h==="text/xml")return"xml";if(["srt","vtt","lrc","elrc","ass","ssa","ttml","dfxp"].includes(t)||h==="text/vtt"||h==="application/x-subrip"||h==="application/ttml+xml")return"subtitle";if(t==="zip"||h==="application/zip"||h==="application/x-zip-compressed")return"zip";if(h.startsWith("video/")||["mp4","webm","ogg","ogv","mov","avi","mkv","m4v","3gp","flv"].includes(t))return"video";if(h.startsWith("audio/")||["mp3","wav","ogg","m4a","flac","aac"].includes(t))return"audio";if(t==="md"||t==="markdown")return"markdown";if(h==="application/json"||t==="json")return"json";const d=["txt","log","lock","js","jsx","ts","tsx","py","java","cpp","c","h","cs","php","rb","go","mod","rs","swift","kt","lua","vim","html","css","scss","sass","less","yaml","yml","toml","ini","conf","env","diff","patch","sh","bash","zsh","sql"];return h.startsWith("text/")||d.includes(t)?"text":"unsupported"}function yu(C){var w;const t=((w=C.split(".").pop())==null?void 0:w.toLowerCase())||"";return{js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",rb:"ruby",go:"go",mod:"go",rs:"rust",swift:"swift",kt:"kotlin",lua:"lua",vim:"vim",scala:"scala",sh:"bash",bash:"bash",zsh:"bash",json:"json",xml:"xml",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",sql:"sql",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",env:"bash",conf:"nginx",diff:"diff",patch:"diff",log:"log",md:"markdown",txt:"text"}[t]||"text"}function ya(C){var w;const t=((w=C.split(".").pop())==null?void 0:w.toLowerCase().split("?")[0])||"";return{mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",ogv:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",mkv:"video/x-matroska",m4v:"video/mp4","3gp":"video/3gpp",flv:"video/x-flv"}[t]||"video/mp4"}function ia(C){return C<1024?`${C} B`:C<1024*1024?`${(C/1024).toFixed(1)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}function wu(C){if(!isFinite(C)||isNaN(C)||C<0)return"0:00";const w=Math.floor(C/60),t=Math.floor(C%60);return`${w}:${t.toString().padStart(2,"0")}`}function _u(C){var w;return(((w=C.split(".").pop())==null?void 0:w.toLowerCase())||"")==="tsv"?" ":","}function xu(C,w={}){const t=w.delimiter??",",h=w.firstRowAsHeader??!0,d=[];let l=[],i="",o=!1,r=0;const e=C.length;for(;r<e;){const s=C[r];if(o){if(s==='"'){if(C[r+1]==='"'){i+='"',r+=2;continue}o=!1,r+=1;continue}i+=s,r+=1;continue}if(s==='"'){o=!0,r+=1;continue}if(s===t){l.push(i),i="",r+=1;continue}if(s==="\r"){C[r+1]===`
1
+ "use strict";var su=Object.defineProperty;var ba=C=>{throw TypeError(C)};var ou=(C,w,t)=>w in C?su(C,w,{enumerable:!0,configurable:!0,writable:!0,value:t}):C[w]=t;var De=(C,w,t)=>ou(C,typeof w!="symbol"?w+"":w,t),po=(C,w,t)=>w.has(C)||ba("Cannot "+t);var Z=(C,w,t)=>(po(C,w,"read from private field"),t?t.call(C):w.get(C)),mt=(C,w,t)=>w.has(C)?ba("Cannot add the same private member more than once"):w instanceof WeakSet?w.add(C):w.set(C,t),gt=(C,w,t,h)=>(po(C,w,"write to private field"),h?h.call(C,t):w.set(C,t),t),ht=(C,w,t)=>(po(C,w,"access private method"),t);var Ei=(C,w,t,h)=>({set _(d){gt(C,w,d,t)},get _(){return Z(C,w,h)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("vue"),Ot=require("lucide-vue-next"),au=require("jszip"),lu=require("pdfjs-dist/build/pdf.mjs"),cu=require("mammoth"),uu=require("x-data-spreadsheet"),mo=require("pptx-preview"),fu=require("@kenjiuno/msgreader"),hu=require("@likecoin/epub-ts"),du=require("video.js"),pu=require("markdown-it"),ra=require("shiki");function mu(C){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const t in C)if(t!=="default"){const h=Object.getOwnPropertyDescriptor(C,t);Object.defineProperty(w,t,h.get?h:{enumerable:!0,get:()=>C[t]})}}return w.default=C,Object.freeze(w)}const va=mu(lu),gu="1.3.2",bu={version:gu};function vu(C){try{const w=new URL(C).pathname.split("/").pop()||"file";return decodeURIComponent(w)}catch{const w=C.split("/").pop()||"file";return decodeURIComponent(w)}}function Oi(C){var w;const t=((w=C.split(".").pop())==null?void 0:w.toLowerCase())||"";return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",ogv:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",mkv:"video/x-matroska",m4v:"video/x-m4v","3gp":"video/3gpp",flv:"video/x-flv",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",aac:"audio/aac",flac:"audio/flac",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ppt:"application/vnd.ms-powerpoint",msg:"application/vnd.ms-outlook",mobi:"application/x-mobipocket-ebook",azw:"application/vnd.amazon.ebook",azw3:"application/vnd.amazon.ebook",kf8:"application/vnd.amazon.ebook",txt:"text/plain",md:"text/markdown",markdown:"text/markdown",json:"application/json",xml:"application/xml",html:"text/html",css:"text/css",js:"text/javascript",ts:"text/typescript",jsx:"text/javascript",tsx:"text/typescript",py:"text/x-python",java:"text/x-java",cpp:"text/x-c++src",c:"text/x-csrc",cs:"text/x-csharp",php:"text/x-php",rb:"text/x-ruby",go:"text/x-go",rs:"text/x-rust",yaml:"text/yaml",yml:"text/yaml",toml:"text/toml",ini:"text/plain",env:"text/plain",diff:"text/x-diff",patch:"text/x-diff",log:"text/plain",csv:"text/csv",tsv:"text/tab-separated-values",srt:"application/x-subrip",vtt:"text/vtt",zip:"application/zip"}[t]||"application/octet-stream"}function Ml(C,w=0){if(C instanceof File)return{id:`file-${Date.now()}-${w}`,name:C.name,url:URL.createObjectURL(C),type:C.type||Oi(C.name),size:C.size};if(typeof C=="string"){const t=vu(C);return{id:`url-${Date.now()}-${w}`,name:t,url:C,type:Oi(t)}}return{id:C.id||`link-${Date.now()}-${w}`,name:C.name,url:C.url,type:C.type||Oi(C.name),size:C.size}}function Al(C){return C.map((w,t)=>Ml(w,t))}function na(C){var w;const t=((w=C.name.split(".").pop())==null?void 0:w.toLowerCase())||"",h=C.type.toLowerCase();if(h.startsWith("image/")||["jpg","jpeg","png","gif","webp","svg"].includes(t))return"image";if(h.includes("pdf")||t==="pdf")return"pdf";if(h.includes("wordprocessingml")||t==="docx")return"docx";if(h.includes("spreadsheetml")||t==="xlsx")return"xlsx";if(h.includes("presentationml")||t==="pptx"||t==="ppt")return"pptx";if(h.includes("ms-outlook")||t==="msg")return"msg";if(h.includes("epub")||t==="epub")return"epub";if(["mobi","azw","azw3","kf8"].includes(t)||h==="application/x-mobipocket-ebook"||h==="application/vnd.amazon.ebook")return"mobi";if(["csv","tsv"].includes(t)||h==="text/csv"||h==="text/tab-separated-values")return"csv";if(t==="xml"||h==="application/xml"||h==="text/xml")return"xml";if(["srt","vtt","lrc","elrc","ass","ssa","ttml","dfxp"].includes(t)||h==="text/vtt"||h==="application/x-subrip"||h==="application/ttml+xml")return"subtitle";if(t==="zip"||h==="application/zip"||h==="application/x-zip-compressed")return"zip";if(h.startsWith("video/")||["mp4","webm","ogg","ogv","mov","avi","mkv","m4v","3gp","flv"].includes(t))return"video";if(h.startsWith("audio/")||["mp3","wav","ogg","m4a","flac","aac"].includes(t))return"audio";if(t==="md"||t==="markdown")return"markdown";if(h==="application/json"||t==="json")return"json";const d=["txt","log","lock","js","jsx","ts","tsx","py","java","cpp","c","h","cs","php","rb","go","mod","rs","swift","kt","lua","vim","html","css","scss","sass","less","yaml","yml","toml","ini","conf","env","diff","patch","sh","bash","zsh","sql"];return h.startsWith("text/")||d.includes(t)?"text":"unsupported"}function yu(C){var w;const t=((w=C.split(".").pop())==null?void 0:w.toLowerCase())||"";return{js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",rb:"ruby",go:"go",mod:"go",rs:"rust",swift:"swift",kt:"kotlin",lua:"lua",vim:"vim",scala:"scala",sh:"bash",bash:"bash",zsh:"bash",json:"json",xml:"xml",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",sql:"sql",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",env:"bash",conf:"nginx",diff:"diff",patch:"diff",log:"log",md:"markdown",txt:"text"}[t]||"text"}function ya(C){var w;const t=((w=C.split(".").pop())==null?void 0:w.toLowerCase().split("?")[0])||"";return{mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",ogv:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",mkv:"video/x-matroska",m4v:"video/mp4","3gp":"video/3gpp",flv:"video/x-flv"}[t]||"video/mp4"}function ia(C){return C<1024?`${C} B`:C<1024*1024?`${(C/1024).toFixed(1)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}function wu(C){if(!isFinite(C)||isNaN(C)||C<0)return"0:00";const w=Math.floor(C/60),t=Math.floor(C%60);return`${w}:${t.toString().padStart(2,"0")}`}function _u(C){var w;return(((w=C.split(".").pop())==null?void 0:w.toLowerCase())||"")==="tsv"?" ":","}function xu(C,w={}){const t=w.delimiter??",",h=w.firstRowAsHeader??!0,d=[];let l=[],i="",o=!1,r=0;const e=C.length;for(;r<e;){const s=C[r];if(o){if(s==='"'){if(C[r+1]==='"'){i+='"',r+=2;continue}o=!1,r+=1;continue}i+=s,r+=1;continue}if(s==='"'){o=!0,r+=1;continue}if(s===t){l.push(i),i="",r+=1;continue}if(s==="\r"){C[r+1]===`
2
2
  `&&(r+=1),l.push(i),d.push(l),l=[],i="",r+=1;continue}if(s===`
3
3
  `){l.push(i),d.push(l),l=[],i="",r+=1;continue}i+=s,r+=1}for((i.length>0||l.length>0)&&(l.push(i),d.push(l));d.length>0;){const s=d[d.length-1];if(s.length===1&&s[0]==="")d.pop();else break}let n=[],c=d;h&&d.length>0&&(n=d[0],c=d.slice(1));const a=Math.max(n.length,...c.map(s=>s.length),0);for(const s of c)for(;s.length<a;)s.push("");return{header:n,rows:c,columnCount:a,delimiter:t}}function ku(C){const w=C instanceof Uint8Array?C:new Uint8Array(C);if(w.length>=3&&w[0]===239&&w[1]===187&&w[2]===191)return new TextDecoder("utf-8").decode(w);if(w.length>=2&&w[0]===255&&w[1]===254)return new TextDecoder("utf-16le").decode(w);if(w.length>=2&&w[0]===254&&w[1]===255)return new TextDecoder("utf-16be").decode(w);try{return new TextDecoder("utf-8",{fatal:!0}).decode(w)}catch{}try{return new TextDecoder("gbk").decode(w)}catch{}return new TextDecoder("utf-8",{fatal:!1}).decode(w)}async function ki(C,w){const t=await fetch(C,w);if(!t.ok)throw new Error(`请求失败: ${t.status}`);const h=await t.arrayBuffer();return ku(h)}function wa(C){const w=C.trim().replace(",","."),t=w.split(":").map(h=>h.trim());if(t.length===3){const[h,d,l]=t;return Number(h)*3600+Number(d)*60+Number(l)}if(t.length===2){const[h,d]=t;return Number(h)*60+Number(d)}return Number(w)||0}function _s(C){if(!isFinite(C)||C<0)return"00:00:00.000";const w=Math.floor(C*1e3),t=w%1e3,h=Math.floor(w/1e3)%60,d=Math.floor(w/6e4)%60,l=Math.floor(w/36e5),i=(o,r=2)=>o.toString().padStart(r,"0");return`${i(l)}:${i(d)}:${i(h)}.${i(t,3)}`}const _a=/(\d{1,2}:)?\d{1,2}:\d{1,2}[.,]\d{1,3}\s*-->\s*(\d{1,2}:)?\d{1,2}:\d{1,2}[.,]\d{1,3}/,Su=/^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;function Eu(C){const w=C.replace(/^\uFEFF/,"").trimStart();return/^WEBVTT/.test(w)?"vtt":/^<\?xml/i.test(w)||/<tt\b[^>]*>/i.test(w)?"ttml":/^\[Script Info\]/im.test(w)||/^Dialogue:/m.test(w)?/ScriptType:\s*v4\.00\s*$/im.test(w)?"ssa":"ass":Su.test(w)||/^\[(ti|ar|al|au|by|length|offset|re|ve):/im.test(w)?/<\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?>/.test(w)?"elrc":"lrc":"srt"}function xa(C,w){const t=C.replace(/\r\n?/g,`
4
4
  `).replace(/^\uFEFF/,"").split(`
@@ -113,7 +113,7 @@ use chrome, FireFox or Internet Explorer 11`)}var r=t("safe-buffer"),e=t("random
113
113
  </div>`};const e=r.renderer.rules.table_open||((f,p,u,g,m)=>m.renderToken(f,p,u));r.renderer.rules.table_open=(f,p,u,g,m)=>'<div class="table-wrapper">'+e(f,p,u,g,m);const n=r.renderer.rules.table_close||((f,p,u,g,m)=>m.renderToken(f,p,u));r.renderer.rules.table_close=(f,p,u,g,m)=>n(f,p,u,g,m)+"</div>";const c=async()=>{l.value=!0,i.value=null;try{const f=await ki(w.url);h.value=f,d.value=r.render(f)}catch(f){console.error(f),i.value=t.value("markdown.load_failed")}finally{l.value=!1}},a=async()=>{if(!o.value)return;const f=o.value.querySelectorAll('pre[data-shiki-pending="1"]');for(const p of f){const u=p.getAttribute("data-lang")||"text",g=p.querySelector("code"),m=(g==null?void 0:g.textContent)||"";try{const v=await ra.codeToHtml(m,{lang:u,theme:"github-light"});p.outerHTML=v}catch{p.removeAttribute("data-shiki-pending")}}},s=async f=>{const p=f.target.closest(".code-copy-btn");if(!p)return;f.preventDefault();const u=p.getAttribute("data-code")||"";try{const g=decodeURIComponent(escape(atob(u)));await navigator.clipboard.writeText(g);const m=p.textContent;p.textContent=t.value("markdown.copied"),setTimeout(()=>{p.textContent=m},2e3)}catch{}};return T.onMounted(()=>{document.addEventListener("click",s)}),T.onBeforeUnmount(()=>{document.removeEventListener("click",s)}),T.watch(()=>w.url,c,{immediate:!0}),T.watch(d,async()=>{d.value&&(await T.nextTick(),a())}),(f,p)=>l.value?(T.openBlock(),T.createElementBlock("div",$p,[...p[0]||(p[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):i.value?(T.openBlock(),T.createElementBlock("div",Vp,[T.createElementVNode("div",Up,[T.createElementVNode("p",Hp,T.toDisplayString(i.value),1)])])):(T.openBlock(),T.createElementBlock("div",Wp,[T.createElementVNode("div",qp,[T.createElementVNode("div",{ref_key:"containerRef",ref:o,class:"markdown-body vfp-p-6 md:vfp-p-10",innerHTML:d.value},null,8,Xp)])]))}}),Gp=Er(Zp,[["__scopeId","data-v-3ae21e99"]]),Kp={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},Yp={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},Jp={class:"vfp-text-white/70 vfp-text-center"},Qp={class:"vfp-text-lg"},tm={key:2,class:"vfp-w-full vfp-h-full vfp-overflow-auto vfp-py-3 vfp-pr-4",style:{background:"#1e1e1e"}},em=T.defineComponent({name:"JsonRenderer"});function rm(C){return C===null?T.h("span",{class:"json-null"},"null"):C===void 0?T.h("span",{class:"json-null"},"undefined"):typeof C=="boolean"?T.h("span",{class:"json-bool"},String(C)):typeof C=="number"?T.h("span",{class:"json-number"},String(C)):typeof C=="string"?T.h("span",{class:"json-string"},`"${C}"`):T.h("span",{class:"json-bracket"},String(C))}function Pa(C,w,t,h){return T.h("div",{class:"json-row",style:{paddingLeft:`${t}px`}},[T.h("span",{class:"json-arrow-placeholder"}),C!==void 0?T.h("span",{class:"json-key"},[`"${C}"`,T.h("span",{class:"json-colon"},": ")]):null,h?T.h("span",{class:"json-bracket"},h):rm(w)])}const Io=T.defineComponent({name:"JsonNode",props:{keyName:{type:String,default:void 0},value:{type:null,required:!0},depth:{type:Number,required:!0},defaultExpanded:{type:Boolean,default:!1}},setup(C){const w=T.ref(C.defaultExpanded),t=()=>{w.value=!w.value},h=T.inject(ao,null),d=T.computed(()=>(h==null?void 0:h.t.value)??oa({locale:"zh-CN"}));return{expanded:w,toggle:t,tFunc:d}},render(){const{keyName:C,value:w,depth:t,expanded:h,toggle:d,tFunc:l}=this,i=t*20;if(w==null||typeof w!="object")return Pa(C,w,i);const o=Array.isArray(w),e=(o?w:Object.entries(w)).length,n=o?"[":"{",c=o?"]":"}";if(e===0)return Pa(C,null,i,`${n}${c}`);const a=[];return a.push(T.h("div",{class:"json-row json-toggle",style:{paddingLeft:`${i}px`},onClick:d},[T.h("span",{class:"json-arrow"},[T.h(h?Ot.ChevronDown:Ot.ChevronRight,{class:"vfp-w-3.5 vfp-h-3.5"})]),C!==void 0?T.h("span",{class:"json-key"},[`"${C}"`,T.h("span",{class:"json-colon"},": ")]):null,T.h("span",{class:"json-bracket"},n),h?null:T.h("span",{class:"json-collapsed"},[o?`${e} ${l("json.items")}`:`${e} ${l("json.keys")}`,T.h("span",{class:"json-bracket"},` ${c}`)])])),h&&(o?w.forEach((s,f)=>{a.push(T.h(Io,{key:f,value:s,depth:t+1,defaultExpanded:t<1}))}):Object.entries(w).forEach(([s,f])=>{a.push(T.h(Io,{key:s,keyName:s,value:f,depth:t+1,defaultExpanded:t<1}))}),a.push(T.h("div",{class:"json-row",style:{paddingLeft:`${i+20}px`}},[T.h("span",{class:"json-bracket"},c)]))),T.h("div",null,a)}}),nm=T.defineComponent({...em,props:{url:{},fileName:{}},setup(C){const w=C,{t}=Te(),h=T.ref(null),d=T.ref(!0),l=T.ref(null),i=async()=>{d.value=!0,l.value=null;try{const o=await ki(w.url);h.value=JSON.parse(o)}catch(o){console.error(o),l.value=t.value("json.load_failed")}finally{d.value=!1}};return T.watch(()=>w.url,i,{immediate:!0}),(o,r)=>d.value?(T.openBlock(),T.createElementBlock("div",Kp,[...r[0]||(r[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):l.value?(T.openBlock(),T.createElementBlock("div",Yp,[T.createElementVNode("div",Jp,[T.createElementVNode("p",Qp,T.toDisplayString(l.value),1)])])):(T.openBlock(),T.createElementBlock("div",tm,[T.createVNode(T.unref(Io),{value:h.value,depth:0,"default-expanded":!0},null,8,["value"])]))}}),im=Er(nm,[["__scopeId","data-v-6417b14e"]]),sm={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},om={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},am={class:"vfp-text-white/70 vfp-text-center"},lm={class:"vfp-text-lg"},cm={key:2,class:"vfp-w-full vfp-h-full vfp-overflow-auto vfp-p-4 md:vfp-p-8"},um={class:"vfp-max-w-full md:vfp-max-w-6xl vfp-mx-auto vfp-bg-white/5 vfp-backdrop-blur-sm vfp-rounded-2xl vfp-border vfp-border-white/10 vfp-overflow-hidden"},fm={class:"vfp-flex vfp-items-center vfp-gap-2 md:vfp-gap-3 vfp-px-4 vfp-py-3 md:vfp-px-6 md:vfp-py-4 vfp-bg-white/5 vfp-border-b vfp-border-white/10"},hm={class:"vfp-text-white vfp-font-medium vfp-text-sm md:vfp-text-base vfp-truncate"},dm={class:"vfp-ml-auto vfp-text-xs vfp-text-white/50 vfp-uppercase vfp-flex-shrink-0"},pm={class:"vfp-overflow-auto vfp-text-sm vfp-text-white/90"},mm={class:"csv-table"},gm={key:0},bm=T.defineComponent({__name:"index",props:{url:{},fileName:{}},setup(C){const w=C,{t}=Te(),h=T.ref(""),d=T.ref(!0),l=T.ref(null),i=async()=>{d.value=!0,l.value=null;try{h.value=await ki(w.url)}catch(c){console.error(c),l.value=t.value("csv.load_failed")}finally{d.value=!1}};T.watch(()=>w.url,i,{immediate:!0});const o=T.computed(()=>{if(!h.value)return null;try{return xu(h.value,{delimiter:_u(w.fileName)})}catch(c){return console.error(c),null}}),r=T.computed(()=>{var c;return((c=o.value)==null?void 0:c.delimiter)===" "?"TSV":"CSV"}),e=T.computed(()=>o.value?Array.from({length:o.value.columnCount},(c,a)=>a):[]),n=T.computed(()=>{var c;return!!((c=o.value)!=null&&c.header.length)});return(c,a)=>d.value?(T.openBlock(),T.createElementBlock("div",sm,[...a[0]||(a[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):l.value||!o.value?(T.openBlock(),T.createElementBlock("div",om,[T.createElementVNode("div",am,[T.createElementVNode("p",lm,T.toDisplayString(l.value||T.unref(t)("csv.parse_failed")),1)])])):(T.openBlock(),T.createElementBlock("div",cm,[T.createElementVNode("div",um,[T.createElementVNode("div",fm,[T.createVNode(T.unref(Ot.FileSpreadsheet),{class:"vfp-w-4 vfp-h-4 md:vfp-w-5 md:vfp-h-5 vfp-text-white/70 vfp-flex-shrink-0"}),T.createElementVNode("span",hm,T.toDisplayString(C.fileName),1),T.createElementVNode("span",dm,T.toDisplayString(r.value)+" · "+T.toDisplayString(o.value.rows.length)+" rows · "+T.toDisplayString(o.value.columnCount)+" cols ",1)]),T.createElementVNode("div",pm,[T.createElementVNode("table",mm,[n.value?(T.openBlock(),T.createElementBlock("thead",gm,[T.createElementVNode("tr",null,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.value,s=>(T.openBlock(),T.createElementBlock("th",{key:"h-"+s},T.toDisplayString(o.value.header[s]??""),1))),128))])])):T.createCommentVNode("",!0),T.createElementVNode("tbody",null,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(o.value.rows,(s,f)=>(T.openBlock(),T.createElementBlock("tr",{key:"r-"+f,class:T.normalizeClass({odd:f%2===1})},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.value,p=>(T.openBlock(),T.createElementBlock("td",{key:"c-"+f+"-"+p},T.toDisplayString(s[p]??""),1))),128))],2))),128))])])])])]))}}),vm=Er(bm,[["__scopeId","data-v-fe9d478c"]]),ym={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},wm={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},_m={class:"vfp-text-white/70 vfp-text-center"},xm={class:"vfp-text-lg"},km={key:2,class:"vfp-w-full vfp-h-full vfp-overflow-auto vfp-p-4 md:vfp-p-8"},Sm={class:"vfp-max-w-full md:vfp-max-w-6xl vfp-mx-auto vfp-bg-white/5 vfp-backdrop-blur-sm vfp-rounded-2xl vfp-border vfp-border-white/10 vfp-overflow-hidden"},Em={class:"vfp-flex vfp-items-center vfp-gap-2 md:vfp-gap-3 vfp-px-4 vfp-py-3 md:vfp-px-6 md:vfp-py-4 vfp-bg-white/5 vfp-border-b vfp-border-white/10"},Cm={class:"vfp-text-white vfp-font-medium vfp-text-sm md:vfp-text-base vfp-truncate"},Tm={class:"vfp-text-sm"},Mm={key:0,class:"vfp-p-6 vfp-text-white/90 vfp-font-mono vfp-whitespace-pre-wrap vfp-break-words"},Am=["innerHTML"],Rm=T.defineComponent({__name:"index",props:{url:{},fileName:{}},setup(C){const w=C,{t}=Te(),h=T.ref(""),d=T.ref(""),l=T.ref(!0),i=T.ref(null),o=n=>{const c=" ",a=/(>)(<)(\/*)/g,s=n.replace(a,`$1
114
114
  $2$3`);let f=0;return s.split(`
115
115
  `).map(p=>{let u=0;/^<\/\w/.test(p)?f=Math.max(f-1,0):/^<\w[^>]*[^/]>.*$/.test(p)&&!/<.+<\/.+>$/.test(p)&&(u=1);const g=c.repeat(f)+p;return f+=u,g}).join(`
116
- `)},r=n=>{try{const a=new DOMParser().parseFromString(n,"application/xml");if(a.querySelector("parsererror"))return n;const f=new XMLSerializer().serializeToString(a);return o(f)}catch{return n}},e=async()=>{l.value=!0,i.value=null;try{const n=await ki(w.url);h.value=r(n);try{d.value=await ra.codeToHtml(h.value,{lang:"xml",theme:"dark-plus"})}catch{d.value=""}}catch(n){console.error(n),i.value=t.value("xml.load_failed")}finally{l.value=!1}};return T.watch(()=>w.url,e,{immediate:!0}),(n,c)=>l.value?(T.openBlock(),T.createElementBlock("div",ym,[...c[0]||(c[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):i.value?(T.openBlock(),T.createElementBlock("div",wm,[T.createElementVNode("div",_m,[T.createElementVNode("p",xm,T.toDisplayString(i.value),1)])])):(T.openBlock(),T.createElementBlock("div",km,[T.createElementVNode("div",Sm,[T.createElementVNode("div",Em,[T.createVNode(T.unref(Ot.Code),{class:"vfp-w-4 vfp-h-4 md:vfp-w-5 md:vfp-h-5 vfp-text-white/70 vfp-flex-shrink-0"}),T.createElementVNode("span",Cm,T.toDisplayString(C.fileName),1),c[1]||(c[1]=T.createElementVNode("span",{class:"vfp-ml-auto vfp-text-xs vfp-text-white/50 vfp-uppercase vfp-flex-shrink-0"},"XML",-1))]),T.createElementVNode("div",Tm,[d.value?(T.openBlock(),T.createElementBlock("div",{key:1,class:"shiki-wrapper",innerHTML:d.value},null,8,Am)):(T.openBlock(),T.createElementBlock("pre",Mm,T.toDisplayString(h.value),1))])])]))}}),Nm=Er(Rm,[["__scopeId","data-v-21dc7ce6"]]),Om={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-bg-[#0f0f12]"},jm={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-bg-[#0f0f12]"},Im={class:"vfp-text-white/70 vfp-text-center"},Bm={class:"vfp-text-lg"},Pm={class:"content-scroll"},Fm={class:"timeline"},Dm={class:"cues"},Lm={class:"cue-meta"},zm={class:"cue-time"},$m={class:"cue-time"},Vm={class:"cue-id"},Um={key:0,class:"cue-style"},Hm={key:0,class:"cue-words"},Wm=["title"],qm={class:"cue-word-time"},Xm={class:"cue-word-text"},Zm={class:"status-pill"},Gm=T.defineComponent({__name:"index",props:{url:{},fileName:{}},setup(C){const w=C,{t}=Te(),h=T.ref(""),d=T.ref(!0),l=T.ref(null),i={srt:"srt",vtt:"vtt",lrc:"lrc",elrc:"elrc",ass:"ass",ssa:"ssa",ttml:"ttml",dfxp:"ttml"},o=s=>{var p;const f=((p=s.split(".").pop())==null?void 0:p.toLowerCase())||"";return i[f]},r=async()=>{d.value=!0,l.value=null;try{h.value=await ki(w.url)}catch(s){console.error(s),l.value=t.value("subtitle.load_failed")}finally{d.value=!1}};T.watch(()=>w.url,r,{immediate:!0});const e=T.computed(()=>{if(!h.value)return null;try{return Au(h.value,o(w.fileName))}catch(s){return console.error(s),null}}),n=T.computed(()=>{var s,f;return((s=e.value)==null?void 0:s.format)==="lrc"||((f=e.value)==null?void 0:f.format)==="elrc"}),c=T.computed(()=>{var s;return((s=e.value)==null?void 0:s.metadata)??{}}),a=s=>_s(s).slice(3,8);return(s,f)=>d.value?(T.openBlock(),T.createElementBlock("div",Om,[...f[0]||(f[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):l.value||!e.value?(T.openBlock(),T.createElementBlock("div",jm,[T.createElementVNode("div",Im,[T.createElementVNode("p",Bm,T.toDisplayString(l.value||T.unref(t)("subtitle.parse_failed")),1)])])):(T.openBlock(),T.createElementBlock("div",{key:2,class:T.normalizeClass(["vfp-relative vfp-w-full vfp-h-full vfp-bg-[#0f0f12]",n.value?"flavor-lyric":"flavor-subtitle"])},[T.createElementVNode("div",Pm,[T.createElementVNode("div",Fm,[f[3]||(f[3]=T.createElementVNode("div",{class:"timeline-line"},null,-1)),T.createElementVNode("ol",Dm,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.value.cues,(p,u)=>(T.openBlock(),T.createElementBlock("li",{key:"cue-"+u,class:"cue-row"},[f[2]||(f[2]=T.createElementVNode("div",{class:"cue-dot"},null,-1)),T.createElementVNode("div",Lm,[T.createElementVNode("span",zm,T.toDisplayString(T.unref(_s)(p.start)),1),f[1]||(f[1]=T.createElementVNode("span",{class:"cue-arrow"},"→",-1)),T.createElementVNode("span",$m,T.toDisplayString(T.unref(_s)(p.end)),1),T.createElementVNode("span",Vm,"#"+T.toDisplayString(p.id??u+1),1),p.style?(T.openBlock(),T.createElementBlock("span",Um,T.toDisplayString(p.style),1)):T.createCommentVNode("",!0)]),p.words&&p.words.length>0?(T.openBlock(),T.createElementBlock("div",Hm,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(p.words,(g,m)=>(T.openBlock(),T.createElementBlock("span",{key:"w-"+m,class:"cue-word",title:T.unref(_s)(g.start)},[T.createElementVNode("span",qm,T.toDisplayString(a(g.start)),1),T.createElementVNode("span",Xm,T.toDisplayString(g.text),1)],8,Wm))),128))])):(T.openBlock(),T.createElementBlock("p",{key:1,class:T.normalizeClass(["cue-text",{lyric:n.value}])},T.toDisplayString(p.text),3))]))),128))])])]),T.createElementVNode("div",Zm,[T.createElementVNode("span",null,T.toDisplayString(e.value.cues.length)+" "+T.toDisplayString(n.value?T.unref(t)("subtitle.lines"):T.unref(t)("subtitle.cues")),1),c.value.length?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[f[4]||(f[4]=T.createElementVNode("span",{class:"dot"},"·",-1)),T.createElementVNode("span",null,T.toDisplayString(c.value.length),1)],64)):T.createCommentVNode("",!0)])],2))}}),Km=Er(Gm,[["__scopeId","data-v-1ebcbb6d"]]),Ym={class:"vfp-flex-1 vfp-min-w-0 vfp-min-h-0 vfp-overflow-hidden"},Jm=T.defineComponent({name:"ResizableSplit",__name:"ResizableSplit",props:{initialLeftWidth:{default:280},minLeftWidth:{default:160},maxLeftWidth:{default:640},minRightWidth:{default:200},storageKey:{},desktopMedia:{default:"(min-width: 768px)"}},setup(C){const w=C,t=T.ref(null),h=T.ref((()=>{if(w.storageKey&&typeof window<"u"){const a=Number(window.localStorage.getItem(w.storageKey));if(!isNaN(a)&&a>0)return a}return w.initialLeftWidth})()),d=T.ref(!1),l=T.ref(!1);let i=null;const o=()=>{i&&(l.value=i.matches)},r=T.computed(()=>l.value?{width:`${h.value}px`}:void 0),e=a=>{if(!t.value)return;const s=t.value.getBoundingClientRect(),f=a.clientX-s.left,p=s.width-w.minRightWidth-6,u=Math.min(w.maxLeftWidth,p);h.value=Math.max(w.minLeftWidth,Math.min(u,f))},n=()=>{if(d.value&&(d.value=!1,window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n),document.body.style.cursor="",document.body.style.userSelect="",w.storageKey))try{window.localStorage.setItem(w.storageKey,String(h.value))}catch{}},c=a=>{a.preventDefault(),d.value=!0,window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),document.body.style.cursor="col-resize",document.body.style.userSelect="none"};return T.onMounted(()=>{typeof window<"u"&&(i=window.matchMedia(w.desktopMedia),o(),i.addEventListener("change",o))}),T.onBeforeUnmount(()=>{i&&i.removeEventListener("change",o),window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n),d.value&&(document.body.style.cursor="",document.body.style.userSelect="")}),T.watch(()=>w.initialLeftWidth,a=>{w.storageKey||(h.value=a)}),(a,s)=>(T.openBlock(),T.createElementBlock("div",{ref_key:"containerRef",ref:t,class:"vfp-w-full vfp-h-full vfp-flex vfp-flex-col md:vfp-flex-row vfp-min-h-0 vfp-min-w-0"},[T.createElementVNode("div",{class:"vfp-min-h-0 vfp-min-w-0 vfp-flex-shrink-0 vfp-w-full vfp-max-h-60 md:vfp-h-full md:vfp-max-h-none",style:T.normalizeStyle(r.value)},[T.renderSlot(a.$slots,"left",{},void 0,!0)],4),T.createElementVNode("div",{role:"separator","aria-orientation":"vertical",class:T.normalizeClass(["split-divider vfp-hidden md:vfp-block vfp-relative vfp-w-1.5 vfp-flex-shrink-0 vfp-cursor-col-resize vfp-transition-colors",d.value?"dragging":""]),onMousedown:c},[...s[0]||(s[0]=[T.createElementVNode("span",{class:"vfp-absolute vfp-inset-y-0 hit-area"},null,-1)])],34),T.createElementVNode("div",Ym,[T.renderSlot(a.$slots,"right",{},void 0,!0)])],512))}}),Qm=Er(Jm,[["__scopeId","data-v-790c366f"]]),t0={key:0},e0={class:"vfp-truncate vfp-flex-1 vfp-min-w-0"},r0={class:"vfp-flex-1 vfp-truncate vfp-min-w-0"},n0={class:"vfp-text-xs vfp-text-white/30 vfp-flex-shrink-0 vfp-ml-2"},i0={name:"ZipTreeItem"},s0=T.defineComponent({...i0,props:{node:{},depth:{},selectedPath:{},expanded:{}},emits:["toggle","select","hover","leave"],setup(C,{emit:w}){const t=C,h=w,d=T.computed(()=>({paddingLeft:`${t.depth*14+10}px`})),l=T.computed(()=>t.expanded.has(t.node.path)),i=T.computed(()=>t.selectedPath===t.node.path),o=T.computed(()=>{const n=na({name:t.node.name,type:""});return n==="image"?Ot.FileImage:n==="text"||n==="markdown"||n==="json"||n==="csv"||n==="xml"||n==="subtitle"?t.node.name.endsWith(".md")||t.node.name.endsWith(".markdown")?Ot.FileText:Ot.FileCode:Ot.File}),r=n=>{const c=n.currentTarget.getBoundingClientRect();h("hover",t.node.name||"/",c)},e=()=>h("leave");return(n,c)=>{const a=T.resolveComponent("ZipTreeItem");return C.node.isDir?(T.openBlock(),T.createElementBlock("div",t0,[T.createElementVNode("button",{type:"button",class:"tree-row dir-row",style:T.normalizeStyle(d.value),onClick:c[0]||(c[0]=s=>h("toggle",C.node.path)),onMouseenter:r,onMouseleave:e},[T.createVNode(T.unref(Ot.ChevronRight),{class:T.normalizeClass(["vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0 vfp-transition-transform",{"vfp-rotate-90":l.value}])},null,8,["class"]),(T.openBlock(),T.createBlock(T.resolveDynamicComponent(l.value?T.unref(Ot.FolderOpen):T.unref(Ot.Folder)),{class:"vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-amber-300/80"})),T.createElementVNode("span",e0,T.toDisplayString(C.node.name||"/"),1)],36),l.value&&C.node.children?(T.openBlock(!0),T.createElementBlock(T.Fragment,{key:0},T.renderList(C.node.children,s=>(T.openBlock(),T.createBlock(a,{key:s.path,node:s,depth:C.depth+1,"selected-path":C.selectedPath,expanded:C.expanded,onToggle:c[1]||(c[1]=f=>h("toggle",f)),onSelect:c[2]||(c[2]=f=>h("select",f)),onHover:c[3]||(c[3]=(f,p)=>h("hover",f,p)),onLeave:c[4]||(c[4]=f=>h("leave"))},null,8,["node","depth","selected-path","expanded"]))),128)):T.createCommentVNode("",!0)])):(T.openBlock(),T.createElementBlock("button",{key:1,type:"button",class:T.normalizeClass(["tree-row file-row",{selected:i.value}]),style:T.normalizeStyle(d.value),onClick:c[5]||(c[5]=s=>h("select",C.node)),onMouseenter:r,onMouseleave:e},[c[6]||(c[6]=T.createElementVNode("span",{class:"vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0"},null,-1)),(T.openBlock(),T.createBlock(T.resolveDynamicComponent(o.value),{class:"vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-white/50"})),T.createElementVNode("span",r0,T.toDisplayString(C.node.name),1),T.createElementVNode("span",n0,T.toDisplayString(T.unref(ia)(C.node.size)),1)],38))}}}),o0=Er(s0,[["__scopeId","data-v-5385318d"]]),a0={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},l0={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},c0={class:"vfp-text-white/70 vfp-text-center"},u0={class:"vfp-text-lg"},f0={class:"vfp-w-full vfp-h-full vfp-overflow-auto"},h0={class:"vfp-w-full vfp-h-full vfp-flex vfp-flex-col"},d0={key:0,class:"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-white/40 vfp-text-sm vfp-p-6"},p0={key:1,class:"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center"},m0={key:2,class:"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-white/70"},g0={key:3,class:"vfp-flex-1 vfp-min-h-0 vfp-overflow-hidden vfp-flex"},b0=T.defineComponent({__name:"index",props:{url:{},nestingDepth:{default:0}},emits:["statsChange"],setup(C,{emit:w}){const t=T.defineAsyncComponent(()=>Promise.resolve().then(()=>K0)),h=C,d=w,{t:l}=Te(),i=T.ref(null),o=T.ref(null),r=T.ref(!0),e=T.ref(null),n=T.ref(new Set([""])),c=T.ref(null),a=T.ref(!1),s=T.ref(null),f=T.ref(null),p=()=>{var F;(F=c.value)!=null&&F.blobUrl&&URL.revokeObjectURL(c.value.blobUrl)},u=async()=>{p(),c.value=null,r.value=!0,e.value=null;try{const F=await fetch(h.url);if(!F.ok)throw new Error("加载失败");const j=await F.arrayBuffer(),L=await Ru(j),$=Nu(L),V=Ou($);i.value=L,o.value=V;const z=new Set([""]);if(V.children)for(const E of V.children)E.isDir&&z.add(E.path);n.value=z}catch(F){console.error(F),e.value=l.value("zip.load_failed")}finally{r.value=!1}};T.watch(()=>h.url,u,{immediate:!0}),T.onBeforeUnmount(()=>{p()});const g=T.computed(()=>{if(!o.value)return null;let F=0,j=0,L=0;const $=V=>{var z;V.isDir?(V.path&&j++,(z=V.children)==null||z.forEach($)):(F++,L+=V.size)};return $(o.value),{files:F,dirs:j,size:L}});T.watch(g,F=>d("statsChange",F),{immediate:!0}),T.onBeforeUnmount(()=>d("statsChange",null));const m=F=>{const j=new Set(n.value);j.has(F)?j.delete(F):j.add(F),n.value=j},v=(F,j)=>{f.value={text:F,x:j.right+8,y:j.top+j.height/2}},S=()=>{f.value=null},R=async F=>{if(!(!i.value||F.isDir)){p(),a.value=!0,s.value=null;try{const j=Oi(F.name),L=await ju(i.value,F.path,j!=="application/octet-stream"?j:void 0),$=URL.createObjectURL(L);c.value={path:F.path,name:F.name,size:F.size,blobUrl:$}}catch(j){console.error(j),s.value="条目读取失败"}finally{a.value=!1}}},I=T.computed(()=>c.value?[{name:c.value.name,url:c.value.blobUrl,type:Oi(c.value.name)}]:[]);return(F,j)=>r.value?(T.openBlock(),T.createElementBlock("div",a0,[...j[0]||(j[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):e.value||!o.value?(T.openBlock(),T.createElementBlock("div",l0,[T.createElementVNode("div",c0,[T.createElementVNode("p",u0,T.toDisplayString(e.value||T.unref(l)("zip.parse_failed")),1)])])):(T.openBlock(),T.createElementBlock(T.Fragment,{key:2},[T.createVNode(Qm,{"initial-left-width":280,"min-left-width":180,"max-left-width":560,"storage-key":"vfp-zip-split-left"},{left:T.withCtx(()=>[T.createElementVNode("div",f0,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(o.value.children||[],L=>{var $;return T.openBlock(),T.createBlock(o0,{key:L.path,node:L,depth:0,"selected-path":(($=c.value)==null?void 0:$.path)??null,expanded:n.value,onToggle:m,onSelect:R,onHover:v,onLeave:S},null,8,["node","selected-path","expanded"])}),128))])]),right:T.withCtx(()=>[T.createElementVNode("div",h0,[c.value?a.value?(T.openBlock(),T.createElementBlock("div",p0,[...j[1]||(j[1]=[T.createElementVNode("div",{class:"vfp-w-8 vfp-h-8 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):s.value?(T.openBlock(),T.createElementBlock("div",m0,T.toDisplayString(s.value),1)):(T.openBlock(),T.createElementBlock("div",g0,[T.createVNode(T.unref(t),{mode:"embed",files:I.value,"current-index":0,"zip-nesting-depth":C.nestingDepth+1},null,8,["files","zip-nesting-depth"])])):(T.openBlock(),T.createElementBlock("div",d0," 从左侧选择一个文件以预览 "))])]),_:1}),(T.openBlock(),T.createBlock(T.Teleport,{to:"body"},[f.value?(T.openBlock(),T.createElementBlock("div",{key:0,class:"vfp-zip-tip",style:T.normalizeStyle({left:f.value.x+"px",top:f.value.y+"px"})},T.toDisplayString(f.value.text),5)):T.createCommentVNode("",!0)]))],64))}}),v0={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},y0={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},w0={class:"vfp-text-white/70 vfp-text-center"},_0={class:"vfp-text-lg"},x0={key:2,class:"vfp-w-full vfp-h-full vfp-bg-white"},k0=["srcdoc","title"],S0={key:3,class:"vfp-w-full vfp-h-full vfp-overflow-auto",style:{background:"#1e1e1e"}},E0=["innerHTML"],C0=T.defineComponent({__name:"index",props:{url:{},fileName:{},wordWrap:{type:Boolean,default:!0},htmlPreview:{type:Boolean,default:!1}},setup(C){const w=C,{t}=Te(),h=T.ref(""),d=T.ref(""),l=T.ref(!0),i=T.ref(null),o=T.computed(()=>yu(w.fileName)),r=async()=>{l.value=!0,i.value=null;try{const e=await ki(w.url);if(h.value=e,o.value!=="text")try{d.value=await ra.codeToHtml(e,{lang:o.value,theme:"dark-plus"})}catch{d.value=""}else d.value=""}catch(e){console.error(e),i.value=t.value("text.load_failed")}finally{l.value=!1}};return T.watch(()=>w.url,r,{immediate:!0}),(e,n)=>l.value?(T.openBlock(),T.createElementBlock("div",v0,[...n[0]||(n[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):i.value?(T.openBlock(),T.createElementBlock("div",y0,[T.createElementVNode("div",w0,[T.createElementVNode("p",_0,T.toDisplayString(i.value),1)])])):C.htmlPreview&&o.value==="html"?(T.openBlock(),T.createElementBlock("div",x0,[T.createElementVNode("iframe",{srcdoc:h.value,sandbox:"allow-same-origin",class:"vfp-w-full vfp-h-full vfp-border-0",title:C.fileName},null,8,k0)])):(T.openBlock(),T.createElementBlock("div",S0,[d.value?(T.openBlock(),T.createElementBlock("div",{key:1,class:T.normalizeClass(["shiki-wrapper",{"no-wrap":!C.wordWrap}]),innerHTML:d.value},null,10,E0)):(T.openBlock(),T.createElementBlock("pre",{key:0,class:T.normalizeClass(["vfp-p-6 vfp-text-white/90 vfp-font-mono vfp-text-sm",C.wordWrap?"vfp-whitespace-pre-wrap vfp-break-words":"vfp-whitespace-pre"])},T.toDisplayString(h.value),3))]))}}),T0=Er(C0,[["__scopeId","data-v-82d3d091"]]),M0={class:"vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-8 vfp-gap-6"},A0={class:"vfp-w-32 vfp-h-32 vfp-rounded-full vfp-bg-white/10 vfp-flex vfp-items-center vfp-justify-center"},R0={class:"vfp-text-white vfp-text-center"},N0={class:"vfp-text-xl vfp-font-medium vfp-mb-2"},O0={class:"vfp-text-white/70"},Fa=T.defineComponent({__name:"index",props:{fileName:{},fileType:{}},emits:["download"],setup(C,{emit:w}){const{t}=Te(),h=w;return(d,l)=>(T.openBlock(),T.createElementBlock("div",M0,[T.createElementVNode("div",A0,[T.createVNode(T.unref(Ot.FileQuestion),{class:"vfp-w-16 vfp-h-16 vfp-text-white/70"})]),T.createElementVNode("div",R0,[T.createElementVNode("p",N0,T.toDisplayString(C.fileName),1),T.createElementVNode("p",O0,T.toDisplayString(T.unref(t)("common.unsupported_preview",{type:C.fileType})),1)]),T.createElementVNode("button",{class:"vfp-flex vfp-items-center vfp-gap-2 vfp-px-6 vfp-py-3 vfp-bg-white/10 hover:vfp-bg-white/20 vfp-backdrop-blur-sm vfp-rounded-lg vfp-text-white vfp-font-medium vfp-transition-all",onClick:l[0]||(l[0]=i=>h("download"))},[T.createVNode(T.unref(Ot.Download),{class:"vfp-w-5 vfp-h-5"}),T.createTextVNode(" "+T.toDisplayString(T.unref(t)("common.download")),1)])]))}}),j0=["tabindex"],I0={class:"vfp-flex-shrink-0 vfp-z-10 vfp-bg-black/50 vfp-backdrop-blur-md vfp-border-b vfp-border-white/10",style:{"padding-top":"env(safe-area-inset-top, 0px)"}},B0={class:"vfp-flex vfp-items-center vfp-justify-between vfp-px-3 md:vfp-px-5 vfp-py-1.5 md:vfp-py-2.5"},P0={class:"vfp-flex vfp-items-center vfp-flex-1 vfp-min-w-0 vfp-mr-2 md:vfp-mr-3"},F0={class:"vfp-text-white/90 vfp-font-medium vfp-text-xs md:vfp-text-sm vfp-truncate"},D0={class:"vfp-text-white/40 vfp-text-xs vfp-ml-2 vfp-flex-shrink-0"},L0={class:"vfp-flex vfp-items-center vfp-gap-1 md:vfp-hidden vfp-flex-shrink-0"},z0=["data-tooltip","disabled","onClick"],$0={class:"vfp-hidden md:vfp-flex vfp-items-center vfp-gap-1 vfp-flex-shrink-0"},V0=["data-tooltip","disabled","onClick"],U0=["data-tooltip","disabled","onClick"],H0={key:0,class:"vfp-flex vfp-items-center vfp-gap-1 vfp-px-3 vfp-pb-1.5 vfp-overflow-x-auto scrollbar-hide md:vfp-hidden"},W0={key:0,class:"vfp-w-px vfp-h-4 vfp-bg-white/10 vfp-mx-0.5"},q0=["data-tooltip","disabled","onClick"],X0=3,Z0=2e3,G0=T.defineComponent({__name:"FilePreviewContent",props:{files:{},currentIndex:{},customRenderers:{default:()=>[]},mode:{default:"modal"},zipNestingDepth:{default:0},locale:{default:void 0},messages:{default:void 0}},emits:["navigate","close"],setup(C,{emit:w}){const t=C,h=w;Ol(T.toRef(t,"locale"),T.toRef(t,"messages"));const{t:d}=Te(),l=T.ref(1),i=T.ref(0),o=T.ref(1),r=T.ref(1),e=T.ref(0),n=T.ref(0),c=T.ref(0),a=T.ref(null),s=T.ref(null),f=T.ref(!0);let p=null;const u=()=>{f.value=!0,p!==null&&clearTimeout(p),p=window.setTimeout(()=>{f.value=!1},Z0)},g=()=>u(),m=T.computed(()=>Al(t.files)),v=T.computed(()=>m.value[t.currentIndex]),S=T.computed(()=>v.value&&t.customRenderers.find(rt=>rt.test(v.value))||null),R=T.computed(()=>!S.value||!v.value?null:S.value.render(v.value)),I=T.computed(()=>v.value?na(v.value):"unsupported");T.watch(()=>t.currentIndex,()=>{l.value=1,i.value=0,o.value=1,r.value=1,e.value=0,n.value=0,f.value=!0,p!==null&&clearTimeout(p)}),T.watch([I,e,n],()=>{if(I.value==="image"&&e.value>0&&n.value>0&&a.value){const rt=a.value.clientWidth,it=a.value.clientHeight,J=rt/e.value,et=it/n.value,nt=Math.min(J,et);l.value=Math.max(.01,Math.min(10,nt))}}),T.watch(()=>m.value.length,rt=>{rt>1&&u()},{immediate:!0});const F=rt=>{rt.key==="Escape"&&t.mode==="modal"?h("close"):rt.key==="ArrowLeft"&&t.currentIndex>0?h("navigate",t.currentIndex-1):rt.key==="ArrowRight"&&t.currentIndex<m.value.length-1&&h("navigate",t.currentIndex+1)};T.onMounted(()=>{t.mode==="modal"?window.addEventListener("keydown",F):s.value&&s.value.addEventListener("keydown",F)}),T.onBeforeUnmount(()=>{p!==null&&clearTimeout(p),t.mode==="modal"?window.removeEventListener("keydown",F):s.value&&s.value.removeEventListener("keydown",F)});const j=()=>{l.value=Math.min(l.value+.1,10)},L=()=>{l.value=Math.max(l.value-.1,.01)},$=()=>{i.value=i.value+90},V=()=>{i.value=i.value-90},z=()=>{if(a.value&&e.value>0&&n.value>0){const rt=a.value.clientWidth,it=a.value.clientHeight,J=rt/e.value,et=it/n.value,nt=Math.min(J,et);l.value=Math.max(.01,Math.min(10,nt))}else l.value=1;i.value=0,c.value++},E=()=>{l.value=1,i.value=0,c.value++},A=rt=>{l.value=rt},k=()=>{l.value=1,i.value=0,c.value++},b=()=>{if(!v.value)return;const rt=document.createElement("a");rt.href=v.value.url,rt.download=v.value.name,rt.click()},y=T.computed(()=>t.mode==="modal"),_=T.ref(null),x=T.ref(0),M=T.ref(0),B=T.ref(!1),P=T.ref(null),H=T.ref(0),W=T.ref(0),K=T.ref(!1),D=(rt,it)=>{x.value=rt,M.value=it},X=(rt,it)=>{H.value=rt,W.value=it},O=T.ref(null),N=rt=>{O.value=rt},U=T.ref(!0),q=T.ref(!1),Y=T.computed(()=>{var rt;if(I.value==="image")return Ju({zoom:l.value,onZoomIn:j,onZoomOut:L,onFitToWidth:z,onOriginalSize:E,onRotateLeft:V,onRotateRight:$,onReset:k,t:d.value});if(I.value==="pdf")return Qu({zoom:l.value,onZoomIn:j,onZoomOut:L,onReset:k,t:d.value});if(I.value==="epub")return tf({epubRef:_.value,current:x.value,total:M.value,fullWidth:B.value,t:d.value});if(I.value==="mobi")return ef({mobiRef:P.value,current:H.value,total:W.value,fullWidth:K.value,t:d.value});if(I.value==="zip")return rf({stats:O.value,t:d.value});if(I.value==="text"){const it=((rt=v.value.name.split(".").pop())==null?void 0:rt.toLowerCase())||"";return nf({wordWrap:U.value,onToggleWrap:()=>{U.value=!U.value},isHtml:it==="html"||it==="htm",htmlPreview:q.value,onToggleHtmlPreview:()=>{q.value=!q.value},t:d.value})}return[]}),G=T.computed(()=>{const rt=[{items:[{type:"button",icon:Ot.Download,tooltip:d.value("common.download"),action:b}]}];return y.value&&rt.push({items:[{type:"button",icon:Ot.X,tooltip:d.value("common.close"),action:()=>h("close")}]}),rt}),Q=T.computed(()=>Y.value.length>0);return(rt,it)=>{var J;return T.openBlock(),T.createElementBlock("div",{ref_key:"rootRef",ref:s,tabindex:C.mode==="embed"?0:-1,class:"vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-flex-col vfp-overflow-hidden vfp-outline-none"},[T.createElementVNode("div",I0,[T.createElementVNode("div",B0,[T.createElementVNode("div",P0,[T.createElementVNode("h2",F0,T.toDisplayString((J=v.value)==null?void 0:J.name),1),T.createElementVNode("span",D0,T.toDisplayString(C.currentIndex+1)+"/"+T.toDisplayString(m.value.length),1)]),T.createElementVNode("div",L0,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(G.value,(et,nt)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"m-action-"+nt},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(et.items,(ot,at)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"m-action-"+nt+"-"+at},[ot.type==="button"?(T.openBlock(),T.createElementBlock("button",{key:0,class:"toolbar-btn","data-tooltip":ot.tooltip,disabled:ot.disabled,onClick:ot.action},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(ot.icon),{class:"vfp-w-4 vfp-h-4"}))],8,z0)):T.createCommentVNode("",!0)],64))),128))],64))),128))]),T.createElementVNode("div",$0,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(Y.value,(et,nt)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"d-tool-"+nt},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(et.items,(ot,at)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"d-tool-"+nt+"-"+at},[ot.type==="button"?(T.openBlock(),T.createElementBlock("button",{key:0,class:"toolbar-btn","data-tooltip":ot.tooltip,disabled:ot.disabled,onClick:ot.action},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(ot.icon),{class:"vfp-w-4 vfp-h-4"}))],8,V0)):ot.type==="text"?(T.openBlock(),T.createElementBlock("span",{key:1,class:"vfp-text-white/60 vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums",style:T.normalizeStyle({minWidth:ot.minWidth||"auto"})},T.toDisplayString(ot.content),5)):T.createCommentVNode("",!0)],64))),128)),it[11]||(it[11]=T.createElementVNode("div",{class:"vfp-w-px vfp-h-4 vfp-bg-white/10 vfp-mx-1"},null,-1))],64))),128)),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(G.value,(et,nt)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"d-action-"+nt},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(et.items,(ot,at)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"d-action-"+nt+"-"+at},[ot.type==="button"?(T.openBlock(),T.createElementBlock("button",{key:0,class:"toolbar-btn","data-tooltip":ot.tooltip,disabled:ot.disabled,onClick:ot.action},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(ot.icon),{class:"vfp-w-4 vfp-h-4"}))],8,U0)):T.createCommentVNode("",!0)],64))),128))],64))),128))])]),Q.value?(T.openBlock(),T.createElementBlock("div",H0,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(Y.value,(et,nt)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"m-tool-"+nt},[nt>0?(T.openBlock(),T.createElementBlock("div",W0)):T.createCommentVNode("",!0),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(et.items,(ot,at)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"m-tool-"+nt+"-"+at},[ot.type==="button"?(T.openBlock(),T.createElementBlock("button",{key:0,class:"toolbar-btn","data-tooltip":ot.tooltip,disabled:ot.disabled,onClick:ot.action},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(ot.icon),{class:"vfp-w-4 vfp-h-4"}))],8,q0)):ot.type==="text"?(T.openBlock(),T.createElementBlock("span",{key:1,class:"vfp-text-white/60 vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums",style:T.normalizeStyle({minWidth:ot.minWidth||"auto"})},T.toDisplayString(ot.content),5)):T.createCommentVNode("",!0)],64))),128))],64))),128))])):T.createCommentVNode("",!0)]),T.createElementVNode("div",{ref_key:"contentRef",ref:a,class:"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-overflow-auto",onMousemove:g},[v.value?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[R.value?(T.openBlock(),T.createBlock(T.resolveDynamicComponent(R.value),{key:0,file:v.value},null,8,["file"])):(T.openBlock(),T.createElementBlock(T.Fragment,{key:1},[I.value==="image"?(T.openBlock(),T.createBlock(uf,{key:0,url:v.value.url,zoom:l.value,rotation:i.value,"reset-key":c.value,"file-size":v.value.size,onZoomChange:A,onNaturalWidthChange:it[0]||(it[0]=et=>e.value=et),onNaturalHeightChange:it[1]||(it[1]=et=>n.value=et)},null,8,["url","zoom","rotation","reset-key","file-size"])):I.value==="pdf"?(T.openBlock(),T.createBlock(gf,{key:1,url:v.value.url,zoom:l.value,"current-page":o.value,onPageChange:it[2]||(it[2]=et=>o.value=et),onTotalPagesChange:it[3]||(it[3]=et=>r.value=et),onPageWidthChange:it[4]||(it[4]=et=>e.value=et)},null,8,["url","zoom","current-page"])):I.value==="docx"?(T.openBlock(),T.createBlock(Ef,{key:2,url:v.value.url},null,8,["url"])):I.value==="xlsx"?(T.openBlock(),T.createBlock(Lf,{key:3,url:v.value.url},null,8,["url"])):I.value==="pptx"?(T.openBlock(),T.createBlock(Kf,{key:4,url:v.value.url},null,8,["url"])):I.value==="msg"?(T.openBlock(),T.createBlock(sd,{key:5,url:v.value.url},null,8,["url"])):I.value==="epub"?(T.openBlock(),T.createBlock(gd,{key:6,ref_key:"epubRef",ref:_,url:v.value.url,onChapterChange:D,onFullWidthChange:it[5]||(it[5]=et=>B.value=et)},null,8,["url"])):I.value==="mobi"?(T.openBlock(),T.createBlock(np,{key:7,ref_key:"mobiRef",ref:P,url:v.value.url,onChapterChange:X,onFullWidthChange:it[6]||(it[6]=et=>K.value=et)},null,8,["url"])):I.value==="video"?(T.openBlock(),T.createBlock(dp,{key:8,url:v.value.url},null,8,["url"])):I.value==="audio"?(T.openBlock(),T.createBlock(zp,{key:9,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="markdown"?(T.openBlock(),T.createBlock(Gp,{key:10,url:v.value.url},null,8,["url"])):I.value==="json"?(T.openBlock(),T.createBlock(im,{key:11,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="csv"?(T.openBlock(),T.createBlock(vm,{key:12,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="xml"?(T.openBlock(),T.createBlock(Nm,{key:13,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="subtitle"?(T.openBlock(),T.createBlock(Km,{key:14,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):T.createCommentVNode("",!0),I.value==="zip"&&t.zipNestingDepth>=X0?(T.openBlock(),T.createBlock(Fa,{key:15,"file-name":v.value.name,"file-type":v.value.type,onDownload:b},null,8,["file-name","file-type"])):I.value==="zip"?(T.openBlock(),T.createBlock(b0,{key:16,url:v.value.url,"nesting-depth":t.zipNestingDepth,onStatsChange:N},null,8,["url","nesting-depth"])):I.value==="text"?(T.openBlock(),T.createBlock(T0,{key:17,url:v.value.url,"file-name":v.value.name,"word-wrap":U.value,"html-preview":q.value},null,8,["url","file-name","word-wrap","html-preview"])):(T.openBlock(),T.createBlock(Fa,{key:18,"file-name":v.value.name,"file-type":v.value.type,onDownload:b},null,8,["file-name","file-type"]))],64))],64)):T.createCommentVNode("",!0)],544),m.value.length>1?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[C.currentIndex>0?(T.openBlock(),T.createElementBlock("button",{key:0,style:T.normalizeStyle({opacity:f.value?1:0,transform:f.value?"translateY(-50%)":"translateY(-50%) translateX(-20px)",pointerEvents:f.value?"auto":"none",transition:"opacity 0.2s, transform 0.2s"}),class:"vfp-absolute vfp-z-20 vfp-left-2 md:vfp-left-4 vfp-top-1/2 vfp-w-10 vfp-h-10 md:vfp-w-12 md:vfp-h-12 vfp-rounded-full vfp-bg-black/40 vfp-backdrop-blur-xl vfp-border vfp-border-white/10 vfp-flex vfp-items-center vfp-justify-center vfp-text-white hover:vfp-bg-black/60 vfp-transition-colors vfp-shadow-2xl",onClick:it[7]||(it[7]=et=>h("navigate",C.currentIndex-1)),onMouseenter:it[8]||(it[8]=et=>f.value=!0)},[T.createVNode(T.unref(Ot.ChevronLeft),{class:"vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6"})],36)):T.createCommentVNode("",!0),C.currentIndex<m.value.length-1?(T.openBlock(),T.createElementBlock("button",{key:1,style:T.normalizeStyle({opacity:f.value?1:0,transform:f.value?"translateY(-50%)":"translateY(-50%) translateX(20px)",pointerEvents:f.value?"auto":"none",transition:"opacity 0.2s, transform 0.2s"}),class:"vfp-absolute vfp-z-20 vfp-right-2 md:vfp-right-4 vfp-top-1/2 vfp-w-10 vfp-h-10 md:vfp-w-12 md:vfp-h-12 vfp-rounded-full vfp-bg-black/40 vfp-backdrop-blur-xl vfp-border vfp-border-white/10 vfp-flex vfp-items-center vfp-justify-center vfp-text-white hover:vfp-bg-black/60 vfp-transition-colors vfp-shadow-2xl",onClick:it[9]||(it[9]=et=>h("navigate",C.currentIndex+1)),onMouseenter:it[10]||(it[10]=et=>f.value=!0)},[T.createVNode(T.unref(Ot.ChevronRight),{class:"vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6"})],36)):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0)],8,j0)}}}),uo=Er(G0,[["__scopeId","data-v-c29255ea"]]),K0=Object.freeze(Object.defineProperty({__proto__:null,default:uo},Symbol.toStringTag,{value:"Module"}));function Y0(C){let w="",t="",h=!1;const d=()=>{if(h||typeof document>"u")return;w=document.body.style.overflow,t=document.body.style.paddingRight;const i=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",i>0&&(document.body.style.paddingRight=`${i}px`),h=!0},l=()=>{!h||typeof document>"u"||(document.body.style.overflow=w,document.body.style.paddingRight=t,h=!1)};return T.onMounted(()=>{C()&&d()}),T.onUnmounted(()=>{l()}),{lock:d,unlock:l}}const J0={key:0,class:"vfp-root"},Q0=T.defineComponent({__name:"FilePreviewModal",props:{files:{},currentIndex:{},isOpen:{type:Boolean},customRenderers:{default:()=>[]},locale:{default:void 0},messages:{default:void 0}},emits:["close","navigate"],setup(C,{emit:w}){const t=C,h=w,{lock:d,unlock:l}=Y0(()=>t.isOpen);T.watch(()=>t.isOpen,e=>{e?d():l()});const i=()=>h("close"),o=e=>e.stopPropagation(),r=e=>e.stopPropagation();return(e,n)=>(T.openBlock(),T.createBlock(T.Teleport,{to:"body"},[T.createVNode(T.Transition,{name:"vfp-fade"},{default:T.withCtx(()=>[C.isOpen?(T.openBlock(),T.createElementBlock("div",J0,[T.createElementVNode("div",{class:"vfp-fixed vfp-inset-0 vfp-z-[9999] vfp-flex vfp-items-center vfp-justify-center vfp-bg-black/80 vfp-backdrop-blur-md vfp-overflow-hidden",onClick:i,onWheel:r},[T.createElementVNode("div",{class:"vfp-relative vfp-w-full vfp-h-full",onClick:o},[T.createVNode(uo,{mode:"modal",files:C.files,"current-index":C.currentIndex,"custom-renderers":C.customRenderers,locale:C.locale,messages:C.messages,onClose:n[0]||(n[0]=c=>h("close")),onNavigate:n[1]||(n[1]=c=>h("navigate",c))},null,8,["files","current-index","custom-renderers","locale","messages"])])],32)])):T.createCommentVNode("",!0)]),_:1})]))}}),t1={class:"vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-black/80"},e1=T.defineComponent({__name:"FilePreviewEmbed",props:{files:{},currentIndex:{default:0},customRenderers:{default:()=>[]},width:{default:"100%"},height:{default:"100%"},locale:{default:void 0},messages:{default:void 0}},emits:["navigate"],setup(C,{emit:w}){const t=C,h=w,d={width:typeof t.width=="number"?`${t.width}px`:t.width,height:typeof t.height=="number"?`${t.height}px`:t.height};return(l,i)=>(T.openBlock(),T.createElementBlock("div",{class:"vfp-root",style:d},[T.createElementVNode("div",t1,[T.createVNode(uo,{mode:"embed",files:C.files,"current-index":C.currentIndex,"custom-renderers":C.customRenderers,locale:C.locale,messages:C.messages,onNavigate:i[0]||(i[0]=o=>h("navigate",o))},null,8,["files","current-index","custom-renderers","locale","messages"])])]))}}),r1=bu.version,Qe=-2,_e=-3,Zr=-5,er=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],n1=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],i1=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],s1=[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],o1=[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,112,112],a1=[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],l1=[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],Ss=15;function Bo(){let C,w,t,h,d,l;function i(r,e,n,c,a,s,f,p,u,g,m){let v,S,R,I,F,j,L,$,V,z,E,A,k,b,y;z=0,F=n;do t[r[e+z]]++,z++,F--;while(F!==0);if(t[0]==n)return f[0]=-1,p[0]=0,0;for($=p[0],j=1;j<=Ss&&t[j]===0;j++);for(L=j,$<j&&($=j),F=Ss;F!==0&&t[F]===0;F--);for(R=F,$>F&&($=F),p[0]=$,b=1<<j;j<F;j++,b<<=1)if((b-=t[j])<0)return _e;if((b-=t[F])<0)return _e;for(t[F]+=b,l[1]=j=0,z=1,k=2;--F!=0;)l[k]=j+=t[z],k++,z++;F=0,z=0;do(j=r[e+z])!==0&&(m[l[j]++]=F),z++;while(++F<n);for(n=l[R],l[0]=F=0,z=0,I=-1,A=-$,d[0]=0,E=0,y=0;L<=R;L++)for(v=t[L];v--!=0;){for(;L>A+$;){if(I++,A+=$,y=R-A,y=y>$?$:y,(S=1<<(j=L-A))>v+1&&(S-=v+1,k=L,j<y))for(;++j<y&&!((S<<=1)<=t[++k]);)S-=t[k];if(y=1<<j,g[0]+y>1440)return _e;d[I]=E=g[0],g[0]+=y,I!==0?(l[I]=F,h[0]=j,h[1]=$,j=F>>>A-$,h[2]=E-d[I-1]-j,u.set(h,3*(d[I-1]+j))):f[0]=E}for(h[1]=L-A,z>=n?h[0]=192:m[z]<c?(h[0]=m[z]<256?0:96,h[2]=m[z++]):(h[0]=s[m[z]-c]+16+64,h[2]=a[m[z++]-c]),S=1<<L-A,j=F>>>A;j<y;j+=S)u.set(h,3*(E+j));for(j=1<<L-1;F&j;j>>>=1)F^=j;for(F^=j,V=(1<<A)-1;(F&V)!=l[I];)I--,A-=$,V=(1<<A)-1}return b!==0&&R!=1?Zr:0}function o(r){let e;for(C||(C=[],w=[],t=new Int32Array(16),h=[],d=new Int32Array(Ss),l=new Int32Array(16)),w.length<r&&(w=[]),e=0;e<r;e++)w[e]=0;for(e=0;e<16;e++)t[e]=0;for(e=0;e<3;e++)h[e]=0;d.set(t.subarray(0,Ss),0),l.set(t.subarray(0,16),0)}this.inflate_trees_bits=function(r,e,n,c,a){let s;return o(19),C[0]=0,s=i(r,0,19,19,null,null,n,e,c,C,w),s==_e?a.msg="oversubscribed dynamic bit lengths tree":s!=Zr&&e[0]!==0||(a.msg="incomplete dynamic bit lengths tree",s=_e),s},this.inflate_trees_dynamic=function(r,e,n,c,a,s,f,p,u){let g;return o(288),C[0]=0,g=i(n,0,r,257,s1,o1,s,c,p,C,w),g!=0||c[0]===0?(g==_e?u.msg="oversubscribed literal/length tree":g!=-4&&(u.msg="incomplete literal/length tree",g=_e),g):(o(288),g=i(n,r,e,0,a1,l1,f,a,p,C,w),g!=0||a[0]===0&&r>257?(g==_e?u.msg="oversubscribed distance tree":g==Zr?(u.msg="incomplete distance tree",g=_e):g!=-4&&(u.msg="empty distance tree with lengths",g=_e),g):0)}}Bo.inflate_trees_fixed=function(C,w,t,h){return C[0]=9,w[0]=5,t[0]=n1,h[0]=i1,0};function c1(){const C=this;let w,t,h,d,l=0,i=0,o=0,r=0,e=0,n=0,c=0,a=0,s=0,f=0;function p(u,g,m,v,S,R,I,F){let j,L,$,V,z,E,A,k,b,y,_,x,M,B,P,H;A=F.next_in_index,k=F.avail_in,z=I.bitb,E=I.bitk,b=I.write,y=b<I.read?I.read-b-1:I.end-b,_=er[u],x=er[g];do{for(;E<20;)k--,z|=(255&F.read_byte(A++))<<E,E+=8;if(j=z&_,L=m,$=v,H=3*($+j),(V=L[H])!==0)for(;;){if(z>>=L[H+1],E-=L[H+1],16&V){for(V&=15,M=L[H+2]+(z&er[V]),z>>=V,E-=V;E<15;)k--,z|=(255&F.read_byte(A++))<<E,E+=8;for(j=z&x,L=S,$=R,H=3*($+j),V=L[H];;){if(z>>=L[H+1],E-=L[H+1],16&V){for(V&=15;E<V;)k--,z|=(255&F.read_byte(A++))<<E,E+=8;if(B=L[H+2]+(z&er[V]),z>>=V,E-=V,y-=M,b>=B)P=b-B,b-P>0&&2>b-P?(I.win[b++]=I.win[P++],I.win[b++]=I.win[P++],M-=2):(I.win.set(I.win.subarray(P,P+2),b),b+=2,P+=2,M-=2);else{P=b-B;do P+=I.end;while(P<0);if(V=I.end-P,M>V){if(M-=V,b-P>0&&V>b-P)do I.win[b++]=I.win[P++];while(--V!=0);else I.win.set(I.win.subarray(P,P+V),b),b+=V,P+=V,V=0;P=0}}if(b-P>0&&M>b-P)do I.win[b++]=I.win[P++];while(--M!=0);else I.win.set(I.win.subarray(P,P+M),b),b+=M,P+=M,M=0;break}if(64&V)return F.msg="invalid distance code",M=F.avail_in-k,M=E>>3<M?E>>3:M,k+=M,A-=M,E-=M<<3,I.bitb=z,I.bitk=E,F.avail_in=k,F.total_in+=A-F.next_in_index,F.next_in_index=A,I.write=b,_e;j+=L[H+2],j+=z&er[V],H=3*($+j),V=L[H]}break}if(64&V)return 32&V?(M=F.avail_in-k,M=E>>3<M?E>>3:M,k+=M,A-=M,E-=M<<3,I.bitb=z,I.bitk=E,F.avail_in=k,F.total_in+=A-F.next_in_index,F.next_in_index=A,I.write=b,1):(F.msg="invalid literal/length code",M=F.avail_in-k,M=E>>3<M?E>>3:M,k+=M,A-=M,E-=M<<3,I.bitb=z,I.bitk=E,F.avail_in=k,F.total_in+=A-F.next_in_index,F.next_in_index=A,I.write=b,_e);if(j+=L[H+2],j+=z&er[V],H=3*($+j),(V=L[H])===0){z>>=L[H+1],E-=L[H+1],I.win[b++]=L[H+2],y--;break}}else z>>=L[H+1],E-=L[H+1],I.win[b++]=L[H+2],y--}while(y>=258&&k>=10);return M=F.avail_in-k,M=E>>3<M?E>>3:M,k+=M,A-=M,E-=M<<3,I.bitb=z,I.bitk=E,F.avail_in=k,F.total_in+=A-F.next_in_index,F.next_in_index=A,I.write=b,0}C.init=function(u,g,m,v,S,R){w=0,c=u,a=g,h=m,s=v,d=S,f=R,t=null},C.proc=function(u,g,m){let v,S,R,I,F,j,L,$=0,V=0,z=0;for(z=g.next_in_index,I=g.avail_in,$=u.bitb,V=u.bitk,F=u.write,j=F<u.read?u.read-F-1:u.end-F;;)switch(w){case 0:if(j>=258&&I>=10&&(u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,m=p(c,a,h,s,d,f,u,g),z=g.next_in_index,I=g.avail_in,$=u.bitb,V=u.bitk,F=u.write,j=F<u.read?u.read-F-1:u.end-F,m!=0)){w=m==1?7:9;break}o=c,t=h,i=s,w=1;case 1:for(v=o;V<v;){if(I===0)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,I--,$|=(255&g.read_byte(z++))<<V,V+=8}if(S=3*(i+($&er[v])),$>>>=t[S+1],V-=t[S+1],R=t[S],R===0){r=t[S+2],w=6;break}if(16&R){e=15&R,l=t[S+2],w=2;break}if(!(64&R)){o=R,i=S/3+t[S+2];break}if(32&R){w=7;break}return w=9,g.msg="invalid literal/length code",m=_e,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);case 2:for(v=e;V<v;){if(I===0)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,I--,$|=(255&g.read_byte(z++))<<V,V+=8}l+=$&er[v],$>>=v,V-=v,o=a,t=d,i=f,w=3;case 3:for(v=o;V<v;){if(I===0)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,I--,$|=(255&g.read_byte(z++))<<V,V+=8}if(S=3*(i+($&er[v])),$>>=t[S+1],V-=t[S+1],R=t[S],16&R){e=15&R,n=t[S+2],w=4;break}if(!(64&R)){o=R,i=S/3+t[S+2];break}return w=9,g.msg="invalid distance code",m=_e,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);case 4:for(v=e;V<v;){if(I===0)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,I--,$|=(255&g.read_byte(z++))<<V,V+=8}n+=$&er[v],$>>=v,V-=v,w=5;case 5:for(L=F-n;L<0;)L+=u.end;for(;l!==0;){if(j===0&&(F==u.end&&u.read!==0&&(F=0,j=F<u.read?u.read-F-1:u.end-F),j===0&&(u.write=F,m=u.inflate_flush(g,m),F=u.write,j=F<u.read?u.read-F-1:u.end-F,F==u.end&&u.read!==0&&(F=0,j=F<u.read?u.read-F-1:u.end-F),j===0)))return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);u.win[F++]=u.win[L++],j--,L==u.end&&(L=0),l--}w=0;break;case 6:if(j===0&&(F==u.end&&u.read!==0&&(F=0,j=F<u.read?u.read-F-1:u.end-F),j===0&&(u.write=F,m=u.inflate_flush(g,m),F=u.write,j=F<u.read?u.read-F-1:u.end-F,F==u.end&&u.read!==0&&(F=0,j=F<u.read?u.read-F-1:u.end-F),j===0)))return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,u.win[F++]=r,j--,w=0;break;case 7:if(V>7&&(V-=8,I++,z--),u.write=F,m=u.inflate_flush(g,m),F=u.write,j=F<u.read?u.read-F-1:u.end-F,u.read!=u.write)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);w=8;case 8:return m=1,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);case 9:return m=_e,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);default:return m=Qe,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m)}},C.free=function(){}}const Da=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function u1(C,w){const t=this;let h,d=0,l=0,i=0,o=0;const r=[0],e=[0],n=new c1;let c=0,a=new Int32Array(4320);const s=new Bo;t.bitk=0,t.bitb=0,t.win=new Uint8Array(w),t.end=w,t.read=0,t.write=0,t.reset=function(f,p){p&&(p[0]=0),d==6&&n.free(f),d=0,t.bitk=0,t.bitb=0,t.read=t.write=0},t.reset(C,null),t.inflate_flush=function(f,p){let u,g,m;return g=f.next_out_index,m=t.read,u=(m<=t.write?t.write:t.end)-m,u>f.avail_out&&(u=f.avail_out),u!==0&&p==Zr&&(p=0),f.avail_out-=u,f.total_out+=u,f.next_out.set(t.win.subarray(m,m+u),g),g+=u,m+=u,m==t.end&&(m=0,t.write==t.end&&(t.write=0),u=t.write-m,u>f.avail_out&&(u=f.avail_out),u!==0&&p==Zr&&(p=0),f.avail_out-=u,f.total_out+=u,f.next_out.set(t.win.subarray(m,m+u),g),g+=u,m+=u),f.next_out_index=g,t.read=m,p},t.proc=function(f,p){let u,g,m,v,S,R,I,F;for(v=f.next_in_index,S=f.avail_in,g=t.bitb,m=t.bitk,R=t.write,I=R<t.read?t.read-R-1:t.end-R;;){let j,L,$,V,z,E,A,k;switch(d){case 0:for(;m<3;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}switch(u=7&g,c=1&u,u>>>1){case 0:g>>>=3,m-=3,u=7&m,g>>>=u,m-=u,d=1;break;case 1:j=[],L=[],$=[[]],V=[[]],Bo.inflate_trees_fixed(j,L,$,V),n.init(j[0],L[0],$[0],0,V[0],0),g>>>=3,m-=3,d=6;break;case 2:g>>>=3,m-=3,d=3;break;case 3:return g>>>=3,m-=3,d=9,f.msg="invalid block type",p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p)}break;case 1:for(;m<32;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}if((~g>>>16&65535)!=(65535&g))return d=9,f.msg="invalid stored block lengths",p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);l=65535&g,g=m=0,d=l!==0?2:c!==0?7:0;break;case 2:if(S===0||I===0&&(R==t.end&&t.read!==0&&(R=0,I=R<t.read?t.read-R-1:t.end-R),I===0&&(t.write=R,p=t.inflate_flush(f,p),R=t.write,I=R<t.read?t.read-R-1:t.end-R,R==t.end&&t.read!==0&&(R=0,I=R<t.read?t.read-R-1:t.end-R),I===0)))return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);if(p=0,u=l,u>S&&(u=S),u>I&&(u=I),t.win.set(f.read_buf(v,u),R),v+=u,S-=u,R+=u,I-=u,(l-=u)!=0)break;d=c!==0?7:0;break;case 3:for(;m<14;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}if(i=u=16383&g,(31&u)>29||(u>>5&31)>29)return d=9,f.msg="too many length or distance symbols",p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);if(u=258+(31&u)+(u>>5&31),!h||h.length<u)h=[];else for(F=0;F<u;F++)h[F]=0;g>>>=14,m-=14,o=0,d=4;case 4:for(;o<4+(i>>>10);){for(;m<3;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}h[Da[o++]]=7&g,g>>>=3,m-=3}for(;o<19;)h[Da[o++]]=0;if(r[0]=7,u=s.inflate_trees_bits(h,r,e,a,f),u!=0)return(p=u)==_e&&(h=null,d=9),t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);o=0,d=5;case 5:for(;u=i,!(o>=258+(31&u)+(u>>5&31));){let b,y;for(u=r[0];m<u;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}if(u=a[3*(e[0]+(g&er[u]))+1],y=a[3*(e[0]+(g&er[u]))+2],y<16)g>>>=u,m-=u,h[o++]=y;else{for(F=y==18?7:y-14,b=y==18?11:3;m<u+F;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}if(g>>>=u,m-=u,b+=g&er[F],g>>>=F,m-=F,F=o,u=i,F+b>258+(31&u)+(u>>5&31)||y==16&&F<1)return h=null,d=9,f.msg="invalid bit length repeat",p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);y=y==16?h[F-1]:0;do h[F++]=y;while(--b!=0);o=F}}if(e[0]=-1,z=[],E=[],A=[],k=[],z[0]=9,E[0]=6,u=i,u=s.inflate_trees_dynamic(257+(31&u),1+(u>>5&31),h,z,E,A,k,a,f),u!=0)return u==_e&&(h=null,d=9),p=u,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);n.init(z[0],E[0],a,A[0],a,k[0]),d=6;case 6:if(t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,(p=n.proc(t,f,p))!=1)return t.inflate_flush(f,p);if(p=0,n.free(f),v=f.next_in_index,S=f.avail_in,g=t.bitb,m=t.bitk,R=t.write,I=R<t.read?t.read-R-1:t.end-R,c===0){d=0;break}d=7;case 7:if(t.write=R,p=t.inflate_flush(f,p),R=t.write,I=R<t.read?t.read-R-1:t.end-R,t.read!=t.write)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);d=8;case 8:return p=1,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);case 9:return p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);default:return p=Qe,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p)}}},t.free=function(f){t.reset(f,null),t.win=null,a=null},t.set_dictionary=function(f,p,u){t.win.set(f.subarray(p,p+u),0),t.read=t.write=u},t.sync_point=function(){return d==1?1:0}}const Qr=13,f1=[0,0,255,255];function h1(){const C=this;function w(t){return t&&t.istate?(t.total_in=t.total_out=0,t.msg=null,t.istate.mode=7,t.istate.blocks.reset(t,null),0):Qe}C.mode=0,C.method=0,C.was=[0],C.need=0,C.marker=0,C.wbits=0,C.inflateEnd=function(t){return C.blocks&&C.blocks.free(t),C.blocks=null,0},C.inflateInit=function(t,h){return t.msg=null,C.blocks=null,h<8||h>15?(C.inflateEnd(t),Qe):(C.wbits=h,t.istate.blocks=new u1(t,1<<h),w(t),0)},C.inflate=function(t,h){let d,l;if(!t||!t.istate||!t.next_in)return Qe;const i=t.istate;for(h=h==4?Zr:0,d=Zr;;)switch(i.mode){case 0:if(t.avail_in===0)return d;if(d=h,t.avail_in--,t.total_in++,(15&(i.method=t.read_byte(t.next_in_index++)))!=8){i.mode=Qr,t.msg="unknown compression method",i.marker=5;break}if(8+(i.method>>4)>i.wbits){i.mode=Qr,t.msg="invalid win size",i.marker=5;break}i.mode=1;case 1:if(t.avail_in===0)return d;if(d=h,t.avail_in--,t.total_in++,l=255&t.read_byte(t.next_in_index++),((i.method<<8)+l)%31!=0){i.mode=Qr,t.msg="incorrect header check",i.marker=5;break}if(!(32&l)){i.mode=7;break}i.mode=2;case 2:if(t.avail_in===0)return d;d=h,t.avail_in--,t.total_in++,i.need=(255&t.read_byte(t.next_in_index++))<<24&4278190080,i.mode=3;case 3:if(t.avail_in===0)return d;d=h,t.avail_in--,t.total_in++,i.need+=(255&t.read_byte(t.next_in_index++))<<16&16711680,i.mode=4;case 4:if(t.avail_in===0)return d;d=h,t.avail_in--,t.total_in++,i.need+=(255&t.read_byte(t.next_in_index++))<<8&65280,i.mode=5;case 5:return t.avail_in===0?d:(d=h,t.avail_in--,t.total_in++,i.need+=255&t.read_byte(t.next_in_index++),i.mode=6,2);case 6:return i.mode=Qr,t.msg="need dictionary",i.marker=0,Qe;case 7:if(d=i.blocks.proc(t,d),d==_e){i.mode=Qr,i.marker=0;break}if(d==0&&(d=h),d!=1)return d;d=h,i.blocks.reset(t,i.was),i.mode=12;case 12:return t.avail_in=0,1;case Qr:return _e;default:return Qe}},C.inflateSetDictionary=function(t,h,d){let l=0,i=d;if(!t||!t.istate||t.istate.mode!=6)return Qe;const o=t.istate;return i>=1<<o.wbits&&(i=(1<<o.wbits)-1,l=d-i),o.blocks.set_dictionary(h,l,i),o.mode=7,0},C.inflateSync=function(t){let h,d,l,i,o;if(!t||!t.istate)return Qe;const r=t.istate;if(r.mode!=Qr&&(r.mode=Qr,r.marker=0),(h=t.avail_in)===0)return Zr;for(d=t.next_in_index,l=r.marker;h!==0&&l<4;)t.read_byte(d)==f1[l]?l++:l=t.read_byte(d)!==0?0:4-l,d++,h--;return t.total_in+=d-t.next_in_index,t.next_in_index=d,t.avail_in=h,r.marker=l,l!=4?_e:(i=t.total_in,o=t.total_out,w(t),t.total_in=i,t.total_out=o,r.mode=7,0)},C.inflateSyncPoint=function(t){return t&&t.istate&&t.istate.blocks?t.istate.blocks.sync_point():Qe}}function Kl(){}Kl.prototype={inflateInit(C){const w=this;return w.istate=new h1,C||(C=15),w.istate.inflateInit(w,C)},inflate(C){const w=this;return w.istate?w.istate.inflate(w,C):Qe},inflateEnd(){const C=this;if(!C.istate)return Qe;const w=C.istate.inflateEnd(C);return C.istate=null,w},inflateSync(){const C=this;return C.istate?C.istate.inflateSync(C):Qe},inflateSetDictionary(C,w){const t=this;return t.istate?t.istate.inflateSetDictionary(t,C,w):Qe},read_byte(C){return this.next_in[C]},read_buf(C,w){return this.next_in.subarray(C,C+w)}};const Un=4294967295,Nn=65535,La=33639248,za=101075792,Gn=22,Fe=void 0,wn="undefined",us="function";let $a=class{constructor(w){return class extends TransformStream{constructor(t,h){const d=new w(h);super({transform(l,i){i.enqueue(d.append(l))},flush(l){const i=d.flush();i&&l.enqueue(i)}})}}}},Yl=2;try{typeof navigator!=wn&&navigator.hardwareConcurrency&&(Yl=navigator.hardwareConcurrency)}catch{}const d1={chunkSize:524288,maxWorkers:Yl,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Fe,CompressionStreamNative:typeof CompressionStream!=wn&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=wn&&DecompressionStream},nn=Object.assign({},d1);function Jl(C){const{baseURL:w,chunkSize:t,maxWorkers:h,terminateWorkerTimeout:d,useCompressionStream:l,useWebWorkers:i,Deflate:o,Inflate:r,CompressionStream:e,DecompressionStream:n,workerScripts:c}=C;if(tn("baseURL",w),tn("chunkSize",t),tn("maxWorkers",h),tn("terminateWorkerTimeout",d),tn("useCompressionStream",l),tn("useWebWorkers",i),o&&(nn.CompressionStream=new $a(o)),r&&(nn.DecompressionStream=new $a(r)),tn("CompressionStream",e),tn("DecompressionStream",n),c!==Fe){const{deflate:a,inflate:s}=c;if((a||s)&&(nn.workerScripts||(nn.workerScripts={})),a){if(!Array.isArray(a))throw new Error("workerScripts.deflate must be an array");nn.workerScripts.deflate=a}if(s){if(!Array.isArray(s))throw new Error("workerScripts.inflate must be an array");nn.workerScripts.inflate=s}}}function tn(C,w){w!==Fe&&(nn[C]=w)}const Ql=[];for(let C=0;C<256;C++){let w=C;for(let t=0;t<8;t++)1&w?w=w>>>1^3988292384:w>>>=1;Ql[C]=w}class Zs{constructor(w){this.crc=w||-1}append(w){let t=0|this.crc;for(let h=0,d=0|w.length;h<d;h++)t=t>>>8^Ql[255&(t^w[h])];this.crc=t}get(){return~this.crc}}class tc extends TransformStream{constructor(){let w;const t=new Zs;super({transform(h,d){t.append(h),d.enqueue(h)},flush(){const h=new Uint8Array(4);new DataView(h.buffer).setUint32(0,t.get()),w.value=h}}),w=this}}const qe={concat(C,w){if(C.length===0||w.length===0)return C.concat(w);const t=C[C.length-1],h=qe.getPartial(t);return h===32?C.concat(w):qe._shiftRight(w,h,0|t,C.slice(0,C.length-1))},bitLength(C){const w=C.length;if(w===0)return 0;const t=C[w-1];return 32*(w-1)+qe.getPartial(t)},clamp(C,w){if(32*C.length<w)return C;const t=(C=C.slice(0,Math.ceil(w/32))).length;return w&=31,t>0&&w&&(C[t-1]=qe.partial(w,C[t-1]&2147483648>>w-1,1)),C},partial:(C,w,t)=>C===32?w:(t?0|w:w<<32-C)+1099511627776*C,getPartial:C=>Math.round(C/1099511627776)||32,_shiftRight(C,w,t,h){for(h===void 0&&(h=[]);w>=32;w-=32)h.push(t),t=0;if(w===0)return h.concat(C);for(let i=0;i<C.length;i++)h.push(t|C[i]>>>w),t=C[i]<<32-w;const d=C.length?C[C.length-1]:0,l=qe.getPartial(d);return h.push(qe.partial(w+l&31,w+l>32?t:h.pop(),1)),h}},Gs={bytes:{fromBits(C){const w=qe.bitLength(C)/8,t=new Uint8Array(w);let h;for(let d=0;d<w;d++)3&d||(h=C[d/4]),t[d]=h>>>24,h<<=8;return t},toBits(C){const w=[];let t,h=0;for(t=0;t<C.length;t++)h=h<<8|C[t],3&~t||(w.push(h),h=0);return 3&t&&w.push(qe.partial(8*(3&t),h)),w}}},p1={sha1:class{constructor(C){const w=this;w.blockSize=512,w._init=[1732584193,4023233417,2562383102,271733878,3285377520],w._key=[1518500249,1859775393,2400959708,3395469782],C?(w._h=C._h.slice(0),w._buffer=C._buffer.slice(0),w._length=C._length):w.reset()}reset(){const C=this;return C._h=C._init.slice(0),C._buffer=[],C._length=0,C}update(C){const w=this;typeof C=="string"&&(C=Gs.utf8String.toBits(C));const t=w._buffer=qe.concat(w._buffer,C),h=w._length,d=w._length=h+qe.bitLength(C);if(d>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const l=new Uint32Array(t);let i=0;for(let o=w.blockSize+h-(w.blockSize+h&w.blockSize-1);o<=d;o+=w.blockSize)w._block(l.subarray(16*i,16*(i+1))),i+=1;return t.splice(0,16*i),w}finalize(){const C=this;let w=C._buffer;const t=C._h;w=qe.concat(w,[qe.partial(1,1)]);for(let h=w.length+2;15&h;h++)w.push(0);for(w.push(Math.floor(C._length/4294967296)),w.push(0|C._length);w.length;)C._block(w.splice(0,16));return C.reset(),t}_f(C,w,t,h){return C<=19?w&t|~w&h:C<=39?w^t^h:C<=59?w&t|w&h|t&h:C<=79?w^t^h:void 0}_S(C,w){return w<<C|w>>>32-C}_block(C){const w=this,t=w._h,h=Array(80);for(let e=0;e<16;e++)h[e]=C[e];let d=t[0],l=t[1],i=t[2],o=t[3],r=t[4];for(let e=0;e<=79;e++){e>=16&&(h[e]=w._S(1,h[e-3]^h[e-8]^h[e-14]^h[e-16]));const n=w._S(5,d)+w._f(e,l,i,o)+r+h[e]+w._key[Math.floor(e/20)]|0;r=o,o=i,i=w._S(30,l),l=d,d=n}t[0]=t[0]+d|0,t[1]=t[1]+l|0,t[2]=t[2]+i|0,t[3]=t[3]+o|0,t[4]=t[4]+r|0}}},m1={aes:class{constructor(C){const w=this;w._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],w._tables[0][0][0]||w._precompute();const t=w._tables[0][4],h=w._tables[1],d=C.length;let l,i,o,r=1;if(d!==4&&d!==6&&d!==8)throw new Error("invalid aes key size");for(w._key=[i=C.slice(0),o=[]],l=d;l<4*d+28;l++){let e=i[l-1];(l%d==0||d===8&&l%d==4)&&(e=t[e>>>24]<<24^t[e>>16&255]<<16^t[e>>8&255]<<8^t[255&e],l%d==0&&(e=e<<8^e>>>24^r<<24,r=r<<1^283*(r>>7))),i[l]=i[l-d]^e}for(let e=0;l;e++,l--){const n=i[3&e?l:l-4];o[e]=l<=4||e<4?n:h[0][t[n>>>24]]^h[1][t[n>>16&255]]^h[2][t[n>>8&255]]^h[3][t[255&n]]}}encrypt(C){return this._crypt(C,0)}decrypt(C){return this._crypt(C,1)}_precompute(){const C=this._tables[0],w=this._tables[1],t=C[4],h=w[4],d=[],l=[];let i,o,r,e;for(let n=0;n<256;n++)l[(d[n]=n<<1^283*(n>>7))^n]=n;for(let n=i=0;!t[n];n^=o||1,i=l[i]||1){let c=i^i<<1^i<<2^i<<3^i<<4;c=c>>8^255&c^99,t[n]=c,h[c]=n,e=d[r=d[o=d[n]]];let a=16843009*e^65537*r^257*o^16843008*n,s=257*d[c]^16843008*c;for(let f=0;f<4;f++)C[f][n]=s=s<<24^s>>>8,w[f][c]=a=a<<24^a>>>8}for(let n=0;n<5;n++)C[n]=C[n].slice(0),w[n]=w[n].slice(0)}_crypt(C,w){if(C.length!==4)throw new Error("invalid aes block size");const t=this._key[w],h=t.length/4-2,d=[0,0,0,0],l=this._tables[w],i=l[0],o=l[1],r=l[2],e=l[3],n=l[4];let c,a,s,f=C[0]^t[0],p=C[w?3:1]^t[1],u=C[2]^t[2],g=C[w?1:3]^t[3],m=4;for(let v=0;v<h;v++)c=i[f>>>24]^o[p>>16&255]^r[u>>8&255]^e[255&g]^t[m],a=i[p>>>24]^o[u>>16&255]^r[g>>8&255]^e[255&f]^t[m+1],s=i[u>>>24]^o[g>>16&255]^r[f>>8&255]^e[255&p]^t[m+2],g=i[g>>>24]^o[f>>16&255]^r[p>>8&255]^e[255&u]^t[m+3],m+=4,f=c,p=a,u=s;for(let v=0;v<4;v++)d[w?3&-v:v]=n[f>>>24]<<24^n[p>>16&255]<<16^n[u>>8&255]<<8^n[255&g]^t[m++],c=f,f=p,p=u,u=g,g=c;return d}}},g1={getRandomValues(C){const w=new Uint32Array(C.buffer),t=h=>{let d=987654321;const l=4294967295;return function(){return d=36969*(65535&d)+(d>>16)&l,(((d<<16)+(h=18e3*(65535&h)+(h>>16)&l)&l)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let h,d=0;d<C.length;d+=4){const l=t(4294967296*(h||Math.random()));h=987654071*l(),w[d/4]=4294967296*l()|0}return C}},b1={ctrGladman:class{constructor(C,w){this._prf=C,this._initIv=w,this._iv=w}reset(){this._iv=this._initIv}update(C){return this.calculate(this._prf,C,this._iv)}incWord(C){if(255&~(C>>24))C+=1<<24;else{let w=C>>16&255,t=C>>8&255,h=255&C;w===255?(w=0,t===255?(t=0,h===255?h=0:++h):++t):++w,C=0,C+=w<<16,C+=t<<8,C+=h}return C}incCounter(C){(C[0]=this.incWord(C[0]))===0&&(C[1]=this.incWord(C[1]))}calculate(C,w,t){let h;if(!(h=w.length))return[];const d=qe.bitLength(w);for(let l=0;l<h;l+=4){this.incCounter(t);const i=C.encrypt(t);w[l]^=i[0],w[l+1]^=i[1],w[l+2]^=i[2],w[l+3]^=i[3]}return qe.clamp(w,d)}}},ei={importKey:C=>new ei.hmacSha1(Gs.bytes.toBits(C)),pbkdf2(C,w,t,h){if(t=t||1e4,h<0||t<0)throw new Error("invalid params to pbkdf2");const d=1+(h>>5)<<2;let l,i,o,r,e;const n=new ArrayBuffer(d),c=new DataView(n);let a=0;const s=qe;for(w=Gs.bytes.toBits(w),e=1;a<(d||1);e++){for(l=i=C.encrypt(s.concat(w,[e])),o=1;o<t;o++)for(i=C.encrypt(i),r=0;r<i.length;r++)l[r]^=i[r];for(o=0;a<(d||1)&&o<l.length;o++)c.setInt32(a,l[o]),a+=4}return n.slice(0,h/8)},hmacSha1:class{constructor(C){const w=this,t=w._hash=p1.sha1,h=[[],[]];w._baseHash=[new t,new t];const d=w._baseHash[0].blockSize/32;C.length>d&&(C=new t().update(C).finalize());for(let l=0;l<d;l++)h[0][l]=909522486^C[l],h[1][l]=1549556828^C[l];w._baseHash[0].update(h[0]),w._baseHash[1].update(h[1]),w._resultHash=new t(w._baseHash[0])}reset(){const C=this;C._resultHash=new C._hash(C._baseHash[0]),C._updated=!1}update(C){this._updated=!0,this._resultHash.update(C)}digest(){const C=this,w=C._resultHash.finalize(),t=new C._hash(C._baseHash[1]).update(w).finalize();return C.reset(),t}encrypt(C){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(C),this.digest(C)}}},v1=typeof crypto!=wn&&typeof crypto.getRandomValues==us,ec="Invalid password",rc="Invalid signature",la="zipjs-abort-check-password";function nc(C){return v1?crypto.getRandomValues(C):g1.getRandomValues(C)}const ri=16,ic={name:"PBKDF2"},y1=Object.assign({hash:{name:"HMAC"}},ic),yo=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},ic),w1=["deriveBits"],Ai=[8,12,16],Ti=[16,24,32],en=10,_1=[0,0,0,0],fo=typeof crypto!=wn,Pi=fo&&crypto.subtle,sc=fo&&typeof Pi!=wn,jr=Gs.bytes,x1=m1.aes,k1=b1.ctrGladman,S1=ei.hmacSha1;let Va=fo&&sc&&typeof Pi.importKey==us,Ua=fo&&sc&&typeof Pi.deriveBits==us;class E1 extends TransformStream{constructor({password:w,rawPassword:t,signed:h,encryptionStrength:d,checkPasswordOnly:l}){super({start(){Object.assign(this,{ready:new Promise(i=>this.resolveReady=i),password:lc(w,t),signed:h,strength:d-1,pending:new Uint8Array})},async transform(i,o){const r=this,{password:e,strength:n,resolveReady:c,ready:a}=r;e?(await async function(f,p,u,g){const m=await ac(f,p,u,fr(g,0,Ai[p])),v=fr(g,Ai[p]);if(m[0]!=v[0]||m[1]!=v[1])throw new Error(ec)}(r,n,e,fr(i,0,Ai[n]+2)),i=fr(i,Ai[n]+2),l?o.error(new Error(la)):c()):await a;const s=new Uint8Array(i.length-en-(i.length-en)%ri);o.enqueue(oc(r,i,s,0,en,!0))},async flush(i){const{signed:o,ctr:r,hmac:e,pending:n,ready:c}=this;if(e&&r){await c;const a=fr(n,0,n.length-en),s=fr(n,n.length-en);let f=new Uint8Array;if(a.length){const p=Di(jr,a);e.update(p);const u=r.update(p);f=Fi(jr,u)}if(o){const p=fr(Fi(jr,e.digest()),0,en);for(let u=0;u<en;u++)if(p[u]!=s[u])throw new Error(rc)}i.enqueue(f)}}})}}class C1 extends TransformStream{constructor({password:w,rawPassword:t,encryptionStrength:h}){let d;super({start(){Object.assign(this,{ready:new Promise(l=>this.resolveReady=l),password:lc(w,t),strength:h-1,pending:new Uint8Array})},async transform(l,i){const o=this,{password:r,strength:e,resolveReady:n,ready:c}=o;let a=new Uint8Array;r?(a=await async function(f,p,u){const g=nc(new Uint8Array(Ai[p])),m=await ac(f,p,u,g);return Po(g,m)}(o,e,r),n()):await c;const s=new Uint8Array(a.length+l.length-l.length%ri);s.set(a,0),i.enqueue(oc(o,l,s,a.length,0))},async flush(l){const{ctr:i,hmac:o,pending:r,ready:e}=this;if(o&&i){await e;let n=new Uint8Array;if(r.length){const c=i.update(Di(jr,r));o.update(c),n=Fi(jr,c)}d.signature=Fi(jr,o.digest()).slice(0,en),l.enqueue(Po(n,d.signature))}}}),d=this}}function oc(C,w,t,h,d,l){const{ctr:i,hmac:o,pending:r}=C,e=w.length-d;let n;for(r.length&&(w=Po(r,w),t=function(c,a){if(a&&a>c.length){const s=c;(c=new Uint8Array(a)).set(s,0)}return c}(t,e-e%ri)),n=0;n<=e-ri;n+=ri){const c=Di(jr,fr(w,n,n+ri));l&&o.update(c);const a=i.update(c);l||o.update(a),t.set(Fi(jr,a),n+h)}return C.pending=fr(w,n),t}async function ac(C,w,t,h){C.password=null;const d=await async function(n,c,a,s,f){if(!Va)return ei.importKey(c);try{return await Pi.importKey(n,c,a,s,f)}catch{return Va=!1,ei.importKey(c)}}("raw",t,y1,!1,w1),l=await async function(n,c,a){if(!Ua)return ei.pbkdf2(c,n.salt,yo.iterations,a);try{return await Pi.deriveBits(n,c,a)}catch{return Ua=!1,ei.pbkdf2(c,n.salt,yo.iterations,a)}}(Object.assign({salt:h},yo),d,8*(2*Ti[w]+2)),i=new Uint8Array(l),o=Di(jr,fr(i,0,Ti[w])),r=Di(jr,fr(i,Ti[w],2*Ti[w])),e=fr(i,2*Ti[w]);return Object.assign(C,{keys:{key:o,authentication:r,passwordVerification:e},ctr:new k1(new x1(o),Array.from(_1)),hmac:new S1(r)}),e}function lc(C,w){return w===Fe?function(t){if(typeof TextEncoder==wn){t=unescape(encodeURIComponent(t));const h=new Uint8Array(t.length);for(let d=0;d<h.length;d++)h[d]=t.charCodeAt(d);return h}return new TextEncoder().encode(t)}(C):w}function Po(C,w){let t=C;return C.length+w.length&&(t=new Uint8Array(C.length+w.length),t.set(C,0),t.set(w,C.length)),t}function fr(C,w,t){return C.subarray(w,t)}function Fi(C,w){return C.fromBits(w)}function Di(C,w){return C.toBits(w)}const Ks=12;class T1 extends TransformStream{constructor({password:w,passwordVerification:t,checkPasswordOnly:h}){super({start(){Object.assign(this,{password:w,passwordVerification:t}),cc(this,w)},transform(d,l){const i=this;if(i.password){const o=Ha(i,d.subarray(0,Ks));if(i.password=null,o[11]!=i.passwordVerification)throw new Error(ec);d=d.subarray(Ks)}h?l.error(new Error(la)):l.enqueue(Ha(i,d))}})}}class M1 extends TransformStream{constructor({password:w,passwordVerification:t}){super({start(){Object.assign(this,{password:w,passwordVerification:t}),cc(this,w)},transform(h,d){const l=this;let i,o;if(l.password){l.password=null;const r=nc(new Uint8Array(Ks));r[11]=l.passwordVerification,i=new Uint8Array(h.length+r.length),i.set(Wa(l,r),0),o=Ks}else i=new Uint8Array(h.length),o=0;i.set(Wa(l,h),o),d.enqueue(i)}})}}function Ha(C,w){const t=new Uint8Array(w.length);for(let h=0;h<w.length;h++)t[h]=uc(C)^w[h],ca(C,t[h]);return t}function Wa(C,w){const t=new Uint8Array(w.length);for(let h=0;h<w.length;h++)t[h]=uc(C)^w[h],ca(C,w[h]);return t}function cc(C,w){const t=[305419896,591751049,878082192];Object.assign(C,{keys:t,crcKey0:new Zs(t[0]),crcKey2:new Zs(t[2])});for(let h=0;h<w.length;h++)ca(C,w.charCodeAt(h))}function ca(C,w){let[t,h,d]=C.keys;C.crcKey0.append([w]),t=~C.crcKey0.get(),h=qa(Math.imul(qa(h+fc(t)),134775813)+1),C.crcKey2.append([h>>>24]),d=~C.crcKey2.get(),C.keys=[t,h,d]}function uc(C){const w=2|C.keys[2];return fc(Math.imul(w,1^w)>>>8)}function fc(C){return 255&C}function qa(C){return 4294967295&C}const Xa="deflate-raw";class A1 extends TransformStream{constructor(w,{chunkSize:t,CompressionStream:h,CompressionStreamNative:d}){super({});const{compressed:l,encrypted:i,useCompressionStream:o,zipCrypto:r,signed:e,level:n}=w,c=this;let a,s,f=hc(super.readable);i&&!r||!e||(a=new tc,f=Ir(f,a)),l&&(f=pc(f,o,{level:n,chunkSize:t},d,h)),i&&(r?f=Ir(f,new M1(w)):(s=new C1(w),f=Ir(f,s))),dc(c,f,()=>{let p;i&&!r&&(p=s.signature),i&&!r||!e||(p=new DataView(a.value.buffer).getUint32(0)),c.signature=p})}}class R1 extends TransformStream{constructor(w,{chunkSize:t,DecompressionStream:h,DecompressionStreamNative:d}){super({});const{zipCrypto:l,encrypted:i,signed:o,signature:r,compressed:e,useCompressionStream:n}=w;let c,a,s=hc(super.readable);i&&(l?s=Ir(s,new T1(w)):(a=new E1(w),s=Ir(s,a))),e&&(s=pc(s,n,{chunkSize:t},d,h)),i&&!l||!o||(c=new tc,s=Ir(s,c)),dc(this,s,()=>{if((!i||l)&&o){const f=new DataView(c.value.buffer);if(r!=f.getUint32(0,!1))throw new Error(rc)}})}}function hc(C){return Ir(C,new TransformStream({transform(w,t){w&&w.length&&t.enqueue(w)}}))}function dc(C,w,t){w=Ir(w,new TransformStream({flush:t})),Object.defineProperty(C,"readable",{get:()=>w})}function pc(C,w,t,h,d){try{C=Ir(C,new(w&&h?h:d)(Xa,t))}catch{if(!w)return C;try{C=Ir(C,new d(Xa,t))}catch{return C}}return C}function Ir(C,w){return C.pipeThrough(w)}const N1="message",O1="start",j1="pull",Za="data",Ga="close",mc="inflate";class I1 extends TransformStream{constructor(w,t){super({});const h=this,{codecType:d}=w;let l;d.startsWith("deflate")?l=A1:d.startsWith(mc)&&(l=R1);let i=0,o=0;const r=new l(w,t),e=super.readable,n=new TransformStream({transform(a,s){a&&a.length&&(o+=a.length,s.enqueue(a))},flush(){Object.assign(h,{inputSize:o})}}),c=new TransformStream({transform(a,s){a&&a.length&&(i+=a.length,s.enqueue(a))},flush(){const{signature:a}=r;Object.assign(h,{signature:a,outputSize:i,inputSize:o})}});Object.defineProperty(h,"readable",{get:()=>e.pipeThrough(n).pipeThrough(r).pipeThrough(c)})}}class B1 extends TransformStream{constructor(w){let t;super({transform:function h(d,l){if(t){const i=new Uint8Array(t.length+d.length);i.set(t),i.set(d,t.length),d=i,t=null}d.length>w?(l.enqueue(d.slice(0,w)),h(d.slice(w),l)):t=d},flush(h){t&&t.length&&h.enqueue(t)}})}}let gc=typeof Worker!=wn;class wo{constructor(w,{readable:t,writable:h},{options:d,config:l,streamOptions:i,useWebWorkers:o,transferStreams:r,scripts:e},n){const{signal:c}=i;return Object.assign(w,{busy:!0,readable:t.pipeThrough(new B1(l.chunkSize)).pipeThrough(new P1(t,i),{signal:c}),writable:h,options:Object.assign({},d),scripts:e,transferStreams:r,terminate:()=>new Promise(a=>{const{worker:s,busy:f}=w;s?(f?w.resolveTerminated=a:(s.terminate(),a()),w.interface=null):a()}),onTaskFinished(){const{resolveTerminated:a}=w;a&&(w.resolveTerminated=null,w.terminated=!0,w.worker.terminate(),a()),w.busy=!1,n(w)}}),(o&&gc?F1:bc)(w,l)}}class P1 extends TransformStream{constructor(w,{onstart:t,onprogress:h,size:d,onend:l}){let i=0;super({async start(){t&&await _o(t,d)},async transform(o,r){i+=o.length,h&&await _o(h,i,d),r.enqueue(o)},async flush(){w.size=i,l&&await _o(l,i)}})}}async function _o(C,...w){try{await C(...w)}catch{}}function bc(C,w){return{run:()=>async function({options:t,readable:h,writable:d,onTaskFinished:l},i){try{const o=new I1(t,i);await h.pipeThrough(o).pipeTo(d,{preventClose:!0,preventAbort:!0});const{signature:r,inputSize:e,outputSize:n}=o;return{signature:r,inputSize:e,outputSize:n}}finally{l()}}(C,w)}}function F1(C,w){const{baseURL:t,chunkSize:h}=w;if(!C.interface){let d;try{d=function(l,i,o){const r={type:"module"};let e,n;typeof l==us&&(l=l());try{e=new URL(l,i)}catch{e=l}if(Ka)try{n=new Worker(e)}catch{Ka=!1,n=new Worker(e,r)}else n=new Worker(e,r);return n.addEventListener(N1,c=>async function({data:a},s){const{type:f,value:p,messageId:u,result:g,error:m}=a,{reader:v,writer:S,resolveResult:R,rejectResult:I,onTaskFinished:F}=s;try{if(m){const{message:L,stack:$,code:V,name:z}=m,E=new Error(L);Object.assign(E,{stack:$,code:V,name:z}),j(E)}else{if(f==j1){const{value:L,done:$}=await v.read();Es({type:Za,value:L,done:$,messageId:u},s)}f==Za&&(await S.ready,await S.write(new Uint8Array(p)),Es({type:"ack",messageId:u},s)),f==Ga&&j(null,g)}}catch(L){Es({type:Ga,messageId:u},s),j(L)}function j(L,$){L?I(L):R($),S&&S.releaseLock(),F()}}(c,o)),n}(C.scripts[0],t,C)}catch{return gc=!1,bc(C,w)}Object.assign(C,{worker:d,interface:{run:()=>async function(l,i){let o,r;const e=new Promise((g,m)=>{o=g,r=m});Object.assign(l,{reader:null,writer:null,resolveResult:o,rejectResult:r,result:e});const{readable:n,options:c,scripts:a}=l,{writable:s,closed:f}=function(g){let m;const v=new Promise(R=>m=R);return{writable:new WritableStream({async write(R){const I=g.getWriter();await I.ready,await I.write(R),I.releaseLock()},close(){m()},abort:R=>g.getWriter().abort(R)}),closed:v}}(l.writable),p=Es({type:O1,scripts:a.slice(1),options:c,config:i,readable:n,writable:s},l);p||Object.assign(l,{reader:n.getReader(),writer:s.getWriter()});const u=await e;return p||await s.getWriter().close(),await f,u}(C,{chunkSize:h})}})}return C.interface}let Ka=!0,Ya=!0;function Es(C,{worker:w,writer:t,onTaskFinished:h,transferStreams:d}){try{const{value:l,readable:i,writable:o}=C,r=[];if(l&&(l.byteLength<l.buffer.byteLength?C.value=l.buffer.slice(0,l.byteLength):C.value=l.buffer,r.push(C.value)),d&&Ya?(i&&r.push(i),o&&r.push(o)):C.readable=C.writable=null,r.length)try{return w.postMessage(C,r),!0}catch{Ya=!1,C.readable=C.writable=null,w.postMessage(C)}else w.postMessage(C)}catch(l){throw t&&t.releaseLock(),h(),l}}let Sn=[];const xo=[];let Ja=0;async function D1(C,w){const{options:t,config:h}=w,{transferStreams:d,useWebWorkers:l,useCompressionStream:i,codecType:o,compressed:r,signed:e,encrypted:n}=t,{workerScripts:c,maxWorkers:a}=h;w.transferStreams=d||d===Fe;const s=!(r||e||n||w.transferStreams);return w.useWebWorkers=!s&&(l||l===Fe&&h.useWebWorkers),w.scripts=w.useWebWorkers&&c?c[o]:[],t.useCompressionStream=i||i===Fe&&h.useCompressionStream,(await async function(){const p=Sn.find(u=>!u.busy);if(p)return Qa(p),new wo(p,C,w,f);if(Sn.length<a){const u={indexWorker:Ja};return Ja++,Sn.push(u),new wo(u,C,w,f)}return new Promise(u=>xo.push({resolve:u,stream:C,workerOptions:w}))}()).run();function f(p){if(xo.length){const[{resolve:u,stream:g,workerOptions:m}]=xo.splice(0,1);u(new wo(p,g,m,f))}else p.worker?(Qa(p),function(u,g){const{config:m}=g,{terminateWorkerTimeout:v}=m;Number.isFinite(v)&&v>=0&&(u.terminated?u.terminated=!1:u.terminateTimeout=setTimeout(async()=>{Sn=Sn.filter(S=>S!=u);try{await u.terminate()}catch{}},v))}(p,w)):Sn=Sn.filter(u=>u!=p)}}function Qa(C){const{terminateTimeout:w}=C;w&&(clearTimeout(w),C.terminateTimeout=null)}const L1=65536,vc="writable";class ua{constructor(){this.size=0}init(){this.initialized=!0}}class yc extends ua{get readable(){const w=this,{chunkSize:t=L1}=w,h=new ReadableStream({start(){this.chunkOffset=0},async pull(d){const{offset:l=0,size:i,diskNumberStart:o}=h,{chunkOffset:r}=this,e=i===Fe?t:Math.min(t,i-r),n=await ze(w,l+r,e,o);d.enqueue(n),r+t>i||i===Fe&&!n.length&&e?d.close():this.chunkOffset+=t}});return h}}class wc extends yc{constructor(w){super(),Object.assign(this,{blob:w,size:w.size})}async readUint8Array(w,t){const h=this,d=w+t;let i=await(w||d<h.size?h.blob.slice(w,d):h.blob).arrayBuffer();return i.byteLength>t&&(i=i.slice(w,d)),new Uint8Array(i)}}class _c extends ua{constructor(w){super();const t=new TransformStream,h=[];w&&h.push(["Content-Type",w]),Object.defineProperty(this,vc,{get:()=>t.writable}),this.blob=new Response(t.readable,{headers:h}).blob()}getData(){return this.blob}}class z1 extends _c{constructor(w){super(w),Object.assign(this,{encoding:w,utf8:!w||w.toLowerCase()=="utf-8"})}async getData(){const{encoding:w,utf8:t}=this,h=await super.getData();if(h.text&&t)return h.text();{const d=new FileReader;return new Promise((l,i)=>{Object.assign(d,{onload:({target:o})=>l(o.result),onerror:()=>i(d.error)}),d.readAsText(h,w)})}}}class $1 extends yc{constructor(w){super(),this.readers=w}async init(){const w=this,{readers:t}=w;w.lastDiskNumber=0,w.lastDiskOffset=0,await Promise.all(t.map(async(h,d)=>{await h.init(),d!=t.length-1&&(w.lastDiskOffset+=h.size),w.size+=h.size})),super.init()}async readUint8Array(w,t,h=0){const d=this,{readers:l}=this;let i,o=h;o==-1&&(o=l.length-1);let r=w;for(;r>=l[o].size;)r-=l[o].size,o++;const e=l[o],n=e.size;if(r+t<=n)i=await ze(e,r,t);else{const c=n-r;i=new Uint8Array(t),i.set(await ze(e,r,c)),i.set(await d.readUint8Array(w+c,t-c,h),c)}return d.lastDiskNumber=Math.max(o,d.lastDiskNumber),i}}class tl extends ua{constructor(w,t=4294967295){super();const h=this;let d,l,i;Object.assign(h,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});const o=new WritableStream({async write(n){const{availableSize:c}=h;if(i)n.length>=c?(await r(n.slice(0,c)),await e(),h.diskOffset+=d.size,h.diskNumber++,i=null,await this.write(n.slice(c))):await r(n);else{const{value:a,done:s}=await w.next();if(s&&!a)throw new Error("Writer iterator completed too soon");d=a,d.size=0,d.maxSize&&(h.maxSize=d.maxSize),h.availableSize=h.maxSize,await Ys(d),l=a.writable,i=l.getWriter(),await this.write(n)}},async close(){await i.ready,await e()}});async function r(n){const c=n.length;c&&(await i.ready,await i.write(n),d.size+=c,h.size+=c,h.availableSize-=c)}async function e(){l.size=d.size,await i.close()}Object.defineProperty(h,vc,{get:()=>o})}}async function Ys(C,w){if(!C.init||C.initialized)return Promise.resolve();await C.init(w)}function V1(C){return Array.isArray(C)&&(C=new $1(C)),C instanceof ReadableStream&&(C={readable:C}),C}function ze(C,w,t,h){return C.readUint8Array(w,t,h)}const xc="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),U1=xc.length==256;function Bs(C,w){return w&&w.trim().toLowerCase()=="cp437"?function(t){if(U1){let h="";for(let d=0;d<t.length;d++)h+=xc[t[d]];return h}return new TextDecoder().decode(t)}(C):new TextDecoder(w).decode(C)}const kc="filename",Sc="rawFilename",Ec="comment",Cc="rawComment",Tc="uncompressedSize",Mc="compressedSize",Ac="offset",Fo="diskNumberStart",Do="lastModDate",Lo="rawLastModDate",Rc="lastAccessDate",H1="rawLastAccessDate",Nc="creationDate",W1="rawCreationDate",q1=[kc,Sc,Mc,Tc,Do,Lo,Ec,Cc,Rc,Nc,Ac,Fo,Fo,"internalFileAttribute","internalFileAttributes","externalFileAttribute","externalFileAttributes","msDosCompatible","zip64","encrypted","version","versionMadeBy","zipCrypto","directory","executable","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class el{constructor(w){q1.forEach(t=>this[t]=w[t])}}const ko="File format is not recognized",X1="Zip64 extra field not found",rl="Compression method not supported",nl="Split zip file",il="utf-8",sl="cp437",Z1=[[Tc,Un],[Mc,Un],[Ac,Un],[Fo,Nn]],G1={[Nn]:{getValue:Ce,bytes:4},[Un]:{getValue:Ps,bytes:8}};class K1{constructor(w,t={}){Object.assign(this,{reader:V1(w),options:t,config:nn})}async*getEntriesGenerator(w={}){const t=this;let{reader:h}=t;const{config:d}=t;if(await Ys(h),h.size!==Fe&&h.readUint8Array||(h=new wc(await new Response(h.readable).blob()),await Ys(h)),h.size<Gn)throw new Error(ko);h.chunkSize=function($){return Math.max($.chunkSize,64)}(d);const l=await async function($,V,z,E,A){const k=new Uint8Array(4);(function(_,x,M){_.setUint32(x,M,!0)})(Ie(k),0,V);const b=E+A;return await y(E)||await y(Math.min(b,z));async function y(_){const x=z-_,M=await ze($,x,_);for(let B=M.length-E;B>=0;B--)if(M[B]==k[0]&&M[B+1]==k[1]&&M[B+2]==k[2]&&M[B+3]==k[3])return{offset:x+B,buffer:M.slice(B,B+E).buffer}}}(h,101010256,h.size,Gn,1048560);if(!l)throw Ce(Ie(await ze(h,0,4)))==134695760?new Error(nl):new Error("End of central directory not found");const i=Ie(l);let o=Ce(i,12),r=Ce(i,16);const e=l.offset,n=Be(i,20),c=e+Gn+n;let a=Be(i,4);const s=h.lastDiskNumber||0;let f=Be(i,6),p=Be(i,8),u=0,g=0;if(r==Un||o==Un||p==Nn||f==Nn){const $=Ie(await ze(h,l.offset-20,20));if(Ce($,0)==117853008){r=Ps($,8);let V=await ze(h,r,56,-1),z=Ie(V);const E=l.offset-20-56;if(Ce(z,0)!=za&&r!=E){const A=r;r=E,u=r-A,V=await ze(h,r,56,-1),z=Ie(V)}if(Ce(z,0)!=za)throw new Error("End of Zip64 central directory locator not found");a==Nn&&(a=Ce(z,16)),f==Nn&&(f=Ce(z,20)),p==Nn&&(p=Ps(z,32)),o==Un&&(o=Ps(z,40)),r-=o}}if(r>=h.size&&(u=h.size-r-o-Gn,r=h.size-o-Gn),s!=a)throw new Error(nl);if(r<0)throw new Error(ko);let m=0,v=await ze(h,r,o,f),S=Ie(v);if(o){const $=l.offset-o;if(Ce(S,m)!=La&&r!=$){const V=r;r=$,u+=r-V,v=await ze(h,r,o,f),S=Ie(v)}}const R=l.offset-r-(h.lastDiskOffset||0);if(o!=R&&R>=0&&(o=R,v=await ze(h,r,o,f),S=Ie(v)),r<0||r>=h.size)throw new Error(ko);const I=We(t,w,"filenameEncoding"),F=We(t,w,"commentEncoding");for(let $=0;$<p;$++){const V=new Y1(h,d,t.options);if(Ce(S,m)!=La)throw new Error("Central directory header not found");Oc(V,S,m+6);const z=!!V.bitFlag.languageEncodingFlag,E=m+46,A=E+V.filenameLength,k=A+V.extraFieldLength,b=Be(S,m+4),y=!(b>>8),_=b>>8==3,x=v.subarray(E,A),M=Be(S,m+32),B=k+M,P=v.subarray(k,B),H=z,W=z,K=Ce(S,m+38),D=y&&!(16&~ni(S,m+38))||_&&!(16384&~(K>>16))||x.length&&x[x.length-1]==47,X=_&&!(73&~(K>>16)),O=Ce(S,m+42)+u;Object.assign(V,{versionMadeBy:b,msDosCompatible:y,compressedSize:0,uncompressedSize:0,commentLength:M,directory:D,offset:O,diskNumberStart:Be(S,m+34),internalFileAttributes:Be(S,m+36),externalFileAttributes:K,rawFilename:x,filenameUTF8:H,commentUTF8:W,rawExtraField:v.subarray(A,k),executable:X}),V.internalFileAttribute=V.internalFileAttributes,V.externalFileAttribute=V.externalFileAttributes;const N=We(t,w,"decodeText")||Bs,U=H?il:I||sl,q=W?il:F||sl;let Y=N(x,U);Y===Fe&&(Y=Bs(x,U));let G=N(P,q);G===Fe&&(G=Bs(P,q)),Object.assign(V,{rawComment:P,filename:Y,comment:G,directory:D||Y.endsWith("/")}),g=Math.max(O,g),jc(V,V,S,m+6),V.zipCrypto=V.encrypted&&!V.extraFieldAES;const Q=new el(V);Q.getData=(it,J)=>V.getData(it,Q,J),m=B;const{onprogress:rt}=w;if(rt)try{await rt($+1,p,new el(V))}catch{}yield Q}const j=We(t,w,"extractPrependedData"),L=We(t,w,"extractAppendedData");return j&&(t.prependedData=g>0?await ze(h,0,g):new Uint8Array),t.comment=n?await ze(h,e+Gn,n):new Uint8Array,L&&(t.appendedData=c<h.size?await ze(h,c,h.size-c):new Uint8Array),!0}async getEntries(w={}){const t=[];for await(const h of this.getEntriesGenerator(w))t.push(h);return t}async close(){}}class Y1{constructor(w,t,h){Object.assign(this,{reader:w,config:t,options:h})}async getData(w,t,h={}){const d=this,{reader:l,offset:i,diskNumberStart:o,extraFieldAES:r,compressionMethod:e,config:n,bitFlag:c,signature:a,rawLastModDate:s,uncompressedSize:f,compressedSize:p}=d,u=t.localDirectory={},g=Ie(await ze(l,i,30,o));let m=We(d,h,"password"),v=We(d,h,"rawPassword");const S=We(d,h,"passThrough");if(m=m&&m.length&&m,v=v&&v.length&&v,r&&r.originalCompressionMethod!=99)throw new Error(rl);if(e!=0&&e!=8&&!S)throw new Error(rl);if(Ce(g,0)!=67324752)throw new Error("Local file header not found");Oc(u,g,4),u.rawExtraField=u.extraFieldLength?await ze(l,i+30+u.filenameLength,u.extraFieldLength,o):new Uint8Array,jc(d,u,g,4,!0),Object.assign(t,{lastAccessDate:u.lastAccessDate,creationDate:u.creationDate});const R=d.encrypted&&u.encrypted&&!S,I=R&&!r;if(S||(t.zipCrypto=I),R){if(!I&&r.strength===Fe)throw new Error("Encryption method not supported");if(!m&&!v)throw new Error("File contains encrypted entry")}const F=i+30+u.filenameLength+u.extraFieldLength,j=p,L=l.readable;Object.assign(L,{diskNumberStart:o,offset:F,size:j});const $=We(d,h,"signal"),V=We(d,h,"checkPasswordOnly");V&&(w=new WritableStream),w=function(_){_.writable===Fe&&typeof _.next==us&&(_=new tl(_)),_ instanceof WritableStream&&(_={writable:_});const{writable:x}=_;return x.size===Fe&&(x.size=0),_ instanceof tl||Object.assign(_,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),_}(w),await Ys(w,S?p:f);const{writable:z}=w,{onstart:E,onprogress:A,onend:k}=h,b={options:{codecType:mc,password:m,rawPassword:v,zipCrypto:I,encryptionStrength:r&&r.strength,signed:We(d,h,"checkSignature")&&!S,passwordVerification:I&&(c.dataDescriptor?s>>>8&255:a>>>24&255),signature:a,compressed:e!=0&&!S,encrypted:d.encrypted&&!S,useWebWorkers:We(d,h,"useWebWorkers"),useCompressionStream:We(d,h,"useCompressionStream"),transferStreams:We(d,h,"transferStreams"),checkPasswordOnly:V},config:n,streamOptions:{signal:$,size:j,onstart:E,onprogress:A,onend:k}};let y=0;try{({outputSize:y}=await D1({readable:L,writable:z},b))}catch(_){if(!V||_.message!=la)throw _}finally{const _=We(d,h,"preventClose");z.size+=y,_||z.locked||await z.getWriter().close()}return V?Fe:w.getData?w.getData():z}}function Oc(C,w,t){const h=C.rawBitFlag=Be(w,t+2),d=!(1&~h),l=Ce(w,t+6);Object.assign(C,{encrypted:d,version:Be(w,t),bitFlag:{level:(6&h)>>1,dataDescriptor:!(8&~h),languageEncodingFlag:!(2048&~h)},rawLastModDate:l,lastModDate:J1(l),filenameLength:Be(w,t+22),extraFieldLength:Be(w,t+24)})}function jc(C,w,t,h,d){const{rawExtraField:l}=w,i=w.extraField=new Map,o=Ie(new Uint8Array(l));let r=0;try{for(;r<l.length;){const g=Be(o,r),m=Be(o,r+2);i.set(g,{type:g,data:l.slice(r+4,r+4+m)}),r+=4+m}}catch{}const e=Be(t,h+4);Object.assign(w,{signature:Ce(t,h+10),uncompressedSize:Ce(t,h+18),compressedSize:Ce(t,h+14)});const n=i.get(1);n&&(function(g,m){m.zip64=!0;const v=Ie(g.data),S=Z1.filter(([R,I])=>m[R]==I);for(let R=0,I=0;R<S.length;R++){const[F,j]=S[R];if(m[F]==j){const L=G1[j];m[F]=g[F]=L.getValue(v,I),I+=L.bytes}else if(g[F])throw new Error(X1)}}(n,w),w.extraFieldZip64=n);const c=i.get(28789);c&&(ol(c,kc,Sc,w,C),w.extraFieldUnicodePath=c);const a=i.get(25461);a&&(ol(a,Ec,Cc,w,C),w.extraFieldUnicodeComment=a);const s=i.get(39169);s?(function(g,m,v){const S=Ie(g.data),R=ni(S,4);Object.assign(g,{vendorVersion:ni(S,0),vendorId:ni(S,2),strength:R,originalCompressionMethod:v,compressionMethod:Be(S,5)}),m.compressionMethod=g.compressionMethod}(s,w,e),w.extraFieldAES=s):w.compressionMethod=e;const f=i.get(10);f&&(function(g,m){const v=Ie(g.data);let S,R=4;try{for(;R<g.data.length&&!S;){const I=Be(v,R),F=Be(v,R+2);I==1&&(S=g.data.slice(R+4,R+4+F)),R+=4+F}}catch{}try{if(S&&S.length==24){const I=Ie(S),F=I.getBigUint64(0,!0),j=I.getBigUint64(8,!0),L=I.getBigUint64(16,!0);Object.assign(g,{rawLastModDate:F,rawLastAccessDate:j,rawCreationDate:L});const $=So(F),V=So(j),z={lastModDate:$,lastAccessDate:V,creationDate:So(L)};Object.assign(g,z),Object.assign(m,z)}}catch{}}(f,w),w.extraFieldNTFS=f);const p=i.get(21589);p&&(function(g,m,v){const S=Ie(g.data),R=ni(S,0),I=[],F=[];v?(1&~R||(I.push(Do),F.push(Lo)),2&~R||(I.push(Rc),F.push(H1)),4&~R||(I.push(Nc),F.push(W1))):g.data.length>=5&&(I.push(Do),F.push(Lo));let j=1;I.forEach((L,$)=>{if(g.data.length>=j+4){const V=Ce(S,j);m[L]=g[L]=new Date(1e3*V);const z=F[$];g[z]=V}j+=4})}(p,w,d),w.extraFieldExtendedTimestamp=p);const u=i.get(6534);u&&(w.extraFieldUSDZ=u)}function ol(C,w,t,h,d){const l=Ie(C.data),i=new Zs;i.append(d[t]);const o=Ie(new Uint8Array(4));o.setUint32(0,i.get(),!0);const r=Ce(l,1);Object.assign(C,{version:ni(l,0),[w]:Bs(C.data.subarray(5)),valid:!d.bitFlag.languageEncodingFlag&&r==Ce(o,0)}),C.valid&&(h[w]=C[w],h[w+"UTF8"]=!0)}function We(C,w,t){return w[t]===Fe?C.options[t]:w[t]}function J1(C){const w=(4294901760&C)>>16,t=65535&C;try{return new Date(1980+((65024&w)>>9),((480&w)>>5)-1,31&w,(63488&t)>>11,(2016&t)>>5,2*(31&t),0)}catch{}}function So(C){return new Date(Number(C/BigInt(1e4)-BigInt(116444736e5)))}function ni(C,w){return C.getUint8(w)}function Be(C,w){return C.getUint16(w,!0)}function Ce(C,w){return C.getUint32(w,!0)}function Ps(C,w){return Number(C.getBigUint64(w,!0))}function Ie(C){return new DataView(C.buffer)}Jl({Inflate:function(C){const w=new Kl,t=C&&C.chunkSize?Math.floor(2*C.chunkSize):131072,h=new Uint8Array(t);let d=!1;w.inflateInit(),w.next_out=h,this.append=function(l,i){const o=[];let r,e,n=0,c=0,a=0;if(l.length!==0){w.next_in_index=0,w.next_in=l,w.avail_in=l.length;do{if(w.next_out_index=0,w.avail_out=t,w.avail_in!==0||d||(w.next_in_index=0,d=!0),r=w.inflate(0),d&&r===Zr){if(w.avail_in!==0)throw new Error("inflating: bad input")}else if(r!==0&&r!==1)throw new Error("inflating: "+w.msg);if((d||r===1)&&w.avail_in===l.length)throw new Error("inflating: bad input");w.next_out_index&&(w.next_out_index===t?o.push(new Uint8Array(h)):o.push(h.subarray(0,w.next_out_index))),a+=w.next_out_index,i&&w.next_in_index>0&&w.next_in_index!=n&&(i(w.next_in_index),n=w.next_in_index)}while(w.avail_in>0||w.avail_out===0);return o.length>1?(e=new Uint8Array(a),o.forEach(function(s){e.set(s,c),c+=s.length})):e=o[0]?new Uint8Array(o[0]):new Uint8Array,e}},this.flush=function(){w.inflateEnd()}}});const Q1=Object.freeze(Object.defineProperty({__proto__:null,BlobReader:wc,BlobWriter:_c,TextWriter:z1,ZipReader:K1,configure:Jl},Symbol.toStringTag,{value:"Module"})),Re={CONTAINER:"urn:oasis:names:tc:opendocument:xmlns:container",XHTML:"http://www.w3.org/1999/xhtml",OPF:"http://www.idpf.org/2007/opf",EPUB:"http://www.idpf.org/2007/ops",DC:"http://purl.org/dc/elements/1.1/",ENC:"http://www.w3.org/2001/04/xmlenc#",NCX:"http://www.daisy.org/z3986/2005/ncx/",XLINK:"http://www.w3.org/1999/xlink",SMIL:"http://www.w3.org/ns/SMIL"},Ue={XML:"application/xml",NCX:"application/x-dtbncx+xml",XHTML:"application/xhtml+xml",HTML:"text/html",CSS:"text/css",SVG:"image/svg+xml",JS:/\/(x-)?(javascript|ecmascript)/},rn={a11y:"http://www.idpf.org/epub/vocab/package/a11y/#",dcterms:"http://purl.org/dc/terms/",marc:"http://id.loc.gov/vocabulary/",media:"http://www.idpf.org/epub/vocab/overlays/#",onix:"http://www.editeur.org/ONIX/book/codelists/current.html#",rendition:"http://www.idpf.org/vocab/rendition/#",schema:"http://schema.org/",xsd:"http://www.w3.org/2001/XMLSchema#",msv:"http://www.idpf.org/epub/vocab/structure/magazine/#",prism:"http://www.prismstandard.org/specifications/3.0/PRISM_CV_Spec_3.0.htm#"},tg={art:"artist",aut:"author",clr:"colorist",edt:"editor",ill:"illustrator",nrt:"narrator",trl:"translator",pbl:"publisher"},eg={"02":"isbn","06":"doi",15:"isbn",26:"doi",34:"issn"},zo=C=>C.toLowerCase().replace(/[-:](.)/g,(w,t)=>t.toUpperCase()),rg=C=>C?C.replace(/[\t\n\f\r ]+/g," ").replace(/^[\t\n\f\r ]+/,"").replace(/[\t\n\f\r ]+$/,""):"",ng=(C,w,t)=>t?h=>{var d,l;return(l=(d=h.getAttribute(C))==null?void 0:d.split(/\s/))==null?void 0:l.includes(w)}:typeof w=="function"?h=>w(h.getAttribute(C)):h=>h.getAttribute(C)===w,Fs=(...C)=>w=>w?Object.fromEntries(C.map(t=>[zo(t),w.getAttribute(t)])):null,Gr=C=>rg(C==null?void 0:C.textContent),fs=(C,w)=>{const t=C.lookupNamespaceURI(null)===w||C.lookupPrefix(w),h=t?(d,l)=>i=>i.namespaceURI===w&&i.localName===l:(d,l)=>i=>i.localName===l;return{$:(d,l)=>[...d.children].find(h(d,l)),$$:(d,l)=>[...d.children].filter(h(d,l)),$$$:t?(d,l)=>[...d.getElementsByTagNameNS(w,l)]:(d,l)=>[...d.getElementsByTagName(l)]}},ii=(C,w)=>{try{if(C=C.replace(/%2c/,","),w.includes(":")&&!w.startsWith("OEBPS"))return new URL(C,w);const t="https://invalid.invalid/",h=new URL(C,t+w);return h.search="",decodeURI(h.href.replace(t,""))}catch(t){return console.warn(t),C}},Ic=C=>/^(?!blob)\w+:/i.test(C),ig=(C,w)=>{if(!C)return w;const t=C.replace(/\/$/,"").split("/"),h=w.replace(/\/$/,"").split("/"),d=(t.length>h.length?t:h).findIndex((l,i)=>t[i]!==h[i]);return d<0?"":Array(t.length-d).fill("..").concat(h.slice(d)).join("/")},sg=C=>C.slice(0,C.lastIndexOf("/")+1),Cs=async(C,w,t)=>{const h=[];C.replace(w,(...l)=>(h.push(l),null));const d=[];for(const l of h)d.push(await t(...l));return C.replace(w,()=>d.shift())},og=C=>C.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),$o=C=>{for(const[t,h]of Object.entries(C))h==null?delete C[t]:Array.isArray(h)?(C[t]=h.filter(d=>d).map(d=>typeof d=="object"&&!Array.isArray(d)?$o(d):d),C[t].length?C[t].length===1&&(C[t]=C[t][0]):delete C[t]):typeof h=="object"&&(C[t]=$o(h),Object.keys(h).length||delete C[t]);const w=Object.keys(C);return w.length===1&&w[0]==="name"?C[w[0]]:C},ag=C=>{const w=new Map(Object.entries(rn)),t=C.documentElement.getAttributeNS(Re.EPUB,"prefix")||C.documentElement.getAttribute("prefix");if(t)for(const[,h,d]of t.matchAll(/(.+): +(.+)[ \t\r\n]*/g))w.set(h,d);return w},al=(C,w)=>{if(!C)return null;const[t,h]=C.split(":"),d=h?t:null,l=h||t,i=w.get(d);return i?i+l:null},lg=C=>{var j,L,$,V,z,E,A,k,b,y,_,x,M,B,P,H,W,K,D,X,O,N,U;const{$:w}=fs(C,Re.OPF),t=w(C.documentElement,"metadata"),h=Object.groupBy(t.children,q=>q.namespaceURI===Re.DC?"dc":q.namespaceURI===Re.OPF&&q.localName==="meta"?q.hasAttribute("name")?"legacyMeta":"meta":""),d=t.getAttribute("xml:lang")??C.documentElement.getAttribute("xml:lang")??"und",l=ag(C),i=q=>{const Y=q.getAttribute("property"),G=q.getAttribute("scheme");return{property:al(Y,l)??Y,scheme:al(G,l)??G,lang:q.getAttribute("xml:lang"),value:Gr(q),props:r(q),attrs:Object.fromEntries(Array.from(q.attributes).filter(Q=>Q.namespaceURI===Re.OPF).map(Q=>[Q.localName,Q.value]))}},o=Map.groupBy(h.meta??[],q=>q.getAttribute("refines")),r=q=>{const Y=o.get(q?"#"+q.getAttribute("id"):null);return Y?Object.groupBy(Y.map(i),G=>G.property):null},e=Object.fromEntries(Object.entries(Object.groupBy(h.dc||[],q=>q.localName)).map(([q,Y])=>[q,Y.map(i)])),n=r()??{},c=Object.fromEntries(((j=h.legacyMeta)==null?void 0:j.map(q=>[q.getAttribute("name"),q.getAttribute("content")]))??[]),a=q=>{var Y;return(Y=q==null?void 0:q[0])==null?void 0:Y.value},s=(q,Y)=>{var G;return a((G=q==null?void 0:q.props)==null?void 0:G[Y])},f=q=>{var rt,it;if(!q)return null;const Y=((rt=q.props)==null?void 0:rt["alternate-script"])??[],G=q.attrs["alt-rep"];if(!Y.length&&(!q.lang||q.lang===d)&&!G)return q.value;const Q={[q.lang??d]:q.value};G&&(Q[q.attrs["alt-rep-lang"]]=G);for(const J of Y)Q[it=J.lang]??(Q[it]=J.value);return Q},p=q=>{var Y,G,Q,rt,it;return q?{name:f(q),sortAs:f((G=(Y=q.props)==null?void 0:Y["file-as"])==null?void 0:G[0])??q.attrs["file-as"],role:((it=(rt=(Q=q.props)==null?void 0:Q.role)==null?void 0:rt.filter(J=>J.scheme===rn.marc+"relators"))==null?void 0:it.map(J=>J.value))??[q.attrs.role],code:s(q,"term")??q.attrs.term,scheme:s(q,"authority")??q.attrs.authority}:null},u=q=>{var Y;return{name:f(q),position:a((Y=q.props)==null?void 0:Y["group-position"])}},g=q=>{var Q;const{value:Y}=q;if(/^urn:/i.test(Y))return Y;if(/^doi:/i.test(Y))return`urn:${Y}`;const G=(Q=q.props)==null?void 0:Q["identifier-type"];if(!G){const rt=q.attrs.scheme;return rt?/^(doi|isbn|uuid)$/i.test(rt)?`urn:${rt}:${Y}`:{scheme:rt,value:Y}:Y}if(G.scheme===rn.onix+"codelist5"){const rt=eg[G.value];if(rt)return`urn:${rt}:${Y}`}return Y},m=Object.groupBy(n["belongs-to-collection"]??[],q=>s(q,"collection-type")==="series"?"series":"collection"),v=((L=e.title)==null?void 0:L.find(q=>s(q,"title-type")==="main"))??(($=e.title)==null?void 0:$[0]),S={identifier:Pc(C),title:f(v),sortAs:f((z=(V=v==null?void 0:v.props)==null?void 0:V["file-as"])==null?void 0:z[0])??((E=v==null?void 0:v.attrs)==null?void 0:E["file-as"])??(c==null?void 0:c["calibre:title_sort"]),subtitle:(k=(A=e.title)==null?void 0:A.find(q=>s(q,"title-type")==="subtitle"))==null?void 0:k.value,language:(b=e.language)==null?void 0:b.map(q=>q.value),description:a(e.description),publisher:p((y=e.publisher)==null?void 0:y[0]),published:((x=(_=e.date)==null?void 0:_.find(q=>q.attrs.event==="publication"))==null?void 0:x.value)??a(e.date),modified:a(n[rn.dcterms+"modified"])??((B=(M=e.date)==null?void 0:M.find(q=>q.attrs.event==="modification"))==null?void 0:B.value),subject:(P=e.subject)==null?void 0:P.map(p),belongsTo:{collection:(H=m.collection)==null?void 0:H.map(u),series:((W=m.series)==null?void 0:W.map(u))??(c==null?void 0:c["calibre:series"])?{name:c==null?void 0:c["calibre:series"],position:parseFloat(c==null?void 0:c["calibre:series_index"])}:null},altIdentifier:(K=e.identifier)==null?void 0:K.map(g),source:(D=e.source)==null?void 0:D.map(g),rights:a(e.rights)},R=q=>Y=>{var Q;const G=new Set((Q=Y.role)==null?void 0:Q.map(rt=>tg[rt]??q));return[G.size?G:[q],Y]};for(const[q,Y]of[].concat(((O=(X=e.creator)==null?void 0:X.map(p))==null?void 0:O.map(R("author")))??[],((U=(N=e.contributor)==null?void 0:N.map(p))==null?void 0:U.map(R("contributor")))??[]))for(const G of q)S[G]?S[G].push(Y):S[G]=[Y];$o(S),S.altIdentifier===S.identifier&&delete S.altIdentifier;const I={},F={};for(const[q,Y]of Object.entries(n))q.startsWith(rn.rendition)?I[zo(q.replace(rn.rendition,""))]=a(Y):q.startsWith(rn.media)&&(F[zo(q.replace(rn.media,""))]=a(Y));return F.duration&&(F.duration=Vo(F.duration)),{metadata:S,rendition:I,media:F}},cg=(C,w=t=>t)=>{var f;const{$:t,$$:h,$$$:d}=fs(C,Re.XHTML),l=p=>p?decodeURI(w(p)):null,i=p=>u=>{var I;const g=t(u,"a")??t(u,"span"),m=t(u,"ol"),v=l(g==null?void 0:g.getAttribute("href")),R={label:Gr(g)||(g==null?void 0:g.getAttribute("title")),href:v,subitems:o(m)};return p&&(R.type=(I=g==null?void 0:g.getAttributeNS(Re.EPUB,"type"))==null?void 0:I.split(/\s/)),R},o=(p,u)=>p?h(p,"li").map(i(u)):null,r=(p,u)=>o(t(p,"ol"),u),e=d(C,"nav");let n=null,c=null,a=null,s=[];for(const p of e){const u=((f=p.getAttributeNS(Re.EPUB,"type"))==null?void 0:f.split(/\s/))??[];u.includes("toc")?n??(n=r(p)):u.includes("page-list")?c??(c=r(p)):u.includes("landmarks")?a??(a=r(p,!0)):s.push({label:Gr(p.firstElementChild),type:u,list:r(p)})}return{toc:n,pageList:c,landmarks:a,others:s}},ug=(C,w=t=>t)=>{const{$:t,$$:h}=fs(C,Re.NCX),d=r=>r?decodeURI(w(r)):null,l=r=>{const e=t(r,"navLabel"),n=t(r,"content"),c=Gr(e),a=d(n.getAttribute("src"));if(r.localName==="navPoint"){const s=h(r,"navPoint");return{label:c,href:a,subitems:s.length?s.map(l):null}}return{label:c,href:a}},i=(r,e)=>h(r,e).map(l),o=(r,e)=>{const n=t(C.documentElement,r);return n?i(n,e):null};return{toc:o("navMap","navPoint"),pageList:o("pageList","pageTarget"),others:h(C.documentElement,"navList").map(r=>({label:Gr(t(r,"navLabel")),list:i(r,"navTarget")}))}},Vo=C=>{if(!C)return;const w=C.split(":").map(i=>parseFloat(i));if(w.length===3){const[i,o,r]=w;return i*60*60+o*60+r}if(w.length===2){const[i,o]=w;return i*60+o}const[t,h]=C.split(/(?=[^\d.])/),d=parseFloat(t),l=h==="h"?60*60:h==="min"?60:h==="ms"?.001:1;return d*l};var on,$i,jn,lr,Ye,Le,Vi,Ui,an,te,Bc,Ds,Cn,Tn,Ls,zs,Mn,Uo;class fg extends EventTarget{constructor(t,h){super();mt(this,te);mt(this,on);mt(this,$i);mt(this,jn);mt(this,lr);mt(this,Ye);mt(this,Le);mt(this,Vi,1);mt(this,Ui,1);mt(this,an);this.book=t,this.loadXML=h}async start(t,h=()=>!0){var o;(o=Z(this,Le))==null||o.pause();const d=this.book.sections[t],l=d==null?void 0:d.id;if(!l)return;const{mediaOverlay:i}=d;if(!i)return this.start(t+1);gt(this,jn,t),await ht(this,te,Bc).call(this,i);for(let r=0;r<Z(this,on).length;r++){const{items:e}=Z(this,on)[r];for(let n=0;n<e.length;n++)if(e[n].text.split("#")[0]===l&&h(e[n],n,e))return ht(this,te,Mn).call(this,r,n).catch(c=>ht(this,te,Tn).call(this,c))}}pause(){var t;gt(this,an,"paused"),(t=Z(this,Le))==null||t.pause()}resume(){var t;gt(this,an,"playing"),(t=Z(this,Le))==null||t.play().catch(h=>ht(this,te,Tn).call(this,h))}stop(){gt(this,an,"stopped"),ht(this,te,Uo).call(this)}prev(){Z(this,Ye)>0?ht(this,te,Mn).call(this,Z(this,lr),Z(this,Ye)-1):Z(this,lr)>0?ht(this,te,Mn).call(this,Z(this,lr)-1,Z(this,on)[Z(this,lr)-1].items.length-1):Z(this,jn)>0&&this.start(Z(this,jn)-1,(t,h,d)=>h===d.length-1)}next(){ht(this,te,Mn).call(this,Z(this,lr),Z(this,Ye)+1)}setVolume(t){gt(this,Vi,t),Z(this,Le)&&(Z(this,Le).volume=t)}setRate(t){gt(this,Ui,t),Z(this,Le)&&(Z(this,Le).playbackRate=t)}}on=new WeakMap,$i=new WeakMap,jn=new WeakMap,lr=new WeakMap,Ye=new WeakMap,Le=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,an=new WeakMap,te=new WeakSet,Bc=async function(t){if(Z(this,$i)===t)return;const h=await this.loadXML(t.href),d=o=>o?ii(o,t.href):null,{$:l,$$$:i}=fs(h,Re.SMIL);gt(this,lr,-1),gt(this,Ye,-1),gt(this,on,i(h,"par").reduce((o,r)=>{var p;const e=d((p=l(r,"text"))==null?void 0:p.getAttribute("src")),n=l(r,"audio");if(!e||!n)return o;const c=d(n.getAttribute("src")),a=Vo(n.getAttribute("clipBegin")),s=Vo(n.getAttribute("clipEnd")),f=o.at(-1);return(f==null?void 0:f.src)===c?f.items.push({text:e,begin:a,end:s}):o.push({src:c,items:[{text:e,begin:a,end:s}]}),o},[])),gt(this,$i,t)},Ds=function(){return Z(this,on)[Z(this,lr)]},Cn=function(){var t,h;return(h=(t=Z(this,te,Ds))==null?void 0:t.items)==null?void 0:h[Z(this,Ye)]},Tn=function(t){console.error(t),this.dispatchEvent(new CustomEvent("error",{detail:t}))},Ls=function(){this.dispatchEvent(new CustomEvent("highlight",{detail:Z(this,te,Cn)}))},zs=function(){this.dispatchEvent(new CustomEvent("unhighlight",{detail:Z(this,te,Cn)}))},Mn=async function(t,h){var o;ht(this,te,Uo).call(this),gt(this,lr,t),gt(this,Ye,h);const d=(o=Z(this,te,Ds))==null?void 0:o.src;if(!d||!Z(this,te,Cn))return this.start(Z(this,jn)+1);const l=URL.createObjectURL(await this.book.loadBlob(d)),i=new Audio(l);gt(this,Le,i),i.volume=Z(this,Vi),i.playbackRate=Z(this,Ui),i.addEventListener("timeupdate",()=>{var c,a;if(i.paused)return;const r=i.currentTime,{items:e}=Z(this,te,Ds);if(r>((c=Z(this,te,Cn))==null?void 0:c.end)&&(ht(this,te,zs).call(this),Z(this,Ye)===e.length-1)){ht(this,te,Mn).call(this,Z(this,lr)+1,0).catch(s=>ht(this,te,Tn).call(this,s));return}const n=Z(this,Ye);for(;((a=e[Z(this,Ye)+1])==null?void 0:a.begin)<=r;)Ei(this,Ye)._++;Z(this,Ye)!==n&&ht(this,te,Ls).call(this)}),i.addEventListener("error",()=>ht(this,te,Tn).call(this,new Error(`Failed to load ${d}`))),i.addEventListener("playing",()=>ht(this,te,Ls).call(this)),i.addEventListener("ended",()=>{ht(this,te,zs).call(this),URL.revokeObjectURL(l),gt(this,Le,null),ht(this,te,Mn).call(this,t+1,0).catch(r=>ht(this,te,Tn).call(this,r))}),Z(this,an)==="paused"?(ht(this,te,Ls).call(this),i.currentTime=Z(this,te,Cn).begin??0):i.addEventListener("canplaythrough",()=>{i.currentTime=Z(this,te,Cn).begin??0,gt(this,an,"playing"),i.play().catch(r=>ht(this,te,Tn).call(this,r))},{once:!0})},Uo=function(){Z(this,Le)&&(Z(this,Le).pause(),URL.revokeObjectURL(Z(this,Le).src),gt(this,Le,null),ht(this,te,zs).call(this))};const hg=/([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})/,dg=C=>{for(const w of C.getElementsByTagNameNS(Re.DC,"identifier")){const[t]=Gr(w).split(":").slice(-1);if(hg.test(t))return t}return""},Pc=C=>Gr(C.getElementById(C.documentElement.getAttribute("unique-identifier"))??C.getElementsByTagNameNS(Re.DC,"identifier")[0]),ll=async(C,w,t)=>{const h=new Uint8Array(await t.slice(0,w).arrayBuffer());w=Math.min(w,h.length);for(var d=0;d<w;d++)h[d]=h[d]^C[d%C.length];return new Blob([h,t.slice(w)],{type:t.type})},pg=async C=>{const w=new TextEncoder().encode(C),t=await globalThis.crypto.subtle.digest("SHA-1",w);return new Uint8Array(t)},mg=(C=pg)=>({"http://www.idpf.org/2008/embedding":{key:w=>C(Pc(w).replaceAll(/[\u0020\u0009\u000d\u000a]/g,"")),decode:(w,t)=>ll(w,1040,t)},"http://ns.adobe.com/pdf/enc#RC":{key:w=>{const t=dg(w).replaceAll("-","");return Uint8Array.from({length:16},(h,d)=>parseInt(t.slice(d*2,d*2+2),16))},decode:(w,t)=>ll(w,1024,t)}});var Hi,oi,Wi;class gg{constructor(w){mt(this,Hi,new Map);mt(this,oi,new Map);mt(this,Wi);gt(this,Wi,w)}async init(w,t){if(!w)return;const h=Array.from(w.getElementsByTagNameNS(Re.ENC,"EncryptedData"),d=>{var l,i;return{algorithm:(l=d.getElementsByTagNameNS(Re.ENC,"EncryptionMethod")[0])==null?void 0:l.getAttribute("Algorithm"),uri:(i=d.getElementsByTagNameNS(Re.ENC,"CipherReference")[0])==null?void 0:i.getAttribute("URI")}});for(const{algorithm:d,uri:l}of h){if(!Z(this,oi).has(d)){const i=Z(this,Wi)[d];if(!i){console.warn("Unknown encryption algorithm");continue}const o=await i.key(t);Z(this,oi).set(d,r=>i.decode(o,r))}Z(this,Hi).set(l,d)}}getDecoder(w){return Z(this,oi).get(Z(this,Hi).get(w))??(t=>t)}}Hi=new WeakMap,oi=new WeakMap,Wi=new WeakMap;class bg{constructor({opf:w,resolveHref:t}){var n,c,a,s,f;this.opf=w;const{$:h,$$:d,$$$:l}=fs(w,Re.OPF),i=h(w.documentElement,"manifest"),o=h(w.documentElement,"spine"),r=d(o,"itemref");this.manifest=d(i,"item").map(Fs("href","id","media-type","properties","media-overlay")).map(p=>{var u;return p.href=t(p.href),p.properties=(u=p.properties)==null?void 0:u.split(/\s/),p}),this.spine=r.map(Fs("idref","id","linear","properties")).map(p=>{var u;return p.properties=(u=p.properties)==null?void 0:u.split(/\s/),p}),this.pageProgressionDirection=o.getAttribute("page-progression-direction"),this.navPath=(n=this.getItemByProperty("nav"))==null?void 0:n.href,this.ncxPath=(c=this.getItemByID(o.getAttribute("toc"))??this.manifest.find(p=>p.mediaType===Ue.NCX))==null?void 0:c.href;const e=h(w.documentElement,"guide");e&&(this.guide=d(e,"reference").map(Fs("type","title","href")).map(({type:p,title:u,href:g})=>({label:u,type:p.split(/\s/),href:t(g)}))),this.cover=this.getItemByProperty("cover-image")??this.getItemByID((a=l(w,"meta").find(ng("name","cover")))==null?void 0:a.getAttribute("content"))??this.manifest.find(p=>p.href.includes("cover")&&p.mediaType.startsWith("image"))??this.getItemByHref((f=(s=this.guide)==null?void 0:s.find(p=>p.type.includes("cover")))==null?void 0:f.href),this.cfis=Td(r)}getItemByID(w){return this.manifest.find(t=>t.id===w)}getItemByHref(w){return this.manifest.find(t=>t.href===w)}getItemByProperty(w){return this.manifest.find(t=>{var h;return(h=t.properties)==null?void 0:h.includes(w)})}resolveCFI(w){const t=Bi(w),h=(t.parent??t).shift();let d=Na(this.opf,h);d&&d.nodeName!=="idref"&&(h.at(-1).id=null,d=Na(this.opf,h));const l=d==null?void 0:d.getAttribute("idref");return{index:this.spine.findIndex(r=>r.idref===l),anchor:r=>Ll(r,t)}}}var $r,Vr,Mr;class vg{constructor({loadText:w,loadBlob:t,resources:h}){mt(this,$r,new Map);mt(this,Vr,new Map);mt(this,Mr,new Map);De(this,"allowScript",!1);De(this,"eventTarget",new EventTarget);this.loadText=w,this.loadBlob=t,this.manifest=h.manifest,this.assets=h.manifest}async createURL(w,t,h,d){if(!t)return"";const l={data:t,type:h};Object.defineProperty(l,"name",{value:w});const i=new CustomEvent("data",{detail:l});this.eventTarget.dispatchEvent(i);const o=await i.detail.data,r=await i.detail.type,e=URL.createObjectURL(new Blob([o],{type:r}));if(Z(this,$r).set(w,e),Z(this,Mr).set(w,1),d){const n=Z(this,Vr).get(d);n?n.push(w):Z(this,Vr).set(d,[w])}return e}ref(w,t){const h=Z(this,Vr).get(t);return h!=null&&h.includes(w)||(Z(this,Mr).set(w,Z(this,Mr).get(w)+1),h?h.push(w):Z(this,Vr).set(t,[w])),Z(this,$r).get(w)}unref(w){if(!Z(this,Mr).has(w))return;const t=Z(this,Mr).get(w)-1;if(t<1){URL.revokeObjectURL(Z(this,$r).get(w)),Z(this,$r).delete(w),Z(this,Mr).delete(w);const h=Z(this,Vr).get(w);if(h)for(;h.length;)this.unref(h.pop());Z(this,Vr).delete(w)}else Z(this,Mr).set(w,t)}async loadItem(w,t=[]){if(!w)return null;const{href:h,mediaType:d}=w,l=Ue.JS.test(w.mediaType);if(l&&!this.allowScript)return null;const i=t.at(-1);if(Z(this,$r).has(h))return this.ref(h,i);if((l||[Ue.XHTML,Ue.HTML,Ue.CSS,Ue.SVG].includes(d))&&t.every(e=>e!==h))return this.loadReplaced(w,t);const r=Promise.resolve().then(()=>this.loadBlob(h));return this.createURL(h,r,d,i)}async loadHref(w,t,h=[]){if(Ic(w))return w;const d=ii(w,t),l=this.manifest.find(i=>i.href===d);return l?this.loadItem(l,h.concat(t)):w}async loadReplaced(w,t=[]){var r,e;const{href:h,mediaType:d}=w,l=t.at(-1);let i="";try{i=await this.loadText(h)}catch(n){return this.createURL(h,Promise.reject(n),d,l)}if(!i)return null;if([Ue.XHTML,Ue.HTML,Ue.SVG].includes(d)){let n=new DOMParser().parseFromString(i,d);if(d===Ue.XHTML&&(n.querySelector("parsererror")||!((r=n.documentElement)!=null&&r.namespaceURI))&&(console.warn(((e=n.querySelector("parsererror"))==null?void 0:e.innerText)??"Invalid XHTML"),w.mediaType=Ue.HTML,n=new DOMParser().parseFromString(i,w.mediaType)),[Ue.XHTML,Ue.SVG].includes(w.mediaType)){let s=n.firstChild;for(;s instanceof ProcessingInstruction;){if(s.data){const f=await Cs(s.data,/(?:^|\s*)(href\s*=\s*['"])([^'"]*)(['"])/i,(p,u,g,m)=>this.loadHref(g,h,t).then(v=>`${u}${v}${m}`));s.replaceWith(n.createProcessingInstruction(s.target,f))}s=s.nextSibling}}const c=async(s,f)=>s.setAttribute(f,await this.loadHref(s.getAttribute(f),h,t));for(const s of n.querySelectorAll("link[href]"))await c(s,"href");for(const s of n.querySelectorAll("[src]"))await c(s,"src");for(const s of n.querySelectorAll("[poster]"))await c(s,"poster");for(const s of n.querySelectorAll("object[data]"))await c(s,"data");for(const s of n.querySelectorAll("[*|href]:not([href])"))s.setAttributeNS(Re.XLINK,"href",await this.loadHref(s.getAttributeNS(Re.XLINK,"href"),h,t));for(const s of n.querySelectorAll("style"))s.textContent&&(s.textContent=await this.replaceCSS(s.textContent,h,t));for(const s of n.querySelectorAll("[style]"))s.setAttribute("style",await this.replaceCSS(s.getAttribute("style"),h,t));const a=new XMLSerializer().serializeToString(n);return this.createURL(h,a,w.mediaType,l)}const o=d===Ue.CSS?await this.replaceCSS(i,h,t):await this.replaceString(i,h,t);return this.createURL(h,o,d,l)}async replaceCSS(w,t,h=[]){const d=await Cs(w,/url\(\s*["']?([^'"\n]*?)\s*["']?\s*\)/gi,(l,i)=>this.loadHref(i,t,h).then(o=>`url("${o}")`));return Cs(d,/@import\s*["']([^"'\n]*?)["']/gi,(l,i)=>this.loadHref(i,t,h).then(o=>`@import "${o}"`))}replaceString(w,t,h=[]){const d=new Map,l=this.assets.map(o=>{if(o.href===t)return;const r=ig(sg(t),o.href),e=encodeURI(r),n="/"+o.href,c=encodeURI(n),a=new Set([r,e,n,c]);for(const s of a)d.set(s,o);return Array.from(a)}).flat().filter(o=>o);if(!l.length)return w;const i=new RegExp(l.map(og).join("|"),"g");return Cs(w,i,async o=>this.loadItem(d.get(o.replace(/^\//,"")),h.concat(t)))}unloadItem(w){this.unref(w==null?void 0:w.href)}destroy(){for(const w of Z(this,$r).values())URL.revokeObjectURL(w)}}$r=new WeakMap,Vr=new WeakMap,Mr=new WeakMap;const yg=(C,w)=>C.getElementById(w)??C.querySelector(`[name="${CSS.escape(w)}"]`),wg=C=>{for(const w of C){if(w==="page-spread-left"||w==="rendition:page-spread-left")return"left";if(w==="page-spread-right"||w==="rendition:page-spread-right")return"right";if(w==="rendition:page-spread-center")return"center"}},_g=C=>C?{fixedLayout:Gr(C.querySelector('option[name="fixed-layout"]')),openToSpread:Gr(C.querySelector('option[name="open-to-spread"]'))}:null;var ln,ai,yr,Fr;class xg{constructor({loadText:w,loadBlob:t,getSize:h,sha1:d}){mt(this,yr);De(this,"parser",new DOMParser);mt(this,ln);mt(this,ai);this.loadText=w,this.loadBlob=t,this.getSize=h,gt(this,ai,new gg(mg(d)))}async init(){var a,s;const w=await ht(this,yr,Fr).call(this,"META-INF/container.xml");if(!w)throw new Error("Failed to load container file");const t=Array.from(w.getElementsByTagNameNS(Re.CONTAINER,"rootfile"),Fs("full-path","media-type")).filter(f=>f.mediaType==="application/oebps-package+xml");if(!t.length)throw new Error("No package document defined in container");const h=t[0].fullPath,d=await ht(this,yr,Fr).call(this,h);if(!d)throw new Error("Failed to load package document");const l=await ht(this,yr,Fr).call(this,"META-INF/encryption.xml");await Z(this,ai).init(l,d),this.resources=new bg({opf:d,resolveHref:f=>ii(f,h)}),gt(this,ln,new vg({loadText:this.loadText,loadBlob:f=>Promise.resolve(this.loadBlob(f)).then(Z(this,ai).getDecoder(f)),resources:this.resources})),this.transformTarget=Z(this,ln).eventTarget,this.sections=this.resources.spine.map((f,p)=>{const{idref:u,linear:g,properties:m=[]}=f,v=this.resources.getItemByID(u);return v?{id:v.href,load:()=>Z(this,ln).loadItem(v),unload:()=>Z(this,ln).unloadItem(v),createDocument:()=>this.loadDocument(v),size:this.getSize(v.href),cfi:this.resources.cfis[p],linear:g,pageSpread:wg(m),resolveHref:S=>ii(S,v.href),mediaOverlay:v.mediaOverlay?this.resources.getItemByID(v.mediaOverlay):null}:(console.warn(`Could not find item with ID "${u}" in manifest`),null)}).filter(f=>f);const{navPath:i,ncxPath:o}=this.resources;if(i)try{const f=u=>ii(u,i),p=cg(await ht(this,yr,Fr).call(this,i),f);this.toc=p.toc,this.pageList=p.pageList,this.landmarks=p.landmarks}catch(f){console.warn(f)}if(!this.toc&&o)try{const f=u=>ii(u,o),p=ug(await ht(this,yr,Fr).call(this,o),f);this.toc=p.toc,this.pageList=p.pageList}catch(f){console.warn(f)}this.landmarks??(this.landmarks=this.resources.guide);const{metadata:r,rendition:e,media:n}=lg(d);this.metadata=r,this.rendition=e,this.media=n,this.dir=this.resources.pageProgressionDirection;const c=_g(await ht(this,yr,Fr).call(this,"META-INF/com.apple.ibooks.display-options.xml")??await ht(this,yr,Fr).call(this,"META-INF/com.kobobooks.display-options.xml"));return c&&(c.fixedLayout==="true"&&((a=this.rendition).layout??(a.layout="pre-paginated")),c.openToSpread==="false"&&((s=this.sections.find(f=>f.linear!=="no")).pageSpread??(s.pageSpread=this.dir==="rtl"?"left":"right"))),this}async loadDocument(w){const t=await this.loadText(w.href);return this.parser.parseFromString(t,w.mediaType)}getMediaOverlay(){return new fg(this,ht(this,yr,Fr).bind(this))}resolveCFI(w){return this.resources.resolveCFI(w)}resolveHref(w){const[t,h]=w.split("#"),d=this.resources.getItemByHref(decodeURI(t));return d?{index:this.resources.spine.findIndex(({idref:o})=>o===d.id),anchor:h?o=>yg(o,h):()=>0}:null}splitTOCHref(w){return(w==null?void 0:w.split("#"))??[]}getTOCFragment(w,t){return w.getElementById(t)??w.querySelector(`[name="${CSS.escape(t)}"]`)}isExternal(w){return Ic(w)}async getCover(){var t;const w=(t=this.resources)==null?void 0:t.cover;return w!=null&&w.href?new Blob([await this.loadBlob(w.href)],{type:w.mediaType}):null}async getCalibreBookmarks(){const w=await this.loadText("META-INF/calibre_bookmarks.txt"),t="encoding=json+base64:";if(w!=null&&w.startsWith(t)){const h=atob(w.slice(t.length));return JSON.parse(h)}}destroy(){var w;(w=Z(this,ln))==null||w.destroy()}}ln=new WeakMap,ai=new WeakMap,yr=new WeakSet,Fr=async function(w){const t=await this.loadText(w);if(!t)return null;const h=this.parser.parseFromString(t,Ue.XML);if(h.querySelector("parsererror"))throw new Error(`XML parsing error: ${w}
116
+ `)},r=n=>{try{const a=new DOMParser().parseFromString(n,"application/xml");if(a.querySelector("parsererror"))return n;const f=new XMLSerializer().serializeToString(a);return o(f)}catch{return n}},e=async()=>{l.value=!0,i.value=null;try{const n=await ki(w.url);h.value=r(n);try{d.value=await ra.codeToHtml(h.value,{lang:"xml",theme:"dark-plus"})}catch{d.value=""}}catch(n){console.error(n),i.value=t.value("xml.load_failed")}finally{l.value=!1}};return T.watch(()=>w.url,e,{immediate:!0}),(n,c)=>l.value?(T.openBlock(),T.createElementBlock("div",ym,[...c[0]||(c[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):i.value?(T.openBlock(),T.createElementBlock("div",wm,[T.createElementVNode("div",_m,[T.createElementVNode("p",xm,T.toDisplayString(i.value),1)])])):(T.openBlock(),T.createElementBlock("div",km,[T.createElementVNode("div",Sm,[T.createElementVNode("div",Em,[T.createVNode(T.unref(Ot.Code),{class:"vfp-w-4 vfp-h-4 md:vfp-w-5 md:vfp-h-5 vfp-text-white/70 vfp-flex-shrink-0"}),T.createElementVNode("span",Cm,T.toDisplayString(C.fileName),1),c[1]||(c[1]=T.createElementVNode("span",{class:"vfp-ml-auto vfp-text-xs vfp-text-white/50 vfp-uppercase vfp-flex-shrink-0"},"XML",-1))]),T.createElementVNode("div",Tm,[d.value?(T.openBlock(),T.createElementBlock("div",{key:1,class:"shiki-wrapper",innerHTML:d.value},null,8,Am)):(T.openBlock(),T.createElementBlock("pre",Mm,T.toDisplayString(h.value),1))])])]))}}),Nm=Er(Rm,[["__scopeId","data-v-21dc7ce6"]]),Om={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-bg-[#0f0f12]"},jm={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-bg-[#0f0f12]"},Im={class:"vfp-text-white/70 vfp-text-center"},Bm={class:"vfp-text-lg"},Pm={class:"content-scroll"},Fm={class:"timeline"},Dm={class:"cues"},Lm={class:"cue-meta"},zm={class:"cue-time"},$m={class:"cue-time"},Vm={class:"cue-id"},Um={key:0,class:"cue-style"},Hm={key:0,class:"cue-words"},Wm=["title"],qm={class:"cue-word-time"},Xm={class:"cue-word-text"},Zm={class:"status-pill"},Gm=T.defineComponent({__name:"index",props:{url:{},fileName:{}},setup(C){const w=C,{t}=Te(),h=T.ref(""),d=T.ref(!0),l=T.ref(null),i={srt:"srt",vtt:"vtt",lrc:"lrc",elrc:"elrc",ass:"ass",ssa:"ssa",ttml:"ttml",dfxp:"ttml"},o=s=>{var p;const f=((p=s.split(".").pop())==null?void 0:p.toLowerCase())||"";return i[f]},r=async()=>{d.value=!0,l.value=null;try{h.value=await ki(w.url)}catch(s){console.error(s),l.value=t.value("subtitle.load_failed")}finally{d.value=!1}};T.watch(()=>w.url,r,{immediate:!0});const e=T.computed(()=>{if(!h.value)return null;try{return Au(h.value,o(w.fileName))}catch(s){return console.error(s),null}}),n=T.computed(()=>{var s,f;return((s=e.value)==null?void 0:s.format)==="lrc"||((f=e.value)==null?void 0:f.format)==="elrc"}),c=T.computed(()=>{var s;return((s=e.value)==null?void 0:s.metadata)??{}}),a=s=>_s(s).slice(3,8);return(s,f)=>d.value?(T.openBlock(),T.createElementBlock("div",Om,[...f[0]||(f[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):l.value||!e.value?(T.openBlock(),T.createElementBlock("div",jm,[T.createElementVNode("div",Im,[T.createElementVNode("p",Bm,T.toDisplayString(l.value||T.unref(t)("subtitle.parse_failed")),1)])])):(T.openBlock(),T.createElementBlock("div",{key:2,class:T.normalizeClass(["vfp-relative vfp-w-full vfp-h-full vfp-bg-[#0f0f12]",n.value?"flavor-lyric":"flavor-subtitle"])},[T.createElementVNode("div",Pm,[T.createElementVNode("div",Fm,[f[3]||(f[3]=T.createElementVNode("div",{class:"timeline-line"},null,-1)),T.createElementVNode("ol",Dm,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(e.value.cues,(p,u)=>(T.openBlock(),T.createElementBlock("li",{key:"cue-"+u,class:"cue-row"},[f[2]||(f[2]=T.createElementVNode("div",{class:"cue-dot"},null,-1)),T.createElementVNode("div",Lm,[T.createElementVNode("span",zm,T.toDisplayString(T.unref(_s)(p.start)),1),f[1]||(f[1]=T.createElementVNode("span",{class:"cue-arrow"},"→",-1)),T.createElementVNode("span",$m,T.toDisplayString(T.unref(_s)(p.end)),1),T.createElementVNode("span",Vm,"#"+T.toDisplayString(p.id??u+1),1),p.style?(T.openBlock(),T.createElementBlock("span",Um,T.toDisplayString(p.style),1)):T.createCommentVNode("",!0)]),p.words&&p.words.length>0?(T.openBlock(),T.createElementBlock("div",Hm,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(p.words,(g,m)=>(T.openBlock(),T.createElementBlock("span",{key:"w-"+m,class:"cue-word",title:T.unref(_s)(g.start)},[T.createElementVNode("span",qm,T.toDisplayString(a(g.start)),1),T.createElementVNode("span",Xm,T.toDisplayString(g.text),1)],8,Wm))),128))])):(T.openBlock(),T.createElementBlock("p",{key:1,class:T.normalizeClass(["cue-text",{lyric:n.value}])},T.toDisplayString(p.text),3))]))),128))])])]),T.createElementVNode("div",Zm,[T.createElementVNode("span",null,T.toDisplayString(e.value.cues.length)+" "+T.toDisplayString(n.value?T.unref(t)("subtitle.lines"):T.unref(t)("subtitle.cues")),1),c.value.length?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[f[4]||(f[4]=T.createElementVNode("span",{class:"dot"},"·",-1)),T.createElementVNode("span",null,T.toDisplayString(c.value.length),1)],64)):T.createCommentVNode("",!0)])],2))}}),Km=Er(Gm,[["__scopeId","data-v-1ebcbb6d"]]),Ym={class:"vfp-flex-1 vfp-min-w-0 vfp-min-h-0 vfp-overflow-hidden"},Jm=T.defineComponent({name:"ResizableSplit",__name:"ResizableSplit",props:{initialLeftWidth:{default:280},minLeftWidth:{default:160},maxLeftWidth:{default:640},minRightWidth:{default:200},storageKey:{},desktopMedia:{default:"(min-width: 768px)"}},setup(C){const w=C,t=T.ref(null),h=T.ref((()=>{if(w.storageKey&&typeof window<"u"){const a=Number(window.localStorage.getItem(w.storageKey));if(!isNaN(a)&&a>0)return a}return w.initialLeftWidth})()),d=T.ref(!1),l=T.ref(!1);let i=null;const o=()=>{i&&(l.value=i.matches)},r=T.computed(()=>l.value?{width:`${h.value}px`}:void 0),e=a=>{if(!t.value)return;const s=t.value.getBoundingClientRect(),f=a.clientX-s.left,p=s.width-w.minRightWidth-6,u=Math.min(w.maxLeftWidth,p);h.value=Math.max(w.minLeftWidth,Math.min(u,f))},n=()=>{if(d.value&&(d.value=!1,window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n),document.body.style.cursor="",document.body.style.userSelect="",w.storageKey))try{window.localStorage.setItem(w.storageKey,String(h.value))}catch{}},c=a=>{a.preventDefault(),d.value=!0,window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),document.body.style.cursor="col-resize",document.body.style.userSelect="none"};return T.onMounted(()=>{typeof window<"u"&&(i=window.matchMedia(w.desktopMedia),o(),i.addEventListener("change",o))}),T.onBeforeUnmount(()=>{i&&i.removeEventListener("change",o),window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n),d.value&&(document.body.style.cursor="",document.body.style.userSelect="")}),T.watch(()=>w.initialLeftWidth,a=>{w.storageKey||(h.value=a)}),(a,s)=>(T.openBlock(),T.createElementBlock("div",{ref_key:"containerRef",ref:t,class:"vfp-w-full vfp-h-full vfp-flex vfp-flex-col md:vfp-flex-row vfp-min-h-0 vfp-min-w-0"},[T.createElementVNode("div",{class:"vfp-min-h-0 vfp-min-w-0 vfp-flex-shrink-0 vfp-w-full vfp-max-h-60 md:vfp-h-full md:vfp-max-h-none",style:T.normalizeStyle(r.value)},[T.renderSlot(a.$slots,"left",{},void 0,!0)],4),T.createElementVNode("div",{role:"separator","aria-orientation":"vertical",class:T.normalizeClass(["split-divider vfp-hidden md:vfp-block vfp-relative vfp-w-1.5 vfp-flex-shrink-0 vfp-cursor-col-resize vfp-transition-colors",d.value?"dragging":""]),onMousedown:c},[...s[0]||(s[0]=[T.createElementVNode("span",{class:"vfp-absolute vfp-inset-y-0 hit-area"},null,-1)])],34),T.createElementVNode("div",Ym,[T.renderSlot(a.$slots,"right",{},void 0,!0)])],512))}}),Qm=Er(Jm,[["__scopeId","data-v-790c366f"]]),t0={key:0},e0={class:"vfp-truncate vfp-flex-1 vfp-min-w-0"},r0={class:"vfp-flex-1 vfp-truncate vfp-min-w-0"},n0={class:"vfp-text-xs vfp-text-white/30 vfp-flex-shrink-0 vfp-ml-2"},i0={name:"ZipTreeItem"},s0=T.defineComponent({...i0,props:{node:{},depth:{},selectedPath:{},expanded:{}},emits:["toggle","select","hover","leave"],setup(C,{emit:w}){const t=C,h=w,d=T.computed(()=>({paddingLeft:`${t.depth*14+10}px`})),l=T.computed(()=>t.expanded.has(t.node.path)),i=T.computed(()=>t.selectedPath===t.node.path),o=T.computed(()=>{const n=na({name:t.node.name,type:""});return n==="image"?Ot.FileImage:n==="text"||n==="markdown"||n==="json"||n==="csv"||n==="xml"||n==="subtitle"?t.node.name.endsWith(".md")||t.node.name.endsWith(".markdown")?Ot.FileText:Ot.FileCode:Ot.File}),r=n=>{const c=n.currentTarget.getBoundingClientRect();h("hover",t.node.name||"/",c)},e=()=>h("leave");return(n,c)=>{const a=T.resolveComponent("ZipTreeItem");return C.node.isDir?(T.openBlock(),T.createElementBlock("div",t0,[T.createElementVNode("button",{type:"button",class:"tree-row dir-row",style:T.normalizeStyle(d.value),onClick:c[0]||(c[0]=s=>h("toggle",C.node.path)),onMouseenter:r,onMouseleave:e},[T.createVNode(T.unref(Ot.ChevronRight),{class:T.normalizeClass(["vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0 vfp-transition-transform",{"vfp-rotate-90":l.value}])},null,8,["class"]),(T.openBlock(),T.createBlock(T.resolveDynamicComponent(l.value?T.unref(Ot.FolderOpen):T.unref(Ot.Folder)),{class:"vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-amber-300/80"})),T.createElementVNode("span",e0,T.toDisplayString(C.node.name||"/"),1)],36),l.value&&C.node.children?(T.openBlock(!0),T.createElementBlock(T.Fragment,{key:0},T.renderList(C.node.children,s=>(T.openBlock(),T.createBlock(a,{key:s.path,node:s,depth:C.depth+1,"selected-path":C.selectedPath,expanded:C.expanded,onToggle:c[1]||(c[1]=f=>h("toggle",f)),onSelect:c[2]||(c[2]=f=>h("select",f)),onHover:c[3]||(c[3]=(f,p)=>h("hover",f,p)),onLeave:c[4]||(c[4]=f=>h("leave"))},null,8,["node","depth","selected-path","expanded"]))),128)):T.createCommentVNode("",!0)])):(T.openBlock(),T.createElementBlock("button",{key:1,type:"button",class:T.normalizeClass(["tree-row file-row",{selected:i.value}]),style:T.normalizeStyle(d.value),onClick:c[5]||(c[5]=s=>h("select",C.node)),onMouseenter:r,onMouseleave:e},[c[6]||(c[6]=T.createElementVNode("span",{class:"vfp-w-3.5 vfp-h-3.5 vfp-flex-shrink-0"},null,-1)),(T.openBlock(),T.createBlock(T.resolveDynamicComponent(o.value),{class:"vfp-w-4 vfp-h-4 vfp-flex-shrink-0 vfp-text-white/50"})),T.createElementVNode("span",r0,T.toDisplayString(C.node.name),1),T.createElementVNode("span",n0,T.toDisplayString(T.unref(ia)(C.node.size)),1)],38))}}}),o0=Er(s0,[["__scopeId","data-v-5385318d"]]),a0={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},l0={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},c0={class:"vfp-text-white/70 vfp-text-center"},u0={class:"vfp-text-lg"},f0={class:"vfp-w-full vfp-h-full vfp-overflow-auto"},h0={class:"vfp-w-full vfp-h-full vfp-flex vfp-flex-col"},d0={key:0,class:"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-white/40 vfp-text-sm vfp-p-6"},p0={key:1,class:"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center"},m0={key:2,class:"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-text-white/70"},g0={key:3,class:"vfp-flex-1 vfp-min-h-0 vfp-overflow-hidden vfp-flex"},b0=T.defineComponent({__name:"index",props:{url:{},nestingDepth:{default:0}},emits:["statsChange"],setup(C,{emit:w}){const t=T.defineAsyncComponent(()=>Promise.resolve().then(()=>K0)),h=C,d=w,{t:l}=Te(),i=T.ref(null),o=T.ref(null),r=T.ref(!0),e=T.ref(null),n=T.ref(new Set([""])),c=T.ref(null),a=T.ref(!1),s=T.ref(null),f=T.ref(null),p=()=>{var F;(F=c.value)!=null&&F.blobUrl&&URL.revokeObjectURL(c.value.blobUrl)},u=async()=>{p(),c.value=null,r.value=!0,e.value=null;try{const F=await fetch(h.url);if(!F.ok)throw new Error("加载失败");const j=await F.arrayBuffer(),L=await Ru(j),$=Nu(L),V=Ou($);i.value=L,o.value=V;const z=new Set([""]);if(V.children)for(const E of V.children)E.isDir&&z.add(E.path);n.value=z}catch(F){console.error(F),e.value=l.value("zip.load_failed")}finally{r.value=!1}};T.watch(()=>h.url,u,{immediate:!0}),T.onBeforeUnmount(()=>{p()});const g=T.computed(()=>{if(!o.value)return null;let F=0,j=0,L=0;const $=V=>{var z;V.isDir?(V.path&&j++,(z=V.children)==null||z.forEach($)):(F++,L+=V.size)};return $(o.value),{files:F,dirs:j,size:L}});T.watch(g,F=>d("statsChange",F),{immediate:!0}),T.onBeforeUnmount(()=>d("statsChange",null));const m=F=>{const j=new Set(n.value);j.has(F)?j.delete(F):j.add(F),n.value=j},v=(F,j)=>{f.value={text:F,x:j.right+8,y:j.top+j.height/2}},S=()=>{f.value=null},R=async F=>{if(!(!i.value||F.isDir)){p(),a.value=!0,s.value=null;try{const j=Oi(F.name),L=await ju(i.value,F.path,j!=="application/octet-stream"?j:void 0),$=URL.createObjectURL(L);c.value={path:F.path,name:F.name,size:F.size,blobUrl:$}}catch(j){console.error(j),s.value="条目读取失败"}finally{a.value=!1}}},I=T.computed(()=>c.value?[{name:c.value.name,url:c.value.blobUrl,type:Oi(c.value.name)}]:[]);return(F,j)=>r.value?(T.openBlock(),T.createElementBlock("div",a0,[...j[0]||(j[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):e.value||!o.value?(T.openBlock(),T.createElementBlock("div",l0,[T.createElementVNode("div",c0,[T.createElementVNode("p",u0,T.toDisplayString(e.value||T.unref(l)("zip.parse_failed")),1)])])):(T.openBlock(),T.createElementBlock(T.Fragment,{key:2},[T.createVNode(Qm,{"initial-left-width":280,"min-left-width":180,"max-left-width":560,"storage-key":"vfp-zip-split-left"},{left:T.withCtx(()=>[T.createElementVNode("div",f0,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(o.value.children||[],L=>{var $;return T.openBlock(),T.createBlock(o0,{key:L.path,node:L,depth:0,"selected-path":(($=c.value)==null?void 0:$.path)??null,expanded:n.value,onToggle:m,onSelect:R,onHover:v,onLeave:S},null,8,["node","selected-path","expanded"])}),128))])]),right:T.withCtx(()=>[T.createElementVNode("div",h0,[c.value?a.value?(T.openBlock(),T.createElementBlock("div",p0,[...j[1]||(j[1]=[T.createElementVNode("div",{class:"vfp-w-8 vfp-h-8 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):s.value?(T.openBlock(),T.createElementBlock("div",m0,T.toDisplayString(s.value),1)):(T.openBlock(),T.createElementBlock("div",g0,[T.createVNode(T.unref(t),{mode:"embed",files:I.value,"current-index":0,"zip-nesting-depth":C.nestingDepth+1},null,8,["files","zip-nesting-depth"])])):(T.openBlock(),T.createElementBlock("div",d0," 从左侧选择一个文件以预览 "))])]),_:1}),(T.openBlock(),T.createBlock(T.Teleport,{to:"body"},[f.value?(T.openBlock(),T.createElementBlock("div",{key:0,class:"vfp-zip-tip",style:T.normalizeStyle({left:f.value.x+"px",top:f.value.y+"px"})},T.toDisplayString(f.value.text),5)):T.createCommentVNode("",!0)]))],64))}}),v0={key:0,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},y0={key:1,class:"vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full"},w0={class:"vfp-text-white/70 vfp-text-center"},_0={class:"vfp-text-lg"},x0={key:2,class:"vfp-w-full vfp-h-full vfp-bg-white"},k0=["srcdoc","title"],S0={key:3,class:"vfp-w-full vfp-h-full vfp-overflow-auto",style:{background:"#1e1e1e"}},E0=["innerHTML"],C0=T.defineComponent({__name:"index",props:{url:{},fileName:{},wordWrap:{type:Boolean,default:!0},htmlPreview:{type:Boolean,default:!1}},setup(C){const w=C,{t}=Te(),h=T.ref(""),d=T.ref(""),l=T.ref(!0),i=T.ref(null),o=T.computed(()=>yu(w.fileName)),r=async()=>{l.value=!0,i.value=null;try{const e=await ki(w.url);if(h.value=e,o.value!=="text")try{d.value=await ra.codeToHtml(e,{lang:o.value,theme:"dark-plus"})}catch{d.value=""}else d.value=""}catch(e){console.error(e),i.value=t.value("text.load_failed")}finally{l.value=!1}};return T.watch(()=>w.url,r,{immediate:!0}),(e,n)=>l.value?(T.openBlock(),T.createElementBlock("div",v0,[...n[0]||(n[0]=[T.createElementVNode("div",{class:"vfp-w-12 vfp-h-12 vfp-border-4 vfp-border-white/20 vfp-border-t-white vfp-rounded-full vfp-animate-spin"},null,-1)])])):i.value?(T.openBlock(),T.createElementBlock("div",y0,[T.createElementVNode("div",w0,[T.createElementVNode("p",_0,T.toDisplayString(i.value),1)])])):C.htmlPreview&&o.value==="html"?(T.openBlock(),T.createElementBlock("div",x0,[T.createElementVNode("iframe",{srcdoc:h.value,sandbox:"allow-same-origin",class:"vfp-w-full vfp-h-full vfp-border-0",title:C.fileName},null,8,k0)])):(T.openBlock(),T.createElementBlock("div",S0,[d.value?(T.openBlock(),T.createElementBlock("div",{key:1,class:T.normalizeClass(["shiki-wrapper",{"no-wrap":!C.wordWrap}]),innerHTML:d.value},null,10,E0)):(T.openBlock(),T.createElementBlock("pre",{key:0,class:T.normalizeClass(["vfp-p-6 vfp-text-white/90 vfp-font-mono vfp-text-sm",C.wordWrap?"vfp-whitespace-pre-wrap vfp-break-words":"vfp-whitespace-pre"])},T.toDisplayString(h.value),3))]))}}),T0=Er(C0,[["__scopeId","data-v-82d3d091"]]),M0={class:"vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-8 vfp-gap-6"},A0={class:"vfp-w-32 vfp-h-32 vfp-rounded-full vfp-bg-white/10 vfp-flex vfp-items-center vfp-justify-center"},R0={class:"vfp-text-white vfp-text-center"},N0={class:"vfp-text-xl vfp-font-medium vfp-mb-2"},O0={class:"vfp-text-white/70"},Fa=T.defineComponent({__name:"index",props:{fileName:{},fileType:{}},emits:["download"],setup(C,{emit:w}){const{t}=Te(),h=w;return(d,l)=>(T.openBlock(),T.createElementBlock("div",M0,[T.createElementVNode("div",A0,[T.createVNode(T.unref(Ot.FileQuestion),{class:"vfp-w-16 vfp-h-16 vfp-text-white/70"})]),T.createElementVNode("div",R0,[T.createElementVNode("p",N0,T.toDisplayString(C.fileName),1),T.createElementVNode("p",O0,T.toDisplayString(T.unref(t)("common.unsupported_preview",{type:C.fileType})),1)]),T.createElementVNode("button",{class:"vfp-flex vfp-items-center vfp-gap-2 vfp-px-6 vfp-py-3 vfp-bg-white/10 hover:vfp-bg-white/20 vfp-backdrop-blur-sm vfp-rounded-lg vfp-text-white vfp-font-medium vfp-transition-all",onClick:l[0]||(l[0]=i=>h("download"))},[T.createVNode(T.unref(Ot.Download),{class:"vfp-w-5 vfp-h-5"}),T.createTextVNode(" "+T.toDisplayString(T.unref(t)("common.download")),1)])]))}}),j0=["tabindex"],I0={class:"vfp-flex-shrink-0 vfp-z-10 vfp-bg-black/50 vfp-backdrop-blur-md vfp-border-b vfp-border-white/10",style:{"padding-top":"env(safe-area-inset-top, 0px)"}},B0={class:"vfp-flex vfp-items-center vfp-justify-between vfp-px-3 md:vfp-px-5 vfp-py-1.5 md:vfp-py-2.5"},P0={class:"vfp-flex vfp-items-center vfp-flex-1 vfp-min-w-0 vfp-mr-2 md:vfp-mr-3"},F0={class:"vfp-text-white/90 vfp-font-medium vfp-text-xs md:vfp-text-sm vfp-truncate"},D0={class:"vfp-text-white/40 vfp-text-xs vfp-ml-2 vfp-flex-shrink-0"},L0={class:"vfp-flex vfp-items-center vfp-gap-1 md:vfp-hidden vfp-flex-shrink-0"},z0=["data-tooltip","disabled","onClick"],$0={class:"vfp-hidden md:vfp-flex vfp-items-center vfp-gap-1 vfp-flex-shrink-0"},V0=["data-tooltip","disabled","onClick"],U0=["data-tooltip","disabled","onClick"],H0={key:0,class:"vfp-flex vfp-items-center vfp-gap-1 vfp-px-3 vfp-pb-1.5 vfp-overflow-x-auto scrollbar-hide md:vfp-hidden"},W0={key:0,class:"vfp-w-px vfp-h-4 vfp-bg-white/10 vfp-mx-0.5"},q0=["data-tooltip","disabled","onClick"],X0=3,Z0=2e3,G0=T.defineComponent({__name:"FilePreviewContent",props:{files:{},currentIndex:{},customRenderers:{default:()=>[]},mode:{default:"modal"},zipNestingDepth:{default:0},locale:{default:void 0},messages:{default:void 0}},emits:["navigate","close"],setup(C,{emit:w}){const t=C,h=w;Ol(T.toRef(t,"locale"),T.toRef(t,"messages"));const{t:d}=Te(),l=T.ref(1),i=T.ref(0),o=T.ref(1),r=T.ref(1),e=T.ref(0),n=T.ref(0),c=T.ref(0),a=T.ref(null),s=T.ref(null),f=T.ref(!0);let p=null;const u=()=>{f.value=!0,p!==null&&clearTimeout(p),p=window.setTimeout(()=>{f.value=!1},Z0)},g=()=>u(),m=T.computed(()=>Al(t.files)),v=T.computed(()=>m.value[t.currentIndex]),S=T.computed(()=>v.value&&t.customRenderers.find(rt=>rt.test(v.value))||null),R=T.computed(()=>!S.value||!v.value?null:S.value.render(v.value)),I=T.computed(()=>v.value?na(v.value):"unsupported");T.watch(()=>t.currentIndex,()=>{l.value=1,i.value=0,o.value=1,r.value=1,e.value=0,n.value=0,f.value=!0,p!==null&&clearTimeout(p)}),T.watch([I,e,n],()=>{if(I.value==="image"&&e.value>0&&n.value>0&&a.value){const rt=a.value.clientWidth,it=a.value.clientHeight,J=rt/e.value,et=it/n.value,nt=Math.min(J,et);l.value=Math.max(.01,Math.min(10,nt))}}),T.watch(()=>m.value.length,rt=>{rt>1&&u()},{immediate:!0});const F=rt=>{rt.key==="Escape"&&t.mode==="modal"?h("close"):rt.key==="ArrowLeft"&&t.currentIndex>0?h("navigate",t.currentIndex-1):rt.key==="ArrowRight"&&t.currentIndex<m.value.length-1&&h("navigate",t.currentIndex+1)};T.onMounted(()=>{t.mode==="modal"?window.addEventListener("keydown",F):s.value&&s.value.addEventListener("keydown",F)}),T.onBeforeUnmount(()=>{p!==null&&clearTimeout(p),t.mode==="modal"?window.removeEventListener("keydown",F):s.value&&s.value.removeEventListener("keydown",F)});const j=()=>{l.value=Math.min(l.value+.1,10)},L=()=>{l.value=Math.max(l.value-.1,.01)},$=()=>{i.value=i.value+90},V=()=>{i.value=i.value-90},z=()=>{if(a.value&&e.value>0&&n.value>0){const rt=a.value.clientWidth,it=a.value.clientHeight,J=rt/e.value,et=it/n.value,nt=Math.min(J,et);l.value=Math.max(.01,Math.min(10,nt))}else l.value=1;i.value=0,c.value++},E=()=>{l.value=1,i.value=0,c.value++},A=rt=>{l.value=rt},k=()=>{l.value=1,i.value=0,c.value++},b=()=>{if(!v.value)return;const rt=document.createElement("a");rt.href=v.value.url,rt.download=v.value.name,rt.click()},y=T.computed(()=>t.mode==="modal"),_=T.ref(null),x=T.ref(0),M=T.ref(0),B=T.ref(!1),P=T.ref(null),H=T.ref(0),W=T.ref(0),K=T.ref(!1),D=(rt,it)=>{x.value=rt,M.value=it},X=(rt,it)=>{H.value=rt,W.value=it},O=T.ref(null),N=rt=>{O.value=rt},U=T.ref(!0),q=T.ref(!1),Y=T.computed(()=>{var rt;if(I.value==="image")return Ju({zoom:l.value,onZoomIn:j,onZoomOut:L,onFitToWidth:z,onOriginalSize:E,onRotateLeft:V,onRotateRight:$,onReset:k,t:d.value});if(I.value==="pdf")return Qu({zoom:l.value,onZoomIn:j,onZoomOut:L,onReset:k,t:d.value});if(I.value==="epub")return tf({epubRef:_.value,current:x.value,total:M.value,fullWidth:B.value,t:d.value});if(I.value==="mobi")return ef({mobiRef:P.value,current:H.value,total:W.value,fullWidth:K.value,t:d.value});if(I.value==="zip")return rf({stats:O.value,t:d.value});if(I.value==="text"){const it=((rt=v.value.name.split(".").pop())==null?void 0:rt.toLowerCase())||"";return nf({wordWrap:U.value,onToggleWrap:()=>{U.value=!U.value},isHtml:it==="html"||it==="htm",htmlPreview:q.value,onToggleHtmlPreview:()=>{q.value=!q.value},t:d.value})}return[]}),G=T.computed(()=>{const rt=[{items:[{type:"button",icon:Ot.Download,tooltip:d.value("common.download"),action:b}]}];return y.value&&rt.push({items:[{type:"button",icon:Ot.X,tooltip:d.value("common.close"),action:()=>h("close")}]}),rt}),Q=T.computed(()=>Y.value.length>0);return(rt,it)=>{var J;return T.openBlock(),T.createElementBlock("div",{ref_key:"rootRef",ref:s,tabindex:C.mode==="embed"?0:-1,class:"vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-flex-col vfp-overflow-hidden vfp-outline-none"},[T.createElementVNode("div",I0,[T.createElementVNode("div",B0,[T.createElementVNode("div",P0,[T.createElementVNode("h2",F0,T.toDisplayString((J=v.value)==null?void 0:J.name),1),T.createElementVNode("span",D0,T.toDisplayString(C.currentIndex+1)+"/"+T.toDisplayString(m.value.length),1)]),T.createElementVNode("div",L0,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(G.value,(et,nt)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"m-action-"+nt},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(et.items,(ot,at)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"m-action-"+nt+"-"+at},[ot.type==="button"?(T.openBlock(),T.createElementBlock("button",{key:0,class:"toolbar-btn","data-tooltip":ot.tooltip,disabled:ot.disabled,onClick:ot.action},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(ot.icon),{class:"vfp-w-4 vfp-h-4"}))],8,z0)):T.createCommentVNode("",!0)],64))),128))],64))),128))]),T.createElementVNode("div",$0,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(Y.value,(et,nt)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"d-tool-"+nt},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(et.items,(ot,at)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"d-tool-"+nt+"-"+at},[ot.type==="button"?(T.openBlock(),T.createElementBlock("button",{key:0,class:"toolbar-btn","data-tooltip":ot.tooltip,disabled:ot.disabled,onClick:ot.action},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(ot.icon),{class:"vfp-w-4 vfp-h-4"}))],8,V0)):ot.type==="text"?(T.openBlock(),T.createElementBlock("span",{key:1,class:"vfp-text-white/60 vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums",style:T.normalizeStyle({minWidth:ot.minWidth||"auto"})},T.toDisplayString(ot.content),5)):T.createCommentVNode("",!0)],64))),128)),it[11]||(it[11]=T.createElementVNode("div",{class:"vfp-w-px vfp-h-4 vfp-bg-white/10 vfp-mx-1"},null,-1))],64))),128)),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(G.value,(et,nt)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"d-action-"+nt},[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(et.items,(ot,at)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"d-action-"+nt+"-"+at},[ot.type==="button"?(T.openBlock(),T.createElementBlock("button",{key:0,class:"toolbar-btn","data-tooltip":ot.tooltip,disabled:ot.disabled,onClick:ot.action},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(ot.icon),{class:"vfp-w-4 vfp-h-4"}))],8,U0)):T.createCommentVNode("",!0)],64))),128))],64))),128))])]),Q.value?(T.openBlock(),T.createElementBlock("div",H0,[(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(Y.value,(et,nt)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"m-tool-"+nt},[nt>0?(T.openBlock(),T.createElementBlock("div",W0)):T.createCommentVNode("",!0),(T.openBlock(!0),T.createElementBlock(T.Fragment,null,T.renderList(et.items,(ot,at)=>(T.openBlock(),T.createElementBlock(T.Fragment,{key:"m-tool-"+nt+"-"+at},[ot.type==="button"?(T.openBlock(),T.createElementBlock("button",{key:0,class:"toolbar-btn","data-tooltip":ot.tooltip,disabled:ot.disabled,onClick:ot.action},[(T.openBlock(),T.createBlock(T.resolveDynamicComponent(ot.icon),{class:"vfp-w-4 vfp-h-4"}))],8,q0)):ot.type==="text"?(T.openBlock(),T.createElementBlock("span",{key:1,class:"vfp-text-white/60 vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums",style:T.normalizeStyle({minWidth:ot.minWidth||"auto"})},T.toDisplayString(ot.content),5)):T.createCommentVNode("",!0)],64))),128))],64))),128))])):T.createCommentVNode("",!0)]),T.createElementVNode("div",{ref_key:"contentRef",ref:a,class:"vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-overflow-auto",onMousemove:g},[v.value?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[R.value?(T.openBlock(),T.createBlock(T.resolveDynamicComponent(R.value),{key:0,file:v.value},null,8,["file"])):(T.openBlock(),T.createElementBlock(T.Fragment,{key:1},[I.value==="image"?(T.openBlock(),T.createBlock(uf,{key:0,url:v.value.url,zoom:l.value,rotation:i.value,"reset-key":c.value,"file-size":v.value.size,onZoomChange:A,onNaturalWidthChange:it[0]||(it[0]=et=>e.value=et),onNaturalHeightChange:it[1]||(it[1]=et=>n.value=et)},null,8,["url","zoom","rotation","reset-key","file-size"])):I.value==="pdf"?(T.openBlock(),T.createBlock(gf,{key:1,url:v.value.url,zoom:l.value,"current-page":o.value,onPageChange:it[2]||(it[2]=et=>o.value=et),onTotalPagesChange:it[3]||(it[3]=et=>r.value=et),onPageWidthChange:it[4]||(it[4]=et=>e.value=et)},null,8,["url","zoom","current-page"])):I.value==="docx"?(T.openBlock(),T.createBlock(Ef,{key:2,url:v.value.url},null,8,["url"])):I.value==="xlsx"?(T.openBlock(),T.createBlock(Lf,{key:3,url:v.value.url},null,8,["url"])):I.value==="pptx"?(T.openBlock(),T.createBlock(Kf,{key:4,url:v.value.url},null,8,["url"])):I.value==="msg"?(T.openBlock(),T.createBlock(sd,{key:5,url:v.value.url},null,8,["url"])):I.value==="epub"?(T.openBlock(),T.createBlock(gd,{key:6,ref_key:"epubRef",ref:_,url:v.value.url,onChapterChange:D,onFullWidthChange:it[5]||(it[5]=et=>B.value=et)},null,8,["url"])):I.value==="mobi"?(T.openBlock(),T.createBlock(np,{key:7,ref_key:"mobiRef",ref:P,url:v.value.url,onChapterChange:X,onFullWidthChange:it[6]||(it[6]=et=>K.value=et)},null,8,["url"])):I.value==="video"?(T.openBlock(),T.createBlock(dp,{key:8,url:v.value.url},null,8,["url"])):I.value==="audio"?(T.openBlock(),T.createBlock(zp,{key:9,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="markdown"?(T.openBlock(),T.createBlock(Gp,{key:10,url:v.value.url},null,8,["url"])):I.value==="json"?(T.openBlock(),T.createBlock(im,{key:11,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="csv"?(T.openBlock(),T.createBlock(vm,{key:12,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="xml"?(T.openBlock(),T.createBlock(Nm,{key:13,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="subtitle"?(T.openBlock(),T.createBlock(Km,{key:14,url:v.value.url,"file-name":v.value.name},null,8,["url","file-name"])):I.value==="zip"&&t.zipNestingDepth>=X0?(T.openBlock(),T.createBlock(Fa,{key:15,"file-name":v.value.name,"file-type":v.value.type,onDownload:b},null,8,["file-name","file-type"])):I.value==="zip"?(T.openBlock(),T.createBlock(b0,{key:16,url:v.value.url,"nesting-depth":t.zipNestingDepth,onStatsChange:N},null,8,["url","nesting-depth"])):I.value==="text"?(T.openBlock(),T.createBlock(T0,{key:17,url:v.value.url,"file-name":v.value.name,"word-wrap":U.value,"html-preview":q.value},null,8,["url","file-name","word-wrap","html-preview"])):(T.openBlock(),T.createBlock(Fa,{key:18,"file-name":v.value.name,"file-type":v.value.type,onDownload:b},null,8,["file-name","file-type"]))],64))],64)):T.createCommentVNode("",!0)],544),m.value.length>1?(T.openBlock(),T.createElementBlock(T.Fragment,{key:0},[C.currentIndex>0?(T.openBlock(),T.createElementBlock("button",{key:0,style:T.normalizeStyle({opacity:f.value?1:0,transform:f.value?"translateY(-50%)":"translateY(-50%) translateX(-20px)",pointerEvents:f.value?"auto":"none",transition:"opacity 0.2s, transform 0.2s"}),class:"vfp-absolute vfp-z-20 vfp-left-2 md:vfp-left-4 vfp-top-1/2 vfp-w-10 vfp-h-10 md:vfp-w-12 md:vfp-h-12 vfp-rounded-full vfp-bg-black/40 vfp-backdrop-blur-xl vfp-border vfp-border-white/10 vfp-flex vfp-items-center vfp-justify-center vfp-text-white hover:vfp-bg-black/60 vfp-transition-colors vfp-shadow-2xl",onClick:it[7]||(it[7]=et=>h("navigate",C.currentIndex-1)),onMouseenter:it[8]||(it[8]=et=>f.value=!0)},[T.createVNode(T.unref(Ot.ChevronLeft),{class:"vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6"})],36)):T.createCommentVNode("",!0),C.currentIndex<m.value.length-1?(T.openBlock(),T.createElementBlock("button",{key:1,style:T.normalizeStyle({opacity:f.value?1:0,transform:f.value?"translateY(-50%)":"translateY(-50%) translateX(20px)",pointerEvents:f.value?"auto":"none",transition:"opacity 0.2s, transform 0.2s"}),class:"vfp-absolute vfp-z-20 vfp-right-2 md:vfp-right-4 vfp-top-1/2 vfp-w-10 vfp-h-10 md:vfp-w-12 md:vfp-h-12 vfp-rounded-full vfp-bg-black/40 vfp-backdrop-blur-xl vfp-border vfp-border-white/10 vfp-flex vfp-items-center vfp-justify-center vfp-text-white hover:vfp-bg-black/60 vfp-transition-colors vfp-shadow-2xl",onClick:it[9]||(it[9]=et=>h("navigate",C.currentIndex+1)),onMouseenter:it[10]||(it[10]=et=>f.value=!0)},[T.createVNode(T.unref(Ot.ChevronRight),{class:"vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6"})],36)):T.createCommentVNode("",!0)],64)):T.createCommentVNode("",!0)],8,j0)}}}),uo=Er(G0,[["__scopeId","data-v-829ecc7c"]]),K0=Object.freeze(Object.defineProperty({__proto__:null,default:uo},Symbol.toStringTag,{value:"Module"}));function Y0(C){let w="",t="",h=!1;const d=()=>{if(h||typeof document>"u")return;w=document.body.style.overflow,t=document.body.style.paddingRight;const i=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",i>0&&(document.body.style.paddingRight=`${i}px`),h=!0},l=()=>{!h||typeof document>"u"||(document.body.style.overflow=w,document.body.style.paddingRight=t,h=!1)};return T.onMounted(()=>{C()&&d()}),T.onUnmounted(()=>{l()}),{lock:d,unlock:l}}const J0={key:0,class:"vfp-root"},Q0=T.defineComponent({__name:"FilePreviewModal",props:{files:{},currentIndex:{},isOpen:{type:Boolean},customRenderers:{default:()=>[]},locale:{default:void 0},messages:{default:void 0}},emits:["close","navigate"],setup(C,{emit:w}){const t=C,h=w,{lock:d,unlock:l}=Y0(()=>t.isOpen);T.watch(()=>t.isOpen,e=>{e?d():l()});const i=()=>h("close"),o=e=>e.stopPropagation(),r=e=>e.stopPropagation();return(e,n)=>(T.openBlock(),T.createBlock(T.Teleport,{to:"body"},[T.createVNode(T.Transition,{name:"vfp-fade"},{default:T.withCtx(()=>[C.isOpen?(T.openBlock(),T.createElementBlock("div",J0,[T.createElementVNode("div",{class:"vfp-fixed vfp-inset-0 vfp-z-[9999] vfp-flex vfp-items-center vfp-justify-center vfp-bg-black/80 vfp-backdrop-blur-md vfp-overflow-hidden",onClick:i,onWheel:r},[T.createElementVNode("div",{class:"vfp-relative vfp-w-full vfp-h-full",onClick:o},[T.createVNode(uo,{mode:"modal",files:C.files,"current-index":C.currentIndex,"custom-renderers":C.customRenderers,locale:C.locale,messages:C.messages,onClose:n[0]||(n[0]=c=>h("close")),onNavigate:n[1]||(n[1]=c=>h("navigate",c))},null,8,["files","current-index","custom-renderers","locale","messages"])])],32)])):T.createCommentVNode("",!0)]),_:1})]))}}),t1={class:"vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-black/80"},e1=T.defineComponent({__name:"FilePreviewEmbed",props:{files:{},currentIndex:{default:0},customRenderers:{default:()=>[]},width:{default:"100%"},height:{default:"100%"},locale:{default:void 0},messages:{default:void 0}},emits:["navigate"],setup(C,{emit:w}){const t=C,h=w,d={width:typeof t.width=="number"?`${t.width}px`:t.width,height:typeof t.height=="number"?`${t.height}px`:t.height};return(l,i)=>(T.openBlock(),T.createElementBlock("div",{class:"vfp-root",style:d},[T.createElementVNode("div",t1,[T.createVNode(uo,{mode:"embed",files:C.files,"current-index":C.currentIndex,"custom-renderers":C.customRenderers,locale:C.locale,messages:C.messages,onNavigate:i[0]||(i[0]=o=>h("navigate",o))},null,8,["files","current-index","custom-renderers","locale","messages"])])]))}}),r1=bu.version,Qe=-2,_e=-3,Zr=-5,er=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],n1=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],i1=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],s1=[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],o1=[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,112,112],a1=[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],l1=[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],Ss=15;function Bo(){let C,w,t,h,d,l;function i(r,e,n,c,a,s,f,p,u,g,m){let v,S,R,I,F,j,L,$,V,z,E,A,k,b,y;z=0,F=n;do t[r[e+z]]++,z++,F--;while(F!==0);if(t[0]==n)return f[0]=-1,p[0]=0,0;for($=p[0],j=1;j<=Ss&&t[j]===0;j++);for(L=j,$<j&&($=j),F=Ss;F!==0&&t[F]===0;F--);for(R=F,$>F&&($=F),p[0]=$,b=1<<j;j<F;j++,b<<=1)if((b-=t[j])<0)return _e;if((b-=t[F])<0)return _e;for(t[F]+=b,l[1]=j=0,z=1,k=2;--F!=0;)l[k]=j+=t[z],k++,z++;F=0,z=0;do(j=r[e+z])!==0&&(m[l[j]++]=F),z++;while(++F<n);for(n=l[R],l[0]=F=0,z=0,I=-1,A=-$,d[0]=0,E=0,y=0;L<=R;L++)for(v=t[L];v--!=0;){for(;L>A+$;){if(I++,A+=$,y=R-A,y=y>$?$:y,(S=1<<(j=L-A))>v+1&&(S-=v+1,k=L,j<y))for(;++j<y&&!((S<<=1)<=t[++k]);)S-=t[k];if(y=1<<j,g[0]+y>1440)return _e;d[I]=E=g[0],g[0]+=y,I!==0?(l[I]=F,h[0]=j,h[1]=$,j=F>>>A-$,h[2]=E-d[I-1]-j,u.set(h,3*(d[I-1]+j))):f[0]=E}for(h[1]=L-A,z>=n?h[0]=192:m[z]<c?(h[0]=m[z]<256?0:96,h[2]=m[z++]):(h[0]=s[m[z]-c]+16+64,h[2]=a[m[z++]-c]),S=1<<L-A,j=F>>>A;j<y;j+=S)u.set(h,3*(E+j));for(j=1<<L-1;F&j;j>>>=1)F^=j;for(F^=j,V=(1<<A)-1;(F&V)!=l[I];)I--,A-=$,V=(1<<A)-1}return b!==0&&R!=1?Zr:0}function o(r){let e;for(C||(C=[],w=[],t=new Int32Array(16),h=[],d=new Int32Array(Ss),l=new Int32Array(16)),w.length<r&&(w=[]),e=0;e<r;e++)w[e]=0;for(e=0;e<16;e++)t[e]=0;for(e=0;e<3;e++)h[e]=0;d.set(t.subarray(0,Ss),0),l.set(t.subarray(0,16),0)}this.inflate_trees_bits=function(r,e,n,c,a){let s;return o(19),C[0]=0,s=i(r,0,19,19,null,null,n,e,c,C,w),s==_e?a.msg="oversubscribed dynamic bit lengths tree":s!=Zr&&e[0]!==0||(a.msg="incomplete dynamic bit lengths tree",s=_e),s},this.inflate_trees_dynamic=function(r,e,n,c,a,s,f,p,u){let g;return o(288),C[0]=0,g=i(n,0,r,257,s1,o1,s,c,p,C,w),g!=0||c[0]===0?(g==_e?u.msg="oversubscribed literal/length tree":g!=-4&&(u.msg="incomplete literal/length tree",g=_e),g):(o(288),g=i(n,r,e,0,a1,l1,f,a,p,C,w),g!=0||a[0]===0&&r>257?(g==_e?u.msg="oversubscribed distance tree":g==Zr?(u.msg="incomplete distance tree",g=_e):g!=-4&&(u.msg="empty distance tree with lengths",g=_e),g):0)}}Bo.inflate_trees_fixed=function(C,w,t,h){return C[0]=9,w[0]=5,t[0]=n1,h[0]=i1,0};function c1(){const C=this;let w,t,h,d,l=0,i=0,o=0,r=0,e=0,n=0,c=0,a=0,s=0,f=0;function p(u,g,m,v,S,R,I,F){let j,L,$,V,z,E,A,k,b,y,_,x,M,B,P,H;A=F.next_in_index,k=F.avail_in,z=I.bitb,E=I.bitk,b=I.write,y=b<I.read?I.read-b-1:I.end-b,_=er[u],x=er[g];do{for(;E<20;)k--,z|=(255&F.read_byte(A++))<<E,E+=8;if(j=z&_,L=m,$=v,H=3*($+j),(V=L[H])!==0)for(;;){if(z>>=L[H+1],E-=L[H+1],16&V){for(V&=15,M=L[H+2]+(z&er[V]),z>>=V,E-=V;E<15;)k--,z|=(255&F.read_byte(A++))<<E,E+=8;for(j=z&x,L=S,$=R,H=3*($+j),V=L[H];;){if(z>>=L[H+1],E-=L[H+1],16&V){for(V&=15;E<V;)k--,z|=(255&F.read_byte(A++))<<E,E+=8;if(B=L[H+2]+(z&er[V]),z>>=V,E-=V,y-=M,b>=B)P=b-B,b-P>0&&2>b-P?(I.win[b++]=I.win[P++],I.win[b++]=I.win[P++],M-=2):(I.win.set(I.win.subarray(P,P+2),b),b+=2,P+=2,M-=2);else{P=b-B;do P+=I.end;while(P<0);if(V=I.end-P,M>V){if(M-=V,b-P>0&&V>b-P)do I.win[b++]=I.win[P++];while(--V!=0);else I.win.set(I.win.subarray(P,P+V),b),b+=V,P+=V,V=0;P=0}}if(b-P>0&&M>b-P)do I.win[b++]=I.win[P++];while(--M!=0);else I.win.set(I.win.subarray(P,P+M),b),b+=M,P+=M,M=0;break}if(64&V)return F.msg="invalid distance code",M=F.avail_in-k,M=E>>3<M?E>>3:M,k+=M,A-=M,E-=M<<3,I.bitb=z,I.bitk=E,F.avail_in=k,F.total_in+=A-F.next_in_index,F.next_in_index=A,I.write=b,_e;j+=L[H+2],j+=z&er[V],H=3*($+j),V=L[H]}break}if(64&V)return 32&V?(M=F.avail_in-k,M=E>>3<M?E>>3:M,k+=M,A-=M,E-=M<<3,I.bitb=z,I.bitk=E,F.avail_in=k,F.total_in+=A-F.next_in_index,F.next_in_index=A,I.write=b,1):(F.msg="invalid literal/length code",M=F.avail_in-k,M=E>>3<M?E>>3:M,k+=M,A-=M,E-=M<<3,I.bitb=z,I.bitk=E,F.avail_in=k,F.total_in+=A-F.next_in_index,F.next_in_index=A,I.write=b,_e);if(j+=L[H+2],j+=z&er[V],H=3*($+j),(V=L[H])===0){z>>=L[H+1],E-=L[H+1],I.win[b++]=L[H+2],y--;break}}else z>>=L[H+1],E-=L[H+1],I.win[b++]=L[H+2],y--}while(y>=258&&k>=10);return M=F.avail_in-k,M=E>>3<M?E>>3:M,k+=M,A-=M,E-=M<<3,I.bitb=z,I.bitk=E,F.avail_in=k,F.total_in+=A-F.next_in_index,F.next_in_index=A,I.write=b,0}C.init=function(u,g,m,v,S,R){w=0,c=u,a=g,h=m,s=v,d=S,f=R,t=null},C.proc=function(u,g,m){let v,S,R,I,F,j,L,$=0,V=0,z=0;for(z=g.next_in_index,I=g.avail_in,$=u.bitb,V=u.bitk,F=u.write,j=F<u.read?u.read-F-1:u.end-F;;)switch(w){case 0:if(j>=258&&I>=10&&(u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,m=p(c,a,h,s,d,f,u,g),z=g.next_in_index,I=g.avail_in,$=u.bitb,V=u.bitk,F=u.write,j=F<u.read?u.read-F-1:u.end-F,m!=0)){w=m==1?7:9;break}o=c,t=h,i=s,w=1;case 1:for(v=o;V<v;){if(I===0)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,I--,$|=(255&g.read_byte(z++))<<V,V+=8}if(S=3*(i+($&er[v])),$>>>=t[S+1],V-=t[S+1],R=t[S],R===0){r=t[S+2],w=6;break}if(16&R){e=15&R,l=t[S+2],w=2;break}if(!(64&R)){o=R,i=S/3+t[S+2];break}if(32&R){w=7;break}return w=9,g.msg="invalid literal/length code",m=_e,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);case 2:for(v=e;V<v;){if(I===0)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,I--,$|=(255&g.read_byte(z++))<<V,V+=8}l+=$&er[v],$>>=v,V-=v,o=a,t=d,i=f,w=3;case 3:for(v=o;V<v;){if(I===0)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,I--,$|=(255&g.read_byte(z++))<<V,V+=8}if(S=3*(i+($&er[v])),$>>=t[S+1],V-=t[S+1],R=t[S],16&R){e=15&R,n=t[S+2],w=4;break}if(!(64&R)){o=R,i=S/3+t[S+2];break}return w=9,g.msg="invalid distance code",m=_e,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);case 4:for(v=e;V<v;){if(I===0)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,I--,$|=(255&g.read_byte(z++))<<V,V+=8}n+=$&er[v],$>>=v,V-=v,w=5;case 5:for(L=F-n;L<0;)L+=u.end;for(;l!==0;){if(j===0&&(F==u.end&&u.read!==0&&(F=0,j=F<u.read?u.read-F-1:u.end-F),j===0&&(u.write=F,m=u.inflate_flush(g,m),F=u.write,j=F<u.read?u.read-F-1:u.end-F,F==u.end&&u.read!==0&&(F=0,j=F<u.read?u.read-F-1:u.end-F),j===0)))return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);u.win[F++]=u.win[L++],j--,L==u.end&&(L=0),l--}w=0;break;case 6:if(j===0&&(F==u.end&&u.read!==0&&(F=0,j=F<u.read?u.read-F-1:u.end-F),j===0&&(u.write=F,m=u.inflate_flush(g,m),F=u.write,j=F<u.read?u.read-F-1:u.end-F,F==u.end&&u.read!==0&&(F=0,j=F<u.read?u.read-F-1:u.end-F),j===0)))return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);m=0,u.win[F++]=r,j--,w=0;break;case 7:if(V>7&&(V-=8,I++,z--),u.write=F,m=u.inflate_flush(g,m),F=u.write,j=F<u.read?u.read-F-1:u.end-F,u.read!=u.write)return u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);w=8;case 8:return m=1,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);case 9:return m=_e,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m);default:return m=Qe,u.bitb=$,u.bitk=V,g.avail_in=I,g.total_in+=z-g.next_in_index,g.next_in_index=z,u.write=F,u.inflate_flush(g,m)}},C.free=function(){}}const Da=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function u1(C,w){const t=this;let h,d=0,l=0,i=0,o=0;const r=[0],e=[0],n=new c1;let c=0,a=new Int32Array(4320);const s=new Bo;t.bitk=0,t.bitb=0,t.win=new Uint8Array(w),t.end=w,t.read=0,t.write=0,t.reset=function(f,p){p&&(p[0]=0),d==6&&n.free(f),d=0,t.bitk=0,t.bitb=0,t.read=t.write=0},t.reset(C,null),t.inflate_flush=function(f,p){let u,g,m;return g=f.next_out_index,m=t.read,u=(m<=t.write?t.write:t.end)-m,u>f.avail_out&&(u=f.avail_out),u!==0&&p==Zr&&(p=0),f.avail_out-=u,f.total_out+=u,f.next_out.set(t.win.subarray(m,m+u),g),g+=u,m+=u,m==t.end&&(m=0,t.write==t.end&&(t.write=0),u=t.write-m,u>f.avail_out&&(u=f.avail_out),u!==0&&p==Zr&&(p=0),f.avail_out-=u,f.total_out+=u,f.next_out.set(t.win.subarray(m,m+u),g),g+=u,m+=u),f.next_out_index=g,t.read=m,p},t.proc=function(f,p){let u,g,m,v,S,R,I,F;for(v=f.next_in_index,S=f.avail_in,g=t.bitb,m=t.bitk,R=t.write,I=R<t.read?t.read-R-1:t.end-R;;){let j,L,$,V,z,E,A,k;switch(d){case 0:for(;m<3;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}switch(u=7&g,c=1&u,u>>>1){case 0:g>>>=3,m-=3,u=7&m,g>>>=u,m-=u,d=1;break;case 1:j=[],L=[],$=[[]],V=[[]],Bo.inflate_trees_fixed(j,L,$,V),n.init(j[0],L[0],$[0],0,V[0],0),g>>>=3,m-=3,d=6;break;case 2:g>>>=3,m-=3,d=3;break;case 3:return g>>>=3,m-=3,d=9,f.msg="invalid block type",p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p)}break;case 1:for(;m<32;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}if((~g>>>16&65535)!=(65535&g))return d=9,f.msg="invalid stored block lengths",p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);l=65535&g,g=m=0,d=l!==0?2:c!==0?7:0;break;case 2:if(S===0||I===0&&(R==t.end&&t.read!==0&&(R=0,I=R<t.read?t.read-R-1:t.end-R),I===0&&(t.write=R,p=t.inflate_flush(f,p),R=t.write,I=R<t.read?t.read-R-1:t.end-R,R==t.end&&t.read!==0&&(R=0,I=R<t.read?t.read-R-1:t.end-R),I===0)))return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);if(p=0,u=l,u>S&&(u=S),u>I&&(u=I),t.win.set(f.read_buf(v,u),R),v+=u,S-=u,R+=u,I-=u,(l-=u)!=0)break;d=c!==0?7:0;break;case 3:for(;m<14;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}if(i=u=16383&g,(31&u)>29||(u>>5&31)>29)return d=9,f.msg="too many length or distance symbols",p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);if(u=258+(31&u)+(u>>5&31),!h||h.length<u)h=[];else for(F=0;F<u;F++)h[F]=0;g>>>=14,m-=14,o=0,d=4;case 4:for(;o<4+(i>>>10);){for(;m<3;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}h[Da[o++]]=7&g,g>>>=3,m-=3}for(;o<19;)h[Da[o++]]=0;if(r[0]=7,u=s.inflate_trees_bits(h,r,e,a,f),u!=0)return(p=u)==_e&&(h=null,d=9),t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);o=0,d=5;case 5:for(;u=i,!(o>=258+(31&u)+(u>>5&31));){let b,y;for(u=r[0];m<u;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}if(u=a[3*(e[0]+(g&er[u]))+1],y=a[3*(e[0]+(g&er[u]))+2],y<16)g>>>=u,m-=u,h[o++]=y;else{for(F=y==18?7:y-14,b=y==18?11:3;m<u+F;){if(S===0)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);p=0,S--,g|=(255&f.read_byte(v++))<<m,m+=8}if(g>>>=u,m-=u,b+=g&er[F],g>>>=F,m-=F,F=o,u=i,F+b>258+(31&u)+(u>>5&31)||y==16&&F<1)return h=null,d=9,f.msg="invalid bit length repeat",p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);y=y==16?h[F-1]:0;do h[F++]=y;while(--b!=0);o=F}}if(e[0]=-1,z=[],E=[],A=[],k=[],z[0]=9,E[0]=6,u=i,u=s.inflate_trees_dynamic(257+(31&u),1+(u>>5&31),h,z,E,A,k,a,f),u!=0)return u==_e&&(h=null,d=9),p=u,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);n.init(z[0],E[0],a,A[0],a,k[0]),d=6;case 6:if(t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,(p=n.proc(t,f,p))!=1)return t.inflate_flush(f,p);if(p=0,n.free(f),v=f.next_in_index,S=f.avail_in,g=t.bitb,m=t.bitk,R=t.write,I=R<t.read?t.read-R-1:t.end-R,c===0){d=0;break}d=7;case 7:if(t.write=R,p=t.inflate_flush(f,p),R=t.write,I=R<t.read?t.read-R-1:t.end-R,t.read!=t.write)return t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);d=8;case 8:return p=1,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);case 9:return p=_e,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p);default:return p=Qe,t.bitb=g,t.bitk=m,f.avail_in=S,f.total_in+=v-f.next_in_index,f.next_in_index=v,t.write=R,t.inflate_flush(f,p)}}},t.free=function(f){t.reset(f,null),t.win=null,a=null},t.set_dictionary=function(f,p,u){t.win.set(f.subarray(p,p+u),0),t.read=t.write=u},t.sync_point=function(){return d==1?1:0}}const Qr=13,f1=[0,0,255,255];function h1(){const C=this;function w(t){return t&&t.istate?(t.total_in=t.total_out=0,t.msg=null,t.istate.mode=7,t.istate.blocks.reset(t,null),0):Qe}C.mode=0,C.method=0,C.was=[0],C.need=0,C.marker=0,C.wbits=0,C.inflateEnd=function(t){return C.blocks&&C.blocks.free(t),C.blocks=null,0},C.inflateInit=function(t,h){return t.msg=null,C.blocks=null,h<8||h>15?(C.inflateEnd(t),Qe):(C.wbits=h,t.istate.blocks=new u1(t,1<<h),w(t),0)},C.inflate=function(t,h){let d,l;if(!t||!t.istate||!t.next_in)return Qe;const i=t.istate;for(h=h==4?Zr:0,d=Zr;;)switch(i.mode){case 0:if(t.avail_in===0)return d;if(d=h,t.avail_in--,t.total_in++,(15&(i.method=t.read_byte(t.next_in_index++)))!=8){i.mode=Qr,t.msg="unknown compression method",i.marker=5;break}if(8+(i.method>>4)>i.wbits){i.mode=Qr,t.msg="invalid win size",i.marker=5;break}i.mode=1;case 1:if(t.avail_in===0)return d;if(d=h,t.avail_in--,t.total_in++,l=255&t.read_byte(t.next_in_index++),((i.method<<8)+l)%31!=0){i.mode=Qr,t.msg="incorrect header check",i.marker=5;break}if(!(32&l)){i.mode=7;break}i.mode=2;case 2:if(t.avail_in===0)return d;d=h,t.avail_in--,t.total_in++,i.need=(255&t.read_byte(t.next_in_index++))<<24&4278190080,i.mode=3;case 3:if(t.avail_in===0)return d;d=h,t.avail_in--,t.total_in++,i.need+=(255&t.read_byte(t.next_in_index++))<<16&16711680,i.mode=4;case 4:if(t.avail_in===0)return d;d=h,t.avail_in--,t.total_in++,i.need+=(255&t.read_byte(t.next_in_index++))<<8&65280,i.mode=5;case 5:return t.avail_in===0?d:(d=h,t.avail_in--,t.total_in++,i.need+=255&t.read_byte(t.next_in_index++),i.mode=6,2);case 6:return i.mode=Qr,t.msg="need dictionary",i.marker=0,Qe;case 7:if(d=i.blocks.proc(t,d),d==_e){i.mode=Qr,i.marker=0;break}if(d==0&&(d=h),d!=1)return d;d=h,i.blocks.reset(t,i.was),i.mode=12;case 12:return t.avail_in=0,1;case Qr:return _e;default:return Qe}},C.inflateSetDictionary=function(t,h,d){let l=0,i=d;if(!t||!t.istate||t.istate.mode!=6)return Qe;const o=t.istate;return i>=1<<o.wbits&&(i=(1<<o.wbits)-1,l=d-i),o.blocks.set_dictionary(h,l,i),o.mode=7,0},C.inflateSync=function(t){let h,d,l,i,o;if(!t||!t.istate)return Qe;const r=t.istate;if(r.mode!=Qr&&(r.mode=Qr,r.marker=0),(h=t.avail_in)===0)return Zr;for(d=t.next_in_index,l=r.marker;h!==0&&l<4;)t.read_byte(d)==f1[l]?l++:l=t.read_byte(d)!==0?0:4-l,d++,h--;return t.total_in+=d-t.next_in_index,t.next_in_index=d,t.avail_in=h,r.marker=l,l!=4?_e:(i=t.total_in,o=t.total_out,w(t),t.total_in=i,t.total_out=o,r.mode=7,0)},C.inflateSyncPoint=function(t){return t&&t.istate&&t.istate.blocks?t.istate.blocks.sync_point():Qe}}function Kl(){}Kl.prototype={inflateInit(C){const w=this;return w.istate=new h1,C||(C=15),w.istate.inflateInit(w,C)},inflate(C){const w=this;return w.istate?w.istate.inflate(w,C):Qe},inflateEnd(){const C=this;if(!C.istate)return Qe;const w=C.istate.inflateEnd(C);return C.istate=null,w},inflateSync(){const C=this;return C.istate?C.istate.inflateSync(C):Qe},inflateSetDictionary(C,w){const t=this;return t.istate?t.istate.inflateSetDictionary(t,C,w):Qe},read_byte(C){return this.next_in[C]},read_buf(C,w){return this.next_in.subarray(C,C+w)}};const Un=4294967295,Nn=65535,La=33639248,za=101075792,Gn=22,Fe=void 0,wn="undefined",us="function";let $a=class{constructor(w){return class extends TransformStream{constructor(t,h){const d=new w(h);super({transform(l,i){i.enqueue(d.append(l))},flush(l){const i=d.flush();i&&l.enqueue(i)}})}}}},Yl=2;try{typeof navigator!=wn&&navigator.hardwareConcurrency&&(Yl=navigator.hardwareConcurrency)}catch{}const d1={chunkSize:524288,maxWorkers:Yl,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Fe,CompressionStreamNative:typeof CompressionStream!=wn&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=wn&&DecompressionStream},nn=Object.assign({},d1);function Jl(C){const{baseURL:w,chunkSize:t,maxWorkers:h,terminateWorkerTimeout:d,useCompressionStream:l,useWebWorkers:i,Deflate:o,Inflate:r,CompressionStream:e,DecompressionStream:n,workerScripts:c}=C;if(tn("baseURL",w),tn("chunkSize",t),tn("maxWorkers",h),tn("terminateWorkerTimeout",d),tn("useCompressionStream",l),tn("useWebWorkers",i),o&&(nn.CompressionStream=new $a(o)),r&&(nn.DecompressionStream=new $a(r)),tn("CompressionStream",e),tn("DecompressionStream",n),c!==Fe){const{deflate:a,inflate:s}=c;if((a||s)&&(nn.workerScripts||(nn.workerScripts={})),a){if(!Array.isArray(a))throw new Error("workerScripts.deflate must be an array");nn.workerScripts.deflate=a}if(s){if(!Array.isArray(s))throw new Error("workerScripts.inflate must be an array");nn.workerScripts.inflate=s}}}function tn(C,w){w!==Fe&&(nn[C]=w)}const Ql=[];for(let C=0;C<256;C++){let w=C;for(let t=0;t<8;t++)1&w?w=w>>>1^3988292384:w>>>=1;Ql[C]=w}class Zs{constructor(w){this.crc=w||-1}append(w){let t=0|this.crc;for(let h=0,d=0|w.length;h<d;h++)t=t>>>8^Ql[255&(t^w[h])];this.crc=t}get(){return~this.crc}}class tc extends TransformStream{constructor(){let w;const t=new Zs;super({transform(h,d){t.append(h),d.enqueue(h)},flush(){const h=new Uint8Array(4);new DataView(h.buffer).setUint32(0,t.get()),w.value=h}}),w=this}}const qe={concat(C,w){if(C.length===0||w.length===0)return C.concat(w);const t=C[C.length-1],h=qe.getPartial(t);return h===32?C.concat(w):qe._shiftRight(w,h,0|t,C.slice(0,C.length-1))},bitLength(C){const w=C.length;if(w===0)return 0;const t=C[w-1];return 32*(w-1)+qe.getPartial(t)},clamp(C,w){if(32*C.length<w)return C;const t=(C=C.slice(0,Math.ceil(w/32))).length;return w&=31,t>0&&w&&(C[t-1]=qe.partial(w,C[t-1]&2147483648>>w-1,1)),C},partial:(C,w,t)=>C===32?w:(t?0|w:w<<32-C)+1099511627776*C,getPartial:C=>Math.round(C/1099511627776)||32,_shiftRight(C,w,t,h){for(h===void 0&&(h=[]);w>=32;w-=32)h.push(t),t=0;if(w===0)return h.concat(C);for(let i=0;i<C.length;i++)h.push(t|C[i]>>>w),t=C[i]<<32-w;const d=C.length?C[C.length-1]:0,l=qe.getPartial(d);return h.push(qe.partial(w+l&31,w+l>32?t:h.pop(),1)),h}},Gs={bytes:{fromBits(C){const w=qe.bitLength(C)/8,t=new Uint8Array(w);let h;for(let d=0;d<w;d++)3&d||(h=C[d/4]),t[d]=h>>>24,h<<=8;return t},toBits(C){const w=[];let t,h=0;for(t=0;t<C.length;t++)h=h<<8|C[t],3&~t||(w.push(h),h=0);return 3&t&&w.push(qe.partial(8*(3&t),h)),w}}},p1={sha1:class{constructor(C){const w=this;w.blockSize=512,w._init=[1732584193,4023233417,2562383102,271733878,3285377520],w._key=[1518500249,1859775393,2400959708,3395469782],C?(w._h=C._h.slice(0),w._buffer=C._buffer.slice(0),w._length=C._length):w.reset()}reset(){const C=this;return C._h=C._init.slice(0),C._buffer=[],C._length=0,C}update(C){const w=this;typeof C=="string"&&(C=Gs.utf8String.toBits(C));const t=w._buffer=qe.concat(w._buffer,C),h=w._length,d=w._length=h+qe.bitLength(C);if(d>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const l=new Uint32Array(t);let i=0;for(let o=w.blockSize+h-(w.blockSize+h&w.blockSize-1);o<=d;o+=w.blockSize)w._block(l.subarray(16*i,16*(i+1))),i+=1;return t.splice(0,16*i),w}finalize(){const C=this;let w=C._buffer;const t=C._h;w=qe.concat(w,[qe.partial(1,1)]);for(let h=w.length+2;15&h;h++)w.push(0);for(w.push(Math.floor(C._length/4294967296)),w.push(0|C._length);w.length;)C._block(w.splice(0,16));return C.reset(),t}_f(C,w,t,h){return C<=19?w&t|~w&h:C<=39?w^t^h:C<=59?w&t|w&h|t&h:C<=79?w^t^h:void 0}_S(C,w){return w<<C|w>>>32-C}_block(C){const w=this,t=w._h,h=Array(80);for(let e=0;e<16;e++)h[e]=C[e];let d=t[0],l=t[1],i=t[2],o=t[3],r=t[4];for(let e=0;e<=79;e++){e>=16&&(h[e]=w._S(1,h[e-3]^h[e-8]^h[e-14]^h[e-16]));const n=w._S(5,d)+w._f(e,l,i,o)+r+h[e]+w._key[Math.floor(e/20)]|0;r=o,o=i,i=w._S(30,l),l=d,d=n}t[0]=t[0]+d|0,t[1]=t[1]+l|0,t[2]=t[2]+i|0,t[3]=t[3]+o|0,t[4]=t[4]+r|0}}},m1={aes:class{constructor(C){const w=this;w._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],w._tables[0][0][0]||w._precompute();const t=w._tables[0][4],h=w._tables[1],d=C.length;let l,i,o,r=1;if(d!==4&&d!==6&&d!==8)throw new Error("invalid aes key size");for(w._key=[i=C.slice(0),o=[]],l=d;l<4*d+28;l++){let e=i[l-1];(l%d==0||d===8&&l%d==4)&&(e=t[e>>>24]<<24^t[e>>16&255]<<16^t[e>>8&255]<<8^t[255&e],l%d==0&&(e=e<<8^e>>>24^r<<24,r=r<<1^283*(r>>7))),i[l]=i[l-d]^e}for(let e=0;l;e++,l--){const n=i[3&e?l:l-4];o[e]=l<=4||e<4?n:h[0][t[n>>>24]]^h[1][t[n>>16&255]]^h[2][t[n>>8&255]]^h[3][t[255&n]]}}encrypt(C){return this._crypt(C,0)}decrypt(C){return this._crypt(C,1)}_precompute(){const C=this._tables[0],w=this._tables[1],t=C[4],h=w[4],d=[],l=[];let i,o,r,e;for(let n=0;n<256;n++)l[(d[n]=n<<1^283*(n>>7))^n]=n;for(let n=i=0;!t[n];n^=o||1,i=l[i]||1){let c=i^i<<1^i<<2^i<<3^i<<4;c=c>>8^255&c^99,t[n]=c,h[c]=n,e=d[r=d[o=d[n]]];let a=16843009*e^65537*r^257*o^16843008*n,s=257*d[c]^16843008*c;for(let f=0;f<4;f++)C[f][n]=s=s<<24^s>>>8,w[f][c]=a=a<<24^a>>>8}for(let n=0;n<5;n++)C[n]=C[n].slice(0),w[n]=w[n].slice(0)}_crypt(C,w){if(C.length!==4)throw new Error("invalid aes block size");const t=this._key[w],h=t.length/4-2,d=[0,0,0,0],l=this._tables[w],i=l[0],o=l[1],r=l[2],e=l[3],n=l[4];let c,a,s,f=C[0]^t[0],p=C[w?3:1]^t[1],u=C[2]^t[2],g=C[w?1:3]^t[3],m=4;for(let v=0;v<h;v++)c=i[f>>>24]^o[p>>16&255]^r[u>>8&255]^e[255&g]^t[m],a=i[p>>>24]^o[u>>16&255]^r[g>>8&255]^e[255&f]^t[m+1],s=i[u>>>24]^o[g>>16&255]^r[f>>8&255]^e[255&p]^t[m+2],g=i[g>>>24]^o[f>>16&255]^r[p>>8&255]^e[255&u]^t[m+3],m+=4,f=c,p=a,u=s;for(let v=0;v<4;v++)d[w?3&-v:v]=n[f>>>24]<<24^n[p>>16&255]<<16^n[u>>8&255]<<8^n[255&g]^t[m++],c=f,f=p,p=u,u=g,g=c;return d}}},g1={getRandomValues(C){const w=new Uint32Array(C.buffer),t=h=>{let d=987654321;const l=4294967295;return function(){return d=36969*(65535&d)+(d>>16)&l,(((d<<16)+(h=18e3*(65535&h)+(h>>16)&l)&l)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let h,d=0;d<C.length;d+=4){const l=t(4294967296*(h||Math.random()));h=987654071*l(),w[d/4]=4294967296*l()|0}return C}},b1={ctrGladman:class{constructor(C,w){this._prf=C,this._initIv=w,this._iv=w}reset(){this._iv=this._initIv}update(C){return this.calculate(this._prf,C,this._iv)}incWord(C){if(255&~(C>>24))C+=1<<24;else{let w=C>>16&255,t=C>>8&255,h=255&C;w===255?(w=0,t===255?(t=0,h===255?h=0:++h):++t):++w,C=0,C+=w<<16,C+=t<<8,C+=h}return C}incCounter(C){(C[0]=this.incWord(C[0]))===0&&(C[1]=this.incWord(C[1]))}calculate(C,w,t){let h;if(!(h=w.length))return[];const d=qe.bitLength(w);for(let l=0;l<h;l+=4){this.incCounter(t);const i=C.encrypt(t);w[l]^=i[0],w[l+1]^=i[1],w[l+2]^=i[2],w[l+3]^=i[3]}return qe.clamp(w,d)}}},ei={importKey:C=>new ei.hmacSha1(Gs.bytes.toBits(C)),pbkdf2(C,w,t,h){if(t=t||1e4,h<0||t<0)throw new Error("invalid params to pbkdf2");const d=1+(h>>5)<<2;let l,i,o,r,e;const n=new ArrayBuffer(d),c=new DataView(n);let a=0;const s=qe;for(w=Gs.bytes.toBits(w),e=1;a<(d||1);e++){for(l=i=C.encrypt(s.concat(w,[e])),o=1;o<t;o++)for(i=C.encrypt(i),r=0;r<i.length;r++)l[r]^=i[r];for(o=0;a<(d||1)&&o<l.length;o++)c.setInt32(a,l[o]),a+=4}return n.slice(0,h/8)},hmacSha1:class{constructor(C){const w=this,t=w._hash=p1.sha1,h=[[],[]];w._baseHash=[new t,new t];const d=w._baseHash[0].blockSize/32;C.length>d&&(C=new t().update(C).finalize());for(let l=0;l<d;l++)h[0][l]=909522486^C[l],h[1][l]=1549556828^C[l];w._baseHash[0].update(h[0]),w._baseHash[1].update(h[1]),w._resultHash=new t(w._baseHash[0])}reset(){const C=this;C._resultHash=new C._hash(C._baseHash[0]),C._updated=!1}update(C){this._updated=!0,this._resultHash.update(C)}digest(){const C=this,w=C._resultHash.finalize(),t=new C._hash(C._baseHash[1]).update(w).finalize();return C.reset(),t}encrypt(C){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(C),this.digest(C)}}},v1=typeof crypto!=wn&&typeof crypto.getRandomValues==us,ec="Invalid password",rc="Invalid signature",la="zipjs-abort-check-password";function nc(C){return v1?crypto.getRandomValues(C):g1.getRandomValues(C)}const ri=16,ic={name:"PBKDF2"},y1=Object.assign({hash:{name:"HMAC"}},ic),yo=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},ic),w1=["deriveBits"],Ai=[8,12,16],Ti=[16,24,32],en=10,_1=[0,0,0,0],fo=typeof crypto!=wn,Pi=fo&&crypto.subtle,sc=fo&&typeof Pi!=wn,jr=Gs.bytes,x1=m1.aes,k1=b1.ctrGladman,S1=ei.hmacSha1;let Va=fo&&sc&&typeof Pi.importKey==us,Ua=fo&&sc&&typeof Pi.deriveBits==us;class E1 extends TransformStream{constructor({password:w,rawPassword:t,signed:h,encryptionStrength:d,checkPasswordOnly:l}){super({start(){Object.assign(this,{ready:new Promise(i=>this.resolveReady=i),password:lc(w,t),signed:h,strength:d-1,pending:new Uint8Array})},async transform(i,o){const r=this,{password:e,strength:n,resolveReady:c,ready:a}=r;e?(await async function(f,p,u,g){const m=await ac(f,p,u,fr(g,0,Ai[p])),v=fr(g,Ai[p]);if(m[0]!=v[0]||m[1]!=v[1])throw new Error(ec)}(r,n,e,fr(i,0,Ai[n]+2)),i=fr(i,Ai[n]+2),l?o.error(new Error(la)):c()):await a;const s=new Uint8Array(i.length-en-(i.length-en)%ri);o.enqueue(oc(r,i,s,0,en,!0))},async flush(i){const{signed:o,ctr:r,hmac:e,pending:n,ready:c}=this;if(e&&r){await c;const a=fr(n,0,n.length-en),s=fr(n,n.length-en);let f=new Uint8Array;if(a.length){const p=Di(jr,a);e.update(p);const u=r.update(p);f=Fi(jr,u)}if(o){const p=fr(Fi(jr,e.digest()),0,en);for(let u=0;u<en;u++)if(p[u]!=s[u])throw new Error(rc)}i.enqueue(f)}}})}}class C1 extends TransformStream{constructor({password:w,rawPassword:t,encryptionStrength:h}){let d;super({start(){Object.assign(this,{ready:new Promise(l=>this.resolveReady=l),password:lc(w,t),strength:h-1,pending:new Uint8Array})},async transform(l,i){const o=this,{password:r,strength:e,resolveReady:n,ready:c}=o;let a=new Uint8Array;r?(a=await async function(f,p,u){const g=nc(new Uint8Array(Ai[p])),m=await ac(f,p,u,g);return Po(g,m)}(o,e,r),n()):await c;const s=new Uint8Array(a.length+l.length-l.length%ri);s.set(a,0),i.enqueue(oc(o,l,s,a.length,0))},async flush(l){const{ctr:i,hmac:o,pending:r,ready:e}=this;if(o&&i){await e;let n=new Uint8Array;if(r.length){const c=i.update(Di(jr,r));o.update(c),n=Fi(jr,c)}d.signature=Fi(jr,o.digest()).slice(0,en),l.enqueue(Po(n,d.signature))}}}),d=this}}function oc(C,w,t,h,d,l){const{ctr:i,hmac:o,pending:r}=C,e=w.length-d;let n;for(r.length&&(w=Po(r,w),t=function(c,a){if(a&&a>c.length){const s=c;(c=new Uint8Array(a)).set(s,0)}return c}(t,e-e%ri)),n=0;n<=e-ri;n+=ri){const c=Di(jr,fr(w,n,n+ri));l&&o.update(c);const a=i.update(c);l||o.update(a),t.set(Fi(jr,a),n+h)}return C.pending=fr(w,n),t}async function ac(C,w,t,h){C.password=null;const d=await async function(n,c,a,s,f){if(!Va)return ei.importKey(c);try{return await Pi.importKey(n,c,a,s,f)}catch{return Va=!1,ei.importKey(c)}}("raw",t,y1,!1,w1),l=await async function(n,c,a){if(!Ua)return ei.pbkdf2(c,n.salt,yo.iterations,a);try{return await Pi.deriveBits(n,c,a)}catch{return Ua=!1,ei.pbkdf2(c,n.salt,yo.iterations,a)}}(Object.assign({salt:h},yo),d,8*(2*Ti[w]+2)),i=new Uint8Array(l),o=Di(jr,fr(i,0,Ti[w])),r=Di(jr,fr(i,Ti[w],2*Ti[w])),e=fr(i,2*Ti[w]);return Object.assign(C,{keys:{key:o,authentication:r,passwordVerification:e},ctr:new k1(new x1(o),Array.from(_1)),hmac:new S1(r)}),e}function lc(C,w){return w===Fe?function(t){if(typeof TextEncoder==wn){t=unescape(encodeURIComponent(t));const h=new Uint8Array(t.length);for(let d=0;d<h.length;d++)h[d]=t.charCodeAt(d);return h}return new TextEncoder().encode(t)}(C):w}function Po(C,w){let t=C;return C.length+w.length&&(t=new Uint8Array(C.length+w.length),t.set(C,0),t.set(w,C.length)),t}function fr(C,w,t){return C.subarray(w,t)}function Fi(C,w){return C.fromBits(w)}function Di(C,w){return C.toBits(w)}const Ks=12;class T1 extends TransformStream{constructor({password:w,passwordVerification:t,checkPasswordOnly:h}){super({start(){Object.assign(this,{password:w,passwordVerification:t}),cc(this,w)},transform(d,l){const i=this;if(i.password){const o=Ha(i,d.subarray(0,Ks));if(i.password=null,o[11]!=i.passwordVerification)throw new Error(ec);d=d.subarray(Ks)}h?l.error(new Error(la)):l.enqueue(Ha(i,d))}})}}class M1 extends TransformStream{constructor({password:w,passwordVerification:t}){super({start(){Object.assign(this,{password:w,passwordVerification:t}),cc(this,w)},transform(h,d){const l=this;let i,o;if(l.password){l.password=null;const r=nc(new Uint8Array(Ks));r[11]=l.passwordVerification,i=new Uint8Array(h.length+r.length),i.set(Wa(l,r),0),o=Ks}else i=new Uint8Array(h.length),o=0;i.set(Wa(l,h),o),d.enqueue(i)}})}}function Ha(C,w){const t=new Uint8Array(w.length);for(let h=0;h<w.length;h++)t[h]=uc(C)^w[h],ca(C,t[h]);return t}function Wa(C,w){const t=new Uint8Array(w.length);for(let h=0;h<w.length;h++)t[h]=uc(C)^w[h],ca(C,w[h]);return t}function cc(C,w){const t=[305419896,591751049,878082192];Object.assign(C,{keys:t,crcKey0:new Zs(t[0]),crcKey2:new Zs(t[2])});for(let h=0;h<w.length;h++)ca(C,w.charCodeAt(h))}function ca(C,w){let[t,h,d]=C.keys;C.crcKey0.append([w]),t=~C.crcKey0.get(),h=qa(Math.imul(qa(h+fc(t)),134775813)+1),C.crcKey2.append([h>>>24]),d=~C.crcKey2.get(),C.keys=[t,h,d]}function uc(C){const w=2|C.keys[2];return fc(Math.imul(w,1^w)>>>8)}function fc(C){return 255&C}function qa(C){return 4294967295&C}const Xa="deflate-raw";class A1 extends TransformStream{constructor(w,{chunkSize:t,CompressionStream:h,CompressionStreamNative:d}){super({});const{compressed:l,encrypted:i,useCompressionStream:o,zipCrypto:r,signed:e,level:n}=w,c=this;let a,s,f=hc(super.readable);i&&!r||!e||(a=new tc,f=Ir(f,a)),l&&(f=pc(f,o,{level:n,chunkSize:t},d,h)),i&&(r?f=Ir(f,new M1(w)):(s=new C1(w),f=Ir(f,s))),dc(c,f,()=>{let p;i&&!r&&(p=s.signature),i&&!r||!e||(p=new DataView(a.value.buffer).getUint32(0)),c.signature=p})}}class R1 extends TransformStream{constructor(w,{chunkSize:t,DecompressionStream:h,DecompressionStreamNative:d}){super({});const{zipCrypto:l,encrypted:i,signed:o,signature:r,compressed:e,useCompressionStream:n}=w;let c,a,s=hc(super.readable);i&&(l?s=Ir(s,new T1(w)):(a=new E1(w),s=Ir(s,a))),e&&(s=pc(s,n,{chunkSize:t},d,h)),i&&!l||!o||(c=new tc,s=Ir(s,c)),dc(this,s,()=>{if((!i||l)&&o){const f=new DataView(c.value.buffer);if(r!=f.getUint32(0,!1))throw new Error(rc)}})}}function hc(C){return Ir(C,new TransformStream({transform(w,t){w&&w.length&&t.enqueue(w)}}))}function dc(C,w,t){w=Ir(w,new TransformStream({flush:t})),Object.defineProperty(C,"readable",{get:()=>w})}function pc(C,w,t,h,d){try{C=Ir(C,new(w&&h?h:d)(Xa,t))}catch{if(!w)return C;try{C=Ir(C,new d(Xa,t))}catch{return C}}return C}function Ir(C,w){return C.pipeThrough(w)}const N1="message",O1="start",j1="pull",Za="data",Ga="close",mc="inflate";class I1 extends TransformStream{constructor(w,t){super({});const h=this,{codecType:d}=w;let l;d.startsWith("deflate")?l=A1:d.startsWith(mc)&&(l=R1);let i=0,o=0;const r=new l(w,t),e=super.readable,n=new TransformStream({transform(a,s){a&&a.length&&(o+=a.length,s.enqueue(a))},flush(){Object.assign(h,{inputSize:o})}}),c=new TransformStream({transform(a,s){a&&a.length&&(i+=a.length,s.enqueue(a))},flush(){const{signature:a}=r;Object.assign(h,{signature:a,outputSize:i,inputSize:o})}});Object.defineProperty(h,"readable",{get:()=>e.pipeThrough(n).pipeThrough(r).pipeThrough(c)})}}class B1 extends TransformStream{constructor(w){let t;super({transform:function h(d,l){if(t){const i=new Uint8Array(t.length+d.length);i.set(t),i.set(d,t.length),d=i,t=null}d.length>w?(l.enqueue(d.slice(0,w)),h(d.slice(w),l)):t=d},flush(h){t&&t.length&&h.enqueue(t)}})}}let gc=typeof Worker!=wn;class wo{constructor(w,{readable:t,writable:h},{options:d,config:l,streamOptions:i,useWebWorkers:o,transferStreams:r,scripts:e},n){const{signal:c}=i;return Object.assign(w,{busy:!0,readable:t.pipeThrough(new B1(l.chunkSize)).pipeThrough(new P1(t,i),{signal:c}),writable:h,options:Object.assign({},d),scripts:e,transferStreams:r,terminate:()=>new Promise(a=>{const{worker:s,busy:f}=w;s?(f?w.resolveTerminated=a:(s.terminate(),a()),w.interface=null):a()}),onTaskFinished(){const{resolveTerminated:a}=w;a&&(w.resolveTerminated=null,w.terminated=!0,w.worker.terminate(),a()),w.busy=!1,n(w)}}),(o&&gc?F1:bc)(w,l)}}class P1 extends TransformStream{constructor(w,{onstart:t,onprogress:h,size:d,onend:l}){let i=0;super({async start(){t&&await _o(t,d)},async transform(o,r){i+=o.length,h&&await _o(h,i,d),r.enqueue(o)},async flush(){w.size=i,l&&await _o(l,i)}})}}async function _o(C,...w){try{await C(...w)}catch{}}function bc(C,w){return{run:()=>async function({options:t,readable:h,writable:d,onTaskFinished:l},i){try{const o=new I1(t,i);await h.pipeThrough(o).pipeTo(d,{preventClose:!0,preventAbort:!0});const{signature:r,inputSize:e,outputSize:n}=o;return{signature:r,inputSize:e,outputSize:n}}finally{l()}}(C,w)}}function F1(C,w){const{baseURL:t,chunkSize:h}=w;if(!C.interface){let d;try{d=function(l,i,o){const r={type:"module"};let e,n;typeof l==us&&(l=l());try{e=new URL(l,i)}catch{e=l}if(Ka)try{n=new Worker(e)}catch{Ka=!1,n=new Worker(e,r)}else n=new Worker(e,r);return n.addEventListener(N1,c=>async function({data:a},s){const{type:f,value:p,messageId:u,result:g,error:m}=a,{reader:v,writer:S,resolveResult:R,rejectResult:I,onTaskFinished:F}=s;try{if(m){const{message:L,stack:$,code:V,name:z}=m,E=new Error(L);Object.assign(E,{stack:$,code:V,name:z}),j(E)}else{if(f==j1){const{value:L,done:$}=await v.read();Es({type:Za,value:L,done:$,messageId:u},s)}f==Za&&(await S.ready,await S.write(new Uint8Array(p)),Es({type:"ack",messageId:u},s)),f==Ga&&j(null,g)}}catch(L){Es({type:Ga,messageId:u},s),j(L)}function j(L,$){L?I(L):R($),S&&S.releaseLock(),F()}}(c,o)),n}(C.scripts[0],t,C)}catch{return gc=!1,bc(C,w)}Object.assign(C,{worker:d,interface:{run:()=>async function(l,i){let o,r;const e=new Promise((g,m)=>{o=g,r=m});Object.assign(l,{reader:null,writer:null,resolveResult:o,rejectResult:r,result:e});const{readable:n,options:c,scripts:a}=l,{writable:s,closed:f}=function(g){let m;const v=new Promise(R=>m=R);return{writable:new WritableStream({async write(R){const I=g.getWriter();await I.ready,await I.write(R),I.releaseLock()},close(){m()},abort:R=>g.getWriter().abort(R)}),closed:v}}(l.writable),p=Es({type:O1,scripts:a.slice(1),options:c,config:i,readable:n,writable:s},l);p||Object.assign(l,{reader:n.getReader(),writer:s.getWriter()});const u=await e;return p||await s.getWriter().close(),await f,u}(C,{chunkSize:h})}})}return C.interface}let Ka=!0,Ya=!0;function Es(C,{worker:w,writer:t,onTaskFinished:h,transferStreams:d}){try{const{value:l,readable:i,writable:o}=C,r=[];if(l&&(l.byteLength<l.buffer.byteLength?C.value=l.buffer.slice(0,l.byteLength):C.value=l.buffer,r.push(C.value)),d&&Ya?(i&&r.push(i),o&&r.push(o)):C.readable=C.writable=null,r.length)try{return w.postMessage(C,r),!0}catch{Ya=!1,C.readable=C.writable=null,w.postMessage(C)}else w.postMessage(C)}catch(l){throw t&&t.releaseLock(),h(),l}}let Sn=[];const xo=[];let Ja=0;async function D1(C,w){const{options:t,config:h}=w,{transferStreams:d,useWebWorkers:l,useCompressionStream:i,codecType:o,compressed:r,signed:e,encrypted:n}=t,{workerScripts:c,maxWorkers:a}=h;w.transferStreams=d||d===Fe;const s=!(r||e||n||w.transferStreams);return w.useWebWorkers=!s&&(l||l===Fe&&h.useWebWorkers),w.scripts=w.useWebWorkers&&c?c[o]:[],t.useCompressionStream=i||i===Fe&&h.useCompressionStream,(await async function(){const p=Sn.find(u=>!u.busy);if(p)return Qa(p),new wo(p,C,w,f);if(Sn.length<a){const u={indexWorker:Ja};return Ja++,Sn.push(u),new wo(u,C,w,f)}return new Promise(u=>xo.push({resolve:u,stream:C,workerOptions:w}))}()).run();function f(p){if(xo.length){const[{resolve:u,stream:g,workerOptions:m}]=xo.splice(0,1);u(new wo(p,g,m,f))}else p.worker?(Qa(p),function(u,g){const{config:m}=g,{terminateWorkerTimeout:v}=m;Number.isFinite(v)&&v>=0&&(u.terminated?u.terminated=!1:u.terminateTimeout=setTimeout(async()=>{Sn=Sn.filter(S=>S!=u);try{await u.terminate()}catch{}},v))}(p,w)):Sn=Sn.filter(u=>u!=p)}}function Qa(C){const{terminateTimeout:w}=C;w&&(clearTimeout(w),C.terminateTimeout=null)}const L1=65536,vc="writable";class ua{constructor(){this.size=0}init(){this.initialized=!0}}class yc extends ua{get readable(){const w=this,{chunkSize:t=L1}=w,h=new ReadableStream({start(){this.chunkOffset=0},async pull(d){const{offset:l=0,size:i,diskNumberStart:o}=h,{chunkOffset:r}=this,e=i===Fe?t:Math.min(t,i-r),n=await ze(w,l+r,e,o);d.enqueue(n),r+t>i||i===Fe&&!n.length&&e?d.close():this.chunkOffset+=t}});return h}}class wc extends yc{constructor(w){super(),Object.assign(this,{blob:w,size:w.size})}async readUint8Array(w,t){const h=this,d=w+t;let i=await(w||d<h.size?h.blob.slice(w,d):h.blob).arrayBuffer();return i.byteLength>t&&(i=i.slice(w,d)),new Uint8Array(i)}}class _c extends ua{constructor(w){super();const t=new TransformStream,h=[];w&&h.push(["Content-Type",w]),Object.defineProperty(this,vc,{get:()=>t.writable}),this.blob=new Response(t.readable,{headers:h}).blob()}getData(){return this.blob}}class z1 extends _c{constructor(w){super(w),Object.assign(this,{encoding:w,utf8:!w||w.toLowerCase()=="utf-8"})}async getData(){const{encoding:w,utf8:t}=this,h=await super.getData();if(h.text&&t)return h.text();{const d=new FileReader;return new Promise((l,i)=>{Object.assign(d,{onload:({target:o})=>l(o.result),onerror:()=>i(d.error)}),d.readAsText(h,w)})}}}class $1 extends yc{constructor(w){super(),this.readers=w}async init(){const w=this,{readers:t}=w;w.lastDiskNumber=0,w.lastDiskOffset=0,await Promise.all(t.map(async(h,d)=>{await h.init(),d!=t.length-1&&(w.lastDiskOffset+=h.size),w.size+=h.size})),super.init()}async readUint8Array(w,t,h=0){const d=this,{readers:l}=this;let i,o=h;o==-1&&(o=l.length-1);let r=w;for(;r>=l[o].size;)r-=l[o].size,o++;const e=l[o],n=e.size;if(r+t<=n)i=await ze(e,r,t);else{const c=n-r;i=new Uint8Array(t),i.set(await ze(e,r,c)),i.set(await d.readUint8Array(w+c,t-c,h),c)}return d.lastDiskNumber=Math.max(o,d.lastDiskNumber),i}}class tl extends ua{constructor(w,t=4294967295){super();const h=this;let d,l,i;Object.assign(h,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});const o=new WritableStream({async write(n){const{availableSize:c}=h;if(i)n.length>=c?(await r(n.slice(0,c)),await e(),h.diskOffset+=d.size,h.diskNumber++,i=null,await this.write(n.slice(c))):await r(n);else{const{value:a,done:s}=await w.next();if(s&&!a)throw new Error("Writer iterator completed too soon");d=a,d.size=0,d.maxSize&&(h.maxSize=d.maxSize),h.availableSize=h.maxSize,await Ys(d),l=a.writable,i=l.getWriter(),await this.write(n)}},async close(){await i.ready,await e()}});async function r(n){const c=n.length;c&&(await i.ready,await i.write(n),d.size+=c,h.size+=c,h.availableSize-=c)}async function e(){l.size=d.size,await i.close()}Object.defineProperty(h,vc,{get:()=>o})}}async function Ys(C,w){if(!C.init||C.initialized)return Promise.resolve();await C.init(w)}function V1(C){return Array.isArray(C)&&(C=new $1(C)),C instanceof ReadableStream&&(C={readable:C}),C}function ze(C,w,t,h){return C.readUint8Array(w,t,h)}const xc="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),U1=xc.length==256;function Bs(C,w){return w&&w.trim().toLowerCase()=="cp437"?function(t){if(U1){let h="";for(let d=0;d<t.length;d++)h+=xc[t[d]];return h}return new TextDecoder().decode(t)}(C):new TextDecoder(w).decode(C)}const kc="filename",Sc="rawFilename",Ec="comment",Cc="rawComment",Tc="uncompressedSize",Mc="compressedSize",Ac="offset",Fo="diskNumberStart",Do="lastModDate",Lo="rawLastModDate",Rc="lastAccessDate",H1="rawLastAccessDate",Nc="creationDate",W1="rawCreationDate",q1=[kc,Sc,Mc,Tc,Do,Lo,Ec,Cc,Rc,Nc,Ac,Fo,Fo,"internalFileAttribute","internalFileAttributes","externalFileAttribute","externalFileAttributes","msDosCompatible","zip64","encrypted","version","versionMadeBy","zipCrypto","directory","executable","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class el{constructor(w){q1.forEach(t=>this[t]=w[t])}}const ko="File format is not recognized",X1="Zip64 extra field not found",rl="Compression method not supported",nl="Split zip file",il="utf-8",sl="cp437",Z1=[[Tc,Un],[Mc,Un],[Ac,Un],[Fo,Nn]],G1={[Nn]:{getValue:Ce,bytes:4},[Un]:{getValue:Ps,bytes:8}};class K1{constructor(w,t={}){Object.assign(this,{reader:V1(w),options:t,config:nn})}async*getEntriesGenerator(w={}){const t=this;let{reader:h}=t;const{config:d}=t;if(await Ys(h),h.size!==Fe&&h.readUint8Array||(h=new wc(await new Response(h.readable).blob()),await Ys(h)),h.size<Gn)throw new Error(ko);h.chunkSize=function($){return Math.max($.chunkSize,64)}(d);const l=await async function($,V,z,E,A){const k=new Uint8Array(4);(function(_,x,M){_.setUint32(x,M,!0)})(Ie(k),0,V);const b=E+A;return await y(E)||await y(Math.min(b,z));async function y(_){const x=z-_,M=await ze($,x,_);for(let B=M.length-E;B>=0;B--)if(M[B]==k[0]&&M[B+1]==k[1]&&M[B+2]==k[2]&&M[B+3]==k[3])return{offset:x+B,buffer:M.slice(B,B+E).buffer}}}(h,101010256,h.size,Gn,1048560);if(!l)throw Ce(Ie(await ze(h,0,4)))==134695760?new Error(nl):new Error("End of central directory not found");const i=Ie(l);let o=Ce(i,12),r=Ce(i,16);const e=l.offset,n=Be(i,20),c=e+Gn+n;let a=Be(i,4);const s=h.lastDiskNumber||0;let f=Be(i,6),p=Be(i,8),u=0,g=0;if(r==Un||o==Un||p==Nn||f==Nn){const $=Ie(await ze(h,l.offset-20,20));if(Ce($,0)==117853008){r=Ps($,8);let V=await ze(h,r,56,-1),z=Ie(V);const E=l.offset-20-56;if(Ce(z,0)!=za&&r!=E){const A=r;r=E,u=r-A,V=await ze(h,r,56,-1),z=Ie(V)}if(Ce(z,0)!=za)throw new Error("End of Zip64 central directory locator not found");a==Nn&&(a=Ce(z,16)),f==Nn&&(f=Ce(z,20)),p==Nn&&(p=Ps(z,32)),o==Un&&(o=Ps(z,40)),r-=o}}if(r>=h.size&&(u=h.size-r-o-Gn,r=h.size-o-Gn),s!=a)throw new Error(nl);if(r<0)throw new Error(ko);let m=0,v=await ze(h,r,o,f),S=Ie(v);if(o){const $=l.offset-o;if(Ce(S,m)!=La&&r!=$){const V=r;r=$,u+=r-V,v=await ze(h,r,o,f),S=Ie(v)}}const R=l.offset-r-(h.lastDiskOffset||0);if(o!=R&&R>=0&&(o=R,v=await ze(h,r,o,f),S=Ie(v)),r<0||r>=h.size)throw new Error(ko);const I=We(t,w,"filenameEncoding"),F=We(t,w,"commentEncoding");for(let $=0;$<p;$++){const V=new Y1(h,d,t.options);if(Ce(S,m)!=La)throw new Error("Central directory header not found");Oc(V,S,m+6);const z=!!V.bitFlag.languageEncodingFlag,E=m+46,A=E+V.filenameLength,k=A+V.extraFieldLength,b=Be(S,m+4),y=!(b>>8),_=b>>8==3,x=v.subarray(E,A),M=Be(S,m+32),B=k+M,P=v.subarray(k,B),H=z,W=z,K=Ce(S,m+38),D=y&&!(16&~ni(S,m+38))||_&&!(16384&~(K>>16))||x.length&&x[x.length-1]==47,X=_&&!(73&~(K>>16)),O=Ce(S,m+42)+u;Object.assign(V,{versionMadeBy:b,msDosCompatible:y,compressedSize:0,uncompressedSize:0,commentLength:M,directory:D,offset:O,diskNumberStart:Be(S,m+34),internalFileAttributes:Be(S,m+36),externalFileAttributes:K,rawFilename:x,filenameUTF8:H,commentUTF8:W,rawExtraField:v.subarray(A,k),executable:X}),V.internalFileAttribute=V.internalFileAttributes,V.externalFileAttribute=V.externalFileAttributes;const N=We(t,w,"decodeText")||Bs,U=H?il:I||sl,q=W?il:F||sl;let Y=N(x,U);Y===Fe&&(Y=Bs(x,U));let G=N(P,q);G===Fe&&(G=Bs(P,q)),Object.assign(V,{rawComment:P,filename:Y,comment:G,directory:D||Y.endsWith("/")}),g=Math.max(O,g),jc(V,V,S,m+6),V.zipCrypto=V.encrypted&&!V.extraFieldAES;const Q=new el(V);Q.getData=(it,J)=>V.getData(it,Q,J),m=B;const{onprogress:rt}=w;if(rt)try{await rt($+1,p,new el(V))}catch{}yield Q}const j=We(t,w,"extractPrependedData"),L=We(t,w,"extractAppendedData");return j&&(t.prependedData=g>0?await ze(h,0,g):new Uint8Array),t.comment=n?await ze(h,e+Gn,n):new Uint8Array,L&&(t.appendedData=c<h.size?await ze(h,c,h.size-c):new Uint8Array),!0}async getEntries(w={}){const t=[];for await(const h of this.getEntriesGenerator(w))t.push(h);return t}async close(){}}class Y1{constructor(w,t,h){Object.assign(this,{reader:w,config:t,options:h})}async getData(w,t,h={}){const d=this,{reader:l,offset:i,diskNumberStart:o,extraFieldAES:r,compressionMethod:e,config:n,bitFlag:c,signature:a,rawLastModDate:s,uncompressedSize:f,compressedSize:p}=d,u=t.localDirectory={},g=Ie(await ze(l,i,30,o));let m=We(d,h,"password"),v=We(d,h,"rawPassword");const S=We(d,h,"passThrough");if(m=m&&m.length&&m,v=v&&v.length&&v,r&&r.originalCompressionMethod!=99)throw new Error(rl);if(e!=0&&e!=8&&!S)throw new Error(rl);if(Ce(g,0)!=67324752)throw new Error("Local file header not found");Oc(u,g,4),u.rawExtraField=u.extraFieldLength?await ze(l,i+30+u.filenameLength,u.extraFieldLength,o):new Uint8Array,jc(d,u,g,4,!0),Object.assign(t,{lastAccessDate:u.lastAccessDate,creationDate:u.creationDate});const R=d.encrypted&&u.encrypted&&!S,I=R&&!r;if(S||(t.zipCrypto=I),R){if(!I&&r.strength===Fe)throw new Error("Encryption method not supported");if(!m&&!v)throw new Error("File contains encrypted entry")}const F=i+30+u.filenameLength+u.extraFieldLength,j=p,L=l.readable;Object.assign(L,{diskNumberStart:o,offset:F,size:j});const $=We(d,h,"signal"),V=We(d,h,"checkPasswordOnly");V&&(w=new WritableStream),w=function(_){_.writable===Fe&&typeof _.next==us&&(_=new tl(_)),_ instanceof WritableStream&&(_={writable:_});const{writable:x}=_;return x.size===Fe&&(x.size=0),_ instanceof tl||Object.assign(_,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),_}(w),await Ys(w,S?p:f);const{writable:z}=w,{onstart:E,onprogress:A,onend:k}=h,b={options:{codecType:mc,password:m,rawPassword:v,zipCrypto:I,encryptionStrength:r&&r.strength,signed:We(d,h,"checkSignature")&&!S,passwordVerification:I&&(c.dataDescriptor?s>>>8&255:a>>>24&255),signature:a,compressed:e!=0&&!S,encrypted:d.encrypted&&!S,useWebWorkers:We(d,h,"useWebWorkers"),useCompressionStream:We(d,h,"useCompressionStream"),transferStreams:We(d,h,"transferStreams"),checkPasswordOnly:V},config:n,streamOptions:{signal:$,size:j,onstart:E,onprogress:A,onend:k}};let y=0;try{({outputSize:y}=await D1({readable:L,writable:z},b))}catch(_){if(!V||_.message!=la)throw _}finally{const _=We(d,h,"preventClose");z.size+=y,_||z.locked||await z.getWriter().close()}return V?Fe:w.getData?w.getData():z}}function Oc(C,w,t){const h=C.rawBitFlag=Be(w,t+2),d=!(1&~h),l=Ce(w,t+6);Object.assign(C,{encrypted:d,version:Be(w,t),bitFlag:{level:(6&h)>>1,dataDescriptor:!(8&~h),languageEncodingFlag:!(2048&~h)},rawLastModDate:l,lastModDate:J1(l),filenameLength:Be(w,t+22),extraFieldLength:Be(w,t+24)})}function jc(C,w,t,h,d){const{rawExtraField:l}=w,i=w.extraField=new Map,o=Ie(new Uint8Array(l));let r=0;try{for(;r<l.length;){const g=Be(o,r),m=Be(o,r+2);i.set(g,{type:g,data:l.slice(r+4,r+4+m)}),r+=4+m}}catch{}const e=Be(t,h+4);Object.assign(w,{signature:Ce(t,h+10),uncompressedSize:Ce(t,h+18),compressedSize:Ce(t,h+14)});const n=i.get(1);n&&(function(g,m){m.zip64=!0;const v=Ie(g.data),S=Z1.filter(([R,I])=>m[R]==I);for(let R=0,I=0;R<S.length;R++){const[F,j]=S[R];if(m[F]==j){const L=G1[j];m[F]=g[F]=L.getValue(v,I),I+=L.bytes}else if(g[F])throw new Error(X1)}}(n,w),w.extraFieldZip64=n);const c=i.get(28789);c&&(ol(c,kc,Sc,w,C),w.extraFieldUnicodePath=c);const a=i.get(25461);a&&(ol(a,Ec,Cc,w,C),w.extraFieldUnicodeComment=a);const s=i.get(39169);s?(function(g,m,v){const S=Ie(g.data),R=ni(S,4);Object.assign(g,{vendorVersion:ni(S,0),vendorId:ni(S,2),strength:R,originalCompressionMethod:v,compressionMethod:Be(S,5)}),m.compressionMethod=g.compressionMethod}(s,w,e),w.extraFieldAES=s):w.compressionMethod=e;const f=i.get(10);f&&(function(g,m){const v=Ie(g.data);let S,R=4;try{for(;R<g.data.length&&!S;){const I=Be(v,R),F=Be(v,R+2);I==1&&(S=g.data.slice(R+4,R+4+F)),R+=4+F}}catch{}try{if(S&&S.length==24){const I=Ie(S),F=I.getBigUint64(0,!0),j=I.getBigUint64(8,!0),L=I.getBigUint64(16,!0);Object.assign(g,{rawLastModDate:F,rawLastAccessDate:j,rawCreationDate:L});const $=So(F),V=So(j),z={lastModDate:$,lastAccessDate:V,creationDate:So(L)};Object.assign(g,z),Object.assign(m,z)}}catch{}}(f,w),w.extraFieldNTFS=f);const p=i.get(21589);p&&(function(g,m,v){const S=Ie(g.data),R=ni(S,0),I=[],F=[];v?(1&~R||(I.push(Do),F.push(Lo)),2&~R||(I.push(Rc),F.push(H1)),4&~R||(I.push(Nc),F.push(W1))):g.data.length>=5&&(I.push(Do),F.push(Lo));let j=1;I.forEach((L,$)=>{if(g.data.length>=j+4){const V=Ce(S,j);m[L]=g[L]=new Date(1e3*V);const z=F[$];g[z]=V}j+=4})}(p,w,d),w.extraFieldExtendedTimestamp=p);const u=i.get(6534);u&&(w.extraFieldUSDZ=u)}function ol(C,w,t,h,d){const l=Ie(C.data),i=new Zs;i.append(d[t]);const o=Ie(new Uint8Array(4));o.setUint32(0,i.get(),!0);const r=Ce(l,1);Object.assign(C,{version:ni(l,0),[w]:Bs(C.data.subarray(5)),valid:!d.bitFlag.languageEncodingFlag&&r==Ce(o,0)}),C.valid&&(h[w]=C[w],h[w+"UTF8"]=!0)}function We(C,w,t){return w[t]===Fe?C.options[t]:w[t]}function J1(C){const w=(4294901760&C)>>16,t=65535&C;try{return new Date(1980+((65024&w)>>9),((480&w)>>5)-1,31&w,(63488&t)>>11,(2016&t)>>5,2*(31&t),0)}catch{}}function So(C){return new Date(Number(C/BigInt(1e4)-BigInt(116444736e5)))}function ni(C,w){return C.getUint8(w)}function Be(C,w){return C.getUint16(w,!0)}function Ce(C,w){return C.getUint32(w,!0)}function Ps(C,w){return Number(C.getBigUint64(w,!0))}function Ie(C){return new DataView(C.buffer)}Jl({Inflate:function(C){const w=new Kl,t=C&&C.chunkSize?Math.floor(2*C.chunkSize):131072,h=new Uint8Array(t);let d=!1;w.inflateInit(),w.next_out=h,this.append=function(l,i){const o=[];let r,e,n=0,c=0,a=0;if(l.length!==0){w.next_in_index=0,w.next_in=l,w.avail_in=l.length;do{if(w.next_out_index=0,w.avail_out=t,w.avail_in!==0||d||(w.next_in_index=0,d=!0),r=w.inflate(0),d&&r===Zr){if(w.avail_in!==0)throw new Error("inflating: bad input")}else if(r!==0&&r!==1)throw new Error("inflating: "+w.msg);if((d||r===1)&&w.avail_in===l.length)throw new Error("inflating: bad input");w.next_out_index&&(w.next_out_index===t?o.push(new Uint8Array(h)):o.push(h.subarray(0,w.next_out_index))),a+=w.next_out_index,i&&w.next_in_index>0&&w.next_in_index!=n&&(i(w.next_in_index),n=w.next_in_index)}while(w.avail_in>0||w.avail_out===0);return o.length>1?(e=new Uint8Array(a),o.forEach(function(s){e.set(s,c),c+=s.length})):e=o[0]?new Uint8Array(o[0]):new Uint8Array,e}},this.flush=function(){w.inflateEnd()}}});const Q1=Object.freeze(Object.defineProperty({__proto__:null,BlobReader:wc,BlobWriter:_c,TextWriter:z1,ZipReader:K1,configure:Jl},Symbol.toStringTag,{value:"Module"})),Re={CONTAINER:"urn:oasis:names:tc:opendocument:xmlns:container",XHTML:"http://www.w3.org/1999/xhtml",OPF:"http://www.idpf.org/2007/opf",EPUB:"http://www.idpf.org/2007/ops",DC:"http://purl.org/dc/elements/1.1/",ENC:"http://www.w3.org/2001/04/xmlenc#",NCX:"http://www.daisy.org/z3986/2005/ncx/",XLINK:"http://www.w3.org/1999/xlink",SMIL:"http://www.w3.org/ns/SMIL"},Ue={XML:"application/xml",NCX:"application/x-dtbncx+xml",XHTML:"application/xhtml+xml",HTML:"text/html",CSS:"text/css",SVG:"image/svg+xml",JS:/\/(x-)?(javascript|ecmascript)/},rn={a11y:"http://www.idpf.org/epub/vocab/package/a11y/#",dcterms:"http://purl.org/dc/terms/",marc:"http://id.loc.gov/vocabulary/",media:"http://www.idpf.org/epub/vocab/overlays/#",onix:"http://www.editeur.org/ONIX/book/codelists/current.html#",rendition:"http://www.idpf.org/vocab/rendition/#",schema:"http://schema.org/",xsd:"http://www.w3.org/2001/XMLSchema#",msv:"http://www.idpf.org/epub/vocab/structure/magazine/#",prism:"http://www.prismstandard.org/specifications/3.0/PRISM_CV_Spec_3.0.htm#"},tg={art:"artist",aut:"author",clr:"colorist",edt:"editor",ill:"illustrator",nrt:"narrator",trl:"translator",pbl:"publisher"},eg={"02":"isbn","06":"doi",15:"isbn",26:"doi",34:"issn"},zo=C=>C.toLowerCase().replace(/[-:](.)/g,(w,t)=>t.toUpperCase()),rg=C=>C?C.replace(/[\t\n\f\r ]+/g," ").replace(/^[\t\n\f\r ]+/,"").replace(/[\t\n\f\r ]+$/,""):"",ng=(C,w,t)=>t?h=>{var d,l;return(l=(d=h.getAttribute(C))==null?void 0:d.split(/\s/))==null?void 0:l.includes(w)}:typeof w=="function"?h=>w(h.getAttribute(C)):h=>h.getAttribute(C)===w,Fs=(...C)=>w=>w?Object.fromEntries(C.map(t=>[zo(t),w.getAttribute(t)])):null,Gr=C=>rg(C==null?void 0:C.textContent),fs=(C,w)=>{const t=C.lookupNamespaceURI(null)===w||C.lookupPrefix(w),h=t?(d,l)=>i=>i.namespaceURI===w&&i.localName===l:(d,l)=>i=>i.localName===l;return{$:(d,l)=>[...d.children].find(h(d,l)),$$:(d,l)=>[...d.children].filter(h(d,l)),$$$:t?(d,l)=>[...d.getElementsByTagNameNS(w,l)]:(d,l)=>[...d.getElementsByTagName(l)]}},ii=(C,w)=>{try{if(C=C.replace(/%2c/,","),w.includes(":")&&!w.startsWith("OEBPS"))return new URL(C,w);const t="https://invalid.invalid/",h=new URL(C,t+w);return h.search="",decodeURI(h.href.replace(t,""))}catch(t){return console.warn(t),C}},Ic=C=>/^(?!blob)\w+:/i.test(C),ig=(C,w)=>{if(!C)return w;const t=C.replace(/\/$/,"").split("/"),h=w.replace(/\/$/,"").split("/"),d=(t.length>h.length?t:h).findIndex((l,i)=>t[i]!==h[i]);return d<0?"":Array(t.length-d).fill("..").concat(h.slice(d)).join("/")},sg=C=>C.slice(0,C.lastIndexOf("/")+1),Cs=async(C,w,t)=>{const h=[];C.replace(w,(...l)=>(h.push(l),null));const d=[];for(const l of h)d.push(await t(...l));return C.replace(w,()=>d.shift())},og=C=>C.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),$o=C=>{for(const[t,h]of Object.entries(C))h==null?delete C[t]:Array.isArray(h)?(C[t]=h.filter(d=>d).map(d=>typeof d=="object"&&!Array.isArray(d)?$o(d):d),C[t].length?C[t].length===1&&(C[t]=C[t][0]):delete C[t]):typeof h=="object"&&(C[t]=$o(h),Object.keys(h).length||delete C[t]);const w=Object.keys(C);return w.length===1&&w[0]==="name"?C[w[0]]:C},ag=C=>{const w=new Map(Object.entries(rn)),t=C.documentElement.getAttributeNS(Re.EPUB,"prefix")||C.documentElement.getAttribute("prefix");if(t)for(const[,h,d]of t.matchAll(/(.+): +(.+)[ \t\r\n]*/g))w.set(h,d);return w},al=(C,w)=>{if(!C)return null;const[t,h]=C.split(":"),d=h?t:null,l=h||t,i=w.get(d);return i?i+l:null},lg=C=>{var j,L,$,V,z,E,A,k,b,y,_,x,M,B,P,H,W,K,D,X,O,N,U;const{$:w}=fs(C,Re.OPF),t=w(C.documentElement,"metadata"),h=Object.groupBy(t.children,q=>q.namespaceURI===Re.DC?"dc":q.namespaceURI===Re.OPF&&q.localName==="meta"?q.hasAttribute("name")?"legacyMeta":"meta":""),d=t.getAttribute("xml:lang")??C.documentElement.getAttribute("xml:lang")??"und",l=ag(C),i=q=>{const Y=q.getAttribute("property"),G=q.getAttribute("scheme");return{property:al(Y,l)??Y,scheme:al(G,l)??G,lang:q.getAttribute("xml:lang"),value:Gr(q),props:r(q),attrs:Object.fromEntries(Array.from(q.attributes).filter(Q=>Q.namespaceURI===Re.OPF).map(Q=>[Q.localName,Q.value]))}},o=Map.groupBy(h.meta??[],q=>q.getAttribute("refines")),r=q=>{const Y=o.get(q?"#"+q.getAttribute("id"):null);return Y?Object.groupBy(Y.map(i),G=>G.property):null},e=Object.fromEntries(Object.entries(Object.groupBy(h.dc||[],q=>q.localName)).map(([q,Y])=>[q,Y.map(i)])),n=r()??{},c=Object.fromEntries(((j=h.legacyMeta)==null?void 0:j.map(q=>[q.getAttribute("name"),q.getAttribute("content")]))??[]),a=q=>{var Y;return(Y=q==null?void 0:q[0])==null?void 0:Y.value},s=(q,Y)=>{var G;return a((G=q==null?void 0:q.props)==null?void 0:G[Y])},f=q=>{var rt,it;if(!q)return null;const Y=((rt=q.props)==null?void 0:rt["alternate-script"])??[],G=q.attrs["alt-rep"];if(!Y.length&&(!q.lang||q.lang===d)&&!G)return q.value;const Q={[q.lang??d]:q.value};G&&(Q[q.attrs["alt-rep-lang"]]=G);for(const J of Y)Q[it=J.lang]??(Q[it]=J.value);return Q},p=q=>{var Y,G,Q,rt,it;return q?{name:f(q),sortAs:f((G=(Y=q.props)==null?void 0:Y["file-as"])==null?void 0:G[0])??q.attrs["file-as"],role:((it=(rt=(Q=q.props)==null?void 0:Q.role)==null?void 0:rt.filter(J=>J.scheme===rn.marc+"relators"))==null?void 0:it.map(J=>J.value))??[q.attrs.role],code:s(q,"term")??q.attrs.term,scheme:s(q,"authority")??q.attrs.authority}:null},u=q=>{var Y;return{name:f(q),position:a((Y=q.props)==null?void 0:Y["group-position"])}},g=q=>{var Q;const{value:Y}=q;if(/^urn:/i.test(Y))return Y;if(/^doi:/i.test(Y))return`urn:${Y}`;const G=(Q=q.props)==null?void 0:Q["identifier-type"];if(!G){const rt=q.attrs.scheme;return rt?/^(doi|isbn|uuid)$/i.test(rt)?`urn:${rt}:${Y}`:{scheme:rt,value:Y}:Y}if(G.scheme===rn.onix+"codelist5"){const rt=eg[G.value];if(rt)return`urn:${rt}:${Y}`}return Y},m=Object.groupBy(n["belongs-to-collection"]??[],q=>s(q,"collection-type")==="series"?"series":"collection"),v=((L=e.title)==null?void 0:L.find(q=>s(q,"title-type")==="main"))??(($=e.title)==null?void 0:$[0]),S={identifier:Pc(C),title:f(v),sortAs:f((z=(V=v==null?void 0:v.props)==null?void 0:V["file-as"])==null?void 0:z[0])??((E=v==null?void 0:v.attrs)==null?void 0:E["file-as"])??(c==null?void 0:c["calibre:title_sort"]),subtitle:(k=(A=e.title)==null?void 0:A.find(q=>s(q,"title-type")==="subtitle"))==null?void 0:k.value,language:(b=e.language)==null?void 0:b.map(q=>q.value),description:a(e.description),publisher:p((y=e.publisher)==null?void 0:y[0]),published:((x=(_=e.date)==null?void 0:_.find(q=>q.attrs.event==="publication"))==null?void 0:x.value)??a(e.date),modified:a(n[rn.dcterms+"modified"])??((B=(M=e.date)==null?void 0:M.find(q=>q.attrs.event==="modification"))==null?void 0:B.value),subject:(P=e.subject)==null?void 0:P.map(p),belongsTo:{collection:(H=m.collection)==null?void 0:H.map(u),series:((W=m.series)==null?void 0:W.map(u))??(c==null?void 0:c["calibre:series"])?{name:c==null?void 0:c["calibre:series"],position:parseFloat(c==null?void 0:c["calibre:series_index"])}:null},altIdentifier:(K=e.identifier)==null?void 0:K.map(g),source:(D=e.source)==null?void 0:D.map(g),rights:a(e.rights)},R=q=>Y=>{var Q;const G=new Set((Q=Y.role)==null?void 0:Q.map(rt=>tg[rt]??q));return[G.size?G:[q],Y]};for(const[q,Y]of[].concat(((O=(X=e.creator)==null?void 0:X.map(p))==null?void 0:O.map(R("author")))??[],((U=(N=e.contributor)==null?void 0:N.map(p))==null?void 0:U.map(R("contributor")))??[]))for(const G of q)S[G]?S[G].push(Y):S[G]=[Y];$o(S),S.altIdentifier===S.identifier&&delete S.altIdentifier;const I={},F={};for(const[q,Y]of Object.entries(n))q.startsWith(rn.rendition)?I[zo(q.replace(rn.rendition,""))]=a(Y):q.startsWith(rn.media)&&(F[zo(q.replace(rn.media,""))]=a(Y));return F.duration&&(F.duration=Vo(F.duration)),{metadata:S,rendition:I,media:F}},cg=(C,w=t=>t)=>{var f;const{$:t,$$:h,$$$:d}=fs(C,Re.XHTML),l=p=>p?decodeURI(w(p)):null,i=p=>u=>{var I;const g=t(u,"a")??t(u,"span"),m=t(u,"ol"),v=l(g==null?void 0:g.getAttribute("href")),R={label:Gr(g)||(g==null?void 0:g.getAttribute("title")),href:v,subitems:o(m)};return p&&(R.type=(I=g==null?void 0:g.getAttributeNS(Re.EPUB,"type"))==null?void 0:I.split(/\s/)),R},o=(p,u)=>p?h(p,"li").map(i(u)):null,r=(p,u)=>o(t(p,"ol"),u),e=d(C,"nav");let n=null,c=null,a=null,s=[];for(const p of e){const u=((f=p.getAttributeNS(Re.EPUB,"type"))==null?void 0:f.split(/\s/))??[];u.includes("toc")?n??(n=r(p)):u.includes("page-list")?c??(c=r(p)):u.includes("landmarks")?a??(a=r(p,!0)):s.push({label:Gr(p.firstElementChild),type:u,list:r(p)})}return{toc:n,pageList:c,landmarks:a,others:s}},ug=(C,w=t=>t)=>{const{$:t,$$:h}=fs(C,Re.NCX),d=r=>r?decodeURI(w(r)):null,l=r=>{const e=t(r,"navLabel"),n=t(r,"content"),c=Gr(e),a=d(n.getAttribute("src"));if(r.localName==="navPoint"){const s=h(r,"navPoint");return{label:c,href:a,subitems:s.length?s.map(l):null}}return{label:c,href:a}},i=(r,e)=>h(r,e).map(l),o=(r,e)=>{const n=t(C.documentElement,r);return n?i(n,e):null};return{toc:o("navMap","navPoint"),pageList:o("pageList","pageTarget"),others:h(C.documentElement,"navList").map(r=>({label:Gr(t(r,"navLabel")),list:i(r,"navTarget")}))}},Vo=C=>{if(!C)return;const w=C.split(":").map(i=>parseFloat(i));if(w.length===3){const[i,o,r]=w;return i*60*60+o*60+r}if(w.length===2){const[i,o]=w;return i*60+o}const[t,h]=C.split(/(?=[^\d.])/),d=parseFloat(t),l=h==="h"?60*60:h==="min"?60:h==="ms"?.001:1;return d*l};var on,$i,jn,lr,Ye,Le,Vi,Ui,an,te,Bc,Ds,Cn,Tn,Ls,zs,Mn,Uo;class fg extends EventTarget{constructor(t,h){super();mt(this,te);mt(this,on);mt(this,$i);mt(this,jn);mt(this,lr);mt(this,Ye);mt(this,Le);mt(this,Vi,1);mt(this,Ui,1);mt(this,an);this.book=t,this.loadXML=h}async start(t,h=()=>!0){var o;(o=Z(this,Le))==null||o.pause();const d=this.book.sections[t],l=d==null?void 0:d.id;if(!l)return;const{mediaOverlay:i}=d;if(!i)return this.start(t+1);gt(this,jn,t),await ht(this,te,Bc).call(this,i);for(let r=0;r<Z(this,on).length;r++){const{items:e}=Z(this,on)[r];for(let n=0;n<e.length;n++)if(e[n].text.split("#")[0]===l&&h(e[n],n,e))return ht(this,te,Mn).call(this,r,n).catch(c=>ht(this,te,Tn).call(this,c))}}pause(){var t;gt(this,an,"paused"),(t=Z(this,Le))==null||t.pause()}resume(){var t;gt(this,an,"playing"),(t=Z(this,Le))==null||t.play().catch(h=>ht(this,te,Tn).call(this,h))}stop(){gt(this,an,"stopped"),ht(this,te,Uo).call(this)}prev(){Z(this,Ye)>0?ht(this,te,Mn).call(this,Z(this,lr),Z(this,Ye)-1):Z(this,lr)>0?ht(this,te,Mn).call(this,Z(this,lr)-1,Z(this,on)[Z(this,lr)-1].items.length-1):Z(this,jn)>0&&this.start(Z(this,jn)-1,(t,h,d)=>h===d.length-1)}next(){ht(this,te,Mn).call(this,Z(this,lr),Z(this,Ye)+1)}setVolume(t){gt(this,Vi,t),Z(this,Le)&&(Z(this,Le).volume=t)}setRate(t){gt(this,Ui,t),Z(this,Le)&&(Z(this,Le).playbackRate=t)}}on=new WeakMap,$i=new WeakMap,jn=new WeakMap,lr=new WeakMap,Ye=new WeakMap,Le=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,an=new WeakMap,te=new WeakSet,Bc=async function(t){if(Z(this,$i)===t)return;const h=await this.loadXML(t.href),d=o=>o?ii(o,t.href):null,{$:l,$$$:i}=fs(h,Re.SMIL);gt(this,lr,-1),gt(this,Ye,-1),gt(this,on,i(h,"par").reduce((o,r)=>{var p;const e=d((p=l(r,"text"))==null?void 0:p.getAttribute("src")),n=l(r,"audio");if(!e||!n)return o;const c=d(n.getAttribute("src")),a=Vo(n.getAttribute("clipBegin")),s=Vo(n.getAttribute("clipEnd")),f=o.at(-1);return(f==null?void 0:f.src)===c?f.items.push({text:e,begin:a,end:s}):o.push({src:c,items:[{text:e,begin:a,end:s}]}),o},[])),gt(this,$i,t)},Ds=function(){return Z(this,on)[Z(this,lr)]},Cn=function(){var t,h;return(h=(t=Z(this,te,Ds))==null?void 0:t.items)==null?void 0:h[Z(this,Ye)]},Tn=function(t){console.error(t),this.dispatchEvent(new CustomEvent("error",{detail:t}))},Ls=function(){this.dispatchEvent(new CustomEvent("highlight",{detail:Z(this,te,Cn)}))},zs=function(){this.dispatchEvent(new CustomEvent("unhighlight",{detail:Z(this,te,Cn)}))},Mn=async function(t,h){var o;ht(this,te,Uo).call(this),gt(this,lr,t),gt(this,Ye,h);const d=(o=Z(this,te,Ds))==null?void 0:o.src;if(!d||!Z(this,te,Cn))return this.start(Z(this,jn)+1);const l=URL.createObjectURL(await this.book.loadBlob(d)),i=new Audio(l);gt(this,Le,i),i.volume=Z(this,Vi),i.playbackRate=Z(this,Ui),i.addEventListener("timeupdate",()=>{var c,a;if(i.paused)return;const r=i.currentTime,{items:e}=Z(this,te,Ds);if(r>((c=Z(this,te,Cn))==null?void 0:c.end)&&(ht(this,te,zs).call(this),Z(this,Ye)===e.length-1)){ht(this,te,Mn).call(this,Z(this,lr)+1,0).catch(s=>ht(this,te,Tn).call(this,s));return}const n=Z(this,Ye);for(;((a=e[Z(this,Ye)+1])==null?void 0:a.begin)<=r;)Ei(this,Ye)._++;Z(this,Ye)!==n&&ht(this,te,Ls).call(this)}),i.addEventListener("error",()=>ht(this,te,Tn).call(this,new Error(`Failed to load ${d}`))),i.addEventListener("playing",()=>ht(this,te,Ls).call(this)),i.addEventListener("ended",()=>{ht(this,te,zs).call(this),URL.revokeObjectURL(l),gt(this,Le,null),ht(this,te,Mn).call(this,t+1,0).catch(r=>ht(this,te,Tn).call(this,r))}),Z(this,an)==="paused"?(ht(this,te,Ls).call(this),i.currentTime=Z(this,te,Cn).begin??0):i.addEventListener("canplaythrough",()=>{i.currentTime=Z(this,te,Cn).begin??0,gt(this,an,"playing"),i.play().catch(r=>ht(this,te,Tn).call(this,r))},{once:!0})},Uo=function(){Z(this,Le)&&(Z(this,Le).pause(),URL.revokeObjectURL(Z(this,Le).src),gt(this,Le,null),ht(this,te,zs).call(this))};const hg=/([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})/,dg=C=>{for(const w of C.getElementsByTagNameNS(Re.DC,"identifier")){const[t]=Gr(w).split(":").slice(-1);if(hg.test(t))return t}return""},Pc=C=>Gr(C.getElementById(C.documentElement.getAttribute("unique-identifier"))??C.getElementsByTagNameNS(Re.DC,"identifier")[0]),ll=async(C,w,t)=>{const h=new Uint8Array(await t.slice(0,w).arrayBuffer());w=Math.min(w,h.length);for(var d=0;d<w;d++)h[d]=h[d]^C[d%C.length];return new Blob([h,t.slice(w)],{type:t.type})},pg=async C=>{const w=new TextEncoder().encode(C),t=await globalThis.crypto.subtle.digest("SHA-1",w);return new Uint8Array(t)},mg=(C=pg)=>({"http://www.idpf.org/2008/embedding":{key:w=>C(Pc(w).replaceAll(/[\u0020\u0009\u000d\u000a]/g,"")),decode:(w,t)=>ll(w,1040,t)},"http://ns.adobe.com/pdf/enc#RC":{key:w=>{const t=dg(w).replaceAll("-","");return Uint8Array.from({length:16},(h,d)=>parseInt(t.slice(d*2,d*2+2),16))},decode:(w,t)=>ll(w,1024,t)}});var Hi,oi,Wi;class gg{constructor(w){mt(this,Hi,new Map);mt(this,oi,new Map);mt(this,Wi);gt(this,Wi,w)}async init(w,t){if(!w)return;const h=Array.from(w.getElementsByTagNameNS(Re.ENC,"EncryptedData"),d=>{var l,i;return{algorithm:(l=d.getElementsByTagNameNS(Re.ENC,"EncryptionMethod")[0])==null?void 0:l.getAttribute("Algorithm"),uri:(i=d.getElementsByTagNameNS(Re.ENC,"CipherReference")[0])==null?void 0:i.getAttribute("URI")}});for(const{algorithm:d,uri:l}of h){if(!Z(this,oi).has(d)){const i=Z(this,Wi)[d];if(!i){console.warn("Unknown encryption algorithm");continue}const o=await i.key(t);Z(this,oi).set(d,r=>i.decode(o,r))}Z(this,Hi).set(l,d)}}getDecoder(w){return Z(this,oi).get(Z(this,Hi).get(w))??(t=>t)}}Hi=new WeakMap,oi=new WeakMap,Wi=new WeakMap;class bg{constructor({opf:w,resolveHref:t}){var n,c,a,s,f;this.opf=w;const{$:h,$$:d,$$$:l}=fs(w,Re.OPF),i=h(w.documentElement,"manifest"),o=h(w.documentElement,"spine"),r=d(o,"itemref");this.manifest=d(i,"item").map(Fs("href","id","media-type","properties","media-overlay")).map(p=>{var u;return p.href=t(p.href),p.properties=(u=p.properties)==null?void 0:u.split(/\s/),p}),this.spine=r.map(Fs("idref","id","linear","properties")).map(p=>{var u;return p.properties=(u=p.properties)==null?void 0:u.split(/\s/),p}),this.pageProgressionDirection=o.getAttribute("page-progression-direction"),this.navPath=(n=this.getItemByProperty("nav"))==null?void 0:n.href,this.ncxPath=(c=this.getItemByID(o.getAttribute("toc"))??this.manifest.find(p=>p.mediaType===Ue.NCX))==null?void 0:c.href;const e=h(w.documentElement,"guide");e&&(this.guide=d(e,"reference").map(Fs("type","title","href")).map(({type:p,title:u,href:g})=>({label:u,type:p.split(/\s/),href:t(g)}))),this.cover=this.getItemByProperty("cover-image")??this.getItemByID((a=l(w,"meta").find(ng("name","cover")))==null?void 0:a.getAttribute("content"))??this.manifest.find(p=>p.href.includes("cover")&&p.mediaType.startsWith("image"))??this.getItemByHref((f=(s=this.guide)==null?void 0:s.find(p=>p.type.includes("cover")))==null?void 0:f.href),this.cfis=Td(r)}getItemByID(w){return this.manifest.find(t=>t.id===w)}getItemByHref(w){return this.manifest.find(t=>t.href===w)}getItemByProperty(w){return this.manifest.find(t=>{var h;return(h=t.properties)==null?void 0:h.includes(w)})}resolveCFI(w){const t=Bi(w),h=(t.parent??t).shift();let d=Na(this.opf,h);d&&d.nodeName!=="idref"&&(h.at(-1).id=null,d=Na(this.opf,h));const l=d==null?void 0:d.getAttribute("idref");return{index:this.spine.findIndex(r=>r.idref===l),anchor:r=>Ll(r,t)}}}var $r,Vr,Mr;class vg{constructor({loadText:w,loadBlob:t,resources:h}){mt(this,$r,new Map);mt(this,Vr,new Map);mt(this,Mr,new Map);De(this,"allowScript",!1);De(this,"eventTarget",new EventTarget);this.loadText=w,this.loadBlob=t,this.manifest=h.manifest,this.assets=h.manifest}async createURL(w,t,h,d){if(!t)return"";const l={data:t,type:h};Object.defineProperty(l,"name",{value:w});const i=new CustomEvent("data",{detail:l});this.eventTarget.dispatchEvent(i);const o=await i.detail.data,r=await i.detail.type,e=URL.createObjectURL(new Blob([o],{type:r}));if(Z(this,$r).set(w,e),Z(this,Mr).set(w,1),d){const n=Z(this,Vr).get(d);n?n.push(w):Z(this,Vr).set(d,[w])}return e}ref(w,t){const h=Z(this,Vr).get(t);return h!=null&&h.includes(w)||(Z(this,Mr).set(w,Z(this,Mr).get(w)+1),h?h.push(w):Z(this,Vr).set(t,[w])),Z(this,$r).get(w)}unref(w){if(!Z(this,Mr).has(w))return;const t=Z(this,Mr).get(w)-1;if(t<1){URL.revokeObjectURL(Z(this,$r).get(w)),Z(this,$r).delete(w),Z(this,Mr).delete(w);const h=Z(this,Vr).get(w);if(h)for(;h.length;)this.unref(h.pop());Z(this,Vr).delete(w)}else Z(this,Mr).set(w,t)}async loadItem(w,t=[]){if(!w)return null;const{href:h,mediaType:d}=w,l=Ue.JS.test(w.mediaType);if(l&&!this.allowScript)return null;const i=t.at(-1);if(Z(this,$r).has(h))return this.ref(h,i);if((l||[Ue.XHTML,Ue.HTML,Ue.CSS,Ue.SVG].includes(d))&&t.every(e=>e!==h))return this.loadReplaced(w,t);const r=Promise.resolve().then(()=>this.loadBlob(h));return this.createURL(h,r,d,i)}async loadHref(w,t,h=[]){if(Ic(w))return w;const d=ii(w,t),l=this.manifest.find(i=>i.href===d);return l?this.loadItem(l,h.concat(t)):w}async loadReplaced(w,t=[]){var r,e;const{href:h,mediaType:d}=w,l=t.at(-1);let i="";try{i=await this.loadText(h)}catch(n){return this.createURL(h,Promise.reject(n),d,l)}if(!i)return null;if([Ue.XHTML,Ue.HTML,Ue.SVG].includes(d)){let n=new DOMParser().parseFromString(i,d);if(d===Ue.XHTML&&(n.querySelector("parsererror")||!((r=n.documentElement)!=null&&r.namespaceURI))&&(console.warn(((e=n.querySelector("parsererror"))==null?void 0:e.innerText)??"Invalid XHTML"),w.mediaType=Ue.HTML,n=new DOMParser().parseFromString(i,w.mediaType)),[Ue.XHTML,Ue.SVG].includes(w.mediaType)){let s=n.firstChild;for(;s instanceof ProcessingInstruction;){if(s.data){const f=await Cs(s.data,/(?:^|\s*)(href\s*=\s*['"])([^'"]*)(['"])/i,(p,u,g,m)=>this.loadHref(g,h,t).then(v=>`${u}${v}${m}`));s.replaceWith(n.createProcessingInstruction(s.target,f))}s=s.nextSibling}}const c=async(s,f)=>s.setAttribute(f,await this.loadHref(s.getAttribute(f),h,t));for(const s of n.querySelectorAll("link[href]"))await c(s,"href");for(const s of n.querySelectorAll("[src]"))await c(s,"src");for(const s of n.querySelectorAll("[poster]"))await c(s,"poster");for(const s of n.querySelectorAll("object[data]"))await c(s,"data");for(const s of n.querySelectorAll("[*|href]:not([href])"))s.setAttributeNS(Re.XLINK,"href",await this.loadHref(s.getAttributeNS(Re.XLINK,"href"),h,t));for(const s of n.querySelectorAll("style"))s.textContent&&(s.textContent=await this.replaceCSS(s.textContent,h,t));for(const s of n.querySelectorAll("[style]"))s.setAttribute("style",await this.replaceCSS(s.getAttribute("style"),h,t));const a=new XMLSerializer().serializeToString(n);return this.createURL(h,a,w.mediaType,l)}const o=d===Ue.CSS?await this.replaceCSS(i,h,t):await this.replaceString(i,h,t);return this.createURL(h,o,d,l)}async replaceCSS(w,t,h=[]){const d=await Cs(w,/url\(\s*["']?([^'"\n]*?)\s*["']?\s*\)/gi,(l,i)=>this.loadHref(i,t,h).then(o=>`url("${o}")`));return Cs(d,/@import\s*["']([^"'\n]*?)["']/gi,(l,i)=>this.loadHref(i,t,h).then(o=>`@import "${o}"`))}replaceString(w,t,h=[]){const d=new Map,l=this.assets.map(o=>{if(o.href===t)return;const r=ig(sg(t),o.href),e=encodeURI(r),n="/"+o.href,c=encodeURI(n),a=new Set([r,e,n,c]);for(const s of a)d.set(s,o);return Array.from(a)}).flat().filter(o=>o);if(!l.length)return w;const i=new RegExp(l.map(og).join("|"),"g");return Cs(w,i,async o=>this.loadItem(d.get(o.replace(/^\//,"")),h.concat(t)))}unloadItem(w){this.unref(w==null?void 0:w.href)}destroy(){for(const w of Z(this,$r).values())URL.revokeObjectURL(w)}}$r=new WeakMap,Vr=new WeakMap,Mr=new WeakMap;const yg=(C,w)=>C.getElementById(w)??C.querySelector(`[name="${CSS.escape(w)}"]`),wg=C=>{for(const w of C){if(w==="page-spread-left"||w==="rendition:page-spread-left")return"left";if(w==="page-spread-right"||w==="rendition:page-spread-right")return"right";if(w==="rendition:page-spread-center")return"center"}},_g=C=>C?{fixedLayout:Gr(C.querySelector('option[name="fixed-layout"]')),openToSpread:Gr(C.querySelector('option[name="open-to-spread"]'))}:null;var ln,ai,yr,Fr;class xg{constructor({loadText:w,loadBlob:t,getSize:h,sha1:d}){mt(this,yr);De(this,"parser",new DOMParser);mt(this,ln);mt(this,ai);this.loadText=w,this.loadBlob=t,this.getSize=h,gt(this,ai,new gg(mg(d)))}async init(){var a,s;const w=await ht(this,yr,Fr).call(this,"META-INF/container.xml");if(!w)throw new Error("Failed to load container file");const t=Array.from(w.getElementsByTagNameNS(Re.CONTAINER,"rootfile"),Fs("full-path","media-type")).filter(f=>f.mediaType==="application/oebps-package+xml");if(!t.length)throw new Error("No package document defined in container");const h=t[0].fullPath,d=await ht(this,yr,Fr).call(this,h);if(!d)throw new Error("Failed to load package document");const l=await ht(this,yr,Fr).call(this,"META-INF/encryption.xml");await Z(this,ai).init(l,d),this.resources=new bg({opf:d,resolveHref:f=>ii(f,h)}),gt(this,ln,new vg({loadText:this.loadText,loadBlob:f=>Promise.resolve(this.loadBlob(f)).then(Z(this,ai).getDecoder(f)),resources:this.resources})),this.transformTarget=Z(this,ln).eventTarget,this.sections=this.resources.spine.map((f,p)=>{const{idref:u,linear:g,properties:m=[]}=f,v=this.resources.getItemByID(u);return v?{id:v.href,load:()=>Z(this,ln).loadItem(v),unload:()=>Z(this,ln).unloadItem(v),createDocument:()=>this.loadDocument(v),size:this.getSize(v.href),cfi:this.resources.cfis[p],linear:g,pageSpread:wg(m),resolveHref:S=>ii(S,v.href),mediaOverlay:v.mediaOverlay?this.resources.getItemByID(v.mediaOverlay):null}:(console.warn(`Could not find item with ID "${u}" in manifest`),null)}).filter(f=>f);const{navPath:i,ncxPath:o}=this.resources;if(i)try{const f=u=>ii(u,i),p=cg(await ht(this,yr,Fr).call(this,i),f);this.toc=p.toc,this.pageList=p.pageList,this.landmarks=p.landmarks}catch(f){console.warn(f)}if(!this.toc&&o)try{const f=u=>ii(u,o),p=ug(await ht(this,yr,Fr).call(this,o),f);this.toc=p.toc,this.pageList=p.pageList}catch(f){console.warn(f)}this.landmarks??(this.landmarks=this.resources.guide);const{metadata:r,rendition:e,media:n}=lg(d);this.metadata=r,this.rendition=e,this.media=n,this.dir=this.resources.pageProgressionDirection;const c=_g(await ht(this,yr,Fr).call(this,"META-INF/com.apple.ibooks.display-options.xml")??await ht(this,yr,Fr).call(this,"META-INF/com.kobobooks.display-options.xml"));return c&&(c.fixedLayout==="true"&&((a=this.rendition).layout??(a.layout="pre-paginated")),c.openToSpread==="false"&&((s=this.sections.find(f=>f.linear!=="no")).pageSpread??(s.pageSpread=this.dir==="rtl"?"left":"right"))),this}async loadDocument(w){const t=await this.loadText(w.href);return this.parser.parseFromString(t,w.mediaType)}getMediaOverlay(){return new fg(this,ht(this,yr,Fr).bind(this))}resolveCFI(w){return this.resources.resolveCFI(w)}resolveHref(w){const[t,h]=w.split("#"),d=this.resources.getItemByHref(decodeURI(t));return d?{index:this.resources.spine.findIndex(({idref:o})=>o===d.id),anchor:h?o=>yg(o,h):()=>0}:null}splitTOCHref(w){return(w==null?void 0:w.split("#"))??[]}getTOCFragment(w,t){return w.getElementById(t)??w.querySelector(`[name="${CSS.escape(t)}"]`)}isExternal(w){return Ic(w)}async getCover(){var t;const w=(t=this.resources)==null?void 0:t.cover;return w!=null&&w.href?new Blob([await this.loadBlob(w.href)],{type:w.mediaType}):null}async getCalibreBookmarks(){const w=await this.loadText("META-INF/calibre_bookmarks.txt"),t="encoding=json+base64:";if(w!=null&&w.startsWith(t)){const h=atob(w.slice(t.length));return JSON.parse(h)}}destroy(){var w;(w=Z(this,ln))==null||w.destroy()}}ln=new WeakMap,ai=new WeakMap,yr=new WeakSet,Fr=async function(w){const t=await this.loadText(w);if(!t)return null;const h=this.parser.parseFromString(t,Ue.XML);if(h.querySelector("parsererror"))throw new Error(`XML parsing error: ${w}
117
117
  ${h.querySelector("parsererror").innerText}`);return h};const cl=Object.freeze(Object.defineProperty({__proto__:null,EPUB:xg},Symbol.toStringTag,{value:"Module"})),kg=async({entries:C,loadBlob:w,getSize:t,getComment:h},d)=>{const l=new Map,i=new Map,o=async a=>{if(l.has(a))return l.get(a);const s=URL.createObjectURL(await w(a)),f=URL.createObjectURL(new Blob([`<body style="margin: 0"><img src="${s}">`],{type:"text/html"}));return i.set(a,[s,f]),l.set(a,f),f},r=a=>{var s,f;(f=(s=i.get(a))==null?void 0:s.forEach)==null||f.call(s,p=>URL.revokeObjectURL(p)),i.delete(a),l.delete(a)},e=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".jxl",".avif"],n=C.map(a=>a.filename).filter(a=>e.some(s=>a.endsWith(s))).sort();if(!n.length)throw new Error("No supported image files in archive");const c={};try{const s=JSON.parse(await h()||"")["ComicBookInfo/1.0"];if(s){const f=s.publicationYear,p=s.publicationMonth,u=p&&p>=1&&p<=12?String(p).padStart(2,"0"):null;c.metadata={title:s.title||d.name,publisher:s.publisher,language:s.language||s.lang,author:s.credits?s.credits.map(g=>`${g.person} (${g.role})`).join(", "):"",published:f&&p?`${f}-${u}`:void 0}}else c.metadata={title:d.name}}catch{c.metadata={title:d.name}}return c.getCover=()=>w(n[0]),c.sections=n.map(a=>({id:a,load:()=>o(a),unload:()=>r(a),size:t(a)})),c.toc=n.map(a=>({label:a,href:a})),c.rendition={layout:"pre-paginated"},c.resolveHref=a=>({index:c.sections.findIndex(s=>s.id===a)}),c.splitTOCHref=a=>[a,null],c.getTOCFragment=a=>a.documentElement,c.destroy=()=>{for(const a of i.values())for(const s of a)URL.revokeObjectURL(s)},c},Sg=Object.freeze(Object.defineProperty({__proto__:null,makeComicBook:kg},Symbol.toStringTag,{value:"Module"})),Fc=C=>C?C.replace(/[\t\n\f\r ]+/g," ").replace(/^[\t\n\f\r ]+/,"").replace(/[\t\n\f\r ]+$/,""):"",sr=C=>Fc(C==null?void 0:C.textContent),Ts={XLINK:"http://www.w3.org/1999/xlink",EPUB:"http://www.idpf.org/2007/ops"},Js={XML:"application/xml",XHTML:"application/xhtml+xml"},ir={strong:["strong","self"],emphasis:["em","self"],style:["span","self"],a:"anchor",strikethrough:["s","self"],sub:["sub","self"],sup:["sup","self"],code:["code","self"],image:"image"},Eg={tr:["tr",{th:["th",ir,["colspan","rowspan","align","valign"]],td:["td",ir,["colspan","rowspan","align","valign"]]},["align"]]},Dc={epigraph:["blockquote"],subtitle:["h2",ir],"text-author":["p",ir],date:["p",ir],stanza:"stanza"},Qs={title:["header",{p:["h1",ir],"empty-line":["br"]}],epigraph:["blockquote","self"],image:"image",annotation:["aside"],section:["section","self"],p:["p",ir],poem:["blockquote",Dc],subtitle:["h2",ir],cite:["blockquote","self"],"empty-line":["br"],table:["table",Eg],"text-author":["p",ir]};Dc.epigraph.push(Qs);const Cg={image:"image",title:["section",{p:["h1",ir],"empty-line":["br"]}],epigraph:["section",Qs],section:["section",Qs]};class Tg{constructor(w){this.fb2=w,this.doc=document.implementation.createDocument(Ts.XHTML,"html"),this.bins=new Map(Array.from(this.fb2.getElementsByTagName("binary"),t=>[t.id,t]))}getImageSrc(w){const t=w.getAttributeNS(Ts.XLINK,"href");if(!t)return"data:,";const[,h]=t.split("#");if(!h)return t;const d=this.bins.get(h);return d?`data:${d.getAttribute("content-type")};base64,${d.textContent}`:t}image(w){const t=this.doc.createElement("img");return t.alt=w.getAttribute("alt"),t.title=w.getAttribute("title"),t.setAttribute("src",this.getImageSrc(w)),t}anchor(w){const t=this.convert(w,{a:["a",ir]});return t.setAttribute("href",w.getAttributeNS(Ts.XLINK,"href")),w.getAttribute("type")==="note"&&t.setAttributeNS(Ts.EPUB,"epub:type","noteref"),t}stanza(w){const t=this.convert(w,{stanza:["p",{title:["header",{p:["strong",ir],"empty-line":["br"]}],subtitle:["p",ir]}]});for(const h of w.children)h.nodeName==="v"&&(t.append(this.doc.createTextNode(h.textContent)),t.append(this.doc.createElement("br")));return t}convert(w,t){if(w.nodeType===3)return this.doc.createTextNode(w.textContent);if(w.nodeType===4)return this.doc.createCDATASection(w.textContent);if(w.nodeType===8)return this.doc.createComment(w.textContent);const h=t==null?void 0:t[w.nodeName];if(!h)return null;if(typeof h=="string")return this[h](w);const[d,l,i]=h,o=this.doc.createElement(d);if(w.id&&(o.id=w.id),o.classList.add(w.nodeName),Array.isArray(i))for(const n of i){const c=w.getAttribute(n);c&&o.setAttribute(n,c)}const r=l==="self"?t:l;let e=w.firstChild;for(;e;){const n=this.convert(e,r);n&&o.append(n),e=e.nextSibling}return o}}const Mg=async C=>{var i;const w=await C.arrayBuffer(),t=new TextDecoder("utf-8").decode(w),h=new DOMParser,d=h.parseFromString(t,Js.XML),l=d.xmlEncoding||((i=t.match(/^<\?xml\s+version\s*=\s*["']1.\d+"\s+encoding\s*=\s*["']([A-Za-z0-9._-]*)["']/))==null?void 0:i[1]);if(l&&l.toLowerCase()!=="utf-8"){const o=new TextDecoder(l).decode(w);return h.parseFromString(o,Js.XML)}return d},Ag=URL.createObjectURL(new Blob([`
118
118
  @namespace epub "http://www.idpf.org/2007/ops";
119
119
  body > img, section > img {