(()=>{var re=Object.create,hr=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var oe=t=>hr(t,"__esModule",{value:!0});var ae=(t,r)=>()=>(t&&(r=t(t=0)),r),b=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports);var ue=(t,r,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of te(r))!ie.call(t,n)&&n!=="default"&&hr(t,n,{get:()=>r[n],enumerable:!(e=ee(r,n))||e.enumerable});return t},se=t=>ue(oe(hr(t!=null?re(ne(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Cr=b(X=>{y();"use strict";X.byteLength=he;X.toByteArray=pe;X.fromByteArray=ge;var F=[],I=[],ce=typeof Uint8Array!="undefined"?Uint8Array:Array,lr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var O=0,fe=lr.length;O<fe;++O)F[O]=lr[O],I[lr.charCodeAt(O)]=O;I["-".charCodeAt(0)]=62;I["_".charCodeAt(0)]=63;function Ur(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");e===-1&&(e=r);var n=e===r?0:4-e%4;return[e,n]}function he(t){var r=Ur(t),e=r[0],n=r[1];return(e+n)*3/4-n}function le(t,r,e){return(r+e)*3/4-e}function pe(t){var r,e=Ur(t),n=e[0],i=e[1],o=new ce(le(t,n,i)),a=0,s=i>0?n-4:n,c;for(c=0;c<s;c+=4)r=I[t.charCodeAt(c)]<<18|I[t.charCodeAt(c+1)]<<12|I[t.charCodeAt(c+2)]<<6|I[t.charCodeAt(c+3)],o[a++]=r>>16&255,o[a++]=r>>8&255,o[a++]=r&255;return i===2&&(r=I[t.charCodeAt(c)]<<2|I[t.charCodeAt(c+1)]>>4,o[a++]=r&255),i===1&&(r=I[t.charCodeAt(c)]<<10|I[t.charCodeAt(c+1)]<<4|I[t.charCodeAt(c+2)]>>2,o[a++]=r>>8&255,o[a++]=r&255),o}function de(t){return F[t>>18&63]+F[t>>12&63]+F[t>>6&63]+F[t&63]}function ye(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(de(n));return i.join("")}function ge(t){for(var r,e=t.length,n=e%3,i=[],o=16383,a=0,s=e-n;a<s;a+=o)i.push(ye(t,a,a+o>s?s:a+o));return n===1?(r=t[e-1],i.push(F[r>>2]+F[r<<4&63]+"==")):n===2&&(r=(t[e-2]<<8)+t[e-1],i.push(F[r>>10]+F[r>>4&63]+F[r<<2&63]+"=")),i.join("")}});var br=b(pr=>{y();pr.read=function(t,r,e,n,i){var o,a,s=i*8-n-1,c=(1<<s)-1,f=c>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-f;else{if(o===c)return a?NaN:(g?-1:1)*Infinity;a=a+Math.pow(2,n),o=o-f}return(g?-1:1)*a*Math.pow(2,o-n)};pr.write=function(t,r,e,n,i,o){var a,s,c,f=o*8-i-1,h=(1<<f)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,E=n?1:-1,d=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===Infinity?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+l>=1?r+=m/c:r+=m*Math.pow(2,1-l),r*c>=2&&(a++,c/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*c-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=E,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[e+g]=a&255,g+=E,a/=256,f-=8);t[e+g-E]|=d*128}});var qr=b(z=>{y();"use strict";var dr=Cr(),L=br(),_r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;z.Buffer=u;z.SlowBuffer=Ie;z.INSPECT_MAX_BYTES=50;var K=2147483647;z.kMaxLength=K;u.TYPED_ARRAY_SUPPORT=we();!u.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&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 we(){try{let t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),t.foo()===42}catch(t){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function _(t){if(t>K)throw new RangeError('The value "'+t+'" is invalid for option "size"');let r=new Uint8Array(t);return Object.setPrototypeOf(r,u.prototype),r}function u(t,r,e){if(typeof t=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return yr(t)}return Tr(t,r,e)}u.poolSize=8192;function Tr(t,r,e){if(typeof t=="string")return me(t,r);if(ArrayBuffer.isView(t))return Be(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(A(t,ArrayBuffer)||t&&A(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(A(t,SharedArrayBuffer)||t&&A(t.buffer,SharedArrayBuffer)))return wr(t,r,e);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return u.from(n,r,e);let i=Ee(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return u.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}u.from=function(t,r,e){return Tr(t,r,e)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Sr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function xe(t,r,e){return Sr(t),t<=0?_(t):r!==void 0?typeof e=="string"?_(t).fill(r,e):_(t).fill(r):_(t)}u.alloc=function(t,r,e){return xe(t,r,e)};function yr(t){return Sr(t),_(t<0?0:xr(t)|0)}u.allocUnsafe=function(t){return yr(t)};u.allocUnsafeSlow=function(t){return yr(t)};function me(t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let e=Rr(t,r)|0,n=_(e),i=n.write(t,r);return i!==e&&(n=n.slice(0,i)),n}function gr(t){let r=t.length<0?0:xr(t.length)|0,e=_(r);for(let n=0;n<r;n+=1)e[n]=t[n]&255;return e}function Be(t){if(A(t,Uint8Array)){let r=new Uint8Array(t);return wr(r.buffer,r.byteOffset,r.byteLength)}return gr(t)}function wr(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');let n;return r===void 0&&e===void 0?n=new Uint8Array(t):e===void 0?n=new Uint8Array(t,r):n=new Uint8Array(t,r,e),Object.setPrototypeOf(n,u.prototype),n}function Ee(t){if(u.isBuffer(t)){let r=xr(t.length)|0,e=_(r);return e.length===0||t.copy(e,0,0,r),e}if(t.length!==void 0)return typeof t.length!="number"||Er(t.length)?_(0):gr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return gr(t.data)}function xr(t){if(t>=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return t|0}function Ie(t){return+t!=t&&(t=0),u.alloc(+t)}u.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==u.prototype};u.compare=function(r,e){if(A(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),A(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(r)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;let n=r.length,i=e.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};u.isEncoding=function(r){switch(String(r).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}};u.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;let i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){let a=r[n];if(A(a,Uint8Array))o+a.length>i.length?(u.isBuffer(a)||(a=u.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(u.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Rr(t,r){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||A(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let e=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return Br(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return jr(t).length;default:if(i)return n?-1:Br(t).length;r=(""+r).toLowerCase(),i=!0}}u.byteLength=Rr;function Fe(t,r,e){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Pe(this,r,e);case"utf8":case"utf-8":return kr(this,r,e);case"ascii":return Re(this,r,e);case"latin1":case"binary":return De(this,r,e);case"base64":return Te(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){let n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){let r=this.length;if(r%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<r;e+=2)M(this,e,e+1);return this};u.prototype.swap32=function(){let r=this.length;if(r%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.prototype.swap64=function(){let r=this.length;if(r%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?kr(this,0,r):Fe.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(r){if(!u.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){let r="",e=z.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"};_r&&(u.prototype[_r]=u.prototype.inspect);u.prototype.compare=function(r,e,n,i,o){if(A(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.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===r)return 0;let a=o-i,s=n-e,c=Math.min(a,s),f=this.slice(i,o),h=r.slice(e,n);for(let l=0;l<c;++l)if(f[l]!==h[l]){a=f[l],s=h[l];break}return a<s?-1:s<a?1:0};function Dr(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Er(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),u.isBuffer(r))return r.length===0?-1:Pr(t,r,e,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Pr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Pr(t,r,e,n,i){let o=1,a=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,s/=2,e/=2}function c(h,l){return o===1?h[l]:h.readUInt16BE(l*o)}let f;if(i){let h=-1;for(f=e;f<a;f++)if(c(t,f)===c(r,h===-1?0:f-h)){if(h===-1&&(h=f),f-h+1===s)return h*o}else h!==-1&&(f-=f-h),h=-1}else for(e+s>a&&(e=a-s),f=e;f>=0;f--){let h=!0;for(let l=0;l<s;l++)if(c(t,f+l)!==c(r,l)){h=!1;break}if(h)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Dr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Dr(this,r,e,n,!1)};function Ae(t,r,e,n){e=Number(e)||0;let i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;let o=r.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let s=parseInt(r.substr(a*2,2),16);if(Er(s))return a;t[e+a]=s}return a}function Ue(t,r,e,n){return J(Br(r,t.length-e),t,e,n)}function Ce(t,r,e,n){return J(Le(r),t,e,n)}function be(t,r,e,n){return J(jr(r),t,e,n)}function _e(t,r,e,n){return J(Ne(r,t.length-e),t,e,n)}u.prototype.write=function(r,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),r.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 Ae(this,r,e,n);case"utf8":case"utf-8":return Ue(this,r,e,n);case"ascii":case"latin1":case"binary":return Ce(this,r,e,n);case"base64":return be(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Te(t,r,e){return r===0&&e===t.length?dr.fromByteArray(t):dr.fromByteArray(t.slice(r,e))}function kr(t,r,e){e=Math.min(t.length,e);let n=[],i=r;for(;i<e;){let o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){let c,f,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)==128&&(l=(o&31)<<6|c&63,l>127&&(a=l));break;case 3:c=t[i+1],f=t[i+2],(c&192)==128&&(f&192)==128&&(l=(o&15)<<12|(c&63)<<6|f&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:c=t[i+1],f=t[i+2],h=t[i+3],(c&192)==128&&(f&192)==128&&(h&192)==128&&(l=(o&15)<<18|(c&63)<<12|(f&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}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 Se(n)}var vr=4096;function Se(t){let r=t.length;if(r<=vr)return String.fromCharCode.apply(String,t);let e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=vr));return e}function Re(t,r,e){let n="";e=Math.min(t.length,e);for(let i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function De(t,r,e){let n="";e=Math.min(t.length,e);for(let i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function Pe(t,r,e){let n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);let i="";for(let o=r;o<e;++o)i+=$e[t[o]];return i}function ke(t,r,e){let n=t.slice(r,e),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}u.prototype.slice=function(r,e){let n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);let i=this.subarray(r,e);return Object.setPrototypeOf(i,u.prototype),i};function x(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||x(r,e,this.length);let i=this[r],o=1,a=0;for(;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||x(r,e,this.length);let i=this[r+--e],o=1;for(;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUint8=u.prototype.readUInt8=function(r,e){return r=r>>>0,e||x(r,1,this.length),this[r]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(r,e){return r=r>>>0,e||x(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(r,e){return r=r>>>0,e||x(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(r,e){return r=r>>>0,e||x(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(r,e){return r=r>>>0,e||x(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readBigUInt64LE=T(function(r){r=r>>>0,$(r,"offset");let e=this[r],n=this[r+7];(e===void 0||n===void 0)&&W(r,this.length-8);let i=e+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});u.prototype.readBigUInt64BE=T(function(r){r=r>>>0,$(r,"offset");let e=this[r],n=this[r+7];(e===void 0||n===void 0)&&W(r,this.length-8);let i=e*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});u.prototype.readIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||x(r,e,this.length);let i=this[r],o=1,a=0;for(;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||x(r,e,this.length);let i=e,o=1,a=this[r+--i];for(;i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return r=r>>>0,e||x(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){r=r>>>0,e||x(r,2,this.length);let n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){r=r>>>0,e||x(r,2,this.length);let n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return r=r>>>0,e||x(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return r=r>>>0,e||x(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readBigInt64LE=T(function(r){r=r>>>0,$(r,"offset");let e=this[r],n=this[r+7];(e===void 0||n===void 0)&&W(r,this.length-8);let i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)});u.prototype.readBigInt64BE=T(function(r){r=r>>>0,$(r,"offset");let e=this[r],n=this[r+7];(e===void 0||n===void 0)&&W(r,this.length-8);let i=(e<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(i)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n)});u.prototype.readFloatLE=function(r,e){return r=r>>>0,e||x(r,4,this.length),L.read(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return r=r>>>0,e||x(r,4,this.length),L.read(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return r=r>>>0,e||x(r,8,this.length),L.read(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return r=r>>>0,e||x(r,8,this.length),L.read(this,r,!1,52,8)};function B(t,r,e,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;B(this,r,e,n,s,0)}let o=1,a=0;for(this[e]=r&255;++a<n&&(o*=256);)this[e+a]=r/o&255;return e+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;B(this,r,e,n,s,0)}let o=n-1,a=1;for(this[e+o]=r&255;--o>=0&&(a*=256);)this[e+o]=r/a&255;return e+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,1,255,0),this[e]=r&255,e+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,2,65535,0),this[e]=r&255,this[e+1]=r>>>8,e+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=r&255,e+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255,e+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};function Mr(t,r,e,n,i){Gr(r,n,i,t,e,7);let o=Number(r&BigInt(4294967295));t[e++]=o,o=o>>8,t[e++]=o,o=o>>8,t[e++]=o,o=o>>8,t[e++]=o;let a=Number(r>>BigInt(32)&BigInt(4294967295));return t[e++]=a,a=a>>8,t[e++]=a,a=a>>8,t[e++]=a,a=a>>8,t[e++]=a,e}function Or(t,r,e,n,i){Gr(r,n,i,t,e,7);let o=Number(r&BigInt(4294967295));t[e+7]=o,o=o>>8,t[e+6]=o,o=o>>8,t[e+5]=o,o=o>>8,t[e+4]=o;let a=Number(r>>BigInt(32)&BigInt(4294967295));return t[e+3]=a,a=a>>8,t[e+2]=a,a=a>>8,t[e+1]=a,a=a>>8,t[e]=a,e+8}u.prototype.writeBigUInt64LE=T(function(r,e=0){return Mr(this,r,e,BigInt(0),BigInt("0xffffffffffffffff"))});u.prototype.writeBigUInt64BE=T(function(r,e=0){return Or(this,r,e,BigInt(0),BigInt("0xffffffffffffffff"))});u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){let c=Math.pow(2,8*n-1);B(this,r,e,n,c-1,-c)}let o=0,a=1,s=0;for(this[e]=r&255;++o<n&&(a*=256);)r<0&&s===0&&this[e+o-1]!==0&&(s=1),this[e+o]=(r/a>>0)-s&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){let c=Math.pow(2,8*n-1);B(this,r,e,n,c-1,-c)}let o=n-1,a=1,s=0;for(this[e+o]=r&255;--o>=0&&(a*=256);)r<0&&s===0&&this[e+o+1]!==0&&(s=1),this[e+o]=(r/a>>0)-s&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,2,32767,-32768),this[e]=r&255,this[e+1]=r>>>8,e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=r&255,e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,4,2147483647,-2147483648),this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||B(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};u.prototype.writeBigInt64LE=T(function(r,e=0){return Mr(this,r,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});u.prototype.writeBigInt64BE=T(function(r,e=0){return Or(this,r,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Lr(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Nr(t,r,e,n,i){return r=+r,e=e>>>0,i||Lr(t,r,e,4,34028234663852886e22,-34028234663852886e22),L.write(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Nr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Nr(this,r,e,!1,n)};function $r(t,r,e,n,i){return r=+r,e=e>>>0,i||Lr(t,r,e,8,17976931348623157e292,-17976931348623157e292),L.write(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return $r(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return $r(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(!u.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.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),r.length-e<i-n&&(i=r.length-e+n);let o=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),e),o};u.prototype.fill=function(r,e,n,i){if(typeof r=="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"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){let a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));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,r||(r=0);let o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{let a=u.isBuffer(r)?r:u.from(r,i),s=a.length;if(s===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var N={};function mr(t,r,e){N[t]=class extends e{constructor(){super();Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}mr("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);mr("ERR_INVALID_ARG_TYPE",function(t,r){return`The "${t}" argument must be of type number. Received type ${typeof r}`},TypeError);mr("ERR_OUT_OF_RANGE",function(t,r,e){let n=`The value of "${t}" is out of range.`,i=e;return Number.isInteger(e)&&Math.abs(e)>2**32?i=zr(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=zr(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function zr(t){let r="",e=t.length,n=t[0]==="-"?1:0;for(;e>=n+4;e-=3)r=`_${t.slice(e-3,e)}${r}`;return`${t.slice(0,e)}${r}`}function ve(t,r,e){$(r,"offset"),(t[r]===void 0||t[r+e]===void 0)&&W(r,t.length-(e+1))}function Gr(t,r,e,n,i,o){if(t>e||t<r){let a=typeof r=="bigint"?"n":"",s;throw o>3?r===0||r===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=`>= ${r}${a} and <= ${e}${a}`,new N.ERR_OUT_OF_RANGE("value",s,t)}ve(n,i,o)}function $(t,r){if(typeof t!="number")throw new N.ERR_INVALID_ARG_TYPE(r,"number",t)}function W(t,r,e){throw Math.floor(t)!==t?($(t,e),new N.ERR_OUT_OF_RANGE(e||"offset","an integer",t)):r<0?new N.ERR_BUFFER_OUT_OF_BOUNDS:new N.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${r}`,t)}var Me=/[^+/0-9A-Za-z-_]/g;function Oe(t){if(t=t.split("=")[0],t=t.trim().replace(Me,""),t.length<2)return"";for(;t.length%4!=0;)t=t+"=";return t}function Br(t,r){r=r||Infinity;let e,n=t.length,i=null,o=[];for(let a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=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 Le(t){let r=[];for(let e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ne(t,r){let e,n,i,o=[];for(let a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function jr(t){return dr.toByteArray(Oe(t))}function J(t,r,e,n){let i;for(i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function A(t,r){return t instanceof r||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===r.name}function Er(t){return t!==t}var $e=function(){let t="0123456789abcdef",r=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let i=0;i<16;++i)r[n+i]=t[e]+t[i]}return r}();function T(t){return typeof BigInt=="undefined"?ze:t}function ze(){throw new Error("BigInt not supported")}});var y=ae(()=>{globalThis.global=globalThis;globalThis.Buffer=qr().Buffer;globalThis.process={browser:!0,env:{},nextTick(t,...r){queueMicrotask(()=>t(...r))}}});var Ir=b(S=>{y();"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.loop=S.conditional=S.parse=void 0;var Ge=function t(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(e))e.forEach(function(a){return t(r,a,n,i)});else if(typeof e=="function")e(r,n,i,t);else{var o=Object.keys(e)[0];Array.isArray(e[o])?(i[o]={},t(r,e[o],n,i[o])):i[o]=e[o](r,n,i,t)}return n};S.parse=Ge;var je=function(r,e){return function(n,i,o,a){e(n,i,o)&&a(n,r,i,o)}};S.conditional=je;var qe=function(r,e){return function(n,i,o,a){for(var s=[];e(n,i,o);){var c={};a(n,r,i,c),s.push(c)}return s}};S.loop=qe});var Fr=b(w=>{y();"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.readBits=w.readArray=w.readUnsigned=w.readString=w.peekBytes=w.readBytes=w.peekByte=w.readByte=w.buildStream=void 0;var We=function(r){return{data:r,pos:0}};w.buildStream=We;var Wr=function(){return function(r){return r.data[r.pos++]}};w.readByte=Wr;var Ye=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+r]}};w.peekByte=Ye;var Z=function(r){return function(e){return e.data.subarray(e.pos,e.pos+=r)}};w.readBytes=Z;var Ve=function(r){return function(e){return e.data.subarray(e.pos,e.pos+r)}};w.peekBytes=Ve;var He=function(r){return function(e){return Array.from(Z(r)(e)).map(function(n){return String.fromCharCode(n)}).join("")}};w.readString=He;var Xe=function(r){return function(e){var n=Z(2)(e);return r?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};w.readUnsigned=Xe;var Ke=function(r,e){return function(n,i,o){for(var a=typeof e=="function"?e(n,i,o):e,s=Z(r),c=new Array(a),f=0;f<a;f++)c[f]=s(n);return c}};w.readArray=Ke;var Je=function(r,e,n){for(var i=0,o=0;o<n;o++)i+=r[e+o]&&Math.pow(2,n-o-1);return i},Ze=function(r){return function(e){for(var n=Wr()(e),i=new Array(8),o=0;o<8;o++)i[7-o]=!!(n&1<<o);return Object.keys(r).reduce(function(a,s){var c=r[s];return c.length?a[s]=Je(i,c.index,c.length):a[s]=i[c.index],a},{})}};w.readBits=Ze});var Yr=b(rr=>{y();"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.default=void 0;var R=Ir(),p=Fr(),Q={blocks:function(r){for(var e=0,n=[],i=0,o=(0,p.readByte)()(r);o!==e;o=(0,p.readByte)()(r))n.push((0,p.readBytes)(o)(r)),i+=o;for(var a=new Uint8Array(i),s=0,c=0;c<n.length;c++)a.set(n[c],s),s+=n[c].length;return a}},Qe=(0,R.conditional)({gce:[{codes:(0,p.readBytes)(2)},{byteSize:(0,p.readByte)()},{extras:(0,p.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,p.readUnsigned)(!0)},{transparentColorIndex:(0,p.readByte)()},{terminator:(0,p.readByte)()}]},function(t){var r=(0,p.peekBytes)(2)(t);return r[0]===33&&r[1]===249}),rt=(0,R.conditional)({image:[{code:(0,p.readByte)()},{descriptor:[{left:(0,p.readUnsigned)(!0)},{top:(0,p.readUnsigned)(!0)},{width:(0,p.readUnsigned)(!0)},{height:(0,p.readUnsigned)(!0)},{lct:(0,p.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,R.conditional)({lct:(0,p.readArray)(3,function(t,r,e){return Math.pow(2,e.descriptor.lct.size+1)})},function(t,r,e){return e.descriptor.lct.exists}),{data:[{minCodeSize:(0,p.readByte)()},Q]}]},function(t){return(0,p.peekByte)()(t)===44}),et=(0,R.conditional)({text:[{codes:(0,p.readBytes)(2)},{blockSize:(0,p.readByte)()},{preData:function(r,e,n){return(0,p.readBytes)(n.text.blockSize)(r)}},Q]},function(t){var r=(0,p.peekBytes)(2)(t);return r[0]===33&&r[1]===1}),tt=(0,R.conditional)({application:[{codes:(0,p.readBytes)(2)},{blockSize:(0,p.readByte)()},{id:function(r,e,n){return(0,p.readString)(n.blockSize)(r)}},Q]},function(t){var r=(0,p.peekBytes)(2)(t);return r[0]===33&&r[1]===255}),nt=(0,R.conditional)({comment:[{codes:(0,p.readBytes)(2)},Q]},function(t){var r=(0,p.peekBytes)(2)(t);return r[0]===33&&r[1]===254}),it=[{header:[{signature:(0,p.readString)(3)},{version:(0,p.readString)(3)}]},{lsd:[{width:(0,p.readUnsigned)(!0)},{height:(0,p.readUnsigned)(!0)},{gct:(0,p.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,p.readByte)()},{pixelAspectRatio:(0,p.readByte)()}]},(0,R.conditional)({gct:(0,p.readArray)(3,function(t,r){return Math.pow(2,r.lsd.gct.size+1)})},function(t,r){return r.lsd.gct.exists}),{frames:(0,R.loop)([Qe,tt,nt,rt,et],function(t){var r=(0,p.peekByte)()(t);return r===33||r===44})}],ot=it;rr.default=ot});var Vr=b(er=>{y();"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.deinterlace=void 0;var at=function(r,e){for(var n=new Array(r.length),i=r.length/e,o=function(m,g){var E=r.slice(g*e,(g+1)*e);n.splice.apply(n,[m*e,e].concat(E))},a=[0,4,2,1],s=[8,8,4,2],c=0,f=0;f<4;f++)for(var h=a[f];h<i;h+=s[f])o(h,c),c++;return n};er.deinterlace=at});var Hr=b(tr=>{y();"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.lzw=void 0;var ut=function(r,e,n){var i=4096,o=-1,a=n,s,c,f,h,l,m,g,E,d,k,G,Y,v,C,V,H,cr=new Array(n),fr=new Array(i),j=new Array(i),q=new Array(i+1);for(Y=r,c=1<<Y,l=c+1,s=c+2,g=o,h=Y+1,f=(1<<h)-1,d=0;d<c;d++)fr[d]=0,j[d]=d;var G,E,Qr,v,C,H,V;for(G=E=Qr=v=C=H=V=0,k=0;k<a;){if(C===0){if(E<h){G+=e[V]<<E,E+=8,V++;continue}if(d=G&f,G>>=h,E-=h,d>s||d==l)break;if(d==c){h=Y+1,f=(1<<h)-1,s=c+2,g=o;continue}if(g==o){q[C++]=j[d],g=d,v=d;continue}for(m=d,d==s&&(q[C++]=v,d=g);d>c;)q[C++]=j[d],d=fr[d];v=j[d]&255,q[C++]=v,s<i&&(fr[s]=g,j[s]=v,s++,(s&f)==0&&s<i&&(h++,f+=s)),g=m}C--,cr[H++]=q[C],k++}for(k=H;k<a;k++)cr[k]=0;return cr};tr.lzw=ut});var Kr=b(D=>{y();"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.decompressFrames=D.decompressFrame=D.parseGIF=void 0;var st=pt(Yr()),ct=Ir(),ft=Fr(),ht=Vr(),lt=Hr();function pt(t){return t&&t.__esModule?t:{default:t}}var dt=function(r){var e=new Uint8Array(r);return(0,ct.parse)((0,ft.buildStream)(e),st.default)};D.parseGIF=dt;var yt=function(r){for(var e=r.pixels.length,n=new Uint8ClampedArray(e*4),i=0;i<e;i++){var o=i*4,a=r.pixels[i],s=r.colorTable[a];n[o]=s[0],n[o+1]=s[1],n[o+2]=s[2],n[o+3]=a!==r.transparentIndex?255:0}return n},Xr=function(r,e,n){if(!r.image){console.warn("gif frame does not have associated image.");return}var i=r.image,o=i.descriptor.width*i.descriptor.height,a=(0,lt.lzw)(i.data.minCodeSize,i.data.blocks,o);i.descriptor.lct.interlaced&&(a=(0,ht.deinterlace)(a,i.descriptor.width));var s={pixels:a,dims:{top:r.image.descriptor.top,left:r.image.descriptor.left,width:r.image.descriptor.width,height:r.image.descriptor.height}};return i.descriptor.lct&&i.descriptor.lct.exists?s.colorTable=i.lct:s.colorTable=e,r.gce&&(s.delay=(r.gce.delay||10)*10,s.disposalType=r.gce.extras.disposal,r.gce.extras.transparentColorGiven&&(s.transparentIndex=r.gce.transparentColorIndex)),n&&(s.patch=yt(s)),s};D.decompressFrame=Xr;var gt=function(r,e){return r.frames.filter(function(n){return n.image}).map(function(n){return Xr(n,r.gct,e)})};D.decompressFrames=gt});y();y();var nr=se(Kr()),P=new OffscreenCanvas(1,1),U=P.getContext("2d"),ir=new OffscreenCanvas(1,1),or=ir.getContext("2d"),ar=new OffscreenCanvas(1,1),Ar=P.getContext("2d"),ur=512,Jr,sr;(function(i){i[i.NOT_SPECIFIED=0]="NOT_SPECIFIED",i[i.NO_DISPOSAL=1]="NO_DISPOSAL",i[i.RESTORE_TO_BACKGROUND_COLOR=2]="RESTORE_TO_BACKGROUND_COLOR",i[i.RESTORE_TO_PREVIOUS=3]="RESTORE_TO_PREVIOUS"})(sr||(sr={}));async function Zr(t){let r=await(0,nr.parseGIF)(t),e=(0,nr.decompressFrames)(r,!0),n=[],i=[],o=e[0].dims;P.width=o.width,P.height=o.height;let{width:a,height:s,shouldResize:c}=wt(o);ar.width=a,ar.height=s;let f=!0;for(let h of e){n.push(h.delay);let l=xt(h,c,f);l&&i.push(l.data.buffer),f=!1}return{imagesData:i,width:a,height:s,frameDelays:n}}function wt(t){let r=t.width,e=t.height,n=r>ur||e>ur;if(n){let i=r>e?r/ur:e/ur;r=r/i,e=e/i}return{width:r,height:e,shouldResize:n}}function xt(t,r,e){if(!or||!U)return;e||It(),mt(t);let n=Bt(ir,t);return t.disposalType!==2&&t.disposalType!==3&&Et(n),U.setTransform(1,0,0,1,0,0),n&&r&&(n=Ft(P,ar.width,ar.height)),n}function mt(t){if(!or)return;ir.width=t.dims.width,ir.height=t.dims.height;let r=or.createImageData(t.dims.width,t.dims.height);return r.data.set(t.patch),or.putImageData(r,0,0),r}function Bt(t,r){if(!!U)return U.scale(1,-1),U.drawImage(t,r.dims.left,-(P.height-r.dims.top)),U.getImageData(0,0,P.width,P.height)}function Et(t){Jr=t}function It(){!U||U.putImageData(Jr,0,0)}function Ft(t,r,e){if(!(!U||!Ar))return U.setTransform(1,0,0,1,0,0),Ar.drawImage(t,0,0,t.width,t.height,0,0,r,e),Ar.getImageData(0,0,r,e)}{let n=function(s){t.push(s),t.length===1&&o().catch(f=>console.log(f))},i=function(s){if(e&&r&&r.data.id===s.data.id){e.abort();return}for(let f=0;f<t.length;f++)if(t[f].data.id===s.data.id){t.slice(f,0);return}},t=[],r=null,e;self.onmessage=s=>{s.data.type==="FETCH"?n(s):s.data.type==="CANCEL"&&i(s)};async function o(){for(;t.length>0;)r=t[0],await a(r),r=null,t.splice(0,1)}async function a(s){e=new AbortController;let c=e.signal;try{let h=await fetch(s.data.url,{signal:c});e=null;let l=await h.arrayBuffer(),m=await Zr(l);self.postMessage({success:!0,arrayBufferFrames:m.imagesData,width:m.width,height:m.height,delays:m.frameDelays,url:s.data.url,id:s.data.id},m.imagesData)}catch(f){e=null,self.postMessage({success:!1,id:s.data.id})}}}})();
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
