@uurtech/jdf 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jdfjs.js CHANGED
@@ -1,4 +1,5 @@
1
- var Z={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6},Tabloid:{width:279.4,height:431.8}},N={top:25,right:20,bottom:25,left:20},P=3.7795275591,_=96,q=1.3333333333;function f(e,t="mm"){switch(t){case "mm":return e*P;case "in":return e*_;case "pt":return e*q;case "px":return e;default:return e*P}}function R(e,t="portrait"){let n=typeof e=="string"?Z[e]:e;return t==="landscape"?{width:n.height,height:n.width}:{...n}}function H(e){if(typeof e=="number")return `${e}px`;if(typeof e=="string")return e;let{top:t=0,right:n=0,bottom:r=0,left:o=0}=e;return `${t}px ${n}px ${r}px ${o}px`}function m(e){let t={};if(e.fontFamily&&(t["font-family"]=e.fontFamily),e.fontSize&&(t["font-size"]=`${e.fontSize*1.333}px`),e.fontWeight&&(t["font-weight"]=String(e.fontWeight)),e.fontStyle&&(t["font-style"]=e.fontStyle),e.color&&(t.color=e.color),e.backgroundColor&&(t["background-color"]=e.backgroundColor),e.textAlign&&(t["text-align"]=e.textAlign),e.textDecoration){let n=e.textDecoration==="strikethrough"?"line-through":e.textDecoration;t["text-decoration"]=n;}return e.lineHeight&&(t["line-height"]=String(e.lineHeight)),e.letterSpacing!=null&&(t["letter-spacing"]=typeof e.letterSpacing=="number"?`${e.letterSpacing}px`:e.letterSpacing),e.padding!=null&&(t.padding=H(e.padding)),e.margin!=null&&(t.margin=H(e.margin)),e.marginTop!=null&&(t["margin-top"]=`${e.marginTop}px`),e.marginBottom!=null&&(t["margin-bottom"]=`${e.marginBottom}px`),e.border&&(t.border=e.border),e.borderRadius!=null&&(t["border-radius"]=typeof e.borderRadius=="number"?`${e.borderRadius}px`:e.borderRadius),e.opacity!=null&&(t.opacity=String(e.opacity)),t}function E(e,t){if(!e)return {};if(typeof e=="string")return m(t[e]||{});if(Array.isArray(e)){let n={};for(let r of e)n={...n,...t[r]||{}};return m(n)}return m(e)}function b(e,t){for(let[n,r]of Object.entries(t))e.style.setProperty(n,r);}function C(e){if(!e)return null;let t=typeof e=="string"?e:e.target;if(typeof e=="string"?e.startsWith("#"):e.type==="internal"){let r=t.replace(/^#/,"").match(/^page-(\d+)$/i);return r?{href:t,internal:true,pageIndex:Number(r[1])-1}:{href:t,internal:true}}return {href:t,internal:false}}function L(e,t,n){e.href=t.href,t.internal?e.addEventListener("click",r=>{t.pageIndex!=null&&n&&(r.preventDefault(),n(t.pageIndex));}):(e.target="_blank",e.rel="noopener noreferrer");}var j="http://www.w3.org/2000/svg";function w(e,t){let n=document.createElement("div");W(n,e);let r=null;switch(e.type){case "text":r=B(e,t);break;case "richtext":r=X(e,t);break;case "image":r=ee(e,t);break;case "table":r=re(e,t);break;case "list":r=oe(e,t);break;case "shape":r=ie(e);break;case "collapsible":r=se(e,t);break;case "toc":r=ae(e,t);break}return r?(n.appendChild(r),n):null}function W(e,t){let n=t;n.position&&(e.style.position="absolute",n.position.x!=null&&(e.style.left=`${f(n.position.x)}px`),n.position.y!=null&&(e.style.top=`${f(n.position.y)}px`)),n.width!=null&&(e.style.width=`${f(n.width)}px`),n.height!=null&&(e.style.height=`${f(n.height)}px`);}function B(e,t){let n=G(e.heading),r=document.createElement(n);r.className="jdfjs-text",r.style.margin="0",r.style.whiteSpace="pre-wrap",b(r,E(e.style,t.styles)),e.align&&(r.style.textAlign=e.align);let o=C(e.link);if(o){let a=document.createElement("a");L(a,o,t.onNavigatePage),a.className="jdfjs-link",a.textContent=e.content||"",r.appendChild(a);}else r.textContent=e.content||"";return r}function G(e){return e===true?"h1":typeof e=="number"&&e>=1&&e<=6?"h"+e:"p"}function X(e,t){let n=document.createElement("p");n.className="jdfjs-richtext",n.style.margin="0",b(n,E(e.style,t.styles));for(let r of e.runs||[])n.appendChild(K(r,t));return n}function U(e,t){let n={};if(e.style)if(typeof e.style=="string")Object.assign(n,m(t[e.style]||{}));else if(Array.isArray(e.style))for(let o of e.style)Object.assign(n,m(t[o]||{}));else Object.assign(n,m(e.style));e.bold&&(n["font-weight"]="bold"),e.italic&&(n["font-style"]="italic");let r=[];return e.underline&&r.push("underline"),e.strikethrough&&r.push("line-through"),r.length&&(n["text-decoration"]=r.join(" ")),e.color&&(n.color=e.color),e.fontSize&&(n["font-size"]=`${e.fontSize*1.333}px`),e.fontFamily&&(n["font-family"]=e.fontFamily),n}function K(e,t){let n=C(e.link),r=n?document.createElement("a"):document.createElement("span");return n&&(L(r,n,t.onNavigatePage),r.classList.add("jdfjs-link")),b(r,U(e,t.styles)),r.textContent=e.text,r}function Q(e,t){if(!e)return;let n=e[t];if(n&&typeof n=="object"&&"data"in n)return n;let r=e.images?.[t];if(r)return r}function Y(e,t){if(e.src?.startsWith("data:")||e.src?.startsWith("http"))return e.src;if(e.resource){let n=Q(t,e.resource);if(n?.data){let r=n.mimeType||"image/png";return n.data.startsWith("data:")?n.data:`data:${r};base64,${n.data}`}if(n?.path)return n.path}return e.src||""}function ee(e,t){let n=document.createElement("div");n.className="jdfjs-image",n.style.width="100%",n.style.height="100%";let r=document.createElement("img");switch(r.src=Y(e,t.resources),r.alt=e.alt||"",r.style.display="block",r.style.width="100%",r.style.height="100%",e.fit){case "cover":r.style.objectFit="cover";break;case "fill":r.style.objectFit="fill";break;case "none":r.style.objectFit="none";break;default:r.style.objectFit="contain";}return b(r,E(e.style,t.styles)),n.appendChild(r),n}function te(e){return typeof e=="string"?e:e.content}function ne(e){return typeof e=="string"?{}:{colspan:e.colspan,rowspan:e.rowspan}}function re(e,t){let n=document.createElement("div");n.className="jdfjs-table-wrap",b(n,E(e.style,t.styles)),n.style.overflowX="auto";let r=(()=>{let l=e.headerStyle;if(!l)return {};if(typeof l=="string")return m(t.styles[l]||{});if(Array.isArray(l)){let p={};for(let u of l)p={...p,...m(t.styles[u]||{})};return p}return m(l)})(),o=(()=>{let l=e.rowStyle;if(!l)return {};if(typeof l=="string")return m(t.styles[l]||{});if(Array.isArray(l)){let p={};for(let u of l)p={...p,...m(t.styles[u]||{})};return p}return m(l)})(),a=(()=>{let l=e.alternateRowStyle;if(!l){let p=e.alternatingRowColor;return p?{"background-color":p}:{}}if(typeof l=="string")return m(t.styles[l]||{});if(Array.isArray(l)){let p={};for(let u of l)p={...p,...m(t.styles[u]||{})};return p}return m(l)})(),s=(()=>{let l=e.borders;return l===false?{outer:false,inner:false}:l===true||l===void 0?{outer:true,inner:true,color:"#e2e8f0",width:1}:{outer:true,inner:true,color:"#e2e8f0",width:1,...l}})(),d=e.headers??e.columns?.map(l=>l.header||"").filter(l=>l!==""),c=l=>e.columns?.[l]?.align,i=document.createElement("table");if(i.style.width="100%",i.style.borderCollapse="collapse",i.style.fontSize="14px",s.outer&&(i.style.border=`${s.width||1}px solid ${s.color||"#e2e8f0"}`),d&&d.length>0){let l=document.createElement("thead"),p=document.createElement("tr");b(p,r),d.forEach((u,x)=>{let g=document.createElement("th");g.textContent=u,g.style.padding="8px 12px",g.style.fontWeight="600",g.style.background="#f8fafc",g.style.textAlign=c(x)||"left",s.inner&&(g.style.border=`${s.width||1}px solid ${s.color||"#e2e8f0"}`),p.appendChild(g);}),l.appendChild(p),i.appendChild(l);}let h=document.createElement("tbody");return e.rows.forEach((l,p)=>{let u=document.createElement("tr");b(u,o),p%2===1&&b(u,a),l.forEach((x,g)=>{let y=document.createElement("td");y.textContent=te(x);let v=ne(x);v.colspan&&(y.colSpan=v.colspan),v.rowspan&&(y.rowSpan=v.rowspan),y.style.padding="8px 12px",y.style.verticalAlign="top",y.style.textAlign=c(g)||"left",s.inner&&(y.style.border=`${s.width||1}px solid ${s.color||"#e2e8f0"}`),u.appendChild(y);}),h.appendChild(u);}),i.appendChild(h),n.appendChild(i),n}function oe(e,t){let n=document.createElement("div");n.className="jdfjs-list-wrap",b(n,E(e.style,t.styles));let r=e.listType??(e.ordered?"ordered":"unordered"),o=z(r);return $(o,e.items||[],r),n.appendChild(o),n}function z(e){let t=document.createElement(e==="ordered"?"ol":"ul");return t.style.margin="0",t.style.paddingLeft="20px",t.style.listStyle=e==="ordered"?"decimal":"disc",t}function $(e,t,n,r){for(let o of t){let a=document.createElement("li");if(a.style.fontSize="14px",a.style.lineHeight="1.6",a.appendChild(document.createTextNode(o.content)),o.children?.length){let s=o.listType||n,d=z(s);d.style.marginTop="4px",$(d,o.children,s),a.appendChild(d);}e.appendChild(a);}}function ie(e){let t=document.createElement("div");t.className="jdfjs-shape",t.style.width="100%",t.style.height="100%";let n=e.width??100,r=e.height??100,o=e.fill??"none",a=(()=>{let i=e.stroke;return typeof i=="string"?i:i?.color?i.color:"none"})(),s=(()=>{let i=e.stroke;return typeof i=="object"&&i?.width!=null?i.width:e.strokeWidth??0})(),d=document.createElementNS(j,"svg");d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.setAttribute("viewBox",`0 0 ${n} ${r}`),d.setAttribute("preserveAspectRatio","none"),d.style.display="block",d.style.overflow="visible";let c=null;switch(e.shape){case "rect":{let i=document.createElementNS(j,"rect");i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("width",String(n)),i.setAttribute("height",String(r)),e.borderRadius&&i.setAttribute("rx",String(e.borderRadius)),c=i;break}case "circle":{let i=document.createElementNS(j,"circle");i.setAttribute("cx",String(n/2)),i.setAttribute("cy",String(r/2)),i.setAttribute("r",String(Math.min(n,r)/2)),c=i;break}case "ellipse":{let i=document.createElementNS(j,"ellipse");i.setAttribute("cx",String(n/2)),i.setAttribute("cy",String(r/2)),i.setAttribute("rx",String(n/2)),i.setAttribute("ry",String(r/2)),c=i;break}case "line":{let i=document.createElementNS(j,"line");return i.setAttribute("x1","0"),i.setAttribute("y1","0"),i.setAttribute("x2",String(n)),i.setAttribute("y2",String(r)),i.setAttribute("stroke",a==="none"?o!=="none"?o:"currentColor":a),i.setAttribute("stroke-width",String(s||.3)),d.appendChild(i),t.appendChild(d),t}case "path":{let i=document.createElementNS(j,"path");i.setAttribute("d",e.path||""),i.setAttribute("fill-rule","evenodd"),c=i;break}}return c&&(c.setAttribute("fill",o),c.setAttribute("stroke",a),s&&c.setAttribute("stroke-width",String(s)),d.appendChild(c)),t.appendChild(d),t}function se(e,t){let n=document.createElement("div");n.className="jdfjs-collapsible",b(n,E(e.style,t.styles)),n.style.border="1px solid #e2e8f0",n.style.borderRadius="8px",n.style.overflow="hidden",n.style.background="#ffffff";let r=document.createElement("button");r.type="button",r.className="jdfjs-collapsible-header",r.style.width="100%",r.style.display="flex",r.style.alignItems="center",r.style.gap="8px",r.style.padding="10px 16px",r.style.fontSize="14px",r.style.fontWeight="500",r.style.background="#f8fafc",r.style.border="0",r.style.cursor="pointer",r.style.textAlign="left";let o=document.createElement("span");o.textContent="\u25B6",o.style.fontSize="10px",o.style.transition="transform 0.15s ease";let a=document.createElement("span");a.textContent=e.title||"Section",a.style.flex="1",r.appendChild(o),r.appendChild(a),n.appendChild(r);let s=document.createElement("div");s.className="jdfjs-collapsible-body",s.style.padding="12px 16px",s.style.position="relative";let d=e.expanded??false,c=()=>{s.style.display=d?"block":"none",o.style.transform=d?"rotate(90deg)":"rotate(0deg)";};c(),r.addEventListener("click",()=>{d=!d,c();});for(let i of e.elements||[]){let h=w(i,{...t,path:[...t.path,"elements"]});h&&s.appendChild(h);}return n.appendChild(s),n}function ae(e,t){let n=document.createElement("div");n.className="jdfjs-toc",b(n,E(e.style,t.styles));let r=e.depth??6,o=[];t.document.pages.forEach((a,s)=>{for(let d of a.elements){if(d.type!=="text")continue;let c=d,i=c.tocEntry||(c.heading?c.content:null);if(!i)continue;let h=typeof c.tocLevel=="number"?c.tocLevel:typeof c.heading=="number"?c.heading:1;h>r||o.push({title:i,pageIndex:s,level:h});}});for(let a of o){let s=document.createElement("button");s.type="button",s.className="jdfjs-toc-entry",s.style.display="flex",s.style.alignItems="baseline",s.style.gap="8px",s.style.width="100%",s.style.background="transparent",s.style.border="0",s.style.borderBottom="1px dotted #e2e8f0",s.style.padding=`6px 8px 6px ${(a.level-1)*16+8}px`,s.style.cursor="pointer",s.style.fontSize="14px",s.style.color="#334155",s.style.textAlign="left";let d=document.createElement("span");d.textContent=a.title,d.style.flex="1";let c=document.createElement("span");c.style.flex="1",c.style.borderBottom="1px dotted #cbd5e1",c.style.alignSelf="end",c.style.marginBottom="4px";let i=document.createElement("span");i.textContent=String(a.pageIndex+1),i.style.fontFamily="JetBrains Mono, monospace",i.style.fontSize="12px",i.style.color="#94a3b8",i.style.flexShrink="0",s.appendChild(d),s.appendChild(c),s.appendChild(i),s.addEventListener("click",()=>t.onNavigatePage?.(a.pageIndex)),n.appendChild(s);}return n}function D(e,t){return e.replace(/\{\{pageNumber\}\}/g,String(t.pageNumber)).replace(/\{\{totalPages\}\}/g,String(t.totalPages)).replace(/\{\{title\}\}/g,t.title).replace(/\{\{author\}\}/g,t.author)}async function k(e,t,n={}){let r=O(e);r.classList.add("jdfjs-loading");try{let o=await fetch(t,{headers:{Accept:"application/json,application/jdf+json"}});if(!o.ok)throw new Error(`Failed to fetch ${t} (${o.status})`);let a=await o.json();if(!a?.$jdf)throw new Error("Not a valid JDF document (missing $jdf field)");return r.classList.remove("jdfjs-loading"),I(r,a,n)}catch(o){throw r.classList.remove("jdfjs-loading"),r.classList.add("jdfjs-error"),r.innerHTML=`<div class="jdfjs-error-msg">${le(o.message)}</div>`,n.onError?.(o),o}}function I(e,t,n={}){let r=O(e);return new S(r,t,n).getInstance()}var S=class{constructor(t,n,r={}){this.resizeObs=null;this.toolbarEl=null;this.sidebarEl=null;this.observer=null;this.container=t,this.doc=n,this.options={zoom:r.zoom??1,sidebar:r.sidebar??false,toolbar:r.toolbar??true,darkMode:r.darkMode??"auto",initialPage:r.initialPage??0,fit:r.fit??"manual",...r},this.zoom=this.options.zoom,this.currentPage=this.options.initialPage,this.applyContainerSize(),this.mount(),queueMicrotask(()=>this.options.onLoad?.(this.doc));}applyContainerSize(){let t=this.options.width,n=this.options.height;t!=null&&(this.container.style.width=typeof t=="number"?`${t}px`:t),n!=null&&(this.container.style.height=typeof n=="number"?`${n}px`:n);}mount(){this.container.innerHTML="",this.container.classList.add("jdfjs"),this.options.darkMode==="dark"?this.container.classList.add("jdfjs-dark"):this.options.darkMode==="auto"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches&&this.container.classList.add("jdfjs-dark"),this.root=document.createElement("div"),this.root.className="jdfjs-root",this.options.toolbar&&(this.toolbarEl=this.buildToolbar(),this.root.appendChild(this.toolbarEl));let t=document.createElement("div");t.className="jdfjs-body",this.options.sidebar&&(this.sidebarEl=this.buildSidebar(),t.appendChild(this.sidebarEl)),this.pagesEl=document.createElement("div"),this.pagesEl.className="jdfjs-pages",t.appendChild(this.pagesEl),this.root.appendChild(t),this.container.appendChild(this.root),this.renderAllPages(),this.setupScrollObserver(),this.setupResizeObserver(),this.applyFit(),this.currentPage>0&&this.scrollToPage(this.currentPage);}setupResizeObserver(){typeof ResizeObserver>"u"||(this.resizeObs?.disconnect(),this.resizeObs=new ResizeObserver(()=>this.applyFit()),this.resizeObs.observe(this.pagesEl));}applyFit(){if(this.options.fit==="manual")return;let t=this.pagesEl.querySelector(".jdfjs-page");if(!t)return;let n=parseFloat(t.style.width||"0"),r=parseFloat(t.style.minHeight||"0");if(!n||!r)return;let o=this.pagesEl.clientWidth-32,a=this.pagesEl.clientHeight-32;this.options.fit==="fit-width"?this.zoom=Math.max(.25,Math.min(3,o/n)):this.options.fit==="fit-page"&&(this.zoom=Math.max(.25,Math.min(3,Math.min(o/n,a/r)))),this.applyZoom(),this.updateIndicators();}buildToolbar(){let t=document.createElement("div");return t.className="jdfjs-toolbar",t.innerHTML=`
1
+ var Bf=Object.create;var li=Object.defineProperty;var qf=Object.getOwnPropertyDescriptor;var Uf=Object.getOwnPropertyNames;var Hf=Object.getPrototypeOf,Zf=Object.prototype.hasOwnProperty;var ve=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var At=(e,t)=>()=>(e&&(t=e(e=0)),t);var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wf=(e,t)=>{for(var r in t)li(e,r,{get:t[r],enumerable:true});},Jf=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Uf(t))!Zf.call(e,n)&&n!==r&&li(e,n,{get:()=>t[n],enumerable:!(i=qf(t,n))||i.enumerable});return e};var $f=(e,t,r)=>(r=e!=null?Bf(Hf(e)):{},Jf(li(r,"default",{value:e,enumerable:true}),e));var sa=At(()=>{});function B(e,t="mm"){switch(t){case "mm":return e*la;case "in":return e*Vf;case "pt":return e*Yf;case "px":return e;default:return e*la}}function ua(e,t="portrait"){let r=typeof e=="string"?Xf[e]:e;return t==="landscape"?{width:r.height,height:r.width}:{...r}}var Xf,fa,la,Vf,Yf,da=At(()=>{Xf={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6},Tabloid:{width:279.4,height:431.8}},fa={top:25,right:20,bottom:25,left:20},la=3.7795275591,Vf=96,Yf=1.3333333333;});var fi,ha,ca=At(()=>{fi="document.json",ha="manifest.json";});var cr=At(()=>{sa();da();ca();});var Rt=v((cg,hi)=>{typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?hi.exports={nextTick:cu}:hi.exports=process;function cu(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,a,o;switch(n){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t);});case 3:return process.nextTick(function(){e.call(null,t,r);});case 4:return process.nextTick(function(){e.call(null,t,r,i);});default:for(a=new Array(n-1),o=0;o<a.length;)a[o++]=arguments[o];return process.nextTick(function(){e.apply(null,a);})}}});var ba=v((pg,_a)=>{var pu={}.toString;_a.exports=Array.isArray||function(e){return pu.call(e)=="[object Array]"};});var ci=v((gg,ya)=>{ya.exports=ve("stream");});var Ot=v((pi,xa)=>{var gr=ve("buffer"),_e=gr.Buffer;function wa(e,t){for(var r in e)t[r]=e[r];}_e.from&&_e.alloc&&_e.allocUnsafe&&_e.allocUnsafeSlow?xa.exports=gr:(wa(gr,pi),pi.Buffer=tt);function tt(e,t,r){return _e(e,t,r)}wa(_e,tt);tt.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return _e(e,t,r)};tt.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=_e(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};tt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return _e(e)};tt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return gr.SlowBuffer(e)};});var rt=v(Z=>{function gu(e){return Array.isArray?Array.isArray(e):mr(e)==="[object Array]"}Z.isArray=gu;function mu(e){return typeof e=="boolean"}Z.isBoolean=mu;function vu(e){return e===null}Z.isNull=vu;function _u(e){return e==null}Z.isNullOrUndefined=_u;function bu(e){return typeof e=="number"}Z.isNumber=bu;function yu(e){return typeof e=="string"}Z.isString=yu;function wu(e){return typeof e=="symbol"}Z.isSymbol=wu;function xu(e){return e===void 0}Z.isUndefined=xu;function Eu(e){return mr(e)==="[object RegExp]"}Z.isRegExp=Eu;function Su(e){return typeof e=="object"&&e!==null}Z.isObject=Su;function ku(e){return mr(e)==="[object Date]"}Z.isDate=ku;function Tu(e){return mr(e)==="[object Error]"||e instanceof Error}Z.isError=Tu;function Cu(e){return typeof e=="function"}Z.isFunction=Cu;function Au(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}Z.isPrimitive=Au;Z.isBuffer=ve("buffer").Buffer.isBuffer;function mr(e){return Object.prototype.toString.call(e)}});var Ea=v((vg,gi)=>{typeof Object.create=="function"?gi.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}));}:gi.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t;}};});var it=v((_g,vi)=>{try{if(mi=ve("util"),typeof mi.inherits!="function")throw "";vi.exports=mi.inherits;}catch{vi.exports=Ea();}var mi;});var ka=v((bg,_i)=>{function Ru(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Sa=Ot().Buffer,Dt=ve("util");function Ou(e,t,r){e.copy(t,r);}_i.exports=(function(){function e(){Ru(this,e),this.head=null,this.tail=null,this.length=0;}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length;},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length;},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0;},e.prototype.join=function(r){if(this.length===0)return "";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return Sa.alloc(0);for(var i=Sa.allocUnsafe(r>>>0),n=this.head,a=0;n;)Ou(n.data,i,a),a+=n.data.length,n=n.next;return i},e})();Dt&&Dt.inspect&&Dt.inspect.custom&&(_i.exports.prototype[Dt.inspect.custom]=function(){var e=Dt.inspect({length:this.length});return this.constructor.name+" "+e});});var bi=v((yg,Ta)=>{var vr=Rt();function Du(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=true,vr.nextTick(_r,this,e)):vr.nextTick(_r,this,e)),this):(this._readableState&&(this._readableState.destroyed=true),this._writableState&&(this._writableState.destroyed=true),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=true,vr.nextTick(_r,r,a)):vr.nextTick(_r,r,a):t&&t(a);}),this)}function Iu(){this._readableState&&(this._readableState.destroyed=false,this._readableState.reading=false,this._readableState.ended=false,this._readableState.endEmitted=false),this._writableState&&(this._writableState.destroyed=false,this._writableState.ended=false,this._writableState.ending=false,this._writableState.finalCalled=false,this._writableState.prefinished=false,this._writableState.finished=false,this._writableState.errorEmitted=false);}function _r(e,t){e.emit("error",t);}Ta.exports={destroy:Du,undestroy:Iu};});var Aa=v((wg,Ca)=>{Ca.exports=ve("util").deprecate;});var wi=v((xg,ja)=>{var Pe=Rt();ja.exports=F;function Oa(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Yu(t,e);};}var Lu=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Pe.nextTick,nt;F.WritableState=Lt;var Da=Object.create(rt());Da.inherits=it();var zu={deprecate:Aa()},Ia=ci(),yr=Ot().Buffer,Nu=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ju(e){return yr.from(e)}function Fu(e){return yr.isBuffer(e)||e instanceof Nu}var La=bi();Da.inherits(F,Ia);function Mu(){}function Lt(e,t){nt=nt||Be(),e=e||{};var r=t instanceof nt;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,a=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=false,this.needDrain=false,this.ending=false,this.ended=false,this.finished=false,this.destroyed=false;var o=e.decodeStrings===false;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=false,this.corked=0,this.sync=true,this.bufferProcessing=false,this.onwrite=function(l){Wu(t,l);},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=false,this.errorEmitted=false,this.bufferedRequestCount=0,this.corkedRequestsFree=new Oa(this);}Lt.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Lt.prototype,"buffer",{get:zu.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")});}catch{}})();var br;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(br=Function.prototype[Symbol.hasInstance],Object.defineProperty(F,Symbol.hasInstance,{value:function(e){return br.call(this,e)?true:this!==F?false:e&&e._writableState instanceof Lt}})):br=function(e){return e instanceof this};function F(e){if(nt=nt||Be(),!br.call(F,this)&&!(this instanceof nt))return new F(e);this._writableState=new Lt(e,this),this.writable=true,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),Ia.call(this);}F.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"));};function Pu(e,t){var r=new Error("write after end");e.emit("error",r),Pe.nextTick(t,r);}function Bu(e,t,r,i){var n=true,a=false;return r===null?a=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),Pe.nextTick(i,a),n=false),n}F.prototype.write=function(e,t,r){var i=this._writableState,n=false,a=!i.objectMode&&Fu(e);return a&&!yr.isBuffer(e)&&(e=ju(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=Mu),i.ended?Pu(this,r):(a||Bu(this,i,e,r))&&(i.pendingcb++,n=Uu(this,i,a,e,t,r)),n};F.prototype.cork=function(){var e=this._writableState;e.corked++;};F.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&za(this,e));};F.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function qu(e,t,r){return !e.objectMode&&e.decodeStrings!==false&&typeof t=="string"&&(t=yr.from(t,r)),t}Object.defineProperty(F.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function Uu(e,t,r,i,n,a){if(!r){var o=qu(t,i,n);i!==o&&(r=true,n="buffer",i=o);}var l=t.objectMode?1:i.length;t.length+=l;var u=t.length<t.highWaterMark;if(u||(t.needDrain=true),t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:a,next:null},s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1;}else yi(e,t,false,l,i,n,a);return u}function yi(e,t,r,i,n,a,o){t.writelen=i,t.writecb=o,t.writing=true,t.sync=true,r?e._writev(n,t.onwrite):e._write(n,a,t.onwrite),t.sync=false;}function Hu(e,t,r,i,n){--t.pendingcb,r?(Pe.nextTick(n,i),Pe.nextTick(It,e,t),e._writableState.errorEmitted=true,e.emit("error",i)):(n(i),e._writableState.errorEmitted=true,e.emit("error",i),It(e,t));}function Zu(e){e.writing=false,e.writecb=null,e.length-=e.writelen,e.writelen=0;}function Wu(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(Zu(r),t)Hu(e,r,i,t,n);else {var a=Na(r);!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&za(e,r),i?Lu(Ra,e,r,a,n):Ra(e,r,a,n);}}function Ra(e,t,r,i){r||Ju(e,t),t.pendingcb--,i(),It(e,t);}function Ju(e,t){t.length===0&&t.needDrain&&(t.needDrain=false,e.emit("drain"));}function za(e,t){t.bufferProcessing=true;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),a=t.corkedRequestsFree;a.entry=r;for(var o=0,l=true;r;)n[o]=r,r.isBuf||(l=false),r=r.next,o+=1;n.allBuffers=l,yi(e,t,true,t.length,n,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Oa(t),t.bufferedRequestCount=0;}else {for(;r;){var u=r.chunk,s=r.encoding,f=r.callback,c=t.objectMode?1:u.length;if(yi(e,t,false,c,u,s,f),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null);}t.bufferedRequest=r,t.bufferProcessing=false;}F.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"));};F.prototype._writev=null;F.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||Vu(this,i,r);};function Na(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function $u(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=true,e.emit("prefinish"),It(e,t);});}function Xu(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=true,Pe.nextTick($u,e,t)):(t.prefinished=true,e.emit("prefinish")));}function It(e,t){var r=Na(t);return r&&(Xu(e,t),t.pendingcb===0&&(t.finished=true,e.emit("finish"))),r}function Vu(e,t,r){t.ending=true,It(e,t),r&&(t.finished?Pe.nextTick(r):e.once("finish",r)),t.ended=true,e.writable=false;}function Yu(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next;}t.corkedRequestsFree.next=e;}Object.defineProperty(F.prototype,"destroyed",{get:function(){return this._writableState===void 0?false:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e);}});F.prototype.destroy=La.destroy;F.prototype._undestroy=La.undestroy;F.prototype._destroy=function(e,t){this.end(),t(e);};});var Be=v((Eg,Ba)=>{var Fa=Rt(),Ku=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Ba.exports=be;var Ma=Object.create(rt());Ma.inherits=it();var Pa=Si(),Ei=wi();Ma.inherits(be,Pa);for(xi=Ku(Ei.prototype),wr=0;wr<xi.length;wr++)xr=xi[wr],be.prototype[xr]||(be.prototype[xr]=Ei.prototype[xr]);var xi,xr,wr;function be(e){if(!(this instanceof be))return new be(e);Pa.call(this,e),Ei.call(this,e),e&&e.readable===false&&(this.readable=false),e&&e.writable===false&&(this.writable=false),this.allowHalfOpen=true,e&&e.allowHalfOpen===false&&(this.allowHalfOpen=false),this.once("end",Gu);}Object.defineProperty(be.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function Gu(){this.allowHalfOpen||this._writableState.ended||Fa.nextTick(Qu,this);}function Qu(e){e.end();}Object.defineProperty(be.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?false:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e);}});be.prototype._destroy=function(e,t){this.push(null),this.end(),Fa.nextTick(t,e);};});var Ci=v(Ua=>{var Ti=Ot().Buffer,qa=Ti.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":case "raw":return true;default:return false}};function ed(e){if(!e)return "utf8";for(var t;;)switch(e){case "utf8":case "utf-8":return "utf8";case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return "utf16le";case "latin1":case "binary":return "latin1";case "base64":case "ascii":case "hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=true;}}function td(e){var t=ed(e);if(typeof t!="string"&&(Ti.isEncoding===qa||!qa(e)))throw new Error("Unknown encoding: "+e);return t||e}Ua.StringDecoder=zt;function zt(e){this.encoding=td(e);var t;switch(this.encoding){case "utf16le":this.text=sd,this.end=ld,t=4;break;case "utf8":this.fillLast=nd,t=4;break;case "base64":this.text=fd,this.end=ud,t=3;break;default:this.write=dd,this.end=hd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ti.allocUnsafe(t);}zt.prototype.write=function(e){if(e.length===0)return "";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return "";r=this.lastNeed,this.lastNeed=0;}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};zt.prototype.end=od;zt.prototype.text=ad;zt.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length;};function ki(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function rd(e,t,r){var i=t.length-1;if(i<r)return 0;var n=ki(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=ki(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=ki(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function id(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function nd(e){var t=this.lastTotal-this.lastNeed,r=id(this,e);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length;}function ad(e,t){var r=rd(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function od(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function sd(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function ld(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function fd(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function ud(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function dd(e){return e.toString(this.encoding)}function hd(e){return e&&e.length?this.write(e):""}});var Si=v((Tg,eo)=>{var ot=Rt();eo.exports=L;var cd=ba(),Nt;L.ReadableState=Va;ve("events").EventEmitter;var Ja=function(e,t){return e.listeners(t).length},Ii=ci(),jt=Ot().Buffer,pd=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function gd(e){return jt.from(e)}function md(e){return jt.isBuffer(e)||e instanceof pd}var $a=Object.create(rt());$a.inherits=it();var Ai=ve("util"),O=void 0;Ai&&Ai.debuglog?O=Ai.debuglog("stream"):O=function(){};var vd=ka(),Xa=bi(),at;$a.inherits(L,Ii);var Ri=["error","close","destroy","pause","resume"];function _d(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):cd(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]];}function Va(e,t){Nt=Nt||Be(),e=e||{};var r=t instanceof Nt;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,a=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new vd,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=false,this.endEmitted=false,this.reading=false,this.sync=true,this.needReadable=false,this.emittedReadable=false,this.readableListening=false,this.resumeScheduled=false,this.destroyed=false,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=false,this.decoder=null,this.encoding=null,e.encoding&&(at||(at=Ci().StringDecoder),this.decoder=new at(e.encoding),this.encoding=e.encoding);}function L(e){if(Nt=Nt||Be(),!(this instanceof L))return new L(e);this._readableState=new Va(e,this),this.readable=true,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Ii.call(this);}Object.defineProperty(L.prototype,"destroyed",{get:function(){return this._readableState===void 0?false:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e);}});L.prototype.destroy=Xa.destroy;L.prototype._undestroy=Xa.undestroy;L.prototype._destroy=function(e,t){this.push(null),t(e);};L.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=true:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=jt.from(e,t),t=""),i=true),Ya(this,e,t,false,i)};L.prototype.unshift=function(e){return Ya(this,e,null,true,false)};function Ya(e,t,r,i,n){var a=e._readableState;if(t===null)a.reading=false,xd(e,a);else {var o;n||(o=bd(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==jt.prototype&&(t=gd(t)),i?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Oi(e,a,t,true):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=false,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Oi(e,a,t,false):Ka(e,a)):Oi(e,a,t,false))):i||(a.reading=false);}return yd(a)}function Oi(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Er(e)),Ka(e,t);}function bd(e,t){var r;return !md(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function yd(e){return !e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}L.prototype.isPaused=function(){return this._readableState.flowing===false};L.prototype.setEncoding=function(e){return at||(at=Ci().StringDecoder),this._readableState.decoder=new at(e),this._readableState.encoding=e,this};var Ha=8388608;function wd(e){return e>=Ha?e=Ha:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Za(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=wd(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=true,0))}L.prototype.read=function(e){O("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=false),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return O("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Di(this):Er(this),null;if(e=Za(e,t),e===0&&t.ended)return t.length===0&&Di(this),null;var i=t.needReadable;O("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=true,O("length less than watermark",i)),t.ended||t.reading?(i=false,O("reading or ended",i)):i&&(O("do read"),t.reading=true,t.sync=true,t.length===0&&(t.needReadable=true),this._read(t.highWaterMark),t.sync=false,t.reading||(e=Za(r,t)));var n;return e>0?n=Ga(e,t):n=null,n===null?(t.needReadable=true,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=true),r!==e&&t.ended&&Di(this)),n!==null&&this.emit("data",n),n};function xd(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length);}t.ended=true,Er(e);}}function Er(e){var t=e._readableState;t.needReadable=false,t.emittedReadable||(O("emitReadable",t.flowing),t.emittedReadable=true,t.sync?ot.nextTick(Wa,e):Wa(e));}function Wa(e){O("emit readable"),e.emit("readable"),Li(e);}function Ka(e,t){t.readingMore||(t.readingMore=true,ot.nextTick(Ed,e,t));}function Ed(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(O("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=false;}L.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"));};L.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,O("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==false)&&e!==process.stdout&&e!==process.stderr,a=n?l:y;i.endEmitted?ot.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(p,g){O("onunpipe"),p===r&&g&&g.hasUnpiped===false&&(g.hasUnpiped=true,f());}function l(){O("onend"),e.end();}var u=Sd(r);e.on("drain",u);var s=false;function f(){O("cleanup"),e.removeListener("close",w),e.removeListener("finish",_),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",l),r.removeListener("end",y),r.removeListener("data",d),s=true,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u();}var c=false;r.on("data",d);function d(p){O("ondata"),c=false;var g=e.write(p);g===false&&!c&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&Qa(i.pipes,e)!==-1)&&!s&&(O("false write response, pause",i.awaitDrain),i.awaitDrain++,c=true),r.pause());}function h(p){O("onerror",p),y(),e.removeListener("error",h),Ja(e,"error")===0&&e.emit("error",p);}_d(e,"error",h);function w(){e.removeListener("finish",_),y();}e.once("close",w);function _(){O("onfinish"),e.removeListener("close",w),y();}e.once("finish",_);function y(){O("unpipe"),r.unpipe(e);}return e.emit("pipe",r),i.flowing||(O("pipe resume"),r.resume()),e};function Sd(e){return function(){var t=e._readableState;O("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Ja(e,"data")&&(t.flowing=true,Li(e));}}L.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=false,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=false;for(var a=0;a<n;a++)i[a].emit("unpipe",this,{hasUnpiped:false});return this}var o=Qa(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};L.prototype.on=function(e,t){var r=Ii.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==false&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=true,i.emittedReadable=false,i.reading?i.length&&Er(this):ot.nextTick(kd,this));}return r};L.prototype.addListener=L.prototype.on;function kd(e){O("readable nexttick read 0"),e.read(0);}L.prototype.resume=function(){var e=this._readableState;return e.flowing||(O("resume"),e.flowing=true,Td(this,e)),this};function Td(e,t){t.resumeScheduled||(t.resumeScheduled=true,ot.nextTick(Cd,e,t));}function Cd(e,t){t.reading||(O("resume read 0"),e.read(0)),t.resumeScheduled=false,t.awaitDrain=0,e.emit("resume"),Li(e),t.flowing&&!t.reading&&e.read(0);}L.prototype.pause=function(){return O("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==false&&(O("pause"),this._readableState.flowing=false,this.emit("pause")),this};function Li(e){var t=e._readableState;for(O("flow",t.flowing);t.flowing&&e.read()!==null;);}L.prototype.wrap=function(e){var t=this,r=this._readableState,i=false;e.on("end",function(){if(O("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o);}t.push(null);}),e.on("data",function(o){if(O("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var l=t.push(o);l||(i=true,e.pause());}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(o){return function(){return e[o].apply(e,arguments)}})(n));for(var a=0;a<Ri.length;a++)e.on(Ri[a],this.emit.bind(this,Ri[a]));return this._read=function(o){O("wrapped _read",o),i&&(i=false,e.resume());},this};Object.defineProperty(L.prototype,"readableHighWaterMark",{enumerable:false,get:function(){return this._readableState.highWaterMark}});L._fromList=Ga;function Ga(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=Ad(e,t.buffer,t.decoder),r}function Ad(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?Rd(e,t):Od(e,t),i}function Rd(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),e-=o,e===0){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i;}return t.length-=i,n}function Od(e,t){var r=jt.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),e-=o,e===0){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=a.slice(o));break}++n;}return t.length-=n,r}function Di(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=true,ot.nextTick(Dd,t,e));}function Dd(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=true,t.readable=false,t.emit("end"));}function Qa(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return -1}});var zi=v((Cg,io)=>{io.exports=ye;var Sr=Be(),ro=Object.create(rt());ro.inherits=it();ro.inherits(ye,Sr);function Id(e,t){var r=this._transformState;r.transforming=false;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=false,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark);}function ye(e){if(!(this instanceof ye))return new ye(e);Sr.call(this,e),this._transformState={afterTransform:Id.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=true,this._readableState.sync=false,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Ld);}function Ld(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){to(e,t,r);}):to(this,null,null);}ye.prototype.push=function(e,t){return this._transformState.needTransform=false,Sr.prototype.push.call(this,e,t)};ye.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};ye.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark);}};ye.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=true,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=true;};ye.prototype._destroy=function(e,t){var r=this;Sr.prototype._destroy.call(this,e,function(i){t(i),r.emit("close");});};function to(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var so=v((Ag,oo)=>{oo.exports=Ft;var no=zi(),ao=Object.create(rt());ao.inherits=it();ao.inherits(Ft,no);function Ft(e){if(!(this instanceof Ft))return new Ft(e);no.call(this,e);}Ft.prototype._transform=function(e,t,r){r(null,e);};});var Ni=v((q,kr)=>{var ue=ve("stream");process.env.READABLE_STREAM==="disable"&&ue?(kr.exports=ue,q=kr.exports=ue.Readable,q.Readable=ue.Readable,q.Writable=ue.Writable,q.Duplex=ue.Duplex,q.Transform=ue.Transform,q.PassThrough=ue.PassThrough,q.Stream=ue):(q=kr.exports=Si(),q.Stream=ue||q,q.Readable=q,q.Writable=wi(),q.Duplex=Be(),q.Transform=zi(),q.PassThrough=so());});var we=v(Y=>{Y.base64=true;Y.array=true;Y.string=true;Y.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";Y.nodebuffer=typeof Buffer<"u";Y.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")Y.blob=false;else {ji=new ArrayBuffer(0);try{Y.blob=new Blob([ji],{type:"application/zip"}).size===0;}catch{try{lo=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,Fi=new lo,Fi.append(ji),Y.blob=Fi.getBlob("application/zip").size===0;}catch{Y.blob=false;}}}var ji,lo,Fi;try{Y.nodestream=!!Ni().Readable;}catch{Y.nodestream=false;}});var Pi=v(Mi=>{var zd=N(),Nd=we(),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Mi.encode=function(e){for(var t=[],r,i,n,a,o,l,u,s=0,f=e.length,c=f,d=zd.getTypeOf(e)!=="string";s<e.length;)c=f-s,d?(r=e[s++],i=s<f?e[s++]:0,n=s<f?e[s++]:0):(r=e.charCodeAt(s++),i=s<f?e.charCodeAt(s++):0,n=s<f?e.charCodeAt(s++):0),a=r>>2,o=(r&3)<<4|i>>4,l=c>1?(i&15)<<2|n>>6:64,u=c>2?n&63:64,t.push(de.charAt(a)+de.charAt(o)+de.charAt(l)+de.charAt(u));return t.join("")};Mi.decode=function(e){var t,r,i,n,a,o,l,u=0,s=0,f="data:";if(e.substr(0,f.length)===f)throw new Error("Invalid base64 input, it looks like a data url.");e=e.replace(/[^A-Za-z0-9+/=]/g,"");var c=e.length*3/4;if(e.charAt(e.length-1)===de.charAt(64)&&c--,e.charAt(e.length-2)===de.charAt(64)&&c--,c%1!==0)throw new Error("Invalid base64 input, bad content length.");var d;for(Nd.uint8array?d=new Uint8Array(c|0):d=new Array(c|0);u<e.length;)n=de.indexOf(e.charAt(u++)),a=de.indexOf(e.charAt(u++)),o=de.indexOf(e.charAt(u++)),l=de.indexOf(e.charAt(u++)),t=n<<2|a>>4,r=(a&15)<<4|o>>2,i=(o&3)<<6|l,d[s++]=t,o!==64&&(d[s++]=r),l!==64&&(d[s++]=i);return d};});var Mt=v((Dg,fo)=>{fo.exports={isNode:typeof Buffer<"u",newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e=="number")throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on=="function"&&typeof e.pause=="function"&&typeof e.resume=="function"}};});var po=v((Ig,co)=>{var uo=global.MutationObserver||global.WebKitMutationObserver,st;process.browser?uo?(Bi=0,ho=new uo(Pt),qi=global.document.createTextNode(""),ho.observe(qi,{characterData:true}),st=function(){qi.data=Bi=++Bi%2;}):!global.setImmediate&&typeof global.MessageChannel<"u"?(Ui=new global.MessageChannel,Ui.port1.onmessage=Pt,st=function(){Ui.port2.postMessage(0);}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?st=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){Pt(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null;},global.document.documentElement.appendChild(e);}:st=function(){setTimeout(Pt,0);}:st=function(){process.nextTick(Pt);};var Bi,ho,qi,Ui,Hi,Bt=[];function Pt(){Hi=true;for(var e,t,r=Bt.length;r;){for(t=Bt,Bt=[],e=-1;++e<r;)t[e]();r=Bt.length;}Hi=false;}co.exports=jd;function jd(e){Bt.push(e)===1&&!Hi&&st();}});var wo=v((Lg,yo)=>{var go=po();function lt(){}var W={},mo=["REJECTED"],Zi=["FULFILLED"],vo=["PENDING"];process.browser||(qt=["UNHANDLED"]);var qt;yo.exports=Ae;function Ae(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=vo,this.queue=[],this.outcome=void 0,process.browser||(this.handled=qt),e!==lt&&_o(this,e);}Ae.prototype.finally=function(e){if(typeof e!="function")return this;var t=this.constructor;return this.then(r,i);function r(n){function a(){return n}return t.resolve(e()).then(a)}function i(n){function a(){throw n}return t.resolve(e()).then(a)}};Ae.prototype.catch=function(e){return this.then(null,e)};Ae.prototype.then=function(e,t){if(typeof e!="function"&&this.state===Zi||typeof t!="function"&&this.state===mo)return this;var r=new this.constructor(lt);if(process.browser||this.handled===qt&&(this.handled=null),this.state!==vo){var i=this.state===Zi?e:t;Wi(r,i,this.outcome);}else this.queue.push(new Ut(r,e,t));return r};function Ut(e,t,r){this.promise=e,typeof t=="function"&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof r=="function"&&(this.onRejected=r,this.callRejected=this.otherCallRejected);}Ut.prototype.callFulfilled=function(e){W.resolve(this.promise,e);};Ut.prototype.otherCallFulfilled=function(e){Wi(this.promise,this.onFulfilled,e);};Ut.prototype.callRejected=function(e){W.reject(this.promise,e);};Ut.prototype.otherCallRejected=function(e){Wi(this.promise,this.onRejected,e);};function Wi(e,t,r){go(function(){var i;try{i=t(r);}catch(n){return W.reject(e,n)}i===e?W.reject(e,new TypeError("Cannot resolve promise with itself")):W.resolve(e,i);});}W.resolve=function(e,t){var r=bo(Fd,t);if(r.status==="error")return W.reject(e,r.value);var i=r.value;if(i)_o(e,i);else {e.state=Zi,e.outcome=t;for(var n=-1,a=e.queue.length;++n<a;)e.queue[n].callFulfilled(t);}return e};W.reject=function(e,t){e.state=mo,e.outcome=t,process.browser||e.handled===qt&&go(function(){e.handled===qt&&process.emit("unhandledRejection",t,e);});for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callRejected(t);return e};function Fd(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments);}}function _o(e,t){var r=false;function i(l){r||(r=true,W.reject(e,l));}function n(l){r||(r=true,W.resolve(e,l));}function a(){t(n,i);}var o=bo(a);o.status==="error"&&i(o.value);}function bo(e,t){var r={};try{r.value=e(t),r.status="success";}catch(i){r.status="error",r.value=i;}return r}Ae.resolve=Md;function Md(e){return e instanceof this?e:W.resolve(new this(lt),e)}Ae.reject=Pd;function Pd(e){var t=new this(lt);return W.reject(t,e)}Ae.all=Bd;function Bd(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var r=e.length,i=false;if(!r)return this.resolve([]);for(var n=new Array(r),a=0,o=-1,l=new this(lt);++o<r;)u(e[o],o);return l;function u(s,f){t.resolve(s).then(c,function(d){i||(i=true,W.reject(l,d));});function c(d){n[f]=d,++a===r&&!i&&(i=true,W.resolve(l,n));}}}Ae.race=qd;function qd(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var r=e.length,i=false;if(!r)return this.resolve([]);for(var n=-1,a=new this(lt);++n<r;)o(e[n]);return a;function o(l){t.resolve(l).then(function(u){i||(i=true,W.resolve(a,u));},function(u){i||(i=true,W.reject(a,u));});}}});var ft=v((zg,xo)=>{var Ji=null;typeof Promise<"u"?Ji=Promise:Ji=wo();xo.exports={Promise:Ji};});var So=v(Eo=>{(function(e,t){if(e.setImmediate)return;var r=1,i={},n=false,a=e.document,o;function l(g){typeof g!="function"&&(g=new Function(""+g));for(var x=new Array(arguments.length-1),m=0;m<x.length;m++)x[m]=arguments[m+1];var b={callback:g,args:x};return i[r]=b,o(r),r++}function u(g){delete i[g];}function s(g){var x=g.callback,m=g.args;switch(m.length){case 0:x();break;case 1:x(m[0]);break;case 2:x(m[0],m[1]);break;case 3:x(m[0],m[1],m[2]);break;default:x.apply(t,m);break}}function f(g){if(n)setTimeout(f,0,g);else {var x=i[g];if(x){n=true;try{s(x);}finally{u(g),n=false;}}}}function c(){o=function(g){process.nextTick(function(){f(g);});};}function d(){if(e.postMessage&&!e.importScripts){var g=true,x=e.onmessage;return e.onmessage=function(){g=false;},e.postMessage("","*"),e.onmessage=x,g}}function h(){var g="setImmediate$"+Math.random()+"$",x=function(m){m.source===e&&typeof m.data=="string"&&m.data.indexOf(g)===0&&f(+m.data.slice(g.length));};e.addEventListener?e.addEventListener("message",x,false):e.attachEvent("onmessage",x),o=function(m){e.postMessage(g+m,"*");};}function w(){var g=new MessageChannel;g.port1.onmessage=function(x){var m=x.data;f(m);},o=function(x){g.port2.postMessage(x);};}function _(){var g=a.documentElement;o=function(x){var m=a.createElement("script");m.onreadystatechange=function(){f(x),m.onreadystatechange=null,g.removeChild(m),m=null;},g.appendChild(m);};}function y(){o=function(g){setTimeout(f,0,g);};}var p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,{}.toString.call(e.process)==="[object process]"?c():d()?h():e.MessageChannel?w():a&&"onreadystatechange"in a.createElement("script")?_():y(),p.setImmediate=l,p.clearImmediate=u;})(typeof self>"u"?typeof global>"u"?Eo:global:self);});var N=v(M=>{var Re=we(),Ud=Pi(),ut=Mt(),$i=ft();So();function Hd(e){var t=null;return Re.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),Cr(e,t)}M.newBlob=function(e,t){M.checkSupport("blob");try{return new Blob([e],{type:t})}catch{try{var r=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,i=new r;return i.append(e),i.getBlob(t)}catch{throw new Error("Bug : can't construct the Blob.")}}};function Ht(e){return e}function Cr(e,t){for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)&255;return t}var Tr={stringifyByChunk:function(e,t,r){var i=[],n=0,a=e.length;if(a<=r)return String.fromCharCode.apply(null,e);for(;n<a;)t==="array"||t==="nodebuffer"?i.push(String.fromCharCode.apply(null,e.slice(n,Math.min(n+r,a)))):i.push(String.fromCharCode.apply(null,e.subarray(n,Math.min(n+r,a)))),n+=r;return i.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:(function(){try{return Re.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return false}})(),nodebuffer:(function(){try{return Re.nodebuffer&&String.fromCharCode.apply(null,ut.allocBuffer(1)).length===1}catch{return false}})()}};function Zt(e){var t=65536,r=M.getTypeOf(e),i=true;if(r==="uint8array"?i=Tr.applyCanBeUsed.uint8array:r==="nodebuffer"&&(i=Tr.applyCanBeUsed.nodebuffer),i)for(;t>1;)try{return Tr.stringifyByChunk(e,r,t)}catch{t=Math.floor(t/2);}return Tr.stringifyByChar(e)}M.applyFromCharCode=Zt;function Ar(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}var Oe={};Oe.string={string:Ht,array:function(e){return Cr(e,new Array(e.length))},arraybuffer:function(e){return Oe.string.uint8array(e).buffer},uint8array:function(e){return Cr(e,new Uint8Array(e.length))},nodebuffer:function(e){return Cr(e,ut.allocBuffer(e.length))}};Oe.array={string:Zt,array:Ht,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return ut.newBufferFrom(e)}};Oe.arraybuffer={string:function(e){return Zt(new Uint8Array(e))},array:function(e){return Ar(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:Ht,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return ut.newBufferFrom(new Uint8Array(e))}};Oe.uint8array={string:Zt,array:function(e){return Ar(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:Ht,nodebuffer:function(e){return ut.newBufferFrom(e)}};Oe.nodebuffer={string:Zt,array:function(e){return Ar(e,new Array(e.length))},arraybuffer:function(e){return Oe.nodebuffer.uint8array(e).buffer},uint8array:function(e){return Ar(e,new Uint8Array(e.length))},nodebuffer:Ht};M.transformTo=function(e,t){if(t||(t=""),!e)return t;M.checkSupport(e);var r=M.getTypeOf(t),i=Oe[r][e](t);return i};M.resolve=function(e){for(var t=e.split("/"),r=[],i=0;i<t.length;i++){var n=t[i];n==="."||n===""&&i!==0&&i!==t.length-1||(n===".."?r.pop():r.push(n));}return r.join("/")};M.getTypeOf=function(e){if(typeof e=="string")return "string";if(Object.prototype.toString.call(e)==="[object Array]")return "array";if(Re.nodebuffer&&ut.isBuffer(e))return "nodebuffer";if(Re.uint8array&&e instanceof Uint8Array)return "uint8array";if(Re.arraybuffer&&e instanceof ArrayBuffer)return "arraybuffer"};M.checkSupport=function(e){var t=Re[e.toLowerCase()];if(!t)throw new Error(e+" is not supported by this platform")};M.MAX_VALUE_16BITS=65535;M.MAX_VALUE_32BITS=-1;M.pretty=function(e){var t="",r,i;for(i=0;i<(e||"").length;i++)r=e.charCodeAt(i),t+="\\x"+(r<16?"0":"")+r.toString(16).toUpperCase();return t};M.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[]);});};M.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r;};M.extend=function(){var e={},t,r;for(t=0;t<arguments.length;t++)for(r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&typeof e[r]>"u"&&(e[r]=arguments[t][r]);return e};M.prepareContent=function(e,t,r,i,n){var a=$i.Promise.resolve(t).then(function(o){var l=Re.blob&&(o instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(o))!==-1);return l&&typeof FileReader<"u"?new $i.Promise(function(u,s){var f=new FileReader;f.onload=function(c){u(c.target.result);},f.onerror=function(c){s(c.target.error);},f.readAsArrayBuffer(o);}):o});return a.then(function(o){var l=M.getTypeOf(o);return l?(l==="arraybuffer"?o=M.transformTo("uint8array",o):l==="string"&&(n?o=Ud.decode(o):r&&i!==true&&(o=Hd(o))),o):$i.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})};});var K=v((Fg,To)=>{function ko(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=true,this.isFinished=false,this.isLocked=false,this._listeners={data:[],end:[],error:[]},this.previous=null;}ko.prototype={push:function(e){this.emit("data",e);},end:function(){if(this.isFinished)return false;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0;}catch(e){this.emit("error",e);}return true},error:function(e){return this.isFinished?false:(this.isPaused?this.generatedError=e:(this.isFinished=true,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),true)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[];},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t);},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(r){t.processChunk(r);}),e.on("end",function(){t.end();}),e.on("error",function(r){t.error(r);}),this},pause:function(){return this.isPaused||this.isFinished?false:(this.isPaused=true,this.previous&&this.previous.pause(),true)},resume:function(){if(!this.isPaused||this.isFinished)return false;this.isPaused=false;var e=false;return this.generatedError&&(this.error(this.generatedError),e=true),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e);},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e]);},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=true,this.previous&&this.previous.lock();},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};To.exports=ko;});var ht=v(De=>{var dt=N(),qe=we(),Zd=Mt(),Rr=K(),Wt=new Array(256);for(xe=0;xe<256;xe++)Wt[xe]=xe>=252?6:xe>=248?5:xe>=240?4:xe>=224?3:xe>=192?2:1;var xe;Wt[254]=Wt[254]=1;var Wd=function(e){var t,r,i,n,a,o=e.length,l=0;for(n=0;n<o;n++)r=e.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(qe.uint8array?t=new Uint8Array(l):t=new Array(l),a=0,n=0;a<l;n++)r=e.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t},Jd=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Wt[e[r]]>t?r:t},$d=function(e){var t,r,i,n,a=e.length,o=new Array(a*2);for(r=0,t=0;t<a;){if(i=e[t++],i<128){o[r++]=i;continue}if(n=Wt[i],n>4){o[r++]=65533,t+=n-1;continue}for(i&=n===2?31:n===3?15:7;n>1&&t<a;)i=i<<6|e[t++]&63,n--;if(n>1){o[r++]=65533;continue}i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|i&1023);}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),dt.applyFromCharCode(o)};De.utf8encode=function(t){return qe.nodebuffer?Zd.newBufferFrom(t,"utf-8"):Wd(t)};De.utf8decode=function(t){return qe.nodebuffer?dt.transformTo("nodebuffer",t).toString("utf-8"):(t=dt.transformTo(qe.uint8array?"uint8array":"array",t),$d(t))};function Or(){Rr.call(this,"utf-8 decode"),this.leftOver=null;}dt.inherits(Or,Rr);Or.prototype.processChunk=function(e){var t=dt.transformTo(qe.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(qe.uint8array){var r=t;t=new Uint8Array(r.length+this.leftOver.length),t.set(this.leftOver,0),t.set(r,this.leftOver.length);}else t=this.leftOver.concat(t);this.leftOver=null;}var i=Jd(t),n=t;i!==t.length&&(qe.uint8array?(n=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(n=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:De.utf8decode(n),meta:e.meta});};Or.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:De.utf8decode(this.leftOver),meta:{}}),this.leftOver=null);};De.Utf8DecodeWorker=Or;function Xi(){Rr.call(this,"utf-8 encode");}dt.inherits(Xi,Rr);Xi.prototype.processChunk=function(e){this.push({data:De.utf8encode(e.data),meta:e.meta});};De.Utf8EncodeWorker=Xi;});var Oo=v((Pg,Ro)=>{var Co=K(),Ao=N();function Vi(e){Co.call(this,"ConvertWorker to "+e),this.destType=e;}Ao.inherits(Vi,Co);Vi.prototype.processChunk=function(e){this.push({data:Ao.transformTo(this.destType,e.data),meta:e.meta});};Ro.exports=Vi;});var Lo=v((Bg,Io)=>{var Do=Ni().Readable,Xd=N();Xd.inherits(Yi,Do);function Yi(e,t,r){Do.call(this,t),this._helper=e;var i=this;e.on("data",function(n,a){i.push(n)||i._helper.pause(),r&&r(a);}).on("error",function(n){i.emit("error",n);}).on("end",function(){i.push(null);});}Yi.prototype._read=function(){this._helper.resume();};Io.exports=Yi;});var Ki=v((qg,jo)=>{var Ue=N(),Vd=Oo(),Yd=K(),Kd=Pi(),Gd=we(),Qd=ft(),zo=null;if(Gd.nodestream)try{zo=Lo();}catch{}function eh(e,t,r){switch(e){case "blob":return Ue.newBlob(Ue.transformTo("arraybuffer",t),r);case "base64":return Kd.encode(t);default:return Ue.transformTo(e,t)}}function th(e,t){var r,i=0,n=null,a=0;for(r=0;r<t.length;r++)a+=t[r].length;switch(e){case "string":return t.join("");case "array":return Array.prototype.concat.apply([],t);case "uint8array":for(n=new Uint8Array(a),r=0;r<t.length;r++)n.set(t[r],i),i+=t[r].length;return n;case "nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}function rh(e,t){return new Qd.Promise(function(r,i){var n=[],a=e._internalType,o=e._outputType,l=e._mimeType;e.on("data",function(u,s){n.push(u),t&&t(s);}).on("error",function(u){n=[],i(u);}).on("end",function(){try{var u=eh(o,th(a,n),l);r(u);}catch(s){i(s);}n=[];}).resume();})}function No(e,t,r){var i=t;switch(t){case "blob":case "arraybuffer":i="uint8array";break;case "base64":i="string";break}try{this._internalType=i,this._outputType=t,this._mimeType=r,Ue.checkSupport(i),this._worker=e.pipe(new Vd(i)),e.lock();}catch(n){this._worker=new Yd("error"),this._worker.error(n);}}No.prototype={accumulate:function(e){return rh(this,e)},on:function(e,t){var r=this;return e==="data"?this._worker.on(e,function(i){t.call(r,i.data,i.meta);}):this._worker.on(e,function(){Ue.delay(t,arguments,r);}),this},resume:function(){return Ue.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Ue.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new zo(this,{objectMode:this._outputType!=="nodebuffer"},e)}};jo.exports=No;});var Gi=v(ne=>{ne.base64=false;ne.binary=false;ne.dir=false;ne.createFolders=true;ne.date=null;ne.compression=null;ne.compressionOptions=null;ne.comment=null;ne.unixPermissions=null;ne.dosPermissions=null;});var Qi=v((Hg,Fo)=>{var Dr=N(),Ir=K(),ih=16*1024;function ct(e){Ir.call(this,"DataWorker");var t=this;this.dataIsReady=false,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=false,e.then(function(r){t.dataIsReady=true,t.data=r,t.max=r&&r.length||0,t.type=Dr.getTypeOf(r),t.isPaused||t._tickAndRepeat();},function(r){t.error(r);});}Dr.inherits(ct,Ir);ct.prototype.cleanUp=function(){Ir.prototype.cleanUp.call(this),this.data=null;};ct.prototype.resume=function(){return Ir.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=true,Dr.delay(this._tickAndRepeat,[],this)),true):false};ct.prototype._tickAndRepeat=function(){this._tickScheduled=false,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(Dr.delay(this._tickAndRepeat,[],this),this._tickScheduled=true));};ct.prototype._tick=function(){if(this.isPaused||this.isFinished)return false;var e=ih,t=null,r=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();switch(this.type){case "string":t=this.data.substring(this.index,r);break;case "uint8array":t=this.data.subarray(this.index,r);break;case "array":case "nodebuffer":t=this.data.slice(this.index,r);break}return this.index=r,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})};Fo.exports=ct;});var Lr=v((Zg,Po)=>{var nh=N();function ah(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e;}return t}var Mo=ah();function oh(e,t,r,i){var n=Mo,a=i+r;e=e^-1;for(var o=i;o<a;o++)e=e>>>8^n[(e^t[o])&255];return e^-1}function sh(e,t,r,i){var n=Mo,a=i+r;e=e^-1;for(var o=i;o<a;o++)e=e>>>8^n[(e^t.charCodeAt(o))&255];return e^-1}Po.exports=function(t,r){if(typeof t>"u"||!t.length)return 0;var i=nh.getTypeOf(t)!=="string";return i?oh(r|0,t,t.length,0):sh(r|0,t,t.length,0)};});var tn=v((Wg,qo)=>{var Bo=K(),lh=Lr(),fh=N();function en(){Bo.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0);}fh.inherits(en,Bo);en.prototype.processChunk=function(e){this.streamInfo.crc32=lh(e.data,this.streamInfo.crc32||0),this.push(e);};qo.exports=en;});var Ho=v((Jg,Uo)=>{var uh=N(),rn=K();function nn(e){rn.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0);}uh.inherits(nn,rn);nn.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length;}rn.prototype.processChunk.call(this,e);};Uo.exports=nn;});var zr=v(($g,Jo)=>{var Zo=ft(),Wo=Qi(),dh=tn(),an=Ho();function on(e,t,r,i,n){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=i,this.compressedContent=n;}on.prototype={getContentWorker:function(){var e=new Wo(Zo.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new an("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new Wo(Zo.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};on.createWorkerFrom=function(e,t,r){return e.pipe(new dh).pipe(new an("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new an("compressedSize")).withStreamInfo("compression",t)};Jo.exports=on;});var Yo=v((Xg,Vo)=>{var hh=Ki(),ch=Qi(),sn=ht(),ln=zr(),$o=K(),fn=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions};};fn.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");r=e.toLowerCase();var i=r==="string"||r==="text";(r==="binarystring"||r==="text")&&(r="string"),t=this._decompressWorker();var n=!this._dataBinary;n&&!i&&(t=t.pipe(new sn.Utf8EncodeWorker)),!n&&i&&(t=t.pipe(new sn.Utf8DecodeWorker));}catch(a){t=new $o("error"),t.error(a);}return new hh(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof ln&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new sn.Utf8EncodeWorker)),ln.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof ln?this._data.getContentWorker():this._data instanceof $o?this._data:new ch(this._data)}};var Xo=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],ph=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(Nr=0;Nr<Xo.length;Nr++)fn.prototype[Xo[Nr]]=ph;var Nr;Vo.exports=fn;});var Ee=v(J=>{var gh=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function mh(e,t){return Object.prototype.hasOwnProperty.call(e,t)}J.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)mh(r,i)&&(e[i]=r[i]);}}return e};J.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var vh={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+i),n);return}for(var a=0;a<i;a++)e[n+a]=t[r+a];},flattenChunks:function(e){var t,r,i,n,a,o;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(o=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)a=e[t],o.set(a,n),n+=a.length;return o}},_h={arraySet:function(e,t,r,i,n){for(var a=0;a<i;a++)e[n+a]=t[r+a];},flattenChunks:function(e){return [].concat.apply([],e)}};J.setTyped=function(e){e?(J.Buf8=Uint8Array,J.Buf16=Uint16Array,J.Buf32=Int32Array,J.assign(J,vh)):(J.Buf8=Array,J.Buf16=Array,J.Buf32=Array,J.assign(J,_h));};J.setTyped(gh);});var bs=v(mt=>{var bh=Ee(),yh=4,Ko=0,Go=1,wh=2;function gt(e){for(var t=e.length;--t>=0;)e[t]=0;}var xh=0,ns=1,Eh=2,Sh=3,kh=258,mn=29,Kt=256,$t=Kt+1+mn,pt=30,vn=19,as=2*$t+1,He=15,un=16,Th=7,_n=256,os=16,ss=17,ls=18,pn=[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],jr=[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],Ch=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],fs=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ah=512,Se=new Array(($t+2)*2);gt(Se);var Jt=new Array(pt*2);gt(Jt);var Xt=new Array(Ah);gt(Xt);var Vt=new Array(kh-Sh+1);gt(Vt);var bn=new Array(mn);gt(bn);var Fr=new Array(pt);gt(Fr);function dn(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length;}var us,ds,hs;function hn(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t;}function cs(e){return e<256?Xt[e]:Xt[256+(e>>>7)]}function Yt(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255;}function X(e,t,r){e.bi_valid>un-r?(e.bi_buf|=t<<e.bi_valid&65535,Yt(e,e.bi_buf),e.bi_buf=t>>un-e.bi_valid,e.bi_valid+=r-un):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r);}function he(e,t,r){X(e,r[t*2],r[t*2+1]);}function ps(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Rh(e){e.bi_valid===16?(Yt(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8);}function Oh(e,t){var r=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,u=t.stat_desc.max_length,s,f,c,d,h,w,_=0;for(d=0;d<=He;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,s=e.heap_max+1;s<as;s++)f=e.heap[s],d=r[r[f*2+1]*2+1]+1,d>u&&(d=u,_++),r[f*2+1]=d,!(f>i)&&(e.bl_count[d]++,h=0,f>=l&&(h=o[f-l]),w=r[f*2],e.opt_len+=w*(d+h),a&&(e.static_len+=w*(n[f*2+1]+h)));if(_!==0){do{for(d=u-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[u]--,_-=2;}while(_>0);for(d=u;d!==0;d--)for(f=e.bl_count[d];f!==0;)c=e.heap[--s],!(c>i)&&(r[c*2+1]!==d&&(e.opt_len+=(d-r[c*2+1])*r[c*2],r[c*2+1]=d),f--);}}function gs(e,t,r){var i=new Array(He+1),n=0,a,o;for(a=1;a<=He;a++)i[a]=n=n+r[a-1]<<1;for(o=0;o<=t;o++){var l=e[o*2+1];l!==0&&(e[o*2]=ps(i[l]++,l));}}function Dh(){var e,t,r,i,n,a=new Array(He+1);for(r=0,i=0;i<mn-1;i++)for(bn[i]=r,e=0;e<1<<pn[i];e++)Vt[r++]=i;for(Vt[r-1]=i,n=0,i=0;i<16;i++)for(Fr[i]=n,e=0;e<1<<jr[i];e++)Xt[n++]=i;for(n>>=7;i<pt;i++)for(Fr[i]=n<<7,e=0;e<1<<jr[i]-7;e++)Xt[256+n++]=i;for(t=0;t<=He;t++)a[t]=0;for(e=0;e<=143;)Se[e*2+1]=8,e++,a[8]++;for(;e<=255;)Se[e*2+1]=9,e++,a[9]++;for(;e<=279;)Se[e*2+1]=7,e++,a[7]++;for(;e<=287;)Se[e*2+1]=8,e++,a[8]++;for(gs(Se,$t+1,a),e=0;e<pt;e++)Jt[e*2+1]=5,Jt[e*2]=ps(e,5);us=new dn(Se,pn,Kt+1,$t,He),ds=new dn(Jt,jr,0,pt,He),hs=new dn(new Array(0),Ch,0,vn,Th);}function ms(e){var t;for(t=0;t<$t;t++)e.dyn_ltree[t*2]=0;for(t=0;t<pt;t++)e.dyn_dtree[t*2]=0;for(t=0;t<vn;t++)e.bl_tree[t*2]=0;e.dyn_ltree[_n*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0;}function vs(e){e.bi_valid>8?Yt(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0;}function Ih(e,t,r,i){vs(e),(Yt(e,r),Yt(e,~r)),bh.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r;}function Qo(e,t,r,i){var n=t*2,a=r*2;return e[n]<e[a]||e[n]===e[a]&&i[t]<=i[r]}function cn(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&Qo(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!Qo(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i;}function es(e,t,r){var i,n,a=0,o,l;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],n=e.pending_buf[e.l_buf+a],a++,i===0?he(e,n,t):(o=Vt[n],he(e,o+Kt+1,t),l=pn[o],l!==0&&(n-=bn[o],X(e,n,l)),i--,o=cs(i),he(e,o,r),l=jr[o],l!==0&&(i-=Fr[o],X(e,i,l)));while(a<e.last_lit);he(e,_n,t);}function gn(e,t){var r=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,a=t.stat_desc.elems,o,l,u=-1,s;for(e.heap_len=0,e.heap_max=as,o=0;o<a;o++)r[o*2]!==0?(e.heap[++e.heap_len]=u=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)s=e.heap[++e.heap_len]=u<2?++u:0,r[s*2]=1,e.depth[s]=0,e.opt_len--,n&&(e.static_len-=i[s*2+1]);for(t.max_code=u,o=e.heap_len>>1;o>=1;o--)cn(e,r,o);s=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],cn(e,r,1),l=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=l,r[s*2]=r[o*2]+r[l*2],e.depth[s]=(e.depth[o]>=e.depth[l]?e.depth[o]:e.depth[l])+1,r[o*2+1]=r[l*2+1]=s,e.heap[1]=s++,cn(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Oh(e,t),gs(r,u,e.bl_count);}function ts(e,t,r){var i,n=-1,a,o=t[1],l=0,u=7,s=4;for(o===0&&(u=138,s=3),t[(r+1)*2+1]=65535,i=0;i<=r;i++)a=o,o=t[(i+1)*2+1],!(++l<u&&a===o)&&(l<s?e.bl_tree[a*2]+=l:a!==0?(a!==n&&e.bl_tree[a*2]++,e.bl_tree[os*2]++):l<=10?e.bl_tree[ss*2]++:e.bl_tree[ls*2]++,l=0,n=a,o===0?(u=138,s=3):a===o?(u=6,s=3):(u=7,s=4));}function rs(e,t,r){var i,n=-1,a,o=t[1],l=0,u=7,s=4;for(o===0&&(u=138,s=3),i=0;i<=r;i++)if(a=o,o=t[(i+1)*2+1],!(++l<u&&a===o)){if(l<s)do he(e,a,e.bl_tree);while(--l!==0);else a!==0?(a!==n&&(he(e,a,e.bl_tree),l--),he(e,os,e.bl_tree),X(e,l-3,2)):l<=10?(he(e,ss,e.bl_tree),X(e,l-3,3)):(he(e,ls,e.bl_tree),X(e,l-11,7));l=0,n=a,o===0?(u=138,s=3):a===o?(u=6,s=3):(u=7,s=4);}}function Lh(e){var t;for(ts(e,e.dyn_ltree,e.l_desc.max_code),ts(e,e.dyn_dtree,e.d_desc.max_code),gn(e,e.bl_desc),t=vn-1;t>=3&&e.bl_tree[fs[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function zh(e,t,r,i){var n;for(X(e,t-257,5),X(e,r-1,5),X(e,i-4,4),n=0;n<i;n++)X(e,e.bl_tree[fs[n]*2+1],3);rs(e,e.dyn_ltree,t-1),rs(e,e.dyn_dtree,r-1);}function Nh(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return Ko;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Go;for(r=32;r<Kt;r++)if(e.dyn_ltree[r*2]!==0)return Go;return Ko}var is=false;function jh(e){is||(Dh(),is=true),e.l_desc=new hn(e.dyn_ltree,us),e.d_desc=new hn(e.dyn_dtree,ds),e.bl_desc=new hn(e.bl_tree,hs),e.bi_buf=0,e.bi_valid=0,ms(e);}function _s(e,t,r,i){X(e,(xh<<1)+(i?1:0),3),Ih(e,t,r);}function Fh(e){X(e,ns<<1,3),he(e,_n,Se),Rh(e);}function Mh(e,t,r,i){var n,a,o=0;e.level>0?(e.strm.data_type===wh&&(e.strm.data_type=Nh(e)),gn(e,e.l_desc),gn(e,e.d_desc),o=Lh(e),n=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&t!==-1?_s(e,t,r,i):e.strategy===yh||a===n?(X(e,(ns<<1)+(i?1:0),3),es(e,Se,Jt)):(X(e,(Eh<<1)+(i?1:0),3),zh(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),es(e,e.dyn_ltree,e.dyn_dtree)),ms(e),i&&vs(e);}function Ph(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Vt[r]+Kt+1)*2]++,e.dyn_dtree[cs(t)*2]++),e.last_lit===e.lit_bufsize-1}mt._tr_init=jh;mt._tr_stored_block=_s;mt._tr_flush_block=Mh;mt._tr_tally=Ph;mt._tr_align=Fh;});var yn=v((Kg,ys)=>{function Bh(e,t,r,i){for(var n=e&65535|0,a=e>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do n=n+t[i++]|0,a=a+n|0;while(--o);n%=65521,a%=65521;}return n|a<<16|0}ys.exports=Bh;});var wn=v((Gg,ws)=>{function qh(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e;}return t}var Uh=qh();function Hh(e,t,r,i){var n=Uh,a=i+r;e^=-1;for(var o=i;o<a;o++)e=e>>>8^n[(e^t[o])&255];return e^-1}ws.exports=Hh;});var Mr=v((Qg,xs)=>{xs.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};});var Ds=v(ge=>{var $=Ee(),ee=bs(),Ts=yn(),Ie=wn(),Zh=Mr(),$e=0,Wh=1,Jh=3,Fe=4,Es=5,pe=0,Ss=1,te=-2,$h=-3,xn=-5,Xh=-1,Vh=1,Pr=2,Yh=3,Kh=4,Gh=0,Qh=2,Hr=8,ec=9,tc=15,rc=8,ic=29,nc=256,Sn=nc+1+ic,ac=30,oc=19,sc=2*Sn+1,lc=15,A=3,Ne=258,ae=Ne+A+1,fc=32,Zr=42,kn=69,Br=73,qr=91,Ur=103,Ze=113,Qt=666,P=1,er=2,We=3,bt=4,uc=3;function je(e,t){return e.msg=Zh[t],t}function ks(e){return (e<<1)-(e>4?9:0)}function ze(e){for(var t=e.length;--t>=0;)e[t]=0;}function Le(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&($.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0));}function U(e,t){ee._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Le(e.strm);}function R(e,t){e.pending_buf[e.pending++]=t;}function Gt(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255;}function dc(e,t,r,i){var n=e.avail_in;return n>i&&(n=i),n===0?0:(e.avail_in-=n,$.arraySet(t,e.input,e.next_in,n,r),e.state.wrap===1?e.adler=Ts(e.adler,t,n,r):e.state.wrap===2&&(e.adler=Ie(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function Cs(e,t){var r=e.max_chain_length,i=e.strstart,n,a,o=e.prev_length,l=e.nice_match,u=e.strstart>e.w_size-ae?e.strstart-(e.w_size-ae):0,s=e.window,f=e.w_mask,c=e.prev,d=e.strstart+Ne,h=s[i+o-1],w=s[i+o];e.prev_length>=e.good_match&&(r>>=2),l>e.lookahead&&(l=e.lookahead);do if(n=t,!(s[n+o]!==w||s[n+o-1]!==h||s[n]!==s[i]||s[++n]!==s[i+1])){i+=2,n++;do;while(s[++i]===s[++n]&&s[++i]===s[++n]&&s[++i]===s[++n]&&s[++i]===s[++n]&&s[++i]===s[++n]&&s[++i]===s[++n]&&s[++i]===s[++n]&&s[++i]===s[++n]&&i<d);if(a=Ne-(d-i),i=d-Ne,a>o){if(e.match_start=t,o=a,a>=l)break;h=s[i+o-1],w=s[i+o];}}while((t=c[t&f])>u&&--r!==0);return o<=e.lookahead?o:e.lookahead}function Je(e){var t=e.w_size,r,i,n,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ae)){$.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,i=e.hash_size,r=i;do n=e.head[--r],e.head[r]=n>=t?n-t:0;while(--i);i=t,r=i;do n=e.prev[--r],e.prev[r]=n>=t?n-t:0;while(--i);a+=t;}if(e.strm.avail_in===0)break;if(i=dc(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=i,e.lookahead+e.insert>=A)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+A-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<A)););}while(e.lookahead<ae&&e.strm.avail_in!==0)}function hc(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Je(e),e.lookahead===0&&t===$e)return P;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((e.strstart===0||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,U(e,false),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-ae&&(U(e,false),e.strm.avail_out===0))return P}return e.insert=0,t===Fe?(U(e,true),e.strm.avail_out===0?We:bt):(e.strstart>e.block_start&&(U(e,false),e.strm.avail_out===0),P)}function En(e,t){for(var r,i;;){if(e.lookahead<ae){if(Je(e),e.lookahead<ae&&t===$e)return P;if(e.lookahead===0)break}if(r=0,e.lookahead>=A&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+A-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-ae&&(e.match_length=Cs(e,r)),e.match_length>=A)if(i=ee._tr_tally(e,e.strstart-e.match_start,e.match_length-A),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=A){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+A-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++;}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=ee._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(U(e,false),e.strm.avail_out===0))return P}return e.insert=e.strstart<A-1?e.strstart:A-1,t===Fe?(U(e,true),e.strm.avail_out===0?We:bt):e.last_lit&&(U(e,false),e.strm.avail_out===0)?P:er}function vt(e,t){for(var r,i,n;;){if(e.lookahead<ae){if(Je(e),e.lookahead<ae&&t===$e)return P;if(e.lookahead===0)break}if(r=0,e.lookahead>=A&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+A-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=A-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-ae&&(e.match_length=Cs(e,r),e.match_length<=5&&(e.strategy===Vh||e.match_length===A&&e.strstart-e.match_start>4096)&&(e.match_length=A-1)),e.prev_length>=A&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-A,i=ee._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-A),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+A-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=A-1,e.strstart++,i&&(U(e,false),e.strm.avail_out===0))return P}else if(e.match_available){if(i=ee._tr_tally(e,0,e.window[e.strstart-1]),i&&U(e,false),e.strstart++,e.lookahead--,e.strm.avail_out===0)return P}else e.match_available=1,e.strstart++,e.lookahead--;}return e.match_available&&(i=ee._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<A-1?e.strstart:A-1,t===Fe?(U(e,true),e.strm.avail_out===0?We:bt):e.last_lit&&(U(e,false),e.strm.avail_out===0)?P:er}function cc(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=Ne){if(Je(e),e.lookahead<=Ne&&t===$e)return P;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=A&&e.strstart>0&&(n=e.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=e.strstart+Ne;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<a);e.match_length=Ne-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead);}if(e.match_length>=A?(r=ee._tr_tally(e,1,e.match_length-A),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=ee._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(U(e,false),e.strm.avail_out===0))return P}return e.insert=0,t===Fe?(U(e,true),e.strm.avail_out===0?We:bt):e.last_lit&&(U(e,false),e.strm.avail_out===0)?P:er}function pc(e,t){for(var r;;){if(e.lookahead===0&&(Je(e),e.lookahead===0)){if(t===$e)return P;break}if(e.match_length=0,r=ee._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(U(e,false),e.strm.avail_out===0))return P}return e.insert=0,t===Fe?(U(e,true),e.strm.avail_out===0?We:bt):e.last_lit&&(U(e,false),e.strm.avail_out===0)?P:er}function ce(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n;}var _t;_t=[new ce(0,0,0,0,hc),new ce(4,4,8,4,En),new ce(4,5,16,8,En),new ce(4,6,32,32,En),new ce(4,4,16,16,vt),new ce(8,16,32,32,vt),new ce(8,16,128,128,vt),new ce(8,32,128,256,vt),new ce(32,128,258,1024,vt),new ce(32,258,258,4096,vt)];function gc(e){e.window_size=2*e.w_size,ze(e.head),e.max_lazy_match=_t[e.level].max_lazy,e.good_match=_t[e.level].good_length,e.nice_match=_t[e.level].nice_length,e.max_chain_length=_t[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=A-1,e.match_available=0,e.ins_h=0;}function mc(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Hr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new $.Buf16(sc*2),this.dyn_dtree=new $.Buf16((2*ac+1)*2),this.bl_tree=new $.Buf16((2*oc+1)*2),ze(this.dyn_ltree),ze(this.dyn_dtree),ze(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new $.Buf16(lc+1),this.heap=new $.Buf16(2*Sn+1),ze(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new $.Buf16(2*Sn+1),ze(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0;}function As(e){var t;return !e||!e.state?je(e,te):(e.total_in=e.total_out=0,e.data_type=Qh,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Zr:Ze,e.adler=t.wrap===2?0:1,t.last_flush=$e,ee._tr_init(t),pe)}function Rs(e){var t=As(e);return t===pe&&gc(e.state),t}function vc(e,t){return !e||!e.state||e.state.wrap!==2?te:(e.state.gzhead=t,pe)}function Os(e,t,r,i,n,a){if(!e)return te;var o=1;if(t===Xh&&(t=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>ec||r!==Hr||i<8||i>15||t<0||t>9||a<0||a>Kh)return je(e,te);i===8&&(i=9);var l=new mc;return e.state=l,l.strm=e,l.wrap=o,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=n+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+A-1)/A),l.window=new $.Buf8(l.w_size*2),l.head=new $.Buf16(l.hash_size),l.prev=new $.Buf16(l.w_size),l.lit_bufsize=1<<n+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new $.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=a,l.method=r,Rs(e)}function _c(e,t){return Os(e,t,Hr,tc,rc,Gh)}function bc(e,t){var r,i,n,a;if(!e||!e.state||t>Es||t<0)return e?je(e,te):te;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===Qt&&t!==Fe)return je(e,e.avail_out===0?xn:te);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===Zr)if(i.wrap===2)e.adler=0,R(i,31),R(i,139),R(i,8),i.gzhead?(R(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),R(i,i.gzhead.time&255),R(i,i.gzhead.time>>8&255),R(i,i.gzhead.time>>16&255),R(i,i.gzhead.time>>24&255),R(i,i.level===9?2:i.strategy>=Pr||i.level<2?4:0),R(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(R(i,i.gzhead.extra.length&255),R(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Ie(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=kn):(R(i,0),R(i,0),R(i,0),R(i,0),R(i,0),R(i,i.level===9?2:i.strategy>=Pr||i.level<2?4:0),R(i,uc),i.status=Ze);else {var o=Hr+(i.w_bits-8<<4)<<8,l=-1;i.strategy>=Pr||i.level<2?l=0:i.level<6?l=1:i.level===6?l=2:l=3,o|=l<<6,i.strstart!==0&&(o|=fc),o+=31-o%31,i.status=Ze,Gt(i,o),i.strstart!==0&&(Gt(i,e.adler>>>16),Gt(i,e.adler&65535)),e.adler=1;}if(i.status===kn)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Ie(e.adler,i.pending_buf,i.pending-n,n)),Le(e),n=i.pending,i.pending===i.pending_buf_size));)R(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=Ie(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Br);}else i.status=Br;if(i.status===Br)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Ie(e.adler,i.pending_buf,i.pending-n,n)),Le(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}i.gzindex<i.gzhead.name.length?a=i.gzhead.name.charCodeAt(i.gzindex++)&255:a=0,R(i,a);}while(a!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Ie(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.gzindex=0,i.status=qr);}else i.status=qr;if(i.status===qr)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Ie(e.adler,i.pending_buf,i.pending-n,n)),Le(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}i.gzindex<i.gzhead.comment.length?a=i.gzhead.comment.charCodeAt(i.gzindex++)&255:a=0,R(i,a);}while(a!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Ie(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.status=Ur);}else i.status=Ur;if(i.status===Ur&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Le(e),i.pending+2<=i.pending_buf_size&&(R(i,e.adler&255),R(i,e.adler>>8&255),e.adler=0,i.status=Ze)):i.status=Ze),i.pending!==0){if(Le(e),e.avail_out===0)return i.last_flush=-1,pe}else if(e.avail_in===0&&ks(t)<=ks(r)&&t!==Fe)return je(e,xn);if(i.status===Qt&&e.avail_in!==0)return je(e,xn);if(e.avail_in!==0||i.lookahead!==0||t!==$e&&i.status!==Qt){var u=i.strategy===Pr?pc(i,t):i.strategy===Yh?cc(i,t):_t[i.level].func(i,t);if((u===We||u===bt)&&(i.status=Qt),u===P||u===We)return e.avail_out===0&&(i.last_flush=-1),pe;if(u===er&&(t===Wh?ee._tr_align(i):t!==Es&&(ee._tr_stored_block(i,0,0,false),t===Jh&&(ze(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Le(e),e.avail_out===0))return i.last_flush=-1,pe}return t!==Fe?pe:i.wrap<=0?Ss:(i.wrap===2?(R(i,e.adler&255),R(i,e.adler>>8&255),R(i,e.adler>>16&255),R(i,e.adler>>24&255),R(i,e.total_in&255),R(i,e.total_in>>8&255),R(i,e.total_in>>16&255),R(i,e.total_in>>24&255)):(Gt(i,e.adler>>>16),Gt(i,e.adler&65535)),Le(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?pe:Ss)}function yc(e){var t;return !e||!e.state?te:(t=e.state.status,t!==Zr&&t!==kn&&t!==Br&&t!==qr&&t!==Ur&&t!==Ze&&t!==Qt?je(e,te):(e.state=null,t===Ze?je(e,$h):pe))}function wc(e,t){var r=t.length,i,n,a,o,l,u,s,f;if(!e||!e.state||(i=e.state,o=i.wrap,o===2||o===1&&i.status!==Zr||i.lookahead))return te;for(o===1&&(e.adler=Ts(e.adler,t,r,0)),i.wrap=0,r>=i.w_size&&(o===0&&(ze(i.head),i.strstart=0,i.block_start=0,i.insert=0),f=new $.Buf8(i.w_size),$.arraySet(f,t,r-i.w_size,i.w_size,0),t=f,r=i.w_size),l=e.avail_in,u=e.next_in,s=e.input,e.avail_in=r,e.next_in=0,e.input=t,Je(i);i.lookahead>=A;){n=i.strstart,a=i.lookahead-(A-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+A-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--a);i.strstart=n,i.lookahead=A-1,Je(i);}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=A-1,i.match_available=0,e.next_in=u,e.input=s,e.avail_in=l,i.wrap=o,pe}ge.deflateInit=_c;ge.deflateInit2=Os;ge.deflateReset=Rs;ge.deflateResetKeep=As;ge.deflateSetHeader=vc;ge.deflate=bc;ge.deflateEnd=yc;ge.deflateSetDictionary=wc;ge.deflateInfo="pako deflate (from Nodeca project)";});var Tn=v(yt=>{var Wr=Ee(),Is=true,Ls=true;try{String.fromCharCode.apply(null,[0]);}catch{Is=false;}try{String.fromCharCode.apply(null,new Uint8Array(1));}catch{Ls=false;}var tr=new Wr.Buf8(256);for(ke=0;ke<256;ke++)tr[ke]=ke>=252?6:ke>=248?5:ke>=240?4:ke>=224?3:ke>=192?2:1;var ke;tr[254]=tr[254]=1;yt.string2buf=function(e){var t,r,i,n,a,o=e.length,l=0;for(n=0;n<o;n++)r=e.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Wr.Buf8(l),a=0,n=0;a<l;n++)r=e.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};function zs(e,t){if(t<65534&&(e.subarray&&Ls||!e.subarray&&Is))return String.fromCharCode.apply(null,Wr.shrinkBuf(e,t));for(var r="",i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r}yt.buf2binstring=function(e){return zs(e,e.length)};yt.binstring2buf=function(e){for(var t=new Wr.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t};yt.buf2string=function(e,t){var r,i,n,a,o=t||e.length,l=new Array(o*2);for(i=0,r=0;r<o;){if(n=e[r++],n<128){l[i++]=n;continue}if(a=tr[n],a>4){l[i++]=65533,r+=a-1;continue}for(n&=a===2?31:a===3?15:7;a>1&&r<o;)n=n<<6|e[r++]&63,a--;if(a>1){l[i++]=65533;continue}n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|n&1023);}return zs(l,i)};yt.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+tr[e[r]]>t?r:t};});var Cn=v((r0,Ns)=>{function xc(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0;}Ns.exports=xc;});var Ps=v(nr=>{var rr=Ds(),ir=Ee(),Rn=Tn(),On=Mr(),Ec=Cn(),Ms=Object.prototype.toString,Sc=0,An=4,wt=0,js=1,Fs=2,kc=-1,Tc=0,Cc=8;function Xe(e){if(!(this instanceof Xe))return new Xe(e);this.options=ir.assign({level:kc,method:Cc,chunkSize:16384,windowBits:15,memLevel:8,strategy:Tc,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=false,this.chunks=[],this.strm=new Ec,this.strm.avail_out=0;var r=rr.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==wt)throw new Error(On[r]);if(t.header&&rr.deflateSetHeader(this.strm,t.header),t.dictionary){var i;if(typeof t.dictionary=="string"?i=Rn.string2buf(t.dictionary):Ms.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,r=rr.deflateSetDictionary(this.strm,i),r!==wt)throw new Error(On[r]);this._dict_set=true;}}Xe.prototype.push=function(e,t){var r=this.strm,i=this.options.chunkSize,n,a;if(this.ended)return false;a=t===~~t?t:t===true?An:Sc,typeof e=="string"?r.input=Rn.string2buf(e):Ms.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new ir.Buf8(i),r.next_out=0,r.avail_out=i),n=rr.deflate(r,a),n!==js&&n!==wt)return this.onEnd(n),this.ended=true,false;(r.avail_out===0||r.avail_in===0&&(a===An||a===Fs))&&(this.options.to==="string"?this.onData(Rn.buf2binstring(ir.shrinkBuf(r.output,r.next_out))):this.onData(ir.shrinkBuf(r.output,r.next_out)));}while((r.avail_in>0||r.avail_out===0)&&n!==js);return a===An?(n=rr.deflateEnd(this.strm),this.onEnd(n),this.ended=true,n===wt):(a===Fs&&(this.onEnd(wt),r.avail_out=0),true)};Xe.prototype.onData=function(e){this.chunks.push(e);};Xe.prototype.onEnd=function(e){e===wt&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ir.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg;};function Dn(e,t){var r=new Xe(t);if(r.push(e,true),r.err)throw r.msg||On[r.err];return r.result}function Ac(e,t){return t=t||{},t.raw=true,Dn(e,t)}function Rc(e,t){return t=t||{},t.gzip=true,Dn(e,t)}nr.Deflate=Xe;nr.deflate=Dn;nr.deflateRaw=Ac;nr.gzip=Rc;});var qs=v((n0,Bs)=>{var Jr=30,Oc=12;Bs.exports=function(t,r){var i,n,a,o,l,u,s,f,c,d,h,w,_,y,p,g,x,m,b,T,k,S,C,I,E;i=t.state,n=t.next_in,I=t.input,a=n+(t.avail_in-5),o=t.next_out,E=t.output,l=o-(r-t.avail_out),u=o+(t.avail_out-257),s=i.dmax,f=i.wsize,c=i.whave,d=i.wnext,h=i.window,w=i.hold,_=i.bits,y=i.lencode,p=i.distcode,g=(1<<i.lenbits)-1,x=(1<<i.distbits)-1;e:do{_<15&&(w+=I[n++]<<_,_+=8,w+=I[n++]<<_,_+=8),m=y[w&g];t:for(;;){if(b=m>>>24,w>>>=b,_-=b,b=m>>>16&255,b===0)E[o++]=m&65535;else if(b&16){T=m&65535,b&=15,b&&(_<b&&(w+=I[n++]<<_,_+=8),T+=w&(1<<b)-1,w>>>=b,_-=b),_<15&&(w+=I[n++]<<_,_+=8,w+=I[n++]<<_,_+=8),m=p[w&x];r:for(;;){if(b=m>>>24,w>>>=b,_-=b,b=m>>>16&255,b&16){if(k=m&65535,b&=15,_<b&&(w+=I[n++]<<_,_+=8,_<b&&(w+=I[n++]<<_,_+=8)),k+=w&(1<<b)-1,k>s){t.msg="invalid distance too far back",i.mode=Jr;break e}if(w>>>=b,_-=b,b=o-l,k>b){if(b=k-b,b>c&&i.sane){t.msg="invalid distance too far back",i.mode=Jr;break e}if(S=0,C=h,d===0){if(S+=f-b,b<T){T-=b;do E[o++]=h[S++];while(--b);S=o-k,C=E;}}else if(d<b){if(S+=f+d-b,b-=d,b<T){T-=b;do E[o++]=h[S++];while(--b);if(S=0,d<T){b=d,T-=b;do E[o++]=h[S++];while(--b);S=o-k,C=E;}}}else if(S+=d-b,b<T){T-=b;do E[o++]=h[S++];while(--b);S=o-k,C=E;}for(;T>2;)E[o++]=C[S++],E[o++]=C[S++],E[o++]=C[S++],T-=3;T&&(E[o++]=C[S++],T>1&&(E[o++]=C[S++]));}else {S=o-k;do E[o++]=E[S++],E[o++]=E[S++],E[o++]=E[S++],T-=3;while(T>2);T&&(E[o++]=E[S++],T>1&&(E[o++]=E[S++]));}}else if((b&64)===0){m=p[(m&65535)+(w&(1<<b)-1)];continue r}else {t.msg="invalid distance code",i.mode=Jr;break e}break}}else if((b&64)===0){m=y[(m&65535)+(w&(1<<b)-1)];continue t}else if(b&32){i.mode=Oc;break e}else {t.msg="invalid literal/length code",i.mode=Jr;break e}break}}while(n<a&&o<u);T=_>>3,n-=T,_-=T<<3,w&=(1<<_)-1,t.next_in=n,t.next_out=o,t.avail_in=n<a?5+(a-n):5-(n-a),t.avail_out=o<u?257+(u-o):257-(o-u),i.hold=w,i.bits=_;};});var Xs=v((a0,$s)=>{var Us=Ee(),xt=15,Hs=852,Zs=592,Ws=0,In=1,Js=2,Dc=[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],Ic=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Lc=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],zc=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];$s.exports=function(t,r,i,n,a,o,l,u){var s=u.bits,f=0,c=0,d=0,h=0,w=0,_=0,y=0,p=0,g=0,x=0,m,b,T,k,S,C=null,I=0,E,V=new Us.Buf16(xt+1),Qe=new Us.Buf16(xt+1),ur=null,aa=0,oa,dr,hr;for(f=0;f<=xt;f++)V[f]=0;for(c=0;c<n;c++)V[r[i+c]]++;for(w=s,h=xt;h>=1&&V[h]===0;h--);if(w>h&&(w=h),h===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,u.bits=1,0;for(d=1;d<h&&V[d]===0;d++);for(w<d&&(w=d),p=1,f=1;f<=xt;f++)if(p<<=1,p-=V[f],p<0)return -1;if(p>0&&(t===Ws||h!==1))return -1;for(Qe[1]=0,f=1;f<xt;f++)Qe[f+1]=Qe[f]+V[f];for(c=0;c<n;c++)r[i+c]!==0&&(l[Qe[r[i+c]]++]=c);if(t===Ws?(C=ur=l,E=19):t===In?(C=Dc,I-=257,ur=Ic,aa-=257,E=256):(C=Lc,ur=zc,E=-1),x=0,c=0,f=d,S=o,_=w,y=0,T=-1,g=1<<w,k=g-1,t===In&&g>Hs||t===Js&&g>Zs)return 1;for(;;){oa=f-y,l[c]<E?(dr=0,hr=l[c]):l[c]>E?(dr=ur[aa+l[c]],hr=C[I+l[c]]):(dr=96,hr=0),m=1<<f-y,b=1<<_,d=b;do b-=m,a[S+(x>>y)+b]=oa<<24|dr<<16|hr|0;while(b!==0);for(m=1<<f-1;x&m;)m>>=1;if(m!==0?(x&=m-1,x+=m):x=0,c++,--V[f]===0){if(f===h)break;f=r[i+l[c]];}if(f>w&&(x&k)!==T){for(y===0&&(y=w),S+=d,_=f-y,p=1<<_;_+y<h&&(p-=V[_+y],!(p<=0));)_++,p<<=1;if(g+=1<<_,t===In&&g>Hs||t===Js&&g>Zs)return 1;T=x&k,a[T]=w<<24|_<<16|S-o|0;}}return x!==0&&(a[S+x]=f-y<<24|64<<16|0),u.bits=w,0};});var Rl=v(oe=>{var G=Ee(),Mn=yn(),me=wn(),Nc=qs(),ar=Xs(),jc=0,yl=1,wl=2,Vs=4,Fc=5,$r=6,Ve=0,Mc=1,Pc=2,re=-2,xl=-3,Pn=-4,Bc=-5,Ys=8,El=1,Ks=2,Gs=3,Qs=4,el=5,tl=6,rl=7,il=8,nl=9,al=10,Yr=11,Te=12,Ln=13,ol=14,zn=15,sl=16,ll=17,fl=18,ul=19,Xr=20,Vr=21,dl=22,hl=23,cl=24,pl=25,gl=26,Nn=27,ml=28,vl=29,z=30,Bn=31,qc=32,Uc=852,Hc=592,Zc=15,Wc=Zc;function _l(e){return (e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Jc(){this.mode=0,this.last=false,this.wrap=0,this.havedict=false,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new G.Buf16(320),this.work=new G.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0;}function Sl(e){var t;return !e||!e.state?re:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=El,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new G.Buf32(Uc),t.distcode=t.distdyn=new G.Buf32(Hc),t.sane=1,t.back=-1,Ve)}function kl(e){var t;return !e||!e.state?re:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Sl(e))}function Tl(e,t){var r,i;return !e||!e.state||(i=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?re:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,kl(e))}function Cl(e,t){var r,i;return e?(i=new Jc,e.state=i,i.window=null,r=Tl(e,t),r!==Ve&&(e.state=null),r):re}function $c(e){return Cl(e,Wc)}var bl=true,jn,Fn;function Xc(e){if(bl){var t;for(jn=new G.Buf32(512),Fn=new G.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ar(yl,e.lens,0,288,jn,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ar(wl,e.lens,0,32,Fn,0,e.work,{bits:5}),bl=false;}e.lencode=jn,e.lenbits=9,e.distcode=Fn,e.distbits=5;}function Al(e,t,r,i){var n,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new G.Buf8(a.wsize)),i>=a.wsize?(G.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),G.arraySet(a.window,t,r-i,n,a.wnext),i-=n,i?(G.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0}function Vc(e,t){var r,i,n,a,o,l,u,s,f,c,d,h,w,_,y=0,p,g,x,m,b,T,k,S,C=new G.Buf8(4),I,E,V=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return re;r=e.state,r.mode===Te&&(r.mode=Ln),o=e.next_out,n=e.output,u=e.avail_out,a=e.next_in,i=e.input,l=e.avail_in,s=r.hold,f=r.bits,c=l,d=u,S=Ve;e:for(;;)switch(r.mode){case El:if(r.wrap===0){r.mode=Ln;break}for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if(r.wrap&2&&s===35615){r.check=0,C[0]=s&255,C[1]=s>>>8&255,r.check=me(r.check,C,2,0),s=0,f=0,r.mode=Ks;break}if(r.flags=0,r.head&&(r.head.done=false),!(r.wrap&1)||(((s&255)<<8)+(s>>8))%31){e.msg="incorrect header check",r.mode=z;break}if((s&15)!==Ys){e.msg="unknown compression method",r.mode=z;break}if(s>>>=4,f-=4,k=(s&15)+8,r.wbits===0)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=z;break}r.dmax=1<<k,e.adler=r.check=1,r.mode=s&512?al:Te,s=0,f=0;break;case Ks:for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if(r.flags=s,(r.flags&255)!==Ys){e.msg="unknown compression method",r.mode=z;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=z;break}r.head&&(r.head.text=s>>8&1),r.flags&512&&(C[0]=s&255,C[1]=s>>>8&255,r.check=me(r.check,C,2,0)),s=0,f=0,r.mode=Gs;case Gs:for(;f<32;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}r.head&&(r.head.time=s),r.flags&512&&(C[0]=s&255,C[1]=s>>>8&255,C[2]=s>>>16&255,C[3]=s>>>24&255,r.check=me(r.check,C,4,0)),s=0,f=0,r.mode=Qs;case Qs:for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}r.head&&(r.head.xflags=s&255,r.head.os=s>>8),r.flags&512&&(C[0]=s&255,C[1]=s>>>8&255,r.check=me(r.check,C,2,0)),s=0,f=0,r.mode=el;case el:if(r.flags&1024){for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}r.length=s,r.head&&(r.head.extra_len=s),r.flags&512&&(C[0]=s&255,C[1]=s>>>8&255,r.check=me(r.check,C,2,0)),s=0,f=0;}else r.head&&(r.head.extra=null);r.mode=tl;case tl:if(r.flags&1024&&(h=r.length,h>l&&(h=l),h&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),G.arraySet(r.head.extra,i,a,h,k)),r.flags&512&&(r.check=me(r.check,i,h,a)),l-=h,a+=h,r.length-=h),r.length))break e;r.length=0,r.mode=rl;case rl:if(r.flags&2048){if(l===0)break e;h=0;do k=i[a+h++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&h<l);if(r.flags&512&&(r.check=me(r.check,i,h,a)),l-=h,a+=h,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=il;case il:if(r.flags&4096){if(l===0)break e;h=0;do k=i[a+h++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k));while(k&&h<l);if(r.flags&512&&(r.check=me(r.check,i,h,a)),l-=h,a+=h,k)break e}else r.head&&(r.head.comment=null);r.mode=nl;case nl:if(r.flags&512){for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if(s!==(r.check&65535)){e.msg="header crc mismatch",r.mode=z;break}s=0,f=0;}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=true),e.adler=r.check=0,r.mode=Te;break;case al:for(;f<32;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}e.adler=r.check=_l(s),s=0,f=0,r.mode=Yr;case Yr:if(r.havedict===0)return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=s,r.bits=f,Pc;e.adler=r.check=1,r.mode=Te;case Te:if(t===Fc||t===$r)break e;case Ln:if(r.last){s>>>=f&7,f-=f&7,r.mode=Nn;break}for(;f<3;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}switch(r.last=s&1,s>>>=1,f-=1,s&3){case 0:r.mode=ol;break;case 1:if(Xc(r),r.mode=Xr,t===$r){s>>>=2,f-=2;break e}break;case 2:r.mode=ll;break;case 3:e.msg="invalid block type",r.mode=z;}s>>>=2,f-=2;break;case ol:for(s>>>=f&7,f-=f&7;f<32;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if((s&65535)!==(s>>>16^65535)){e.msg="invalid stored block lengths",r.mode=z;break}if(r.length=s&65535,s=0,f=0,r.mode=zn,t===$r)break e;case zn:r.mode=sl;case sl:if(h=r.length,h){if(h>l&&(h=l),h>u&&(h=u),h===0)break e;G.arraySet(n,i,a,h,o),l-=h,a+=h,u-=h,o+=h,r.length-=h;break}r.mode=Te;break;case ll:for(;f<14;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if(r.nlen=(s&31)+257,s>>>=5,f-=5,r.ndist=(s&31)+1,s>>>=5,f-=5,r.ncode=(s&15)+4,s>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=z;break}r.have=0,r.mode=fl;case fl:for(;r.have<r.ncode;){for(;f<3;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}r.lens[V[r.have++]]=s&7,s>>>=3,f-=3;}for(;r.have<19;)r.lens[V[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},S=ar(jc,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,S){e.msg="invalid code lengths set",r.mode=z;break}r.have=0,r.mode=ul;case ul:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[s&(1<<r.lenbits)-1],p=y>>>24,g=y>>>16&255,x=y&65535,!(p<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if(x<16)s>>>=p,f-=p,r.lens[r.have++]=x;else {if(x===16){for(E=p+2;f<E;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if(s>>>=p,f-=p,r.have===0){e.msg="invalid bit length repeat",r.mode=z;break}k=r.lens[r.have-1],h=3+(s&3),s>>>=2,f-=2;}else if(x===17){for(E=p+3;f<E;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}s>>>=p,f-=p,k=0,h=3+(s&7),s>>>=3,f-=3;}else {for(E=p+7;f<E;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}s>>>=p,f-=p,k=0,h=11+(s&127),s>>>=7,f-=7;}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=z;break}for(;h--;)r.lens[r.have++]=k;}}if(r.mode===z)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=z;break}if(r.lenbits=9,I={bits:r.lenbits},S=ar(yl,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,S){e.msg="invalid literal/lengths set",r.mode=z;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},S=ar(wl,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,S){e.msg="invalid distances set",r.mode=z;break}if(r.mode=Xr,t===$r)break e;case Xr:r.mode=Vr;case Vr:if(l>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=s,r.bits=f,Nc(e,d),o=e.next_out,n=e.output,u=e.avail_out,a=e.next_in,i=e.input,l=e.avail_in,s=r.hold,f=r.bits,r.mode===Te&&(r.back=-1);break}for(r.back=0;y=r.lencode[s&(1<<r.lenbits)-1],p=y>>>24,g=y>>>16&255,x=y&65535,!(p<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if(g&&(g&240)===0){for(m=p,b=g,T=x;y=r.lencode[T+((s&(1<<m+b)-1)>>m)],p=y>>>24,g=y>>>16&255,x=y&65535,!(m+p<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}s>>>=m,f-=m,r.back+=m;}if(s>>>=p,f-=p,r.back+=p,r.length=x,g===0){r.mode=gl;break}if(g&32){r.back=-1,r.mode=Te;break}if(g&64){e.msg="invalid literal/length code",r.mode=z;break}r.extra=g&15,r.mode=dl;case dl:if(r.extra){for(E=r.extra;f<E;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}r.length+=s&(1<<r.extra)-1,s>>>=r.extra,f-=r.extra,r.back+=r.extra;}r.was=r.length,r.mode=hl;case hl:for(;y=r.distcode[s&(1<<r.distbits)-1],p=y>>>24,g=y>>>16&255,x=y&65535,!(p<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if((g&240)===0){for(m=p,b=g,T=x;y=r.distcode[T+((s&(1<<m+b)-1)>>m)],p=y>>>24,g=y>>>16&255,x=y&65535,!(m+p<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}s>>>=m,f-=m,r.back+=m;}if(s>>>=p,f-=p,r.back+=p,g&64){e.msg="invalid distance code",r.mode=z;break}r.offset=x,r.extra=g&15,r.mode=cl;case cl:if(r.extra){for(E=r.extra;f<E;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}r.offset+=s&(1<<r.extra)-1,s>>>=r.extra,f-=r.extra,r.back+=r.extra;}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=z;break}r.mode=pl;case pl:if(u===0)break e;if(h=d-u,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=z;break}h>r.wnext?(h-=r.wnext,w=r.wsize-h):w=r.wnext-h,h>r.length&&(h=r.length),_=r.window;}else _=n,w=o-r.offset,h=r.length;h>u&&(h=u),u-=h,r.length-=h;do n[o++]=_[w++];while(--h);r.length===0&&(r.mode=Vr);break;case gl:if(u===0)break e;n[o++]=r.length,u--,r.mode=Vr;break;case Nn:if(r.wrap){for(;f<32;){if(l===0)break e;l--,s|=i[a++]<<f,f+=8;}if(d-=u,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?me(r.check,n,d,o-d):Mn(r.check,n,d,o-d)),d=u,(r.flags?s:_l(s))!==r.check){e.msg="incorrect data check",r.mode=z;break}s=0,f=0;}r.mode=ml;case ml:if(r.wrap&&r.flags){for(;f<32;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8;}if(s!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=z;break}s=0,f=0;}r.mode=vl;case vl:S=Mc;break e;case z:S=xl;break e;case Bn:return Pn;case qc:default:return re}return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=s,r.bits=f,(r.wsize||d!==e.avail_out&&r.mode<z&&(r.mode<Nn||t!==Vs))&&Al(e,e.output,e.next_out,d-e.avail_out)?(r.mode=Bn,Pn):(c-=e.avail_in,d-=e.avail_out,e.total_in+=c,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?me(r.check,n,d,e.next_out-d):Mn(r.check,n,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Te?128:0)+(r.mode===Xr||r.mode===zn?256:0),(c===0&&d===0||t===Vs)&&S===Ve&&(S=Bc),S)}function Yc(e){if(!e||!e.state)return re;var t=e.state;return t.window&&(t.window=null),e.state=null,Ve}function Kc(e,t){var r;return !e||!e.state||(r=e.state,(r.wrap&2)===0)?re:(r.head=t,t.done=false,Ve)}function Gc(e,t){var r=t.length,i,n,a;return !e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==Yr)?re:i.mode===Yr&&(n=1,n=Mn(n,t,r,0),n!==i.check)?xl:(a=Al(e,t,r,r),a?(i.mode=Bn,Pn):(i.havedict=1,Ve))}oe.inflateReset=kl;oe.inflateReset2=Tl;oe.inflateResetKeep=Sl;oe.inflateInit=$c;oe.inflateInit2=Cl;oe.inflate=Vc;oe.inflateEnd=Yc;oe.inflateGetHeader=Kc;oe.inflateSetDictionary=Gc;oe.inflateInfo="pako inflate (from Nodeca project)";});var qn=v((s0,Ol)=>{Ol.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};});var Il=v((l0,Dl)=>{function Qc(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=false;}Dl.exports=Qc;});var zl=v(sr=>{var Et=Rl(),or=Ee(),Kr=Tn(),j=qn(),Un=Mr(),ep=Cn(),tp=Il(),Ll=Object.prototype.toString;function Ye(e){if(!(this instanceof Ye))return new Ye(e);this.options=or.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=false,this.chunks=[],this.strm=new ep,this.strm.avail_out=0;var r=Et.inflateInit2(this.strm,t.windowBits);if(r!==j.Z_OK)throw new Error(Un[r]);if(this.header=new tp,Et.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Kr.string2buf(t.dictionary):Ll.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Et.inflateSetDictionary(this.strm,t.dictionary),r!==j.Z_OK)))throw new Error(Un[r])}Ye.prototype.push=function(e,t){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,a,o,l,u,s,f=false;if(this.ended)return false;o=t===~~t?t:t===true?j.Z_FINISH:j.Z_NO_FLUSH,typeof e=="string"?r.input=Kr.binstring2buf(e):Ll.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new or.Buf8(i),r.next_out=0,r.avail_out=i),a=Et.inflate(r,j.Z_NO_FLUSH),a===j.Z_NEED_DICT&&n&&(a=Et.inflateSetDictionary(this.strm,n)),a===j.Z_BUF_ERROR&&f===true&&(a=j.Z_OK,f=false),a!==j.Z_STREAM_END&&a!==j.Z_OK)return this.onEnd(a),this.ended=true,false;r.next_out&&(r.avail_out===0||a===j.Z_STREAM_END||r.avail_in===0&&(o===j.Z_FINISH||o===j.Z_SYNC_FLUSH))&&(this.options.to==="string"?(l=Kr.utf8border(r.output,r.next_out),u=r.next_out-l,s=Kr.buf2string(r.output,l),r.next_out=u,r.avail_out=i-u,u&&or.arraySet(r.output,r.output,l,u,0),this.onData(s)):this.onData(or.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(f=true);}while((r.avail_in>0||r.avail_out===0)&&a!==j.Z_STREAM_END);return a===j.Z_STREAM_END&&(o=j.Z_FINISH),o===j.Z_FINISH?(a=Et.inflateEnd(this.strm),this.onEnd(a),this.ended=true,a===j.Z_OK):(o===j.Z_SYNC_FLUSH&&(this.onEnd(j.Z_OK),r.avail_out=0),true)};Ye.prototype.onData=function(e){this.chunks.push(e);};Ye.prototype.onEnd=function(e){e===j.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=or.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg;};function Hn(e,t){var r=new Ye(t);if(r.push(e,true),r.err)throw r.msg||Un[r.err];return r.result}function rp(e,t){return t=t||{},t.raw=true,Hn(e,t)}sr.Inflate=Ye;sr.inflate=Hn;sr.inflateRaw=rp;sr.ungzip=Hn;});var Fl=v((u0,jl)=>{var ip=Ee().assign,np=Ps(),ap=zl(),op=qn(),Nl={};ip(Nl,np,ap,op);jl.exports=Nl;});var Pl=v(Qr=>{var sp=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",lp=Fl(),Ml=N(),Gr=K(),fp=sp?"uint8array":"array";Qr.magic="\b\0";function Ke(e,t){Gr.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={};}Ml.inherits(Ke,Gr);Ke.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(Ml.transformTo(fp,e.data),false);};Ke.prototype.flush=function(){Gr.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],true);};Ke.prototype.cleanUp=function(){Gr.prototype.cleanUp.call(this),this._pako=null;};Ke.prototype._createPako=function(){this._pako=new lp[this._pakoAction]({raw:true,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta});};};Qr.compressWorker=function(e){return new Ke("Deflate",e)};Qr.uncompressWorker=function(){return new Ke("Inflate",{})};});var Wn=v(Zn=>{var Bl=K();Zn.STORE={magic:"\0\0",compressWorker:function(){return new Bl("STORE compression")},uncompressWorker:function(){return new Bl("STORE decompression")}};Zn.DEFLATE=Pl();});var Jn=v(Ge=>{Ge.LOCAL_FILE_HEADER="PK";Ge.CENTRAL_FILE_HEADER="PK";Ge.CENTRAL_DIRECTORY_END="PK";Ge.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";Ge.ZIP64_CENTRAL_DIRECTORY_END="PK";Ge.DATA_DESCRIPTOR="PK\x07\b";});var Zl=v((p0,Hl)=>{var St=N(),kt=K(),$n=ht(),ql=Lr(),ei=Jn(),D=function(e,t){var r="",i;for(i=0;i<t;i++)r+=String.fromCharCode(e&255),e=e>>>8;return r},up=function(e,t){var r=e;return e||(r=t?16893:33204),(r&65535)<<16},dp=function(e){return (e||0)&63},Ul=function(e,t,r,i,n,a){var o=e.file,l=e.compression,u=a!==$n.utf8encode,s=St.transformTo("string",a(o.name)),f=St.transformTo("string",$n.utf8encode(o.name)),c=o.comment,d=St.transformTo("string",a(c)),h=St.transformTo("string",$n.utf8encode(c)),w=f.length!==o.name.length,_=h.length!==c.length,y,p,g="",x="",m="",b=o.dir,T=o.date,k={crc32:0,compressedSize:0,uncompressedSize:0};(!t||r)&&(k.crc32=e.crc32,k.compressedSize=e.compressedSize,k.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),!u&&(w||_)&&(S|=2048);var C=0,I=0;b&&(C|=16),n==="UNIX"?(I=798,C|=up(o.unixPermissions,b)):(I=20,C|=dp(o.dosPermissions)),y=T.getUTCHours(),y=y<<6,y=y|T.getUTCMinutes(),y=y<<5,y=y|T.getUTCSeconds()/2,p=T.getUTCFullYear()-1980,p=p<<4,p=p|T.getUTCMonth()+1,p=p<<5,p=p|T.getUTCDate(),w&&(x=D(1,1)+D(ql(s),4)+f,g+="up"+D(x.length,2)+x),_&&(m=D(1,1)+D(ql(d),4)+h,g+="uc"+D(m.length,2)+m);var E="";E+=`
2
+ \0`,E+=D(S,2),E+=l.magic,E+=D(y,2),E+=D(p,2),E+=D(k.crc32,4),E+=D(k.compressedSize,4),E+=D(k.uncompressedSize,4),E+=D(s.length,2),E+=D(g.length,2);var V=ei.LOCAL_FILE_HEADER+E+s+g,Qe=ei.CENTRAL_FILE_HEADER+D(I,2)+E+D(d.length,2)+"\0\0\0\0"+D(C,4)+D(i,4)+s+g+d;return {fileRecord:V,dirRecord:Qe}},hp=function(e,t,r,i,n){var a="",o=St.transformTo("string",n(i));return a=ei.CENTRAL_DIRECTORY_END+"\0\0\0\0"+D(e,2)+D(e,2)+D(t,4)+D(r,4)+D(o.length,2)+o,a},cp=function(e){var t="";return t=ei.DATA_DESCRIPTOR+D(e.crc32,4)+D(e.compressedSize,4)+D(e.uncompressedSize,4),t};function se(e,t,r,i){kt.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=e,this.accumulate=false,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[];}St.inherits(se,kt);se.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,kt.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-i-1))/r:100}}));};se.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=Ul(e,t,false,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}});}else this.accumulate=true;};se.prototype.closedSource=function(e){this.accumulate=false;var t=this.streamFiles&&!e.file.dir,r=Ul(e,t,true,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:cp(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null;};se.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=hp(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}});};se.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume();};se.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(r){t.processChunk(r);}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end();}),e.on("error",function(r){t.error(r);}),this};se.prototype.resume=function(){if(!kt.prototype.resume.call(this))return false;if(!this.previous&&this._sources.length)return this.prepareNextSource(),true;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),true};se.prototype.error=function(e){var t=this._sources;if(!kt.prototype.error.call(this,e))return false;for(var r=0;r<t.length;r++)try{t[r].error(e);}catch{}return true};se.prototype.lock=function(){kt.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock();};Hl.exports=se;});var Jl=v(Wl=>{var pp=Wn(),gp=Zl(),mp=function(e,t){var r=e||t,i=pp[r];if(!i)throw new Error(r+" is not a valid compression method !");return i};Wl.generateWorker=function(e,t,r){var i=new gp(t.streamFiles,r,t.platform,t.encodeFileName),n=0;try{e.forEach(function(a,o){n++;var l=mp(o.options.compression,t.compression),u=o.options.compressionOptions||t.compressionOptions||{},s=o.dir,f=o.date;o._compressWorker(l,u).withStreamInfo("file",{name:a,dir:s,date:f,comment:o.comment||"",unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions}).pipe(i);}),i.entriesCount=n;}catch(a){i.error(a);}return i};});var Xl=v((m0,$l)=>{var vp=N(),ti=K();function lr(e,t){ti.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=false,this._bindStream(t);}vp.inherits(lr,ti);lr.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(r){t.push({data:r,meta:{percent:0}});}).on("error",function(r){t.isPaused?this.generatedError=r:t.error(r);}).on("end",function(){t.isPaused?t._upstreamEnded=true:t.end();});};lr.prototype.pause=function(){return ti.prototype.pause.call(this)?(this._stream.pause(),true):false};lr.prototype.resume=function(){return ti.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),true):false};$l.exports=lr;});var af=v((v0,nf)=>{var _p=ht(),fr=N(),Gl=K(),bp=Ki(),Ql=Gi(),Vl=zr(),yp=Yo(),wp=Jl(),Yl=Mt(),xp=Xl(),ef=function(e,t,r){var i=fr.getTypeOf(t),n,a=fr.extend(r||{},Ql);a.date=a.date||new Date,a.compression!==null&&(a.compression=a.compression.toUpperCase()),typeof a.unixPermissions=="string"&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&a.unixPermissions&16384&&(a.dir=true),a.dosPermissions&&a.dosPermissions&16&&(a.dir=true),a.dir&&(e=tf(e)),a.createFolders&&(n=Ep(e))&&rf.call(this,n,true);var o=i==="string"&&a.binary===false&&a.base64===false;(!r||typeof r.binary>"u")&&(a.binary=!o);var l=t instanceof Vl&&t.uncompressedSize===0;(l||a.dir||!t||t.length===0)&&(a.base64=false,a.binary=true,t="",a.compression="STORE",i="string");var u=null;t instanceof Vl||t instanceof Gl?u=t:Yl.isNode&&Yl.isStream(t)?u=new xp(e,t):u=fr.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var s=new yp(e,u,a);this.files[e]=s;},Ep=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},tf=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},rf=function(e,t){return t=typeof t<"u"?t:Ql.createFolders,e=tf(e),this.files[e]||ef.call(this,e,null,{dir:true,createFolders:t}),this.files[e]};function Kl(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var Sp={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,i;for(t in this.files)i=this.files[t],r=t.slice(this.root.length,t.length),r&&t.slice(0,this.root.length)===this.root&&e(r,i);},filter:function(e){var t=[];return this.forEach(function(r,i){e(r,i)&&t.push(i);}),t},file:function(e,t,r){if(arguments.length===1)if(Kl(e)){var i=e;return this.filter(function(a,o){return !o.dir&&i.test(a)})}else {var n=this.files[this.root+e];return n&&!n.dir?n:null}else e=this.root+e,ef.call(this,e,t,r);return this},folder:function(e){if(!e)return this;if(Kl(e))return this.filter(function(n,a){return a.dir&&e.test(n)});var t=this.root+e,r=rf.call(this,t),i=this.clone();return i.root=r.name,i},remove:function(e){e=this.root+e;var t=this.files[e];if(t||(e.slice(-1)!=="/"&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(n,a){return a.name.slice(0,e.length)===e}),i=0;i<r.length;i++)delete this.files[r[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if(r=fr.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:_p.utf8encode}),r.type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),r.type==="binarystring"&&(r.type="string"),!r.type)throw new Error("No output type specified.");fr.checkSupport(r.type),(r.platform==="darwin"||r.platform==="freebsd"||r.platform==="linux"||r.platform==="sunos")&&(r.platform="UNIX"),r.platform==="win32"&&(r.platform="DOS");var i=r.comment||this.comment||"";t=wp.generateWorker(this,r,i);}catch(n){t=new Gl("error"),t.error(n);}return new bp(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return e=e||{},e.type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};nf.exports=Sp;});var Xn=v((_0,sf)=>{var kp=N();function of(e){this.data=e,this.length=e.length,this.index=0,this.zero=0;}of.prototype={checkOffset:function(e){this.checkIndex(this.index+e);},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e;},skip:function(e){this.setIndex(this.index+e);},byteAt:function(){},readInt:function(e){var t=0,r;for(this.checkOffset(e),r=this.index+e-1;r>=this.index;r--)t=(t<<8)+this.byteAt(r);return this.index+=e,t},readString:function(e){return kp.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}};sf.exports=of;});var Vn=v((b0,ff)=>{var lf=Xn(),Tp=N();function Tt(e){lf.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255;}Tp.inherits(Tt,lf);Tt.prototype.byteAt=function(e){return this.data[this.zero+e]};Tt.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2),n=e.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===i&&this.data[a+3]===n)return a-this.zero;return -1};Tt.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2),n=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&r===a[1]&&i===a[2]&&n===a[3]};Tt.prototype.readData=function(e){if(this.checkOffset(e),e===0)return [];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};ff.exports=Tt;});var hf=v((y0,df)=>{var uf=Xn(),Cp=N();function Ct(e){uf.call(this,e);}Cp.inherits(Ct,uf);Ct.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};Ct.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};Ct.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};Ct.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};df.exports=Ct;});var Kn=v((w0,pf)=>{var cf=Vn(),Ap=N();function Yn(e){cf.call(this,e);}Ap.inherits(Yn,cf);Yn.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};pf.exports=Yn;});var vf=v((x0,mf)=>{var gf=Kn(),Rp=N();function Gn(e){gf.call(this,e);}Rp.inherits(Gn,gf);Gn.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};mf.exports=Gn;});var Qn=v((E0,bf)=>{var ri=N(),_f=we(),Op=Vn(),Dp=hf(),Ip=vf(),Lp=Kn();bf.exports=function(e){var t=ri.getTypeOf(e);return ri.checkSupport(t),t==="string"&&!_f.uint8array?new Dp(e):t==="nodebuffer"?new Ip(e):_f.uint8array?new Lp(ri.transformTo("uint8array",e)):new Op(ri.transformTo("array",e))};});var Ef=v((S0,xf)=>{var ea=Qn(),Me=N(),zp=zr(),yf=Lr(),ii=ht(),ni=Wn(),Np=we(),jp=0,Fp=3,Mp=function(e){for(var t in ni)if(Object.prototype.hasOwnProperty.call(ni,t)&&ni[t].magic===e)return ni[t];return null};function wf(e,t){this.options=e,this.loadOptions=t;}wf.prototype={isEncrypted:function(){return (this.bitFlag&1)===1},useUTF8:function(){return (this.bitFlag&2048)===2048},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(t=Mp(this.compressionMethod),t===null)throw new Error("Corrupted zip : compression "+Me.pretty(this.compressionMethod)+" unknown (inner file : "+Me.transformTo("string",this.fileName)+")");this.decompressed=new zp(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize));},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength);},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===jp&&(this.dosPermissions=this.externalFileAttributes&63),e===Fp&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=true);},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=ea(this.extraFields[1].value);this.uncompressedSize===Me.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===Me.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===Me.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===Me.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4));}},readExtraFields:function(e){var t=e.index+this.extraFieldsLength,r,i,n;for(this.extraFields||(this.extraFields={});e.index+4<t;)r=e.readInt(2),i=e.readInt(2),n=e.readData(i),this.extraFields[r]={id:r,length:i,value:n};e.setIndex(t);},handleUTF8:function(){var e=Np.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=ii.utf8decode(this.fileName),this.fileCommentStr=ii.utf8decode(this.fileComment);else {var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else {var r=Me.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r);}var i=this.findExtraFieldUnicodeComment();if(i!==null)this.fileCommentStr=i;else {var n=Me.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n);}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=ea(e.value);return t.readInt(1)!==1||yf(this.fileName)!==t.readInt(4)?null:ii.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=ea(e.value);return t.readInt(1)!==1||yf(this.fileComment)!==t.readInt(4)?null:ii.utf8decode(t.readData(e.length-5))}return null}};xf.exports=wf;});var Tf=v((k0,kf)=>{var Pp=Qn(),Ce=N(),le=Jn(),Bp=Ef(),qp=we();function Sf(e){this.files=[],this.loadOptions=e;}Sf.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+Ce.pretty(t)+", expected "+Ce.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var i=this.reader.readString(4),n=i===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=qp.uint8array?"uint8array":"array",r=Ce.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r);},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,t=0,r,i,n;t<e;)r=this.reader.readInt(2),i=this.reader.readInt(4),n=this.reader.readData(i),this.zip64ExtensibleData[r]={id:r,length:i,value:n};},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(le.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes();},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(le.CENTRAL_FILE_HEADER);)e=new Bp({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(le.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,le.LOCAL_FILE_HEADER);throw t?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(e);var r=e;if(this.checkSignature(le.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Ce.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Ce.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Ce.MAX_VALUE_16BITS||this.centralDirRecords===Ce.MAX_VALUE_16BITS||this.centralDirSize===Ce.MAX_VALUE_32BITS||this.centralDirOffset===Ce.MAX_VALUE_32BITS){if(this.zip64=true,e=this.reader.lastIndexOfSignature(le.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(le.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,le.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(le.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(le.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral();}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var n=r-i;if(n>0)this.isSignature(r,le.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=Pp(e);},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles();}};kf.exports=Sf;});var Rf=v((T0,Af)=>{var ta=N(),ai=ft(),Up=ht(),Hp=Tf(),Zp=tn(),Cf=Mt();function Wp(e){return new ai.Promise(function(t,r){var i=e.decompressed.getContentWorker().pipe(new Zp);i.on("error",function(n){r(n);}).on("end",function(){i.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t();}).resume();})}Af.exports=function(e,t){var r=this;return t=ta.extend(t||{},{base64:false,checkCRC32:false,optimizedBinaryString:false,createFolders:false,decodeFileName:Up.utf8decode}),Cf.isNode&&Cf.isStream(e)?ai.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):ta.prepareContent("the loaded zip file",e,true,t.optimizedBinaryString,t.base64).then(function(i){var n=new Hp(t);return n.load(i),n}).then(function(n){var a=[ai.Promise.resolve(n)],o=n.files;if(t.checkCRC32)for(var l=0;l<o.length;l++)a.push(Wp(o[l]));return ai.Promise.all(a)}).then(function(n){for(var a=n.shift(),o=a.files,l=0;l<o.length;l++){var u=o[l],s=u.fileNameStr,f=ta.resolve(u.fileNameStr);r.file(f,u.decompressed,{binary:true,optimizedBinaryString:true,date:u.date,dir:u.dir,comment:u.fileCommentStr.length?u.fileCommentStr:null,unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions,createFolders:t.createFolders}),u.dir||(r.file(f).unsafeOriginalName=s);}return a.zipComment.length&&(r.comment=a.zipComment),r})};});var Df=v((C0,Of)=>{function ie(){if(!(this instanceof ie))return new ie;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new ie;for(var t in this)typeof this[t]!="function"&&(e[t]=this[t]);return e};}ie.prototype=af();ie.prototype.loadAsync=Rf();ie.support=we();ie.defaults=Gi();ie.version="3.10.1";ie.loadAsync=function(e,t){return new ie().loadAsync(e,t)};ie.external=ft();Of.exports=ie;});var Lf={};Wf(Lf,{unpackJdfxToDocument:()=>Jp});async function Jp(e){let t=await If.default.loadAsync(e),r=t.file(fi);if(!r)throw new Error(`${fi} missing from .jdfx bundle`);let i=JSON.parse(await r.async("string")),n=t.file(ha),a=null;if(n)try{a=JSON.parse(await n.async("string"));}catch{a=null;}let o=new Map;if(a?.assets)for(let u of a.assets){let s=t.file(u.path);if(!s)continue;let f=await s.async("uint8array"),c=new Blob([f],{type:u.mimeType});o.set(u.id,URL.createObjectURL(c));}function l(u){if(u)for(let s of u){if(s?.type==="image"&&s.resource){let f=o.get(s.resource);f&&(s.src=f);}s?.elements&&l(s.elements),s?.children&&l(s.children);}}for(let u of i.pages||[])l(u.elements);return i}var If,zf=At(()=>{If=$f(Df());cr();});cr();cr();function pa(e){if(typeof e=="number")return `${e}px`;if(typeof e=="string")return e;let{top:t=0,right:r=0,bottom:i=0,left:n=0}=e;return `${t}px ${r}px ${i}px ${n}px`}function H(e){let t={};if(e.fontFamily&&(t["font-family"]=e.fontFamily),e.fontSize&&(t["font-size"]=`${e.fontSize*1.333}px`),e.fontWeight&&(t["font-weight"]=String(e.fontWeight)),e.fontStyle&&(t["font-style"]=e.fontStyle),e.color&&(t.color=e.color),e.backgroundColor&&(t["background-color"]=e.backgroundColor),e.textAlign&&(t["text-align"]=e.textAlign),e.textDecoration){let r=e.textDecoration==="strikethrough"?"line-through":e.textDecoration;t["text-decoration"]=r;}return e.lineHeight&&(t["line-height"]=String(e.lineHeight)),e.letterSpacing!=null&&(t["letter-spacing"]=typeof e.letterSpacing=="number"?`${e.letterSpacing}px`:e.letterSpacing),e.padding!=null&&(t.padding=pa(e.padding)),e.margin!=null&&(t.margin=pa(e.margin)),e.marginTop!=null&&(t["margin-top"]=`${e.marginTop}px`),e.marginBottom!=null&&(t["margin-bottom"]=`${e.marginBottom}px`),e.border&&(t.border=e.border),e.borderRadius!=null&&(t["border-radius"]=typeof e.borderRadius=="number"?`${e.borderRadius}px`:e.borderRadius),e.opacity!=null&&(t.opacity=String(e.opacity)),t}function fe(e,t){if(!e)return {};if(typeof e=="string")return H(t[e]||{});if(Array.isArray(e)){let r={};for(let i of e)r={...r,...t[i]||{}};return H(r)}return H(e)}function Q(e,t){for(let[r,i]of Object.entries(t))e.style.setProperty(r,i);}function ui(e){if(!e)return null;let t=typeof e=="string"?e:e.target;if(typeof e=="string"?e.startsWith("#"):e.type==="internal"){let i=t.replace(/^#/,"").match(/^page-(\d+)$/i);return i?{href:t,internal:true,pageIndex:Number(i[1])-1}:{href:t,internal:true}}return {href:t,internal:false}}function di(e,t,r){e.href=t.href,t.internal?e.addEventListener("click",i=>{t.pageIndex!=null&&r&&(i.preventDefault(),r(t.pageIndex));}):(e.target="_blank",e.rel="noopener noreferrer");}var et="http://www.w3.org/2000/svg";function pr(e,t){let r=document.createElement("div");Kf(r,e);let i=null;switch(e.type){case "text":i=Gf(e,t);break;case "richtext":i=eu(e,t);break;case "image":i=au(e,t);break;case "table":i=lu(e,t);break;case "list":i=fu(e,t);break;case "shape":i=uu(e);break;case "collapsible":i=du(e,t);break;case "toc":i=hu(e,t);break}return i?(r.appendChild(i),r):null}function Kf(e,t){let r=t;r.position&&(e.style.position="absolute",r.position.x!=null&&(e.style.left=`${B(r.position.x)}px`),r.position.y!=null&&(e.style.top=`${B(r.position.y)}px`)),r.width!=null&&(e.style.width=`${B(r.width)}px`),r.height!=null&&(e.style.height=`${B(r.height)}px`);}function Gf(e,t){let r=Qf(e.heading),i=document.createElement(r);i.className="jdfjs-text",i.style.margin="0",i.style.whiteSpace="pre-wrap",Q(i,fe(e.style,t.styles)),e.align&&(i.style.textAlign=e.align);let n=ui(e.link);if(n){let a=document.createElement("a");di(a,n,t.onNavigatePage),a.className="jdfjs-link",a.textContent=e.content||"",i.appendChild(a);}else i.textContent=e.content||"";return i}function Qf(e){return e===true?"h1":typeof e=="number"&&e>=1&&e<=6?"h"+e:"p"}function eu(e,t){let r=document.createElement("p");r.className="jdfjs-richtext",r.style.margin="0",Q(r,fe(e.style,t.styles));for(let i of e.runs||[])r.appendChild(ru(i,t));return r}function tu(e,t){let r={};if(e.style)if(typeof e.style=="string")Object.assign(r,H(t[e.style]||{}));else if(Array.isArray(e.style))for(let n of e.style)Object.assign(r,H(t[n]||{}));else Object.assign(r,H(e.style));e.bold&&(r["font-weight"]="bold"),e.italic&&(r["font-style"]="italic");let i=[];return e.underline&&i.push("underline"),e.strikethrough&&i.push("line-through"),i.length&&(r["text-decoration"]=i.join(" ")),e.color&&(r.color=e.color),e.fontSize&&(r["font-size"]=`${e.fontSize*1.333}px`),e.fontFamily&&(r["font-family"]=e.fontFamily),r}function ru(e,t){let r=ui(e.link),i=r?document.createElement("a"):document.createElement("span");return r&&(di(i,r,t.onNavigatePage),i.classList.add("jdfjs-link")),Q(i,tu(e,t.styles)),i.textContent=e.text,i}function iu(e,t){if(!e)return;let r=e[t];if(r&&typeof r=="object"&&"data"in r)return r;let i=e.images?.[t];if(i)return i}function nu(e,t){if(e.src?.startsWith("data:")||e.src?.startsWith("http"))return e.src;if(e.resource){let r=iu(t,e.resource);if(r?.data){let i=r.mimeType||"image/png";return r.data.startsWith("data:")?r.data:`data:${i};base64,${r.data}`}if(r?.path)return r.path}return e.src||""}function au(e,t){let r=document.createElement("div");r.className="jdfjs-image",r.style.width="100%",r.style.height="100%";let i=document.createElement("img");switch(i.src=nu(e,t.resources),i.alt=e.alt||"",i.style.display="block",i.style.width="100%",i.style.height="100%",e.fit){case "cover":i.style.objectFit="cover";break;case "fill":i.style.objectFit="fill";break;case "none":i.style.objectFit="none";break;default:i.style.objectFit="contain";}return Q(i,fe(e.style,t.styles)),r.appendChild(i),r}function ou(e){return typeof e=="string"?e:e.content}function su(e){return typeof e=="string"?{}:{colspan:e.colspan,rowspan:e.rowspan}}function lu(e,t){let r=document.createElement("div");r.className="jdfjs-table-wrap",Q(r,fe(e.style,t.styles)),r.style.overflowX="auto";let i=(()=>{let c=e.headerStyle;if(!c)return {};if(typeof c=="string")return H(t.styles[c]||{});if(Array.isArray(c)){let d={};for(let h of c)d={...d,...H(t.styles[h]||{})};return d}return H(c)})(),n=(()=>{let c=e.rowStyle;if(!c)return {};if(typeof c=="string")return H(t.styles[c]||{});if(Array.isArray(c)){let d={};for(let h of c)d={...d,...H(t.styles[h]||{})};return d}return H(c)})(),a=(()=>{let c=e.alternateRowStyle;if(!c){let d=e.alternatingRowColor;return d?{"background-color":d}:{}}if(typeof c=="string")return H(t.styles[c]||{});if(Array.isArray(c)){let d={};for(let h of c)d={...d,...H(t.styles[h]||{})};return d}return H(c)})(),o=(()=>{let c=e.borders;return c===false?{outer:false,inner:false}:c===true||c===void 0?{outer:true,inner:true,color:"#e2e8f0",width:1}:{outer:true,inner:true,color:"#e2e8f0",width:1,...c}})(),l=e.headers??e.columns?.map(c=>c.header||"").filter(c=>c!==""),u=c=>e.columns?.[c]?.align,s=document.createElement("table");if(s.style.width="100%",s.style.borderCollapse="collapse",s.style.fontSize="14px",o.outer&&(s.style.border=`${o.width||1}px solid ${o.color||"#e2e8f0"}`),l&&l.length>0){let c=document.createElement("thead"),d=document.createElement("tr");Q(d,i),l.forEach((h,w)=>{let _=document.createElement("th");_.textContent=h,_.style.padding="8px 12px",_.style.fontWeight="600",_.style.background="#f8fafc",_.style.textAlign=u(w)||"left",o.inner&&(_.style.border=`${o.width||1}px solid ${o.color||"#e2e8f0"}`),d.appendChild(_);}),c.appendChild(d),s.appendChild(c);}let f=document.createElement("tbody");return e.rows.forEach((c,d)=>{let h=document.createElement("tr");Q(h,n),d%2===1&&Q(h,a),c.forEach((w,_)=>{let y=document.createElement("td");y.textContent=ou(w);let p=su(w);p.colspan&&(y.colSpan=p.colspan),p.rowspan&&(y.rowSpan=p.rowspan),y.style.padding="8px 12px",y.style.verticalAlign="top",y.style.textAlign=u(_)||"left",o.inner&&(y.style.border=`${o.width||1}px solid ${o.color||"#e2e8f0"}`),h.appendChild(y);}),f.appendChild(h);}),s.appendChild(f),r.appendChild(s),r}function fu(e,t){let r=document.createElement("div");r.className="jdfjs-list-wrap",Q(r,fe(e.style,t.styles));let i=e.listType??(e.ordered?"ordered":"unordered"),n=ga(i);return ma(n,e.items||[],i),r.appendChild(n),r}function ga(e){let t=document.createElement(e==="ordered"?"ol":"ul");return t.style.margin="0",t.style.paddingLeft="20px",t.style.listStyle=e==="ordered"?"decimal":"disc",t}function ma(e,t,r,i){for(let n of t){let a=document.createElement("li");if(a.style.fontSize="14px",a.style.lineHeight="1.6",a.appendChild(document.createTextNode(n.content)),n.children?.length){let o=n.listType||r,l=ga(o);l.style.marginTop="4px",ma(l,n.children,o),a.appendChild(l);}e.appendChild(a);}}function uu(e){let t=document.createElement("div");t.className="jdfjs-shape",t.style.width="100%",t.style.height="100%";let r=e.width??100,i=e.height??100,n=e.fill??"none",a=(()=>{let s=e.stroke;return typeof s=="string"?s:s?.color?s.color:"none"})(),o=(()=>{let s=e.stroke;return typeof s=="object"&&s?.width!=null?s.width:e.strokeWidth??0})(),l=document.createElementNS(et,"svg");l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("viewBox",`0 0 ${r} ${i}`),l.setAttribute("preserveAspectRatio","none"),l.style.display="block",l.style.overflow="visible";let u=null;switch(e.shape){case "rect":{let s=document.createElementNS(et,"rect");s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("width",String(r)),s.setAttribute("height",String(i)),e.borderRadius&&s.setAttribute("rx",String(e.borderRadius)),u=s;break}case "circle":{let s=document.createElementNS(et,"circle");s.setAttribute("cx",String(r/2)),s.setAttribute("cy",String(i/2)),s.setAttribute("r",String(Math.min(r,i)/2)),u=s;break}case "ellipse":{let s=document.createElementNS(et,"ellipse");s.setAttribute("cx",String(r/2)),s.setAttribute("cy",String(i/2)),s.setAttribute("rx",String(r/2)),s.setAttribute("ry",String(i/2)),u=s;break}case "line":{let s=document.createElementNS(et,"line");return s.setAttribute("x1","0"),s.setAttribute("y1","0"),s.setAttribute("x2",String(r)),s.setAttribute("y2",String(i)),s.setAttribute("stroke",a==="none"?n!=="none"?n:"currentColor":a),s.setAttribute("stroke-width",String(o||.3)),l.appendChild(s),t.appendChild(l),t}case "path":{let s=document.createElementNS(et,"path");s.setAttribute("d",e.path||""),s.setAttribute("fill-rule","evenodd"),u=s;break}}return u&&(u.setAttribute("fill",n),u.setAttribute("stroke",a),o&&u.setAttribute("stroke-width",String(o)),l.appendChild(u)),t.appendChild(l),t}function du(e,t){let r=document.createElement("div");r.className="jdfjs-collapsible",Q(r,fe(e.style,t.styles)),r.style.border="1px solid #e2e8f0",r.style.borderRadius="8px",r.style.overflow="hidden",r.style.background="#ffffff";let i=document.createElement("button");i.type="button",i.className="jdfjs-collapsible-header",i.style.width="100%",i.style.display="flex",i.style.alignItems="center",i.style.gap="8px",i.style.padding="10px 16px",i.style.fontSize="14px",i.style.fontWeight="500",i.style.background="#f8fafc",i.style.border="0",i.style.cursor="pointer",i.style.textAlign="left";let n=document.createElement("span");n.textContent="\u25B6",n.style.fontSize="10px",n.style.transition="transform 0.15s ease";let a=document.createElement("span");a.textContent=e.title||"Section",a.style.flex="1",i.appendChild(n),i.appendChild(a),r.appendChild(i);let o=document.createElement("div");o.className="jdfjs-collapsible-body",o.style.padding="12px 16px",o.style.position="relative";let l=e.expanded??false,u=()=>{o.style.display=l?"block":"none",n.style.transform=l?"rotate(90deg)":"rotate(0deg)";};u(),i.addEventListener("click",()=>{l=!l,u();});for(let s of e.elements||[]){let f=pr(s,{...t,path:[...t.path,"elements"]});f&&o.appendChild(f);}return r.appendChild(o),r}function hu(e,t){let r=document.createElement("div");r.className="jdfjs-toc",Q(r,fe(e.style,t.styles));let i=e.depth??6,n=[];t.document.pages.forEach((a,o)=>{for(let l of a.elements){if(l.type!=="text")continue;let u=l,s=u.tocEntry||(u.heading?u.content:null);if(!s)continue;let f=typeof u.tocLevel=="number"?u.tocLevel:typeof u.heading=="number"?u.heading:1;f>i||n.push({title:s,pageIndex:o,level:f});}});for(let a of n){let o=document.createElement("button");o.type="button",o.className="jdfjs-toc-entry",o.style.display="flex",o.style.alignItems="baseline",o.style.gap="8px",o.style.width="100%",o.style.background="transparent",o.style.border="0",o.style.borderBottom="1px dotted #e2e8f0",o.style.padding=`6px 8px 6px ${(a.level-1)*16+8}px`,o.style.cursor="pointer",o.style.fontSize="14px",o.style.color="#334155",o.style.textAlign="left";let l=document.createElement("span");l.textContent=a.title,l.style.flex="1";let u=document.createElement("span");u.style.flex="1",u.style.borderBottom="1px dotted #cbd5e1",u.style.alignSelf="end",u.style.marginBottom="4px";let s=document.createElement("span");s.textContent=String(a.pageIndex+1),s.style.fontFamily="JetBrains Mono, monospace",s.style.fontSize="12px",s.style.color="#94a3b8",s.style.flexShrink="0",o.appendChild(l),o.appendChild(u),o.appendChild(s),o.addEventListener("click",()=>t.onNavigatePage?.(a.pageIndex)),r.appendChild(o);}return r}function va(e,t){return e.replace(/\{\{pageNumber\}\}/g,String(t.pageNumber)).replace(/\{\{totalPages\}\}/g,String(t.totalPages)).replace(/\{\{title\}\}/g,t.title).replace(/\{\{author\}\}/g,t.author)}async function ra(e,t,r={}){let i=jf(e);i.classList.add("jdfjs-loading");try{let n=/\.jdfx(\?|#|$)/i.test(t),a=await fetch(t,{headers:n?{Accept:"application/jdf+zip,application/zip"}:{Accept:"application/json,application/jdf+json"}});if(!a.ok)throw new Error(`Failed to fetch ${t} (${a.status})`);let o;if(n){let{unpackJdfxToDocument:l}=await Promise.resolve().then(()=>(zf(),Lf));o=await l(await a.arrayBuffer());}else o=await a.json();if(!o?.$jdf)throw new Error("Not a valid JDF document (missing $jdf field)");return i.classList.remove("jdfjs-loading"),Nf(i,o,r)}catch(n){throw i.classList.remove("jdfjs-loading"),i.classList.add("jdfjs-error"),i.innerHTML=`<div class="jdfjs-error-msg">${$p(n.message)}</div>`,r.onError?.(n),n}}function Nf(e,t,r={}){let i=jf(e);return new oi(i,t,r).getInstance()}var oi=class{constructor(t,r,i={}){this.resizeObs=null;this.toolbarEl=null;this.sidebarEl=null;this.observer=null;this.container=t,this.doc=r,this.options={zoom:i.zoom??1,sidebar:i.sidebar??false,toolbar:i.toolbar??true,darkMode:i.darkMode??"auto",initialPage:i.initialPage??0,fit:i.fit??"manual",...i},this.zoom=this.options.zoom,this.currentPage=this.options.initialPage,this.applyContainerSize(),this.mount(),queueMicrotask(()=>this.options.onLoad?.(this.doc));}applyContainerSize(){let t=this.options.width,r=this.options.height;t!=null&&(this.container.style.width=typeof t=="number"?`${t}px`:t),r!=null&&(this.container.style.height=typeof r=="number"?`${r}px`:r);}mount(){this.container.innerHTML="",this.container.classList.add("jdfjs"),this.options.darkMode==="dark"?this.container.classList.add("jdfjs-dark"):this.options.darkMode==="auto"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches&&this.container.classList.add("jdfjs-dark"),this.root=document.createElement("div"),this.root.className="jdfjs-root",this.options.toolbar&&(this.toolbarEl=this.buildToolbar(),this.root.appendChild(this.toolbarEl));let t=document.createElement("div");t.className="jdfjs-body",this.options.sidebar&&(this.sidebarEl=this.buildSidebar(),t.appendChild(this.sidebarEl)),this.pagesEl=document.createElement("div"),this.pagesEl.className="jdfjs-pages",t.appendChild(this.pagesEl),this.root.appendChild(t),this.container.appendChild(this.root),this.renderAllPages(),this.setupScrollObserver(),this.setupResizeObserver(),this.applyFit(),this.currentPage>0&&this.scrollToPage(this.currentPage);}setupResizeObserver(){typeof ResizeObserver>"u"||(this.resizeObs?.disconnect(),this.resizeObs=new ResizeObserver(()=>this.applyFit()),this.resizeObs.observe(this.pagesEl));}applyFit(){if(this.options.fit==="manual")return;let t=this.pagesEl.querySelector(".jdfjs-page");if(!t)return;let r=parseFloat(t.style.width||"0"),i=parseFloat(t.style.minHeight||"0");if(!r||!i)return;let n=this.pagesEl.clientWidth-32,a=this.pagesEl.clientHeight-32;this.options.fit==="fit-width"?this.zoom=Math.max(.25,Math.min(3,n/r)):this.options.fit==="fit-page"&&(this.zoom=Math.max(.25,Math.min(3,Math.min(n/r,a/i)))),this.applyZoom(),this.updateIndicators();}buildToolbar(){let t=document.createElement("div");return t.className="jdfjs-toolbar",t.innerHTML=`
2
3
  <span class="jdfjs-title"></span>
3
4
  <div class="jdfjs-spacer"></div>
4
5
  <button class="jdfjs-btn" data-act="prev" title="Previous page">\u2039</button>
@@ -8,5 +9,5 @@ var Z={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:
8
9
  <button class="jdfjs-btn" data-act="zoom-out" title="Zoom out">\u2212</button>
9
10
  <span class="jdfjs-zoom-indicator"></span>
10
11
  <button class="jdfjs-btn" data-act="zoom-in" title="Zoom in">+</button>
11
- `,t.querySelector(".jdfjs-title").textContent=this.doc.meta?.title??"Document",this.updateIndicators(t),t.addEventListener("click",n=>{let r=n.target.closest("[data-act]");if(!r)return;let o=r.getAttribute("data-act");o==="prev"?this.goToPage(this.currentPage-1):o==="next"?this.goToPage(this.currentPage+1):o==="zoom-in"?this.setZoom(this.zoom+.1):o==="zoom-out"&&this.setZoom(this.zoom-.1);}),t}buildSidebar(){let t=document.createElement("div");return t.className="jdfjs-sidebar",this.doc.pages.forEach((n,r)=>{let o=document.createElement("button");o.className="jdfjs-sidebar-thumb",o.setAttribute("data-page",String(r)),o.innerHTML=`<span class="jdfjs-sidebar-num">${r+1}</span>`,o.addEventListener("click",()=>this.goToPage(r)),t.appendChild(o);}),t}updateIndicators(t=this.toolbarEl){if(!t)return;let n=t.querySelector(".jdfjs-page-indicator");n&&(n.textContent=`${this.currentPage+1} / ${this.doc.pages.length}`);let r=t.querySelector(".jdfjs-zoom-indicator");r&&(r.textContent=`${Math.round(this.zoom*100)}%`),this.sidebarEl&&this.sidebarEl.querySelectorAll(".jdfjs-sidebar-thumb").forEach(o=>{let a=Number(o.getAttribute("data-page"));o.classList.toggle("jdfjs-sidebar-thumb-active",a===this.currentPage);});}renderAllPages(){this.pagesEl.innerHTML="";let t=this.doc.styles??{};this.doc.pages.forEach((n,r)=>{let o=this.renderPage(n,r,t);this.pagesEl.appendChild(o);}),this.applyZoom();}renderPage(t,n,r){let o=R(t.pageSize??this.doc.meta?.pageSize??"A4",t.pageOrientation??this.doc.meta?.pageOrientation??"portrait"),a={...N,...this.doc.meta?.margins||{},...t.margins||{}},s=document.createElement("div");s.className="jdfjs-page-wrapper",s.setAttribute("data-page-index",String(n));let d=document.createElement("div");d.className="jdfjs-page",d.style.width=`${f(o.width)}px`,d.style.minHeight=`${f(o.height)}px`,t.background&&(d.style.backgroundColor=t.background);let c=t.header??this.doc.header,i=t.footer??this.doc.footer,h=c?.height??0,l=i?.height??0;if(c){let u=this.renderHeaderFooter(c,n,this.doc.pages.length,r);u.classList.add("jdfjs-header"),u.style.paddingTop=`${f(a.top/2)}px`,u.style.paddingLeft=`${f(a.left)}px`,u.style.paddingRight=`${f(a.right)}px`,d.appendChild(u);}let p=document.createElement("div");if(p.className="jdfjs-page-content",p.style.position="absolute",p.style.top=`${f((a.top||0)+h)}px`,p.style.right=`${f(a.right||0)}px`,p.style.bottom=`${f((a.bottom||0)+l)}px`,p.style.left=`${f(a.left||0)}px`,t.elements.forEach((u,x)=>{let g=w(u,{styles:r,resources:this.doc.resources,document:this.doc,path:["pages",n,"elements",x],onNavigatePage:y=>this.goToPage(y)});g&&p.appendChild(g);}),d.appendChild(p),i){let u=this.renderHeaderFooter(i,n,this.doc.pages.length,r);u.classList.add("jdfjs-footer"),u.style.paddingBottom=`${f(a.bottom/2)}px`,u.style.paddingLeft=`${f(a.left)}px`,u.style.paddingRight=`${f(a.right)}px`,d.appendChild(u);}return s.appendChild(d),s}renderHeaderFooter(t,n,r,o){let a=document.createElement("div");if(t.elements?.length)t.elements.forEach((s,d)=>{let c=w(s,{styles:o,resources:this.doc.resources,document:this.doc,path:["__hf__",n,d],onNavigatePage:i=>this.goToPage(i)});c&&a.appendChild(c);});else if(t.content){let s=D(t.content,{pageNumber:n+1,totalPages:r,title:this.doc.meta?.title??"",author:this.doc.meta?.author??""}),d=document.createElement("div");d.textContent=s,Object.assign(d.style,E(t.style,o)),a.appendChild(d);}return a}setupScrollObserver(){typeof IntersectionObserver>"u"||(this.observer?.disconnect(),this.observer=new IntersectionObserver(t=>{let n=t.filter(r=>r.isIntersecting).sort((r,o)=>o.intersectionRatio-r.intersectionRatio);if(n[0]){let r=Number(n[0].target.getAttribute("data-page-index"));!isNaN(r)&&r!==this.currentPage&&(this.currentPage=r,this.updateIndicators(),this.options.onPageChange?.(r));}},{root:this.pagesEl,threshold:[.25,.5,.75]}),this.pagesEl.querySelectorAll("[data-page-index]").forEach(t=>this.observer.observe(t)));}scrollToPage(t){let n=this.pagesEl.querySelector(`[data-page-index="${t}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"start"});}applyZoom(){this.pagesEl.style.setProperty("--jdfjs-zoom",String(this.zoom)),this.pagesEl.querySelectorAll(".jdfjs-page").forEach(t=>{t.style.transform=`scale(${this.zoom})`,t.style.transformOrigin="top center";});}setZoom(t){this.zoom=Math.max(.25,Math.min(3,t)),this.applyZoom(),this.updateIndicators();}getZoom(){return this.zoom}goToPage(t){let n=Math.max(0,Math.min(this.doc.pages.length-1,t));this.currentPage=n,this.scrollToPage(n),this.updateIndicators(),this.options.onPageChange?.(n);}getCurrentPage(){return this.currentPage}setDocument(t){if(this.doc=t,this.currentPage=0,this.toolbarEl){let n=this.toolbarEl.querySelector(".jdfjs-title");n&&(n.textContent=t.meta?.title??"Document");}this.sidebarEl&&(this.sidebarEl.innerHTML="",this.buildSidebar().querySelectorAll(".jdfjs-sidebar-thumb").forEach(r=>this.sidebarEl.appendChild(r))),this.renderAllPages(),this.setupScrollObserver(),this.options.onLoad?.(t);}destroy(){this.observer?.disconnect(),this.resizeObs?.disconnect(),this.container.innerHTML="",this.container.classList.remove("jdfjs","jdfjs-dark","jdfjs-loading","jdfjs-error"),this.container.style.removeProperty("width"),this.container.style.removeProperty("height");}getInstance(){return {container:this.container,document:this.doc,setZoom:t=>this.setZoom(t),getZoom:()=>this.getZoom(),goToPage:t=>this.goToPage(t),getCurrentPage:()=>this.getCurrentPage(),setDocument:t=>this.setDocument(t),destroy:()=>this.destroy()}}};function O(e){if(typeof e=="string"){let t=document.querySelector(e);if(!t)throw new Error(`jdfjs: container "${e}" not found`);return t}return e}function le(e){return e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}var M=new WeakSet;function de(e){let t={},n=l=>e.getAttribute(l),r=n("zoom");if(r!=null){let l=Number(r);isNaN(l)||(t.zoom=l);}let o=n("sidebar");o!=null&&(t.sidebar=o!=="false"&&o!=="0");let a=n("toolbar");a!=null&&(t.toolbar=a!=="false"&&a!=="0");let s=n("dark-mode")||n("darkmode");(s==="auto"||s==="light"||s==="dark")&&(t.darkMode=s);let d=n("page");if(d!=null){let l=Number(d);isNaN(l)||(t.initialPage=l);}let c=n("width");if(c!=null){let l=Number(c);t.width=isNaN(l)?c:l;}let i=n("height");if(i!=null){let l=Number(i);t.height=isNaN(l)?i:l;}let h=n("fit");return (h==="manual"||h==="fit-width"||h==="fit-page")&&(t.fit=h),t}function A(e){if(M.has(e)||e.hasAttribute("manual"))return;let t=e.getAttribute("src");if(!t)return;M.add(e);let n=e;V(n);let r=de(e);k(n,t,r).catch(o=>{console.error("[jdf.js] failed to embed",t,o),n.dispatchEvent(new CustomEvent("jdf-error",{detail:o,bubbles:true}));}),ce(n);}function V(e){let t=e.getAttribute("width");if(t!=null){let r=Number(t);e.style.width=isNaN(r)?t:`${r}px`;}let n=e.getAttribute("height");if(n!=null){let r=Number(n);e.style.height=isNaN(r)?n:`${r}px`;}}var F=new WeakSet;function ce(e){if(F.has(e)||typeof MutationObserver>"u")return;F.add(e),new MutationObserver(n=>{for(let r of n){if(r.type!=="attributes"||!r.attributeName)continue;let o=r.attributeName;o==="src"?(M.delete(e),A(e)):(o==="width"||o==="height")&&V(e);}}).observe(e,{attributes:true,attributeFilter:["src","width","height"]});}function T(e=document){e.querySelectorAll("jdf").forEach(A);}function J(){if(typeof MutationObserver>"u")return;new MutationObserver(t=>{for(let n of t)n.addedNodes.forEach(r=>{r instanceof Element&&(r.tagName.toLowerCase()==="jdf"?A(r):T(r));});}).observe(document.body,{childList:true,subtree:true});}function pe(e=document){T(e);}function ue(){typeof window>"u"||typeof document>"u"||window.JDFjsAutoInit!==false&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{T(),J();},{once:true}):(T(),J()));}ue();export{S as JDFViewer,k as embed,pe as jdf,I as render};//# sourceMappingURL=jdfjs.js.map
12
+ `,t.querySelector(".jdfjs-title").textContent=this.doc.meta?.title??"Document",this.updateIndicators(t),t.addEventListener("click",r=>{let i=r.target.closest("[data-act]");if(!i)return;let n=i.getAttribute("data-act");n==="prev"?this.goToPage(this.currentPage-1):n==="next"?this.goToPage(this.currentPage+1):n==="zoom-in"?this.setZoom(this.zoom+.1):n==="zoom-out"&&this.setZoom(this.zoom-.1);}),t}buildSidebar(){let t=document.createElement("div");return t.className="jdfjs-sidebar",this.doc.pages.forEach((r,i)=>{let n=document.createElement("button");n.className="jdfjs-sidebar-thumb",n.setAttribute("data-page",String(i)),n.innerHTML=`<span class="jdfjs-sidebar-num">${i+1}</span>`,n.addEventListener("click",()=>this.goToPage(i)),t.appendChild(n);}),t}updateIndicators(t=this.toolbarEl){if(!t)return;let r=t.querySelector(".jdfjs-page-indicator");r&&(r.textContent=`${this.currentPage+1} / ${this.doc.pages.length}`);let i=t.querySelector(".jdfjs-zoom-indicator");i&&(i.textContent=`${Math.round(this.zoom*100)}%`),this.sidebarEl&&this.sidebarEl.querySelectorAll(".jdfjs-sidebar-thumb").forEach(n=>{let a=Number(n.getAttribute("data-page"));n.classList.toggle("jdfjs-sidebar-thumb-active",a===this.currentPage);});}renderAllPages(){this.pagesEl.innerHTML="";let t=this.doc.styles??{};this.doc.pages.forEach((r,i)=>{let n=this.renderPage(r,i,t);this.pagesEl.appendChild(n);}),this.applyZoom();}renderPage(t,r,i){let n=ua(t.pageSize??this.doc.meta?.pageSize??"A4",t.pageOrientation??this.doc.meta?.pageOrientation??"portrait"),a={...fa,...this.doc.meta?.margins||{},...t.margins||{}},o=document.createElement("div");o.className="jdfjs-page-wrapper",o.setAttribute("data-page-index",String(r));let l=document.createElement("div");l.className="jdfjs-page",l.style.width=`${B(n.width)}px`,l.style.minHeight=`${B(n.height)}px`,t.background&&(l.style.backgroundColor=t.background);let u=t.header??this.doc.header,s=t.footer??this.doc.footer,f=u?.height??0,c=s?.height??0;if(u){let h=this.renderHeaderFooter(u,r,this.doc.pages.length,i);h.classList.add("jdfjs-header"),h.style.paddingTop=`${B(a.top/2)}px`,h.style.paddingLeft=`${B(a.left)}px`,h.style.paddingRight=`${B(a.right)}px`,l.appendChild(h);}let d=document.createElement("div");if(d.className="jdfjs-page-content",d.style.position="absolute",d.style.top=`${B((a.top||0)+f)}px`,d.style.right=`${B(a.right||0)}px`,d.style.bottom=`${B((a.bottom||0)+c)}px`,d.style.left=`${B(a.left||0)}px`,t.elements.forEach((h,w)=>{let _=pr(h,{styles:i,resources:this.doc.resources,document:this.doc,path:["pages",r,"elements",w],onNavigatePage:y=>this.goToPage(y)});_&&d.appendChild(_);}),l.appendChild(d),s){let h=this.renderHeaderFooter(s,r,this.doc.pages.length,i);h.classList.add("jdfjs-footer"),h.style.paddingBottom=`${B(a.bottom/2)}px`,h.style.paddingLeft=`${B(a.left)}px`,h.style.paddingRight=`${B(a.right)}px`,l.appendChild(h);}return o.appendChild(l),o}renderHeaderFooter(t,r,i,n){let a=document.createElement("div");if(t.elements?.length)t.elements.forEach((o,l)=>{let u=pr(o,{styles:n,resources:this.doc.resources,document:this.doc,path:["__hf__",r,l],onNavigatePage:s=>this.goToPage(s)});u&&a.appendChild(u);});else if(t.content){let o=va(t.content,{pageNumber:r+1,totalPages:i,title:this.doc.meta?.title??"",author:this.doc.meta?.author??""}),l=document.createElement("div");l.textContent=o,Object.assign(l.style,fe(t.style,n)),a.appendChild(l);}return a}setupScrollObserver(){typeof IntersectionObserver>"u"||(this.observer?.disconnect(),this.observer=new IntersectionObserver(t=>{let r=t.filter(i=>i.isIntersecting).sort((i,n)=>n.intersectionRatio-i.intersectionRatio);if(r[0]){let i=Number(r[0].target.getAttribute("data-page-index"));!isNaN(i)&&i!==this.currentPage&&(this.currentPage=i,this.updateIndicators(),this.options.onPageChange?.(i));}},{root:this.pagesEl,threshold:[.25,.5,.75]}),this.pagesEl.querySelectorAll("[data-page-index]").forEach(t=>this.observer.observe(t)));}scrollToPage(t){let r=this.pagesEl.querySelector(`[data-page-index="${t}"]`);r&&r.scrollIntoView({behavior:"smooth",block:"start"});}applyZoom(){this.pagesEl.style.setProperty("--jdfjs-zoom",String(this.zoom)),this.pagesEl.querySelectorAll(".jdfjs-page").forEach(t=>{t.style.transform=`scale(${this.zoom})`,t.style.transformOrigin="top center";});}setZoom(t){this.zoom=Math.max(.25,Math.min(3,t)),this.applyZoom(),this.updateIndicators();}getZoom(){return this.zoom}goToPage(t){let r=Math.max(0,Math.min(this.doc.pages.length-1,t));this.currentPage=r,this.scrollToPage(r),this.updateIndicators(),this.options.onPageChange?.(r);}getCurrentPage(){return this.currentPage}setDocument(t){if(this.doc=t,this.currentPage=0,this.toolbarEl){let r=this.toolbarEl.querySelector(".jdfjs-title");r&&(r.textContent=t.meta?.title??"Document");}this.sidebarEl&&(this.sidebarEl.innerHTML="",this.buildSidebar().querySelectorAll(".jdfjs-sidebar-thumb").forEach(i=>this.sidebarEl.appendChild(i))),this.renderAllPages(),this.setupScrollObserver(),this.options.onLoad?.(t);}destroy(){this.observer?.disconnect(),this.resizeObs?.disconnect(),this.container.innerHTML="",this.container.classList.remove("jdfjs","jdfjs-dark","jdfjs-loading","jdfjs-error"),this.container.style.removeProperty("width"),this.container.style.removeProperty("height");}getInstance(){return {container:this.container,document:this.doc,setZoom:t=>this.setZoom(t),getZoom:()=>this.getZoom(),goToPage:t=>this.goToPage(t),getCurrentPage:()=>this.getCurrentPage(),setDocument:t=>this.setDocument(t),destroy:()=>this.destroy()}}};function jf(e){if(typeof e=="string"){let t=document.querySelector(e);if(!t)throw new Error(`jdfjs: container "${e}" not found`);return t}return e}function $p(e){return e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}var ia=new WeakSet;function Xp(e){let t={},r=c=>e.getAttribute(c),i=r("zoom");if(i!=null){let c=Number(i);isNaN(c)||(t.zoom=c);}let n=r("sidebar");n!=null&&(t.sidebar=n!=="false"&&n!=="0");let a=r("toolbar");a!=null&&(t.toolbar=a!=="false"&&a!=="0");let o=r("dark-mode")||r("darkmode");(o==="auto"||o==="light"||o==="dark")&&(t.darkMode=o);let l=r("page");if(l!=null){let c=Number(l);isNaN(c)||(t.initialPage=c);}let u=r("width");if(u!=null){let c=Number(u);t.width=isNaN(c)?u:c;}let s=r("height");if(s!=null){let c=Number(s);t.height=isNaN(c)?s:c;}let f=r("fit");return (f==="manual"||f==="fit-width"||f==="fit-page")&&(t.fit=f),t}function na(e){if(ia.has(e)||e.hasAttribute("manual"))return;let t=e.getAttribute("src");if(!t)return;ia.add(e);let r=e;Pf(r);let i=Xp(e);ra(r,t,i).catch(n=>{console.error("[jdf.js] failed to embed",t,n),r.dispatchEvent(new CustomEvent("jdf-error",{detail:n,bubbles:true}));}),Vp(r);}function Pf(e){let t=e.getAttribute("width");if(t!=null){let i=Number(t);e.style.width=isNaN(i)?t:`${i}px`;}let r=e.getAttribute("height");if(r!=null){let i=Number(r);e.style.height=isNaN(i)?r:`${i}px`;}}var Ff=new WeakSet;function Vp(e){if(Ff.has(e)||typeof MutationObserver>"u")return;Ff.add(e),new MutationObserver(r=>{for(let i of r){if(i.type!=="attributes"||!i.attributeName)continue;let n=i.attributeName;n==="src"?(ia.delete(e),na(e)):(n==="width"||n==="height")&&Pf(e);}}).observe(e,{attributes:true,attributeFilter:["src","width","height"]});}function si(e=document){e.querySelectorAll("jdf").forEach(na);}function Mf(){if(typeof MutationObserver>"u")return;new MutationObserver(t=>{for(let r of t)r.addedNodes.forEach(i=>{i instanceof Element&&(i.tagName.toLowerCase()==="jdf"?na(i):si(i));});}).observe(document.body,{childList:true,subtree:true});}function Yp(e=document){si(e);}function Kp(){typeof window>"u"||typeof document>"u"||window.JDFjsAutoInit!==false&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{si(),Mf();},{once:true}):(si(),Mf()));}Kp();export{oi as JDFViewer,ra as embed,Yp as jdf,Nf as render};//# sourceMappingURL=jdfjs.js.map
12
13
  //# sourceMappingURL=jdfjs.js.map