neozipkit 1.0.2 → 1.0.5

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.
Files changed (76) hide show
  1. package/NEOZIP_APPNOTE.md +527 -0
  2. package/README.md +8 -5
  3. package/WHATS_NEW.md +42 -10
  4. package/dist/browser/ZipkitBrowser.d.ts.map +1 -1
  5. package/dist/browser/ZipkitBrowser.js +4 -6
  6. package/dist/browser/ZipkitBrowser.js.map +1 -1
  7. package/dist/browser-esm/index.js +424 -82
  8. package/dist/browser-esm/index.js.map +4 -4
  9. package/dist/browser-umd/index.js +424 -82
  10. package/dist/browser-umd/index.js.map +4 -4
  11. package/dist/browser-umd/index.min.js +3 -3
  12. package/dist/core/ZipCompress.d.ts.map +1 -1
  13. package/dist/core/ZipCompress.js +12 -11
  14. package/dist/core/ZipCompress.js.map +1 -1
  15. package/dist/core/ZipDecompress.d.ts.map +1 -1
  16. package/dist/core/ZipDecompress.js +13 -8
  17. package/dist/core/ZipDecompress.js.map +1 -1
  18. package/dist/core/ZipEntry.d.ts +6 -0
  19. package/dist/core/ZipEntry.d.ts.map +1 -1
  20. package/dist/core/ZipEntry.js +7 -1
  21. package/dist/core/ZipEntry.js.map +1 -1
  22. package/dist/core/Zipkit.d.ts +43 -11
  23. package/dist/core/Zipkit.d.ts.map +1 -1
  24. package/dist/core/Zipkit.js +106 -63
  25. package/dist/core/Zipkit.js.map +1 -1
  26. package/dist/core/components/HashCalculator.d.ts +22 -1
  27. package/dist/core/components/HashCalculator.d.ts.map +1 -1
  28. package/dist/core/components/HashCalculator.js +49 -6
  29. package/dist/core/components/HashCalculator.js.map +1 -1
  30. package/dist/core/components/Util.d.ts +3 -4
  31. package/dist/core/components/Util.d.ts.map +1 -1
  32. package/dist/core/components/Util.js +10 -8
  33. package/dist/core/components/Util.js.map +1 -1
  34. package/dist/core/constants/Headers.d.ts +1 -3
  35. package/dist/core/constants/Headers.d.ts.map +1 -1
  36. package/dist/core/constants/Headers.js +14 -5
  37. package/dist/core/constants/Headers.js.map +1 -1
  38. package/dist/core/constants/MetaPaths.d.ts +38 -0
  39. package/dist/core/constants/MetaPaths.d.ts.map +1 -0
  40. package/dist/core/constants/MetaPaths.js +79 -0
  41. package/dist/core/constants/MetaPaths.js.map +1 -0
  42. package/dist/core/index.d.ts +2 -0
  43. package/dist/core/index.d.ts.map +1 -1
  44. package/dist/core/index.js +14 -1
  45. package/dist/core/index.js.map +1 -1
  46. package/dist/core/merkle/MerkleRoot.d.ts +109 -0
  47. package/dist/core/merkle/MerkleRoot.d.ts.map +1 -0
  48. package/dist/core/merkle/MerkleRoot.js +275 -0
  49. package/dist/core/merkle/MerkleRoot.js.map +1 -0
  50. package/dist/core/version.js +1 -1
  51. package/dist/node/ZipCompressNode.d.ts.map +1 -1
  52. package/dist/node/ZipCompressNode.js +40 -49
  53. package/dist/node/ZipCompressNode.js.map +1 -1
  54. package/dist/node/ZipDecompressNode.d.ts.map +1 -1
  55. package/dist/node/ZipDecompressNode.js +17 -1
  56. package/dist/node/ZipDecompressNode.js.map +1 -1
  57. package/dist/node/ZipkitNode.d.ts +9 -0
  58. package/dist/node/ZipkitNode.d.ts.map +1 -1
  59. package/dist/node/ZipkitNode.js +67 -4
  60. package/dist/node/ZipkitNode.js.map +1 -1
  61. package/package.json +3 -2
  62. package/src/browser/ZipkitBrowser.ts +4 -6
  63. package/src/core/ZipCompress.ts +14 -13
  64. package/src/core/ZipDecompress.ts +14 -8
  65. package/src/core/ZipEntry.ts +8 -1
  66. package/src/core/Zipkit.ts +149 -76
  67. package/src/core/components/HashCalculator.ts +58 -6
  68. package/src/core/components/Util.ts +16 -7
  69. package/src/core/constants/Headers.ts +14 -4
  70. package/src/core/constants/MetaPaths.ts +86 -0
  71. package/src/core/index.ts +14 -0
  72. package/src/core/merkle/MerkleRoot.ts +312 -0
  73. package/src/core/version.ts +1 -1
  74. package/src/node/ZipCompressNode.ts +40 -49
  75. package/src/node/ZipDecompressNode.ts +13 -1
  76. package/src/node/ZipkitNode.ts +82 -4
@@ -3,9 +3,9 @@
3
3
  * Copyright (c) 2025 NeoWare, Inc. All rights reserved.
4
4
  * Licensed under MIT License
5
5
  */
6
- "use strict";var NeoZipKit=(()=>{var Wo=Object.create;var zt=Object.defineProperty;var qo=Object.getOwnPropertyDescriptor;var jo=Object.getOwnPropertyNames;var Jo=Object.getPrototypeOf,Qo=Object.prototype.hasOwnProperty;var Z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ea=(r,t)=>{for(var e in t)zt(r,e,{get:t[e],enumerable:!0})},Cn=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jo(t))!Qo.call(r,i)&&i!==e&&zt(r,i,{get:()=>t[i],enumerable:!(n=qo(t,i))||n.enumerable});return r};var ta=(r,t,e)=>(e=r!=null?Wo(Jo(r)):{},Cn(t||!r||!r.__esModule?zt(e,"default",{value:r,enumerable:!0}):e,r)),ra=r=>Cn(zt({},"__esModule",{value:!0}),r);var Un=Z(Ht=>{"use strict";Ht.byteLength=ia;Ht.toByteArray=aa;Ht.fromByteArray=la;var oe=[],W=[],na=typeof Uint8Array<"u"?Uint8Array:Array,Er="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(He=0,Ln=Er.length;He<Ln;++He)oe[He]=Er[He],W[Er.charCodeAt(He)]=He;var He,Ln;W[45]=62;W[95]=63;function Rn(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function ia(r){var t=Rn(r),e=t[0],n=t[1];return(e+n)*3/4-n}function oa(r,t,e){return(t+e)*3/4-e}function aa(r){var t,e=Rn(r),n=e[0],i=e[1],o=new na(oa(r,n,i)),a=0,s=i>0?n-4:n,c;for(c=0;c<s;c+=4)t=W[r.charCodeAt(c)]<<18|W[r.charCodeAt(c+1)]<<12|W[r.charCodeAt(c+2)]<<6|W[r.charCodeAt(c+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return i===2&&(t=W[r.charCodeAt(c)]<<2|W[r.charCodeAt(c+1)]>>4,o[a++]=t&255),i===1&&(t=W[r.charCodeAt(c)]<<10|W[r.charCodeAt(c+1)]<<4|W[r.charCodeAt(c+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}function sa(r){return oe[r>>18&63]+oe[r>>12&63]+oe[r>>6&63]+oe[r&63]}function fa(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(sa(n));return i.join("")}function la(r){for(var t,e=r.length,n=e%3,i=[],o=16383,a=0,s=e-n;a<s;a+=o)i.push(fa(r,a,a+o>s?s:a+o));return n===1?(t=r[e-1],i.push(oe[t>>2]+oe[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],i.push(oe[t>>10]+oe[t>>4&63]+oe[t<<2&63]+"=")),i.join("")}});var Nn=Z(xr=>{xr.read=function(r,t,e,n,i){var o,a,s=i*8-n-1,c=(1<<s)-1,f=c>>1,l=-7,d=e?i-1:0,h=e?-1:1,u=r[t+d];for(d+=h,o=u&(1<<-l)-1,u>>=-l,l+=s;l>0;o=o*256+r[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=a*256+r[t+d],d+=h,l-=8);if(o===0)o=1-f;else{if(o===c)return a?NaN:(u?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(u?-1:1)*a*Math.pow(2,o-n)};xr.write=function(r,t,e,n,i,o){var a,s,c,f=o*8-i-1,l=(1<<f)-1,d=l>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,u=n?0:o-1,E=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+d>=1?t+=h/c:t+=h*Math.pow(2,1-d),t*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a=a+d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;r[e+u]=s&255,u+=E,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;r[e+u]=a&255,u+=E,a/=256,f-=8);r[e+u-E]|=_*128}});var qn=Z(nt=>{"use strict";var _r=Un(),tt=Nn(),kn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;nt.Buffer=m;nt.SlowBuffer=ma;nt.INSPECT_MAX_BYTES=50;var $t=2147483647;nt.kMaxLength=$t;m.TYPED_ARRAY_SUPPORT=ca();!m.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ca(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}});function Se(r){if(r>$t)throw new RangeError('The value "'+r+'" is invalid for option "size"');let t=new Uint8Array(r);return Object.setPrototypeOf(t,m.prototype),t}function m(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return wr(r)}return Pn(r,t,e)}m.poolSize=8192;function Pn(r,t,e){if(typeof r=="string")return ha(r,t);if(ArrayBuffer.isView(r))return da(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(ae(r,ArrayBuffer)||r&&ae(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ae(r,SharedArrayBuffer)||r&&ae(r.buffer,SharedArrayBuffer)))return yr(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return m.from(n,t,e);let i=pa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return m.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}m.from=function(r,t,e){return Pn(r,t,e)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function Mn(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function ua(r,t,e){return Mn(r),r<=0?Se(r):t!==void 0?typeof e=="string"?Se(r).fill(t,e):Se(r).fill(t):Se(r)}m.alloc=function(r,t,e){return ua(r,t,e)};function wr(r){return Mn(r),Se(r<0?0:Sr(r)|0)}m.allocUnsafe=function(r){return wr(r)};m.allocUnsafeSlow=function(r){return wr(r)};function ha(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=Zn(r,t)|0,n=Se(e),i=n.write(r,t);return i!==e&&(n=n.slice(0,i)),n}function gr(r){let t=r.length<0?0:Sr(r.length)|0,e=Se(t);for(let n=0;n<t;n+=1)e[n]=r[n]&255;return e}function da(r){if(ae(r,Uint8Array)){let t=new Uint8Array(r);return yr(t.buffer,t.byteOffset,t.byteLength)}return gr(r)}function yr(r,t,e){if(t<0||r.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&e===void 0?n=new Uint8Array(r):e===void 0?n=new Uint8Array(r,t):n=new Uint8Array(r,t,e),Object.setPrototypeOf(n,m.prototype),n}function pa(r){if(m.isBuffer(r)){let t=Sr(r.length)|0,e=Se(t);return e.length===0||r.copy(e,0,0,t),e}if(r.length!==void 0)return typeof r.length!="number"||Ir(r.length)?Se(0):gr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return gr(r.data)}function Sr(r){if(r>=$t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$t.toString(16)+" bytes");return r|0}function ma(r){return+r!=r&&(r=0),m.alloc(+r)}m.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==m.prototype};m.compare=function(t,e){if(ae(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),ae(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(t)||!m.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,i=e.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};m.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};m.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return m.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;let i=m.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){let a=t[n];if(ae(a,Uint8Array))o+a.length>i.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(m.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Zn(r,t){if(m.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||ae(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return br(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Wn(r).length;default:if(i)return n?-1:br(r).length;t=(""+t).toLowerCase(),i=!0}}m.byteLength=Zn;function Ea(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ba(this,t,e);case"utf8":case"utf-8":return Hn(this,t,e);case"ascii":return Aa(this,t,e);case"latin1":case"binary":return Ia(this,t,e);case"base64":return wa(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Da(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}m.prototype._isBuffer=!0;function $e(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}m.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)$e(this,e,e+1);return this};m.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)$e(this,e,e+3),$e(this,e+1,e+2);return this};m.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)$e(this,e,e+7),$e(this,e+1,e+6),$e(this,e+2,e+5),$e(this,e+3,e+4);return this};m.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?Hn(this,0,t):Ea.apply(this,arguments)};m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:m.compare(this,t)===0};m.prototype.inspect=function(){let t="",e=nt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"};kn&&(m.prototype[kn]=m.prototype.inspect);m.prototype.compare=function(t,e,n,i,o){if(ae(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let a=o-i,s=n-e,c=Math.min(a,s),f=this.slice(i,o),l=t.slice(e,n);for(let d=0;d<c;++d)if(f[d]!==l[d]){a=f[d],s=l[d];break}return a<s?-1:s<a?1:0};function zn(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Ir(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=m.from(t,n)),m.isBuffer(t))return t.length===0?-1:vn(r,t,e,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):vn(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function vn(r,t,e,n,i){let o=1,a=r.length,s=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,a/=2,s/=2,e/=2}function c(l,d){return o===1?l[d]:l.readUInt16BE(d*o)}let f;if(i){let l=-1;for(f=e;f<a;f++)if(c(r,f)===c(t,l===-1?0:f-l)){if(l===-1&&(l=f),f-l+1===s)return l*o}else l!==-1&&(f-=f-l),l=-1}else for(e+s>a&&(e=a-s),f=e;f>=0;f--){let l=!0;for(let d=0;d<s;d++)if(c(r,f+d)!==c(t,d)){l=!1;break}if(l)return f}return-1}m.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};m.prototype.indexOf=function(t,e,n){return zn(this,t,e,n,!0)};m.prototype.lastIndexOf=function(t,e,n){return zn(this,t,e,n,!1)};function xa(r,t,e,n){e=Number(e)||0;let i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let s=parseInt(t.substr(a*2,2),16);if(Ir(s))return a;r[e+a]=s}return a}function _a(r,t,e,n){return Yt(br(t,r.length-e),r,e,n)}function ga(r,t,e,n){return Yt(Ra(t),r,e,n)}function ya(r,t,e,n){return Yt(Wn(t),r,e,n)}function ba(r,t,e,n){return Yt(Ua(t,r.length-e),r,e,n)}m.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return xa(this,t,e,n);case"utf8":case"utf-8":return _a(this,t,e,n);case"ascii":case"latin1":case"binary":return ga(this,t,e,n);case"base64":return ya(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ba(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wa(r,t,e){return t===0&&e===r.length?_r.fromByteArray(r):_r.fromByteArray(r.slice(t,e))}function Hn(r,t,e){e=Math.min(r.length,e);let n=[],i=t;for(;i<e;){let o=r[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){let c,f,l,d;switch(s){case 1:o<128&&(a=o);break;case 2:c=r[i+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(a=d));break;case 3:c=r[i+1],f=r[i+2],(c&192)===128&&(f&192)===128&&(d=(o&15)<<12|(c&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:c=r[i+1],f=r[i+2],l=r[i+3],(c&192)===128&&(f&192)===128&&(l&192)===128&&(d=(o&15)<<18|(c&63)<<12|(f&63)<<6|l&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return Sa(n)}var On=4096;function Sa(r){let t=r.length;if(t<=On)return String.fromCharCode.apply(String,r);let e="",n=0;for(;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=On));return e}function Aa(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function Ia(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function Ba(r,t,e){let n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);let i="";for(let o=t;o<e;++o)i+=Na[r[o]];return i}function Da(r,t,e){let n=r.slice(t,e),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}m.prototype.slice=function(t,e){let n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,m.prototype),i};function z(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t],o=1,a=0;for(;++a<e&&(o*=256);)i+=this[t+a]*o;return i};m.prototype.readUintBE=m.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t+--e],o=1;for(;e>0&&(o*=256);)i+=this[t+--e]*o;return i};m.prototype.readUint8=m.prototype.readUInt8=function(t,e){return t=t>>>0,e||z(t,1,this.length),this[t]};m.prototype.readUint16LE=m.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||z(t,2,this.length),this[t]|this[t+1]<<8};m.prototype.readUint16BE=m.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||z(t,2,this.length),this[t]<<8|this[t+1]};m.prototype.readUint32LE=m.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};m.prototype.readUint32BE=m.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};m.prototype.readBigUInt64LE=De(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&_t(t,this.length-8);let i=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});m.prototype.readBigUInt64BE=De(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&_t(t,this.length-8);let i=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});m.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t],o=1,a=0;for(;++a<e&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};m.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=e,o=1,a=this[t+--i];for(;i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};m.prototype.readInt8=function(t,e){return t=t>>>0,e||z(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};m.prototype.readInt16LE=function(t,e){t=t>>>0,e||z(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};m.prototype.readInt16BE=function(t,e){t=t>>>0,e||z(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};m.prototype.readInt32LE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};m.prototype.readInt32BE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};m.prototype.readBigInt64LE=De(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&_t(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});m.prototype.readBigInt64BE=De(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&_t(t,this.length-8);let i=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});m.prototype.readFloatLE=function(t,e){return t=t>>>0,e||z(t,4,this.length),tt.read(this,t,!0,23,4)};m.prototype.readFloatBE=function(t,e){return t=t>>>0,e||z(t,4,this.length),tt.read(this,t,!1,23,4)};m.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||z(t,8,this.length),tt.read(this,t,!0,52,8)};m.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||z(t,8,this.length),tt.read(this,t,!1,52,8)};function V(r,t,e,n,i,o){if(!m.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;V(this,t,e,n,s,0)}let o=1,a=0;for(this[e]=t&255;++a<n&&(o*=256);)this[e+a]=t/o&255;return e+n};m.prototype.writeUintBE=m.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;V(this,t,e,n,s,0)}let o=n-1,a=1;for(this[e+o]=t&255;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+n};m.prototype.writeUint8=m.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,1,255,0),this[e]=t&255,e+1};m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function $n(r,t,e,n,i){Xn(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=a,a=a>>8,r[e++]=a,a=a>>8,r[e++]=a,a=a>>8,r[e++]=a,e}function Yn(r,t,e,n,i){Xn(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e+7]=o,o=o>>8,r[e+6]=o,o=o>>8,r[e+5]=o,o=o>>8,r[e+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=a,a=a>>8,r[e+2]=a,a=a>>8,r[e+1]=a,a=a>>8,r[e]=a,e+8}m.prototype.writeBigUInt64LE=De(function(t,e=0){return $n(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});m.prototype.writeBigUInt64BE=De(function(t,e=0){return Yn(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});m.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let c=Math.pow(2,8*n-1);V(this,t,e,n,c-1,-c)}let o=0,a=1,s=0;for(this[e]=t&255;++o<n&&(a*=256);)t<0&&s===0&&this[e+o-1]!==0&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n};m.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let c=Math.pow(2,8*n-1);V(this,t,e,n,c-1,-c)}let o=n-1,a=1,s=0;for(this[e+o]=t&255;--o>=0&&(a*=256);)t<0&&s===0&&this[e+o+1]!==0&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n};m.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};m.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};m.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};m.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};m.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};m.prototype.writeBigInt64LE=De(function(t,e=0){return $n(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});m.prototype.writeBigInt64BE=De(function(t,e=0){return Yn(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Vn(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Gn(r,t,e,n,i){return t=+t,e=e>>>0,i||Vn(r,t,e,4,34028234663852886e22,-34028234663852886e22),tt.write(r,t,e,n,23,4),e+4}m.prototype.writeFloatLE=function(t,e,n){return Gn(this,t,e,!0,n)};m.prototype.writeFloatBE=function(t,e,n){return Gn(this,t,e,!1,n)};function Kn(r,t,e,n,i){return t=+t,e=e>>>0,i||Vn(r,t,e,8,17976931348623157e292,-17976931348623157e292),tt.write(r,t,e,n,52,8),e+8}m.prototype.writeDoubleLE=function(t,e,n){return Kn(this,t,e,!0,n)};m.prototype.writeDoubleBE=function(t,e,n){return Kn(this,t,e,!1,n)};m.prototype.copy=function(t,e,n,i){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);let o=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),e),o};m.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!m.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let a=t.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{let a=m.isBuffer(t)?t:m.from(t,i),s=a.length;if(s===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var et={};function Ar(r,t,e){et[r]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}Ar("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ar("ERR_INVALID_ARG_TYPE",function(r,t){return`The "${r}" argument must be of type number. Received type ${typeof t}`},TypeError);Ar("ERR_OUT_OF_RANGE",function(r,t,e){let n=`The value of "${r}" is out of range.`,i=e;return Number.isInteger(e)&&Math.abs(e)>2**32?i=Fn(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=Fn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Fn(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function Ta(r,t,e){rt(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&_t(t,r.length-(e+1))}function Xn(r,t,e,n,i,o){if(r>e||r<t){let a=typeof t=="bigint"?"n":"",s;throw o>3?t===0||t===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${t}${a} and <= ${e}${a}`,new et.ERR_OUT_OF_RANGE("value",s,r)}Ta(n,i,o)}function rt(r,t){if(typeof r!="number")throw new et.ERR_INVALID_ARG_TYPE(t,"number",r)}function _t(r,t,e){throw Math.floor(r)!==r?(rt(r,e),new et.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new et.ERR_BUFFER_OUT_OF_BOUNDS:new et.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}var Ca=/[^+/0-9A-Za-z-_]/g;function La(r){if(r=r.split("=")[0],r=r.trim().replace(Ca,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function br(r,t){t=t||1/0;let e,n=r.length,i=null,o=[];for(let a=0;a<n;++a){if(e=r.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Ra(r){let t=[];for(let e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function Ua(r,t){let e,n,i,o=[];for(let a=0;a<r.length&&!((t-=2)<0);++a)e=r.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function Wn(r){return _r.toByteArray(La(r))}function Yt(r,t,e,n){let i;for(i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function ae(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function Ir(r){return r!==r}var Na=(function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let i=0;i<16;++i)t[n+i]=r[e]+r[i]}return t})();function De(r){return typeof BigInt>"u"?ka:r}function ka(){throw new Error("BigInt not supported")}});var Di=Z((Wl,ft)=>{"use strict";function st(r){let t=r.length;for(;--t>=0;)r[t]=0}var os=0,hi=1,as=2,ss=3,fs=258,Hr=29,Bt=256,wt=Bt+1+Hr,at=30,$r=19,di=2*wt+1,Ve=15,Or=16,ls=7,Yr=256,pi=16,mi=17,Ei=18,Zr=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),er=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),cs=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),xi=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),us=512,Ie=new Array((wt+2)*2);st(Ie);var bt=new Array(at*2);st(bt);var St=new Array(us);st(St);var At=new Array(fs-ss+1);st(At);var Vr=new Array(Hr);st(Vr);var tr=new Array(at);st(tr);function Fr(r,t,e,n,i){this.static_tree=r,this.extra_bits=t,this.extra_base=e,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}var _i,gi,yi;function Pr(r,t){this.dyn_tree=r,this.max_code=0,this.stat_desc=t}var bi=r=>r<256?St[r]:St[256+(r>>>7)],It=(r,t)=>{r.pending_buf[r.pending++]=t&255,r.pending_buf[r.pending++]=t>>>8&255},G=(r,t,e)=>{r.bi_valid>Or-e?(r.bi_buf|=t<<r.bi_valid&65535,It(r,r.bi_buf),r.bi_buf=t>>Or-r.bi_valid,r.bi_valid+=e-Or):(r.bi_buf|=t<<r.bi_valid&65535,r.bi_valid+=e)},pe=(r,t,e)=>{G(r,e[t*2],e[t*2+1])},wi=(r,t)=>{let e=0;do e|=r&1,r>>>=1,e<<=1;while(--t>0);return e>>>1},hs=r=>{r.bi_valid===16?(It(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},ds=(r,t)=>{let e=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,f,l,d,h,u,E,_=0;for(h=0;h<=Ve;h++)r.bl_count[h]=0;for(e[r.heap[r.heap_max]*2+1]=0,f=r.heap_max+1;f<di;f++)l=r.heap[f],h=e[e[l*2+1]*2+1]+1,h>c&&(h=c,_++),e[l*2+1]=h,!(l>n)&&(r.bl_count[h]++,u=0,l>=s&&(u=a[l-s]),E=e[l*2],r.opt_len+=E*(h+u),o&&(r.static_len+=E*(i[l*2+1]+u)));if(_!==0){do{for(h=c-1;r.bl_count[h]===0;)h--;r.bl_count[h]--,r.bl_count[h+1]+=2,r.bl_count[c]--,_-=2}while(_>0);for(h=c;h!==0;h--)for(l=r.bl_count[h];l!==0;)d=r.heap[--f],!(d>n)&&(e[d*2+1]!==h&&(r.opt_len+=(h-e[d*2+1])*e[d*2],e[d*2+1]=h),l--)}},Si=(r,t,e)=>{let n=new Array(Ve+1),i=0,o,a;for(o=1;o<=Ve;o++)i=i+e[o-1]<<1,n[o]=i;for(a=0;a<=t;a++){let s=r[a*2+1];s!==0&&(r[a*2]=wi(n[s]++,s))}},ps=()=>{let r,t,e,n,i,o=new Array(Ve+1);for(e=0,n=0;n<Hr-1;n++)for(Vr[n]=e,r=0;r<1<<Zr[n];r++)At[e++]=n;for(At[e-1]=n,i=0,n=0;n<16;n++)for(tr[n]=i,r=0;r<1<<er[n];r++)St[i++]=n;for(i>>=7;n<at;n++)for(tr[n]=i<<7,r=0;r<1<<er[n]-7;r++)St[256+i++]=n;for(t=0;t<=Ve;t++)o[t]=0;for(r=0;r<=143;)Ie[r*2+1]=8,r++,o[8]++;for(;r<=255;)Ie[r*2+1]=9,r++,o[9]++;for(;r<=279;)Ie[r*2+1]=7,r++,o[7]++;for(;r<=287;)Ie[r*2+1]=8,r++,o[8]++;for(Si(Ie,wt+1,o),r=0;r<at;r++)bt[r*2+1]=5,bt[r*2]=wi(r,5);_i=new Fr(Ie,Zr,Bt+1,wt,Ve),gi=new Fr(bt,er,0,at,Ve),yi=new Fr(new Array(0),cs,0,$r,ls)},Ai=r=>{let t;for(t=0;t<wt;t++)r.dyn_ltree[t*2]=0;for(t=0;t<at;t++)r.dyn_dtree[t*2]=0;for(t=0;t<$r;t++)r.bl_tree[t*2]=0;r.dyn_ltree[Yr*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},Ii=r=>{r.bi_valid>8?It(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},si=(r,t,e,n)=>{let i=t*2,o=e*2;return r[i]<r[o]||r[i]===r[o]&&n[t]<=n[e]},Mr=(r,t,e)=>{let n=r.heap[e],i=e<<1;for(;i<=r.heap_len&&(i<r.heap_len&&si(t,r.heap[i+1],r.heap[i],r.depth)&&i++,!si(t,n,r.heap[i],r.depth));)r.heap[e]=r.heap[i],e=i,i<<=1;r.heap[e]=n},fi=(r,t,e)=>{let n,i,o=0,a,s;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+o++]&255,n+=(r.pending_buf[r.sym_buf+o++]&255)<<8,i=r.pending_buf[r.sym_buf+o++],n===0?pe(r,i,t):(a=At[i],pe(r,a+Bt+1,t),s=Zr[a],s!==0&&(i-=Vr[a],G(r,i,s)),n--,a=bi(n),pe(r,a,e),s=er[a],s!==0&&(n-=tr[a],G(r,n,s)));while(o<r.sym_next);pe(r,Yr,t)},zr=(r,t)=>{let e=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,c=-1,f;for(r.heap_len=0,r.heap_max=di,a=0;a<o;a++)e[a*2]!==0?(r.heap[++r.heap_len]=c=a,r.depth[a]=0):e[a*2+1]=0;for(;r.heap_len<2;)f=r.heap[++r.heap_len]=c<2?++c:0,e[f*2]=1,r.depth[f]=0,r.opt_len--,i&&(r.static_len-=n[f*2+1]);for(t.max_code=c,a=r.heap_len>>1;a>=1;a--)Mr(r,e,a);f=o;do a=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Mr(r,e,1),s=r.heap[1],r.heap[--r.heap_max]=a,r.heap[--r.heap_max]=s,e[f*2]=e[a*2]+e[s*2],r.depth[f]=(r.depth[a]>=r.depth[s]?r.depth[a]:r.depth[s])+1,e[a*2+1]=e[s*2+1]=f,r.heap[1]=f++,Mr(r,e,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],ds(r,t),Si(e,c,r.bl_count)},li=(r,t,e)=>{let n,i=-1,o,a=t[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),t[(e+1)*2+1]=65535,n=0;n<=e;n++)o=a,a=t[(n+1)*2+1],!(++s<c&&o===a)&&(s<f?r.bl_tree[o*2]+=s:o!==0?(o!==i&&r.bl_tree[o*2]++,r.bl_tree[pi*2]++):s<=10?r.bl_tree[mi*2]++:r.bl_tree[Ei*2]++,s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4))},ci=(r,t,e)=>{let n,i=-1,o,a=t[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),n=0;n<=e;n++)if(o=a,a=t[(n+1)*2+1],!(++s<c&&o===a)){if(s<f)do pe(r,o,r.bl_tree);while(--s!==0);else o!==0?(o!==i&&(pe(r,o,r.bl_tree),s--),pe(r,pi,r.bl_tree),G(r,s-3,2)):s<=10?(pe(r,mi,r.bl_tree),G(r,s-3,3)):(pe(r,Ei,r.bl_tree),G(r,s-11,7));s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4)}},ms=r=>{let t;for(li(r,r.dyn_ltree,r.l_desc.max_code),li(r,r.dyn_dtree,r.d_desc.max_code),zr(r,r.bl_desc),t=$r-1;t>=3&&r.bl_tree[xi[t]*2+1]===0;t--);return r.opt_len+=3*(t+1)+5+5+4,t},Es=(r,t,e,n)=>{let i;for(G(r,t-257,5),G(r,e-1,5),G(r,n-4,4),i=0;i<n;i++)G(r,r.bl_tree[xi[i]*2+1],3);ci(r,r.dyn_ltree,t-1),ci(r,r.dyn_dtree,e-1)},xs=r=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&r.dyn_ltree[e*2]!==0)return 0;if(r.dyn_ltree[18]!==0||r.dyn_ltree[20]!==0||r.dyn_ltree[26]!==0)return 1;for(e=32;e<Bt;e++)if(r.dyn_ltree[e*2]!==0)return 1;return 0},ui=!1,_s=r=>{ui||(ps(),ui=!0),r.l_desc=new Pr(r.dyn_ltree,_i),r.d_desc=new Pr(r.dyn_dtree,gi),r.bl_desc=new Pr(r.bl_tree,yi),r.bi_buf=0,r.bi_valid=0,Ai(r)},Bi=(r,t,e,n)=>{G(r,(os<<1)+(n?1:0),3),Ii(r),It(r,e),It(r,~e),e&&r.pending_buf.set(r.window.subarray(t,t+e),r.pending),r.pending+=e},gs=r=>{G(r,hi<<1,3),pe(r,Yr,Ie),hs(r)},ys=(r,t,e,n)=>{let i,o,a=0;r.level>0?(r.strm.data_type===2&&(r.strm.data_type=xs(r)),zr(r,r.l_desc),zr(r,r.d_desc),a=ms(r),i=r.opt_len+3+7>>>3,o=r.static_len+3+7>>>3,o<=i&&(i=o)):i=o=e+5,e+4<=i&&t!==-1?Bi(r,t,e,n):r.strategy===4||o===i?(G(r,(hi<<1)+(n?1:0),3),fi(r,Ie,bt)):(G(r,(as<<1)+(n?1:0),3),Es(r,r.l_desc.max_code+1,r.d_desc.max_code+1,a+1),fi(r,r.dyn_ltree,r.dyn_dtree)),Ai(r),n&&Ii(r)},bs=(r,t,e)=>(r.pending_buf[r.sym_buf+r.sym_next++]=t,r.pending_buf[r.sym_buf+r.sym_next++]=t>>8,r.pending_buf[r.sym_buf+r.sym_next++]=e,t===0?r.dyn_ltree[e*2]++:(r.matches++,t--,r.dyn_ltree[(At[e]+Bt+1)*2]++,r.dyn_dtree[bi(t)*2]++),r.sym_next===r.sym_end);ft.exports._tr_init=_s;ft.exports._tr_stored_block=Bi;ft.exports._tr_flush_block=ys;ft.exports._tr_tally=bs;ft.exports._tr_align=gs});var Gr=Z((ql,Ti)=>{"use strict";var ws=(r,t,e,n)=>{let i=r&65535|0,o=r>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0};Ti.exports=ws});var Kr=Z((jl,Ci)=>{"use strict";var Ss=()=>{let r,t=[];for(var e=0;e<256;e++){r=e;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r}return t},As=new Uint32Array(Ss()),Is=(r,t,e,n)=>{let i=As,o=n+e;r^=-1;for(let a=n;a<o;a++)r=r>>>8^i[(r^t[a])&255];return r^-1};Ci.exports=Is});var rr=Z((Jl,Li)=>{"use strict";Li.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 ve=Z((Ql,Ri)=>{"use strict";Ri.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_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var zi=Z((ec,_e)=>{"use strict";var{_tr_init:Bs,_tr_stored_block:qr,_tr_flush_block:Ds,_tr_tally:Me,_tr_align:Ts}=Di(),vi=Gr(),Oe=Kr(),Cs=rr(),{Z_NO_FLUSH:Ze,Z_PARTIAL_FLUSH:Ls,Z_FULL_FLUSH:Rs,Z_FINISH:j,Z_BLOCK:Ui,Z_OK:$,Z_STREAM_END:Ni,Z_STREAM_ERROR:Ee,Z_DATA_ERROR:Us,Z_BUF_ERROR:Xr,Z_DEFAULT_COMPRESSION:Ns,Z_FILTERED:ks,Z_HUFFMAN_ONLY:nr,Z_RLE:vs,Z_FIXED:Os,Z_DEFAULT_STRATEGY:Fs,Z_UNKNOWN:Ps,Z_DEFLATED:ir}=ve(),Ms=9,Zs=15,zs=8,Hs=29,$s=256,jr=$s+1+Hs,Ys=30,Vs=19,Gs=2*jr+1,Ks=15,U=3,Pe=258,xe=Pe+U+1,Xs=32,ct=42,nn=57,Jr=69,Qr=73,en=91,tn=103,Ge=113,Tt=666,Y=1,ht=2,Xe=3,dt=4,Ws=3,Ke=(r,t)=>(r.msg=Cs[t],t),ki=r=>r*2-(r>4?9:0),Fe=r=>{let t=r.length;for(;--t>=0;)r[t]=0},qs=r=>{let t,e,n,i=r.w_size;t=r.hash_size,n=t;do e=r.head[--n],r.head[n]=e>=i?e-i:0;while(--t);t=i,n=t;do e=r.prev[--n],r.prev[n]=e>=i?e-i:0;while(--t)},on=(r,t,e)=>(t<<r.hash_shift^e)&r.hash_mask,We=(r,t)=>{let e;if(r.legacy_hash)e=r.ins_h=on(r,r.ins_h,r.window[t+U-1]);else{let i=r.window,o=i[t]|i[t+1]<<8|i[t+2]<<16|i[t+3]<<24;e=r.ins_h=Math.imul(o,66521)+66521>>>16&r.hash_mask}let n=r.prev[t&r.w_mask]=r.head[e];return r.head[e]=t,n},K=r=>{let t=r.state,e=t.pending;e>r.avail_out&&(e=r.avail_out),e!==0&&(r.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),r.next_out),r.next_out+=e,t.pending_out+=e,r.total_out+=e,r.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},X=(r,t)=>{Ds(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,t),r.block_start=r.strstart,K(r.strm)},N=(r,t)=>{r.pending_buf[r.pending++]=t},Dt=(r,t)=>{r.pending_buf[r.pending++]=t>>>8&255,r.pending_buf[r.pending++]=t&255},rn=(r,t,e,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,t.set(r.input.subarray(r.next_in,r.next_in+i),e),r.state.wrap===1?r.adler=vi(r.adler,t,i,e):r.state.wrap===2&&(r.adler=Oe(r.adler,t,i,e)),r.next_in+=i,r.total_in+=i,i)},Oi=(r,t)=>{let e=r.max_chain_length,n=r.strstart,i,o,a=r.prev_length,s=r.nice_match,c=r.strstart>r.w_size-xe?r.strstart-(r.w_size-xe):0,f=r.window,l=r.w_mask,d=r.prev,h=r.strstart+Pe,u=f[n+a-1],E=f[n+a];r.prev_length>=r.good_match&&(e>>=2),s>r.lookahead&&(s=r.lookahead);do if(i=t,!(f[i+a]!==E||f[i+a-1]!==u||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<h);if(o=Pe-(h-n),n=h-Pe,o>a){if(r.match_start=t,a=o,o>=s)break;u=f[n+a-1],E=f[n+a]}}while((t=d[t&l])>c&&--e!==0);return a<=r.lookahead?a:r.lookahead},ut=r=>{let t=r.w_size,e,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=t+(t-xe)&&(r.window.set(r.window.subarray(t,t+t-n),0),r.match_start-=t,r.strstart-=t,r.block_start-=t,r.insert>r.strstart&&(r.insert=r.strstart),qs(r),n+=t),r.strm.avail_in===0)break;if(e=rn(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=e,r.legacy_hash){if(r.lookahead+r.insert>=U)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=on(r,r.ins_h,r.window[i+1]);r.insert&&(We(r,i),i++,r.insert--,!(r.lookahead+r.insert<U)););}else if(r.lookahead+r.insert>U)for(i=r.strstart-r.insert;r.insert&&(We(r,i),i++,r.insert--,!(r.lookahead+r.insert<=U)););}while(r.lookahead<xe&&r.strm.avail_in!==0)},Fi=(r,t)=>{let e=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,o,a=0,s=r.strm.avail_in;do{if(n=65535,o=r.bi_valid+42>>3,r.strm.avail_out<o||(o=r.strm.avail_out-o,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>o&&(n=o),n<e&&(n===0&&t!==j||t===Ze||n!==i+r.strm.avail_in)))break;a=t===j&&n===i+r.strm.avail_in?1:0,qr(r,0,0,a),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,K(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(rn(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(a===0);return s-=r.strm.avail_in,s&&(s>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=s&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-s,r.strm.next_in),r.strstart),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),a?dt:t!==Ze&&t!==j&&r.strm.avail_in===0&&r.strstart===r.block_start?ht:(o=r.window_size-r.strstart,r.strm.avail_in>o&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,o+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),o>r.strm.avail_in&&(o=r.strm.avail_in),o&&(rn(r.strm,r.window,r.strstart,o),r.strstart+=o,r.insert+=o>r.w_size-r.insert?r.w_size-r.insert:o),r.high_water<r.strstart&&(r.high_water=r.strstart),o=r.bi_valid+42>>3,o=r.pending_buf_size-o>65535?65535:r.pending_buf_size-o,e=o>r.w_size?r.w_size:o,i=r.strstart-r.block_start,(i>=e||(i||t===j)&&t!==Ze&&r.strm.avail_in===0&&i<=o)&&(n=i>o?o:i,a=t===j&&r.strm.avail_in===0&&n===i?1:0,qr(r,r.block_start,n,a),r.block_start+=n,K(r.strm)),a?Xe:Y)},Wr=(r,t)=>{let e,n;for(;;){if(r.lookahead<xe){if(ut(r),r.lookahead<xe&&t===Ze)return Y;if(r.lookahead===0)break}if(e=0,r.lookahead>=U&&(e=We(r,r.strstart)),e!==0&&r.strstart-e<=r.w_size-xe&&(r.match_length=Oi(r,e)),r.match_length>=U)if(n=Me(r,r.strstart-r.match_start,r.match_length-U),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=U){r.match_length--;do r.strstart++,e=We(r,r.strstart);while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.legacy_hash&&(r.ins_h=r.window[r.strstart],r.ins_h=on(r,r.ins_h,r.window[r.strstart+1]));else n=Me(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(X(r,!1),r.strm.avail_out===0))return Y}return r.insert=r.strstart<U-1?r.strstart:U-1,t===j?(X(r,!0),r.strm.avail_out===0?Xe:dt):r.sym_next&&(X(r,!1),r.strm.avail_out===0)?Y:ht},lt=(r,t)=>{let e,n,i;for(;;){if(r.lookahead<xe){if(ut(r),r.lookahead<xe&&t===Ze)return Y;if(r.lookahead===0)break}if(e=0,r.lookahead>=U&&(e=We(r,r.strstart)),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=U-1,e!==0&&r.prev_length<r.max_lazy_match&&r.strstart-e<=r.w_size-xe&&(r.match_length=Oi(r,e),r.match_length<=5&&(r.strategy===ks||r.match_length===U&&r.strstart-r.match_start>4096)&&(r.match_length=U-1)),r.prev_length>=U&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-U,n=Me(r,r.strstart-1-r.prev_match,r.prev_length-U),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(e=We(r,r.strstart));while(--r.prev_length!==0);if(r.match_available=0,r.match_length=U-1,r.strstart++,n&&(X(r,!1),r.strm.avail_out===0))return Y}else if(r.match_available){if(n=Me(r,0,r.window[r.strstart-1]),n&&X(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return Y}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Me(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<U-1?r.strstart:U-1,t===j?(X(r,!0),r.strm.avail_out===0?Xe:dt):r.sym_next&&(X(r,!1),r.strm.avail_out===0)?Y:ht},js=(r,t)=>{let e,n,i,o,a=r.window;for(;;){if(r.lookahead<=Pe){if(ut(r),r.lookahead<=Pe&&t===Ze)return Y;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=U&&r.strstart>0&&(i=r.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=r.strstart+Pe;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);r.match_length=Pe-(o-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=U?(e=Me(r,1,r.match_length-U),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(e=Me(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),e&&(X(r,!1),r.strm.avail_out===0))return Y}return r.insert=0,t===j?(X(r,!0),r.strm.avail_out===0?Xe:dt):r.sym_next&&(X(r,!1),r.strm.avail_out===0)?Y:ht},Js=(r,t)=>{let e;for(;;){if(r.lookahead===0&&(ut(r),r.lookahead===0)){if(t===Ze)return Y;break}if(r.match_length=0,e=Me(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,e&&(X(r,!1),r.strm.avail_out===0))return Y}return r.insert=0,t===j?(X(r,!0),r.strm.avail_out===0?Xe:dt):r.sym_next&&(X(r,!1),r.strm.avail_out===0)?Y:ht};function me(r,t,e,n,i){this.good_length=r,this.max_lazy=t,this.nice_length=e,this.max_chain=n,this.func=i}var Ct=[new me(0,0,0,0,Fi),new me(4,4,8,4,Wr),new me(4,5,16,8,Wr),new me(4,6,32,32,Wr),new me(4,4,16,16,lt),new me(8,16,32,32,lt),new me(8,16,128,128,lt),new me(8,32,128,256,lt),new me(32,128,258,1024,lt),new me(32,258,258,4096,lt)],Qs=r=>{r.window_size=2*r.w_size,Fe(r.head),r.max_lazy_match=Ct[r.level].max_lazy,r.good_match=Ct[r.level].good_length,r.nice_match=Ct[r.level].nice_length,r.max_chain_length=Ct[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=U-1,r.match_available=0,r.ins_h=0};function ef(){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=ir,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.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Gs*2),this.dyn_dtree=new Uint16Array((2*Ys+1)*2),this.bl_tree=new Uint16Array((2*Vs+1)*2),Fe(this.dyn_ltree),Fe(this.dyn_dtree),Fe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Ks+1),this.heap=new Uint16Array(2*jr+1),Fe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*jr+1),Fe(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Lt=r=>{if(!r)return 1;let t=r.state;return!t||t.strm!==r||t.status!==ct&&t.status!==nn&&t.status!==Jr&&t.status!==Qr&&t.status!==en&&t.status!==tn&&t.status!==Ge&&t.status!==Tt?1:0},Pi=r=>{if(Lt(r))return Ke(r,Ee);r.total_in=r.total_out=0,r.data_type=Ps;let t=r.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?nn:t.wrap?ct:Ge,r.adler=t.wrap===2?0:1,t.last_flush=-2,Bs(t),$},Mi=r=>{let t=Pi(r);return t===$&&Qs(r.state),t},tf=(r,t)=>Lt(r)||r.state.wrap!==2?Ee:(r.state.gzhead=t,$),Zi=(r,t,e,n,i,o,a)=>{if(!r)return Ee;let s=1;if(t===Ns&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>Ms||e!==ir||n<8||n>15||t<0||t>9||o<0||o>Os||n===8&&s!==1)return Ke(r,Ee);n===8&&(n=9);let c=new ef;return r.state=c,c.strm=r,c.status=ct,c.wrap=s,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=a?1:0,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+U-1)/U),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=o,c.method=e,Mi(r)},rf=(r,t)=>Zi(r,t,ir,Zs,zs,Fs),nf=(r,t)=>{if(Lt(r)||t>Ui||t<0)return r?Ke(r,Ee):Ee;let e=r.state;if(!r.output||r.avail_in!==0&&!r.input||e.status===Tt&&t!==j)return Ke(r,r.avail_out===0?Xr:Ee);let n=e.last_flush;if(e.last_flush=t,e.pending!==0){if(K(r),r.avail_out===0)return e.last_flush=-1,$}else if(r.avail_in===0&&ki(t)<=ki(n)&&t!==j)return Ke(r,Xr);if(e.status===Tt&&r.avail_in!==0)return Ke(r,Xr);if(e.status===ct&&e.wrap===0&&(e.status=Ge),e.status===ct){let i=ir+(e.w_bits-8<<4)<<8,o=-1;if(e.strategy>=nr||e.level<2?o=0:e.level<6?o=1:e.level===6?o=2:o=3,i|=o<<6,e.strstart!==0&&(i|=Xs),i+=31-i%31,Dt(e,i),e.strstart!==0&&(Dt(e,r.adler>>>16),Dt(e,r.adler&65535)),r.adler=1,e.status=Ge,K(r),e.pending!==0)return e.last_flush=-1,$}if(e.status===nn){if(r.adler=0,N(e,31),N(e,139),N(e,8),e.gzhead)N(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),N(e,e.gzhead.time&255),N(e,e.gzhead.time>>8&255),N(e,e.gzhead.time>>16&255),N(e,e.gzhead.time>>24&255),N(e,e.level===9?2:e.strategy>=nr||e.level<2?4:0),N(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(N(e,e.gzhead.extra.length&255),N(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(r.adler=Oe(r.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=Jr;else if(N(e,0),N(e,0),N(e,0),N(e,0),N(e,0),N(e,e.level===9?2:e.strategy>=nr||e.level<2?4:0),N(e,Ws),e.status=Ge,K(r),e.pending!==0)return e.last_flush=-1,$}if(e.status===Jr){if(e.gzhead.extra){let i=e.pending,o=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+o>e.pending_buf_size;){let s=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex+=s,K(r),e.pending!==0)return e.last_flush=-1,$;i=0,o-=s}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending+=o,e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=Qr}if(e.status===Qr){if(e.gzhead.name){let i=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),K(r),e.pending!==0)return e.last_flush=-1,$;i=0}e.gzindex<e.gzhead.name.length?o=e.gzhead.name.charCodeAt(e.gzindex++)&255:o=0,N(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=en}if(e.status===en){if(e.gzhead.comment){let i=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),K(r),e.pending!==0)return e.last_flush=-1,$;i=0}e.gzindex<e.gzhead.comment.length?o=e.gzhead.comment.charCodeAt(e.gzindex++)&255:o=0,N(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i))}e.status=tn}if(e.status===tn){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(K(r),e.pending!==0))return e.last_flush=-1,$;N(e,r.adler&255),N(e,r.adler>>8&255),r.adler=0}if(e.status=Ge,K(r),e.pending!==0)return e.last_flush=-1,$}if(r.avail_in!==0||e.lookahead!==0||t!==Ze&&e.status!==Tt){let i=e.level===0?Fi(e,t):e.strategy===nr?Js(e,t):e.strategy===vs?js(e,t):Ct[e.level].func(e,t);if((i===Xe||i===dt)&&(e.status=Tt),i===Y||i===Xe)return r.avail_out===0&&(e.last_flush=-1),$;if(i===ht&&(t===Ls?Ts(e):t!==Ui&&(qr(e,0,0,!1),t===Rs&&(Fe(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),K(r),r.avail_out===0))return e.last_flush=-1,$}return t!==j?$:e.wrap<=0?Ni:(e.wrap===2?(N(e,r.adler&255),N(e,r.adler>>8&255),N(e,r.adler>>16&255),N(e,r.adler>>24&255),N(e,r.total_in&255),N(e,r.total_in>>8&255),N(e,r.total_in>>16&255),N(e,r.total_in>>24&255)):(Dt(e,r.adler>>>16),Dt(e,r.adler&65535)),K(r),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?$:Ni)},of=r=>{if(Lt(r))return Ee;let t=r.state.status;return r.state=null,t===Ge?Ke(r,Us):$},af=(r,t)=>{let e=t.length;if(Lt(r))return Ee;let n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==ct||n.lookahead)return Ee;if(i===1&&(r.adler=vi(r.adler,t,e,0)),n.wrap=0,e>=n.w_size){i===0&&(Fe(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(t.subarray(e-n.w_size,e),0),t=c,e=n.w_size}let o=r.avail_in,a=r.next_in,s=r.input;for(r.avail_in=e,r.next_in=0,r.input=t,ut(n);n.lookahead>=U;){let c=n.strstart,f=n.lookahead-(U-1);do We(n,c),c++;while(--f);n.strstart=c,n.lookahead=U-1,ut(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=U-1,n.match_available=0,r.next_in=a,r.input=s,r.avail_in=o,n.wrap=i,$};_e.exports.deflateInit=rf;_e.exports.deflateInit2=Zi;_e.exports.deflateReset=Mi;_e.exports.deflateResetKeep=Pi;_e.exports.deflateSetHeader=tf;_e.exports.deflate=nf;_e.exports.deflateEnd=of;_e.exports.deflateSetDictionary=af;_e.exports.deflateInfo="pako deflate (from Nodeca project)"});var sn=Z((tc,an)=>{"use strict";var sf=(r,t)=>Object.prototype.hasOwnProperty.call(r,t);an.exports.assign=function(r){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(let n in e)sf(e,n)&&(r[n]=e[n])}}return r};an.exports.flattenChunks=r=>{let t=0;for(let n=0,i=r.length;n<i;n++)t+=r[n].length;let e=new Uint8Array(t);for(let n=0,i=0,o=r.length;n<o;n++){let a=r[n];e.set(a,i),i+=a.length}return e}});var fn=Z((rc,or)=>{"use strict";var Hi=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Hi=!1}var Rt=new Uint8Array(256);for(let r=0;r<256;r++)Rt[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Rt[254]=Rt[255]=1;or.exports.string2buf=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let t,e,n,i,o,a=r.length,s=0;for(i=0;i<a;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),s+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),e<128?t[o++]=e:e<2048?(t[o++]=192|e>>>6,t[o++]=128|e&63):e<65536?(t[o++]=224|e>>>12,t[o++]=128|e>>>6&63,t[o++]=128|e&63):(t[o++]=240|e>>>18,t[o++]=128|e>>>12&63,t[o++]=128|e>>>6&63,t[o++]=128|e&63);return t};var ff=(r,t)=>{if(t<65534&&r.subarray&&Hi)return String.fromCharCode.apply(null,r.length===t?r:r.subarray(0,t));let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(r[n]);return e};or.exports.buf2string=(r,t)=>{let e=t||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,t));let n,i,o=new Array(e*2);for(i=0,n=0;n<e;){let a=r[n++];if(a<128){o[i++]=a;continue}let s=Rt[a];if(s>4){o[i++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<e;)a=a<<6|r[n++]&63,s--;if(s>1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return ff(o,i)};or.exports.utf8border=(r,t)=>{t=t||r.length,t>r.length&&(t=r.length);let e=t-1;for(;e>=0&&(r[e]&192)===128;)e--;return e<0||e===0?t:e+Rt[r[e]]>t?e:t}});var ln=Z((nc,$i)=>{"use strict";function lf(){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}$i.exports=lf});var Ki=Z((ic,pt)=>{"use strict";var Ut=zi(),Yi=sn(),Vi=fn(),cn=rr(),cf=ln(),Gi=Object.prototype.toString,{Z_NO_FLUSH:uf,Z_SYNC_FLUSH:hf,Z_FULL_FLUSH:df,Z_FINISH:pf,Z_OK:ar,Z_STREAM_END:mf,Z_DEFAULT_COMPRESSION:Ef,Z_DEFAULT_STRATEGY:xf,Z_DEFLATED:_f}=ve(),gf={level:Ef,method:_f,chunkSize:16384,windowBits:15,memLevel:8,strategy:xf,legacyHash:!0};function Nt(r){this.options=Yi.assign({},gf,r||{});let 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=!1,this.chunks=[],this.strm=new cf,this.strm.avail_out=0;let e=Ut.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(e!==ar)throw new Error(cn[e]);if(t.header&&Ut.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=Vi.string2buf(t.dictionary):Gi.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,e=Ut.deflateSetDictionary(this.strm,n),e!==ar)throw new Error(cn[e]);this._dict_set=!0}}Nt.prototype.push=function(r,t){let e=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?pf:uf,typeof r=="string"?e.input=Vi.string2buf(r):Gi.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),(o===hf||o===df)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(i=Ut.deflate(e,o),i===mf)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),i=Ut.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ar;if(e.avail_out===0){this.onData(e.output);continue}if(o>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0};Nt.prototype.onData=function(r){this.chunks.push(r)};Nt.prototype.onEnd=function(r){r===ar&&(this.result=Yi.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function un(r,t){let e=new Nt(t);if(e.push(r,!0),e.err)throw e.msg||cn[e.err];return e.result}function yf(r,t){return t=t||{},t.raw=!0,un(r,t)}function bf(r,t){return t=t||{},t.gzip=!0,un(r,t)}pt.exports.Deflate=Nt;pt.exports.deflate=un;pt.exports.deflateRaw=yf;pt.exports.gzip=bf;pt.exports.constants=ve()});var Wi=Z((oc,Xi)=>{"use strict";Xi.exports=function(t,e){let n,i,o,a,s,c,f,l,d,h,u,E,_,b,p,B,S,g,y,C,w,v,L,D,T=t.state;n=t.next_in,L=t.input,i=n+(t.avail_in-5),o=t.next_out,D=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),c=T.dmax,f=T.wsize,l=T.whave,d=T.wnext,h=T.window,u=T.hold,E=T.bits,_=T.lencode,b=T.distcode,p=(1<<T.lenbits)-1,B=(1<<T.distbits)-1;e:do{E<15&&(u+=L[n++]<<E,E+=8,u+=L[n++]<<E,E+=8),S=_[u&p];t:for(;;){if(g=S>>>24,u>>>=g,E-=g,g=S>>>16&255,g===0)D[o++]=S&65535;else if(g&16){y=S&65535,g&=15,g&&(E<g&&(u+=L[n++]<<E,E+=8),y+=u&(1<<g)-1,u>>>=g,E-=g),E<15&&(u+=L[n++]<<E,E+=8,u+=L[n++]<<E,E+=8),S=b[u&B];r:for(;;){if(g=S>>>24,u>>>=g,E-=g,g=S>>>16&255,g&16){if(C=S&65535,g&=15,E<g&&(u+=L[n++]<<E,E+=8,E<g&&(u+=L[n++]<<E,E+=8)),C+=u&(1<<g)-1,C>c){t.msg="invalid distance too far back",T.mode=16209;break e}if(u>>>=g,E-=g,g=o-a,C>g){if(g=C-g,g>l&&T.sane){t.msg="invalid distance too far back",T.mode=16209;break e}if(w=0,v=h,d===0){if(w+=f-g,g<y){y-=g;do D[o++]=h[w++];while(--g);w=o-C,v=D}}else if(d<g){if(w+=f+d-g,g-=d,g<y){y-=g;do D[o++]=h[w++];while(--g);if(w=0,d<y){g=d,y-=g;do D[o++]=h[w++];while(--g);w=o-C,v=D}}}else if(w+=d-g,g<y){y-=g;do D[o++]=h[w++];while(--g);w=o-C,v=D}for(;y>2;)D[o++]=v[w++],D[o++]=v[w++],D[o++]=v[w++],y-=3;y&&(D[o++]=v[w++],y>1&&(D[o++]=v[w++]))}else{w=o-C;do D[o++]=D[w++],D[o++]=D[w++],D[o++]=D[w++],y-=3;while(y>2);y&&(D[o++]=D[w++],y>1&&(D[o++]=D[w++]))}}else if((g&64)===0){S=b[(S&65535)+(u&(1<<g)-1)];continue r}else{t.msg="invalid distance code",T.mode=16209;break e}break}}else if((g&64)===0){S=_[(S&65535)+(u&(1<<g)-1)];continue t}else if(g&32){T.mode=16191;break e}else{t.msg="invalid literal/length code",T.mode=16209;break e}break}}while(n<i&&o<s);y=E>>3,n-=y,E-=y<<3,u&=(1<<E)-1,t.next_in=n,t.next_out=o,t.avail_in=n<i?5+(i-n):5-(n-i),t.avail_out=o<s?257+(s-o):257-(o-s),T.hold=u,T.bits=E}});var ji=Z((ac,qi)=>{"use strict";var wf=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Sf=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),Af=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),If=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Bf=(r,t,e,n,i,o,a,s)=>{let c=s.bits,f=0,l=0,d=0,h=0,u=0,E=0,_=0,b=0,p=0,B=0,S,g,y,C,w,v=null,L,D=new Uint16Array(16),T=new Uint16Array(16),ze=null,Tn,Mt,Zt;for(f=0;f<=15;f++)D[f]=0;for(l=0;l<n;l++)D[t[e+l]]++;for(u=c,h=15;h>=1&&D[h]===0;h--);if(u>h&&(u=h),h===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<h&&D[d]===0;d++);for(u<d&&(u=d),b=1,f=1;f<=15;f++)if(b<<=1,b-=D[f],b<0)return-1;if(b>0&&(r===0||h!==1))return-1;for(T[1]=0,f=1;f<15;f++)T[f+1]=T[f]+D[f];for(l=0;l<n;l++)t[e+l]!==0&&(a[T[t[e+l]]++]=l);if(r===0?(v=ze=a,L=20):r===1?(v=wf,ze=Sf,L=257):(v=Af,ze=If,L=0),B=0,l=0,f=d,w=o,E=u,_=0,y=-1,p=1<<u,C=p-1,r===1&&p>852||r===2&&p>592)return 1;for(;;){Tn=f-_,a[l]+1<L?(Mt=0,Zt=a[l]):a[l]>=L?(Mt=ze[a[l]-L],Zt=v[a[l]-L]):(Mt=96,Zt=0),S=1<<f-_,g=1<<E,d=g;do g-=S,i[w+(B>>_)+g]=Tn<<24|Mt<<16|Zt|0;while(g!==0);for(S=1<<f-1;B&S;)S>>=1;if(S!==0?(B&=S-1,B+=S):B=0,l++,--D[f]===0){if(f===h)break;f=t[e+a[l]]}if(f>u&&(B&C)!==y){for(_===0&&(_=u),w+=d,E=f-_,b=1<<E;E+_<h&&(b-=D[E+_],!(b<=0));)E++,b<<=1;if(p+=1<<E,r===1&&p>852||r===2&&p>592)return 1;y=B&C,i[y]=u<<24|E<<16|w-o|0}}return B!==0&&(i[w+B]=f-_<<24|64<<16|0),s.bits=u,0};qi.exports=Bf});var No=Z((sc,ie)=>{"use strict";var xn=Gr(),ge=Kr(),Df=Wi(),kt=ji(),Tf=0,Ao=1,Io=2,{Z_FINISH:Ji,Z_BLOCK:Cf,Z_TREES:sr,Z_OK:qe,Z_STREAM_END:Lf,Z_NEED_DICT:Rf,Z_STREAM_ERROR:J,Z_DATA_ERROR:Bo,Z_MEM_ERROR:_n,Z_BUF_ERROR:Uf,Z_DEFLATED:Qi}=ve(),ur=16180,eo=16181,to=16182,ro=16183,no=16184,io=16185,oo=16186,ao=16187,so=16188,fo=16189,cr=16190,Be=16191,hn=16192,lo=16193,dn=16194,co=16195,uo=16196,ho=16197,po=16198,fr=16199,lr=16200,mo=16201,Eo=16202,xo=16203,_o=16204,go=16205,pn=16206,yo=16207,bo=16208,F=16209,gn=16210,Do=16211,Nf=852,kf=592,vf=15,Of=vf,wo=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function Ff(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var je=r=>{if(!r)return 1;let t=r.state;return!t||t.strm!==r||t.mode<ur||t.mode>Do?1:0},To=r=>{if(je(r))return J;let t=r.state;return r.total_in=r.total_out=t.total=0,r.msg="",t.wrap&&(r.adler=t.wrap&1),t.mode=ur,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Nf),t.distcode=t.distdyn=new Int32Array(kf),t.sane=1,t.back=-1,qe},Co=r=>{if(je(r))return J;let t=r.state;return t.wsize=0,t.whave=0,t.wnext=0,To(r)},Lo=(r,t)=>{let e;if(je(r))return J;let n=r.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?J:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,Co(r))},Ro=(r,t)=>{if(!r)return J;let e=new Ff;r.state=e,e.strm=r,e.window=null,e.mode=ur;let n=Lo(r,t);return n!==qe&&(r.state=null),n},Pf=r=>Ro(r,Of),So=!0,mn,En,Mf=r=>{if(So){mn=new Int32Array(512),En=new Int32Array(32);let t=0;for(;t<144;)r.lens[t++]=8;for(;t<256;)r.lens[t++]=9;for(;t<280;)r.lens[t++]=7;for(;t<288;)r.lens[t++]=8;for(kt(Ao,r.lens,0,288,mn,0,r.work,{bits:9}),t=0;t<32;)r.lens[t++]=5;kt(Io,r.lens,0,32,En,0,r.work,{bits:5}),So=!1}r.lencode=mn,r.lenbits=9,r.distcode=En,r.distbits=5},Uo=(r,t,e,n)=>{let i,o=r.state;return o.window===null&&(o.window=new Uint8Array(1<<o.wbits)),o.wsize===0&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0),n>=o.wsize?(o.window.set(t.subarray(e-o.wsize,e),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(e-n,e-n+i),o.wnext),n-=i,n?(o.window.set(t.subarray(e-n,e),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},Zf=(r,t)=>{let e,n,i,o,a,s,c,f,l,d,h,u,E,_,b=0,p,B,S,g,y,C,w,v,L=new Uint8Array(4),D,T,ze=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(je(r)||!r.output||!r.input&&r.avail_in!==0)return J;e=r.state,e.mode===Be&&(e.mode=hn),a=r.next_out,i=r.output,c=r.avail_out,o=r.next_in,n=r.input,s=r.avail_in,f=e.hold,l=e.bits,d=s,h=c,v=qe;e:for(;;)switch(e.mode){case ur:if(e.wrap===0){e.mode=hn;break}for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&2&&f===35615){e.wbits===0&&(e.wbits=15),e.check=0,L[0]=f&255,L[1]=f>>>8&255,e.check=ge(e.check,L,2,0),f=0,l=0,e.mode=eo;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((f&255)<<8)+(f>>8))%31){r.msg="incorrect header check",e.mode=F;break}if((f&15)!==Qi){r.msg="unknown compression method",e.mode=F;break}if(f>>>=4,l-=4,w=(f&15)+8,e.wbits===0&&(e.wbits=w),w>15||w>e.wbits){r.msg="invalid window size",e.mode=F;break}e.dmax=1<<e.wbits,e.flags=0,r.adler=e.check=1,e.mode=f&512?fo:Be,f=0,l=0;break;case eo:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.flags=f,(e.flags&255)!==Qi){r.msg="unknown compression method",e.mode=F;break}if(e.flags&57344){r.msg="unknown header flags set",e.mode=F;break}e.head&&(e.head.text=f>>8&1),e.flags&512&&e.wrap&4&&(L[0]=f&255,L[1]=f>>>8&255,e.check=ge(e.check,L,2,0)),f=0,l=0,e.mode=to;case to:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.head&&(e.head.time=f),e.flags&512&&e.wrap&4&&(L[0]=f&255,L[1]=f>>>8&255,L[2]=f>>>16&255,L[3]=f>>>24&255,e.check=ge(e.check,L,4,0)),f=0,l=0,e.mode=ro;case ro:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.head&&(e.head.xflags=f&255,e.head.os=f>>8),e.flags&512&&e.wrap&4&&(L[0]=f&255,L[1]=f>>>8&255,e.check=ge(e.check,L,2,0)),f=0,l=0,e.mode=no;case no:if(e.flags&1024){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.length=f,e.head&&(e.head.extra_len=f),e.flags&512&&e.wrap&4&&(L[0]=f&255,L[1]=f>>>8&255,e.check=ge(e.check,L,2,0)),f=0,l=0}else e.head&&(e.head.extra=null);e.mode=io;case io:if(e.flags&1024&&(u=e.length,u>s&&(u=s),u&&(e.head&&(w=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(n.subarray(o,o+u),w)),e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,e.length-=u),e.length))break e;e.length=0,e.mode=oo;case oo:if(e.flags&2048){if(s===0)break e;u=0;do w=n[o+u++],e.head&&w&&e.length<65536&&(e.head.name+=String.fromCharCode(w));while(w&&u<s);if(e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,w)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=ao;case ao:if(e.flags&4096){if(s===0)break e;u=0;do w=n[o+u++],e.head&&w&&e.length<65536&&(e.head.comment+=String.fromCharCode(w));while(w&&u<s);if(e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,w)break e}else e.head&&(e.head.comment=null);e.mode=so;case so:if(e.flags&512){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&4&&f!==(e.check&65535)){r.msg="header crc mismatch",e.mode=F;break}f=0,l=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),r.adler=e.check=0,e.mode=Be;break;case fo:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}r.adler=e.check=wo(f),f=0,l=0,e.mode=cr;case cr:if(e.havedict===0)return r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,Rf;r.adler=e.check=1,e.mode=Be;case Be:if(t===Cf||t===sr)break e;case hn:if(e.last){f>>>=l&7,l-=l&7,e.mode=pn;break}for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}switch(e.last=f&1,f>>>=1,l-=1,f&3){case 0:e.mode=lo;break;case 1:if(Mf(e),e.mode=fr,t===sr){f>>>=2,l-=2;break e}break;case 2:e.mode=uo;break;case 3:r.msg="invalid block type",e.mode=F}f>>>=2,l-=2;break;case lo:for(f>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((f&65535)!==(f>>>16^65535)){r.msg="invalid stored block lengths",e.mode=F;break}if(e.length=f&65535,f=0,l=0,e.mode=dn,t===sr)break e;case dn:e.mode=co;case co:if(u=e.length,u){if(u>s&&(u=s),u>c&&(u=c),u===0)break e;i.set(n.subarray(o,o+u),a),s-=u,o+=u,c-=u,a+=u,e.length-=u;break}e.mode=Be;break;case uo:for(;l<14;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.nlen=(f&31)+257,f>>>=5,l-=5,e.ndist=(f&31)+1,f>>>=5,l-=5,e.ncode=(f&15)+4,f>>>=4,l-=4,e.nlen>286||e.ndist>30){r.msg="too many length or distance symbols",e.mode=F;break}e.have=0,e.mode=ho;case ho:for(;e.have<e.ncode;){for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.lens[ze[e.have++]]=f&7,f>>>=3,l-=3}for(;e.have<19;)e.lens[ze[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,D={bits:e.lenbits},v=kt(Tf,e.lens,0,19,e.lencode,0,e.work,D),e.lenbits=D.bits,v){r.msg="invalid code lengths set",e.mode=F;break}e.have=0,e.mode=po;case po:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[f&(1<<e.lenbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(S<16)f>>>=p,l-=p,e.lens[e.have++]=S;else{if(S===16){for(T=p+2;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(f>>>=p,l-=p,e.have===0){r.msg="invalid bit length repeat",e.mode=F;break}w=e.lens[e.have-1],u=3+(f&3),f>>>=2,l-=2}else if(S===17){for(T=p+3;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=p,l-=p,w=0,u=3+(f&7),f>>>=3,l-=3}else{for(T=p+7;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=p,l-=p,w=0,u=11+(f&127),f>>>=7,l-=7}if(e.have+u>e.nlen+e.ndist){r.msg="invalid bit length repeat",e.mode=F;break}for(;u--;)e.lens[e.have++]=w}}if(e.mode===F)break;if(e.lens[256]===0){r.msg="invalid code -- missing end-of-block",e.mode=F;break}if(e.lenbits=9,D={bits:e.lenbits},v=kt(Ao,e.lens,0,e.nlen,e.lencode,0,e.work,D),e.lenbits=D.bits,v){r.msg="invalid literal/lengths set",e.mode=F;break}if(e.distbits=6,e.distcode=e.distdyn,D={bits:e.distbits},v=kt(Io,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,D),e.distbits=D.bits,v){r.msg="invalid distances set",e.mode=F;break}if(e.mode=fr,t===sr)break e;case fr:e.mode=lr;case lr:if(s>=6&&c>=258){r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,Df(r,h),a=r.next_out,i=r.output,c=r.avail_out,o=r.next_in,n=r.input,s=r.avail_in,f=e.hold,l=e.bits,e.mode===Be&&(e.back=-1);break}for(e.back=0;b=e.lencode[f&(1<<e.lenbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(B&&(B&240)===0){for(g=p,y=B,C=S;b=e.lencode[C+((f&(1<<g+y)-1)>>g)],p=b>>>24,B=b>>>16&255,S=b&65535,!(g+p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=g,l-=g,e.back+=g}if(f>>>=p,l-=p,e.back+=p,e.length=S,B===0){e.mode=go;break}if(B&32){e.back=-1,e.mode=Be;break}if(B&64){r.msg="invalid literal/length code",e.mode=F;break}e.extra=B&15,e.mode=mo;case mo:if(e.extra){for(T=e.extra;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.length+=f&(1<<e.extra)-1,f>>>=e.extra,l-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=Eo;case Eo:for(;b=e.distcode[f&(1<<e.distbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((B&240)===0){for(g=p,y=B,C=S;b=e.distcode[C+((f&(1<<g+y)-1)>>g)],p=b>>>24,B=b>>>16&255,S=b&65535,!(g+p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=g,l-=g,e.back+=g}if(f>>>=p,l-=p,e.back+=p,B&64){r.msg="invalid distance code",e.mode=F;break}e.offset=S,e.extra=B&15,e.mode=xo;case xo:if(e.extra){for(T=e.extra;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.offset+=f&(1<<e.extra)-1,f>>>=e.extra,l-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){r.msg="invalid distance too far back",e.mode=F;break}e.mode=_o;case _o:if(c===0)break e;if(u=h-c,e.offset>u){if(u=e.offset-u,u>e.whave&&e.sane){r.msg="invalid distance too far back",e.mode=F;break}u>e.wnext?(u-=e.wnext,E=e.wsize-u):E=e.wnext-u,u>e.length&&(u=e.length),_=e.window}else _=i,E=a-e.offset,u=e.length;u>c&&(u=c),c-=u,e.length-=u;do i[a++]=_[E++];while(--u);e.length===0&&(e.mode=lr);break;case go:if(c===0)break e;i[a++]=e.length,c--,e.mode=lr;break;case pn:if(e.wrap){for(;l<32;){if(s===0)break e;s--,f|=n[o++]<<l,l+=8}if(h-=c,r.total_out+=h,e.total+=h,e.wrap&4&&h&&(r.adler=e.check=e.flags?ge(e.check,i,h,a-h):xn(e.check,i,h,a-h)),h=c,e.wrap&4&&(e.flags?f:wo(f))!==e.check){r.msg="incorrect data check",e.mode=F;break}f=0,l=0}e.mode=yo;case yo:if(e.wrap&&e.flags){for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&4&&f!==(e.total&4294967295)){r.msg="incorrect length check",e.mode=F;break}f=0,l=0}e.mode=bo;case bo:v=Lf;break e;case F:v=Bo;break e;case gn:return _n;case Do:default:return J}return r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,(e.wsize||h!==r.avail_out&&e.mode<F&&(e.mode<pn||t!==Ji))&&Uo(r,r.output,r.next_out,h-r.avail_out)?(e.mode=gn,_n):(d-=r.avail_in,h-=r.avail_out,r.total_in+=d,r.total_out+=h,e.total+=h,e.wrap&4&&h&&(r.adler=e.check=e.flags?ge(e.check,i,h,r.next_out-h):xn(e.check,i,h,r.next_out-h)),r.data_type=e.bits+(e.last?64:0)+(e.mode===Be?128:0)+(e.mode===fr||e.mode===dn?256:0),(d===0&&h===0||t===Ji)&&v===qe&&(v=Uf),v)},zf=r=>{if(je(r))return J;let t=r.state;return t.window&&(t.window=null),r.state=null,qe},Hf=(r,t)=>{if(je(r))return J;let e=r.state;return(e.wrap&2)===0?J:(e.head=t,t.done=!1,qe)},$f=(r,t)=>{let e=t.length,n,i,o;return je(r)||(n=r.state,n.wrap!==0&&n.mode!==cr)?J:n.mode===cr&&(i=1,i=xn(i,t,e,0),i!==n.check)?Bo:(o=Uo(r,t,e,e),o?(n.mode=gn,_n):(n.havedict=1,qe))};ie.exports.inflateReset=Co;ie.exports.inflateReset2=Lo;ie.exports.inflateResetKeep=To;ie.exports.inflateInit=Pf;ie.exports.inflateInit2=Ro;ie.exports.inflate=Zf;ie.exports.inflateEnd=zf;ie.exports.inflateGetHeader=Hf;ie.exports.inflateSetDictionary=$f;ie.exports.inflateInfo="pako inflate (from Nodeca project)"});var vo=Z((fc,ko)=>{"use strict";function Yf(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}ko.exports=Yf});var zo=Z((lc,Et)=>{"use strict";var ye=No(),Mo=sn(),wn=fn(),Sn=rr(),Vf=ln(),Gf=vo(),Zo=Object.prototype.toString,{Z_NO_FLUSH:Kf,Z_FINISH:Oo,Z_OK:mt,Z_STREAM_END:yn,Z_NEED_DICT:bn,Z_STREAM_ERROR:Xf,Z_DATA_ERROR:Fo,Z_MEM_ERROR:Wf,Z_BUF_ERROR:Po}=ve(),qf={chunkSize:1024*64,windowBits:15,to:""};function vt(r){this.options=Mo.assign({},qf,r||{});let 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&&!(r&&r.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Vf,this.strm.avail_out=0;let e=ye.inflateInit2(this.strm,t.windowBits);if(e!==mt)throw new Error(Sn[e]);if(this.header=new Gf,ye.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wn.string2buf(t.dictionary):Zo.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=ye.inflateSetDictionary(this.strm,t.dictionary),e!==mt)))throw new Error(Sn[e])}vt.prototype.push=function(r,t){let e=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Oo:Kf,Zo.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),o=ye.inflate(e,a),o===bn&&i&&(o=ye.inflateSetDictionary(e,i),o===mt?o=ye.inflate(e,a):o===Fo&&(o=bn));e.avail_in>0&&o===yn&&e.state.wrap&2&&e.state.flags!==0&&e.input[e.next_in]!==0;)ye.inflateReset(e),o=ye.inflate(e,a);switch(o){case Xf:case Fo:case bn:case Wf:return this.onEnd(o),this.ended=!0,!1}if(s=e.avail_out,e.next_out&&(e.avail_out===0||o===yn||a>0))if(this.options.to==="string"){let c=wn.utf8border(e.output,e.next_out),f=e.next_out-c,l=wn.buf2string(e.output,c);e.next_out=f,e.avail_out=n-f,f&&e.output.set(e.output.subarray(c,c+f),0),this.onData(l)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out)),e.avail_out=0,e.next_out=0;if(!((o===mt||o===Po)&&s===0)){if(o===yn)return o=ye.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(e.avail_in===0){if(a===Oo)return o=ye.inflateEnd(this.strm),this.onEnd(o===mt?Po:o),this.ended=!0,!1;break}}}return!0};vt.prototype.onData=function(r){this.chunks.push(r)};vt.prototype.onEnd=function(r){r===mt&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Mo.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function An(r,t){let e=new vt(t);if(e.push(r,!0),e.err)throw e.msg||Sn[e.err];return e.result}function jf(r,t){return t=t||{},t.raw=!0,An(r,t)}Et.exports.Inflate=vt;Et.exports.inflate=An;Et.exports.inflateRaw=jf;Et.exports.ungzip=An;Et.exports.constants=ve()});var In=Z((cc,be)=>{"use strict";var{Deflate:Jf,deflate:Qf,deflateRaw:el,gzip:tl}=Ki(),{Inflate:rl,inflate:nl,inflateRaw:il,ungzip:ol}=zo(),al=ve();be.exports.Deflate=Jf;be.exports.deflate=Qf;be.exports.deflateRaw=el;be.exports.gzip=tl;be.exports.Inflate=rl;be.exports.inflate=nl;be.exports.inflateRaw=il;be.exports.ungzip=ol;be.exports.constants=al});var El={};ea(El,{AES256_KEY_SIZE:()=>Ye,AES256_PWD_VERIFY_SIZE:()=>Ce,AES256_SALT_SIZE:()=>ce,AES_AUTH_CODE_SIZE:()=>ue,AES_EXTRA_FIELD_SIZE:()=>Le,AES_OVERHEAD:()=>Vt,CENTRAL_DIR:()=>A,CENTRAL_DIRECTORY_END:()=>Qn,CENTRAL_END:()=>ee,CENTRAL_FILE_HEADER:()=>Jn,CMP_METHOD:()=>I,DATATYPE:()=>we,DATA_DESC:()=>Pa,DATA_DESCRIPTOR:()=>Fa,DOS_FILE_ATTR:()=>Ue,ENCRYPT_HDR_SIZE:()=>Te,EXTENSIBLE_DATA_FIELDS:()=>Ma,EncryptionManager:()=>mr,Errors:()=>O,FILE_SYSTEM:()=>P,GP_FLAG:()=>M,HDR_ID:()=>R,HashCalculator:()=>yt,HashCalculatorClass:()=>de,LOCAL_FILE_HEADER:()=>jn,LOCAL_HDR:()=>k,Logger:()=>x,NEOZIPKIT_INFO:()=>qt,NEO_CRYPTO_EXTRA_FIELD_SIZE:()=>Re,NEO_CRYPTO_MAGIC_BYTES:()=>H,NEO_CRYPTO_PAYLOAD_V1:()=>Q,PlatformUtils:()=>ml,ProgressTracker:()=>pr,TIMESTAMP_METADATA:()=>fe,TIMESTAMP_SUBMITTED:()=>se,TOKENIZED_METADATA:()=>le,VERSION:()=>pl,ZIP64_CENTRAL_DIR:()=>Gt,ZIP64_CENTRAL_DIRECTORY_END:()=>Oa,ZIP64_CENTRAL_DIRECTORY_LOCATOR:()=>va,ZIP64_CENTRAL_END:()=>Br,ZipCompress:()=>xt,ZipCopy:()=>hr,ZipCrypto:()=>q,ZipEntry:()=>re,ZipkitBrowser:()=>Pt,configureLoggerFromEnvironment:()=>Dr,crc32:()=>te,crc32update:()=>Wt,getTypeOf:()=>dr,isMetadataFile:()=>hl,isStream:()=>ul,readBigUInt64LE:()=>ll,sha256:()=>ot,uMul:()=>cl});var Xo=ta(qn());var O={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",STRONG_ENCRYPT_UNSUPPORTED:"Strong Encryption is not supported",INVALID_TIMESTAMP:"Invalid timestamp",TIMESTAMP_FAILED:"Failed to create the timestamp",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",INVALID_CMP_DATA_LENGTH:"Compressed data length does not match the expected length",EXTRACT_FAILED:"Failed to extract file",INVALID_CRC:"CRC32 checksum does not match the expected value",UNKNOWN_SHA256:"The SHA-256 hash has not been saved",INVALID_SHA256:"The SHA-256 hash does not match the expected value",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",NO_STREAM_SUPPORT:"Streams are not supported in this environment",NO_BLOB_SUPPORT:"Blobs are not supported in this environment",NO_FILE_READER_SUPPORT:"FileReader is not supported in this environment",NO_FILES:"No files added, Zip file not created",DATATYPE_STRING_UNSUPPORTED:"The String type is not supported by this platform.",DATATYPE_ARRAY_UNSUPPORTED:"The Array type is not supported by this platform.",DATATYPE_BUFFER_UNSUPPORTED:"The Buffer type is not supported by this platform.",DATATYPE_BLOB_UNSUPPORTED:"The Blob type is not supported by this platform.",DATATYPE_U8ARRAY_UNSUPPORTED:"The uint8Array type is not supported by this platform.",DATATYPE_ARRAYBUFFER_UNSUPPORTED:"The ArrayBuffer type is not supported by this platform.",DATATYPE_UNSUPPORTED:"Unsupported input type.",COMPRESS_FAILED:"Failed to compress data",COMPRESSION_ERROR:"Error occurred during compression",DECOMPRESSION_ERROR:"Error occurred during decompression",ENCRYPT_FAILED:"Encryption failed"};var jn="PK",Jn="PK",Qn="PK",va="PK\x07",Oa="PK",Fa="PK\x07\b",se="META-INF/TS-SUBMIT.OTS",fe="META-INF/TIMESTAMP.OTS",le="META-INF/NZIP.TOKEN",k={SIZE:30,SIGNATURE:67324752,VER_EXTRACT:4,FLAGS:6,COMPRESSION:8,TIMEDATE_DOS:10,CRC:14,CMP_SIZE:18,UNCMP_SIZE:22,FNAME_LEN:26,EXTRA_LEN:28},Te=12,ce=16,Ye=32,Ce=2,ue=10,Le=11,Vt=ce+Ce+ue,Q=11,Re=4+Q,H=[78,69,90,0],Pa={SIGNATURE:134695760,SIZE:16,CRC:4,CMP_SIZE:8,UNCMP_SIZE:12},A={SIZE:46,SIGNATURE:33639248,VER_MADE:4,VER_EXT:6,FLAGS:8,CMP_METHOD:10,TIMEDATE_DOS:12,CRC:16,CMP_SIZE:20,UNCMP_SIZE:24,FNAME_LEN:28,EXTRA_LEN:30,COMMENT_LEN:32,DISK_NUM:34,INT_FILE_ATTR:36,EXT_FILE_ATTR:38,LOCAL_HDR_OFFSET:42},ee={SIZE:22,SIGNATURE:101010256,VOL_NUM:4,VOLDIR_START:6,VOL_ENTRIES:8,TOTAL_ENTRIES:10,CENTRAL_DIR_SIZE:12,CENTRAL_DIR_OFFSET:16,ZIP_COMMENT_LEN:20},Gt={SIGNATURE:101075792,SIZE:56,LEAD:12,SIZE_FIELD:4,VER_MADEBY:12,VER_NEEDED:14,VOL_NUM:16,VOLDIR_START:20,VOL_ENTRIES:24,TOTAL_ENTRIES:32,CENTRAL_DIR_SIZE:40,CENTRAL_DIR_OFFSET:48,EXTRA_FIELD:56},Br={SIZE:20,SIGNATURE:117853008,VOL_NUM:4,CENTRAL_DIR_OFFSET:8,TOTAL_DISKS:16},I={STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATE:9,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,ZSTD:93,AES_ENCRYPT:99},M={ENCRYPTED:1,COMPRESSION1:2,COMPRESSION2:4,DATA_DESC:8,ENHANCED_DEFLATE:16,PATCHED:32,STRONG_ENCRYPT:64,EFS:2048,MASK:4096},Ma={ID:0,SIZE:2},R={ZIP64:1,AVINFO:7,PFS:8,OS2:9,NTFS:10,OPENVMS:12,UNIX:13,FORK:14,PATCH:15,x509PKCS7:20,x509CERT_IDF:21,x509CERT_IDC:22,STRONG_ENC:23,AES:39169,RECORD_MGT:24,x509PKCS7RL:25,IBM1:101,IBM2:102,SHA256:334,NEO_CRYPTO:590,POSZIP:18064,UNV_TIME:21589,UID_GID:30837,UNICODE_PATH:28789,SYMLINK:30805,HARDLINK:30821},P={MSDOS:0,AMIGA:1,OPENVMS:2,UNIX:3,VM_CMS:4,ATARI:5,OS2:6,MAC:7,CP_M:9,NTFS:10,MVS:11,VSE:12,ACORN:13,VFAT:14,ALTMVS:15,BEOS:16,TANDEM:17,OS400:18,DARWIN:19},Ue={READONLY:1,HIDDEN:2,SYSTEM:4,VOLUME:8,DIRECTORY:16,ARCHIVE:32};var x=class{static configure(t){this.config={...this.config,...t}}static getConfig(){return{...this.config}}static enable(){this.config.enabled=!0}static disable(){this.config.enabled=!1}static setLevel(t){this.config.level=t}static shouldLog(t){if(!this.config.enabled)return!1;let e=["debug","info","warn","error","silent"],n=e.indexOf(this.config.level);return e.indexOf(t)>=n}static log(...t){this.shouldLog("info")&&this.originalConsole.log(...t)}static error(...t){this.shouldLog("error")&&this.originalConsole.error(...t)}static warn(...t){this.shouldLog("warn")&&this.originalConsole.warn(...t)}static debug(...t){this.shouldLog("debug")&&this.originalConsole.log(...t)}static info(...t){this.shouldLog("info")&&this.originalConsole.info(...t)}static overrideConsole(){console.log=(...t)=>this.log(...t),console.error=(...t)=>this.error(...t),console.warn=(...t)=>this.warn(...t),console.debug=(...t)=>this.debug(...t),console.info=(...t)=>this.info(...t)}static restoreConsole(){console.log=this.originalConsole.log,console.error=this.originalConsole.error,console.warn=this.originalConsole.warn,console.debug=this.originalConsole.debug,console.info=this.originalConsole.info}};x.config={enabled:!0,level:"info"},x.originalConsole={log:console.log,error:console.error,warn:console.warn,debug:console.debug,info:console.info};function Dr(){let r=typeof process<"u"?process.env:{};if(r.NEOZIP_DEBUG==="false"?x.disable():r.NEOZIP_DEBUG==="true"&&(x.enable(),x.setLevel("debug")),r.NEOZIP_LOG_LEVEL){let t=r.NEOZIP_LOG_LEVEL;["debug","info","warn","error","silent"].includes(t)&&x.setLevel(t)}r.NODE_ENV==="production"&&x.setLevel("error")}Dr();var Kt=typeof crypto<"u"?crypto:typeof window<"u"&&window.crypto?window.crypto:null;if(!Kt||!Kt.subtle)throw new Error("Web Crypto API is not available in this environment");function za(r){return new Uint8Array(r)}function ei(r){return r instanceof Uint8Array||r instanceof ArrayBuffer,Buffer.from(r)}async function it(r){let e={sha256:"SHA-256",sha1:"SHA-1",md5:"MD5"}[r.toLowerCase()]||"SHA-256";return{update:function(n){return this._data=this._data?Buffer.concat([this._data,ei(n)]):ei(n),this},digest:async function(n){let i=this._data||Buffer.alloc(0),o=await Kt.subtle.digest(e,i),a=za(o);return n==="hex"?Array.from(a).map(s=>s.toString(16).padStart(2,"0")).join(""):n==="base64"?Buffer.from(a).toString("base64"):Buffer.from(a)}}}function Xt(r){let t=new Uint8Array(r);return Kt.getRandomValues(t),Buffer.from(t)}function Tr(r){let t=(Buffer.isBuffer(r),Buffer.from(r)),e=t.length,n=e*8,i=64-(e+9)%64,o=e+1+(i<0?i+64:i)+8,a=Buffer.alloc(o);t.copy(a,0),a[e]=128,a.writeUInt32BE(n/4294967296>>>0,o-8),a.writeUInt32BE(n>>>0,o-4);let s=[1732584193,4023233417,2562383102,271733878,3285377520],c=[1518500249,1859775393,2400959708,3395469782],f=new Array(80);for(let d=0;d<o;d+=64){for(let p=0;p<16;p++)f[p]=a.readUInt32BE(d+p*4);for(let p=16;p<80;p++)f[p]=(f[p-3]^f[p-8]^f[p-14]^f[p-16])<<1|(f[p-3]^f[p-8]^f[p-14]^f[p-16])>>>31;let[h,u,E,_,b]=s;for(let p=0;p<80;p++){let B,S;p<20?(B=u&E|~u&_,S=c[0]):p<40?(B=u^E^_,S=c[1]):p<60?(B=u&E|u&_|E&_,S=c[2]):(B=u^E^_,S=c[3]),S=(h<<5|h>>>27)+B+b+S+(f[p]>>>0)>>>0,b=_,_=E,E=u<<30|u>>>2,u=h,h=S}s[0]=s[0]+h>>>0,s[1]=s[1]+u>>>0,s[2]=s[2]+E>>>0,s[3]=s[3]+_>>>0,s[4]=s[4]+b>>>0}let l=Buffer.alloc(20);for(let d=0;d<5;d++)l.writeUInt32BE(s[d],d*4);return l}function Cr(r,t){let n=(Buffer.isBuffer(r),Buffer.from(r));n.length>64&&(n=Tr(n)),n.length<64&&(n=Buffer.concat([n,Buffer.alloc(64-n.length)]));let i=Buffer.alloc(64,54),o=Buffer.alloc(64,92);for(let s=0;s<64;s++)i[s]^=n[s],o[s]^=n[s];let a=Tr(Buffer.concat([i,Buffer.isBuffer(t)?t:Buffer.from(t)]));return Tr(Buffer.concat([o,a]))}function ti(r,t,e,n,i){if(i&&i.toLowerCase()!=="sha1")throw new Error("Browser shim only supports PBKDF2 with sha1");let o=20,a=Math.ceil(n/o),s=[],c=Buffer.isBuffer(r)?r:Buffer.from(r),f=Buffer.isBuffer(t)?t:Buffer.from(t);for(let l=1;l<=a;l++){let d=Buffer.from([l>>>24&255,l>>>16&255,l>>>8&255,l&255]),h=Cr(c,Buffer.concat([f,d])),u=Buffer.from(h);for(let E=1;E<e;E++){h=Cr(c,h);for(let _=0;_<o;_++)u[_]^=h[_]}s.push(u)}return Buffer.concat(s).subarray(0,n)}function Lr(r,t){if(r!=="sha1")throw new Error("Browser shim createHmac only supports sha1");let e=Buffer.isBuffer(t)?t:Buffer.from(t),n=Buffer.alloc(0);return{update(i){return n=Buffer.concat([n,Buffer.isBuffer(i)?i:Buffer.from(i)]),this},digest(){let i=Cr(e,n);return n=Buffer.alloc(0),i}}}var he=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),Ha=new Uint8Array([1,2,4,8,16,32,64,128,27,54]);function $a(r){let t=new Uint8Array(240);for(let e=0;e<32;e++)t[e]=r[e];for(let e=8;e<60;e++){let n=e*4,i=(e-8)*4,o=(e-1)*4;if(e%8===0){let a=he[t[o+1]]^Ha[e/8-1];t[n]=t[i]^a,t[n+1]=t[i+1]^he[t[o+2]],t[n+2]=t[i+2]^he[t[o+3]],t[n+3]=t[i+3]^he[t[o]]}else e%8===4?(t[n]=t[i]^he[t[o]],t[n+1]=t[i+1]^he[t[o+1]],t[n+2]=t[i+2]^he[t[o+2]],t[n+3]=t[i+3]^he[t[o+3]]):(t[n]=t[i]^t[o],t[n+1]=t[i+1]^t[o+1],t[n+2]=t[i+2]^t[o+2],t[n+3]=t[i+3]^t[o+3])}return t}function Ne(r){return r<<1&255^(r>>>7&1)*27}function Ya(r,t){let e=new Uint8Array(16);for(let s=0;s<16;s++)e[s]=t[s]^r[s];for(let s=1;s<14;s++){for(let u=0;u<16;u++)e[u]=he[e[u]];let c=e[1];e[1]=e[5],e[5]=e[9],e[9]=e[13],e[13]=c;let f=e[2];e[2]=e[10],e[10]=f;let l=e[6];e[6]=e[14],e[14]=l;let d=e[3];e[3]=e[15],e[15]=e[11],e[11]=e[7],e[7]=d;for(let u=0;u<4;u++){let E=e[u*4],_=e[u*4+1],b=e[u*4+2],p=e[u*4+3];e[u*4]=Ne(E)^Ne(_)^_^b^p,e[u*4+1]=E^Ne(_)^Ne(b)^b^p,e[u*4+2]=E^_^Ne(b)^Ne(p)^p,e[u*4+3]=Ne(E)^E^_^b^Ne(p)}let h=s*16;for(let u=0;u<16;u++)e[u]^=r[h+u]}for(let s=0;s<16;s++)e[s]=he[e[s]];let n=e[1];e[1]=e[5],e[5]=e[9],e[9]=e[13],e[13]=n;let i=e[2];e[2]=e[10],e[10]=i;let o=e[6];e[6]=e[14],e[14]=o;let a=e[3];e[3]=e[15],e[15]=e[11],e[11]=e[7],e[7]=a;for(let s=0;s<16;s++)e[s]^=r[224+s];return e}function ri(r,t,e){if(r!=="aes-256-ecb"||e!=null)throw new Error("Browser shim createCipheriv only supports aes-256-ecb with null iv");let n=Buffer.isBuffer(t)?t:Buffer.from(t);if(n.length!==32)throw new Error("aes-256-ecb requires 32-byte key");let i=$a(n);return{setAutoPadding(){return this},update(o){let a=Buffer.isBuffer(o)?o:Buffer.from(o);if(a.length!==16)throw new Error("Browser shim AES-ECB only supports 16-byte blocks");let s=Ya(i,a);return Buffer.from(s)},final(){return Buffer.alloc(0)}}}var ke=class ke{canHandle(t){return t===1}getMethodName(){return"ZIP-Crypto"}getKeyLength(){return ke.KEY_LENGTH}async encrypt(t,e){try{if(e.method!==1)return{success:!1,error:"ZIP-Crypto encryption method required"};let n=this.initKeys(e.password),i=Buffer.alloc(t.length);for(let o=0;o<t.length;o++){let a=t[o],s=this.encryptByte(n,a);i[o]=s,this.updateKeys(n,a)}return{success:!0,encryptedData:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown encryption error"}}}async decrypt(t,e){try{if(e.method!==1)return{success:!1,error:"ZIP-Crypto decryption method required"};let n=this.initKeys(e.password),i=Buffer.alloc(t.length);for(let o=0;o<t.length;o++){let a=t[o],s=this.decryptByte(n,a);i[o]=s,this.updateKeys(n,s)}return{success:!0,decryptedData:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown decryption error"}}}verifyPassword(t,e){if(t.length<12)throw new Error("Decrypted header must be at least 12 bytes");if(t[11]!==e)throw new Error("Password verification FAILED")}parseLocalHeaderForDecryption(t,e){if(t.readUInt32LE(0)!==67324752)throw new Error("Invalid local header signature");let n=t.readUInt16LE(6),i=t.readUInt32LE(10),o=t.readUInt32LE(14);n&M.DATA_DESC&&(!e.lastModTimeDate||e.lastModTimeDate===0)&&(e.lastModTimeDate=i),e.localCrc=o;let a;return n&M.DATA_DESC?a=(e.lastModTimeDate||e.timeDateDOS||0)>>8&255:a=(o&&o!==0?o:e.crc)>>24&255,{bitFlags:n,lastModTimeDate:i,localCrc:o,checkByte:a}}createEncryptionHeader(t,e){let n=Buffer.alloc(Te);Xt(11).copy(n,0);let o;return(t.bitFlags&M.DATA_DESC)!==0?o=(t.lastModTimeDate||t.timeDateDOS||0)>>8&255:o=t.crc>>24&255,n[11]=o,x.debug(`[ZipCrypto] Created encryption header: checkByte=0x${o.toString(16).padStart(2,"0")}, DATA_DESC=${(t.bitFlags&M.DATA_DESC)!==0}`),n}encryptBuffer(t,e,n){let i=this.createEncryptionHeader(t,n),o=Buffer.concat([i,e]),a=this.initKeys(n),s=Buffer.alloc(o.length);for(let c=0;c<o.length;c++){let f=o[c],l=this.encryptByte(a,f);s[c]=l,this.updateKeys(a,f)}return x.debug(`[ZipCrypto] Encrypted buffer: ${e.length} bytes compressed data + ${Te} bytes header = ${s.length} bytes total`),s}decryptBuffer(t,e,n,i){let o=e.subarray(t.localHdrOffset),a=o.subarray(0,30),{bitFlags:s,localCrc:c,checkByte:f}=this.parseLocalHeaderForDecryption(a,t),l=a.readUInt16LE(26),d=a.readUInt16LE(28),h=30+l+d,u=12,E=o.subarray(h,h+u),_=Buffer.concat([E,n]),b=this.initKeys(i);for(let B=0;B<_.length;B++){let S=_[B],g=this.decryptByte(b,S);_[B]=g,this.updateKeys(b,g)}let p=_.subarray(0,u);return this.verifyPassword(p,f),_.subarray(u)}async*createStreamDecryptor(t,e,n){let i=this.initKeys(t),o=12,a=Buffer.alloc(o),s=0,c=null,f=0;for(;s<o;){if(!c||f>=c.length){let h=await n.next();if(h.done||!h.value)throw new Error("ZIP-Crypto: insufficient encrypted data (missing encryption header)");c=h.value,f=0}let l=o-s,d=Math.min(l,c.length-f);c.copy(a,s,f,f+d),s+=d,f+=d}for(let l=0;l<o;l++){let d=a[l],h=this.decryptByte(i,d)&255;a[l]=h,this.updateKeys(i,h)}if(this.verifyPassword(a,e),c&&f<c.length){let l=c.length-f;for(let d=0;d<l;d++){let h=f+d,u=c[h],E=this.decryptByte(i,u);c[h]=E,this.updateKeys(i,E)}yield c.subarray(f)}for await(let l of n){for(let d=0;d<l.length;d++){let h=l[d],u=this.decryptByte(i,h);l[d]=u,this.updateKeys(i,u)}yield l}}initKeys(t){let e=[305419896,591751049,878082192];for(let n=0;n<t.length;n++)this.updateKeys(e,t.charCodeAt(n));return e}updateKeys(t,e){t[0]=(t[0]>>>8^ke.CRC_TABLE[(t[0]^e)&255])>>>0,t[1]=(Math.imul(t[1]+(t[0]&255),134775813)+1&4294967295)>>>0,t[2]=(t[2]>>>8^ke.CRC_TABLE[(t[2]^t[1]>>>24)&255])>>>0}encryptByte(t,e){let n=t[2]|2;return(e^Math.imul(n,n^1)>>>8)&255}decryptByte(t,e){let n=t[2]|2;return(e^Math.imul(n,n^1)>>>8)&255}crc32(t,e){return(t>>>8^ke.CRC_TABLE[(t^e)&255])>>>0}static crc32(t){return ii(t)}static crc32update(t,e){return oi(t,e)}};ke.KEY_LENGTH=3,ke.CRC_TABLE=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];var q=ke;function ii(r){typeof r=="string"&&(r=Buffer.from(r,"utf8"));let t=r.length,e=-1;for(let n=0;n<t;)e=q.CRC_TABLE[(e^r[n++])&255]^e>>>8;return~e>>>0}function oi(r,t){return q.CRC_TABLE[(r^t)&255]^r>>>8}function te(r){return ii(r)}function Wt(r,t){return oi(r,t)}function ot(r){return it("sha256").update(r).digest("hex")}var Rr=30,ai=10,Ur=51,re=class{constructor(t,e,n){this.debug=!0;this.verMadeBy=0;this.verExtract=0;this.bitFlags=0;this.cmpMethod=0;this.timeDateDOS=0;this.crc=0;this.compressedSize=0;this.uncompressedSize=0;this.volNumber=0;this.intFileAttr=0;this.extFileAttr=0;this.localHdrOffset=0;this.filename="";this.extraField=null;this.comment=null;this.fileBuffer=null;this.cmpData=null;this.isEncrypted=!1;this.isStrongEncrypt=!1;this.encryptHdr=null;this.lastModTimeDate=0;this.decrypt=null;this.aesVersion=0;this.aesStrength=0;this.realCmpMethod=-1;this.neoCryptoPayloadVersion=0;this.neoCryptoAlgorithm=0;this.neoCryptoFlags=0;this.isUpdated=!0;this.isDirectory=!1;this.isMetaData=!1;this.platform=null;this.universalTime=null;this.uid=null;this.gid=null;this.sha256=null;this.isSymlink=!1;this.linkTarget=null;this.isHardLink=!1;this.originalEntry=null;this.inode=null;this.isMSDOS=this.platform===null;this.isUnixLike=this.platform!=null&&this.platform!=="win32";this.isMacOS=this.platform!=null&&this.platform==="darwin";this.isLinux=this.platform!=null&&this.platform==="linux";this.VER_MADE_BY=(()=>{switch(this.platform){case"darwin":return P.DARWIN<<8|Rr;case"win32":return P.NTFS<<8|Rr;default:return P.UNIX<<8|Rr}})();this.filename=t||"",this.comment=e||null,this.debug=n||!1,this.bitFlags|=M.EFS}readZipEntry(t){if(t.length<A.SIZE)throw new Error("Zip entry data is too small or corrupt");if(t.readUInt32LE(0)!==A.SIGNATURE)throw new Error(O.INVALID_CEN);this.verMadeBy=t.readUInt16LE(A.VER_MADE),this.verExtract=t.readUInt16LE(A.VER_EXT),this.bitFlags=t.readUInt16LE(A.FLAGS),(this.bitFlags&M.ENCRYPTED)!=0&&(this.isEncrypted=!0,(this.bitFlags&M.STRONG_ENCRYPT)!=0&&(this.isStrongEncrypt=!0)),this.cmpMethod=t.readUInt16LE(A.CMP_METHOD),this.timeDateDOS=t.readUInt32LE(A.TIMEDATE_DOS),this.crc=t.readUInt32LE(A.CRC),this.compressedSize=t.readUInt32LE(A.CMP_SIZE),this.uncompressedSize=t.readUInt32LE(A.UNCMP_SIZE),this.volNumber=t.readUInt16LE(A.DISK_NUM),this.intFileAttr=t.readUInt16LE(A.INT_FILE_ATTR),this.extFileAttr=t.readUInt32LE(A.EXT_FILE_ATTR),this.extFileAttr&Ue.DIRECTORY&&(this.isDirectory=!0),this.localHdrOffset=t.readUInt32LE(A.LOCAL_HDR_OFFSET);let e=t.readUInt16LE(A.FNAME_LEN),n=t.toString("utf8",A.SIZE,A.SIZE+e);this.filename=n,this.filename.endsWith("/")&&(this.isDirectory=!0);let i=t.readUInt16LE(A.EXTRA_LEN);if(i>0){this.extraField=t.subarray(A.SIZE+e,A.SIZE+e+i);for(let s=0;s<i;){let c=this.extraField.readUInt16LE(s),f=this.extraField.readUInt16LE(s+2),l=this.extraField.subarray(s+4,s+4+f);if(c===R.UNICODE_PATH&&f>=5){let d=l.readUInt8(0),h=l.readUInt32LE(1),u=Buffer.from(this.filename);if(te(u)===h){let _=l.subarray(5).toString("utf8");this.filename=_,this.debug&&x.log(`Using Unicode Path: ${this.filename}`)}}s+=4+f}for(let s=0;s<i;){let c=this.extraField.readUInt16LE(s),f=this.extraField.readUInt16LE(s+2),l=this.extraField.subarray(s+4,s+4+f);if(c===R.SHA256)f===64?this.sha256=l.toString("utf8"):this.sha256=l.toString("hex");else if(c===R.UNV_TIME)f>=5&&l.readUInt8(0)&1&&(this.universalTime=l.readUInt32LE(1));else if(c===R.UID_GID){if(f>=5){let d=l.readUInt8(0),h=l.readUInt8(1);if(h<=4&&f>=2+h&&(this.uid=l.readUIntLE(2,h),f>=2+h+1)){let u=l.readUInt8(2+h);u<=4&&f>=2+h+1+u&&(this.gid=l.readUIntLE(2+h+1,u))}}}else if(c===R.SYMLINK){if(f>=3){let d=l.readUInt8(0),h=l.readUInt16LE(1);h>0&&f>=3+h&&(this.isSymlink=!0,this.linkTarget=l.subarray(3,3+h).toString("utf8"))}}else if(c===R.HARDLINK){if(f>=11){let d=l.readUInt8(0);this.inode=l.readUInt32LE(1);let h=l.readUInt16LE(5);h>0&&f>=7+h&&(this.isHardLink=!0,this.originalEntry=l.subarray(7,7+h).toString("utf8"))}}else c===R.AES?f>=7&&(this.aesVersion=l.readUInt16LE(0),this.aesStrength=l.readUInt8(4),this.realCmpMethod=l.readUInt16LE(5)):c===R.NEO_CRYPTO&&f>=Q&&l[0]===H[0]&&l[1]===H[1]&&l[2]===H[2]&&l[3]===H[3]&&(this.neoCryptoPayloadVersion=l.readUInt8(4),this.neoCryptoAlgorithm=l.readUInt16LE(5),this.neoCryptoFlags=l.readUInt16LE(7));s+=4+f}}let o=t.readUInt16LE(A.COMMENT_LEN);o>0&&(this.comment=t.toString("utf8",A.SIZE+e,A.SIZE+e+o)),this.debug&&this.showVerboseInfo();let a=A.SIZE+e+i+o;return t.subarray(a)}needsUnicodeHandling(){return/[^\x00-\x7E]|['"]/.test(this.filename)}addUnicodePathField(t,e){let n=Buffer.from(this.filename,"utf8"),i=this.filename.replace(/[^\x00-\x7E]/g,"?"),o=Buffer.from(i,"ascii"),a=te(o),s=5+n.length;return t.writeUInt16LE(R.UNICODE_PATH,e),t.writeUInt16LE(s,e+2),t.writeUInt8(1,e+4),t.writeUInt32LE(a,e+5),n.copy(t,e+9),e+4+s}createLocalHdr(){let t=0,e=this.needsUnicodeHandling();e&&(t=5+Buffer.from(this.filename,"utf8").length+4);let n=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0;n&&(t+=Le);let i=this.neoCryptoAlgorithm>0;i&&(t+=Re);let o=Buffer.alloc(k.SIZE+this.filename.length+t);o.writeUInt32LE(k.SIGNATURE,0);let a=this.cmpMethod===I.AES_ENCRYPT?Ur:ai;o.writeUInt16LE(a,k.VER_EXTRACT),o.writeUInt16LE(this.bitFlags>>>0,k.FLAGS),o.writeUInt16LE(this.cmpMethod,k.COMPRESSION),o.writeUInt32LE(this.timeDateDOS>>>0,k.TIMEDATE_DOS),o.writeUInt32LE(this.aesVersion===2?0:this.crc,k.CRC),o.writeUInt32LE(this.compressedSize,k.CMP_SIZE),o.writeUInt32LE(this.uncompressedSize,k.UNCMP_SIZE),o.writeUInt16LE(this.filename.length,k.FNAME_LEN),o.writeUInt16LE(t,k.EXTRA_LEN);let s=this.filename.replace(/[^\x00-\x7E]/g,"?"),c=Buffer.from(s);c.copy(o,k.SIZE);let f=k.SIZE+c.length;if(e&&(f=this.addUnicodePathField(o,f)),n&&(o.writeUInt16LE(R.AES,f),o.writeUInt16LE(7,f+2),o.writeUInt16LE(this.aesVersion,f+4),o.writeUInt16LE(17729,f+6),o.writeUInt8(this.aesStrength,f+8),o.writeUInt16LE(this.realCmpMethod,f+9),f+=Le),i){o.writeUInt16LE(R.NEO_CRYPTO,f),o.writeUInt16LE(Q,f+2);let l=f+4;for(let d=0;d<4;d++)o.writeUInt8(H[d],l+d);o.writeUInt8(this.neoCryptoPayloadVersion,l+4),o.writeUInt16LE(this.neoCryptoAlgorithm,l+5),o.writeUInt16LE(this.neoCryptoFlags,l+7),o.writeUInt16LE(0,l+9),f+=Re}return o}centralDirEntry(){let t=this.comment?Buffer.from(this.comment,"utf8").length:0,e=this.universalTime?9:0,n=this.uid&&this.gid?15:0,i=this.sha256?Buffer.from(this.sha256,"hex"):null,o=i?i.length+4:0,a=this.isSymlink&&this.linkTarget?7+Buffer.byteLength(this.linkTarget,"utf8"):0,s=this.isHardLink&&this.originalEntry&&this.inode!==null?11+Buffer.byteLength(this.originalEntry,"utf8"):0,c=this.needsUnicodeHandling(),f=0;c&&(f=5+Buffer.from(this.filename,"utf8").length+4);let l=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0,d=l?Le:0,h=this.neoCryptoAlgorithm>0,u=h?Re:0,E=e+o+n+a+s+(c?f:0)+d+u,_=this.filename.replace(/[^\x00-\x7E]/g,"?"),b=_.length,p=Buffer.alloc(A.SIZE+b+t+E);p.writeUInt32LE(A.SIGNATURE,0),p.writeUInt16LE(this.isUpdated?this.VER_MADE_BY:this.verMadeBy,A.VER_MADE);let B=this.cmpMethod===I.AES_ENCRYPT?Ur:ai;p.writeInt16LE(this.isUpdated?B:this.verMadeBy,A.VER_EXT),p.writeInt16LE(this.bitFlags>>>0,A.FLAGS),p.writeInt16LE(this.cmpMethod,A.CMP_METHOD),p.writeUInt32LE(this.timeDateDOS>>>0,A.TIMEDATE_DOS),p.writeUInt32LE(this.aesVersion===2?0:this.crc,A.CRC),p.writeUInt32LE(this.compressedSize,A.CMP_SIZE),p.writeUInt32LE(this.uncompressedSize,A.UNCMP_SIZE),p.writeUInt16LE(this.filename.length,A.FNAME_LEN),p.writeUInt16LE(E,A.EXTRA_LEN),p.writeUInt16LE(t,A.COMMENT_LEN),p.writeUInt16LE(0,A.DISK_NUM),p.writeUInt16LE(this.intFileAttr>>>0,A.INT_FILE_ATTR),p.writeUInt32LE(this.extFileAttr>>>0,A.EXT_FILE_ATTR),p.writeUInt32LE(this.localHdrOffset,A.LOCAL_HDR_OFFSET),Buffer.from(_).copy(p,A.SIZE);let g=A.SIZE+b;t>0&&this.comment&&(Buffer.from(this.comment,"utf8").copy(p,g),g+=t);let y=g;if(this.universalTime&&(p.writeUInt16LE(R.UNV_TIME,y),p.writeUInt16LE(5,y+2),p.writeUInt8(1,y+4),p.writeUInt32LE(Math.floor(Date.now()/1e3),y+5),y+=9),i&&(p.writeUInt16LE(R.SHA256,y),p.writeUInt16LE(i.length,y+2),i.copy(p,y+4),y+=4+i.length),this.uid&&this.gid&&(p.writeUInt16LE(R.UID_GID,y),p.writeUInt16LE(11,y+2),p.writeUInt8(1,y+4),p.writeUInt8(4,y+5),p.writeUInt32LE(this.uid,y+6),p.writeUInt8(4,y+10),p.writeUInt32LE(this.gid,y+11),y+=15),this.isSymlink&&this.linkTarget){let C=Buffer.from(this.linkTarget,"utf8"),w=3+C.length;p.writeUInt16LE(R.SYMLINK,y),p.writeUInt16LE(w,y+2),p.writeUInt8(1,y+4),p.writeUInt16LE(C.length,y+5),C.copy(p,y+7),y+=4+w}if(this.isHardLink&&this.originalEntry&&this.inode!==null){let C=Buffer.from(this.originalEntry,"utf8"),w=7+C.length;p.writeUInt16LE(R.HARDLINK,y),p.writeUInt16LE(w,y+2),p.writeUInt8(1,y+4),p.writeUInt32LE(this.inode,y+5),p.writeUInt16LE(C.length,y+9),C.copy(p,y+11),y+=4+w}if(c&&(y=this.addUnicodePathField(p,y)),l&&(p.writeUInt16LE(R.AES,y),p.writeUInt16LE(7,y+2),p.writeUInt16LE(this.aesVersion,y+4),p.writeUInt16LE(17729,y+6),p.writeUInt8(this.aesStrength,y+8),p.writeUInt16LE(this.realCmpMethod,y+9),y+=Le),h){p.writeUInt16LE(R.NEO_CRYPTO,y),p.writeUInt16LE(Q,y+2);let C=y+4;for(let w=0;w<4;w++)p.writeUInt8(H[w],C+w);p.writeUInt8(this.neoCryptoPayloadVersion,C+4),p.writeUInt16LE(this.neoCryptoAlgorithm,C+5),p.writeUInt16LE(this.neoCryptoFlags,C+7),p.writeUInt16LE(0,C+9),y+=Re}return p}setDateTime(t){if(!t)return 0;let e=t.getFullYear()-1980,n=t.getMonth()+1,i=t.getDate(),o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),c=(e&127)<<9|(n&15)<<5|i&31,f=(o&31)<<11|(a&63)<<5|s>>1&31;return c<<16|f}parseDateTime(t){if(t==0)return null;let e=t>>16&65535,n=(e>>9&127)+1980,i=(e>>5&15)-1,o=e&31,a=t&65535,s=a>>11&31,c=a>>5&63,f=(a&31)<<1;return new Date(n,i,o,s,c,f)}toLocalDateString(){let t=this.parseDateTime(this.timeDateDOS);return t===null?"--/--/----":t.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}).slice(0,10)}toTimeString(){let t=this.parseDateTime(this.timeDateDOS);return t===null?"--:--":t.toTimeString().slice(0,5)}toFormattedDateString(){let t=this.parseDateTime(this.timeDateDOS);if(t==null)return"--/--/-- --:--";let e=t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${e} ${n}`}toFormattedUTCDateString(){let t=this.parseDateTime(this.timeDateDOS);if(t==null)return"--/--/-- --:--";let e=t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"UTC"});return`${e} ${n} UTC`}cmpMethodToString(){switch(this.cmpMethod){case I.STORED:return"Stored";case I.SHRUNK:return"Shrunk";case I.REDUCED1:return"Reduced-1";case I.REDUCED2:return"Reduced-2";case I.REDUCED3:return"Reduced-3";case I.REDUCED4:return"Reduced-4";case I.IMPLODED:return"Imploded";case I.DEFLATED:switch(this.bitFlags&6){case 0:return"Deflate-N";case 2:return"Deflate-M";case 4:return"Deflate-F";case 6:return"Deflate-S"}case I.ENHANCED_DEFLATE:return"Deflate-Enh";case I.IBM_TERSE:return"PKDCL-LZ77";case I.ZSTD:return"Zstandard";case I.AES_ENCRYPT:return this.aesStrength===3?"AES-256":this.aesStrength===2?"AES-192":this.aesStrength===1?"AES-128":"AES";default:return"Unknown"}}fileSystemToString(){switch(this.verMadeBy>>8){case P.MSDOS:return"MS-DOS";case P.AMIGA:return"Amiga";case P.OPENVMS:return"OpenVMS";case P.UNIX:return"Unix";case P.VM_CMS:return"VM/CMS";case P.ATARI:return"Atari ST";case P.OS2:return"OS/2 HPFS";case P.MAC:return"Macintosh";case P.CP_M:return"CP/M";case P.NTFS:return"Windows NTFS";case P.MVS:return"MVS (OS/390 - Z/OS)";case P.VSE:return"VSE";case P.ACORN:return"Acorn Risc";case P.ALTMVS:return"Alternate MVS";case P.BEOS:return"BeOS";case P.TANDEM:return"Tandem";case P.OS400:return"OS/400";case P.DARWIN:return"Apple OS/X (Darwin)";default:return"Unknown"}}compressionMethodCodeToString(t){if(t<0)return"Not set";switch(t){case I.STORED:return"Stored (0)";case I.DEFLATED:return"Deflated (8)";case I.ZSTD:return"Zstandard (93)";case I.BZIP2:return"BZIP2 (12)";case I.LZMA:return"LZMA (14)";case I.AES_ENCRYPT:return"AES wrapper (99)";default:return`code ${t}`}}logEncryptionDetails(){let t=(this.bitFlags&M.ENCRYPTED)!==0,e=(this.bitFlags&M.STRONG_ENCRYPT)!==0;x.log("Encryption (detailed): "),x.log(" GP flags: ",`bit0 encrypted=${t}, bit6 strong_encrypt=${e}`);let n=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0,i=!n&&this.neoCryptoAlgorithm>0;if(n){x.log(" Scheme: ",'WinZip AES (ZIP compression method 99 + extra 0x9901, vendor "AE")'),x.log(" AE variant: ",this.aesVersion===2?"AE-2 \u2014 CRC-32 in local/CEN headers is 0; plaintext integrity from HMAC-SHA1":"AE-1 \u2014 CRC-32 in headers is plaintext (uncompressed) CRC-32");let o=this.aesStrength===3?"AES-256 (extra field strength byte 3)":this.aesStrength===2?"AES-192 (2)":this.aesStrength===1?"AES-128 (1)":`Unknown (${this.aesStrength})`;x.log(" Key size: ",o),x.log(" Real compression (inside ciphertext): ",this.compressionMethodCodeToString(this.realCmpMethod)),x.log(' "Compressed size" in headers: ',"Length of full AES file data: salt + password verifier + ciphertext + 10-byte HMAC"),x.log(" Payload layout: ",`${ce} byte salt + ${Ce} byte verifier + encrypted(compressed) data + ${ue} byte HMAC (PBKDF2-HMAC-SHA1, WinZip AES-CTR)`),x.log(" Version needed to extract (from entry): ",`${this.verExtract}${this.verExtract===Ur?" (5.1 \u2014 typical for AES)":""}`),e?x.log(" Note: ","Strong-encrypt bit set \u2014 unusual for pure WinZip AES; confirm with extra fields."):x.log(" Typical WinZip AES: ","bit 6 (strong) usually clear; bit 0 (encrypted) set.")}else i?(x.log(" Scheme: ","NeoEncrypt (GP encrypted + NEO extra 0x024E; standard ZIP compression method in header)"),x.log(" NEO payload version / algorithm / flags: ",`${this.neoCryptoPayloadVersion} / ${this.neoCryptoAlgorithm} / ${this.neoCryptoFlags}`),x.log(" Compression after decrypt: ",this.compressionMethodCodeToString(this.cmpMethod)),x.log(" Ciphertext layout: ",`Same as WinZip AES-256 stream: ${ce} byte salt + ${Ce} byte verifier + encrypted(compressed) + ${ue} byte HMAC`),x.log(" CRC in headers: ","Plaintext CRC (AE-1 style) for algorithm 1")):t?(e?x.log(" Scheme: ","PKWARE strong encryption (GP bit 6) \u2014 not WinZip method 99; expect extras e.g. 0x0017"):x.log(" Scheme: ","Encrypted (bit 0) \u2014 typically legacy ZipCrypto if method \u2260 99"),x.log(" Compression method in header: ",`${this.cmpMethodToString()} (${this.cmpMethod})`)):x.log(" Scheme: ","Not encrypted")}dosAttributesToString(){let t=this.extFileAttr&65535;if(t===0)return"none";let e="";return e+=t&Ue.READONLY?"r":"-",e+=t&Ue.HIDDEN?"h":"-",e+=t&Ue.SYSTEM?"s":"-",e+=t&Ue.DIRECTORY?"d":"-",e+=t&Ue.ARCHIVE?"a":"-",e}showVerboseInfo(){if(x.log("=== Central Directory Entry (%s) ===",this.filename),x.log("unzip from start of archive: ",this.localHdrOffset),x.log("File system or operating system of origin: ",this.fileSystemToString()),x.log("Version of encoding software: ",this.verMadeBy),x.log("Compression Method: ",this.cmpMethodToString()),x.log("File Security Status: ",this.bitFlags&M.ENCRYPTED?this.bitFlags&M.STRONG_ENCRYPT?"Strong Encrypt":"Encrypted":"Not Encrypted"),this.logEncryptionDetails(),x.log("File Modified (DOS date/time) ",this.toFormattedDateString()),x.log("File Modified (UTC) ",this.toFormattedUTCDateString()),x.log("Compressed Size: ",this.compressedSize),x.log("UnCompressed Size: ",this.uncompressedSize),x.log(`32-bit CRC value (hex): ${this.crc.toString(16).padStart(8,"0")}`),x.log("Length of extra field: ",this.extraField?.length??0),x.log("Length of file comment: ",this.comment?.length??0),x.log("Unix File Attributes: "),x.log("MS-DOS File Attributes: ",this.dosAttributesToString()),this.extraField){x.log(`
7
- The Central-Directory Extra Field contains:`);try{for(let t=0;t<this.extraField.length;){if(t+4>this.extraField.length){x.log(` Warning: Truncated extra field at offset ${t}`);break}let e=this.extraField.readUInt16LE(t),n=e.toString(16).padStart(4,"0"),i=this.extraField.readUInt16LE(t+2);if(i<0||t+4+i>this.extraField.length){x.log(` Warning: Invalid extra field length (${i}) at offset ${t} for ID ${n}`);break}let o=this.extraField.subarray(t+4,t+4+i);try{if(e===R.SHA256)x.log(` ID[0x${n}] NeoZip-SHA256: ${o.toString("hex")}`);else if(e===R.UNV_TIME)if(i>=5){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=new Date(s*1e3);x.log(` ID[0x${n}] Universal Time: flags=${a}, time=${c.toISOString()}`)}else x.log(` ID[0x${n}] Universal Time: (invalid length ${i})`);else if(e===R.UID_GID)if(i>=5){let a=o.readUInt8(0),s=o.readUInt8(1);if(2+s>i)x.log(` ID[0x${n}] Unix UID/GID: (invalid UID size ${s})`);else{let c=o.readUIntLE(2,Math.min(s,4)),f=0;if(2+s+1<i){let l=o.readUInt8(2+s);2+s+1+l<=i&&(f=o.readUIntLE(2+s+1,Math.min(l,4)))}x.log(` ID[0x${n}] Unix UID/GID: version=${a}, uid=${c}, gid=${f}`)}}else x.log(` ID[0x${n}] Unix UID/GID: (invalid length ${i})`);else if(e===R.SYMLINK)if(i>=3){let a=o.readUInt8(0),s=o.readUInt16LE(1);if(s>0&&i>=3+s){let c=o.subarray(3,3+s).toString("utf8");x.log(` ID[0x${n}] Symbolic Link: version=${a}, target="${c}"`)}else x.log(` ID[0x${n}] Symbolic Link: (invalid target length ${s})`)}else x.log(` ID[0x${n}] Symbolic Link: (invalid length ${i})`);else if(e===R.HARDLINK)if(i>=11){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=o.readUInt16LE(5);if(c>0&&i>=7+c){let f=o.subarray(7,7+c).toString("utf8");x.log(` ID[0x${n}] Hard Link: version=${a}, inode=${s}, original="${f}"`)}else x.log(` ID[0x${n}] Hard Link: (invalid original length ${c})`)}else x.log(` ID[0x${n}] Hard Link: (invalid length ${i})`);else if(e===R.UNICODE_PATH)if(i>=5){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=o.subarray(5).toString("utf8"),f=Buffer.from(this.filename),l=te(f),d=s===l?"MATCH":"MISMATCH";x.log(` ID[0x${n}] Unicode Path: version=${a}, CRC32=${s.toString(16)} (${d})`),x.log(` Path: "${c}"`)}else x.log(` ID[0x${n}] Unicode Path: (invalid length ${i})`);else if(e===R.AES)if(i>=7){let a=o.readUInt16LE(0),s=String.fromCharCode(o[2],o[3]),c=o.readUInt8(4),f=o.readUInt16LE(5),l=c===3?"256-bit":c===2?"192-bit":c===1?"128-bit":"Unknown",d=a===2?"AE-2 (CRC=0 in headers)":a===1?"AE-1 (plaintext CRC in headers)":`vendorVer=${a}`;x.log(` ID[0x${n}] WinZip AES: ${d}, vendor="${s}", strength=${l}, realCompressionMethod=${f}`)}else x.log(` ID[0x${n}] WinZip AES: (invalid length ${i})`);else if(e===R.NEO_CRYPTO)if(i>=Q)if(o[0]===H[0]&&o[1]===H[1]&&o[2]===H[2]&&o[3]===H[3]){let a=o.readUInt8(4),s=o.readUInt16LE(5),c=o.readUInt16LE(7);x.log(` ID[0x${n}] NeoEncrypt: payloadVer=${a}, algorithm=${s}, flags=${c}`)}else x.log(` ID[0x${n}] NeoEncrypt: (invalid magic)`);else x.log(` ID[0x${n}] NeoEncrypt: (invalid length ${i})`);else if(e===R.ZIP64)if(x.log(` ID[0x${n}] ZIP64 Extended Information:`),i>=8){let a=0;if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Uncompressed Size (ZIP64): ${s.toString()} bytes`),a+=8}if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Compressed Size (ZIP64): ${s.toString()} bytes`),a+=8}if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Local Header Offset (ZIP64): ${s.toString()}`),a+=8}if(a+4<=i){let s=o.readUInt32LE(a);x.log(` Disk Number (ZIP64): ${s}`)}}else x.log(` ZIP64 Extended Information: (invalid length ${i})`);else{let a=i>0?o.slice(0,Math.min(16,i)).toString("hex"):"";x.log(` ID[0x${n}] Unknown field: length=${i} bytes${a?", data="+a+"...":""}`)}}catch(a){x.log(` Error parsing extra field ID[0x${n}]: ${a.message}`)}t+=4+i}}catch(t){x.log(` Error parsing extra fields: ${t.message}`)}}x.log(`
8
- `)}};var qt={version:"0.7.0",releaseDate:"2026-04-06"};var Ga="ZSTD requires Node.js with native zlib support (Node.js >= 22.15 or >= 23.8). Browser builds do not include a zstd codec; use Deflate or process zstd archives in Node.";function Ae(){throw new Error(Ga)}function Ka(){return!1}function Xa(r){return Ae()}function Wa(r){return Ae()}function qa(){return Ae()}async function ja(r,t){return Ae()}async function Ja(r){return Ae()}function Qa(r,t){return Ae()}function es(r){return Ae()}async function ts(r,t,e,n,i,o){return Ae()}async function*rs(r){Ae()}var gt={isNativeZstdAvailable:Ka,mapCompressionLevel:Xa,createCompressTransform:Wa,createDecompressTransform:qa,compress:ja,decompress:Ja,compressSync:Qa,decompressSync:es,compressChunks:ts,decompressStream:rs};var de=class r{constructor(t){this.crc32State=-1;this.sha256Hash=null;this.useSHA256=!1;this.hashes=[];this.xorResult=Buffer.alloc(32,0);this.enableAccumulation=!1;this.merkleLeaves=[];this.merkleLayers=[];this.merkleOptions={hashLeaves:!1,sortLeaves:!0,sortPairs:!0,duplicateOdd:!0};this.useSHA256=t?.useSHA256||!1,this.enableAccumulation=t?.enableAccumulation||!1,this.useSHA256&&(this.sha256Hash=it("sha256"))}update(t){for(let e=0;e<t.length;e++)this.crc32State=Wt(this.crc32State,t[e]);this.sha256Hash&&this.sha256Hash.update(t)}finalizeCRC32(){return~this.crc32State>>>0}finalizeSHA256(){return this.sha256Hash?this.sha256Hash.digest("hex"):null}reset(){this.crc32State=-1,this.sha256Hash&&(this.sha256Hash=it("sha256"))}addHash(t){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");let e=typeof t=="string"?Buffer.from(t,"hex"):t;this.hashes.push(e),this.merkleLeaves.push(e);for(let n=0;n<32;n++)this.xorResult[n]^=e[n];this.rebuildMerkleTree()}xorHash(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");return this.xorResult.toString("hex")}merkleRoot(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");if(this.merkleLeaves.length===0)return null;this.merkleLayers.length===0&&this.rebuildMerkleTree();let t=this.merkleLayers[this.merkleLayers.length-1];return t&&t.length>0?t[0].toString("hex"):null}leafCount(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");return this.hashes.length}clear(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");this.hashes=[],this.merkleLeaves=[],this.merkleLayers=[],this.xorResult=Buffer.alloc(32,0)}static combineResults(t){let e=new r({enableAccumulation:!0});for(let n of t)n.merkleRoot&&e.addHash(n.merkleRoot);return e.merkleRoot()}hash(t){return it("sha256").update(t).digest()}combinedHash(t,e){return this.merkleOptions.sortPairs&&Buffer.compare(t,e)>0&&([t,e]=[e,t]),this.hash(Buffer.concat([t,e]))}createHashes(t){for(;t.length>1;){let e=this.merkleLayers.length;this.merkleLayers.push([]);for(let n=0;n<t.length-1;n+=2){let i=t[n],o=t[n+1],a=this.combinedHash(i,o);this.merkleLayers[e].push(a)}if(t.length%2===1){let n=t[t.length-1];if(this.merkleOptions.duplicateOdd){let i=this.combinedHash(n,n);this.merkleLayers[e].push(i)}else this.merkleLayers[e].push(n)}t=this.merkleLayers[e]}}rebuildMerkleTree(){if(this.merkleLeaves.length===0){this.merkleLayers=[];return}let t=this.merkleLeaves.map(e=>this.merkleOptions.hashLeaves?this.hash(e):Buffer.isBuffer(e)?e:Buffer.from(e));this.merkleOptions.sortLeaves&&t.sort(Buffer.compare),this.merkleLayers=[t],this.createHashes(t)}getProof(t){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");this.merkleLayers.length===0&&this.rebuildMerkleTree();let e=this.merkleLeaves.findIndex(n=>n.equals(t));if(e===-1)throw new Error("Leaf not found in tree");return this.merkleLayers.reduce((n,i)=>{if(i.length===1)return n;let o=e%2===0?e+1:e-1;return o<i.length&&n.push(i[o]),e=Math.floor(e/2),n},[])}verify(t,e,n){let i=e;for(let o of t)i=Buffer.compare(i,o)<=0?this.combinedHash(i,o):this.combinedHash(o,i);return i.equals(n)}},yt=de;var ns=2*Ye+Ce,is=1e3,Nr=16,jt=class r{constructor(t){this.aesKey=t,this.counter=Buffer.alloc(Nr),this.counter[0]=1,this.keystream=this.encryptCounter(),this.ksPos=0}process(t){if(t.length===0)return Buffer.alloc(0);let e=Buffer.alloc(t.length);for(let n=0;n<t.length;n++)this.ksPos>=Nr&&(r.incrementCounterLE(this.counter),this.keystream=this.encryptCounter(),this.ksPos=0),e[n]=t[n]^this.keystream[this.ksPos++];return e}encryptCounter(){let t=ri("aes-256-ecb",this.aesKey,null);return t.setAutoPadding(!1),t.update(this.counter)}static incrementCounterLE(t){for(let e=0;e<Nr;e++)if(t[e]===255)t[e]=0;else{t[e]++;break}}},kr=class{constructor(t){this.headerSent=!1;this.finished=!1;this.salt=Xt(ce),this.keys=ne.deriveKeys(t,this.salt),this.ctr=new jt(this.keys.aesKey),this.hmac=Lr("sha1",this.keys.hmacKey)}header(){if(this.finished)throw new Error("AesEncryptor already finished");return this.headerSent=!0,Buffer.concat([this.salt,this.keys.passwordVerifier])}update(t){if(this.finished)throw new Error("AesEncryptor already finished");if(!this.headerSent)throw new Error("AesEncryptor.header() must be called before update()");if(t.length===0)return Buffer.alloc(0);let e=this.ctr.process(t);return this.hmac.update(e),e}finish(){if(this.finished)throw new Error("AesEncryptor already finished");if(!this.headerSent)throw new Error("AesEncryptor.header() must be called before finish()");return this.finished=!0,this.hmac.digest().subarray(0,ue)}},vr=class{constructor(t,e){this.keys=null;this.ctr=null;this.hmac=null;this.headerBuf=Buffer.alloc(0);this.authBuf=Buffer.alloc(0);this.headerDone=!1;this.verified=!1;if(e<Vt)throw new Error("AES decryption failed: payload too short");this.password=t,this.cipherLen=e-Vt,this.remainingCipher=this.cipherLen}push(t){let e=t;if(!this.headerDone){this.headerBuf=Buffer.concat([this.headerBuf,e]);let s=ce+Ce;if(this.headerBuf.length<s)return Buffer.alloc(0);let c=this.headerBuf.subarray(0,ce),f=this.headerBuf.subarray(ce,s);if(this.keys=ne.deriveKeys(this.password,c),!this.keys.passwordVerifier.equals(f))throw new Error("AES decryption failed: wrong password");this.ctr=new jt(this.keys.aesKey),this.hmac=Lr("sha1",this.keys.hmacKey),this.headerDone=!0,e=this.headerBuf.subarray(s),this.headerBuf=Buffer.alloc(0)}if(e.length===0)return Buffer.alloc(0);let n=Math.min(e.length,this.remainingCipher),i=e.subarray(0,n),o=e.subarray(n);if(o.length>0&&(this.authBuf=Buffer.concat([this.authBuf,o])),i.length===0)return this.tryVerify(),Buffer.alloc(0);this.hmac.update(i);let a=this.ctr.process(i);return this.remainingCipher-=i.length,this.tryVerify(),a}end(){if(this.remainingCipher>0)throw new Error("AES decryption failed: truncated ciphertext");if(this.tryVerify(),!this.verified)throw new Error("AES decryption failed: missing authentication code")}tryVerify(){if(this.verified||this.remainingCipher>0||!this.hmac||this.authBuf.length<ue)return;let t=this.authBuf.subarray(0,ue);if(!this.hmac.digest().subarray(0,ue).equals(t))throw new Error("AES decryption failed: authentication code mismatch (data corrupted or tampered)");this.verified=!0}},ne=class r{static deriveKeys(t,e){let n=Buffer.isBuffer(t)?t:Buffer.from(t),i=ti(n,e,is,ns,"sha1");return{aesKey:i.subarray(0,Ye),hmacKey:i.subarray(Ye,2*Ye),passwordVerifier:i.subarray(2*Ye)}}static createEncryptor(t){return new kr(t)}static createDecryptor(t,e){return new vr(t,e)}static encryptBuffer(t,e,n){let i=r.createEncryptor(n),o=[i.header()];return e.length>0&&o.push(i.update(e)),o.push(i.finish()),Buffer.concat(o)}static decryptBuffer(t,e,n){let i=r.createDecryptor(n,e.length),o=i.push(e);return i.end(),o}static async*decryptStream(t,e,n){let i=r.createDecryptor(t,e);for await(let o of n){let a=i.push(o);a.length>0&&(yield a)}i.end()}static buildAesExtraField(t,e=1){let n=Buffer.alloc(Le);return n.writeUInt16LE(R.AES,0),n.writeUInt16LE(7,2),n.writeUInt16LE(e,4),n.writeUInt16LE(17729,6),n.writeUInt8(3,8),n.writeUInt16LE(t,9),n}static parseAesExtraField(t){return{vendorVersion:t.readUInt16LE(0),vendorId:String.fromCharCode(t[2],t[3]),encryptionStrength:t.readUInt8(4),realCmpMethod:t.readUInt16LE(5)}}};var Jt=1,Qt=class r{static buildPayloadV1(t=Jt,e=0,n=0){let i=Buffer.alloc(Q);for(let o=0;o<4;o++)i[o]=H[o];return i.writeUInt8(1,4),i.writeUInt16LE(t,5),i.writeUInt16LE(e,7),i.writeUInt16LE(n,9),i}static buildExtraFieldRecordV1(t=Jt,e=0,n=0){let i=Buffer.alloc(Re);return i.writeUInt16LE(R.NEO_CRYPTO,0),i.writeUInt16LE(Q,2),r.buildPayloadV1(t,e,n).copy(i,4),i}static tryParsePayload(t){return t.length<Q||t[0]!==H[0]||t[1]!==H[1]||t[2]!==H[2]||t[3]!==H[3]?null:{payloadVersion:t.readUInt8(4),algorithm:t.readUInt16LE(5),flags:t.readUInt16LE(7),reserved:t.readUInt16LE(9)}}static parsePayload(t){let e=r.tryParsePayload(t);if(!e||e.payloadVersion!==1)throw new Error("NeoEncrypt: invalid NEO crypto extra field");return e}static encryptBuffer(t,e,n){return ne.encryptBuffer(t,e,n)}static decryptBuffer(t,e,n){return ne.decryptBuffer(t,e,n)}};var Ho=In(),Ot=class Ot{log(...t){Ot.loggingEnabled&&x.debug("[ZipCompress]",...t)}constructor(t){this.zipkit=t,this.debug=!1,Ot.loggingEnabled&&x.setLevel("debug"),this.log("ZipCompress initialized")}async compressData(t,e,n,i){this.log(`compressData() called for entry: ${t.filename}`),(!t.uncompressedSize||t.uncompressedSize===0)&&(t.uncompressedSize=e.length);let o=e.length,a=n?.bufferSize||this.zipkit.getBufferSize();this.log(`Compressing ${o} bytes for entry: ${t.filename}`),this.log("Compression options:",{level:n?.level,useZstd:n?.useZstd,bufferSize:a});let s;n?.level===0?(s=I.STORED,this.log("Using STORED method (no compression)")):n?.useZstd?o<100?(s=I.STORED,this.log(`ZSTD fallback to STORED (file too small: ${o} bytes)`)):(s=I.ZSTD,this.log("Using ZSTD method (zstd compression)")):(s=I.DEFLATED,this.log("Using DEFLATED method (default compression)")),t.cmpMethod=s;let f=!t.crc||t.crc===0||n?.useSHA256&&!t.sha256?new de({useSHA256:n?.useSHA256&&!t.sha256||!1}):null;f&&(f.update(e),(!t.crc||t.crc===0)&&(t.crc=f.finalizeCRC32()),n?.useSHA256&&!t.sha256&&(t.sha256=f.finalizeSHA256()),this.log(`Final hashes: CRC32=0x${t.crc.toString(16).padStart(8,"0")}, SHA256=${t.sha256||"N/A"}`));let l=n?.encryptionMethod,d=l==="zipcrypto",h=l==="neo-aes256",u=n?.password&&!d&&!h;if(n?.password){let b=d?"ZipCrypto":h?"NeoEncrypt (AES-256)":"WinZip AES-256";this.log(`Encrypting compressed data for entry: ${t.filename} (method: ${b})`),t.bitFlags=(t.bitFlags||0)|M.ENCRYPTED,t.isEncrypted=!0}let E,_=s===I.ZSTD?"ZSTD":s===I.DEFLATED?"DEFLATED":"STORED";return s===I.STORED?E=e:(this.log(`Processing sequence for ${_}: [HASH] -> [COMPRESS] -> [OUTPUT]`),this.log(`Compressing: method=${_}, input=${o} bytes, buffer size=${a} bytes`),this.log(`Calculating hashes: CRC32=${!t.crc||t.crc===0}, SHA256=${n?.useSHA256}`),s===I.ZSTD?E=await this.zstdCompress(e,n,a,t,i):E=await this.deflateCompress(e,n,a,t,i)),n?.password&&(h?E=this.encryptCompressedDataNeo(t,E,n.password):u?E=this.encryptCompressedDataAes(t,E,n.password):E=this.encryptCompressedData(t,E,n.password)),t.compressedSize=E.length,E}async deflateCompress(t,e,n,i,o){this.log(`deflateCompress() called - entry: ${i?.filename??"unknown"}, bufferSize: ${n}, level: ${e?.level??6}`);let a=n||this.zipkit.getBufferSize(),s=e?.level??6;if(typeof t=="object"&&"totalSize"in t&&"onReadChunk"in t)throw new Error("Chunked reader mode not supported in ZipCompress");if(t.length<=a)return this.deflate(t,e);let c=new Ho.Deflate({level:s,raw:!0}),f=[],l=0,d=0;try{for(let u=0;u<t.length;u+=a){let E=t.slice(u,u+a),_=u+a>=t.length;if(c.push(E,_),c.result&&c.result.length>0){let b=Buffer.from(c.result);f.push(b),d+=b.length,o&&await o(b)}l+=E.length}let h=l>0?Math.round(d/l*100):0;return this.log(`Final hashes: CRC32=0x${i?.crc?.toString(16).padStart(8,"0")}, SHA256=${i?.sha256||"N/A"}`),this.log(`Deflate compression complete: ${d} bytes from ${l} bytes (ratio=${h}%)`),Buffer.concat(f)}catch(h){throw new Error(`Deflate compression failed: ${h instanceof Error?h.message:String(h)}`)}}deflate(t,e){this.log(`deflate() called with buffer size: ${t.length}, level: ${e?.level??6}`);let n=e?.level??6,i=Ho.deflateRaw(t,{level:n}),o=t.length>0?Math.round(i.length/t.length*100):0;return this.log(`Deflate compression complete: ${i.length} bytes from ${t.length} bytes (ratio=${o}%)`),Buffer.from(i.buffer,i.byteOffset,i.byteLength)}async zstdCompress(t,e,n,i,o){this.log(`zstdCompress() called - entry: ${i?.filename??"unknown"}, bufferSize: ${n}, level: ${e?.level??6}`);let a=n||this.zipkit.getBufferSize(),s=e?.level??6,c=Buffer.isBuffer(t),f=c?t.length:t.totalSize;if(!f)throw new Error("ZSTD compression: empty input buffer");if(e?.level===0){if(c)return o&&await o(t),t;let u=[],E=0;for(;E<f;){let _=Math.min(a,f-E),b=t.readChunk(E,_);o?await o(b):u.push(b),E+=b.length}return o?Buffer.alloc(0):Buffer.concat(u)}let l=c?(u,E)=>t.subarray(u,u+E):t.readChunk.bind(t),d=[],h=await gt.compressChunks(l,f,a,s,void 0,async u=>{o?await o(u):d.push(u)});return i&&(i.compressedSize=h),o?Buffer.alloc(0):Buffer.concat(d)}encryptCompressedData(t,e,n){this.log(`encryptCompressedData() called for entry: ${t.filename}, compressed size: ${e.length}`);let o=new q().encryptBuffer(t,e,n);return this.log(`Encryption complete: ${e.length} bytes compressed -> ${o.length} bytes encrypted (includes ${Te}-byte header)`),o}encryptCompressedDataNeo(t,e,n){this.log(`encryptCompressedDataNeo() called for entry: ${t.filename}, compressed size: ${e.length}`);let i=Qt.encryptBuffer(t,e,n);return t.neoCryptoPayloadVersion=1,t.neoCryptoAlgorithm=Jt,t.neoCryptoFlags=0,this.log(`NeoEncrypt encryption complete: ${e.length} bytes -> ${i.length} bytes`),i}encryptCompressedDataAes(t,e,n){this.log(`encryptCompressedDataAes() called for entry: ${t.filename}, compressed size: ${e.length}`);let i=ne.encryptBuffer(t,e,n);return t.realCmpMethod=t.cmpMethod,t.cmpMethod=I.AES_ENCRYPT,t.aesVersion=1,t.aesStrength=3,this.log(`AES-256 encryption complete: ${e.length} bytes -> ${i.length} bytes (salt+verifier+data+hmac)`),i}async compressFileBuffer(t,e,n){this.log(`compressFileBuffer() called for entry: ${t.filename}, size: ${e.length}`),t.uncompressedSize=e.length;let i=new de({useSHA256:n?.useSHA256||!1});return i.update(e),t.crc=i.finalizeCRC32(),n?.useSHA256&&(t.sha256=i.finalizeSHA256(),this.log(`SHA-256 calculated: ${t.sha256}`)),await this.compressData(t,e,n)}};Ot.loggingEnabled=!1;var xt=Ot;var $o=18,bc=Buffer.from([40,181,47,253]);function Yo(r){let t=new de;return t.update(r),t.finalizeCRC32()}function Vo(r,t,e){let n=t>>>0;if(r.length===n+$o&&r.subarray(n).equals(Buffer.alloc($o))){let i=r.subarray(0,n);return e!==void 0&&e!==0&&Yo(i)!==e>>>0?{repaired:r,wasLegacy:!1}:{repaired:i,wasLegacy:!0}}if(r.length>n&&n>0){let i=r.subarray(0,n);if(e!==void 0&&e!==0&&Yo(i)===e>>>0)return{repaired:i,wasLegacy:!0}}return{repaired:r,wasLegacy:!1}}var sl=In(),Ft=class Ft{log(...t){Ft.loggingEnabled&&x.debug("[ZipDecompress]",...t)}constructor(t){this.zipkit=t,this.debug=!1,Ft.loggingEnabled&&x.setLevel("debug")}async extract(t,e){if(!this.zipkit.hasInBuffer())throw new Error("extract() requires Buffer-based ZIP. Use ZipkitNode.extractToFile() for file-based ZIP or call loadZip() first.");this.log(`extract() called for entry: ${t.filename}, method: ${t.cmpMethod}, skipHashCheck: ${e}`);let n=this.zipkit.ensureBuffer(),i=this.zipkit.parseLocalHeader(t,n),o=this.zipkit?.password,a=t.aesVersion>0||t.cmpMethod===I.AES_ENCRYPT,s=t.neoCryptoAlgorithm>0;if(t.isEncrypted&&o&&(this.log(`Starting in-memory decryption for entry: ${t.filename} (${a||s?"AES-256 stream (WinZip or Neo)":"ZipCrypto"})`),a||s?i=ne.decryptBuffer(t,i,o):i=new q().decryptBuffer(t,n,i,o),this.log(`Decryption successful, decrypted compressed data length: ${i.length}`)),i.length===0)return null;let c=a&&t.aesVersion===2?!0:e;return this.unCompress(i,t,c)}inflate(t){this.log(`inflate() called with ${t.length} bytes`);let e=sl.inflateRaw(t);return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}async zstdDecompressSync(t,e){this.log(`zstdDecompressSync() called with ${t.length} bytes`);try{let n=await gt.decompress(t);if(e&&e.uncompressedSize>0){let{repaired:i,wasLegacy:o}=Vo(n,e.uncompressedSize,e.crc);o&&this.log(`Legacy WASM zstd padding repaired: ${n.length} -> ${i.length} bytes`),n=i}return this.log(`ZSTD decompression successful: ${t.length} bytes -> ${n.length} bytes`),n}catch(n){throw this.log(`ZSTD decompression failed: ${n}`),new Error(`ZSTD decompression failed: ${n instanceof Error?n.message:String(n)}`)}}async unCompress(t,e,n){let i=e.cmpMethod===I.AES_ENCRYPT&&e.realCmpMethod>=0?e.realCmpMethod:e.cmpMethod;if(this.log(`unCompress() called for entry: ${e.filename}, method: ${i}, data length: ${t.length}`),t.length===0)return Buffer.alloc(0);let o;if(i===I.STORED)o=t;else if(i===I.DEFLATED)o=this.inflate(t);else if(i===I.ZSTD)o=await this.zstdDecompressSync(t,e);else throw new Error(`Unsupported compression method: ${i}`);if(!n){if(e.sha256){if(!this.zipkit.testSHA256(e,o))throw new Error(O.INVALID_SHA256)}else if(!this.zipkit.testCRC32(e,o))throw new Error(O.INVALID_CRC)}return o}};Ft.loggingEnabled=!1;var Bn=Ft,Go=Bn;var Je=class{constructor(t={}){this.inBuffer=null;this.zipEntries=[];this.centralDirSize=0;this.centralDirOffset=0;this.zipComment=null;this._zipkitCmp=null;this._zipkitDeCmp=null;this.config={bufferSize:t.bufferSize||512*1024,debug:t.debug||!1},this.config.debug&&x.setLevel("debug")}getZipCompress(){return this._zipkitCmp||(this._zipkitCmp=new xt(this)),this._zipkitCmp}getZipDecompress(){return this._zipkitDeCmp||(this._zipkitDeCmp=new Go(this)),this._zipkitDeCmp}getBufferSize(){return this.config.bufferSize||512*1024}hasInBuffer(){return this.inBuffer!==null&&this.inBuffer.length>0}async compressData(t,e,n,i){return this.getZipCompress().compressData(t,e,n,i)}async deflateCompress(t,e,n,i,o){return this.getZipCompress().deflateCompress(t,e,n,i,o)}deflate(t,e){return this.getZipCompress().deflate(t,e)}async zstdCompress(t,e,n,i,o){return this.getZipCompress().zstdCompress(t,e,n,i,o)}async compressFileBuffer(t,e,n){return this.getZipCompress().compressFileBuffer(t,e,n)}async extract(t,e){return this.getZipDecompress().extract(t,e)}loadZip(t){this.resetZipData(),this.inBuffer=t,this.loadEOCDFromBuffer(t);let e=this.getDirectoryFromBuffer();return this.zipEntries=e,e}resetZipData(){this.inBuffer=null,this.zipEntries=[],this.reset(),this.zipComment=null,this._zipkitCmp=null,this._zipkitDeCmp=null}getDirectory(t){return this.zipEntries}getZipEntry(t){try{return this.getDirectory().find(n=>n.filename===t)||null}catch{return null}}ensureBuffer(){return this.inBuffer||(this.inBuffer=Buffer.alloc(0)),this.inBuffer}parseLocalHeader(t,e){let n=e.subarray(t.localHdrOffset);if(n.readUInt32LE(0)!==k.SIGNATURE)throw new Error(O.INVALID_CEN);let i=n.readUInt16LE(k.FLAGS),o=n.readUInt16LE(k.FNAME_LEN),a=n.readUInt16LE(k.EXTRA_LEN),s=k.SIZE+o+a,c=t.aesVersion>0||t.cmpMethod===I.AES_ENCRYPT,f=t.neoCryptoAlgorithm>0;if(c||f){let u=s,E=s+t.compressedSize;return n.subarray(u,E)}let l=0;i&M.ENCRYPTED&&(l=Te);let d=s+l,h=s+t.compressedSize;return n.subarray(d,h)}testCRC32(t,e){let n=te(e),i=n===t.crc;return x.debug(`[DEBUG] testCRC32() comparison: calculated=${n}, stored=${t.crc}, isValid=${i?"\u2713":"\u2717"}, DATA_DESC=${(t.bitFlags&8)!==0?"YES":"NO"}`),i}testSHA256(t,e){if(!t.sha256)throw new Error(O.UNKNOWN_SHA256);let n=ot(e),i=n===t.sha256;return x.debug(`[DEBUG] testSHA256() comparison: calculated=${n}, stored=${t.sha256}, isValid=${i?"\u2713":"\u2717"}`),i}getMemoryUsage(){let t=this.inBuffer?.length||0,e=this.zipEntries.length*1024,n;return this.inBuffer?n="buffer":n="none",{backend:n,memoryUsage:t+e,entries:this.zipEntries.length}}createZipEntry(t,e,n){let i=new re(t,null,!1);return e?(i.crc=te(e),i.uncompressedSize=e.length,i.compressedSize=e.length):(i.crc=0,i.uncompressedSize=0,i.compressedSize=0),i.cmpMethod=I.STORED,i.bitFlags=0,this.zipEntries.push(i),i}async copyEntry(t){if(t.cmpData){let e=t.createLocalHdr();return Buffer.concat([e,t.cmpData])}throw new Error("Cannot copy entry: no compressed data available")}get centralEndHdr(){return(t,e)=>{let n=this.zipEntries.length;return this.centralEndHdrMethod(t,e,n)}}getZipComment(){return this.zipComment}loadEOCDFromBuffer(t){let e=t.length,n=Math.min(65557,e),i=e-n,o=t.subarray(i,i+n),a=-1;for(let f=o.length-22;f>=0;f--)if(o[f]===80&&o.readUInt32LE(f)===ee.SIGNATURE){a=i+f;break}if(a===-1)throw new Error(O.INVALID_FORMAT);let s=t.subarray(a,a+22);if(s.readUInt32LE(0)===ee.SIGNATURE){if(this.centralDirSize=s.readUInt32LE(ee.CENTRAL_DIR_SIZE),this.centralDirOffset=s.readUInt32LE(ee.CENTRAL_DIR_OFFSET),this.centralDirOffset===4294967295){let f=a-20,l=t.subarray(f,f+20);if(l.readUInt32LE(0)===Br.SIGNATURE){let d=Number(l.readBigUInt64LE(8)),h=t.subarray(d,d+56);this.centralDirSize=Number(h.readBigUInt64LE(Gt.CENTRAL_DIR_SIZE)),this.centralDirOffset=Number(h.readBigUInt64LE(Gt.CENTRAL_DIR_OFFSET))}}}else throw new Error(O.INVALID_FORMAT);let c=s.readUInt16LE(ee.ZIP_COMMENT_LEN);if(c>0){let f=a+22;this.zipComment=t.subarray(f,f+c).toString()}}getDirectoryFromBuffer(){if(!this.inBuffer)return[];let t=this.inBuffer,e=[],n=this.centralDirOffset,i=this.centralDirSize,o=this.config.bufferSize||512*1024;for(;i>0;){let a=Math.min(o,i),s=t.subarray(n,n+a),c=0;for(;c<s.length&&s.readUInt32LE(c)===A.SIGNATURE;){let f=new re(null,null,!1),l=s.subarray(c),d=f.readZipEntry(l);e.push(f),c+=l.length-d.length}n+=a,i-=a}return e}reset(){this.centralDirSize=0,this.centralDirOffset=0}centralEndHdrMethod(t,e,n){let i=Buffer.alloc(ee.SIZE);return i.writeUInt32LE(ee.SIGNATURE,0),i.writeUInt16LE(0,4),i.writeUInt16LE(0,6),i.writeUInt16LE(n,8),i.writeUInt16LE(n,10),i.writeUInt32LE(t,12),i.writeUInt32LE(e,16),i.writeUInt16LE(0,20),i}getMerkleRoot(){let t;try{t=this.getDirectory()}catch(o){return x.error(`getMerkleRoot(): Error calling getDirectory(): ${o instanceof Error?o.message:String(o)}`),x.error(`getMerkleRoot(): Stack trace: ${o instanceof Error?o.stack:"No stack trace"}`),null}if(!t||t.length===0)return null;let e=new yt({enableAccumulation:!0}),n=t.filter(o=>{let a=o.filename||"";return a!==se&&a!==fe&&a!==le});for(let o of n)if(o.sha256){let a=Buffer.from(o.sha256,"hex");e.addHash(a)}let i=e.merkleRoot();return i||null}async getMerkleRootAsync(){let t=[];try{if(this.inBuffer)t=this.getDirectory();else return x.error("getMerkleRootAsync() called on file-based ZIP. Use ZipkitServer.getMerkleRootAsync() instead."),null}catch(o){return x.error(`Failed to get directory for merkle root calculation: ${o instanceof Error?o.message:String(o)}`),null}if(!t||t.length===0)return null;let e=new yt({enableAccumulation:!0}),n=t.filter(o=>{let a=o.filename||"";return a!==se&&a!==fe&&a!==le});for(let o of n)if(o.sha256){let a=Buffer.from(o.sha256,"hex");e.addHash(a)}let i=e.merkleRoot();return i||null}};Je.version=qt.version,Je.releaseDate=qt.releaseDate;var hr=class{constructor(t){this.zipkit=t}calculateLocalHeaderSize(t,e){if(e.localHdrOffset+k.SIZE>t.length)throw new Error(`Local header offset ${e.localHdrOffset} is beyond buffer size ${t.length} for entry ${e.filename}`);let n=t.subarray(e.localHdrOffset,e.localHdrOffset+k.SIZE);if(n.readUInt32LE(0)!==k.SIGNATURE)throw new Error(`Invalid local file header signature for entry ${e.filename} at offset ${e.localHdrOffset}`);let i=n.readUInt16LE(k.FNAME_LEN),o=n.readUInt16LE(k.EXTRA_LEN);return k.SIZE+i+o}copyEntryBytes(t,e){let n=this.calculateLocalHeaderSize(t,e),i=(e.bitFlags&M.DATA_DESC)!==0,o=n+e.compressedSize+(i?16:0);if(e.localHdrOffset+o>t.length)throw new Error(`Entry ${e.filename} extends beyond buffer size: offset ${e.localHdrOffset} + size ${o} > buffer length ${t.length}`);let a=t.subarray(e.localHdrOffset,e.localHdrOffset+o);if(i){let s=n+e.compressedSize,c=a.readUInt32LE(s);if(c!==134695760)throw new Error(`Invalid data descriptor signature for entry ${e.filename} (expected 0x08074b50, got 0x${c.toString(16)})`)}return Buffer.from(a)}cloneEntryWithOffset(t,e){let n=new re(t.filename,t.comment||null,t.debug);return n.verMadeBy=t.verMadeBy,n.verExtract=t.verExtract,n.bitFlags=t.bitFlags,n.cmpMethod=t.cmpMethod,n.timeDateDOS=t.timeDateDOS,n.crc=t.crc,n.compressedSize=t.compressedSize,n.uncompressedSize=t.uncompressedSize,n.volNumber=t.volNumber,n.intFileAttr=t.intFileAttr,n.extFileAttr=t.extFileAttr,n.localHdrOffset=e,t.extraField&&(n.extraField=Buffer.from(t.extraField)),n.isEncrypted=t.isEncrypted,n.isStrongEncrypt=t.isStrongEncrypt,n.isDirectory=t.isDirectory,n.isMetaData=t.isMetaData,n.isUpdated=t.isUpdated,n.platform=t.platform,n.universalTime=t.universalTime,n.uid=t.uid,n.gid=t.gid,n.sha256=t.sha256,n.isSymlink=t.isSymlink,n.linkTarget=t.linkTarget,n.isHardLink=t.isHardLink,n.originalEntry=t.originalEntry,n.inode=t.inode,n}buildCentralDirectoryAndEOCDBuffer(t,e,n){let i=[];for(let d of t)i.push(d.centralDirEntry());let o=Buffer.concat(i),a=o.length,s=Buffer.from(e,"utf8"),c=Math.min(s.length,65535),f=Buffer.alloc(22+c),l=0;return f.writeUInt32LE(ee.SIGNATURE,l),l+=4,f.writeUInt16LE(0,l),l+=2,f.writeUInt16LE(0,l),l+=2,f.writeUInt16LE(t.length,l),l+=2,f.writeUInt16LE(t.length,l),l+=2,f.writeUInt32LE(a,l),l+=4,f.writeUInt32LE(n,l),l+=4,f.writeUInt16LE(c,l),l+=2,c>0&&s.copy(f,l,0,c),Buffer.concat([o,f])}async copyZipEntriesOnly(t,e){let n=this.zipkit.loadZip(t),i=e?.entryFilter?n.filter(e.entryFilter):n;if(e?.entrySorter&&(i=[...i].sort(e.entrySorter)),i.length===0)throw new Error("No entries to copy after filtering");let o=[],a=0,s=[];for(let f of i){let l=a,d=this.copyEntryBytes(t,f);o.push(d),a+=d.length;let h=this.cloneEntryWithOffset(f,l);s.push(h)}let c=Buffer.concat(o);return{entryDataBuffer:c,dataEndOffset:c.length,copiedEntries:s}}writeCentralDirectoryAndEOCD(t,e){if(t.length===0)throw new Error("At least one entry is required to finalize");let n=e?.zipComment??"",i=e?.centralDirOffset??0;return this.buildCentralDirectoryAndEOCDBuffer(t,n,i)}async copyZipBuffer(t,e){let{entryDataBuffer:n,dataEndOffset:i,copiedEntries:o}=await this.copyZipEntriesOnly(t,e),a=e?.preserveComments!==!1&&this.zipkit.getZipComment()?this.zipkit.getZipComment():"",s=this.writeCentralDirectoryAndEOCD(o,{zipComment:a,centralDirOffset:i}),c=Buffer.concat([n,s]);return{entries:o.map(f=>({filename:f.filename,localHeaderOffset:f.localHdrOffset,compressedSize:f.compressedSize})),centralDirOffset:i,totalEntries:o.length,zipBuffer:c}}};var fl={base64:!0,array:!0,string:!0,isNode:!0,buffer:!0,uint8array:!0,arrayBuffer:typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",blob:!0,streams:!0,fileReader:!1},Qe=fl;var we={STRING:"string",BUFFER:"buffer",ARRAY:"array",ARRAYBUFFER:"arraybuffer",U8ARRAY:"uint8array",BLOB:"blob",STREAM:"stream"};function ll(r,t){var e=Buffer.from(r.subarray(t,t+8));return e.swap64(),parseInt(`0x${e.toString("hex")}`)}var cl=(r,t)=>Math.imul(r,t)>>>0;function ul(r){if(!r||typeof r!="object")return!1;let t=r;return typeof t.on=="function"&&typeof t.pause=="function"&&typeof t.resume=="function"}function dr(r){if(typeof r=="string"){if(!Qe.string)throw new Error(O.DATATYPE_STRING_UNSUPPORTED);return we.STRING}else if(Object.prototype.toString.call(r)==="[object Array]"){if(!Qe.array)throw new Error(O.DATATYPE_ARRAY_UNSUPPORTED);return we.ARRAY}else if(Buffer.isBuffer(r)){if(!Qe.buffer)throw new Error(O.DATATYPE_BUFFER_UNSUPPORTED);return we.BUFFER}else if(r instanceof Blob){if(!Qe.blob)throw new Error(O.DATATYPE_BLOB_UNSUPPORTED);return we.BLOB}else if(r instanceof Uint8Array){if(!Qe.uint8array)throw new Error(O.DATATYPE_U8ARRAY_UNSUPPORTED);return we.U8ARRAY}else if(r instanceof ArrayBuffer){if(!Qe.arrayBuffer)throw new Error(O.DATATYPE_ARRAYBUFFER_UNSUPPORTED);return we.ARRAYBUFFER}else throw new Error(O.DATATYPE_UNSUPPORTED)}var hl=r=>r===se||r===fe||r===le;var pr=class{constructor(t,e){this.lastReportedPercent=-1;this.fileName=t,this.totalBytes=e,this.processedBytes=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime}update(t){this.processedBytes+=t,this.reportProgress()}setTotalBytes(t){this.totalBytes=t}reportProgress(){let t=Date.now(),e=Math.floor(this.processedBytes/this.totalBytes*100);(e>this.lastReportedPercent||t-this.lastUpdateTime>500)&&(this.lastReportedPercent=e,this.lastUpdateTime=t,this.printProgress())}printProgress(){let t=(Date.now()-this.startTime)/1e3,e=this.processedBytes/t,n=this.totalBytes>this.processedBytes?(this.totalBytes-this.processedBytes)/e:0,i=Math.floor(this.processedBytes/this.totalBytes*100),o=s=>{let c=["B","KB","MB","GB"],f=s,l=0;for(;f>=1024&&l<c.length-1;)f/=1024,l++;return`${f.toFixed(1)}${c[l]}`},a=s=>s<60?`${s.toFixed(0)}s`:s<3600?`${Math.floor(s/60)}m ${(s%60).toFixed(0)}s`:`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`;process.stdout.write(`\r${this.fileName}: ${i}% (${o(this.processedBytes)}/${o(this.totalBytes)}) [${o(e)}/s] ETA: ${a(n)}`)}complete(){let t=(Date.now()-this.startTime)/1e3,e=this.processedBytes/t,n=i=>{let o=["B","KB","MB","GB"],a=i,s=0;for(;a>=1024&&s<o.length-1;)a/=1024,s++;return`${a.toFixed(1)}${o[s]}`};console.log(`\r${this.fileName}: 100% (${n(this.processedBytes)}) [${n(e)}/s] completed in ${t.toFixed(1)}s`)}getProgressPercent(){return Math.floor(this.processedBytes/this.totalBytes*100)}getProcessingRate(){let t=(Date.now()-this.startTime)/1e3;return this.processedBytes/t}};var mr=class{constructor(){this.providers=new Map;this.registerProvider(new q)}registerProvider(t){t.canHandle(1)&&this.providers.set(1,t),t.canHandle(2)&&this.providers.set(2,t)}getAvailableMethods(){return Array.from(this.providers.keys())}getProvider(t){return this.providers.get(t)||null}async encrypt(t,e){let n=this.getProvider(e.method);return n?await n.encrypt(t,e):{success:!1,error:`No encryption provider available for method ${e.method}`}}async decrypt(t,e){let n=this.getProvider(e.method);return n?await n.decrypt(t,e):{success:!1,error:`No decryption provider available for method ${e.method}`}}getRecommendedMethod(){return 2}validateOptions(t){let e=[];return t.method||e.push("Encryption method is required"),(!t.password||t.password.length===0)&&e.push("Password is required"),t.password&&t.password.length<4&&e.push("Password must be at least 4 characters long"),{isValid:e.length===0,errors:e}}getMethodInfo(t){let e=this.getProvider(t);return e?{name:e.getMethodName(),keyLength:e.getKeyLength(),secure:t===2}:null}listMethods(){let t=[];for(let[e,n]of this.providers)t.push({method:e,name:n.getMethodName(),keyLength:n.getKeyLength(),secure:e===2});return t.sort((e,n)=>e.name.localeCompare(n.name))}};var Dn=new Date,dl=`${String(Dn.getMonth()+1).padStart(2,"0")}-${String(Dn.getDate()).padStart(2,"0")}-${Dn.getFullYear()}`,pl={number:"1.0.2",date:dl};var Ko=Je;var Pt=class extends Ko{constructor(){super()}async loadZipBlob(t){if(dr(t)!==we.BLOB)throw new Error(O.DATATYPE_UNSUPPORTED);return new Promise((e,n)=>{let i=new window.FileReader;i.readAsArrayBuffer(t),i.onload=o=>{if(!i.result){n(new Error("Failed to read file"));return}try{let a=Buffer.from(i.result),s=super.loadZip(a);e(s)}catch(a){n(a)}},i.onerror=()=>{n(i.error||new Error("Failed to read file"))}})}createZipFileEntry(t){let e=super.createZipEntry(t.name);e.fileData=t,e.uncompressedSize=t.size;let n=new Date(t.lastModified);return e.timeDateDOS=e.setDateTime(n),e.cmpMethod=I.DEFLATED,e}async hashFile(t){let e=await t.arrayBuffer(),n=Buffer.from(e);return ot(n)}async compressDataBlob(t,e,n){if(dr(e)!==we.BLOB)throw new Error(O.DATATYPE_UNSUPPORTED);return new Promise(async(i,o)=>{let a=async(c,f,l)=>await this.compressData(c,f,l),s=new window.FileReader;s.readAsArrayBuffer(e),s.onload=async function(c){if(!this.result){o(new Error("Failed to read file"));return}try{let f=Buffer.from(this.result),l=await a(t,f,n);i(l)}catch(f){o(f)}},s.onerror=function(c){o(this.error||new Error("Failed to read file"))}})}async extractBlob(t,e){try{let n=await this.extract(t,e);if(!n)return null;let i=new Uint8Array(n);return new Blob([i],{type:"application/octet-stream"})}catch(n){throw n}}async createZipBlob(t,e){let n=e?.onError||(()=>{}),i=e?.onEntryDone||(()=>{}),o=super.getDirectory();if(!o)return n(new Error(O.NO_FILES)),null;let a=0,s=[];for(let u of o){if(!u.isUpdated)if(u.filename===le||u.filename===se||u.filename===fe)u.isUpdated=!0;else{let _=await super.copyEntry(u);u.localHdrOffset=a,a+=_.length,s.push(_),i(u,"Copied");continue}if(!u.fileData)return n(new Error(O.FILE_NOT_FOUND)),null;let E=await u.fileData.arrayBuffer();if(u.cmpData&&u.compressedSize&&u.crc){let _=u.createLocalHdr();u.localHdrOffset=a,a+=_.length+u.cmpData.length,s.push(_),s.push(u.cmpData),i(u,"Written (pre-compressed)");continue}if(u.filename===le||u.filename===se||u.filename===fe){let _=Buffer.from(E);u.crc=te(_),u.cmpMethod=0,u.compressedSize=_.length,u.uncompressedSize=_.length;let b=u.createLocalHdr();u.localHdrOffset=a,a+=b.length+_.length,s.push(b),s.push(_),i(u,"Stored (metadata)")}else{let _=await this.compressData(u,Buffer.from(E),t),b=u.createLocalHdr();u.localHdrOffset=a,a+=b.length+_.length,s.push(b),s.push(_),i(u,"Written")}}let c=a;for(let u of o){let E=u.centralDirEntry();a+=E.length,s.push(E)}let f=a-c,l=super.centralEndHdr(f,c);s.push(l);let d=Buffer.concat(s),h=new Uint8Array(d);return new Blob([h],{type:"application/zip"})}isMetadataFile(t){return t===se||t===fe||t===le}async addFile(t,e){let n=this.createZipFileEntry(t),i=t,o=await this.compressDataBlob(n,i,e);return n.cmpData=o,n}async verifyEntry(t,e){try{return await this.extractBlob(t,e)!==null}catch(n){return console.error(`Verification failed for ${t.filename}:`,n),!1}}};typeof globalThis<"u"&&(globalThis.Buffer=Xo.Buffer);var ml={isBrowser:typeof window<"u"&&typeof document<"u",isNode:typeof process<"u"&&process.versions&&process.versions.node};return ra(El);})();
6
+ "use strict";var NeoZipKit=(()=>{var Ea=Object.create;var Xt=Object.defineProperty;var xa=Object.getOwnPropertyDescriptor;var ga=Object.getOwnPropertyNames;var _a=Object.getPrototypeOf,ya=Object.prototype.hasOwnProperty;var Z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ba=(r,t)=>{for(var e in t)Xt(r,e,{get:t[e],enumerable:!0})},Gn=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ga(t))!ya.call(r,i)&&i!==e&&Xt(r,i,{get:()=>t[i],enumerable:!(n=xa(t,i))||n.enumerable});return r};var wa=(r,t,e)=>(e=r!=null?Ea(_a(r)):{},Gn(t||!r||!r.__esModule?Xt(e,"default",{value:r,enumerable:!0}):e,r)),Sa=r=>Gn(Xt({},"__esModule",{value:!0}),r);var qn=Z(Wt=>{"use strict";Wt.byteLength=Ia;Wt.toByteArray=Ta;Wt.fromByteArray=Ca;var se=[],q=[],Aa=typeof Uint8Array<"u"?Uint8Array:Array,Lr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(He=0,Xn=Lr.length;He<Xn;++He)se[He]=Lr[He],q[Lr.charCodeAt(He)]=He;var He,Xn;q[45]=62;q[95]=63;function Wn(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function Ia(r){var t=Wn(r),e=t[0],n=t[1];return(e+n)*3/4-n}function Ba(r,t,e){return(t+e)*3/4-e}function Ta(r){var t,e=Wn(r),n=e[0],i=e[1],o=new Aa(Ba(r,n,i)),a=0,s=i>0?n-4:n,c;for(c=0;c<s;c+=4)t=q[r.charCodeAt(c)]<<18|q[r.charCodeAt(c+1)]<<12|q[r.charCodeAt(c+2)]<<6|q[r.charCodeAt(c+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return i===2&&(t=q[r.charCodeAt(c)]<<2|q[r.charCodeAt(c+1)]>>4,o[a++]=t&255),i===1&&(t=q[r.charCodeAt(c)]<<10|q[r.charCodeAt(c+1)]<<4|q[r.charCodeAt(c+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}function Da(r){return se[r>>18&63]+se[r>>12&63]+se[r>>6&63]+se[r&63]}function La(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(Da(n));return i.join("")}function Ca(r){for(var t,e=r.length,n=e%3,i=[],o=16383,a=0,s=e-n;a<s;a+=o)i.push(La(r,a,a+o>s?s:a+o));return n===1?(t=r[e-1],i.push(se[t>>2]+se[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],i.push(se[t>>10]+se[t>>4&63]+se[t<<2&63]+"=")),i.join("")}});var jn=Z(Cr=>{Cr.read=function(r,t,e,n,i){var o,a,s=i*8-n-1,c=(1<<s)-1,f=c>>1,l=-7,d=e?i-1:0,h=e?-1:1,u=r[t+d];for(d+=h,o=u&(1<<-l)-1,u>>=-l,l+=s;l>0;o=o*256+r[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=a*256+r[t+d],d+=h,l-=8);if(o===0)o=1-f;else{if(o===c)return a?NaN:(u?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(u?-1:1)*a*Math.pow(2,o-n)};Cr.write=function(r,t,e,n,i,o){var a,s,c,f=o*8-i-1,l=(1<<f)-1,d=l>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,u=n?0:o-1,E=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+d>=1?t+=h/c:t+=h*Math.pow(2,1-d),t*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a=a+d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;r[e+u]=s&255,u+=E,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;r[e+u]=a&255,u+=E,a/=256,f-=8);r[e+u-E]|=g*128}});var pi=Z(nt=>{"use strict";var Rr=qn(),tt=jn(),Jn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;nt.Buffer=m;nt.SlowBuffer=Oa;nt.INSPECT_MAX_BYTES=50;var qt=2147483647;nt.kMaxLength=qt;m.TYPED_ARRAY_SUPPORT=Ra();!m.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ra(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}});function we(r){if(r>qt)throw new RangeError('The value "'+r+'" is invalid for option "size"');let t=new Uint8Array(r);return Object.setPrototypeOf(t,m.prototype),t}function m(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return vr(r)}return ri(r,t,e)}m.poolSize=8192;function ri(r,t,e){if(typeof r=="string")return Ua(r,t);if(ArrayBuffer.isView(r))return Na(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(fe(r,ArrayBuffer)||r&&fe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(r,SharedArrayBuffer)||r&&fe(r.buffer,SharedArrayBuffer)))return Ur(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return m.from(n,t,e);let i=va(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return m.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}m.from=function(r,t,e){return ri(r,t,e)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function ni(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function ka(r,t,e){return ni(r),r<=0?we(r):t!==void 0?typeof e=="string"?we(r).fill(t,e):we(r).fill(t):we(r)}m.alloc=function(r,t,e){return ka(r,t,e)};function vr(r){return ni(r),we(r<0?0:Or(r)|0)}m.allocUnsafe=function(r){return vr(r)};m.allocUnsafeSlow=function(r){return vr(r)};function Ua(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=ii(r,t)|0,n=we(e),i=n.write(r,t);return i!==e&&(n=n.slice(0,i)),n}function kr(r){let t=r.length<0?0:Or(r.length)|0,e=we(t);for(let n=0;n<t;n+=1)e[n]=r[n]&255;return e}function Na(r){if(fe(r,Uint8Array)){let t=new Uint8Array(r);return Ur(t.buffer,t.byteOffset,t.byteLength)}return kr(r)}function Ur(r,t,e){if(t<0||r.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&e===void 0?n=new Uint8Array(r):e===void 0?n=new Uint8Array(r,t):n=new Uint8Array(r,t,e),Object.setPrototypeOf(n,m.prototype),n}function va(r){if(m.isBuffer(r)){let t=Or(r.length)|0,e=we(t);return e.length===0||r.copy(e,0,0,t),e}if(r.length!==void 0)return typeof r.length!="number"||Fr(r.length)?we(0):kr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return kr(r.data)}function Or(r){if(r>=qt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qt.toString(16)+" bytes");return r|0}function Oa(r){return+r!=r&&(r=0),m.alloc(+r)}m.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==m.prototype};m.compare=function(t,e){if(fe(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),fe(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(t)||!m.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,i=e.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};m.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};m.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return m.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;let i=m.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){let a=t[n];if(fe(a,Uint8Array))o+a.length>i.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(m.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function ii(r,t){if(m.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||fe(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return Nr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return di(r).length;default:if(i)return n?-1:Nr(r).length;t=(""+t).toLowerCase(),i=!0}}m.byteLength=ii;function Ma(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ga(this,t,e);case"utf8":case"utf-8":return ai(this,t,e);case"ascii":return Ya(this,t,e);case"latin1":case"binary":return Ka(this,t,e);case"base64":return $a(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xa(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}m.prototype._isBuffer=!0;function $e(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}m.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)$e(this,e,e+1);return this};m.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)$e(this,e,e+3),$e(this,e+1,e+2);return this};m.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)$e(this,e,e+7),$e(this,e+1,e+6),$e(this,e+2,e+5),$e(this,e+3,e+4);return this};m.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?ai(this,0,t):Ma.apply(this,arguments)};m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:m.compare(this,t)===0};m.prototype.inspect=function(){let t="",e=nt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"};Jn&&(m.prototype[Jn]=m.prototype.inspect);m.prototype.compare=function(t,e,n,i,o){if(fe(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let a=o-i,s=n-e,c=Math.min(a,s),f=this.slice(i,o),l=t.slice(e,n);for(let d=0;d<c;++d)if(f[d]!==l[d]){a=f[d],s=l[d];break}return a<s?-1:s<a?1:0};function oi(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Fr(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=m.from(t,n)),m.isBuffer(t))return t.length===0?-1:Qn(r,t,e,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Qn(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Qn(r,t,e,n,i){let o=1,a=r.length,s=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,a/=2,s/=2,e/=2}function c(l,d){return o===1?l[d]:l.readUInt16BE(d*o)}let f;if(i){let l=-1;for(f=e;f<a;f++)if(c(r,f)===c(t,l===-1?0:f-l)){if(l===-1&&(l=f),f-l+1===s)return l*o}else l!==-1&&(f-=f-l),l=-1}else for(e+s>a&&(e=a-s),f=e;f>=0;f--){let l=!0;for(let d=0;d<s;d++)if(c(r,f+d)!==c(t,d)){l=!1;break}if(l)return f}return-1}m.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};m.prototype.indexOf=function(t,e,n){return oi(this,t,e,n,!0)};m.prototype.lastIndexOf=function(t,e,n){return oi(this,t,e,n,!1)};function Fa(r,t,e,n){e=Number(e)||0;let i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let s=parseInt(t.substr(a*2,2),16);if(Fr(s))return a;r[e+a]=s}return a}function Pa(r,t,e,n){return jt(Nr(t,r.length-e),r,e,n)}function Za(r,t,e,n){return jt(Ja(t),r,e,n)}function za(r,t,e,n){return jt(di(t),r,e,n)}function Ha(r,t,e,n){return jt(Qa(t,r.length-e),r,e,n)}m.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return Fa(this,t,e,n);case"utf8":case"utf-8":return Pa(this,t,e,n);case"ascii":case"latin1":case"binary":return Za(this,t,e,n);case"base64":return za(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ha(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $a(r,t,e){return t===0&&e===r.length?Rr.fromByteArray(r):Rr.fromByteArray(r.slice(t,e))}function ai(r,t,e){e=Math.min(r.length,e);let n=[],i=t;for(;i<e;){let o=r[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){let c,f,l,d;switch(s){case 1:o<128&&(a=o);break;case 2:c=r[i+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(a=d));break;case 3:c=r[i+1],f=r[i+2],(c&192)===128&&(f&192)===128&&(d=(o&15)<<12|(c&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:c=r[i+1],f=r[i+2],l=r[i+3],(c&192)===128&&(f&192)===128&&(l&192)===128&&(d=(o&15)<<18|(c&63)<<12|(f&63)<<6|l&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return Va(n)}var ei=4096;function Va(r){let t=r.length;if(t<=ei)return String.fromCharCode.apply(String,r);let e="",n=0;for(;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=ei));return e}function Ya(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function Ka(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function Ga(r,t,e){let n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);let i="";for(let o=t;o<e;++o)i+=es[r[o]];return i}function Xa(r,t,e){let n=r.slice(t,e),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}m.prototype.slice=function(t,e){let n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,m.prototype),i};function z(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t],o=1,a=0;for(;++a<e&&(o*=256);)i+=this[t+a]*o;return i};m.prototype.readUintBE=m.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t+--e],o=1;for(;e>0&&(o*=256);)i+=this[t+--e]*o;return i};m.prototype.readUint8=m.prototype.readUInt8=function(t,e){return t=t>>>0,e||z(t,1,this.length),this[t]};m.prototype.readUint16LE=m.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||z(t,2,this.length),this[t]|this[t+1]<<8};m.prototype.readUint16BE=m.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||z(t,2,this.length),this[t]<<8|this[t+1]};m.prototype.readUint32LE=m.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};m.prototype.readUint32BE=m.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};m.prototype.readBigUInt64LE=Be(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&xt(t,this.length-8);let i=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});m.prototype.readBigUInt64BE=Be(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&xt(t,this.length-8);let i=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});m.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t],o=1,a=0;for(;++a<e&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};m.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=e,o=1,a=this[t+--i];for(;i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};m.prototype.readInt8=function(t,e){return t=t>>>0,e||z(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};m.prototype.readInt16LE=function(t,e){t=t>>>0,e||z(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};m.prototype.readInt16BE=function(t,e){t=t>>>0,e||z(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};m.prototype.readInt32LE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};m.prototype.readInt32BE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};m.prototype.readBigInt64LE=Be(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&xt(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});m.prototype.readBigInt64BE=Be(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&xt(t,this.length-8);let i=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});m.prototype.readFloatLE=function(t,e){return t=t>>>0,e||z(t,4,this.length),tt.read(this,t,!0,23,4)};m.prototype.readFloatBE=function(t,e){return t=t>>>0,e||z(t,4,this.length),tt.read(this,t,!1,23,4)};m.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||z(t,8,this.length),tt.read(this,t,!0,52,8)};m.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||z(t,8,this.length),tt.read(this,t,!1,52,8)};function K(r,t,e,n,i,o){if(!m.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;K(this,t,e,n,s,0)}let o=1,a=0;for(this[e]=t&255;++a<n&&(o*=256);)this[e+a]=t/o&255;return e+n};m.prototype.writeUintBE=m.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;K(this,t,e,n,s,0)}let o=n-1,a=1;for(this[e+o]=t&255;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+n};m.prototype.writeUint8=m.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,1,255,0),this[e]=t&255,e+1};m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function si(r,t,e,n,i){hi(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=a,a=a>>8,r[e++]=a,a=a>>8,r[e++]=a,a=a>>8,r[e++]=a,e}function fi(r,t,e,n,i){hi(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e+7]=o,o=o>>8,r[e+6]=o,o=o>>8,r[e+5]=o,o=o>>8,r[e+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=a,a=a>>8,r[e+2]=a,a=a>>8,r[e+1]=a,a=a>>8,r[e]=a,e+8}m.prototype.writeBigUInt64LE=Be(function(t,e=0){return si(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});m.prototype.writeBigUInt64BE=Be(function(t,e=0){return fi(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});m.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let c=Math.pow(2,8*n-1);K(this,t,e,n,c-1,-c)}let o=0,a=1,s=0;for(this[e]=t&255;++o<n&&(a*=256);)t<0&&s===0&&this[e+o-1]!==0&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n};m.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let c=Math.pow(2,8*n-1);K(this,t,e,n,c-1,-c)}let o=n-1,a=1,s=0;for(this[e+o]=t&255;--o>=0&&(a*=256);)t<0&&s===0&&this[e+o+1]!==0&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n};m.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};m.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};m.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};m.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};m.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||K(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};m.prototype.writeBigInt64LE=Be(function(t,e=0){return si(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});m.prototype.writeBigInt64BE=Be(function(t,e=0){return fi(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function li(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ci(r,t,e,n,i){return t=+t,e=e>>>0,i||li(r,t,e,4,34028234663852886e22,-34028234663852886e22),tt.write(r,t,e,n,23,4),e+4}m.prototype.writeFloatLE=function(t,e,n){return ci(this,t,e,!0,n)};m.prototype.writeFloatBE=function(t,e,n){return ci(this,t,e,!1,n)};function ui(r,t,e,n,i){return t=+t,e=e>>>0,i||li(r,t,e,8,17976931348623157e292,-17976931348623157e292),tt.write(r,t,e,n,52,8),e+8}m.prototype.writeDoubleLE=function(t,e,n){return ui(this,t,e,!0,n)};m.prototype.writeDoubleBE=function(t,e,n){return ui(this,t,e,!1,n)};m.prototype.copy=function(t,e,n,i){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);let o=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),e),o};m.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!m.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let a=t.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{let a=m.isBuffer(t)?t:m.from(t,i),s=a.length;if(s===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var et={};function Mr(r,t,e){et[r]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}Mr("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Mr("ERR_INVALID_ARG_TYPE",function(r,t){return`The "${r}" argument must be of type number. Received type ${typeof t}`},TypeError);Mr("ERR_OUT_OF_RANGE",function(r,t,e){let n=`The value of "${r}" is out of range.`,i=e;return Number.isInteger(e)&&Math.abs(e)>2**32?i=ti(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=ti(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function ti(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function Wa(r,t,e){rt(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&xt(t,r.length-(e+1))}function hi(r,t,e,n,i,o){if(r>e||r<t){let a=typeof t=="bigint"?"n":"",s;throw o>3?t===0||t===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${t}${a} and <= ${e}${a}`,new et.ERR_OUT_OF_RANGE("value",s,r)}Wa(n,i,o)}function rt(r,t){if(typeof r!="number")throw new et.ERR_INVALID_ARG_TYPE(t,"number",r)}function xt(r,t,e){throw Math.floor(r)!==r?(rt(r,e),new et.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new et.ERR_BUFFER_OUT_OF_BOUNDS:new et.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}var qa=/[^+/0-9A-Za-z-_]/g;function ja(r){if(r=r.split("=")[0],r=r.trim().replace(qa,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Nr(r,t){t=t||1/0;let e,n=r.length,i=null,o=[];for(let a=0;a<n;++a){if(e=r.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Ja(r){let t=[];for(let e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function Qa(r,t){let e,n,i,o=[];for(let a=0;a<r.length&&!((t-=2)<0);++a)e=r.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function di(r){return Rr.toByteArray(ja(r))}function jt(r,t,e,n){let i;for(i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function fe(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function Fr(r){return r!==r}var es=(function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let i=0;i<16;++i)t[n+i]=r[e]+r[i]}return t})();function Be(r){return typeof BigInt>"u"?ts:r}function ts(){throw new Error("BigInt not supported")}});var Yi=Z((Bc,st)=>{"use strict";function at(r){let t=r.length;for(;--t>=0;)r[t]=0}var Ts=0,Ci=1,Ds=2,Ls=3,Cs=258,an=29,Lt=256,It=Lt+1+an,ot=30,sn=19,Ri=2*It+1,Ye=15,Qr=16,Rs=7,fn=256,ki=16,Ui=17,Ni=18,nn=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),hr=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ks=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),vi=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Us=512,Ae=new Array((It+2)*2);at(Ae);var At=new Array(ot*2);at(At);var Bt=new Array(Us);at(Bt);var Tt=new Array(Cs-Ls+1);at(Tt);var ln=new Array(an);at(ln);var dr=new Array(ot);at(dr);function en(r,t,e,n,i){this.static_tree=r,this.extra_bits=t,this.extra_base=e,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}var Oi,Mi,Fi;function tn(r,t){this.dyn_tree=r,this.max_code=0,this.stat_desc=t}var Pi=r=>r<256?Bt[r]:Bt[256+(r>>>7)],Dt=(r,t)=>{r.pending_buf[r.pending++]=t&255,r.pending_buf[r.pending++]=t>>>8&255},G=(r,t,e)=>{r.bi_valid>Qr-e?(r.bi_buf|=t<<r.bi_valid&65535,Dt(r,r.bi_buf),r.bi_buf=t>>Qr-r.bi_valid,r.bi_valid+=e-Qr):(r.bi_buf|=t<<r.bi_valid&65535,r.bi_valid+=e)},de=(r,t,e)=>{G(r,e[t*2],e[t*2+1])},Zi=(r,t)=>{let e=0;do e|=r&1,r>>>=1,e<<=1;while(--t>0);return e>>>1},Ns=r=>{r.bi_valid===16?(Dt(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},vs=(r,t)=>{let e=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,f,l,d,h,u,E,g=0;for(h=0;h<=Ye;h++)r.bl_count[h]=0;for(e[r.heap[r.heap_max]*2+1]=0,f=r.heap_max+1;f<Ri;f++)l=r.heap[f],h=e[e[l*2+1]*2+1]+1,h>c&&(h=c,g++),e[l*2+1]=h,!(l>n)&&(r.bl_count[h]++,u=0,l>=s&&(u=a[l-s]),E=e[l*2],r.opt_len+=E*(h+u),o&&(r.static_len+=E*(i[l*2+1]+u)));if(g!==0){do{for(h=c-1;r.bl_count[h]===0;)h--;r.bl_count[h]--,r.bl_count[h+1]+=2,r.bl_count[c]--,g-=2}while(g>0);for(h=c;h!==0;h--)for(l=r.bl_count[h];l!==0;)d=r.heap[--f],!(d>n)&&(e[d*2+1]!==h&&(r.opt_len+=(h-e[d*2+1])*e[d*2],e[d*2+1]=h),l--)}},zi=(r,t,e)=>{let n=new Array(Ye+1),i=0,o,a;for(o=1;o<=Ye;o++)i=i+e[o-1]<<1,n[o]=i;for(a=0;a<=t;a++){let s=r[a*2+1];s!==0&&(r[a*2]=Zi(n[s]++,s))}},Os=()=>{let r,t,e,n,i,o=new Array(Ye+1);for(e=0,n=0;n<an-1;n++)for(ln[n]=e,r=0;r<1<<nn[n];r++)Tt[e++]=n;for(Tt[e-1]=n,i=0,n=0;n<16;n++)for(dr[n]=i,r=0;r<1<<hr[n];r++)Bt[i++]=n;for(i>>=7;n<ot;n++)for(dr[n]=i<<7,r=0;r<1<<hr[n]-7;r++)Bt[256+i++]=n;for(t=0;t<=Ye;t++)o[t]=0;for(r=0;r<=143;)Ae[r*2+1]=8,r++,o[8]++;for(;r<=255;)Ae[r*2+1]=9,r++,o[9]++;for(;r<=279;)Ae[r*2+1]=7,r++,o[7]++;for(;r<=287;)Ae[r*2+1]=8,r++,o[8]++;for(zi(Ae,It+1,o),r=0;r<ot;r++)At[r*2+1]=5,At[r*2]=Zi(r,5);Oi=new en(Ae,nn,Lt+1,It,Ye),Mi=new en(At,hr,0,ot,Ye),Fi=new en(new Array(0),ks,0,sn,Rs)},Hi=r=>{let t;for(t=0;t<It;t++)r.dyn_ltree[t*2]=0;for(t=0;t<ot;t++)r.dyn_dtree[t*2]=0;for(t=0;t<sn;t++)r.bl_tree[t*2]=0;r.dyn_ltree[fn*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},$i=r=>{r.bi_valid>8?Dt(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},Ii=(r,t,e,n)=>{let i=t*2,o=e*2;return r[i]<r[o]||r[i]===r[o]&&n[t]<=n[e]},rn=(r,t,e)=>{let n=r.heap[e],i=e<<1;for(;i<=r.heap_len&&(i<r.heap_len&&Ii(t,r.heap[i+1],r.heap[i],r.depth)&&i++,!Ii(t,n,r.heap[i],r.depth));)r.heap[e]=r.heap[i],e=i,i<<=1;r.heap[e]=n},Bi=(r,t,e)=>{let n,i,o=0,a,s;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+o++]&255,n+=(r.pending_buf[r.sym_buf+o++]&255)<<8,i=r.pending_buf[r.sym_buf+o++],n===0?de(r,i,t):(a=Tt[i],de(r,a+Lt+1,t),s=nn[a],s!==0&&(i-=ln[a],G(r,i,s)),n--,a=Pi(n),de(r,a,e),s=hr[a],s!==0&&(n-=dr[a],G(r,n,s)));while(o<r.sym_next);de(r,fn,t)},on=(r,t)=>{let e=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,c=-1,f;for(r.heap_len=0,r.heap_max=Ri,a=0;a<o;a++)e[a*2]!==0?(r.heap[++r.heap_len]=c=a,r.depth[a]=0):e[a*2+1]=0;for(;r.heap_len<2;)f=r.heap[++r.heap_len]=c<2?++c:0,e[f*2]=1,r.depth[f]=0,r.opt_len--,i&&(r.static_len-=n[f*2+1]);for(t.max_code=c,a=r.heap_len>>1;a>=1;a--)rn(r,e,a);f=o;do a=r.heap[1],r.heap[1]=r.heap[r.heap_len--],rn(r,e,1),s=r.heap[1],r.heap[--r.heap_max]=a,r.heap[--r.heap_max]=s,e[f*2]=e[a*2]+e[s*2],r.depth[f]=(r.depth[a]>=r.depth[s]?r.depth[a]:r.depth[s])+1,e[a*2+1]=e[s*2+1]=f,r.heap[1]=f++,rn(r,e,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],vs(r,t),zi(e,c,r.bl_count)},Ti=(r,t,e)=>{let n,i=-1,o,a=t[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),t[(e+1)*2+1]=65535,n=0;n<=e;n++)o=a,a=t[(n+1)*2+1],!(++s<c&&o===a)&&(s<f?r.bl_tree[o*2]+=s:o!==0?(o!==i&&r.bl_tree[o*2]++,r.bl_tree[ki*2]++):s<=10?r.bl_tree[Ui*2]++:r.bl_tree[Ni*2]++,s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4))},Di=(r,t,e)=>{let n,i=-1,o,a=t[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),n=0;n<=e;n++)if(o=a,a=t[(n+1)*2+1],!(++s<c&&o===a)){if(s<f)do de(r,o,r.bl_tree);while(--s!==0);else o!==0?(o!==i&&(de(r,o,r.bl_tree),s--),de(r,ki,r.bl_tree),G(r,s-3,2)):s<=10?(de(r,Ui,r.bl_tree),G(r,s-3,3)):(de(r,Ni,r.bl_tree),G(r,s-11,7));s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4)}},Ms=r=>{let t;for(Ti(r,r.dyn_ltree,r.l_desc.max_code),Ti(r,r.dyn_dtree,r.d_desc.max_code),on(r,r.bl_desc),t=sn-1;t>=3&&r.bl_tree[vi[t]*2+1]===0;t--);return r.opt_len+=3*(t+1)+5+5+4,t},Fs=(r,t,e,n)=>{let i;for(G(r,t-257,5),G(r,e-1,5),G(r,n-4,4),i=0;i<n;i++)G(r,r.bl_tree[vi[i]*2+1],3);Di(r,r.dyn_ltree,t-1),Di(r,r.dyn_dtree,e-1)},Ps=r=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&r.dyn_ltree[e*2]!==0)return 0;if(r.dyn_ltree[18]!==0||r.dyn_ltree[20]!==0||r.dyn_ltree[26]!==0)return 1;for(e=32;e<Lt;e++)if(r.dyn_ltree[e*2]!==0)return 1;return 0},Li=!1,Zs=r=>{Li||(Os(),Li=!0),r.l_desc=new tn(r.dyn_ltree,Oi),r.d_desc=new tn(r.dyn_dtree,Mi),r.bl_desc=new tn(r.bl_tree,Fi),r.bi_buf=0,r.bi_valid=0,Hi(r)},Vi=(r,t,e,n)=>{G(r,(Ts<<1)+(n?1:0),3),$i(r),Dt(r,e),Dt(r,~e),e&&r.pending_buf.set(r.window.subarray(t,t+e),r.pending),r.pending+=e},zs=r=>{G(r,Ci<<1,3),de(r,fn,Ae),Ns(r)},Hs=(r,t,e,n)=>{let i,o,a=0;r.level>0?(r.strm.data_type===2&&(r.strm.data_type=Ps(r)),on(r,r.l_desc),on(r,r.d_desc),a=Ms(r),i=r.opt_len+3+7>>>3,o=r.static_len+3+7>>>3,o<=i&&(i=o)):i=o=e+5,e+4<=i&&t!==-1?Vi(r,t,e,n):r.strategy===4||o===i?(G(r,(Ci<<1)+(n?1:0),3),Bi(r,Ae,At)):(G(r,(Ds<<1)+(n?1:0),3),Fs(r,r.l_desc.max_code+1,r.d_desc.max_code+1,a+1),Bi(r,r.dyn_ltree,r.dyn_dtree)),Hi(r),n&&$i(r)},$s=(r,t,e)=>(r.pending_buf[r.sym_buf+r.sym_next++]=t,r.pending_buf[r.sym_buf+r.sym_next++]=t>>8,r.pending_buf[r.sym_buf+r.sym_next++]=e,t===0?r.dyn_ltree[e*2]++:(r.matches++,t--,r.dyn_ltree[(Tt[e]+Lt+1)*2]++,r.dyn_dtree[Pi(t)*2]++),r.sym_next===r.sym_end);st.exports._tr_init=Zs;st.exports._tr_stored_block=Vi;st.exports._tr_flush_block=Hs;st.exports._tr_tally=$s;st.exports._tr_align=zs});var cn=Z((Tc,Ki)=>{"use strict";var Vs=(r,t,e,n)=>{let i=r&65535|0,o=r>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0};Ki.exports=Vs});var un=Z((Dc,Gi)=>{"use strict";var Ys=()=>{let r,t=[];for(var e=0;e<256;e++){r=e;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r}return t},Ks=new Uint32Array(Ys()),Gs=(r,t,e,n)=>{let i=Ks,o=n+e;r^=-1;for(let a=n;a<o;a++)r=r>>>8^i[(r^t[a])&255];return r^-1};Gi.exports=Gs});var pr=Z((Lc,Xi)=>{"use strict";Xi.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 Ne=Z((Cc,Wi)=>{"use strict";Wi.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_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var oo=Z((Rc,xe)=>{"use strict";var{_tr_init:Xs,_tr_stored_block:pn,_tr_flush_block:Ws,_tr_tally:Fe,_tr_align:qs}=Yi(),Qi=cn(),ve=un(),js=pr(),{Z_NO_FLUSH:Pe,Z_PARTIAL_FLUSH:Js,Z_FULL_FLUSH:Qs,Z_FINISH:Q,Z_BLOCK:qi,Z_OK:$,Z_STREAM_END:ji,Z_STREAM_ERROR:me,Z_DATA_ERROR:ef,Z_BUF_ERROR:hn,Z_DEFAULT_COMPRESSION:tf,Z_FILTERED:rf,Z_HUFFMAN_ONLY:mr,Z_RLE:nf,Z_FIXED:of,Z_DEFAULT_STRATEGY:af,Z_UNKNOWN:sf,Z_DEFLATED:Er}=Ne(),ff=9,lf=15,cf=8,uf=29,hf=256,mn=hf+1+uf,df=30,pf=19,mf=2*mn+1,Ef=15,k=3,Me=258,Ee=Me+k+1,xf=32,lt=42,bn=57,En=69,xn=73,gn=91,_n=103,Ke=113,Rt=666,Y=1,ut=2,Xe=3,ht=4,gf=3,Ge=(r,t)=>(r.msg=js[t],t),Ji=r=>r*2-(r>4?9:0),Oe=r=>{let t=r.length;for(;--t>=0;)r[t]=0},_f=r=>{let t,e,n,i=r.w_size;t=r.hash_size,n=t;do e=r.head[--n],r.head[n]=e>=i?e-i:0;while(--t);t=i,n=t;do e=r.prev[--n],r.prev[n]=e>=i?e-i:0;while(--t)},wn=(r,t,e)=>(t<<r.hash_shift^e)&r.hash_mask,We=(r,t)=>{let e;if(r.legacy_hash)e=r.ins_h=wn(r,r.ins_h,r.window[t+k-1]);else{let i=r.window,o=i[t]|i[t+1]<<8|i[t+2]<<16|i[t+3]<<24;e=r.ins_h=Math.imul(o,66521)+66521>>>16&r.hash_mask}let n=r.prev[t&r.w_mask]=r.head[e];return r.head[e]=t,n},X=r=>{let t=r.state,e=t.pending;e>r.avail_out&&(e=r.avail_out),e!==0&&(r.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),r.next_out),r.next_out+=e,t.pending_out+=e,r.total_out+=e,r.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},W=(r,t)=>{Ws(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,t),r.block_start=r.strstart,X(r.strm)},U=(r,t)=>{r.pending_buf[r.pending++]=t},Ct=(r,t)=>{r.pending_buf[r.pending++]=t>>>8&255,r.pending_buf[r.pending++]=t&255},yn=(r,t,e,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,t.set(r.input.subarray(r.next_in,r.next_in+i),e),r.state.wrap===1?r.adler=Qi(r.adler,t,i,e):r.state.wrap===2&&(r.adler=ve(r.adler,t,i,e)),r.next_in+=i,r.total_in+=i,i)},eo=(r,t)=>{let e=r.max_chain_length,n=r.strstart,i,o,a=r.prev_length,s=r.nice_match,c=r.strstart>r.w_size-Ee?r.strstart-(r.w_size-Ee):0,f=r.window,l=r.w_mask,d=r.prev,h=r.strstart+Me,u=f[n+a-1],E=f[n+a];r.prev_length>=r.good_match&&(e>>=2),s>r.lookahead&&(s=r.lookahead);do if(i=t,!(f[i+a]!==E||f[i+a-1]!==u||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<h);if(o=Me-(h-n),n=h-Me,o>a){if(r.match_start=t,a=o,o>=s)break;u=f[n+a-1],E=f[n+a]}}while((t=d[t&l])>c&&--e!==0);return a<=r.lookahead?a:r.lookahead},ct=r=>{let t=r.w_size,e,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=t+(t-Ee)&&(r.window.set(r.window.subarray(t,t+t-n),0),r.match_start-=t,r.strstart-=t,r.block_start-=t,r.insert>r.strstart&&(r.insert=r.strstart),_f(r),n+=t),r.strm.avail_in===0)break;if(e=yn(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=e,r.legacy_hash){if(r.lookahead+r.insert>=k)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=wn(r,r.ins_h,r.window[i+1]);r.insert&&(We(r,i),i++,r.insert--,!(r.lookahead+r.insert<k)););}else if(r.lookahead+r.insert>k)for(i=r.strstart-r.insert;r.insert&&(We(r,i),i++,r.insert--,!(r.lookahead+r.insert<=k)););}while(r.lookahead<Ee&&r.strm.avail_in!==0)},to=(r,t)=>{let e=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,o,a=0,s=r.strm.avail_in;do{if(n=65535,o=r.bi_valid+42>>3,r.strm.avail_out<o||(o=r.strm.avail_out-o,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>o&&(n=o),n<e&&(n===0&&t!==Q||t===Pe||n!==i+r.strm.avail_in)))break;a=t===Q&&n===i+r.strm.avail_in?1:0,pn(r,0,0,a),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,X(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(yn(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(a===0);return s-=r.strm.avail_in,s&&(s>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=s&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-s,r.strm.next_in),r.strstart),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),a?ht:t!==Pe&&t!==Q&&r.strm.avail_in===0&&r.strstart===r.block_start?ut:(o=r.window_size-r.strstart,r.strm.avail_in>o&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,o+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),o>r.strm.avail_in&&(o=r.strm.avail_in),o&&(yn(r.strm,r.window,r.strstart,o),r.strstart+=o,r.insert+=o>r.w_size-r.insert?r.w_size-r.insert:o),r.high_water<r.strstart&&(r.high_water=r.strstart),o=r.bi_valid+42>>3,o=r.pending_buf_size-o>65535?65535:r.pending_buf_size-o,e=o>r.w_size?r.w_size:o,i=r.strstart-r.block_start,(i>=e||(i||t===Q)&&t!==Pe&&r.strm.avail_in===0&&i<=o)&&(n=i>o?o:i,a=t===Q&&r.strm.avail_in===0&&n===i?1:0,pn(r,r.block_start,n,a),r.block_start+=n,X(r.strm)),a?Xe:Y)},dn=(r,t)=>{let e,n;for(;;){if(r.lookahead<Ee){if(ct(r),r.lookahead<Ee&&t===Pe)return Y;if(r.lookahead===0)break}if(e=0,r.lookahead>=k&&(e=We(r,r.strstart)),e!==0&&r.strstart-e<=r.w_size-Ee&&(r.match_length=eo(r,e)),r.match_length>=k)if(n=Fe(r,r.strstart-r.match_start,r.match_length-k),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=k){r.match_length--;do r.strstart++,e=We(r,r.strstart);while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.legacy_hash&&(r.ins_h=r.window[r.strstart],r.ins_h=wn(r,r.ins_h,r.window[r.strstart+1]));else n=Fe(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(W(r,!1),r.strm.avail_out===0))return Y}return r.insert=r.strstart<k-1?r.strstart:k-1,t===Q?(W(r,!0),r.strm.avail_out===0?Xe:ht):r.sym_next&&(W(r,!1),r.strm.avail_out===0)?Y:ut},ft=(r,t)=>{let e,n,i;for(;;){if(r.lookahead<Ee){if(ct(r),r.lookahead<Ee&&t===Pe)return Y;if(r.lookahead===0)break}if(e=0,r.lookahead>=k&&(e=We(r,r.strstart)),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=k-1,e!==0&&r.prev_length<r.max_lazy_match&&r.strstart-e<=r.w_size-Ee&&(r.match_length=eo(r,e),r.match_length<=5&&(r.strategy===rf||r.match_length===k&&r.strstart-r.match_start>4096)&&(r.match_length=k-1)),r.prev_length>=k&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-k,n=Fe(r,r.strstart-1-r.prev_match,r.prev_length-k),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(e=We(r,r.strstart));while(--r.prev_length!==0);if(r.match_available=0,r.match_length=k-1,r.strstart++,n&&(W(r,!1),r.strm.avail_out===0))return Y}else if(r.match_available){if(n=Fe(r,0,r.window[r.strstart-1]),n&&W(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return Y}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Fe(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<k-1?r.strstart:k-1,t===Q?(W(r,!0),r.strm.avail_out===0?Xe:ht):r.sym_next&&(W(r,!1),r.strm.avail_out===0)?Y:ut},yf=(r,t)=>{let e,n,i,o,a=r.window;for(;;){if(r.lookahead<=Me){if(ct(r),r.lookahead<=Me&&t===Pe)return Y;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=k&&r.strstart>0&&(i=r.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=r.strstart+Me;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);r.match_length=Me-(o-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=k?(e=Fe(r,1,r.match_length-k),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(e=Fe(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),e&&(W(r,!1),r.strm.avail_out===0))return Y}return r.insert=0,t===Q?(W(r,!0),r.strm.avail_out===0?Xe:ht):r.sym_next&&(W(r,!1),r.strm.avail_out===0)?Y:ut},bf=(r,t)=>{let e;for(;;){if(r.lookahead===0&&(ct(r),r.lookahead===0)){if(t===Pe)return Y;break}if(r.match_length=0,e=Fe(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,e&&(W(r,!1),r.strm.avail_out===0))return Y}return r.insert=0,t===Q?(W(r,!0),r.strm.avail_out===0?Xe:ht):r.sym_next&&(W(r,!1),r.strm.avail_out===0)?Y:ut};function pe(r,t,e,n,i){this.good_length=r,this.max_lazy=t,this.nice_length=e,this.max_chain=n,this.func=i}var kt=[new pe(0,0,0,0,to),new pe(4,4,8,4,dn),new pe(4,5,16,8,dn),new pe(4,6,32,32,dn),new pe(4,4,16,16,ft),new pe(8,16,32,32,ft),new pe(8,16,128,128,ft),new pe(8,32,128,256,ft),new pe(32,128,258,1024,ft),new pe(32,258,258,4096,ft)],wf=r=>{r.window_size=2*r.w_size,Oe(r.head),r.max_lazy_match=kt[r.level].max_lazy,r.good_match=kt[r.level].good_length,r.nice_match=kt[r.level].nice_length,r.max_chain_length=kt[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=k-1,r.match_available=0,r.ins_h=0};function Sf(){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=Er,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.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(mf*2),this.dyn_dtree=new Uint16Array((2*df+1)*2),this.bl_tree=new Uint16Array((2*pf+1)*2),Oe(this.dyn_ltree),Oe(this.dyn_dtree),Oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Ef+1),this.heap=new Uint16Array(2*mn+1),Oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*mn+1),Oe(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ut=r=>{if(!r)return 1;let t=r.state;return!t||t.strm!==r||t.status!==lt&&t.status!==bn&&t.status!==En&&t.status!==xn&&t.status!==gn&&t.status!==_n&&t.status!==Ke&&t.status!==Rt?1:0},ro=r=>{if(Ut(r))return Ge(r,me);r.total_in=r.total_out=0,r.data_type=sf;let t=r.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?bn:t.wrap?lt:Ke,r.adler=t.wrap===2?0:1,t.last_flush=-2,Xs(t),$},no=r=>{let t=ro(r);return t===$&&wf(r.state),t},Af=(r,t)=>Ut(r)||r.state.wrap!==2?me:(r.state.gzhead=t,$),io=(r,t,e,n,i,o,a)=>{if(!r)return me;let s=1;if(t===tf&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>ff||e!==Er||n<8||n>15||t<0||t>9||o<0||o>of||n===8&&s!==1)return Ge(r,me);n===8&&(n=9);let c=new Sf;return r.state=c,c.strm=r,c.status=lt,c.wrap=s,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=a?1:0,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+k-1)/k),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=o,c.method=e,no(r)},If=(r,t)=>io(r,t,Er,lf,cf,af),Bf=(r,t)=>{if(Ut(r)||t>qi||t<0)return r?Ge(r,me):me;let e=r.state;if(!r.output||r.avail_in!==0&&!r.input||e.status===Rt&&t!==Q)return Ge(r,r.avail_out===0?hn:me);let n=e.last_flush;if(e.last_flush=t,e.pending!==0){if(X(r),r.avail_out===0)return e.last_flush=-1,$}else if(r.avail_in===0&&Ji(t)<=Ji(n)&&t!==Q)return Ge(r,hn);if(e.status===Rt&&r.avail_in!==0)return Ge(r,hn);if(e.status===lt&&e.wrap===0&&(e.status=Ke),e.status===lt){let i=Er+(e.w_bits-8<<4)<<8,o=-1;if(e.strategy>=mr||e.level<2?o=0:e.level<6?o=1:e.level===6?o=2:o=3,i|=o<<6,e.strstart!==0&&(i|=xf),i+=31-i%31,Ct(e,i),e.strstart!==0&&(Ct(e,r.adler>>>16),Ct(e,r.adler&65535)),r.adler=1,e.status=Ke,X(r),e.pending!==0)return e.last_flush=-1,$}if(e.status===bn){if(r.adler=0,U(e,31),U(e,139),U(e,8),e.gzhead)U(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),U(e,e.gzhead.time&255),U(e,e.gzhead.time>>8&255),U(e,e.gzhead.time>>16&255),U(e,e.gzhead.time>>24&255),U(e,e.level===9?2:e.strategy>=mr||e.level<2?4:0),U(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(U(e,e.gzhead.extra.length&255),U(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(r.adler=ve(r.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=En;else if(U(e,0),U(e,0),U(e,0),U(e,0),U(e,0),U(e,e.level===9?2:e.strategy>=mr||e.level<2?4:0),U(e,gf),e.status=Ke,X(r),e.pending!==0)return e.last_flush=-1,$}if(e.status===En){if(e.gzhead.extra){let i=e.pending,o=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+o>e.pending_buf_size;){let s=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>i&&(r.adler=ve(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex+=s,X(r),e.pending!==0)return e.last_flush=-1,$;i=0,o-=s}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending+=o,e.gzhead.hcrc&&e.pending>i&&(r.adler=ve(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=xn}if(e.status===xn){if(e.gzhead.name){let i=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(r.adler=ve(r.adler,e.pending_buf,e.pending-i,i)),X(r),e.pending!==0)return e.last_flush=-1,$;i=0}e.gzindex<e.gzhead.name.length?o=e.gzhead.name.charCodeAt(e.gzindex++)&255:o=0,U(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>i&&(r.adler=ve(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=gn}if(e.status===gn){if(e.gzhead.comment){let i=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(r.adler=ve(r.adler,e.pending_buf,e.pending-i,i)),X(r),e.pending!==0)return e.last_flush=-1,$;i=0}e.gzindex<e.gzhead.comment.length?o=e.gzhead.comment.charCodeAt(e.gzindex++)&255:o=0,U(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>i&&(r.adler=ve(r.adler,e.pending_buf,e.pending-i,i))}e.status=_n}if(e.status===_n){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(X(r),e.pending!==0))return e.last_flush=-1,$;U(e,r.adler&255),U(e,r.adler>>8&255),r.adler=0}if(e.status=Ke,X(r),e.pending!==0)return e.last_flush=-1,$}if(r.avail_in!==0||e.lookahead!==0||t!==Pe&&e.status!==Rt){let i=e.level===0?to(e,t):e.strategy===mr?bf(e,t):e.strategy===nf?yf(e,t):kt[e.level].func(e,t);if((i===Xe||i===ht)&&(e.status=Rt),i===Y||i===Xe)return r.avail_out===0&&(e.last_flush=-1),$;if(i===ut&&(t===Js?qs(e):t!==qi&&(pn(e,0,0,!1),t===Qs&&(Oe(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),X(r),r.avail_out===0))return e.last_flush=-1,$}return t!==Q?$:e.wrap<=0?ji:(e.wrap===2?(U(e,r.adler&255),U(e,r.adler>>8&255),U(e,r.adler>>16&255),U(e,r.adler>>24&255),U(e,r.total_in&255),U(e,r.total_in>>8&255),U(e,r.total_in>>16&255),U(e,r.total_in>>24&255)):(Ct(e,r.adler>>>16),Ct(e,r.adler&65535)),X(r),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?$:ji)},Tf=r=>{if(Ut(r))return me;let t=r.state.status;return r.state=null,t===Ke?Ge(r,ef):$},Df=(r,t)=>{let e=t.length;if(Ut(r))return me;let n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==lt||n.lookahead)return me;if(i===1&&(r.adler=Qi(r.adler,t,e,0)),n.wrap=0,e>=n.w_size){i===0&&(Oe(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(t.subarray(e-n.w_size,e),0),t=c,e=n.w_size}let o=r.avail_in,a=r.next_in,s=r.input;for(r.avail_in=e,r.next_in=0,r.input=t,ct(n);n.lookahead>=k;){let c=n.strstart,f=n.lookahead-(k-1);do We(n,c),c++;while(--f);n.strstart=c,n.lookahead=k-1,ct(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=k-1,n.match_available=0,r.next_in=a,r.input=s,r.avail_in=o,n.wrap=i,$};xe.exports.deflateInit=If;xe.exports.deflateInit2=io;xe.exports.deflateReset=no;xe.exports.deflateResetKeep=ro;xe.exports.deflateSetHeader=Af;xe.exports.deflate=Bf;xe.exports.deflateEnd=Tf;xe.exports.deflateSetDictionary=Df;xe.exports.deflateInfo="pako deflate (from Nodeca project)"});var An=Z((kc,Sn)=>{"use strict";var Lf=(r,t)=>Object.prototype.hasOwnProperty.call(r,t);Sn.exports.assign=function(r){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(let n in e)Lf(e,n)&&(r[n]=e[n])}}return r};Sn.exports.flattenChunks=r=>{let t=0;for(let n=0,i=r.length;n<i;n++)t+=r[n].length;let e=new Uint8Array(t);for(let n=0,i=0,o=r.length;n<o;n++){let a=r[n];e.set(a,i),i+=a.length}return e}});var In=Z((Uc,xr)=>{"use strict";var ao=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ao=!1}var Nt=new Uint8Array(256);for(let r=0;r<256;r++)Nt[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Nt[254]=Nt[255]=1;xr.exports.string2buf=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let t,e,n,i,o,a=r.length,s=0;for(i=0;i<a;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),s+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),e<128?t[o++]=e:e<2048?(t[o++]=192|e>>>6,t[o++]=128|e&63):e<65536?(t[o++]=224|e>>>12,t[o++]=128|e>>>6&63,t[o++]=128|e&63):(t[o++]=240|e>>>18,t[o++]=128|e>>>12&63,t[o++]=128|e>>>6&63,t[o++]=128|e&63);return t};var Cf=(r,t)=>{if(t<65534&&r.subarray&&ao)return String.fromCharCode.apply(null,r.length===t?r:r.subarray(0,t));let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(r[n]);return e};xr.exports.buf2string=(r,t)=>{let e=t||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,t));let n,i,o=new Array(e*2);for(i=0,n=0;n<e;){let a=r[n++];if(a<128){o[i++]=a;continue}let s=Nt[a];if(s>4){o[i++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<e;)a=a<<6|r[n++]&63,s--;if(s>1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return Cf(o,i)};xr.exports.utf8border=(r,t)=>{t=t||r.length,t>r.length&&(t=r.length);let e=t-1;for(;e>=0&&(r[e]&192)===128;)e--;return e<0||e===0?t:e+Nt[r[e]]>t?e:t}});var Bn=Z((Nc,so)=>{"use strict";function Rf(){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}so.exports=Rf});var uo=Z((vc,dt)=>{"use strict";var vt=oo(),fo=An(),lo=In(),Tn=pr(),kf=Bn(),co=Object.prototype.toString,{Z_NO_FLUSH:Uf,Z_SYNC_FLUSH:Nf,Z_FULL_FLUSH:vf,Z_FINISH:Of,Z_OK:gr,Z_STREAM_END:Mf,Z_DEFAULT_COMPRESSION:Ff,Z_DEFAULT_STRATEGY:Pf,Z_DEFLATED:Zf}=Ne(),zf={level:Ff,method:Zf,chunkSize:16384,windowBits:15,memLevel:8,strategy:Pf,legacyHash:!0};function Ot(r){this.options=fo.assign({},zf,r||{});let 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=!1,this.chunks=[],this.strm=new kf,this.strm.avail_out=0;let e=vt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(e!==gr)throw new Error(Tn[e]);if(t.header&&vt.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=lo.string2buf(t.dictionary):co.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,e=vt.deflateSetDictionary(this.strm,n),e!==gr)throw new Error(Tn[e]);this._dict_set=!0}}Ot.prototype.push=function(r,t){let e=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?Of:Uf,typeof r=="string"?e.input=lo.string2buf(r):co.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),(o===Nf||o===vf)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(i=vt.deflate(e,o),i===Mf)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),i=vt.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===gr;if(e.avail_out===0){this.onData(e.output);continue}if(o>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0};Ot.prototype.onData=function(r){this.chunks.push(r)};Ot.prototype.onEnd=function(r){r===gr&&(this.result=fo.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Dn(r,t){let e=new Ot(t);if(e.push(r,!0),e.err)throw e.msg||Tn[e.err];return e.result}function Hf(r,t){return t=t||{},t.raw=!0,Dn(r,t)}function $f(r,t){return t=t||{},t.gzip=!0,Dn(r,t)}dt.exports.Deflate=Ot;dt.exports.deflate=Dn;dt.exports.deflateRaw=Hf;dt.exports.gzip=$f;dt.exports.constants=Ne()});var po=Z((Oc,ho)=>{"use strict";ho.exports=function(t,e){let n,i,o,a,s,c,f,l,d,h,u,E,g,b,p,B,S,_,y,L,w,v,C,T,D=t.state;n=t.next_in,C=t.input,i=n+(t.avail_in-5),o=t.next_out,T=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),c=D.dmax,f=D.wsize,l=D.whave,d=D.wnext,h=D.window,u=D.hold,E=D.bits,g=D.lencode,b=D.distcode,p=(1<<D.lenbits)-1,B=(1<<D.distbits)-1;e:do{E<15&&(u+=C[n++]<<E,E+=8,u+=C[n++]<<E,E+=8),S=g[u&p];t:for(;;){if(_=S>>>24,u>>>=_,E-=_,_=S>>>16&255,_===0)T[o++]=S&65535;else if(_&16){y=S&65535,_&=15,_&&(E<_&&(u+=C[n++]<<E,E+=8),y+=u&(1<<_)-1,u>>>=_,E-=_),E<15&&(u+=C[n++]<<E,E+=8,u+=C[n++]<<E,E+=8),S=b[u&B];r:for(;;){if(_=S>>>24,u>>>=_,E-=_,_=S>>>16&255,_&16){if(L=S&65535,_&=15,E<_&&(u+=C[n++]<<E,E+=8,E<_&&(u+=C[n++]<<E,E+=8)),L+=u&(1<<_)-1,L>c){t.msg="invalid distance too far back",D.mode=16209;break e}if(u>>>=_,E-=_,_=o-a,L>_){if(_=L-_,_>l&&D.sane){t.msg="invalid distance too far back",D.mode=16209;break e}if(w=0,v=h,d===0){if(w+=f-_,_<y){y-=_;do T[o++]=h[w++];while(--_);w=o-L,v=T}}else if(d<_){if(w+=f+d-_,_-=d,_<y){y-=_;do T[o++]=h[w++];while(--_);if(w=0,d<y){_=d,y-=_;do T[o++]=h[w++];while(--_);w=o-L,v=T}}}else if(w+=d-_,_<y){y-=_;do T[o++]=h[w++];while(--_);w=o-L,v=T}for(;y>2;)T[o++]=v[w++],T[o++]=v[w++],T[o++]=v[w++],y-=3;y&&(T[o++]=v[w++],y>1&&(T[o++]=v[w++]))}else{w=o-L;do T[o++]=T[w++],T[o++]=T[w++],T[o++]=T[w++],y-=3;while(y>2);y&&(T[o++]=T[w++],y>1&&(T[o++]=T[w++]))}}else if((_&64)===0){S=b[(S&65535)+(u&(1<<_)-1)];continue r}else{t.msg="invalid distance code",D.mode=16209;break e}break}}else if((_&64)===0){S=g[(S&65535)+(u&(1<<_)-1)];continue t}else if(_&32){D.mode=16191;break e}else{t.msg="invalid literal/length code",D.mode=16209;break e}break}}while(n<i&&o<s);y=E>>3,n-=y,E-=y<<3,u&=(1<<E)-1,t.next_in=n,t.next_out=o,t.avail_in=n<i?5+(i-n):5-(n-i),t.avail_out=o<s?257+(s-o):257-(o-s),D.hold=u,D.bits=E}});var Eo=Z((Mc,mo)=>{"use strict";var Vf=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Yf=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),Kf=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Gf=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Xf=(r,t,e,n,i,o,a,s)=>{let c=s.bits,f=0,l=0,d=0,h=0,u=0,E=0,g=0,b=0,p=0,B=0,S,_,y,L,w,v=null,C,T=new Uint16Array(16),D=new Uint16Array(16),ze=null,Kn,Kt,Gt;for(f=0;f<=15;f++)T[f]=0;for(l=0;l<n;l++)T[t[e+l]]++;for(u=c,h=15;h>=1&&T[h]===0;h--);if(u>h&&(u=h),h===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<h&&T[d]===0;d++);for(u<d&&(u=d),b=1,f=1;f<=15;f++)if(b<<=1,b-=T[f],b<0)return-1;if(b>0&&(r===0||h!==1))return-1;for(D[1]=0,f=1;f<15;f++)D[f+1]=D[f]+T[f];for(l=0;l<n;l++)t[e+l]!==0&&(a[D[t[e+l]]++]=l);if(r===0?(v=ze=a,C=20):r===1?(v=Vf,ze=Yf,C=257):(v=Kf,ze=Gf,C=0),B=0,l=0,f=d,w=o,E=u,g=0,y=-1,p=1<<u,L=p-1,r===1&&p>852||r===2&&p>592)return 1;for(;;){Kn=f-g,a[l]+1<C?(Kt=0,Gt=a[l]):a[l]>=C?(Kt=ze[a[l]-C],Gt=v[a[l]-C]):(Kt=96,Gt=0),S=1<<f-g,_=1<<E,d=_;do _-=S,i[w+(B>>g)+_]=Kn<<24|Kt<<16|Gt|0;while(_!==0);for(S=1<<f-1;B&S;)S>>=1;if(S!==0?(B&=S-1,B+=S):B=0,l++,--T[f]===0){if(f===h)break;f=t[e+a[l]]}if(f>u&&(B&L)!==y){for(g===0&&(g=u),w+=d,E=f-g,b=1<<E;E+g<h&&(b-=T[E+g],!(b<=0));)E++,b<<=1;if(p+=1<<E,r===1&&p>852||r===2&&p>592)return 1;y=B&L,i[y]=u<<24|E<<16|w-o|0}}return B!==0&&(i[w+B]=f-g<<24|64<<16|0),s.bits=u,0};mo.exports=Xf});var jo=Z((Fc,ae)=>{"use strict";var Nn=cn(),ge=un(),Wf=po(),Mt=Eo(),qf=0,Ho=1,$o=2,{Z_FINISH:xo,Z_BLOCK:jf,Z_TREES:_r,Z_OK:qe,Z_STREAM_END:Jf,Z_NEED_DICT:Qf,Z_STREAM_ERROR:ee,Z_DATA_ERROR:Vo,Z_MEM_ERROR:vn,Z_BUF_ERROR:el,Z_DEFLATED:go}=Ne(),Sr=16180,_o=16181,yo=16182,bo=16183,wo=16184,So=16185,Ao=16186,Io=16187,Bo=16188,To=16189,wr=16190,Ie=16191,Ln=16192,Do=16193,Cn=16194,Lo=16195,Co=16196,Ro=16197,ko=16198,yr=16199,br=16200,Uo=16201,No=16202,vo=16203,Oo=16204,Mo=16205,Rn=16206,Fo=16207,Po=16208,M=16209,On=16210,Yo=16211,tl=852,rl=592,nl=15,il=nl,Zo=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function ol(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var je=r=>{if(!r)return 1;let t=r.state;return!t||t.strm!==r||t.mode<Sr||t.mode>Yo?1:0},Ko=r=>{if(je(r))return ee;let t=r.state;return r.total_in=r.total_out=t.total=0,r.msg="",t.wrap&&(r.adler=t.wrap&1),t.mode=Sr,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(tl),t.distcode=t.distdyn=new Int32Array(rl),t.sane=1,t.back=-1,qe},Go=r=>{if(je(r))return ee;let t=r.state;return t.wsize=0,t.whave=0,t.wnext=0,Ko(r)},Xo=(r,t)=>{let e;if(je(r))return ee;let n=r.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?ee:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,Go(r))},Wo=(r,t)=>{if(!r)return ee;let e=new ol;r.state=e,e.strm=r,e.window=null,e.mode=Sr;let n=Xo(r,t);return n!==qe&&(r.state=null),n},al=r=>Wo(r,il),zo=!0,kn,Un,sl=r=>{if(zo){kn=new Int32Array(512),Un=new Int32Array(32);let t=0;for(;t<144;)r.lens[t++]=8;for(;t<256;)r.lens[t++]=9;for(;t<280;)r.lens[t++]=7;for(;t<288;)r.lens[t++]=8;for(Mt(Ho,r.lens,0,288,kn,0,r.work,{bits:9}),t=0;t<32;)r.lens[t++]=5;Mt($o,r.lens,0,32,Un,0,r.work,{bits:5}),zo=!1}r.lencode=kn,r.lenbits=9,r.distcode=Un,r.distbits=5},qo=(r,t,e,n)=>{let i,o=r.state;return o.window===null&&(o.window=new Uint8Array(1<<o.wbits)),o.wsize===0&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0),n>=o.wsize?(o.window.set(t.subarray(e-o.wsize,e),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(e-n,e-n+i),o.wnext),n-=i,n?(o.window.set(t.subarray(e-n,e),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},fl=(r,t)=>{let e,n,i,o,a,s,c,f,l,d,h,u,E,g,b=0,p,B,S,_,y,L,w,v,C=new Uint8Array(4),T,D,ze=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(je(r)||!r.output||!r.input&&r.avail_in!==0)return ee;e=r.state,e.mode===Ie&&(e.mode=Ln),a=r.next_out,i=r.output,c=r.avail_out,o=r.next_in,n=r.input,s=r.avail_in,f=e.hold,l=e.bits,d=s,h=c,v=qe;e:for(;;)switch(e.mode){case Sr:if(e.wrap===0){e.mode=Ln;break}for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&2&&f===35615){e.wbits===0&&(e.wbits=15),e.check=0,C[0]=f&255,C[1]=f>>>8&255,e.check=ge(e.check,C,2,0),f=0,l=0,e.mode=_o;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((f&255)<<8)+(f>>8))%31){r.msg="incorrect header check",e.mode=M;break}if((f&15)!==go){r.msg="unknown compression method",e.mode=M;break}if(f>>>=4,l-=4,w=(f&15)+8,e.wbits===0&&(e.wbits=w),w>15||w>e.wbits){r.msg="invalid window size",e.mode=M;break}e.dmax=1<<e.wbits,e.flags=0,r.adler=e.check=1,e.mode=f&512?To:Ie,f=0,l=0;break;case _o:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.flags=f,(e.flags&255)!==go){r.msg="unknown compression method",e.mode=M;break}if(e.flags&57344){r.msg="unknown header flags set",e.mode=M;break}e.head&&(e.head.text=f>>8&1),e.flags&512&&e.wrap&4&&(C[0]=f&255,C[1]=f>>>8&255,e.check=ge(e.check,C,2,0)),f=0,l=0,e.mode=yo;case yo:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.head&&(e.head.time=f),e.flags&512&&e.wrap&4&&(C[0]=f&255,C[1]=f>>>8&255,C[2]=f>>>16&255,C[3]=f>>>24&255,e.check=ge(e.check,C,4,0)),f=0,l=0,e.mode=bo;case bo:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.head&&(e.head.xflags=f&255,e.head.os=f>>8),e.flags&512&&e.wrap&4&&(C[0]=f&255,C[1]=f>>>8&255,e.check=ge(e.check,C,2,0)),f=0,l=0,e.mode=wo;case wo:if(e.flags&1024){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.length=f,e.head&&(e.head.extra_len=f),e.flags&512&&e.wrap&4&&(C[0]=f&255,C[1]=f>>>8&255,e.check=ge(e.check,C,2,0)),f=0,l=0}else e.head&&(e.head.extra=null);e.mode=So;case So:if(e.flags&1024&&(u=e.length,u>s&&(u=s),u&&(e.head&&(w=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(n.subarray(o,o+u),w)),e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,e.length-=u),e.length))break e;e.length=0,e.mode=Ao;case Ao:if(e.flags&2048){if(s===0)break e;u=0;do w=n[o+u++],e.head&&w&&e.length<65536&&(e.head.name+=String.fromCharCode(w));while(w&&u<s);if(e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,w)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=Io;case Io:if(e.flags&4096){if(s===0)break e;u=0;do w=n[o+u++],e.head&&w&&e.length<65536&&(e.head.comment+=String.fromCharCode(w));while(w&&u<s);if(e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,w)break e}else e.head&&(e.head.comment=null);e.mode=Bo;case Bo:if(e.flags&512){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&4&&f!==(e.check&65535)){r.msg="header crc mismatch",e.mode=M;break}f=0,l=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),r.adler=e.check=0,e.mode=Ie;break;case To:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}r.adler=e.check=Zo(f),f=0,l=0,e.mode=wr;case wr:if(e.havedict===0)return r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,Qf;r.adler=e.check=1,e.mode=Ie;case Ie:if(t===jf||t===_r)break e;case Ln:if(e.last){f>>>=l&7,l-=l&7,e.mode=Rn;break}for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}switch(e.last=f&1,f>>>=1,l-=1,f&3){case 0:e.mode=Do;break;case 1:if(sl(e),e.mode=yr,t===_r){f>>>=2,l-=2;break e}break;case 2:e.mode=Co;break;case 3:r.msg="invalid block type",e.mode=M}f>>>=2,l-=2;break;case Do:for(f>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((f&65535)!==(f>>>16^65535)){r.msg="invalid stored block lengths",e.mode=M;break}if(e.length=f&65535,f=0,l=0,e.mode=Cn,t===_r)break e;case Cn:e.mode=Lo;case Lo:if(u=e.length,u){if(u>s&&(u=s),u>c&&(u=c),u===0)break e;i.set(n.subarray(o,o+u),a),s-=u,o+=u,c-=u,a+=u,e.length-=u;break}e.mode=Ie;break;case Co:for(;l<14;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.nlen=(f&31)+257,f>>>=5,l-=5,e.ndist=(f&31)+1,f>>>=5,l-=5,e.ncode=(f&15)+4,f>>>=4,l-=4,e.nlen>286||e.ndist>30){r.msg="too many length or distance symbols",e.mode=M;break}e.have=0,e.mode=Ro;case Ro:for(;e.have<e.ncode;){for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.lens[ze[e.have++]]=f&7,f>>>=3,l-=3}for(;e.have<19;)e.lens[ze[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,T={bits:e.lenbits},v=Mt(qf,e.lens,0,19,e.lencode,0,e.work,T),e.lenbits=T.bits,v){r.msg="invalid code lengths set",e.mode=M;break}e.have=0,e.mode=ko;case ko:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[f&(1<<e.lenbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(S<16)f>>>=p,l-=p,e.lens[e.have++]=S;else{if(S===16){for(D=p+2;l<D;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(f>>>=p,l-=p,e.have===0){r.msg="invalid bit length repeat",e.mode=M;break}w=e.lens[e.have-1],u=3+(f&3),f>>>=2,l-=2}else if(S===17){for(D=p+3;l<D;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=p,l-=p,w=0,u=3+(f&7),f>>>=3,l-=3}else{for(D=p+7;l<D;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=p,l-=p,w=0,u=11+(f&127),f>>>=7,l-=7}if(e.have+u>e.nlen+e.ndist){r.msg="invalid bit length repeat",e.mode=M;break}for(;u--;)e.lens[e.have++]=w}}if(e.mode===M)break;if(e.lens[256]===0){r.msg="invalid code -- missing end-of-block",e.mode=M;break}if(e.lenbits=9,T={bits:e.lenbits},v=Mt(Ho,e.lens,0,e.nlen,e.lencode,0,e.work,T),e.lenbits=T.bits,v){r.msg="invalid literal/lengths set",e.mode=M;break}if(e.distbits=6,e.distcode=e.distdyn,T={bits:e.distbits},v=Mt($o,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,T),e.distbits=T.bits,v){r.msg="invalid distances set",e.mode=M;break}if(e.mode=yr,t===_r)break e;case yr:e.mode=br;case br:if(s>=6&&c>=258){r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,Wf(r,h),a=r.next_out,i=r.output,c=r.avail_out,o=r.next_in,n=r.input,s=r.avail_in,f=e.hold,l=e.bits,e.mode===Ie&&(e.back=-1);break}for(e.back=0;b=e.lencode[f&(1<<e.lenbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(B&&(B&240)===0){for(_=p,y=B,L=S;b=e.lencode[L+((f&(1<<_+y)-1)>>_)],p=b>>>24,B=b>>>16&255,S=b&65535,!(_+p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=_,l-=_,e.back+=_}if(f>>>=p,l-=p,e.back+=p,e.length=S,B===0){e.mode=Mo;break}if(B&32){e.back=-1,e.mode=Ie;break}if(B&64){r.msg="invalid literal/length code",e.mode=M;break}e.extra=B&15,e.mode=Uo;case Uo:if(e.extra){for(D=e.extra;l<D;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.length+=f&(1<<e.extra)-1,f>>>=e.extra,l-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=No;case No:for(;b=e.distcode[f&(1<<e.distbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((B&240)===0){for(_=p,y=B,L=S;b=e.distcode[L+((f&(1<<_+y)-1)>>_)],p=b>>>24,B=b>>>16&255,S=b&65535,!(_+p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=_,l-=_,e.back+=_}if(f>>>=p,l-=p,e.back+=p,B&64){r.msg="invalid distance code",e.mode=M;break}e.offset=S,e.extra=B&15,e.mode=vo;case vo:if(e.extra){for(D=e.extra;l<D;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.offset+=f&(1<<e.extra)-1,f>>>=e.extra,l-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){r.msg="invalid distance too far back",e.mode=M;break}e.mode=Oo;case Oo:if(c===0)break e;if(u=h-c,e.offset>u){if(u=e.offset-u,u>e.whave&&e.sane){r.msg="invalid distance too far back",e.mode=M;break}u>e.wnext?(u-=e.wnext,E=e.wsize-u):E=e.wnext-u,u>e.length&&(u=e.length),g=e.window}else g=i,E=a-e.offset,u=e.length;u>c&&(u=c),c-=u,e.length-=u;do i[a++]=g[E++];while(--u);e.length===0&&(e.mode=br);break;case Mo:if(c===0)break e;i[a++]=e.length,c--,e.mode=br;break;case Rn:if(e.wrap){for(;l<32;){if(s===0)break e;s--,f|=n[o++]<<l,l+=8}if(h-=c,r.total_out+=h,e.total+=h,e.wrap&4&&h&&(r.adler=e.check=e.flags?ge(e.check,i,h,a-h):Nn(e.check,i,h,a-h)),h=c,e.wrap&4&&(e.flags?f:Zo(f))!==e.check){r.msg="incorrect data check",e.mode=M;break}f=0,l=0}e.mode=Fo;case Fo:if(e.wrap&&e.flags){for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&4&&f!==(e.total&4294967295)){r.msg="incorrect length check",e.mode=M;break}f=0,l=0}e.mode=Po;case Po:v=Jf;break e;case M:v=Vo;break e;case On:return vn;case Yo:default:return ee}return r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,(e.wsize||h!==r.avail_out&&e.mode<M&&(e.mode<Rn||t!==xo))&&qo(r,r.output,r.next_out,h-r.avail_out)?(e.mode=On,vn):(d-=r.avail_in,h-=r.avail_out,r.total_in+=d,r.total_out+=h,e.total+=h,e.wrap&4&&h&&(r.adler=e.check=e.flags?ge(e.check,i,h,r.next_out-h):Nn(e.check,i,h,r.next_out-h)),r.data_type=e.bits+(e.last?64:0)+(e.mode===Ie?128:0)+(e.mode===yr||e.mode===Cn?256:0),(d===0&&h===0||t===xo)&&v===qe&&(v=el),v)},ll=r=>{if(je(r))return ee;let t=r.state;return t.window&&(t.window=null),r.state=null,qe},cl=(r,t)=>{if(je(r))return ee;let e=r.state;return(e.wrap&2)===0?ee:(e.head=t,t.done=!1,qe)},ul=(r,t)=>{let e=t.length,n,i,o;return je(r)||(n=r.state,n.wrap!==0&&n.mode!==wr)?ee:n.mode===wr&&(i=1,i=Nn(i,t,e,0),i!==n.check)?Vo:(o=qo(r,t,e,e),o?(n.mode=On,vn):(n.havedict=1,qe))};ae.exports.inflateReset=Go;ae.exports.inflateReset2=Xo;ae.exports.inflateResetKeep=Ko;ae.exports.inflateInit=al;ae.exports.inflateInit2=Wo;ae.exports.inflate=fl;ae.exports.inflateEnd=ll;ae.exports.inflateGetHeader=cl;ae.exports.inflateSetDictionary=ul;ae.exports.inflateInfo="pako inflate (from Nodeca project)"});var Qo=Z((Pc,Jo)=>{"use strict";function hl(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Jo.exports=hl});var oa=Z((Zc,mt)=>{"use strict";var _e=jo(),na=An(),Pn=In(),Zn=pr(),dl=Bn(),pl=Qo(),ia=Object.prototype.toString,{Z_NO_FLUSH:ml,Z_FINISH:ea,Z_OK:pt,Z_STREAM_END:Mn,Z_NEED_DICT:Fn,Z_STREAM_ERROR:El,Z_DATA_ERROR:ta,Z_MEM_ERROR:xl,Z_BUF_ERROR:ra}=Ne(),gl={chunkSize:1024*64,windowBits:15,to:""};function Ft(r){this.options=na.assign({},gl,r||{});let 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&&!(r&&r.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dl,this.strm.avail_out=0;let e=_e.inflateInit2(this.strm,t.windowBits);if(e!==pt)throw new Error(Zn[e]);if(this.header=new pl,_e.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Pn.string2buf(t.dictionary):ia.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=_e.inflateSetDictionary(this.strm,t.dictionary),e!==pt)))throw new Error(Zn[e])}Ft.prototype.push=function(r,t){let e=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?ea:ml,ia.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),o=_e.inflate(e,a),o===Fn&&i&&(o=_e.inflateSetDictionary(e,i),o===pt?o=_e.inflate(e,a):o===ta&&(o=Fn));e.avail_in>0&&o===Mn&&e.state.wrap&2&&e.state.flags!==0&&e.input[e.next_in]!==0;)_e.inflateReset(e),o=_e.inflate(e,a);switch(o){case El:case ta:case Fn:case xl:return this.onEnd(o),this.ended=!0,!1}if(s=e.avail_out,e.next_out&&(e.avail_out===0||o===Mn||a>0))if(this.options.to==="string"){let c=Pn.utf8border(e.output,e.next_out),f=e.next_out-c,l=Pn.buf2string(e.output,c);e.next_out=f,e.avail_out=n-f,f&&e.output.set(e.output.subarray(c,c+f),0),this.onData(l)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out)),e.avail_out=0,e.next_out=0;if(!((o===pt||o===ra)&&s===0)){if(o===Mn)return o=_e.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(e.avail_in===0){if(a===ea)return o=_e.inflateEnd(this.strm),this.onEnd(o===pt?ra:o),this.ended=!0,!1;break}}}return!0};Ft.prototype.onData=function(r){this.chunks.push(r)};Ft.prototype.onEnd=function(r){r===pt&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=na.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function zn(r,t){let e=new Ft(t);if(e.push(r,!0),e.err)throw e.msg||Zn[e.err];return e.result}function _l(r,t){return t=t||{},t.raw=!0,zn(r,t)}mt.exports.Inflate=Ft;mt.exports.inflate=zn;mt.exports.inflateRaw=_l;mt.exports.ungzip=zn;mt.exports.constants=Ne()});var Hn=Z((zc,ye)=>{"use strict";var{Deflate:yl,deflate:bl,deflateRaw:wl,gzip:Sl}=uo(),{Inflate:Al,inflate:Il,inflateRaw:Bl,ungzip:Tl}=oa(),Dl=Ne();ye.exports.Deflate=yl;ye.exports.deflate=bl;ye.exports.deflateRaw=wl;ye.exports.gzip=Sl;ye.exports.Inflate=Al;ye.exports.inflate=Il;ye.exports.inflateRaw=Bl;ye.exports.ungzip=Tl;ye.exports.constants=Dl});var Yl={};ba(Yl,{AES256_KEY_SIZE:()=>Ve,AES256_PWD_VERIFY_SIZE:()=>De,AES256_SALT_SIZE:()=>le,AES_AUTH_CODE_SIZE:()=>ce,AES_EXTRA_FIELD_SIZE:()=>Le,AES_OVERHEAD:()=>nr,CENTRAL_DIR:()=>A,CENTRAL_DIRECTORY_END:()=>xi,CENTRAL_END:()=>re,CENTRAL_FILE_HEADER:()=>Ei,CMP_METHOD:()=>I,DATATYPE:()=>be,DATA_DESC:()=>as,DATA_DESCRIPTOR:()=>os,DOS_FILE_ATTR:()=>Re,ENCRYPT_HDR_SIZE:()=>Te,EXTENSIBLE_DATA_FIELDS:()=>ss,EncryptionManager:()=>Dr,Errors:()=>O,FILE_SYSTEM:()=>F,GP_FLAG:()=>P,HDR_ID:()=>R,HashCalculator:()=>Ai,HashCalculatorClass:()=>J,LOCAL_FILE_HEADER:()=>mi,LOCAL_HDR:()=>N,Logger:()=>x,META_MANIFEST_JSON:()=>tr,META_TIMESTAMP_NZIP:()=>er,META_TIMESTAMP_OTS:()=>yt,META_TOKEN_NZIP:()=>gt,META_TOKEN_NZIP_LEGACY:()=>Jt,META_TS_SUBMIT_NZIP:()=>Qt,META_TS_SUBMIT_OTS:()=>_t,NEOZIPKIT_INFO:()=>fr,NEO_CRYPTO_EXTRA_FIELD_SIZE:()=>Ce,NEO_CRYPTO_MAGIC_BYTES:()=>H,NEO_CRYPTO_PAYLOAD_V1:()=>te,PlatformUtils:()=>Vl,ProgressTracker:()=>Tr,TIMESTAMP_METADATA:()=>Zr,TIMESTAMP_SUBMITTED:()=>Pr,TOKENIZED_METADATA:()=>zr,VERSION:()=>$l,ZIP64_CENTRAL_DIR:()=>ir,ZIP64_CENTRAL_DIRECTORY_END:()=>is,ZIP64_CENTRAL_DIRECTORY_LOCATOR:()=>ns,ZIP64_CENTRAL_END:()=>Hr,ZipCompress:()=>Et,ZipCopy:()=>Ir,ZipCrypto:()=>j,ZipEntry:()=>ie,ZipkitBrowser:()=>Yt,asciiPathEqualsIgnoreCase:()=>rr,computeArchiveMerkleRoot:()=>Ze,computeMerkleRootV0FromDigests:()=>Ar,computeMerkleRootV1FromContents:()=>vl,computeMerkleRootV1FromLeaves:()=>Vt,configureLoggerFromEnvironment:()=>$r,contentDigest:()=>ha,crc32:()=>ne,crc32update:()=>sr,findReservedMetaEntry:()=>wt,getTypeOf:()=>Br,isMetaInfPath:()=>V,isMetadataFile:()=>zl,isReservedMetaPath:()=>bt,isStream:()=>Zl,leafHashV0:()=>Ul,leafHashV1:()=>$t,matchMerkleRoot:()=>Ol,merkleRootFromLeaves:()=>da,normalizeMerklePath:()=>ua,parentHash:()=>Vn,readBigUInt64LE:()=>Fl,sha256:()=>it,uMul:()=>Pl});var ma=wa(pi());var O={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",STRONG_ENCRYPT_UNSUPPORTED:"Strong Encryption is not supported",INVALID_TIMESTAMP:"Invalid timestamp",TIMESTAMP_FAILED:"Failed to create the timestamp",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",INVALID_CMP_DATA_LENGTH:"Compressed data length does not match the expected length",EXTRACT_FAILED:"Failed to extract file",INVALID_CRC:"CRC32 checksum does not match the expected value",UNKNOWN_SHA256:"The SHA-256 hash has not been saved",INVALID_SHA256:"The SHA-256 hash does not match the expected value",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",NO_STREAM_SUPPORT:"Streams are not supported in this environment",NO_BLOB_SUPPORT:"Blobs are not supported in this environment",NO_FILE_READER_SUPPORT:"FileReader is not supported in this environment",NO_FILES:"No files added, Zip file not created",DATATYPE_STRING_UNSUPPORTED:"The String type is not supported by this platform.",DATATYPE_ARRAY_UNSUPPORTED:"The Array type is not supported by this platform.",DATATYPE_BUFFER_UNSUPPORTED:"The Buffer type is not supported by this platform.",DATATYPE_BLOB_UNSUPPORTED:"The Blob type is not supported by this platform.",DATATYPE_U8ARRAY_UNSUPPORTED:"The uint8Array type is not supported by this platform.",DATATYPE_ARRAYBUFFER_UNSUPPORTED:"The ArrayBuffer type is not supported by this platform.",DATATYPE_UNSUPPORTED:"Unsupported input type.",COMPRESS_FAILED:"Failed to compress data",COMPRESSION_ERROR:"Error occurred during compression",DECOMPRESSION_ERROR:"Error occurred during decompression",ENCRYPT_FAILED:"Encryption failed"};var gt="META-INF/TOKEN.NZIP",Jt="META-INF/NZIP.TOKEN",Qt="META-INF/TS-SUBMIT.NZIP",er="META-INF/TIMESTAMP.NZIP",_t="META-INF/TS-SUBMIT.OTS",yt="META-INF/TIMESTAMP.OTS",tr="META-INF/manifest.json",Pr=_t,Zr=yt,zr=gt,rs=[gt,Jt,Qt,er,_t,yt,tr];function rr(r,t){return r.length,t.length,r.toLowerCase()===t.toLowerCase()}function V(r){return r.toLowerCase().startsWith("meta-inf/")}function bt(r){let t=r.toLowerCase();return rs.some(e=>e.toLowerCase()===t)}function wt(r,t){let e=Array.isArray(t)?t:[t];for(let n of e){let i=r.find(o=>o.filename===n);if(i)return i}for(let n of e){let i=r.find(o=>typeof o.filename=="string"&&rr(o.filename,n));if(i)return i}return null}var mi="PK",Ei="PK",xi="PK",ns="PK\x07",is="PK",os="PK\x07\b",N={SIZE:30,SIGNATURE:67324752,VER_EXTRACT:4,FLAGS:6,COMPRESSION:8,TIMEDATE_DOS:10,CRC:14,CMP_SIZE:18,UNCMP_SIZE:22,FNAME_LEN:26,EXTRA_LEN:28},Te=12,le=16,Ve=32,De=2,ce=10,Le=11,nr=le+De+ce,te=11,Ce=4+te,H=[78,69,90,0],as={SIGNATURE:134695760,SIZE:16,CRC:4,CMP_SIZE:8,UNCMP_SIZE:12},A={SIZE:46,SIGNATURE:33639248,VER_MADE:4,VER_EXT:6,FLAGS:8,CMP_METHOD:10,TIMEDATE_DOS:12,CRC:16,CMP_SIZE:20,UNCMP_SIZE:24,FNAME_LEN:28,EXTRA_LEN:30,COMMENT_LEN:32,DISK_NUM:34,INT_FILE_ATTR:36,EXT_FILE_ATTR:38,LOCAL_HDR_OFFSET:42},re={SIZE:22,SIGNATURE:101010256,VOL_NUM:4,VOLDIR_START:6,VOL_ENTRIES:8,TOTAL_ENTRIES:10,CENTRAL_DIR_SIZE:12,CENTRAL_DIR_OFFSET:16,ZIP_COMMENT_LEN:20},ir={SIGNATURE:101075792,SIZE:56,LEAD:12,SIZE_FIELD:4,VER_MADEBY:12,VER_NEEDED:14,VOL_NUM:16,VOLDIR_START:20,VOL_ENTRIES:24,TOTAL_ENTRIES:32,CENTRAL_DIR_SIZE:40,CENTRAL_DIR_OFFSET:48,EXTRA_FIELD:56},Hr={SIZE:20,SIGNATURE:117853008,VOL_NUM:4,CENTRAL_DIR_OFFSET:8,TOTAL_DISKS:16},I={STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATE:9,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,ZSTD:93,AES_ENCRYPT:99},P={ENCRYPTED:1,COMPRESSION1:2,COMPRESSION2:4,DATA_DESC:8,ENHANCED_DEFLATE:16,PATCHED:32,STRONG_ENCRYPT:64,EFS:2048,MASK:4096},ss={ID:0,SIZE:2},R={ZIP64:1,AVINFO:7,PFS:8,OS2:9,NTFS:10,OPENVMS:12,UNIX:13,FORK:14,PATCH:15,x509PKCS7:20,x509CERT_IDF:21,x509CERT_IDC:22,STRONG_ENC:23,AES:39169,RECORD_MGT:24,x509PKCS7RL:25,IBM1:101,IBM2:102,SHA256:334,NEO_CRYPTO:590,POSZIP:18064,UNV_TIME:21589,UID_GID:30837,UNICODE_PATH:28789,SYMLINK:30805,HARDLINK:30821},F={MSDOS:0,AMIGA:1,OPENVMS:2,UNIX:3,VM_CMS:4,ATARI:5,OS2:6,MAC:7,CP_M:9,NTFS:10,MVS:11,VSE:12,ACORN:13,VFAT:14,ALTMVS:15,BEOS:16,TANDEM:17,OS400:18,DARWIN:19},Re={READONLY:1,HIDDEN:2,SYSTEM:4,VOLUME:8,DIRECTORY:16,ARCHIVE:32};var x=class{static configure(t){this.config={...this.config,...t}}static getConfig(){return{...this.config}}static enable(){this.config.enabled=!0}static disable(){this.config.enabled=!1}static setLevel(t){this.config.level=t}static shouldLog(t){if(!this.config.enabled)return!1;let e=["debug","info","warn","error","silent"],n=e.indexOf(this.config.level);return e.indexOf(t)>=n}static log(...t){this.shouldLog("info")&&this.originalConsole.log(...t)}static error(...t){this.shouldLog("error")&&this.originalConsole.error(...t)}static warn(...t){this.shouldLog("warn")&&this.originalConsole.warn(...t)}static debug(...t){this.shouldLog("debug")&&this.originalConsole.log(...t)}static info(...t){this.shouldLog("info")&&this.originalConsole.info(...t)}static overrideConsole(){console.log=(...t)=>this.log(...t),console.error=(...t)=>this.error(...t),console.warn=(...t)=>this.warn(...t),console.debug=(...t)=>this.debug(...t),console.info=(...t)=>this.info(...t)}static restoreConsole(){console.log=this.originalConsole.log,console.error=this.originalConsole.error,console.warn=this.originalConsole.warn,console.debug=this.originalConsole.debug,console.info=this.originalConsole.info}};x.config={enabled:!0,level:"info"},x.originalConsole={log:console.log,error:console.error,warn:console.warn,debug:console.debug,info:console.info};function $r(){let r=typeof process<"u"?process.env:{};if(r.NEOZIP_DEBUG==="false"?x.disable():r.NEOZIP_DEBUG==="true"&&(x.enable(),x.setLevel("debug")),r.NEOZIP_LOG_LEVEL){let t=r.NEOZIP_LOG_LEVEL;["debug","info","warn","error","silent"].includes(t)&&x.setLevel(t)}r.NODE_ENV==="production"&&x.setLevel("error")}$r();var or=typeof crypto<"u"?crypto:typeof window<"u"&&window.crypto?window.crypto:null;if(!or||!or.subtle)throw new Error("Web Crypto API is not available in this environment");function ls(r){return new Uint8Array(r)}function gi(r){return r instanceof Uint8Array||r instanceof ArrayBuffer,Buffer.from(r)}async function he(r){let e={sha256:"SHA-256",sha1:"SHA-1",md5:"MD5"}[r.toLowerCase()]||"SHA-256";return{update:function(n){return this._data=this._data?Buffer.concat([this._data,gi(n)]):gi(n),this},digest:async function(n){let i=this._data||Buffer.alloc(0),o=await or.subtle.digest(e,i),a=ls(o);return n==="hex"?Array.from(a).map(s=>s.toString(16).padStart(2,"0")).join(""):n==="base64"?Buffer.from(a).toString("base64"):Buffer.from(a)}}}function ar(r){let t=new Uint8Array(r);return or.getRandomValues(t),Buffer.from(t)}function Vr(r){let t=(Buffer.isBuffer(r),Buffer.from(r)),e=t.length,n=e*8,i=64-(e+9)%64,o=e+1+(i<0?i+64:i)+8,a=Buffer.alloc(o);t.copy(a,0),a[e]=128,a.writeUInt32BE(n/4294967296>>>0,o-8),a.writeUInt32BE(n>>>0,o-4);let s=[1732584193,4023233417,2562383102,271733878,3285377520],c=[1518500249,1859775393,2400959708,3395469782],f=new Array(80);for(let d=0;d<o;d+=64){for(let p=0;p<16;p++)f[p]=a.readUInt32BE(d+p*4);for(let p=16;p<80;p++)f[p]=(f[p-3]^f[p-8]^f[p-14]^f[p-16])<<1|(f[p-3]^f[p-8]^f[p-14]^f[p-16])>>>31;let[h,u,E,g,b]=s;for(let p=0;p<80;p++){let B,S;p<20?(B=u&E|~u&g,S=c[0]):p<40?(B=u^E^g,S=c[1]):p<60?(B=u&E|u&g|E&g,S=c[2]):(B=u^E^g,S=c[3]),S=(h<<5|h>>>27)+B+b+S+(f[p]>>>0)>>>0,b=g,g=E,E=u<<30|u>>>2,u=h,h=S}s[0]=s[0]+h>>>0,s[1]=s[1]+u>>>0,s[2]=s[2]+E>>>0,s[3]=s[3]+g>>>0,s[4]=s[4]+b>>>0}let l=Buffer.alloc(20);for(let d=0;d<5;d++)l.writeUInt32BE(s[d],d*4);return l}function Yr(r,t){let n=(Buffer.isBuffer(r),Buffer.from(r));n.length>64&&(n=Vr(n)),n.length<64&&(n=Buffer.concat([n,Buffer.alloc(64-n.length)]));let i=Buffer.alloc(64,54),o=Buffer.alloc(64,92);for(let s=0;s<64;s++)i[s]^=n[s],o[s]^=n[s];let a=Vr(Buffer.concat([i,Buffer.isBuffer(t)?t:Buffer.from(t)]));return Vr(Buffer.concat([o,a]))}function _i(r,t,e,n,i){if(i&&i.toLowerCase()!=="sha1")throw new Error("Browser shim only supports PBKDF2 with sha1");let o=20,a=Math.ceil(n/o),s=[],c=Buffer.isBuffer(r)?r:Buffer.from(r),f=Buffer.isBuffer(t)?t:Buffer.from(t);for(let l=1;l<=a;l++){let d=Buffer.from([l>>>24&255,l>>>16&255,l>>>8&255,l&255]),h=Yr(c,Buffer.concat([f,d])),u=Buffer.from(h);for(let E=1;E<e;E++){h=Yr(c,h);for(let g=0;g<o;g++)u[g]^=h[g]}s.push(u)}return Buffer.concat(s).subarray(0,n)}function Kr(r,t){if(r!=="sha1")throw new Error("Browser shim createHmac only supports sha1");let e=Buffer.isBuffer(t)?t:Buffer.from(t),n=Buffer.alloc(0);return{update(i){return n=Buffer.concat([n,Buffer.isBuffer(i)?i:Buffer.from(i)]),this},digest(){let i=Yr(e,n);return n=Buffer.alloc(0),i}}}var ue=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),cs=new Uint8Array([1,2,4,8,16,32,64,128,27,54]);function us(r){let t=new Uint8Array(240);for(let e=0;e<32;e++)t[e]=r[e];for(let e=8;e<60;e++){let n=e*4,i=(e-8)*4,o=(e-1)*4;if(e%8===0){let a=ue[t[o+1]]^cs[e/8-1];t[n]=t[i]^a,t[n+1]=t[i+1]^ue[t[o+2]],t[n+2]=t[i+2]^ue[t[o+3]],t[n+3]=t[i+3]^ue[t[o]]}else e%8===4?(t[n]=t[i]^ue[t[o]],t[n+1]=t[i+1]^ue[t[o+1]],t[n+2]=t[i+2]^ue[t[o+2]],t[n+3]=t[i+3]^ue[t[o+3]]):(t[n]=t[i]^t[o],t[n+1]=t[i+1]^t[o+1],t[n+2]=t[i+2]^t[o+2],t[n+3]=t[i+3]^t[o+3])}return t}function ke(r){return r<<1&255^(r>>>7&1)*27}function hs(r,t){let e=new Uint8Array(16);for(let s=0;s<16;s++)e[s]=t[s]^r[s];for(let s=1;s<14;s++){for(let u=0;u<16;u++)e[u]=ue[e[u]];let c=e[1];e[1]=e[5],e[5]=e[9],e[9]=e[13],e[13]=c;let f=e[2];e[2]=e[10],e[10]=f;let l=e[6];e[6]=e[14],e[14]=l;let d=e[3];e[3]=e[15],e[15]=e[11],e[11]=e[7],e[7]=d;for(let u=0;u<4;u++){let E=e[u*4],g=e[u*4+1],b=e[u*4+2],p=e[u*4+3];e[u*4]=ke(E)^ke(g)^g^b^p,e[u*4+1]=E^ke(g)^ke(b)^b^p,e[u*4+2]=E^g^ke(b)^ke(p)^p,e[u*4+3]=ke(E)^E^g^b^ke(p)}let h=s*16;for(let u=0;u<16;u++)e[u]^=r[h+u]}for(let s=0;s<16;s++)e[s]=ue[e[s]];let n=e[1];e[1]=e[5],e[5]=e[9],e[9]=e[13],e[13]=n;let i=e[2];e[2]=e[10],e[10]=i;let o=e[6];e[6]=e[14],e[14]=o;let a=e[3];e[3]=e[15],e[15]=e[11],e[11]=e[7],e[7]=a;for(let s=0;s<16;s++)e[s]^=r[224+s];return e}function yi(r,t,e){if(r!=="aes-256-ecb"||e!=null)throw new Error("Browser shim createCipheriv only supports aes-256-ecb with null iv");let n=Buffer.isBuffer(t)?t:Buffer.from(t);if(n.length!==32)throw new Error("aes-256-ecb requires 32-byte key");let i=us(n);return{setAutoPadding(){return this},update(o){let a=Buffer.isBuffer(o)?o:Buffer.from(o);if(a.length!==16)throw new Error("Browser shim AES-ECB only supports 16-byte blocks");let s=hs(i,a);return Buffer.from(s)},final(){return Buffer.alloc(0)}}}var Ue=class Ue{canHandle(t){return t===1}getMethodName(){return"ZIP-Crypto"}getKeyLength(){return Ue.KEY_LENGTH}async encrypt(t,e){try{if(e.method!==1)return{success:!1,error:"ZIP-Crypto encryption method required"};let n=this.initKeys(e.password),i=Buffer.alloc(t.length);for(let o=0;o<t.length;o++){let a=t[o],s=this.encryptByte(n,a);i[o]=s,this.updateKeys(n,a)}return{success:!0,encryptedData:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown encryption error"}}}async decrypt(t,e){try{if(e.method!==1)return{success:!1,error:"ZIP-Crypto decryption method required"};let n=this.initKeys(e.password),i=Buffer.alloc(t.length);for(let o=0;o<t.length;o++){let a=t[o],s=this.decryptByte(n,a);i[o]=s,this.updateKeys(n,s)}return{success:!0,decryptedData:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown decryption error"}}}verifyPassword(t,e){if(t.length<12)throw new Error("Decrypted header must be at least 12 bytes");if(t[11]!==e)throw new Error("Password verification FAILED")}parseLocalHeaderForDecryption(t,e){if(t.readUInt32LE(0)!==67324752)throw new Error("Invalid local header signature");let n=t.readUInt16LE(6),i=t.readUInt32LE(10),o=t.readUInt32LE(14);n&P.DATA_DESC&&(!e.lastModTimeDate||e.lastModTimeDate===0)&&(e.lastModTimeDate=i),e.localCrc=o;let a;return n&P.DATA_DESC?a=(e.lastModTimeDate||e.timeDateDOS||0)>>8&255:a=(o&&o!==0?o:e.crc)>>24&255,{bitFlags:n,lastModTimeDate:i,localCrc:o,checkByte:a}}createEncryptionHeader(t,e){let n=Buffer.alloc(Te);ar(11).copy(n,0);let o;return(t.bitFlags&P.DATA_DESC)!==0?o=(t.lastModTimeDate||t.timeDateDOS||0)>>8&255:o=t.crc>>24&255,n[11]=o,x.debug(`[ZipCrypto] Created encryption header: checkByte=0x${o.toString(16).padStart(2,"0")}, DATA_DESC=${(t.bitFlags&P.DATA_DESC)!==0}`),n}encryptBuffer(t,e,n){let i=this.createEncryptionHeader(t,n),o=Buffer.concat([i,e]),a=this.initKeys(n),s=Buffer.alloc(o.length);for(let c=0;c<o.length;c++){let f=o[c],l=this.encryptByte(a,f);s[c]=l,this.updateKeys(a,f)}return x.debug(`[ZipCrypto] Encrypted buffer: ${e.length} bytes compressed data + ${Te} bytes header = ${s.length} bytes total`),s}decryptBuffer(t,e,n,i){let o=e.subarray(t.localHdrOffset),a=o.subarray(0,30),{bitFlags:s,localCrc:c,checkByte:f}=this.parseLocalHeaderForDecryption(a,t),l=a.readUInt16LE(26),d=a.readUInt16LE(28),h=30+l+d,u=12,E=o.subarray(h,h+u),g=Buffer.concat([E,n]),b=this.initKeys(i);for(let B=0;B<g.length;B++){let S=g[B],_=this.decryptByte(b,S);g[B]=_,this.updateKeys(b,_)}let p=g.subarray(0,u);return this.verifyPassword(p,f),g.subarray(u)}async*createStreamDecryptor(t,e,n){let i=this.initKeys(t),o=12,a=Buffer.alloc(o),s=0,c=null,f=0;for(;s<o;){if(!c||f>=c.length){let h=await n.next();if(h.done||!h.value)throw new Error("ZIP-Crypto: insufficient encrypted data (missing encryption header)");c=h.value,f=0}let l=o-s,d=Math.min(l,c.length-f);c.copy(a,s,f,f+d),s+=d,f+=d}for(let l=0;l<o;l++){let d=a[l],h=this.decryptByte(i,d)&255;a[l]=h,this.updateKeys(i,h)}if(this.verifyPassword(a,e),c&&f<c.length){let l=c.length-f;for(let d=0;d<l;d++){let h=f+d,u=c[h],E=this.decryptByte(i,u);c[h]=E,this.updateKeys(i,E)}yield c.subarray(f)}for await(let l of n){for(let d=0;d<l.length;d++){let h=l[d],u=this.decryptByte(i,h);l[d]=u,this.updateKeys(i,u)}yield l}}initKeys(t){let e=[305419896,591751049,878082192];for(let n=0;n<t.length;n++)this.updateKeys(e,t.charCodeAt(n));return e}updateKeys(t,e){t[0]=(t[0]>>>8^Ue.CRC_TABLE[(t[0]^e)&255])>>>0,t[1]=(Math.imul(t[1]+(t[0]&255),134775813)+1&4294967295)>>>0,t[2]=(t[2]>>>8^Ue.CRC_TABLE[(t[2]^t[1]>>>24)&255])>>>0}encryptByte(t,e){let n=t[2]|2;return(e^Math.imul(n,n^1)>>>8)&255}decryptByte(t,e){let n=t[2]|2;return(e^Math.imul(n,n^1)>>>8)&255}crc32(t,e){return(t>>>8^Ue.CRC_TABLE[(t^e)&255])>>>0}static crc32(t){return bi(t)}static crc32update(t,e){return wi(t,e)}};Ue.KEY_LENGTH=3,Ue.CRC_TABLE=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];var j=Ue;function bi(r){typeof r=="string"&&(r=Buffer.from(r,"utf8"));let t=r.length,e=-1;for(let n=0;n<t;)e=j.CRC_TABLE[(e^r[n++])&255]^e>>>8;return~e>>>0}function wi(r,t){return j.CRC_TABLE[(r^t)&255]^r>>>8}function ne(r){return bi(r)}function sr(r,t){return wi(r,t)}function it(r){return he("sha256").update(r).digest("hex")}var Xr=30,Si=10,Wr=51,ie=class{constructor(t,e,n){this.debug=!0;this.verMadeBy=0;this.verExtract=0;this.bitFlags=0;this.cmpMethod=0;this.timeDateDOS=0;this.crc=0;this.compressedSize=0;this.uncompressedSize=0;this.volNumber=0;this.intFileAttr=0;this.extFileAttr=0;this.localHdrOffset=0;this.filename="";this.extraField=null;this.comment=null;this.fileBuffer=null;this.cmpData=null;this.isEncrypted=!1;this.isStrongEncrypt=!1;this.encryptHdr=null;this.lastModTimeDate=0;this.decrypt=null;this.aesVersion=0;this.aesStrength=0;this.realCmpMethod=-1;this.neoCryptoPayloadVersion=0;this.neoCryptoAlgorithm=0;this.neoCryptoFlags=0;this.isUpdated=!0;this.isDirectory=!1;this.isMetaData=!1;this.platform=null;this.universalTime=null;this.uid=null;this.gid=null;this.sha256=null;this.merkleLeafV1=null;this.isSymlink=!1;this.linkTarget=null;this.isHardLink=!1;this.originalEntry=null;this.inode=null;this.isMSDOS=this.platform===null;this.isUnixLike=this.platform!=null&&this.platform!=="win32";this.isMacOS=this.platform!=null&&this.platform==="darwin";this.isLinux=this.platform!=null&&this.platform==="linux";this.VER_MADE_BY=(()=>{switch(this.platform){case"darwin":return F.DARWIN<<8|Xr;case"win32":return F.NTFS<<8|Xr;default:return F.UNIX<<8|Xr}})();this.filename=t||"",this.comment=e||null,this.debug=n||!1,this.bitFlags|=P.EFS}readZipEntry(t){if(t.length<A.SIZE)throw new Error("Zip entry data is too small or corrupt");if(t.readUInt32LE(0)!==A.SIGNATURE)throw new Error(O.INVALID_CEN);this.verMadeBy=t.readUInt16LE(A.VER_MADE),this.verExtract=t.readUInt16LE(A.VER_EXT),this.bitFlags=t.readUInt16LE(A.FLAGS),(this.bitFlags&P.ENCRYPTED)!=0&&(this.isEncrypted=!0,(this.bitFlags&P.STRONG_ENCRYPT)!=0&&(this.isStrongEncrypt=!0)),this.cmpMethod=t.readUInt16LE(A.CMP_METHOD),this.timeDateDOS=t.readUInt32LE(A.TIMEDATE_DOS),this.crc=t.readUInt32LE(A.CRC),this.compressedSize=t.readUInt32LE(A.CMP_SIZE),this.uncompressedSize=t.readUInt32LE(A.UNCMP_SIZE),this.volNumber=t.readUInt16LE(A.DISK_NUM),this.intFileAttr=t.readUInt16LE(A.INT_FILE_ATTR),this.extFileAttr=t.readUInt32LE(A.EXT_FILE_ATTR),this.extFileAttr&Re.DIRECTORY&&(this.isDirectory=!0),this.localHdrOffset=t.readUInt32LE(A.LOCAL_HDR_OFFSET);let e=t.readUInt16LE(A.FNAME_LEN),n=t.toString("utf8",A.SIZE,A.SIZE+e);this.filename=n,this.filename.endsWith("/")&&(this.isDirectory=!0);let i=t.readUInt16LE(A.EXTRA_LEN);if(i>0){this.extraField=t.subarray(A.SIZE+e,A.SIZE+e+i);for(let s=0;s<i;){let c=this.extraField.readUInt16LE(s),f=this.extraField.readUInt16LE(s+2),l=this.extraField.subarray(s+4,s+4+f);if(c===R.UNICODE_PATH&&f>=5){let d=l.readUInt8(0),h=l.readUInt32LE(1),u=Buffer.from(this.filename);if(ne(u)===h){let g=l.subarray(5).toString("utf8");this.filename=g,this.debug&&x.log(`Using Unicode Path: ${this.filename}`)}}s+=4+f}for(let s=0;s<i;){let c=this.extraField.readUInt16LE(s),f=this.extraField.readUInt16LE(s+2),l=this.extraField.subarray(s+4,s+4+f);if(c===R.SHA256)f===64?this.sha256=l.toString("utf8"):this.sha256=l.toString("hex");else if(c===R.UNV_TIME)f>=5&&l.readUInt8(0)&1&&(this.universalTime=l.readUInt32LE(1));else if(c===R.UID_GID){if(f>=5){let d=l.readUInt8(0),h=l.readUInt8(1);if(h<=4&&f>=2+h&&(this.uid=l.readUIntLE(2,h),f>=2+h+1)){let u=l.readUInt8(2+h);u<=4&&f>=2+h+1+u&&(this.gid=l.readUIntLE(2+h+1,u))}}}else if(c===R.SYMLINK){if(f>=3){let d=l.readUInt8(0),h=l.readUInt16LE(1);h>0&&f>=3+h&&(this.isSymlink=!0,this.linkTarget=l.subarray(3,3+h).toString("utf8"))}}else if(c===R.HARDLINK){if(f>=11){let d=l.readUInt8(0);this.inode=l.readUInt32LE(1);let h=l.readUInt16LE(5);h>0&&f>=7+h&&(this.isHardLink=!0,this.originalEntry=l.subarray(7,7+h).toString("utf8"))}}else c===R.AES?f>=7&&(this.aesVersion=l.readUInt16LE(0),this.aesStrength=l.readUInt8(4),this.realCmpMethod=l.readUInt16LE(5)):c===R.NEO_CRYPTO&&f>=te&&l[0]===H[0]&&l[1]===H[1]&&l[2]===H[2]&&l[3]===H[3]&&(this.neoCryptoPayloadVersion=l.readUInt8(4),this.neoCryptoAlgorithm=l.readUInt16LE(5),this.neoCryptoFlags=l.readUInt16LE(7));s+=4+f}}let o=t.readUInt16LE(A.COMMENT_LEN);o>0&&(this.comment=t.toString("utf8",A.SIZE+e,A.SIZE+e+o)),this.debug&&this.showVerboseInfo();let a=A.SIZE+e+i+o;return t.subarray(a)}needsUnicodeHandling(){return/[^\x00-\x7E]|['"]/.test(this.filename)}addUnicodePathField(t,e){let n=Buffer.from(this.filename,"utf8"),i=this.filename.replace(/[^\x00-\x7E]/g,"?"),o=Buffer.from(i,"ascii"),a=ne(o),s=5+n.length;return t.writeUInt16LE(R.UNICODE_PATH,e),t.writeUInt16LE(s,e+2),t.writeUInt8(1,e+4),t.writeUInt32LE(a,e+5),n.copy(t,e+9),e+4+s}createLocalHdr(){let t=0,e=this.needsUnicodeHandling();e&&(t=5+Buffer.from(this.filename,"utf8").length+4);let n=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0;n&&(t+=Le);let i=this.neoCryptoAlgorithm>0;i&&(t+=Ce);let o=Buffer.alloc(N.SIZE+this.filename.length+t);o.writeUInt32LE(N.SIGNATURE,0);let a=this.cmpMethod===I.AES_ENCRYPT?Wr:Si;o.writeUInt16LE(a,N.VER_EXTRACT),o.writeUInt16LE(this.bitFlags>>>0,N.FLAGS),o.writeUInt16LE(this.cmpMethod,N.COMPRESSION),o.writeUInt32LE(this.timeDateDOS>>>0,N.TIMEDATE_DOS),o.writeUInt32LE(this.aesVersion===2?0:this.crc,N.CRC),o.writeUInt32LE(this.compressedSize,N.CMP_SIZE),o.writeUInt32LE(this.uncompressedSize,N.UNCMP_SIZE),o.writeUInt16LE(this.filename.length,N.FNAME_LEN),o.writeUInt16LE(t,N.EXTRA_LEN);let s=this.filename.replace(/[^\x00-\x7E]/g,"?"),c=Buffer.from(s);c.copy(o,N.SIZE);let f=N.SIZE+c.length;if(e&&(f=this.addUnicodePathField(o,f)),n&&(o.writeUInt16LE(R.AES,f),o.writeUInt16LE(7,f+2),o.writeUInt16LE(this.aesVersion,f+4),o.writeUInt16LE(17729,f+6),o.writeUInt8(this.aesStrength,f+8),o.writeUInt16LE(this.realCmpMethod,f+9),f+=Le),i){o.writeUInt16LE(R.NEO_CRYPTO,f),o.writeUInt16LE(te,f+2);let l=f+4;for(let d=0;d<4;d++)o.writeUInt8(H[d],l+d);o.writeUInt8(this.neoCryptoPayloadVersion,l+4),o.writeUInt16LE(this.neoCryptoAlgorithm,l+5),o.writeUInt16LE(this.neoCryptoFlags,l+7),o.writeUInt16LE(0,l+9),f+=Ce}return o}centralDirEntry(){let t=this.comment?Buffer.from(this.comment,"utf8").length:0,e=this.universalTime?9:0,n=this.uid&&this.gid?15:0,i=this.sha256?Buffer.from(this.sha256,"hex"):null,o=i?i.length+4:0,a=this.isSymlink&&this.linkTarget?7+Buffer.byteLength(this.linkTarget,"utf8"):0,s=this.isHardLink&&this.originalEntry&&this.inode!==null?11+Buffer.byteLength(this.originalEntry,"utf8"):0,c=this.needsUnicodeHandling(),f=0;c&&(f=5+Buffer.from(this.filename,"utf8").length+4);let l=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0,d=l?Le:0,h=this.neoCryptoAlgorithm>0,u=h?Ce:0,E=e+o+n+a+s+(c?f:0)+d+u,g=this.filename.replace(/[^\x00-\x7E]/g,"?"),b=g.length,p=Buffer.alloc(A.SIZE+b+t+E);p.writeUInt32LE(A.SIGNATURE,0),p.writeUInt16LE(this.isUpdated?this.VER_MADE_BY:this.verMadeBy,A.VER_MADE);let B=this.cmpMethod===I.AES_ENCRYPT?Wr:Si;p.writeInt16LE(this.isUpdated?B:this.verMadeBy,A.VER_EXT),p.writeInt16LE(this.bitFlags>>>0,A.FLAGS),p.writeInt16LE(this.cmpMethod,A.CMP_METHOD),p.writeUInt32LE(this.timeDateDOS>>>0,A.TIMEDATE_DOS),p.writeUInt32LE(this.aesVersion===2?0:this.crc,A.CRC),p.writeUInt32LE(this.compressedSize,A.CMP_SIZE),p.writeUInt32LE(this.uncompressedSize,A.UNCMP_SIZE),p.writeUInt16LE(this.filename.length,A.FNAME_LEN),p.writeUInt16LE(E,A.EXTRA_LEN),p.writeUInt16LE(t,A.COMMENT_LEN),p.writeUInt16LE(0,A.DISK_NUM),p.writeUInt16LE(this.intFileAttr>>>0,A.INT_FILE_ATTR),p.writeUInt32LE(this.extFileAttr>>>0,A.EXT_FILE_ATTR),p.writeUInt32LE(this.localHdrOffset,A.LOCAL_HDR_OFFSET),Buffer.from(g).copy(p,A.SIZE);let _=A.SIZE+b;t>0&&this.comment&&(Buffer.from(this.comment,"utf8").copy(p,_),_+=t);let y=_;if(this.universalTime&&(p.writeUInt16LE(R.UNV_TIME,y),p.writeUInt16LE(5,y+2),p.writeUInt8(1,y+4),p.writeUInt32LE(Math.floor(Date.now()/1e3),y+5),y+=9),i&&(p.writeUInt16LE(R.SHA256,y),p.writeUInt16LE(i.length,y+2),i.copy(p,y+4),y+=4+i.length),this.uid&&this.gid&&(p.writeUInt16LE(R.UID_GID,y),p.writeUInt16LE(11,y+2),p.writeUInt8(1,y+4),p.writeUInt8(4,y+5),p.writeUInt32LE(this.uid,y+6),p.writeUInt8(4,y+10),p.writeUInt32LE(this.gid,y+11),y+=15),this.isSymlink&&this.linkTarget){let L=Buffer.from(this.linkTarget,"utf8"),w=3+L.length;p.writeUInt16LE(R.SYMLINK,y),p.writeUInt16LE(w,y+2),p.writeUInt8(1,y+4),p.writeUInt16LE(L.length,y+5),L.copy(p,y+7),y+=4+w}if(this.isHardLink&&this.originalEntry&&this.inode!==null){let L=Buffer.from(this.originalEntry,"utf8"),w=7+L.length;p.writeUInt16LE(R.HARDLINK,y),p.writeUInt16LE(w,y+2),p.writeUInt8(1,y+4),p.writeUInt32LE(this.inode,y+5),p.writeUInt16LE(L.length,y+9),L.copy(p,y+11),y+=4+w}if(c&&(y=this.addUnicodePathField(p,y)),l&&(p.writeUInt16LE(R.AES,y),p.writeUInt16LE(7,y+2),p.writeUInt16LE(this.aesVersion,y+4),p.writeUInt16LE(17729,y+6),p.writeUInt8(this.aesStrength,y+8),p.writeUInt16LE(this.realCmpMethod,y+9),y+=Le),h){p.writeUInt16LE(R.NEO_CRYPTO,y),p.writeUInt16LE(te,y+2);let L=y+4;for(let w=0;w<4;w++)p.writeUInt8(H[w],L+w);p.writeUInt8(this.neoCryptoPayloadVersion,L+4),p.writeUInt16LE(this.neoCryptoAlgorithm,L+5),p.writeUInt16LE(this.neoCryptoFlags,L+7),p.writeUInt16LE(0,L+9),y+=Ce}return p}setDateTime(t){if(!t)return 0;let e=t.getFullYear()-1980,n=t.getMonth()+1,i=t.getDate(),o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),c=(e&127)<<9|(n&15)<<5|i&31,f=(o&31)<<11|(a&63)<<5|s>>1&31;return c<<16|f}parseDateTime(t){if(t==0)return null;let e=t>>16&65535,n=(e>>9&127)+1980,i=(e>>5&15)-1,o=e&31,a=t&65535,s=a>>11&31,c=a>>5&63,f=(a&31)<<1;return new Date(n,i,o,s,c,f)}toLocalDateString(){let t=this.parseDateTime(this.timeDateDOS);return t===null?"--/--/----":t.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}).slice(0,10)}toTimeString(){let t=this.parseDateTime(this.timeDateDOS);return t===null?"--:--":t.toTimeString().slice(0,5)}toFormattedDateString(){let t=this.parseDateTime(this.timeDateDOS);if(t==null)return"--/--/-- --:--";let e=t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${e} ${n}`}toFormattedUTCDateString(){let t=this.parseDateTime(this.timeDateDOS);if(t==null)return"--/--/-- --:--";let e=t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"UTC"});return`${e} ${n} UTC`}cmpMethodToString(){switch(this.cmpMethod){case I.STORED:return"Stored";case I.SHRUNK:return"Shrunk";case I.REDUCED1:return"Reduced-1";case I.REDUCED2:return"Reduced-2";case I.REDUCED3:return"Reduced-3";case I.REDUCED4:return"Reduced-4";case I.IMPLODED:return"Imploded";case I.DEFLATED:switch(this.bitFlags&6){case 0:return"Deflate-N";case 2:return"Deflate-M";case 4:return"Deflate-F";case 6:return"Deflate-S"}case I.ENHANCED_DEFLATE:return"Deflate-Enh";case I.IBM_TERSE:return"PKDCL-LZ77";case I.ZSTD:return"Zstandard";case I.AES_ENCRYPT:return this.aesStrength===3?"AES-256":this.aesStrength===2?"AES-192":this.aesStrength===1?"AES-128":"AES";default:return"Unknown"}}fileSystemToString(){switch(this.verMadeBy>>8){case F.MSDOS:return"MS-DOS";case F.AMIGA:return"Amiga";case F.OPENVMS:return"OpenVMS";case F.UNIX:return"Unix";case F.VM_CMS:return"VM/CMS";case F.ATARI:return"Atari ST";case F.OS2:return"OS/2 HPFS";case F.MAC:return"Macintosh";case F.CP_M:return"CP/M";case F.NTFS:return"Windows NTFS";case F.MVS:return"MVS (OS/390 - Z/OS)";case F.VSE:return"VSE";case F.ACORN:return"Acorn Risc";case F.ALTMVS:return"Alternate MVS";case F.BEOS:return"BeOS";case F.TANDEM:return"Tandem";case F.OS400:return"OS/400";case F.DARWIN:return"Apple OS/X (Darwin)";default:return"Unknown"}}compressionMethodCodeToString(t){if(t<0)return"Not set";switch(t){case I.STORED:return"Stored (0)";case I.DEFLATED:return"Deflated (8)";case I.ZSTD:return"Zstandard (93)";case I.BZIP2:return"BZIP2 (12)";case I.LZMA:return"LZMA (14)";case I.AES_ENCRYPT:return"AES wrapper (99)";default:return`code ${t}`}}logEncryptionDetails(){let t=(this.bitFlags&P.ENCRYPTED)!==0,e=(this.bitFlags&P.STRONG_ENCRYPT)!==0;x.log("Encryption (detailed): "),x.log(" GP flags: ",`bit0 encrypted=${t}, bit6 strong_encrypt=${e}`);let n=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0,i=!n&&this.neoCryptoAlgorithm>0;if(n){x.log(" Scheme: ",'WinZip AES (ZIP compression method 99 + extra 0x9901, vendor "AE")'),x.log(" AE variant: ",this.aesVersion===2?"AE-2 \u2014 CRC-32 in local/CEN headers is 0; plaintext integrity from HMAC-SHA1":"AE-1 \u2014 CRC-32 in headers is plaintext (uncompressed) CRC-32");let o=this.aesStrength===3?"AES-256 (extra field strength byte 3)":this.aesStrength===2?"AES-192 (2)":this.aesStrength===1?"AES-128 (1)":`Unknown (${this.aesStrength})`;x.log(" Key size: ",o),x.log(" Real compression (inside ciphertext): ",this.compressionMethodCodeToString(this.realCmpMethod)),x.log(' "Compressed size" in headers: ',"Length of full AES file data: salt + password verifier + ciphertext + 10-byte HMAC"),x.log(" Payload layout: ",`${le} byte salt + ${De} byte verifier + encrypted(compressed) data + ${ce} byte HMAC (PBKDF2-HMAC-SHA1, WinZip AES-CTR)`),x.log(" Version needed to extract (from entry): ",`${this.verExtract}${this.verExtract===Wr?" (5.1 \u2014 typical for AES)":""}`),e?x.log(" Note: ","Strong-encrypt bit set \u2014 unusual for pure WinZip AES; confirm with extra fields."):x.log(" Typical WinZip AES: ","bit 6 (strong) usually clear; bit 0 (encrypted) set.")}else i?(x.log(" Scheme: ","NeoEncrypt (GP encrypted + NEO extra 0x024E; standard ZIP compression method in header)"),x.log(" NEO payload version / algorithm / flags: ",`${this.neoCryptoPayloadVersion} / ${this.neoCryptoAlgorithm} / ${this.neoCryptoFlags}`),x.log(" Compression after decrypt: ",this.compressionMethodCodeToString(this.cmpMethod)),x.log(" Ciphertext layout: ",`Same as WinZip AES-256 stream: ${le} byte salt + ${De} byte verifier + encrypted(compressed) + ${ce} byte HMAC`),x.log(" CRC in headers: ","Plaintext CRC (AE-1 style) for algorithm 1")):t?(e?x.log(" Scheme: ","PKWARE strong encryption (GP bit 6) \u2014 not WinZip method 99; expect extras e.g. 0x0017"):x.log(" Scheme: ","Encrypted (bit 0) \u2014 typically legacy ZipCrypto if method \u2260 99"),x.log(" Compression method in header: ",`${this.cmpMethodToString()} (${this.cmpMethod})`)):x.log(" Scheme: ","Not encrypted")}dosAttributesToString(){let t=this.extFileAttr&65535;if(t===0)return"none";let e="";return e+=t&Re.READONLY?"r":"-",e+=t&Re.HIDDEN?"h":"-",e+=t&Re.SYSTEM?"s":"-",e+=t&Re.DIRECTORY?"d":"-",e+=t&Re.ARCHIVE?"a":"-",e}showVerboseInfo(){if(x.log("=== Central Directory Entry (%s) ===",this.filename),x.log("unzip from start of archive: ",this.localHdrOffset),x.log("File system or operating system of origin: ",this.fileSystemToString()),x.log("Version of encoding software: ",this.verMadeBy),x.log("Compression Method: ",this.cmpMethodToString()),x.log("File Security Status: ",this.bitFlags&P.ENCRYPTED?this.bitFlags&P.STRONG_ENCRYPT?"Strong Encrypt":"Encrypted":"Not Encrypted"),this.logEncryptionDetails(),x.log("File Modified (DOS date/time) ",this.toFormattedDateString()),x.log("File Modified (UTC) ",this.toFormattedUTCDateString()),x.log("Compressed Size: ",this.compressedSize),x.log("UnCompressed Size: ",this.uncompressedSize),x.log(`32-bit CRC value (hex): ${this.crc.toString(16).padStart(8,"0")}`),x.log("Length of extra field: ",this.extraField?.length??0),x.log("Length of file comment: ",this.comment?.length??0),x.log("Unix File Attributes: "),x.log("MS-DOS File Attributes: ",this.dosAttributesToString()),this.extraField){x.log(`
7
+ The Central-Directory Extra Field contains:`);try{for(let t=0;t<this.extraField.length;){if(t+4>this.extraField.length){x.log(` Warning: Truncated extra field at offset ${t}`);break}let e=this.extraField.readUInt16LE(t),n=e.toString(16).padStart(4,"0"),i=this.extraField.readUInt16LE(t+2);if(i<0||t+4+i>this.extraField.length){x.log(` Warning: Invalid extra field length (${i}) at offset ${t} for ID ${n}`);break}let o=this.extraField.subarray(t+4,t+4+i);try{if(e===R.SHA256)x.log(` ID[0x${n}] NeoZip-SHA256: ${o.toString("hex")}`);else if(e===R.UNV_TIME)if(i>=5){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=new Date(s*1e3);x.log(` ID[0x${n}] Universal Time: flags=${a}, time=${c.toISOString()}`)}else x.log(` ID[0x${n}] Universal Time: (invalid length ${i})`);else if(e===R.UID_GID)if(i>=5){let a=o.readUInt8(0),s=o.readUInt8(1);if(2+s>i)x.log(` ID[0x${n}] Unix UID/GID: (invalid UID size ${s})`);else{let c=o.readUIntLE(2,Math.min(s,4)),f=0;if(2+s+1<i){let l=o.readUInt8(2+s);2+s+1+l<=i&&(f=o.readUIntLE(2+s+1,Math.min(l,4)))}x.log(` ID[0x${n}] Unix UID/GID: version=${a}, uid=${c}, gid=${f}`)}}else x.log(` ID[0x${n}] Unix UID/GID: (invalid length ${i})`);else if(e===R.SYMLINK)if(i>=3){let a=o.readUInt8(0),s=o.readUInt16LE(1);if(s>0&&i>=3+s){let c=o.subarray(3,3+s).toString("utf8");x.log(` ID[0x${n}] Symbolic Link: version=${a}, target="${c}"`)}else x.log(` ID[0x${n}] Symbolic Link: (invalid target length ${s})`)}else x.log(` ID[0x${n}] Symbolic Link: (invalid length ${i})`);else if(e===R.HARDLINK)if(i>=11){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=o.readUInt16LE(5);if(c>0&&i>=7+c){let f=o.subarray(7,7+c).toString("utf8");x.log(` ID[0x${n}] Hard Link: version=${a}, inode=${s}, original="${f}"`)}else x.log(` ID[0x${n}] Hard Link: (invalid original length ${c})`)}else x.log(` ID[0x${n}] Hard Link: (invalid length ${i})`);else if(e===R.UNICODE_PATH)if(i>=5){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=o.subarray(5).toString("utf8"),f=Buffer.from(this.filename),l=ne(f),d=s===l?"MATCH":"MISMATCH";x.log(` ID[0x${n}] Unicode Path: version=${a}, CRC32=${s.toString(16)} (${d})`),x.log(` Path: "${c}"`)}else x.log(` ID[0x${n}] Unicode Path: (invalid length ${i})`);else if(e===R.AES)if(i>=7){let a=o.readUInt16LE(0),s=String.fromCharCode(o[2],o[3]),c=o.readUInt8(4),f=o.readUInt16LE(5),l=c===3?"256-bit":c===2?"192-bit":c===1?"128-bit":"Unknown",d=a===2?"AE-2 (CRC=0 in headers)":a===1?"AE-1 (plaintext CRC in headers)":`vendorVer=${a}`;x.log(` ID[0x${n}] WinZip AES: ${d}, vendor="${s}", strength=${l}, realCompressionMethod=${f}`)}else x.log(` ID[0x${n}] WinZip AES: (invalid length ${i})`);else if(e===R.NEO_CRYPTO)if(i>=te)if(o[0]===H[0]&&o[1]===H[1]&&o[2]===H[2]&&o[3]===H[3]){let a=o.readUInt8(4),s=o.readUInt16LE(5),c=o.readUInt16LE(7);x.log(` ID[0x${n}] NeoEncrypt: payloadVer=${a}, algorithm=${s}, flags=${c}`)}else x.log(` ID[0x${n}] NeoEncrypt: (invalid magic)`);else x.log(` ID[0x${n}] NeoEncrypt: (invalid length ${i})`);else if(e===R.ZIP64)if(x.log(` ID[0x${n}] ZIP64 Extended Information:`),i>=8){let a=0;if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Uncompressed Size (ZIP64): ${s.toString()} bytes`),a+=8}if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Compressed Size (ZIP64): ${s.toString()} bytes`),a+=8}if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Local Header Offset (ZIP64): ${s.toString()}`),a+=8}if(a+4<=i){let s=o.readUInt32LE(a);x.log(` Disk Number (ZIP64): ${s}`)}}else x.log(` ZIP64 Extended Information: (invalid length ${i})`);else{let a=i>0?o.slice(0,Math.min(16,i)).toString("hex"):"";x.log(` ID[0x${n}] Unknown field: length=${i} bytes${a?", data="+a+"...":""}`)}}catch(a){x.log(` Error parsing extra field ID[0x${n}]: ${a.message}`)}t+=4+i}}catch(t){x.log(` Error parsing extra fields: ${t.message}`)}}x.log(`
8
+ `)}};var fr={version:"0.7.0",releaseDate:"2026-04-06"};var ps="ZSTD requires Node.js with native zlib support (Node.js >= 22.15 or >= 23.8). Browser builds do not include a zstd codec; use Deflate or process zstd archives in Node.";function Se(){throw new Error(ps)}function ms(){return!1}function Es(r){return Se()}function xs(r){return Se()}function gs(){return Se()}async function _s(r,t){return Se()}async function ys(r){return Se()}function bs(r,t){return Se()}function ws(r){return Se()}async function Ss(r,t,e,n,i,o){return Se()}async function*As(r){Se()}var St={isNativeZstdAvailable:ms,mapCompressionLevel:Es,createCompressTransform:xs,createDecompressTransform:gs,compress:_s,decompress:ys,compressSync:bs,decompressSync:ws,compressChunks:Ss,decompressStream:As};var J=class r{constructor(t){this.crc32State=-1;this.sha256Hash=null;this.merkleLeafHash=null;this.useSHA256=!1;this.hashes=[];this.xorResult=Buffer.alloc(32,0);this.enableAccumulation=!1;this.merkleLeaves=[];this.merkleLayers=[];this.merkleOptions={hashLeaves:!1,sortLeaves:!1,sortPairs:!1,duplicateOdd:!0};this.useSHA256=t?.useSHA256||!1,this.enableAccumulation=t?.enableAccumulation||!1,this.useSHA256&&(this.sha256Hash=he("sha256"),this.merkleLeafHash=he("sha256"),this.merkleLeafHash.update(Buffer.from([0])))}update(t){for(let e=0;e<t.length;e++)this.crc32State=sr(this.crc32State,t[e]);this.sha256Hash&&this.sha256Hash.update(t),this.merkleLeafHash&&this.merkleLeafHash.update(t)}finalizeCRC32(){return~this.crc32State>>>0}finalizeSHA256(){return this.sha256Hash?this.sha256Hash.digest("hex"):null}finalizeMerkleLeafV1(){return this.merkleLeafHash?this.merkleLeafHash.digest("hex"):null}applyToEntry(t,e){if(e.setCrc&&(t.crc=this.finalizeCRC32()),e.setSha256){let n=this.finalizeSHA256(),i=this.finalizeMerkleLeafV1();n&&(t.sha256=n),i&&(t.merkleLeafV1=i)}}reset(){this.crc32State=-1,this.useSHA256&&(this.sha256Hash=he("sha256"),this.merkleLeafHash=he("sha256"),this.merkleLeafHash.update(Buffer.from([0])))}addHash(t){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");let e=typeof t=="string"?Buffer.from(t,"hex"):t;this.hashes.push(e),this.merkleLeaves.push(e);for(let n=0;n<32;n++)this.xorResult[n]^=e[n];this.rebuildMerkleTree()}xorHash(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");return this.xorResult.toString("hex")}merkleRoot(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");if(this.merkleLeaves.length===0)return null;this.merkleLayers.length===0&&this.rebuildMerkleTree();let t=this.merkleLayers[this.merkleLayers.length-1];return t&&t.length>0?t[0].toString("hex"):null}leafCount(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");return this.hashes.length}clear(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");this.hashes=[],this.merkleLeaves=[],this.merkleLayers=[],this.xorResult=Buffer.alloc(32,0)}static combineResults(t){let e=new r({enableAccumulation:!0});for(let n of t)n.merkleRoot&&e.addHash(n.merkleRoot);return e.merkleRoot()}hash(t){return he("sha256").update(t).digest()}combinedHash(t,e){return this.merkleOptions.sortPairs&&Buffer.compare(t,e)>0&&([t,e]=[e,t]),this.hash(Buffer.concat([t,e]))}createHashes(t){for(;t.length>1;){let e=this.merkleLayers.length;this.merkleLayers.push([]);for(let n=0;n<t.length-1;n+=2){let i=t[n],o=t[n+1],a=this.combinedHash(i,o);this.merkleLayers[e].push(a)}if(t.length%2===1){let n=t[t.length-1];if(this.merkleOptions.duplicateOdd){let i=this.combinedHash(n,n);this.merkleLayers[e].push(i)}else this.merkleLayers[e].push(n)}t=this.merkleLayers[e]}}rebuildMerkleTree(){if(this.merkleLeaves.length===0){this.merkleLayers=[];return}let t=this.merkleLeaves.map(e=>this.merkleOptions.hashLeaves?this.hash(e):Buffer.isBuffer(e)?e:Buffer.from(e));this.merkleOptions.sortLeaves&&t.sort(Buffer.compare),this.merkleLayers=[t],this.createHashes(t)}getProof(t){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");this.merkleLayers.length===0&&this.rebuildMerkleTree();let e=this.merkleLeaves.findIndex(n=>n.equals(t));if(e===-1)throw new Error("Leaf not found in tree");return this.merkleLayers.reduce((n,i)=>{if(i.length===1)return n;let o=e%2===0?e+1:e-1;return o<i.length&&n.push(i[o]),e=Math.floor(e/2),n},[])}verify(t,e,n){let i=e;for(let o of t)i=Buffer.compare(i,o)<=0?this.combinedHash(i,o):this.combinedHash(o,i);return i.equals(n)}},Ai=J;var Is=2*Ve+De,Bs=1e3,qr=16,lr=class r{constructor(t){this.aesKey=t,this.counter=Buffer.alloc(qr),this.counter[0]=1,this.keystream=this.encryptCounter(),this.ksPos=0}process(t){if(t.length===0)return Buffer.alloc(0);let e=Buffer.alloc(t.length);for(let n=0;n<t.length;n++)this.ksPos>=qr&&(r.incrementCounterLE(this.counter),this.keystream=this.encryptCounter(),this.ksPos=0),e[n]=t[n]^this.keystream[this.ksPos++];return e}encryptCounter(){let t=yi("aes-256-ecb",this.aesKey,null);return t.setAutoPadding(!1),t.update(this.counter)}static incrementCounterLE(t){for(let e=0;e<qr;e++)if(t[e]===255)t[e]=0;else{t[e]++;break}}},jr=class{constructor(t){this.headerSent=!1;this.finished=!1;this.salt=ar(le),this.keys=oe.deriveKeys(t,this.salt),this.ctr=new lr(this.keys.aesKey),this.hmac=Kr("sha1",this.keys.hmacKey)}header(){if(this.finished)throw new Error("AesEncryptor already finished");return this.headerSent=!0,Buffer.concat([this.salt,this.keys.passwordVerifier])}update(t){if(this.finished)throw new Error("AesEncryptor already finished");if(!this.headerSent)throw new Error("AesEncryptor.header() must be called before update()");if(t.length===0)return Buffer.alloc(0);let e=this.ctr.process(t);return this.hmac.update(e),e}finish(){if(this.finished)throw new Error("AesEncryptor already finished");if(!this.headerSent)throw new Error("AesEncryptor.header() must be called before finish()");return this.finished=!0,this.hmac.digest().subarray(0,ce)}},Jr=class{constructor(t,e){this.keys=null;this.ctr=null;this.hmac=null;this.headerBuf=Buffer.alloc(0);this.authBuf=Buffer.alloc(0);this.headerDone=!1;this.verified=!1;if(e<nr)throw new Error("AES decryption failed: payload too short");this.password=t,this.cipherLen=e-nr,this.remainingCipher=this.cipherLen}push(t){let e=t;if(!this.headerDone){this.headerBuf=Buffer.concat([this.headerBuf,e]);let s=le+De;if(this.headerBuf.length<s)return Buffer.alloc(0);let c=this.headerBuf.subarray(0,le),f=this.headerBuf.subarray(le,s);if(this.keys=oe.deriveKeys(this.password,c),!this.keys.passwordVerifier.equals(f))throw new Error("AES decryption failed: wrong password");this.ctr=new lr(this.keys.aesKey),this.hmac=Kr("sha1",this.keys.hmacKey),this.headerDone=!0,e=this.headerBuf.subarray(s),this.headerBuf=Buffer.alloc(0)}if(e.length===0)return Buffer.alloc(0);let n=Math.min(e.length,this.remainingCipher),i=e.subarray(0,n),o=e.subarray(n);if(o.length>0&&(this.authBuf=Buffer.concat([this.authBuf,o])),i.length===0)return this.tryVerify(),Buffer.alloc(0);this.hmac.update(i);let a=this.ctr.process(i);return this.remainingCipher-=i.length,this.tryVerify(),a}end(){if(this.remainingCipher>0)throw new Error("AES decryption failed: truncated ciphertext");if(this.tryVerify(),!this.verified)throw new Error("AES decryption failed: missing authentication code")}tryVerify(){if(this.verified||this.remainingCipher>0||!this.hmac||this.authBuf.length<ce)return;let t=this.authBuf.subarray(0,ce);if(!this.hmac.digest().subarray(0,ce).equals(t))throw new Error("AES decryption failed: authentication code mismatch (data corrupted or tampered)");this.verified=!0}},oe=class r{static deriveKeys(t,e){let n=Buffer.isBuffer(t)?t:Buffer.from(t),i=_i(n,e,Bs,Is,"sha1");return{aesKey:i.subarray(0,Ve),hmacKey:i.subarray(Ve,2*Ve),passwordVerifier:i.subarray(2*Ve)}}static createEncryptor(t){return new jr(t)}static createDecryptor(t,e){return new Jr(t,e)}static encryptBuffer(t,e,n){let i=r.createEncryptor(n),o=[i.header()];return e.length>0&&o.push(i.update(e)),o.push(i.finish()),Buffer.concat(o)}static decryptBuffer(t,e,n){let i=r.createDecryptor(n,e.length),o=i.push(e);return i.end(),o}static async*decryptStream(t,e,n){let i=r.createDecryptor(t,e);for await(let o of n){let a=i.push(o);a.length>0&&(yield a)}i.end()}static buildAesExtraField(t,e=1){let n=Buffer.alloc(Le);return n.writeUInt16LE(R.AES,0),n.writeUInt16LE(7,2),n.writeUInt16LE(e,4),n.writeUInt16LE(17729,6),n.writeUInt8(3,8),n.writeUInt16LE(t,9),n}static parseAesExtraField(t){return{vendorVersion:t.readUInt16LE(0),vendorId:String.fromCharCode(t[2],t[3]),encryptionStrength:t.readUInt8(4),realCmpMethod:t.readUInt16LE(5)}}};var cr=1,ur=class r{static buildPayloadV1(t=cr,e=0,n=0){let i=Buffer.alloc(te);for(let o=0;o<4;o++)i[o]=H[o];return i.writeUInt8(1,4),i.writeUInt16LE(t,5),i.writeUInt16LE(e,7),i.writeUInt16LE(n,9),i}static buildExtraFieldRecordV1(t=cr,e=0,n=0){let i=Buffer.alloc(Ce);return i.writeUInt16LE(R.NEO_CRYPTO,0),i.writeUInt16LE(te,2),r.buildPayloadV1(t,e,n).copy(i,4),i}static tryParsePayload(t){return t.length<te||t[0]!==H[0]||t[1]!==H[1]||t[2]!==H[2]||t[3]!==H[3]?null:{payloadVersion:t.readUInt8(4),algorithm:t.readUInt16LE(5),flags:t.readUInt16LE(7),reserved:t.readUInt16LE(9)}}static parsePayload(t){let e=r.tryParsePayload(t);if(!e||e.payloadVersion!==1)throw new Error("NeoEncrypt: invalid NEO crypto extra field");return e}static encryptBuffer(t,e,n){return oe.encryptBuffer(t,e,n)}static decryptBuffer(t,e,n){return oe.decryptBuffer(t,e,n)}};var aa=Hn(),Pt=class Pt{log(...t){Pt.loggingEnabled&&x.debug("[ZipCompress]",...t)}constructor(t){this.zipkit=t,this.debug=!1,Pt.loggingEnabled&&x.setLevel("debug"),this.log("ZipCompress initialized")}async compressData(t,e,n,i){this.log(`compressData() called for entry: ${t.filename}`),(!t.uncompressedSize||t.uncompressedSize===0)&&(t.uncompressedSize=e.length);let o=e.length,a=n?.bufferSize||this.zipkit.getBufferSize();this.log(`Compressing ${o} bytes for entry: ${t.filename}`),this.log("Compression options:",{level:n?.level,useZstd:n?.useZstd,bufferSize:a});let s;n?.level===0?(s=I.STORED,this.log("Using STORED method (no compression)")):n?.useZstd?o<100?(s=I.STORED,this.log(`ZSTD fallback to STORED (file too small: ${o} bytes)`)):(s=I.ZSTD,this.log("Using ZSTD method (zstd compression)")):(s=I.DEFLATED,this.log("Using DEFLATED method (default compression)")),t.cmpMethod=s;let f=!t.crc||t.crc===0||n?.useSHA256&&!t.sha256?new J({useSHA256:n?.useSHA256&&!t.sha256||!1}):null;f&&(f.update(e),f.applyToEntry(t,{setCrc:!t.crc||t.crc===0,setSha256:!!(n?.useSHA256&&!t.sha256)}),this.log(`Final hashes: CRC32=0x${t.crc.toString(16).padStart(8,"0")}, SHA256=${t.sha256||"N/A"}`));let l=n?.encryptionMethod,d=l==="zipcrypto",h=l==="aes256",u=!!n?.password&&!d&&!h;if(n?.password){let b=d?"ZipCrypto":u?"NeoEncrypt (AES-256)":"WinZip AES-256";this.log(`Encrypting compressed data for entry: ${t.filename} (method: ${b})`),t.bitFlags=(t.bitFlags||0)|P.ENCRYPTED,t.isEncrypted=!0}let E,g=s===I.ZSTD?"ZSTD":s===I.DEFLATED?"DEFLATED":"STORED";return s===I.STORED?E=e:(this.log(`Processing sequence for ${g}: [HASH] -> [COMPRESS] -> [OUTPUT]`),this.log(`Compressing: method=${g}, input=${o} bytes, buffer size=${a} bytes`),this.log(`Calculating hashes: CRC32=${!t.crc||t.crc===0}, SHA256=${n?.useSHA256}`),s===I.ZSTD?E=await this.zstdCompress(e,n,a,t,i):E=await this.deflateCompress(e,n,a,t,i)),n?.password&&(u?E=this.encryptCompressedDataNeo(t,E,n.password):h?E=this.encryptCompressedDataAes(t,E,n.password):E=this.encryptCompressedData(t,E,n.password)),t.compressedSize=E.length,E}async deflateCompress(t,e,n,i,o){this.log(`deflateCompress() called - entry: ${i?.filename??"unknown"}, bufferSize: ${n}, level: ${e?.level??6}`);let a=n||this.zipkit.getBufferSize(),s=e?.level??6;if(typeof t=="object"&&"totalSize"in t&&"onReadChunk"in t)throw new Error("Chunked reader mode not supported in ZipCompress");if(t.length<=a)return this.deflate(t,e);let c=new aa.Deflate({level:s,raw:!0}),f=[],l=0,d=0;try{for(let u=0;u<t.length;u+=a){let E=t.slice(u,u+a),g=u+a>=t.length;if(c.push(E,g),c.result&&c.result.length>0){let b=Buffer.from(c.result);f.push(b),d+=b.length,o&&await o(b)}l+=E.length}let h=l>0?Math.round(d/l*100):0;return this.log(`Final hashes: CRC32=0x${i?.crc?.toString(16).padStart(8,"0")}, SHA256=${i?.sha256||"N/A"}`),this.log(`Deflate compression complete: ${d} bytes from ${l} bytes (ratio=${h}%)`),Buffer.concat(f)}catch(h){throw new Error(`Deflate compression failed: ${h instanceof Error?h.message:String(h)}`)}}deflate(t,e){this.log(`deflate() called with buffer size: ${t.length}, level: ${e?.level??6}`);let n=e?.level??6,i=aa.deflateRaw(t,{level:n}),o=t.length>0?Math.round(i.length/t.length*100):0;return this.log(`Deflate compression complete: ${i.length} bytes from ${t.length} bytes (ratio=${o}%)`),Buffer.from(i.buffer,i.byteOffset,i.byteLength)}async zstdCompress(t,e,n,i,o){this.log(`zstdCompress() called - entry: ${i?.filename??"unknown"}, bufferSize: ${n}, level: ${e?.level??6}`);let a=n||this.zipkit.getBufferSize(),s=e?.level??6,c=Buffer.isBuffer(t),f=c?t.length:t.totalSize;if(!f)throw new Error("ZSTD compression: empty input buffer");if(e?.level===0){if(c)return o&&await o(t),t;let u=[],E=0;for(;E<f;){let g=Math.min(a,f-E),b=t.readChunk(E,g);o?await o(b):u.push(b),E+=b.length}return o?Buffer.alloc(0):Buffer.concat(u)}let l=c?(u,E)=>t.subarray(u,u+E):t.readChunk.bind(t),d=[],h=await St.compressChunks(l,f,a,s,void 0,async u=>{o?await o(u):d.push(u)});return i&&(i.compressedSize=h),o?Buffer.alloc(0):Buffer.concat(d)}encryptCompressedData(t,e,n){this.log(`encryptCompressedData() called for entry: ${t.filename}, compressed size: ${e.length}`);let o=new j().encryptBuffer(t,e,n);return this.log(`Encryption complete: ${e.length} bytes compressed -> ${o.length} bytes encrypted (includes ${Te}-byte header)`),o}encryptCompressedDataNeo(t,e,n){this.log(`encryptCompressedDataNeo() called for entry: ${t.filename}, compressed size: ${e.length}`);let i=ur.encryptBuffer(t,e,n);return t.neoCryptoPayloadVersion=1,t.neoCryptoAlgorithm=cr,t.neoCryptoFlags=0,this.log(`NeoEncrypt encryption complete: ${e.length} bytes -> ${i.length} bytes`),i}encryptCompressedDataAes(t,e,n){this.log(`encryptCompressedDataAes() called for entry: ${t.filename}, compressed size: ${e.length}`);let i=oe.encryptBuffer(t,e,n);return t.realCmpMethod=t.cmpMethod,t.cmpMethod=I.AES_ENCRYPT,t.aesVersion=1,t.aesStrength=3,this.log(`AES-256 encryption complete: ${e.length} bytes -> ${i.length} bytes (salt+verifier+data+hmac)`),i}async compressFileBuffer(t,e,n){this.log(`compressFileBuffer() called for entry: ${t.filename}, size: ${e.length}`),t.uncompressedSize=e.length;let i=new J({useSHA256:n?.useSHA256||!1});return i.update(e),i.applyToEntry(t,{setCrc:!0,setSha256:!!n?.useSHA256}),t.sha256&&this.log(`SHA-256 calculated: ${t.sha256}`),await this.compressData(t,e,n)}};Pt.loggingEnabled=!1;var Et=Pt;var sa=18,Jc=Buffer.from([40,181,47,253]);function fa(r){let t=new J;return t.update(r),t.finalizeCRC32()}function la(r,t,e){let n=t>>>0;if(r.length===n+sa&&r.subarray(n).equals(Buffer.alloc(sa))){let i=r.subarray(0,n);return e!==void 0&&e!==0&&fa(i)!==e>>>0?{repaired:r,wasLegacy:!1}:{repaired:i,wasLegacy:!0}}if(r.length>n&&n>0){let i=r.subarray(0,n);if(e!==void 0&&e!==0&&fa(i)===e>>>0)return{repaired:i,wasLegacy:!0}}return{repaired:r,wasLegacy:!1}}var Ll=Hn(),Zt=class Zt{log(...t){Zt.loggingEnabled&&x.debug("[ZipDecompress]",...t)}constructor(t){this.zipkit=t,this.debug=!1,Zt.loggingEnabled&&x.setLevel("debug")}async extract(t,e){if(!this.zipkit.hasInBuffer())throw new Error("extract() requires Buffer-based ZIP. Use ZipkitNode.extractToFile() for file-based ZIP or call loadZip() first.");this.log(`extract() called for entry: ${t.filename}, method: ${t.cmpMethod}, skipHashCheck: ${e}`);let n=this.zipkit.ensureBuffer(),i=this.zipkit.parseLocalHeader(t,n),o=this.zipkit?.password,a=t.aesVersion>0||t.cmpMethod===I.AES_ENCRYPT,s=t.neoCryptoAlgorithm>0;if(t.isEncrypted&&o&&(this.log(`Starting in-memory decryption for entry: ${t.filename} (${a||s?"AES-256 stream (WinZip or Neo)":"ZipCrypto"})`),a||s?i=oe.decryptBuffer(t,i,o):i=new j().decryptBuffer(t,n,i,o),this.log(`Decryption successful, decrypted compressed data length: ${i.length}`)),i.length===0)return null;let c=a&&t.aesVersion===2?!0:e;return this.unCompress(i,t,c)}inflate(t){this.log(`inflate() called with ${t.length} bytes`);let e=Ll.inflateRaw(t);return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}async zstdDecompressSync(t,e){this.log(`zstdDecompressSync() called with ${t.length} bytes`);try{let n=await St.decompress(t);if(e&&e.uncompressedSize>0){let{repaired:i,wasLegacy:o}=la(n,e.uncompressedSize,e.crc);o&&this.log(`Legacy WASM zstd padding repaired: ${n.length} -> ${i.length} bytes`),n=i}return this.log(`ZSTD decompression successful: ${t.length} bytes -> ${n.length} bytes`),n}catch(n){throw this.log(`ZSTD decompression failed: ${n}`),new Error(`ZSTD decompression failed: ${n instanceof Error?n.message:String(n)}`)}}async unCompress(t,e,n){let i=e.cmpMethod===I.AES_ENCRYPT&&e.realCmpMethod>=0?e.realCmpMethod:e.cmpMethod;if(this.log(`unCompress() called for entry: ${e.filename}, method: ${i}, data length: ${t.length}`),t.length===0)return Buffer.alloc(0);let o;if(i===I.STORED)o=t;else if(i===I.DEFLATED)o=this.inflate(t);else if(i===I.ZSTD)o=await this.zstdDecompressSync(t,e);else throw new Error(`Unsupported compression method: ${i}`);let a=new J({useSHA256:!0});a.update(o);let s=a.finalizeCRC32(),c=a.finalizeSHA256(),f=a.finalizeMerkleLeafV1();if(f&&(e.merkleLeafV1=f),!n){if(e.sha256){if(c!==e.sha256)throw new Error(O.INVALID_SHA256)}else if(s!==e.crc)throw new Error(O.INVALID_CRC)}return o}};Zt.loggingEnabled=!1;var $n=Zt,ca=$n;var Cl=Buffer.from([0]),Rl=Buffer.from([1]);function zt(r){let t=he("sha256");if(Array.isArray(r))for(let e of r)t.update(e);else t.update(r);return t.digest()}function Ht(r,t){return typeof r=="string"?Buffer.from(r,t??"hex"):Buffer.isBuffer(r)?r:Buffer.from(r)}function ua(r){let t=r.replace(/\\/g,"/");for(t.startsWith("./")&&(t=t.slice(2));t.startsWith("/");)t=t.slice(1);return typeof t.normalize=="function"&&(t=t.normalize("NFC")),t}function kl(r,t){let e=t==="v1"?ua(r):r;return Buffer.from(e,"utf8")}function ha(r){return zt(Ht(r))}function Ul(r,t=!1){let e=Ht(r);return t?e:zt(e)}function $t(r){return zt([Cl,Ht(r)])}function Vn(r,t,e){return zt(e==="v1"?[Rl,r,t]:[r,t])}function da(r,t){if(r.length===0)return null;let e=r.map(n=>Buffer.from(n));for(;e.length>1;){let n=[];for(let i=0;i+1<e.length;i+=2)n.push(Vn(e[i],e[i+1],t));if(e.length%2===1){let i=e[e.length-1];t==="v0"?n.push(Vn(i,i,t)):n.push(i)}e=n}return e[0].toString("hex")}function Nl(r,t){if(t==="v0"){if(r.contentSha256){let e=Ht(r.contentSha256,typeof r.contentSha256=="string"?"hex":void 0);return e.length!==32?null:e}return r.content?ha(r.content):null}if(r.merkleLeafV1){let e=Ht(r.merkleLeafV1,typeof r.merkleLeafV1=="string"?"hex":void 0);return e.length!==32?null:e}return r.content?$t(r.content):null}function Ze(r,t="v1"){let e=[];for(let n of r){if(V(n.path||""))continue;let i=Nl(n,t);i&&e.push({key:kl(n.path||"",t),leaf:i})}return e.length===0?null:(e.sort((n,i)=>Buffer.compare(n.key,i.key)),da(e.map(n=>n.leaf),t))}function Ar(r){return Ze(r.map(t=>({path:t.path,contentSha256:t.sha256})),"v0")}function vl(r){return Ze(r.map(t=>({path:t.path,content:t.content})),"v1")}function Vt(r){return Ze(r.map(t=>({path:t.path,merkleLeafV1:t.merkleLeafV1})),"v1")}function Ol(r,t){let e=t.toLowerCase().replace(/^0x/,"");if(!/^[0-9a-f]{64}$/.test(e))return null;let n=r.some(o=>!V(o.path||"")&&(!!o.merkleLeafV1||!!o.content));if(n){let o=Ze(r,"v1");if(o&&o===e)return{algorithm:"v1",security:"high"}}let i=Ze(r,"v0");return i&&i===e?{algorithm:"v0",security:"legacy"}:null}var Je=class{constructor(t={}){this.inBuffer=null;this.zipEntries=[];this.centralDirSize=0;this.centralDirOffset=0;this.zipComment=null;this._zipkitCmp=null;this._zipkitDeCmp=null;this.config={bufferSize:t.bufferSize||512*1024,debug:t.debug||!1},this.config.debug&&x.setLevel("debug")}getZipCompress(){return this._zipkitCmp||(this._zipkitCmp=new Et(this)),this._zipkitCmp}getZipDecompress(){return this._zipkitDeCmp||(this._zipkitDeCmp=new ca(this)),this._zipkitDeCmp}getBufferSize(){return this.config.bufferSize||512*1024}hasInBuffer(){return this.inBuffer!==null&&this.inBuffer.length>0}async compressData(t,e,n,i){return this.getZipCompress().compressData(t,e,n,i)}async deflateCompress(t,e,n,i,o){return this.getZipCompress().deflateCompress(t,e,n,i,o)}deflate(t,e){return this.getZipCompress().deflate(t,e)}async zstdCompress(t,e,n,i,o){return this.getZipCompress().zstdCompress(t,e,n,i,o)}async compressFileBuffer(t,e,n){return this.getZipCompress().compressFileBuffer(t,e,n)}async extract(t,e){return this.getZipDecompress().extract(t,e)}loadZip(t){this.resetZipData(),this.inBuffer=t,this.loadEOCDFromBuffer(t);let e=this.getDirectoryFromBuffer();return this.zipEntries=e,e}resetZipData(){this.inBuffer=null,this.zipEntries=[],this.reset(),this.zipComment=null,this._zipkitCmp=null,this._zipkitDeCmp=null}getDirectory(t){return this.zipEntries}getZipEntry(t){try{let e=this.getDirectory(),n=e.find(i=>i.filename===t);return n||(bt(t)?wt(e,t):null)}catch{return null}}ensureBuffer(){return this.inBuffer||(this.inBuffer=Buffer.alloc(0)),this.inBuffer}parseLocalHeader(t,e){let n=e.subarray(t.localHdrOffset);if(n.readUInt32LE(0)!==N.SIGNATURE)throw new Error(O.INVALID_CEN);let i=n.readUInt16LE(N.FLAGS),o=n.readUInt16LE(N.FNAME_LEN),a=n.readUInt16LE(N.EXTRA_LEN),s=N.SIZE+o+a,c=t.aesVersion>0||t.cmpMethod===I.AES_ENCRYPT,f=t.neoCryptoAlgorithm>0;if(c||f){let u=s,E=s+t.compressedSize;return n.subarray(u,E)}let l=0;i&P.ENCRYPTED&&(l=Te);let d=s+l,h=s+t.compressedSize;return n.subarray(d,h)}testCRC32(t,e){let n=ne(e),i=n===t.crc;return x.debug(`[DEBUG] testCRC32() comparison: calculated=${n}, stored=${t.crc}, isValid=${i?"\u2713":"\u2717"}, DATA_DESC=${(t.bitFlags&8)!==0?"YES":"NO"}`),i}testSHA256(t,e){if(!t.sha256)throw new Error(O.UNKNOWN_SHA256);let n=it(e),i=n===t.sha256;return x.debug(`[DEBUG] testSHA256() comparison: calculated=${n}, stored=${t.sha256}, isValid=${i?"\u2713":"\u2717"}`),i}getMemoryUsage(){let t=this.inBuffer?.length||0,e=this.zipEntries.length*1024,n;return this.inBuffer?n="buffer":n="none",{backend:n,memoryUsage:t+e,entries:this.zipEntries.length}}createZipEntry(t,e,n){let i=new ie(t,null,!1);return e?(i.crc=ne(e),i.uncompressedSize=e.length,i.compressedSize=e.length):(i.crc=0,i.uncompressedSize=0,i.compressedSize=0),i.cmpMethod=I.STORED,i.bitFlags=0,this.zipEntries.push(i),i}async copyEntry(t){if(t.cmpData){let e=t.createLocalHdr();return Buffer.concat([e,t.cmpData])}throw new Error("Cannot copy entry: no compressed data available")}get centralEndHdr(){return(t,e)=>{let n=this.zipEntries.length;return this.centralEndHdrMethod(t,e,n)}}getZipComment(){return this.zipComment}loadEOCDFromBuffer(t){let e=t.length,n=Math.min(65557,e),i=e-n,o=t.subarray(i,i+n),a=-1;for(let f=o.length-22;f>=0;f--)if(o[f]===80&&o.readUInt32LE(f)===re.SIGNATURE){a=i+f;break}if(a===-1)throw new Error(O.INVALID_FORMAT);let s=t.subarray(a,a+22);if(s.readUInt32LE(0)===re.SIGNATURE){if(this.centralDirSize=s.readUInt32LE(re.CENTRAL_DIR_SIZE),this.centralDirOffset=s.readUInt32LE(re.CENTRAL_DIR_OFFSET),this.centralDirOffset===4294967295){let f=a-20,l=t.subarray(f,f+20);if(l.readUInt32LE(0)===Hr.SIGNATURE){let d=Number(l.readBigUInt64LE(8)),h=t.subarray(d,d+56);this.centralDirSize=Number(h.readBigUInt64LE(ir.CENTRAL_DIR_SIZE)),this.centralDirOffset=Number(h.readBigUInt64LE(ir.CENTRAL_DIR_OFFSET))}}}else throw new Error(O.INVALID_FORMAT);let c=s.readUInt16LE(re.ZIP_COMMENT_LEN);if(c>0){let f=a+22;this.zipComment=t.subarray(f,f+c).toString()}}getDirectoryFromBuffer(){if(!this.inBuffer)return[];let t=this.inBuffer,e=[],n=this.centralDirOffset,i=this.centralDirSize,o=this.config.bufferSize||512*1024;for(;i>0;){let a=Math.min(o,i),s=t.subarray(n,n+a),c=0;for(;c<s.length&&s.readUInt32LE(c)===A.SIGNATURE;){let f=new ie(null,null,!1),l=s.subarray(c),d=f.readZipEntry(l);e.push(f),c+=l.length-d.length}n+=a,i-=a}return e}reset(){this.centralDirSize=0,this.centralDirOffset=0}centralEndHdrMethod(t,e,n){let i=Buffer.alloc(re.SIZE);return i.writeUInt32LE(re.SIGNATURE,0),i.writeUInt16LE(0,4),i.writeUInt16LE(0,6),i.writeUInt16LE(n,8),i.writeUInt16LE(n,10),i.writeUInt32LE(t,12),i.writeUInt32LE(e,16),i.writeUInt16LE(0,20),i}getMerkleRoot(t){let e=t?.algorithm??"v1",n;try{n=this.getDirectory()}catch(o){return x.error(`getMerkleRoot(): Error calling getDirectory(): ${o instanceof Error?o.message:String(o)}`),x.error(`getMerkleRoot(): Stack trace: ${o instanceof Error?o.stack:"No stack trace"}`),null}if(!n||n.length===0)return null;let i=n.filter(o=>!V(o.filename||""));if(e==="v0"){let o=i.filter(a=>a.sha256).map(a=>({path:a.filename||"",sha256:a.sha256}));return Ar(o)}return i.length>0&&i.every(o=>!!o.merkleLeafV1)?Vt(i.map(o=>({path:o.filename||"",merkleLeafV1:o.merkleLeafV1}))):null}async getMerkleRootAsync(t){let e=t?.algorithm??"v1",n=[];try{n=this.getDirectory()}catch(o){return x.error(`Failed to get directory for merkle root calculation: ${o instanceof Error?o.message:String(o)}`),null}if(!n||n.length===0)return null;let i=n.filter(o=>!V(o.filename||""));if(e==="v0"){let o=i.filter(a=>a.sha256).map(a=>({path:a.filename||"",sha256:a.sha256}));return Ar(o)}if(i.length>0&&i.every(o=>!!o.merkleLeafV1))return Vt(i.map(o=>({path:o.filename||"",merkleLeafV1:o.merkleLeafV1})));if(!this.inBuffer)return x.error("getMerkleRootAsync() called on file-based ZIP without precomputed merkle leaves. Use ZipkitNode (streaming testEntry) or ensure create captured merkleLeafV1."),null;for(let o of i)try{let a=await this.extract(o,!1);if(o.merkleLeafV1)continue;a===null||a.length===0?o.merkleLeafV1=$t(Buffer.alloc(0)).toString("hex"):o.merkleLeafV1=$t(a).toString("hex")}catch(a){return x.error(`getMerkleRootAsync(): failed to extract ${o.filename}: ${a instanceof Error?a.message:String(a)}`),null}return i.every(o=>!!o.merkleLeafV1)?Vt(i.map(o=>({path:o.filename||"",merkleLeafV1:o.merkleLeafV1}))):null}static merkleRootFromEntries(t,e="v1"){return Ze(t,e)}};Je.version=fr.version,Je.releaseDate=fr.releaseDate;var Ir=class{constructor(t){this.zipkit=t}calculateLocalHeaderSize(t,e){if(e.localHdrOffset+N.SIZE>t.length)throw new Error(`Local header offset ${e.localHdrOffset} is beyond buffer size ${t.length} for entry ${e.filename}`);let n=t.subarray(e.localHdrOffset,e.localHdrOffset+N.SIZE);if(n.readUInt32LE(0)!==N.SIGNATURE)throw new Error(`Invalid local file header signature for entry ${e.filename} at offset ${e.localHdrOffset}`);let i=n.readUInt16LE(N.FNAME_LEN),o=n.readUInt16LE(N.EXTRA_LEN);return N.SIZE+i+o}copyEntryBytes(t,e){let n=this.calculateLocalHeaderSize(t,e),i=(e.bitFlags&P.DATA_DESC)!==0,o=n+e.compressedSize+(i?16:0);if(e.localHdrOffset+o>t.length)throw new Error(`Entry ${e.filename} extends beyond buffer size: offset ${e.localHdrOffset} + size ${o} > buffer length ${t.length}`);let a=t.subarray(e.localHdrOffset,e.localHdrOffset+o);if(i){let s=n+e.compressedSize,c=a.readUInt32LE(s);if(c!==134695760)throw new Error(`Invalid data descriptor signature for entry ${e.filename} (expected 0x08074b50, got 0x${c.toString(16)})`)}return Buffer.from(a)}cloneEntryWithOffset(t,e){let n=new ie(t.filename,t.comment||null,t.debug);return n.verMadeBy=t.verMadeBy,n.verExtract=t.verExtract,n.bitFlags=t.bitFlags,n.cmpMethod=t.cmpMethod,n.timeDateDOS=t.timeDateDOS,n.crc=t.crc,n.compressedSize=t.compressedSize,n.uncompressedSize=t.uncompressedSize,n.volNumber=t.volNumber,n.intFileAttr=t.intFileAttr,n.extFileAttr=t.extFileAttr,n.localHdrOffset=e,t.extraField&&(n.extraField=Buffer.from(t.extraField)),n.isEncrypted=t.isEncrypted,n.isStrongEncrypt=t.isStrongEncrypt,n.isDirectory=t.isDirectory,n.isMetaData=t.isMetaData,n.isUpdated=t.isUpdated,n.platform=t.platform,n.universalTime=t.universalTime,n.uid=t.uid,n.gid=t.gid,n.sha256=t.sha256,n.isSymlink=t.isSymlink,n.linkTarget=t.linkTarget,n.isHardLink=t.isHardLink,n.originalEntry=t.originalEntry,n.inode=t.inode,n}buildCentralDirectoryAndEOCDBuffer(t,e,n){let i=[];for(let d of t)i.push(d.centralDirEntry());let o=Buffer.concat(i),a=o.length,s=Buffer.from(e,"utf8"),c=Math.min(s.length,65535),f=Buffer.alloc(22+c),l=0;return f.writeUInt32LE(re.SIGNATURE,l),l+=4,f.writeUInt16LE(0,l),l+=2,f.writeUInt16LE(0,l),l+=2,f.writeUInt16LE(t.length,l),l+=2,f.writeUInt16LE(t.length,l),l+=2,f.writeUInt32LE(a,l),l+=4,f.writeUInt32LE(n,l),l+=4,f.writeUInt16LE(c,l),l+=2,c>0&&s.copy(f,l,0,c),Buffer.concat([o,f])}async copyZipEntriesOnly(t,e){let n=this.zipkit.loadZip(t),i=e?.entryFilter?n.filter(e.entryFilter):n;if(e?.entrySorter&&(i=[...i].sort(e.entrySorter)),i.length===0)throw new Error("No entries to copy after filtering");let o=[],a=0,s=[];for(let f of i){let l=a,d=this.copyEntryBytes(t,f);o.push(d),a+=d.length;let h=this.cloneEntryWithOffset(f,l);s.push(h)}let c=Buffer.concat(o);return{entryDataBuffer:c,dataEndOffset:c.length,copiedEntries:s}}writeCentralDirectoryAndEOCD(t,e){if(t.length===0)throw new Error("At least one entry is required to finalize");let n=e?.zipComment??"",i=e?.centralDirOffset??0;return this.buildCentralDirectoryAndEOCDBuffer(t,n,i)}async copyZipBuffer(t,e){let{entryDataBuffer:n,dataEndOffset:i,copiedEntries:o}=await this.copyZipEntriesOnly(t,e),a=e?.preserveComments!==!1&&this.zipkit.getZipComment()?this.zipkit.getZipComment():"",s=this.writeCentralDirectoryAndEOCD(o,{zipComment:a,centralDirOffset:i}),c=Buffer.concat([n,s]);return{entries:o.map(f=>({filename:f.filename,localHeaderOffset:f.localHdrOffset,compressedSize:f.compressedSize})),centralDirOffset:i,totalEntries:o.length,zipBuffer:c}}};var Ml={base64:!0,array:!0,string:!0,isNode:!0,buffer:!0,uint8array:!0,arrayBuffer:typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",blob:!0,streams:!0,fileReader:!1},Qe=Ml;var be={STRING:"string",BUFFER:"buffer",ARRAY:"array",ARRAYBUFFER:"arraybuffer",U8ARRAY:"uint8array",BLOB:"blob",STREAM:"stream"};function Fl(r,t){var e=Buffer.from(r.subarray(t,t+8));return e.swap64(),parseInt(`0x${e.toString("hex")}`)}var Pl=(r,t)=>Math.imul(r,t)>>>0;function Zl(r){if(!r||typeof r!="object")return!1;let t=r;return typeof t.on=="function"&&typeof t.pause=="function"&&typeof t.resume=="function"}function Br(r){if(typeof r=="string"){if(!Qe.string)throw new Error(O.DATATYPE_STRING_UNSUPPORTED);return be.STRING}else if(Object.prototype.toString.call(r)==="[object Array]"){if(!Qe.array)throw new Error(O.DATATYPE_ARRAY_UNSUPPORTED);return be.ARRAY}else if(Buffer.isBuffer(r)){if(!Qe.buffer)throw new Error(O.DATATYPE_BUFFER_UNSUPPORTED);return be.BUFFER}else if(r instanceof Blob){if(!Qe.blob)throw new Error(O.DATATYPE_BLOB_UNSUPPORTED);return be.BLOB}else if(r instanceof Uint8Array){if(!Qe.uint8array)throw new Error(O.DATATYPE_U8ARRAY_UNSUPPORTED);return be.U8ARRAY}else if(r instanceof ArrayBuffer){if(!Qe.arrayBuffer)throw new Error(O.DATATYPE_ARRAYBUFFER_UNSUPPORTED);return be.ARRAYBUFFER}else throw new Error(O.DATATYPE_UNSUPPORTED)}var zl=r=>V(r);var Tr=class{constructor(t,e){this.lastReportedPercent=-1;this.fileName=t,this.totalBytes=e,this.processedBytes=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime}update(t){this.processedBytes+=t,this.reportProgress()}setTotalBytes(t){this.totalBytes=t}reportProgress(){let t=Date.now(),e=Math.floor(this.processedBytes/this.totalBytes*100);(e>this.lastReportedPercent||t-this.lastUpdateTime>500)&&(this.lastReportedPercent=e,this.lastUpdateTime=t,this.printProgress())}printProgress(){let t=(Date.now()-this.startTime)/1e3,e=this.processedBytes/t,n=this.totalBytes>this.processedBytes?(this.totalBytes-this.processedBytes)/e:0,i=Math.floor(this.processedBytes/this.totalBytes*100),o=s=>{let c=["B","KB","MB","GB"],f=s,l=0;for(;f>=1024&&l<c.length-1;)f/=1024,l++;return`${f.toFixed(1)}${c[l]}`},a=s=>s<60?`${s.toFixed(0)}s`:s<3600?`${Math.floor(s/60)}m ${(s%60).toFixed(0)}s`:`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`;process.stdout.write(`\r${this.fileName}: ${i}% (${o(this.processedBytes)}/${o(this.totalBytes)}) [${o(e)}/s] ETA: ${a(n)}`)}complete(){let t=(Date.now()-this.startTime)/1e3,e=this.processedBytes/t,n=i=>{let o=["B","KB","MB","GB"],a=i,s=0;for(;a>=1024&&s<o.length-1;)a/=1024,s++;return`${a.toFixed(1)}${o[s]}`};console.log(`\r${this.fileName}: 100% (${n(this.processedBytes)}) [${n(e)}/s] completed in ${t.toFixed(1)}s`)}getProgressPercent(){return Math.floor(this.processedBytes/this.totalBytes*100)}getProcessingRate(){let t=(Date.now()-this.startTime)/1e3;return this.processedBytes/t}};var Dr=class{constructor(){this.providers=new Map;this.registerProvider(new j)}registerProvider(t){t.canHandle(1)&&this.providers.set(1,t),t.canHandle(2)&&this.providers.set(2,t)}getAvailableMethods(){return Array.from(this.providers.keys())}getProvider(t){return this.providers.get(t)||null}async encrypt(t,e){let n=this.getProvider(e.method);return n?await n.encrypt(t,e):{success:!1,error:`No encryption provider available for method ${e.method}`}}async decrypt(t,e){let n=this.getProvider(e.method);return n?await n.decrypt(t,e):{success:!1,error:`No decryption provider available for method ${e.method}`}}getRecommendedMethod(){return 2}validateOptions(t){let e=[];return t.method||e.push("Encryption method is required"),(!t.password||t.password.length===0)&&e.push("Password is required"),t.password&&t.password.length<4&&e.push("Password must be at least 4 characters long"),{isValid:e.length===0,errors:e}}getMethodInfo(t){let e=this.getProvider(t);return e?{name:e.getMethodName(),keyLength:e.getKeyLength(),secure:t===2}:null}listMethods(){let t=[];for(let[e,n]of this.providers)t.push({method:e,name:n.getMethodName(),keyLength:n.getKeyLength(),secure:e===2});return t.sort((e,n)=>e.name.localeCompare(n.name))}};var Yn=new Date,Hl=`${String(Yn.getMonth()+1).padStart(2,"0")}-${String(Yn.getDate()).padStart(2,"0")}-${Yn.getFullYear()}`,$l={number:"1.0.5",date:Hl};var pa=Je;var Yt=class extends pa{constructor(){super()}async loadZipBlob(t){if(Br(t)!==be.BLOB)throw new Error(O.DATATYPE_UNSUPPORTED);return new Promise((e,n)=>{let i=new window.FileReader;i.readAsArrayBuffer(t),i.onload=o=>{if(!i.result){n(new Error("Failed to read file"));return}try{let a=Buffer.from(i.result),s=super.loadZip(a);e(s)}catch(a){n(a)}},i.onerror=()=>{n(i.error||new Error("Failed to read file"))}})}createZipFileEntry(t){let e=super.createZipEntry(t.name);e.fileData=t,e.uncompressedSize=t.size;let n=new Date(t.lastModified);return e.timeDateDOS=e.setDateTime(n),e.cmpMethod=I.DEFLATED,e}async hashFile(t){let e=await t.arrayBuffer(),n=Buffer.from(e);return it(n)}async compressDataBlob(t,e,n){if(Br(e)!==be.BLOB)throw new Error(O.DATATYPE_UNSUPPORTED);return new Promise(async(i,o)=>{let a=async(c,f,l)=>await this.compressData(c,f,l),s=new window.FileReader;s.readAsArrayBuffer(e),s.onload=async function(c){if(!this.result){o(new Error("Failed to read file"));return}try{let f=Buffer.from(this.result),l=await a(t,f,n);i(l)}catch(f){o(f)}},s.onerror=function(c){o(this.error||new Error("Failed to read file"))}})}async extractBlob(t,e){try{let n=await this.extract(t,e);if(!n)return null;let i=new Uint8Array(n);return new Blob([i],{type:"application/octet-stream"})}catch(n){throw n}}async createZipBlob(t,e){let n=e?.onError||(()=>{}),i=e?.onEntryDone||(()=>{}),o=super.getDirectory();if(!o)return n(new Error(O.NO_FILES)),null;let a=0,s=[];for(let u of o){if(!u.isUpdated)if(V(u.filename||""))u.isUpdated=!0;else{let g=await super.copyEntry(u);u.localHdrOffset=a,a+=g.length,s.push(g),i(u,"Copied");continue}if(!u.fileData)return n(new Error(O.FILE_NOT_FOUND)),null;let E=await u.fileData.arrayBuffer();if(u.cmpData&&u.compressedSize&&u.crc){let g=u.createLocalHdr();u.localHdrOffset=a,a+=g.length+u.cmpData.length,s.push(g),s.push(u.cmpData),i(u,"Written (pre-compressed)");continue}if(V(u.filename||"")){let g=Buffer.from(E);u.crc=ne(g),u.cmpMethod=0,u.compressedSize=g.length,u.uncompressedSize=g.length;let b=u.createLocalHdr();u.localHdrOffset=a,a+=b.length+g.length,s.push(b),s.push(g),i(u,"Stored (metadata)")}else{let g=await this.compressData(u,Buffer.from(E),t),b=u.createLocalHdr();u.localHdrOffset=a,a+=b.length+g.length,s.push(b),s.push(g),i(u,"Written")}}let c=a;for(let u of o){let E=u.centralDirEntry();a+=E.length,s.push(E)}let f=a-c,l=super.centralEndHdr(f,c);s.push(l);let d=Buffer.concat(s),h=new Uint8Array(d);return new Blob([h],{type:"application/zip"})}isMetadataFile(t){return V(t)}async addFile(t,e){let n=this.createZipFileEntry(t),i=t,o=await this.compressDataBlob(n,i,e);return n.cmpData=o,n}async verifyEntry(t,e){try{return await this.extractBlob(t,e)!==null}catch(n){return console.error(`Verification failed for ${t.filename}:`,n),!1}}};typeof globalThis<"u"&&(globalThis.Buffer=ma.Buffer);var Vl={isBrowser:typeof window<"u"&&typeof document<"u",isNode:typeof process<"u"&&process.versions&&process.versions.node};return Sa(Yl);})();
9
9
  /*! Bundled license information:
10
10
 
11
11
  ieee754/index.js: