@legit-sdk/core 0.1.11 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +87 -16
- package/dist/index.js +57 -56
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
// legit-sdk library bundle
|
|
2
2
|
// Generated by esbuild
|
|
3
3
|
|
|
4
|
-
var _x=Object.create;var $i=Object.defineProperty;var Fx=Object.getOwnPropertyDescriptor;var Ex=Object.getOwnPropertyNames;var Sx=Object.getPrototypeOf,xx=Object.prototype.hasOwnProperty;var Tx=(t,e,r)=>e in t?$i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var a=(t,e)=>$i(t,"name",{value:e,configurable:!0}),Ox=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Rx=(t,e)=>()=>(t&&(e=t(t=0)),e);var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),kx=(t,e)=>{for(var r in e)$i(t,r,{get:e[r],enumerable:!0})},gm=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ex(e))!xx.call(t,n)&&n!==r&&$i(t,n,{get:()=>e[n],enumerable:!(i=Fx(e,n))||i.enumerable});return t};var ae=(t,e,r)=>(r=t!=null?_x(Sx(t)):{},gm(e||!t||!t.__esModule?$i(r,"default",{value:t,enumerable:!0}):r,t)),bm=t=>gm($i({},"__esModule",{value:!0}),t);var H=(t,e,r)=>Tx(t,typeof e!="symbol"?e+"":e,r);var Sr=T((AM,_m)=>{"use strict";function Mt(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}a(Mt,"assertPath");function vm(t,e){for(var r="",i=0,n=-1,o=0,s,l=0;l<=t.length;++l){if(l<t.length)s=t.charCodeAt(l);else{if(s===47)break;s=47}if(s===47){if(!(n===l-1||o===1))if(n!==l-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",i=0):(r=r.slice(0,f),i=r.length-1-r.lastIndexOf("/")),n=l,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=l,o=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(n+1,l):r=t.slice(n+1,l),i=l-n-1;n=l,o=0}else s===46&&o!==-1?++o:o=-1}return r}a(vm,"normalizeStringPosix");function Px(t,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+t+i:i}a(Px,"_format");var Mi={resolve:a(function(){for(var e="",r=!1,i,n=arguments.length-1;n>=-1&&!r;n--){var o;n>=0?o=arguments[n]:(i===void 0&&(i=process.cwd()),o=i),Mt(o),o.length!==0&&(e=o+"/"+e,r=o.charCodeAt(0)===47)}return e=vm(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},"resolve"),normalize:a(function(e){if(Mt(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=vm(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},"normalize"),isAbsolute:a(function(e){return Mt(e),e.length>0&&e.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];Mt(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":Mi.normalize(e)},"join"),relative:a(function(e,r){if(Mt(e),Mt(r),e===r||(e=Mi.resolve(e),r=Mi.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var n=e.length,o=n-i,s=1;s<r.length&&r.charCodeAt(s)===47;++s);for(var l=r.length,f=l-s,c=o<f?o:f,u=-1,h=0;h<=c;++h){if(h===c){if(f>c){if(r.charCodeAt(s+h)===47)return r.slice(s+h+1);if(h===0)return r.slice(s+h)}else o>c&&(e.charCodeAt(i+h)===47?u=h:h===0&&(u=0));break}var d=e.charCodeAt(i+h),p=r.charCodeAt(s+h);if(d!==p)break;d===47&&(u=h)}var m="";for(h=i+u+1;h<=n;++h)(h===n||e.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(s+u):(s+=u,r.charCodeAt(s)===47&&++s,r.slice(s))},"relative"),_makeLong:a(function(e){return e},"_makeLong"),dirname:a(function(e){if(Mt(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,n=-1,o=!0,s=e.length-1;s>=1;--s)if(r=e.charCodeAt(s),r===47){if(!o){n=s;break}}else o=!1;return n===-1?i?"/":".":i&&n===1?"//":e.slice(0,n)},"dirname"),basename:a(function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Mt(e);var i=0,n=-1,o=!0,s;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,f=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!o){i=s+1;break}}else f===-1&&(o=!1,f=s+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(n=s):(l=-1,n=f))}return i===n?n=f:n===-1&&(n=e.length),e.slice(i,n)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){i=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":e.slice(i,n)}},"basename"),extname:a(function(e){Mt(e);for(var r=-1,i=0,n=-1,o=!0,s=0,l=e.length-1;l>=0;--l){var f=e.charCodeAt(l);if(f===47){if(!o){i=l+1;break}continue}n===-1&&(o=!1,n=l+1),f===46?r===-1?r=l:s!==1&&(s=1):r!==-1&&(s=-1)}return r===-1||n===-1||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)},"extname"),format:a(function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return Px("/",e)},"format"),parse:a(function(e){Mt(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),n=i===47,o;n?(r.root="/",o=1):o=0;for(var s=-1,l=0,f=-1,c=!0,u=e.length-1,h=0;u>=o;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}f===-1&&(c=!1,f=u+1),i===46?s===-1?s=u:h!==1&&(h=1):s!==-1&&(h=-1)}return s===-1||f===-1||h===0||h===1&&s===f-1&&s===l+1?f!==-1&&(l===0&&n?r.base=r.name=e.slice(1,f):r.base=r.name=e.slice(l,f)):(l===0&&n?(r.name=e.slice(1,s),r.base=e.slice(1,f)):(r.name=e.slice(l,s),r.base=e.slice(l,f)),r.ext=e.slice(s,f)),l>0?r.dir=e.slice(0,l-1):n&&(r.dir="/"),r},"parse"),sep:"/",delimiter:":",win32:null,posix:null};Mi.posix=Mi;_m.exports=Mi});var Pt=T(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.constants=Ui.SEP=void 0;Ui.SEP="/";Ui.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_SYMLINK:2097152,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});var Tf=T(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.Stats=void 0;var Ax=Pt(),{S_IFMT:Ix,S_IFDIR:Dx,S_IFREG:Cx,S_IFBLK:Nx,S_IFCHR:Bx,S_IFLNK:Lx,S_IFIFO:$x,S_IFSOCK:Mx}=Ax.constants,Hs=class Hs{static build(e,r=!1){let i=new Hs,{uid:n,gid:o,atime:s,mtime:l,ctime:f}=e,c=r?h=>BigInt(h):h=>h;i.uid=c(n),i.gid=c(o),i.rdev=c(e.rdev),i.blksize=c(4096),i.ino=c(e.ino),i.size=c(e.getSize()),i.blocks=c(1),i.atime=s,i.mtime=l,i.ctime=f,i.birthtime=f,i.atimeMs=c(s.getTime()),i.mtimeMs=c(l.getTime());let u=c(f.getTime());if(i.ctimeMs=u,i.birthtimeMs=u,r){i.atimeNs=BigInt(s.getTime())*BigInt(1e6),i.mtimeNs=BigInt(l.getTime())*BigInt(1e6);let h=BigInt(f.getTime())*BigInt(1e6);i.ctimeNs=h,i.birthtimeNs=h}return i.dev=c(0),i.mode=c(e.mode),i.nlink=c(e.nlink),i}_checkModeProperty(e){return(Number(this.mode)&Ix)===e}isDirectory(){return this._checkModeProperty(Dx)}isFile(){return this._checkModeProperty(Cx)}isBlockDevice(){return this._checkModeProperty(Nx)}isCharacterDevice(){return this._checkModeProperty(Bx)}isSymbolicLink(){return this._checkModeProperty(Lx)}isFIFO(){return this._checkModeProperty($x)}isSocket(){return this._checkModeProperty(Mx)}};a(Hs,"Stats");var Us=Hs;lo.Stats=Us;lo.default=Us});var Sm=T(qs=>{"use strict";qs.byteLength=Ux;qs.toByteArray=qx;qs.fromByteArray=Vx;var jt=[],ht=[],jx=typeof Uint8Array<"u"?Uint8Array:Array,Of="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ri=0,Fm=Of.length;ri<Fm;++ri)jt[ri]=Of[ri],ht[Of.charCodeAt(ri)]=ri;var ri,Fm;ht[45]=62;ht[95]=63;function Em(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}a(Em,"getLens");function Ux(t){var e=Em(t),r=e[0],i=e[1];return(r+i)*3/4-i}a(Ux,"byteLength");function Hx(t,e,r){return(e+r)*3/4-r}a(Hx,"_byteLength");function qx(t){var e,r=Em(t),i=r[0],n=r[1],o=new jx(Hx(t,i,n)),s=0,l=n>0?i-4:i,f;for(f=0;f<l;f+=4)e=ht[t.charCodeAt(f)]<<18|ht[t.charCodeAt(f+1)]<<12|ht[t.charCodeAt(f+2)]<<6|ht[t.charCodeAt(f+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=ht[t.charCodeAt(f)]<<2|ht[t.charCodeAt(f+1)]>>4,o[s++]=e&255),n===1&&(e=ht[t.charCodeAt(f)]<<10|ht[t.charCodeAt(f+1)]<<4|ht[t.charCodeAt(f+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}a(qx,"toByteArray");function zx(t){return jt[t>>18&63]+jt[t>>12&63]+jt[t>>6&63]+jt[t&63]}a(zx,"tripletToBase64");function Wx(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(zx(i));return n.join("")}a(Wx,"encodeChunk");function Vx(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,l=r-i;s<l;s+=o)n.push(Wx(t,s,s+o>l?l:s+o));return i===1?(e=t[r-1],n.push(jt[e>>2]+jt[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(jt[e>>10]+jt[e>>4&63]+jt[e<<2&63]+"=")),n.join("")}a(Vx,"fromByteArray")});var xm=T(Rf=>{Rf.read=function(t,e,r,i,n){var o,s,l=n*8-i-1,f=(1<<l)-1,c=f>>1,u=-7,h=r?n-1:0,d=r?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=l;u>0;o=o*256+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=s*256+t[e+h],h+=d,u-=8);if(o===0)o=1-c;else{if(o===f)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c}return(p?-1:1)*s*Math.pow(2,o-i)};Rf.write=function(t,e,r,i,n,o){var s,l,f,c=o*8-n-1,u=(1<<c)-1,h=u>>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,m=i?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+h>=1?e+=d/f:e+=d*Math.pow(2,1-h),e*f>=2&&(s++,f/=2),s+h>=u?(l=0,s=u):s+h>=1?(l=(e*f-1)*Math.pow(2,n),s=s+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;t[r+p]=l&255,p+=m,l/=256,n-=8);for(s=s<<n|l,c+=n;c>0;t[r+p]=s&255,p+=m,s/=256,c-=8);t[r+p-m]|=w*128}});var ni=T(Wi=>{"use strict";var kf=Sm(),qi=xm(),Tm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Wi.Buffer=A;Wi.SlowBuffer=Jx;Wi.INSPECT_MAX_BYTES=50;var zs=2147483647;Wi.kMaxLength=zs;A.TYPED_ARRAY_SUPPORT=Gx();!A.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 Gx(){try{let t=new Uint8Array(1),e={foo:a(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}a(Gx,"typedArraySupport");Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:a(function(){if(A.isBuffer(this))return this.buffer},"get")});Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:a(function(){if(A.isBuffer(this))return this.byteOffset},"get")});function or(t){if(t>zs)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,A.prototype),e}a(or,"createBuffer");function A(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Df(t)}return Pm(t,e,r)}a(A,"Buffer");A.poolSize=8192;function Pm(t,e,r){if(typeof t=="string")return Zx(t,e);if(ArrayBuffer.isView(t))return Xx(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(Ut(t,ArrayBuffer)||t&&Ut(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ut(t,SharedArrayBuffer)||t&&Ut(t.buffer,SharedArrayBuffer)))return Af(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return A.from(i,e,r);let n=Yx(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return A.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}a(Pm,"from");A.from=function(t,e,r){return Pm(t,e,r)};Object.setPrototypeOf(A.prototype,Uint8Array.prototype);Object.setPrototypeOf(A,Uint8Array);function Am(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"')}a(Am,"assertSize");function Kx(t,e,r){return Am(t),t<=0?or(t):e!==void 0?typeof r=="string"?or(t).fill(e,r):or(t).fill(e):or(t)}a(Kx,"alloc");A.alloc=function(t,e,r){return Kx(t,e,r)};function Df(t){return Am(t),or(t<0?0:Cf(t)|0)}a(Df,"allocUnsafe");A.allocUnsafe=function(t){return Df(t)};A.allocUnsafeSlow=function(t){return Df(t)};function Zx(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!A.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Im(t,e)|0,i=or(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}a(Zx,"fromString");function Pf(t){let e=t.length<0?0:Cf(t.length)|0,r=or(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}a(Pf,"fromArrayLike");function Xx(t){if(Ut(t,Uint8Array)){let e=new Uint8Array(t);return Af(e.buffer,e.byteOffset,e.byteLength)}return Pf(t)}a(Xx,"fromArrayView");function Af(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,A.prototype),i}a(Af,"fromArrayBuffer");function Yx(t){if(A.isBuffer(t)){let e=Cf(t.length)|0,r=or(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Bf(t.length)?or(0):Pf(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Pf(t.data)}a(Yx,"fromObject");function Cf(t){if(t>=zs)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+zs.toString(16)+" bytes");return t|0}a(Cf,"checked");function Jx(t){return+t!=t&&(t=0),A.alloc(+t)}a(Jx,"SlowBuffer");A.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!==A.prototype},"isBuffer");A.compare=a(function(e,r){if(Ut(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),Ut(r,Uint8Array)&&(r=A.from(r,r.offset,r.byteLength)),!A.isBuffer(e)||!A.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0},"compare");A.isEncoding=a(function(e){switch(String(e).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}},"isEncoding");A.concat=a(function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return A.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=A.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let s=e[i];if(Ut(s,Uint8Array))o+s.length>n.length?(A.isBuffer(s)||(s=A.from(s)),s.copy(n,o)):Uint8Array.prototype.set.call(n,s,o);else if(A.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return n},"concat");function Im(t,e){if(A.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ut(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 r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return If(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Um(t).length;default:if(n)return i?-1:If(t).length;e=(""+e).toLowerCase(),n=!0}}a(Im,"byteLength");A.byteLength=Im;function Qx(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return cT(this,e,r);case"utf8":case"utf-8":return Cm(this,e,r);case"ascii":return aT(this,e,r);case"latin1":case"binary":return lT(this,e,r);case"base64":return oT(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fT(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a(Qx,"slowToString");A.prototype._isBuffer=!0;function ii(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}a(ii,"swap");A.prototype.swap16=a(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)ii(this,r,r+1);return this},"swap16");A.prototype.swap32=a(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)ii(this,r,r+3),ii(this,r+1,r+2);return this},"swap32");A.prototype.swap64=a(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)ii(this,r,r+7),ii(this,r+1,r+6),ii(this,r+2,r+5),ii(this,r+3,r+4);return this},"swap64");A.prototype.toString=a(function(){let e=this.length;return e===0?"":arguments.length===0?Cm(this,0,e):Qx.apply(this,arguments)},"toString");A.prototype.toLocaleString=A.prototype.toString;A.prototype.equals=a(function(e){if(!A.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:A.compare(this,e)===0},"equals");A.prototype.inspect=a(function(){let e="",r=Wi.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Tm&&(A.prototype[Tm]=A.prototype.inspect);A.prototype.compare=a(function(e,r,i,n,o){if(Ut(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let s=o-n,l=i-r,f=Math.min(s,l),c=this.slice(n,o),u=e.slice(r,i);for(let h=0;h<f;++h)if(c[h]!==u[h]){s=c[h],l=u[h];break}return s<l?-1:l<s?1:0},"compare");function Dm(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Bf(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=A.from(e,i)),A.isBuffer(e))return e.length===0?-1:Om(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Om(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}a(Dm,"bidirectionalIndexOf");function Om(t,e,r,i,n){let o=1,s=t.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function f(u,h){return o===1?u[h]:u.readUInt16BE(h*o)}a(f,"read");let c;if(n){let u=-1;for(c=r;c<s;c++)if(f(t,c)===f(e,u===-1?0:c-u)){if(u===-1&&(u=c),c-u+1===l)return u*o}else u!==-1&&(c-=c-u),u=-1}else for(r+l>s&&(r=s-l),c=r;c>=0;c--){let u=!0;for(let h=0;h<l;h++)if(f(t,c+h)!==f(e,h)){u=!1;break}if(u)return c}return-1}a(Om,"arrayIndexOf");A.prototype.includes=a(function(e,r,i){return this.indexOf(e,r,i)!==-1},"includes");A.prototype.indexOf=a(function(e,r,i){return Dm(this,e,r,i,!0)},"indexOf");A.prototype.lastIndexOf=a(function(e,r,i){return Dm(this,e,r,i,!1)},"lastIndexOf");function eT(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let s;for(s=0;s<i;++s){let l=parseInt(e.substr(s*2,2),16);if(Bf(l))return s;t[r+s]=l}return s}a(eT,"hexWrite");function tT(t,e,r,i){return Ws(If(e,t.length-r),t,r,i)}a(tT,"utf8Write");function rT(t,e,r,i){return Ws(pT(e),t,r,i)}a(rT,"asciiWrite");function iT(t,e,r,i){return Ws(Um(e),t,r,i)}a(iT,"base64Write");function nT(t,e,r,i){return Ws(mT(e,t.length-r),t,r,i)}a(nT,"ucs2Write");A.prototype.write=a(function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return eT(this,e,r,i);case"utf8":case"utf-8":return tT(this,e,r,i);case"ascii":case"latin1":case"binary":return rT(this,e,r,i);case"base64":return iT(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nT(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write");A.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function oT(t,e,r){return e===0&&r===t.length?kf.fromByteArray(t):kf.fromByteArray(t.slice(e,r))}a(oT,"base64Slice");function Cm(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],s=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=r){let f,c,u,h;switch(l){case 1:o<128&&(s=o);break;case 2:f=t[n+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(s=h));break;case 3:f=t[n+1],c=t[n+2],(f&192)===128&&(c&192)===128&&(h=(o&15)<<12|(f&63)<<6|c&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:f=t[n+1],c=t[n+2],u=t[n+3],(f&192)===128&&(c&192)===128&&(u&192)===128&&(h=(o&15)<<18|(f&63)<<12|(c&63)<<6|u&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,l=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=l}return sT(i)}a(Cm,"utf8Slice");var Rm=4096;function sT(t){let e=t.length;if(e<=Rm)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Rm));return r}a(sT,"decodeCodePointsArray");function aT(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}a(aT,"asciiSlice");function lT(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}a(lT,"latin1Slice");function cT(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=wT[t[o]];return n}a(cT,"hexSlice");function fT(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a(fT,"utf16leSlice");A.prototype.slice=a(function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,A.prototype),n},"slice");function Ie(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}a(Ie,"checkOffset");A.prototype.readUintLE=A.prototype.readUIntLE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return n},"readUIntLE");A.prototype.readUintBE=A.prototype.readUIntBE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n},"readUIntBE");A.prototype.readUint8=A.prototype.readUInt8=a(function(e,r){return e=e>>>0,r||Ie(e,1,this.length),this[e]},"readUInt8");A.prototype.readUint16LE=A.prototype.readUInt16LE=a(function(e,r){return e=e>>>0,r||Ie(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");A.prototype.readUint16BE=A.prototype.readUInt16BE=a(function(e,r){return e=e>>>0,r||Ie(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");A.prototype.readUint32LE=A.prototype.readUInt32LE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");A.prototype.readUint32BE=A.prototype.readUInt32BE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");A.prototype.readBigUInt64LE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&co(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));A.prototype.readBigUInt64BE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&co(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));A.prototype.readIntLE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},"readIntLE");A.prototype.readIntBE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=r,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s},"readIntBE");A.prototype.readInt8=a(function(e,r){return e=e>>>0,r||Ie(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");A.prototype.readInt16LE=a(function(e,r){e=e>>>0,r||Ie(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},"readInt16LE");A.prototype.readInt16BE=a(function(e,r){e=e>>>0,r||Ie(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},"readInt16BE");A.prototype.readInt32LE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");A.prototype.readInt32BE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");A.prototype.readBigInt64LE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&co(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));A.prototype.readBigInt64BE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&co(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)},"readBigInt64BE"));A.prototype.readFloatLE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),qi.read(this,e,!0,23,4)},"readFloatLE");A.prototype.readFloatBE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),qi.read(this,e,!1,23,4)},"readFloatBE");A.prototype.readDoubleLE=a(function(e,r){return e=e>>>0,r||Ie(e,8,this.length),qi.read(this,e,!0,52,8)},"readDoubleLE");A.prototype.readDoubleBE=a(function(e,r){return e=e>>>0,r||Ie(e,8,this.length),qi.read(this,e,!1,52,8)},"readDoubleBE");function Ye(t,e,r,i,n,o){if(!A.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}a(Ye,"checkInt");A.prototype.writeUintLE=A.prototype.writeUIntLE=a(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;Ye(this,e,r,i,l,0)}let o=1,s=0;for(this[r]=e&255;++s<i&&(o*=256);)this[r+s]=e/o&255;return r+i},"writeUIntLE");A.prototype.writeUintBE=A.prototype.writeUIntBE=a(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;Ye(this,e,r,i,l,0)}let o=i-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+i},"writeUIntBE");A.prototype.writeUint8=A.prototype.writeUInt8=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,1,255,0),this[r]=e&255,r+1},"writeUInt8");A.prototype.writeUint16LE=A.prototype.writeUInt16LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeUInt16LE");A.prototype.writeUint16BE=A.prototype.writeUInt16BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeUInt16BE");A.prototype.writeUint32LE=A.prototype.writeUInt32LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},"writeUInt32LE");A.prototype.writeUint32BE=A.prototype.writeUInt32BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeUInt32BE");function Nm(t,e,r,i,n){jm(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}a(Nm,"wrtBigUInt64LE");function Bm(t,e,r,i,n){jm(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}a(Bm,"wrtBigUInt64BE");A.prototype.writeBigUInt64LE=xr(a(function(e,r=0){return Nm(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));A.prototype.writeBigUInt64BE=xr(a(function(e,r=0){return Bm(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));A.prototype.writeIntLE=a(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let f=Math.pow(2,8*i-1);Ye(this,e,r,i,f-1,-f)}let o=0,s=1,l=0;for(this[r]=e&255;++o<i&&(s*=256);)e<0&&l===0&&this[r+o-1]!==0&&(l=1),this[r+o]=(e/s>>0)-l&255;return r+i},"writeIntLE");A.prototype.writeIntBE=a(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let f=Math.pow(2,8*i-1);Ye(this,e,r,i,f-1,-f)}let o=i-1,s=1,l=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&l===0&&this[r+o+1]!==0&&(l=1),this[r+o]=(e/s>>0)-l&255;return r+i},"writeIntBE");A.prototype.writeInt8=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},"writeInt8");A.prototype.writeInt16LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeInt16LE");A.prototype.writeInt16BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeInt16BE");A.prototype.writeInt32LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},"writeInt32LE");A.prototype.writeInt32BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeInt32BE");A.prototype.writeBigInt64LE=xr(a(function(e,r=0){return Nm(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));A.prototype.writeBigInt64BE=xr(a(function(e,r=0){return Bm(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Lm(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}a(Lm,"checkIEEE754");function $m(t,e,r,i,n){return e=+e,r=r>>>0,n||Lm(t,e,r,4,34028234663852886e22,-34028234663852886e22),qi.write(t,e,r,i,23,4),r+4}a($m,"writeFloat");A.prototype.writeFloatLE=a(function(e,r,i){return $m(this,e,r,!0,i)},"writeFloatLE");A.prototype.writeFloatBE=a(function(e,r,i){return $m(this,e,r,!1,i)},"writeFloatBE");function Mm(t,e,r,i,n){return e=+e,r=r>>>0,n||Lm(t,e,r,8,17976931348623157e292,-17976931348623157e292),qi.write(t,e,r,i,52,8),r+8}a(Mm,"writeDouble");A.prototype.writeDoubleLE=a(function(e,r,i){return Mm(this,e,r,!0,i)},"writeDoubleLE");A.prototype.writeDoubleBE=a(function(e,r,i){return Mm(this,e,r,!1,i)},"writeDoubleBE");A.prototype.copy=a(function(e,r,i,n){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o},"copy");A.prototype.fill=a(function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!A.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let s=e.charCodeAt(0);(n==="utf8"&&s<128||n==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else{let s=A.isBuffer(e)?e:A.from(e,n),l=s.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=s[o%l]}return this},"fill");var Hi={};function Nf(t,e,r){var i;Hi[t]=(i=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},a(i,"NodeError"),i)}a(Nf,"E");Nf("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Nf("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Nf("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=km(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=km(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function km(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}a(km,"addNumericalSeparator");function uT(t,e,r){zi(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&co(e,t.length-(r+1))}a(uT,"checkBounds");function jm(t,e,r,i,n,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:l=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:l=`>= ${e}${s} and <= ${r}${s}`,new Hi.ERR_OUT_OF_RANGE("value",l,t)}uT(i,n,o)}a(jm,"checkIntBI");function zi(t,e){if(typeof t!="number")throw new Hi.ERR_INVALID_ARG_TYPE(e,"number",t)}a(zi,"validateNumber");function co(t,e,r){throw Math.floor(t)!==t?(zi(t,r),new Hi.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Hi.ERR_BUFFER_OUT_OF_BOUNDS:new Hi.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}a(co,"boundsError");var hT=/[^+/0-9A-Za-z-_]/g;function dT(t){if(t=t.split("=")[0],t=t.trim().replace(hT,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}a(dT,"base64clean");function If(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}a(If,"utf8ToBytes");function pT(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}a(pT,"asciiToBytes");function mT(t,e){let r,i,n,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}a(mT,"utf16leToBytes");function Um(t){return kf.toByteArray(dT(t))}a(Um,"base64ToBytes");function Ws(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}a(Ws,"blitBuffer");function Ut(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}a(Ut,"isInstance");function Bf(t){return t!==t}a(Bf,"numberIsNaN");var wT=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function xr(t){return typeof BigInt>"u"?yT:t}a(xr,"defineBigIntMethod");function yT(){throw new Error("BigInt not supported")}a(yT,"BufferBigIntNotDefined")});var Hm=T(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Buffer=void 0;var gT=ni();Object.defineProperty(Vs,"Buffer",{enumerable:!0,get:a(function(){return gT.Buffer},"get")})});var Or=T(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.bufferFrom=Tr.bufferAllocUnsafe=Tr.Buffer=void 0;var Gs=Hm();Object.defineProperty(Tr,"Buffer",{enumerable:!0,get:a(function(){return Gs.Buffer},"get")});function qm(t,...e){return new Gs.Buffer(t,...e)}a(qm,"bufferV0P12Ponyfill");var bT=Gs.Buffer.allocUnsafe||qm;Tr.bufferAllocUnsafe=bT;var vT=Gs.Buffer.from||qm;Tr.bufferFrom=vT});var $f=T(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.inherits=_T;Vi.promisify=FT;Vi.inspect=Lf;Vi.format=ET;function _T(t,e){if(t==null)throw new TypeError("The constructor to inherit from is not defined");if(e==null)throw new TypeError("The super constructor to inherit from is not defined");t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}a(_T,"inherits");function FT(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type function');return function(...e){return new Promise((r,i)=>{t.call(this,...e,(n,o)=>{n?i(n):r(o)})})}}a(FT,"promisify");function Lf(t){return t===null?"null":t===void 0?"undefined":typeof t=="string"?`'${t}'`:typeof t=="number"||typeof t=="boolean"?String(t):Array.isArray(t)?`[ ${t.map(r=>Lf(r)).join(", ")} ]`:typeof t=="object"?`{ ${Object.entries(t).map(([r,i])=>`${r}: ${Lf(i)}`).join(", ")} }`:String(t)}a(Lf,"inspect");function ET(t,...e){if(e.length===0)return t;let r=t,i=0;for(r=r.replace(/%[sdj%]/g,n=>{if(i>=e.length)return n;let o=e[i++];switch(n){case"%s":return String(o);case"%d":return Number(o).toString();case"%j":try{return JSON.stringify(o)}catch{return"[Circular]"}case"%%":return"%";default:return n}});i<e.length;)r+=" "+String(e[i++]);return r}a(ET,"format")});var fo=T(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.AssertionError=Ue.RangeError=Ue.TypeError=Ue.Error=void 0;Ue.message=Vm;Ue.E=Rr;var Mf=$f(),zm=typeof Symbol>"u"?"_kCode":Symbol("code"),Wm={};function Uf(t){var e;return e=class extends t{constructor(i,...n){super(Vm(i,n)),this.code=i,this[zm]=i,this.name=`${super.name} [${this[zm]}]`}},a(e,"NodeError"),e}a(Uf,"makeNodeError");var Ks=globalThis,Hf=class Hf extends Ks.Error{constructor(e){if(typeof e!="object"||e===null)throw new Ue.TypeError("ERR_INVALID_ARG_TYPE","options","object");e.message?super(e.message):super(`${(0,Mf.inspect)(e.actual).slice(0,128)} ${e.operator} ${(0,Mf.inspect)(e.expected).slice(0,128)}`),this.generatedMessage=!e.message,this.name="AssertionError [ERR_ASSERTION]",this.code="ERR_ASSERTION",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,Ue.Error.captureStackTrace(this,e.stackStartFunction)}};a(Hf,"AssertionError");var jf=Hf;Ue.AssertionError=jf;function Vm(t,e){if(typeof t!="string")throw new Ue.Error("Error message key must be a string");let r=Wm[t];if(!r)throw new Ue.Error(`An invalid error message key was used: ${t}.`);let i;if(typeof r=="function")i=r;else{if(i=Mf.format,e===void 0||e.length===0)return r;e.unshift(r)}return String(i.apply(null,e))}a(Vm,"message");function Rr(t,e){Wm[t]=typeof e=="function"?e:String(e)}a(Rr,"E");Ue.Error=Uf(Ks.Error);Ue.TypeError=Uf(Ks.TypeError);Ue.RangeError=Uf(Ks.RangeError);Rr("ERR_DIR_CLOSED","Directory handle was closed");Rr("ERR_DIR_CONCURRENT_OPERATION","Cannot do synchronous work on directory handle with concurrent asynchronous operations");Rr("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');Rr("ERR_INVALID_FILE_URL_PATH","File URL path %s");Rr("ERR_INVALID_OPT_VALUE",(t,e)=>`The value "${String(e)}" is invalid for option "${t}"`);Rr("ERR_INVALID_OPT_VALUE_ENCODING",t=>`The value "${String(t)}" is invalid for option "encoding"`);Rr("ERR_INVALID_ARG_VALUE","Unable to open file as blob")});var uo=T(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.ENCODING_UTF8=void 0;oi.assertEncoding=xT;oi.strToEncoding=TT;var qf=Or(),ST=fo();oi.ENCODING_UTF8="utf8";function xT(t){if(t&&!qf.Buffer.isEncoding(t))throw new ST.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",t)}a(xT,"assertEncoding");function TT(t,e){return!e||e===oi.ENCODING_UTF8?t:e==="buffer"?new qf.Buffer(t):new qf.Buffer(t).toString(e)}a(TT,"strToEncoding")});var Ys=T(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.Dirent=void 0;var OT=Pt(),RT=uo(),{S_IFMT:kT,S_IFDIR:PT,S_IFREG:AT,S_IFBLK:IT,S_IFCHR:DT,S_IFLNK:CT,S_IFIFO:NT,S_IFSOCK:BT}=OT.constants,Xs=class Xs{constructor(){this.name="",this.path="",this.parentPath="",this.mode=0}static build(e,r){let i=new Xs,{mode:n}=e.getNode();return i.name=(0,RT.strToEncoding)(e.getName(),r),i.mode=n,i.path=e.getParentPath(),i.parentPath=i.path,i}_checkModeProperty(e){return(this.mode&kT)===e}isDirectory(){return this._checkModeProperty(PT)}isFile(){return this._checkModeProperty(AT)}isBlockDevice(){return this._checkModeProperty(IT)}isCharacterDevice(){return this._checkModeProperty(DT)}isSymbolicLink(){return this._checkModeProperty(CT)}isFIFO(){return this._checkModeProperty(NT)}isSocket(){return this._checkModeProperty(BT)}};a(Xs,"Dirent");var Zs=Xs;ho.Dirent=Zs;ho.default=Zs});var Gi=T(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.basename=Se.isAbsolute=Se.normalize=Se.dirname=Se.relative=Se.join=Se.posix=Se.sep=Se.resolve=void 0;var sr=Sr();Object.defineProperty(Se,"resolve",{enumerable:!0,get:a(function(){return sr.resolve},"get")});Object.defineProperty(Se,"sep",{enumerable:!0,get:a(function(){return sr.sep},"get")});Object.defineProperty(Se,"posix",{enumerable:!0,get:a(function(){return sr.posix},"get")});Object.defineProperty(Se,"join",{enumerable:!0,get:a(function(){return sr.join},"get")});Object.defineProperty(Se,"relative",{enumerable:!0,get:a(function(){return sr.relative},"get")});Object.defineProperty(Se,"dirname",{enumerable:!0,get:a(function(){return sr.dirname},"get")});Object.defineProperty(Se,"normalize",{enumerable:!0,get:a(function(){return sr.normalize},"get")});Object.defineProperty(Se,"isAbsolute",{enumerable:!0,get:a(function(){return sr.isAbsolute},"get")});Object.defineProperty(Se,"basename",{enumerable:!0,get:a(function(){return sr.basename},"get")})});var Gf={};kx(Gf,{__addDisposableResource:()=>yw,__assign:()=>Js,__asyncDelegator:()=>cw,__asyncGenerator:()=>lw,__asyncValues:()=>fw,__await:()=>Ki,__awaiter:()=>rw,__classPrivateFieldGet:()=>pw,__classPrivateFieldIn:()=>ww,__classPrivateFieldSet:()=>mw,__createBinding:()=>ea,__decorate:()=>Zm,__disposeResources:()=>gw,__esDecorate:()=>Ym,__exportStar:()=>nw,__extends:()=>Gm,__generator:()=>iw,__importDefault:()=>dw,__importStar:()=>hw,__makeTemplateObject:()=>uw,__metadata:()=>tw,__param:()=>Xm,__propKey:()=>Qm,__read:()=>Vf,__rest:()=>Km,__rewriteRelativeImportExtension:()=>bw,__runInitializers:()=>Jm,__setFunctionName:()=>ew,__spread:()=>ow,__spreadArray:()=>aw,__spreadArrays:()=>sw,__values:()=>Qs,default:()=>MT});function Gm(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zf(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Km(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Zm(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}function Xm(t,e){return function(r,i){e(r,i,t)}}function Ym(t,e,r,i,n,o){function s(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}a(s,"accept");for(var l=i.kind,f=l==="getter"?"get":l==="setter"?"set":"value",c=!e&&t?i.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),h,d=!1,p=r.length-1;p>=0;p--){var m={};for(var w in i)m[w]=w==="access"?{}:i[w];for(var w in i.access)m.access[w]=i.access[w];m.addInitializer=function(v){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(v||null))};var y=(0,r[p])(l==="accessor"?{get:u.get,set:u.set}:u[f],m);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(h=s(y.get))&&(u.get=h),(h=s(y.set))&&(u.set=h),(h=s(y.init))&&n.unshift(h)}else(h=s(y))&&(l==="field"?n.unshift(h):u[f]=h)}c&&Object.defineProperty(c,i.name,u),d=!0}function Jm(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function Qm(t){return typeof t=="symbol"?t:"".concat(t)}function ew(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function tw(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function rw(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return a(n,"adopt"),new(r||(r=Promise))(function(o,s){function l(u){try{c(i.next(u))}catch(h){s(h)}}a(l,"fulfilled");function f(u){try{c(i.throw(u))}catch(h){s(h)}}a(f,"rejected");function c(u){u.done?o(u.value):n(u.value).then(l,f)}a(c,"step"),c((i=i.apply(t,e||[])).next())})}function iw(t,e){var r={label:0,sent:a(function(){if(o[0]&1)throw o[1];return o[1]},"sent"),trys:[],ops:[]},i,n,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(c){return function(u){return f([c,u])}}function f(c){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(o=c[0]&2?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],n=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function nw(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ea(e,t,r)}function Qs(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vf(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,o=[],s;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(l){s={error:l}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function ow(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Vf(arguments[e]));return t}function sw(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var o=arguments[e],s=0,l=o.length;s<l;s++,n++)i[n]=o[s];return i}function aw(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function Ki(t){return this instanceof Ki?(this.v=t,this):new Ki(t)}function lw(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",s),n[Symbol.asyncIterator]=function(){return this},n;function s(p){return function(m){return Promise.resolve(m).then(p,h)}}function l(p,m){i[p]&&(n[p]=function(w){return new Promise(function(y,v){o.push([p,w,y,v])>1||f(p,w)})},m&&(n[p]=m(n[p])))}function f(p,m){try{c(i[p](m))}catch(w){d(o[0][3],w)}}function c(p){p.value instanceof Ki?Promise.resolve(p.value.v).then(u,h):d(o[0][2],p)}function u(p){f("next",p)}function h(p){f("throw",p)}function d(p,m){p(m),o.shift(),o.length&&f(o[0][0],o[0][1])}}function cw(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=t[n]?function(s){return(r=!r)?{value:Ki(t[n](s)),done:!1}:o?o(s):s}:o}}function fw(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Qs=="function"?Qs(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(s){return new Promise(function(l,f){s=t[o](s),n(l,f,s.done,s.value)})}}function n(o,s,l,f){Promise.resolve(f).then(function(c){o({value:c,done:l})},s)}}function uw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function hw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Wf(t),i=0;i<r.length;i++)r[i]!=="default"&&ea(e,t,r[i]);return LT(e,t),e}function dw(t){return t&&t.__esModule?t:{default:t}}function pw(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function mw(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function ww(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function yw(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=a(function(){try{n.call(this)}catch(o){return Promise.reject(o)}},"dispose")),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function gw(t){function e(o){t.error=t.hasError?new $T(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}a(e,"fail");var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(o).then(n,function(s){return e(s),n()})}else i|=1}catch(s){e(s)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a(n,"next"),n()}function bw(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,o,s){return i?e?".jsx":".js":n&&(!o||!s)?r:n+o+"."+s.toLowerCase()+"js"}):t}var zf,Js,ea,LT,Wf,$T,MT,Kf=Rx(()=>{zf=a(function(t,e){return zf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},zf(t,e)},"extendStatics");a(Gm,"__extends");Js=a(function(){return Js=Object.assign||a(function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},"__assign"),Js.apply(this,arguments)},"__assign");a(Km,"__rest");a(Zm,"__decorate");a(Xm,"__param");a(Ym,"__esDecorate");a(Jm,"__runInitializers");a(Qm,"__propKey");a(ew,"__setFunctionName");a(tw,"__metadata");a(rw,"__awaiter");a(iw,"__generator");ea=Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]};a(nw,"__exportStar");a(Qs,"__values");a(Vf,"__read");a(ow,"__spread");a(sw,"__spreadArrays");a(aw,"__spreadArray");a(Ki,"__await");a(lw,"__asyncGenerator");a(cw,"__asyncDelegator");a(fw,"__asyncValues");a(uw,"__makeTemplateObject");LT=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Wf=a(function(t){return Wf=Object.getOwnPropertyNames||function(e){var r=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[r.length]=i);return r},Wf(t)},"ownKeys");a(hw,"__importStar");a(dw,"__importDefault");a(pw,"__classPrivateFieldGet");a(mw,"__classPrivateFieldSet");a(ww,"__classPrivateFieldIn");a(yw,"__addDisposableResource");$T=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};a(gw,"__disposeResources");a(bw,"__rewriteRelativeImportExtension");MT={__extends:Gm,__assign:Js,__rest:Km,__decorate:Zm,__param:Xm,__esDecorate:Ym,__runInitializers:Jm,__propKey:Qm,__setFunctionName:ew,__metadata:tw,__awaiter:rw,__generator:iw,__createBinding:ea,__exportStar:nw,__values:Qs,__read:Vf,__spread:ow,__spreadArrays:sw,__spreadArray:aw,__await:Ki,__asyncGenerator:lw,__asyncDelegator:cw,__asyncValues:fw,__makeTemplateObject:uw,__importStar:hw,__importDefault:dw,__classPrivateFieldGet:pw,__classPrivateFieldSet:mw,__classPrivateFieldIn:ww,__addDisposableResource:yw,__disposeResources:gw,__rewriteRelativeImportExtension:bw}});var _w=T(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0})});var Xf=T(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.flattenJSON=void 0;var Fw=Or(),Zf=Gi(),jT=Zf.posix?Zf.posix.join:Zf.join,UT=a(t=>{let e={};function r(i,n){for(let o in n){let s=n[o],l=jT(i,o);typeof s=="string"||s instanceof Fw.Buffer?e[l]=s:typeof s=="object"&&s!==null&&!(s instanceof Fw.Buffer)&&Object.keys(s).length>0?r(l,s):e[l]=null}}return a(r,"flatten"),r("",t),e},"flattenJSON");ta.flattenJSON=UT});var Qf=T(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.FanOut=void 0;var Jf=class Jf{constructor(){this.listeners=new Set}emit(e){this.listeners.forEach(r=>r(e))}listen(e){let r=this.listeners;return r.add(e),()=>r.delete(e)}};a(Jf,"FanOut");var Yf=Jf;ra.FanOut=Yf});var na=T(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.createProcess=Ew;var HT=a(()=>{if(typeof process<"u")return process;try{return Ox("process")}catch{return}},"maybeReturnProcess");function Ew(){let t=HT()||{};return t.cwd||(t.cwd=()=>"/"),t.emitWarning||(t.emitWarning=(e,r)=>{console.warn(`${r}${r?": ":""}${e}`)}),t.env||(t.env={}),t}a(Ew,"createProcess");ia.default=Ew()});var ru=T(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.Node=void 0;var qT=Qf(),xw=na(),dt=Or(),zT=Pt(),{S_IFMT:ar,S_IFDIR:WT,S_IFREG:VT,S_IFLNK:Sw,S_IFCHR:GT}=zT.constants,oa=a(()=>xw.default.getuid?.()??0,"getuid"),sa=a(()=>xw.default.getgid?.()??0,"getgid"),tu=class tu{constructor(e,r=438){this.changes=new qT.FanOut,this._uid=oa(),this._gid=sa(),this._atime=new Date,this._mtime=new Date,this._ctime=new Date,this.rdev=0,this._nlink=1,this.mode=r,this.ino=e}set ctime(e){this._ctime=e}get ctime(){return this._ctime}set uid(e){this._uid=e,this.ctime=new Date}get uid(){return this._uid}set gid(e){this._gid=e,this.ctime=new Date}get gid(){return this._gid}set atime(e){this._atime=e}get atime(){return this._atime}set mtime(e){this._mtime=e,this.ctime=new Date}get mtime(){return this._mtime}get perm(){return this.mode&~ar}set perm(e){this.mode=this.mode&ar|e&~ar,this.ctime=new Date}set nlink(e){this._nlink=e,this.ctime=new Date}get nlink(){return this._nlink}getString(e="utf8"){return this.atime=new Date,this.getBuffer().toString(e)}setString(e){this.buf=(0,dt.bufferFrom)(e,"utf8"),this.touch()}getBuffer(){return this.atime=new Date,this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),(0,dt.bufferFrom)(this.buf)}setBuffer(e){this.buf=(0,dt.bufferFrom)(e),this.touch()}getSize(){return this.buf?this.buf.length:0}setModeProperty(e){this.mode=e}isFile(){return(this.mode&ar)===VT}isDirectory(){return(this.mode&ar)===WT}isSymlink(){return(this.mode&ar)===Sw}isCharacterDevice(){return(this.mode&ar)===GT}makeSymlink(e){this.mode=Sw|438,this.symlink=e}write(e,r=0,i=e.length,n=0){if(this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),n+i>this.buf.length){let o=(0,dt.bufferAllocUnsafe)(n+i);this.buf.copy(o,0,0,this.buf.length),this.buf=o}return e.copy(this.buf,n,r,r+i),this.touch(),i}read(e,r=0,i=e.byteLength,n=0){if(this.atime=new Date,this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),n>=this.buf.length)return 0;let o=i;o>e.byteLength&&(o=e.byteLength),o+n>this.buf.length&&(o=this.buf.length-n);let s=e instanceof dt.Buffer?e:dt.Buffer.from(e.buffer,e.byteOffset,e.byteLength);return this.buf.copy(s,r,n,n+o),o}truncate(e=0){if(!e)this.buf=(0,dt.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),e<=this.buf.length)this.buf=this.buf.slice(0,e);else{let r=(0,dt.bufferAllocUnsafe)(e);this.buf.copy(r),r.fill(0,this.buf.length),this.buf=r}this.touch()}chmod(e){this.mode=this.mode&ar|e&~ar,this.touch()}chown(e,r){this.uid=e,this.gid=r,this.touch()}touch(){this.mtime=new Date,this.changes.emit(["modify"])}canRead(e=oa(),r=sa()){return!!(this.perm&4||r===this.gid&&this.perm&32||e===this.uid&&this.perm&256)}canWrite(e=oa(),r=sa()){return!!(this.perm&2||r===this.gid&&this.perm&16||e===this.uid&&this.perm&128)}canExecute(e=oa(),r=sa()){return!!(this.perm&1||r===this.gid&&this.perm&8||e===this.uid&&this.perm&64)}del(){this.changes.emit(["delete"])}toJSON(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}}};a(tu,"Node");var eu=tu;aa.Node=eu});var nu=T(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.Link=void 0;var KT=Pt(),ZT=Qf(),{S_IFREG:XT}=KT.constants,po=class po{get steps(){return this._steps}set steps(e){this._steps=e;for(let[r,i]of this.children.entries())r==="."||r===".."||i?.syncSteps()}constructor(e,r,i){this.changes=new ZT.FanOut,this.children=new Map,this._steps=[],this.ino=0,this.length=0,this.vol=e,this.parent=r,this.name=i,this.syncSteps()}setNode(e){this.node=e,this.ino=e.ino}getNode(){return this.node}createChild(e,r=this.vol.createNode(XT|438)){let i=new po(this.vol,this,e);return i.setNode(r),r.isDirectory()&&(i.children.set(".",i),i.getNode().nlink++),this.setChild(e,i),i}setChild(e,r=new po(this.vol,this,e)){return this.children.set(e,r),r.parent=this,this.length++,r.getNode().isDirectory()&&(r.children.set("..",this),this.getNode().nlink++),this.getNode().mtime=new Date,this.changes.emit(["child:add",r,this]),r}deleteChild(e){e.getNode().isDirectory()&&(e.children.delete(".."),this.getNode().nlink--),this.children.delete(e.getName()),this.length--,this.getNode().mtime=new Date,this.changes.emit(["child:del",e,this])}getChild(e){return this.getNode().atime=new Date,this.children.get(e)}getPath(){return this.steps.join("/")}getParentPath(){return this.steps.slice(0,-1).join("/")}getName(){return this.steps[this.steps.length-1]}toJSON(){return{steps:this.steps,ino:this.ino,children:Array.from(this.children.keys())}}syncSteps(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]}};a(po,"Link");var iu=po;la.Link=iu});var au=T(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.File=void 0;var YT=Pt(),{O_APPEND:JT}=YT.constants,su=class su{constructor(e,r,i,n){this.link=e,this.node=r,this.flags=i,this.fd=n,this.position=0,this.flags&JT&&(this.position=this.getSize())}getString(e="utf8"){return this.node.getString()}setString(e){this.node.setString(e)}getBuffer(){return this.node.getBuffer()}setBuffer(e){this.node.setBuffer(e)}getSize(){return this.node.getSize()}truncate(e){this.node.truncate(e)}seekTo(e){this.position=e}write(e,r=0,i=e.length,n){typeof n!="number"&&(n=this.position);let o=this.node.write(e,r,i,n);return this.position=n+o,o}read(e,r=0,i=e.byteLength,n){typeof n!="number"&&(n=this.position);let o=this.node.read(e,r,i,n);return this.position=n+o,o}chmod(e){this.node.chmod(e)}chown(e,r){this.node.chown(e,r)}};a(su,"File");var ou=su;ca.File=ou});var Yi=T(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.FLAGS=Xi.ERRSTR=void 0;var QT=Pt();Xi.ERRSTR={PATH_STR:"path must be a string, Buffer, or Uint8Array",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};var{O_RDONLY:Tw,O_WRONLY:fa,O_RDWR:Zi,O_CREAT:kr,O_EXCL:ua,O_TRUNC:ha,O_APPEND:da,O_SYNC:Ow}=QT.constants,Rw;(function(t){t[t.r=Tw]="r",t[t["r+"]=Zi]="r+",t[t.rs=Tw|Ow]="rs",t[t.sr=t.rs]="sr",t[t["rs+"]=Zi|Ow]="rs+",t[t["sr+"]=t["rs+"]]="sr+",t[t.w=fa|kr|ha]="w",t[t.wx=fa|kr|ha|ua]="wx",t[t.xw=t.wx]="xw",t[t["w+"]=Zi|kr|ha]="w+",t[t["wx+"]=Zi|kr|ha|ua]="wx+",t[t["xw+"]=t["wx+"]]="xw+",t[t.a=fa|da|kr]="a",t[t.ax=fa|da|kr|ua]="ax",t[t.xa=t.ax]="xa",t[t["a+"]=Zi|da|kr]="a+",t[t["ax+"]=Zi|da|kr|ua]="ax+",t[t["xa+"]=t["ax+"]]="xa+"})(Rw||(Xi.FLAGS=Rw={}))});var cu=T(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.default=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(()=>t()).catch(()=>{})});var ya=T(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.filenameToSteps=De.resolve=De.unixify=De.isWin=void 0;De.isFd=Pw;De.validateFd=cO;De.dataToBuffer=fO;var ma=Gi(),pa=Or(),kw=na(),eO=uo(),tO=Yi();De.isWin=kw.default.platform==="win32";var rO=ma.resolve,iO=ma.posix?ma.posix.sep:ma.sep,nO=a((t,e)=>{let r=t[e];return e>0&&(r==="/"||De.isWin&&r==="\\")},"isSeparator"),oO=a(t=>{let e=t.length-1;if(e<2)return t;for(;nO(t,e);)e--;return t.substr(0,e+1)},"removeTrailingSeparator"),sO=a((t,e)=>{if(typeof t!="string")throw new TypeError("expected a string");return t=t.replace(/[\\\/]+/g,"/"),e!==!1&&(t=oO(t)),t},"normalizePath"),aO=a((t,e=!0)=>De.isWin?(t=sO(t,e),t.replace(/^([a-zA-Z]+:|\.\/)/,"")):t,"unixify");De.unixify=aO;var wa=a((t,e=kw.default.cwd())=>rO(e,t),"resolve");De.resolve=wa;if(De.isWin){let t=wa;De.resolve=wa=a((e,r)=>(0,De.unixify)(t(e,r)),"resolve")}var lO=a((t,e)=>{let i=wa(t,e).substring(1);return i?i.split(iO):[]},"filenameToSteps");De.filenameToSteps=lO;function Pw(t){return t>>>0===t}a(Pw,"isFd");function cO(t){if(!Pw(t))throw TypeError(tO.ERRSTR.FD)}a(cO,"validateFd");function fO(t,e=eO.ENCODING_UTF8){return pa.Buffer.isBuffer(t)?t:t instanceof Uint8Array?(0,pa.bufferFrom)(t):e==="buffer"?(0,pa.bufferFrom)(String(t),"utf8"):(0,pa.bufferFrom)(String(t),e)}a(fO,"dataToBuffer")});var Aw=T((Ji,Qi)=>{(function(t){var e=typeof Ji=="object"&&Ji&&!Ji.nodeType&&Ji,r=typeof Qi=="object"&&Qi&&!Qi.nodeType&&Qi,i=typeof globalThis=="object"&&globalThis;(i.global===i||i.window===i||i.self===i)&&(t=i);var n,o=2147483647,s=36,l=1,f=26,c=38,u=700,h=72,d=128,p="-",m=/^xn--/,w=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=s-l,F=Math.floor,O=String.fromCharCode,S;function R($){throw new RangeError(v[$])}a(R,"error");function b($,q){for(var G=$.length,X=[];G--;)X[G]=q($[G]);return X}a(b,"map");function x($,q){var G=$.split("@"),X="";G.length>1&&(X=G[0]+"@",$=G[1]),$=$.replace(y,".");var z=$.split("."),fe=b(z,q).join(".");return X+fe}a(x,"mapDomain");function _($){for(var q=[],G=0,X=$.length,z,fe;G<X;)z=$.charCodeAt(G++),z>=55296&&z<=56319&&G<X?(fe=$.charCodeAt(G++),(fe&64512)==56320?q.push(((z&1023)<<10)+(fe&1023)+65536):(q.push(z),G--)):q.push(z);return q}a(_,"ucs2decode");function P($){return b($,function(q){var G="";return q>65535&&(q-=65536,G+=O(q>>>10&1023|55296),q=56320|q&1023),G+=O(q),G}).join("")}a(P,"ucs2encode");function k($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:s}a(k,"basicToDigit");function C($,q){return $+22+75*($<26)-((q!=0)<<5)}a(C,"digitToBasic");function N($,q,G){var X=0;for($=G?F($/u):$>>1,$+=F($/q);$>g*f>>1;X+=s)$=F($/g);return F(X+(g+1)*$/($+c))}a(N,"adapt");function U($){var q=[],G=$.length,X,z=0,fe=d,ee=h,Oe,Re,se,Rt,ve,Ve,Be,Y,he;for(Oe=$.lastIndexOf(p),Oe<0&&(Oe=0),Re=0;Re<Oe;++Re)$.charCodeAt(Re)>=128&&R("not-basic"),q.push($.charCodeAt(Re));for(se=Oe>0?Oe+1:0;se<G;){for(Rt=z,ve=1,Ve=s;se>=G&&R("invalid-input"),Be=k($.charCodeAt(se++)),(Be>=s||Be>F((o-z)/ve))&&R("overflow"),z+=Be*ve,Y=Ve<=ee?l:Ve>=ee+f?f:Ve-ee,!(Be<Y);Ve+=s)he=s-Y,ve>F(o/he)&&R("overflow"),ve*=he;X=q.length+1,ee=N(z-Rt,X,Rt==0),F(z/X)>o-fe&&R("overflow"),fe+=F(z/X),z%=X,q.splice(z++,0,fe)}return P(q)}a(U,"decode");function Z($){var q,G,X,z,fe,ee,Oe,Re,se,Rt,ve,Ve=[],Be,Y,he,je;for($=_($),Be=$.length,q=d,G=0,fe=h,ee=0;ee<Be;++ee)ve=$[ee],ve<128&&Ve.push(O(ve));for(X=z=Ve.length,z&&Ve.push(p);X<Be;){for(Oe=o,ee=0;ee<Be;++ee)ve=$[ee],ve>=q&&ve<Oe&&(Oe=ve);for(Y=X+1,Oe-q>F((o-G)/Y)&&R("overflow"),G+=(Oe-q)*Y,q=Oe,ee=0;ee<Be;++ee)if(ve=$[ee],ve<q&&++G>o&&R("overflow"),ve==q){for(Re=G,se=s;Rt=se<=fe?l:se>=fe+f?f:se-fe,!(Re<Rt);se+=s)je=Re-Rt,he=s-Rt,Ve.push(O(C(Rt+je%he,0))),Re=F(je/he);Ve.push(O(C(Re,0))),fe=N(G,Y,X==z),G=0,++X}++G,++q}return Ve.join("")}a(Z,"encode");function me($){return x($,function(q){return m.test(q)?U(q.slice(4).toLowerCase()):q})}a(me,"toUnicode");function Ee($){return x($,function(q){return w.test(q)?"xn--"+Z(q):q})}if(a(Ee,"toASCII"),n={version:"1.4.1",ucs2:{decode:_,encode:P},decode:U,encode:Z,toASCII:Ee,toUnicode:me},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return n});else if(e&&r)if(Qi.exports==e)r.exports=n;else for(S in n)n.hasOwnProperty(S)&&(e[S]=n[S]);else t.punycode=n})(Ji)});var Ht=T((S8,Iw)=>{"use strict";Iw.exports=TypeError});var Dw=T(()=>{});var bo=T((O8,Qw)=>{var bu=typeof Map=="function"&&Map.prototype,fu=Object.getOwnPropertyDescriptor&&bu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ba=bu&&fu&&typeof fu.get=="function"?fu.get:null,Cw=bu&&Map.prototype.forEach,vu=typeof Set=="function"&&Set.prototype,uu=Object.getOwnPropertyDescriptor&&vu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,va=vu&&uu&&typeof uu.get=="function"?uu.get:null,Nw=vu&&Set.prototype.forEach,uO=typeof WeakMap=="function"&&WeakMap.prototype,wo=uO?WeakMap.prototype.has:null,hO=typeof WeakSet=="function"&&WeakSet.prototype,yo=hO?WeakSet.prototype.has:null,dO=typeof WeakRef=="function"&&WeakRef.prototype,Bw=dO?WeakRef.prototype.deref:null,pO=Boolean.prototype.valueOf,mO=Object.prototype.toString,wO=Function.prototype.toString,yO=String.prototype.match,_u=String.prototype.slice,Pr=String.prototype.replace,gO=String.prototype.toUpperCase,Lw=String.prototype.toLowerCase,Vw=RegExp.prototype.test,$w=Array.prototype.concat,qt=Array.prototype.join,bO=Array.prototype.slice,Mw=Math.floor,pu=typeof BigInt=="function"?BigInt.prototype.valueOf:null,hu=Object.getOwnPropertySymbols,mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,en=typeof Symbol=="function"&&typeof Symbol.iterator=="object",go=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===en||!0)?Symbol.toStringTag:null,Gw=Object.prototype.propertyIsEnumerable,jw=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Uw(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Vw.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-Mw(-t):Mw(t);if(i!==t){var n=String(i),o=_u.call(e,n.length+1);return Pr.call(n,r,"$&_")+"."+Pr.call(Pr.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Pr.call(e,r,"$&_")}a(Uw,"addNumericSeparator");var wu=Dw(),Hw=wu.custom,qw=Xw(Hw)?Hw:null,Kw={__proto__:null,double:'"',single:"'"},vO={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Qw.exports=a(function t(e,r,i,n){var o=r||{};if(lr(o,"quoteStyle")&&!lr(Kw,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(lr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=lr(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(lr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(lr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Jw(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return l?Uw(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return l?Uw(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof e=="object")return yu(e)?"[Array]":"[Object]";var h=$O(o,i);if(typeof n>"u")n=[];else if(Yw(n,e)>=0)return"[Circular]";function d(N,U,Z){if(U&&(n=bO.call(n),n.push(U)),Z){var me={depth:o.depth};return lr(o,"quoteStyle")&&(me.quoteStyle=o.quoteStyle),t(N,me,i+1,n)}return t(N,o,i+1,n)}if(a(d,"inspect"),typeof e=="function"&&!zw(e)){var p=kO(e),m=ga(e,d);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(m.length>0?" { "+qt.call(m,", ")+" }":"")}if(Xw(e)){var w=en?Pr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):mu.call(e);return typeof e=="object"&&!en?mo(w):w}if(NO(e)){for(var y="<"+Lw.call(String(e.nodeName)),v=e.attributes||[],g=0;g<v.length;g++)y+=" "+v[g].name+"="+Zw(_O(v[g].value),"double",o);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+Lw.call(String(e.nodeName))+">",y}if(yu(e)){if(e.length===0)return"[]";var F=ga(e,d);return h&&!LO(F)?"["+gu(F,h)+"]":"[ "+qt.call(F,", ")+" ]"}if(EO(e)){var O=ga(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!Gw.call(e,"cause")?"{ ["+String(e)+"] "+qt.call($w.call("[cause]: "+d(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+qt.call(O,", ")+" }"}if(typeof e=="object"&&s){if(qw&&typeof e[qw]=="function"&&wu)return wu(e,{depth:u-i});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(PO(e)){var S=[];return Cw&&Cw.call(e,function(N,U){S.push(d(U,e,!0)+" => "+d(N,e))}),Ww("Map",ba.call(e),S,h)}if(DO(e)){var R=[];return Nw&&Nw.call(e,function(N){R.push(d(N,e))}),Ww("Set",va.call(e),R,h)}if(AO(e))return du("WeakMap");if(CO(e))return du("WeakSet");if(IO(e))return du("WeakRef");if(xO(e))return mo(d(Number(e)));if(OO(e))return mo(d(pu.call(e)));if(TO(e))return mo(pO.call(e));if(SO(e))return mo(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof globalThis<"u"&&e===globalThis)return"{ [object globalThis] }";if(!FO(e)&&!zw(e)){var b=ga(e,d),x=jw?jw(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",P=!x&&go&&Object(e)===e&&go in e?_u.call(Ar(e),8,-1):_?"Object":"",k=x||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",C=k+(P||_?"["+qt.call($w.call([],P||[],_||[]),": ")+"] ":"");return b.length===0?C+"{}":h?C+"{"+gu(b,h)+"}":C+"{ "+qt.call(b,", ")+" }"}return String(e)},"inspect_");function Zw(t,e,r){var i=r.quoteStyle||e,n=Kw[i];return n+t+n}a(Zw,"wrapQuotes");function _O(t){return Pr.call(String(t),/"/g,""")}a(_O,"quote");function si(t){return!go||!(typeof t=="object"&&(go in t||typeof t[go]<"u"))}a(si,"canTrustToString");function yu(t){return Ar(t)==="[object Array]"&&si(t)}a(yu,"isArray");function FO(t){return Ar(t)==="[object Date]"&&si(t)}a(FO,"isDate");function zw(t){return Ar(t)==="[object RegExp]"&&si(t)}a(zw,"isRegExp");function EO(t){return Ar(t)==="[object Error]"&&si(t)}a(EO,"isError");function SO(t){return Ar(t)==="[object String]"&&si(t)}a(SO,"isString");function xO(t){return Ar(t)==="[object Number]"&&si(t)}a(xO,"isNumber");function TO(t){return Ar(t)==="[object Boolean]"&&si(t)}a(TO,"isBoolean");function Xw(t){if(en)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!mu)return!1;try{return mu.call(t),!0}catch{}return!1}a(Xw,"isSymbol");function OO(t){if(!t||typeof t!="object"||!pu)return!1;try{return pu.call(t),!0}catch{}return!1}a(OO,"isBigInt");var RO=Object.prototype.hasOwnProperty||function(t){return t in this};function lr(t,e){return RO.call(t,e)}a(lr,"has");function Ar(t){return mO.call(t)}a(Ar,"toStr");function kO(t){if(t.name)return t.name;var e=yO.call(wO.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}a(kO,"nameOf");function Yw(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}a(Yw,"indexOf");function PO(t){if(!ba||!t||typeof t!="object")return!1;try{ba.call(t);try{va.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}a(PO,"isMap");function AO(t){if(!wo||!t||typeof t!="object")return!1;try{wo.call(t,wo);try{yo.call(t,yo)}catch{return!0}return t instanceof WeakMap}catch{}return!1}a(AO,"isWeakMap");function IO(t){if(!Bw||!t||typeof t!="object")return!1;try{return Bw.call(t),!0}catch{}return!1}a(IO,"isWeakRef");function DO(t){if(!va||!t||typeof t!="object")return!1;try{va.call(t);try{ba.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}a(DO,"isSet");function CO(t){if(!yo||!t||typeof t!="object")return!1;try{yo.call(t,yo);try{wo.call(t,wo)}catch{return!0}return t instanceof WeakSet}catch{}return!1}a(CO,"isWeakSet");function NO(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}a(NO,"isElement");function Jw(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return Jw(_u.call(t,0,e.maxStringLength),e)+i}var n=vO[e.quoteStyle||"single"];n.lastIndex=0;var o=Pr.call(Pr.call(t,n,"\\$1"),/[\x00-\x1f]/g,BO);return Zw(o,"single",e)}a(Jw,"inspectString");function BO(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+gO.call(e.toString(16))}a(BO,"lowbyte");function mo(t){return"Object("+t+")"}a(mo,"markBoxed");function du(t){return t+" { ? }"}a(du,"weakCollectionOf");function Ww(t,e,r,i){var n=i?gu(r,i):qt.call(r,", ");return t+" ("+e+") {"+n+"}"}a(Ww,"collectionOf");function LO(t){for(var e=0;e<t.length;e++)if(Yw(t[e],`
|
|
5
|
-
`)>=0)return!1;return!0}a(
|
|
6
|
-
`+e.prev+e.base;return r+
|
|
7
|
-
`+e.prev}a(gu,"indentedJoin");function ga(t,e){var r=yu(t),i=[];if(r){i.length=t.length;for(var n=0;n<t.length;n++)i[n]=lr(t,n)?e(t[n],t):""}var o=typeof hu=="function"?hu(t):[],s;if(en){s={};for(var l=0;l<o.length;l++)s["$"+o[l]]=o[l]}for(var f in t)lr(t,f)&&(r&&String(Number(f))===f&&f<t.length||en&&s["$"+f]instanceof Symbol||(Vw.call(/[^\w$]/,f)?i.push(e(f,t)+": "+e(t[f],t)):i.push(f+": "+e(t[f],t))));if(typeof hu=="function")for(var c=0;c<o.length;c++)Gw.call(t,o[c])&&i.push("["+e(o[c])+"]: "+e(t[o[c]],t));return i}a(ga,"arrObjKeys")});var ty=T((k8,ey)=>{"use strict";var MO=bo(),jO=Ht(),_a=a(function(t,e,r){for(var i=t,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,r||(n.next=t.next,t.next=n),n},"listGetNode"),UO=a(function(t,e){if(t){var r=_a(t,e);return r&&r.value}},"listGet"),HO=a(function(t,e,r){var i=_a(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),qO=a(function(t,e){return t?!!_a(t,e):!1},"listHas"),zO=a(function(t,e){if(t)return _a(t,e,!0)},"listDelete");ey.exports=a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new jO("Side channel does not contain "+MO(i))},"assert"),delete:a(function(i){var n=e&&e.next,o=zO(e,i);return o&&n&&n===o&&(e=void 0),!!o},"delete"),get:a(function(i){return UO(e,i)},"get"),has:a(function(i){return qO(e,i)},"has"),set:a(function(i,n){e||(e={next:void 0}),HO(e,i,n)},"set")};return r},"getSideChannelList")});var Fu=T((A8,ry)=>{"use strict";ry.exports=Object});var ny=T((I8,iy)=>{"use strict";iy.exports=Error});var sy=T((D8,oy)=>{"use strict";oy.exports=EvalError});var ly=T((C8,ay)=>{"use strict";ay.exports=RangeError});var fy=T((N8,cy)=>{"use strict";cy.exports=ReferenceError});var Eu=T((B8,uy)=>{"use strict";uy.exports=SyntaxError});var dy=T((L8,hy)=>{"use strict";hy.exports=URIError});var my=T(($8,py)=>{"use strict";py.exports=Math.abs});var yy=T((M8,wy)=>{"use strict";wy.exports=Math.floor});var by=T((j8,gy)=>{"use strict";gy.exports=Math.max});var _y=T((U8,vy)=>{"use strict";vy.exports=Math.min});var Ey=T((H8,Fy)=>{"use strict";Fy.exports=Math.pow});var xy=T((q8,Sy)=>{"use strict";Sy.exports=Math.round});var Oy=T((z8,Ty)=>{"use strict";Ty.exports=Number.isNaN||a(function(e){return e!==e},"isNaN")});var ky=T((V8,Ry)=>{"use strict";var WO=Oy();Ry.exports=a(function(e){return WO(e)||e===0?e:e<0?-1:1},"sign")});var Ay=T((K8,Py)=>{"use strict";Py.exports=Object.getOwnPropertyDescriptor});var tn=T((Z8,Iy)=>{"use strict";var Fa=Ay();if(Fa)try{Fa([],"length")}catch{Fa=null}Iy.exports=Fa});var vo=T((X8,Dy)=>{"use strict";var Ea=Object.defineProperty||!1;if(Ea)try{Ea({},"a",{value:1})}catch{Ea=!1}Dy.exports=Ea});var Su=T((Y8,Cy)=>{"use strict";Cy.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,r);if(l.value!==n||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ly=T((Q8,By)=>{"use strict";var Ny=typeof Symbol<"u"&&Symbol,VO=Su();By.exports=a(function(){return typeof Ny!="function"||typeof Symbol!="function"||typeof Ny("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:VO()},"hasNativeSymbols")});var xu=T((tj,$y)=>{"use strict";$y.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Tu=T((rj,My)=>{"use strict";var GO=Fu();My.exports=GO.getPrototypeOf||null});var Hy=T((ij,Uy)=>{"use strict";var KO="Function.prototype.bind called on incompatible ",ZO=Object.prototype.toString,XO=Math.max,YO="[object Function]",jy=a(function(e,r){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<r.length;o+=1)i[o+e.length]=r[o];return i},"concatty"),JO=a(function(e,r){for(var i=[],n=r||0,o=0;n<e.length;n+=1,o+=1)i[o]=e[n];return i},"slicy"),QO=a(function(t,e){for(var r="",i=0;i<t.length;i+=1)r+=t[i],i+1<t.length&&(r+=e);return r},"joiny");Uy.exports=a(function(e){var r=this;if(typeof r!="function"||ZO.apply(r)!==YO)throw new TypeError(KO+r);for(var i=JO(arguments,1),n,o=a(function(){if(this instanceof n){var u=r.apply(this,jy(i,arguments));return Object(u)===u?u:this}return r.apply(e,jy(i,arguments))},"binder"),s=XO(0,r.length-i.length),l=[],f=0;f<s;f++)l[f]="$"+f;if(n=Function("binder","return function ("+QO(l,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=a(function(){},"Empty");c.prototype=r.prototype,n.prototype=new c,c.prototype=null}return n},"bind")});var rn=T((oj,qy)=>{"use strict";var eR=Hy();qy.exports=Function.prototype.bind||eR});var Sa=T((sj,zy)=>{"use strict";zy.exports=Function.prototype.call});var xa=T((aj,Wy)=>{"use strict";Wy.exports=Function.prototype.apply});var Gy=T((lj,Vy)=>{"use strict";Vy.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ou=T((cj,Ky)=>{"use strict";var tR=rn(),rR=xa(),iR=Sa(),nR=Gy();Ky.exports=nR||tR.call(iR,rR)});var Ta=T((fj,Zy)=>{"use strict";var oR=rn(),sR=Ht(),aR=Sa(),lR=Ou();Zy.exports=a(function(e){if(e.length<1||typeof e[0]!="function")throw new sR("a function is required");return lR(oR,aR,e)},"callBindBasic")});var t0=T((hj,e0)=>{"use strict";var cR=Ta(),Xy=tn(),Jy;try{Jy=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ru=!!Jy&&Xy&&Xy(Object.prototype,"__proto__"),Qy=Object,Yy=Qy.getPrototypeOf;e0.exports=Ru&&typeof Ru.get=="function"?cR([Ru.get]):typeof Yy=="function"?a(function(e){return Yy(e==null?e:Qy(e))},"getDunder"):!1});var ku=T((pj,o0)=>{"use strict";var r0=xu(),i0=Tu(),n0=t0();o0.exports=r0?a(function(e){return r0(e)},"getProto"):i0?a(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return i0(e)},"getProto"):n0?a(function(e){return n0(e)},"getProto"):null});var a0=T((wj,s0)=>{"use strict";var fR=Function.prototype.call,uR=Object.prototype.hasOwnProperty,hR=rn();s0.exports=hR.call(fR,uR)});var So=T((yj,d0)=>{"use strict";var J,dR=Fu(),pR=ny(),mR=sy(),wR=ly(),yR=fy(),an=Eu(),sn=Ht(),gR=dy(),bR=my(),vR=yy(),_R=by(),FR=_y(),ER=Ey(),SR=xy(),xR=ky(),u0=Function,Pu=a(function(t){try{return u0('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),_o=tn(),TR=vo(),Au=a(function(){throw new sn},"throwTypeError"),OR=_o?function(){try{return arguments.callee,Au}catch{try{return _o(arguments,"callee").get}catch{return Au}}}():Au,nn=Ly()(),Ce=ku(),RR=Tu(),kR=xu(),h0=xa(),Fo=Sa(),on={},PR=typeof Uint8Array>"u"||!Ce?J:Ce(Uint8Array),ai={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?J:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?J:ArrayBuffer,"%ArrayIteratorPrototype%":nn&&Ce?Ce([][Symbol.iterator]()):J,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":on,"%AsyncGenerator%":on,"%AsyncGeneratorFunction%":on,"%AsyncIteratorPrototype%":on,"%Atomics%":typeof Atomics>"u"?J:Atomics,"%BigInt%":typeof BigInt>"u"?J:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?J:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?J:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?J:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":pR,"%eval%":eval,"%EvalError%":mR,"%Float16Array%":typeof Float16Array>"u"?J:Float16Array,"%Float32Array%":typeof Float32Array>"u"?J:Float32Array,"%Float64Array%":typeof Float64Array>"u"?J:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?J:FinalizationRegistry,"%Function%":u0,"%GeneratorFunction%":on,"%Int8Array%":typeof Int8Array>"u"?J:Int8Array,"%Int16Array%":typeof Int16Array>"u"?J:Int16Array,"%Int32Array%":typeof Int32Array>"u"?J:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nn&&Ce?Ce(Ce([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%Map%":typeof Map>"u"?J:Map,"%MapIteratorPrototype%":typeof Map>"u"||!nn||!Ce?J:Ce(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":dR,"%Object.getOwnPropertyDescriptor%":_o,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?J:Promise,"%Proxy%":typeof Proxy>"u"?J:Proxy,"%RangeError%":wR,"%ReferenceError%":yR,"%Reflect%":typeof Reflect>"u"?J:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?J:Set,"%SetIteratorPrototype%":typeof Set>"u"||!nn||!Ce?J:Ce(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?J:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nn&&Ce?Ce(""[Symbol.iterator]()):J,"%Symbol%":nn?Symbol:J,"%SyntaxError%":an,"%ThrowTypeError%":OR,"%TypedArray%":PR,"%TypeError%":sn,"%Uint8Array%":typeof Uint8Array>"u"?J:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?J:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?J:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?J:Uint32Array,"%URIError%":gR,"%WeakMap%":typeof WeakMap>"u"?J:WeakMap,"%WeakRef%":typeof WeakRef>"u"?J:WeakRef,"%WeakSet%":typeof WeakSet>"u"?J:WeakSet,"%Function.prototype.call%":Fo,"%Function.prototype.apply%":h0,"%Object.defineProperty%":TR,"%Object.getPrototypeOf%":RR,"%Math.abs%":bR,"%Math.floor%":vR,"%Math.max%":_R,"%Math.min%":FR,"%Math.pow%":ER,"%Math.round%":SR,"%Math.sign%":xR,"%Reflect.getPrototypeOf%":kR};if(Ce)try{null.error}catch(t){l0=Ce(Ce(t)),ai["%Error.prototype%"]=l0}var l0,AR=a(function t(e){var r;if(e==="%AsyncFunction%")r=Pu("async function () {}");else if(e==="%GeneratorFunction%")r=Pu("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Pu("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Ce&&(r=Ce(n.prototype))}return ai[e]=r,r},"doEval"),c0={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Eo=rn(),Oa=a0(),IR=Eo.call(Fo,Array.prototype.concat),DR=Eo.call(h0,Array.prototype.splice),f0=Eo.call(Fo,String.prototype.replace),Ra=Eo.call(Fo,String.prototype.slice),CR=Eo.call(Fo,RegExp.prototype.exec),NR=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,BR=/\\(\\)?/g,LR=a(function(e){var r=Ra(e,0,1),i=Ra(e,-1);if(r==="%"&&i!=="%")throw new an("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new an("invalid intrinsic syntax, expected opening `%`");var n=[];return f0(e,NR,function(o,s,l,f){n[n.length]=l?f0(f,BR,"$1"):s||o}),n},"stringToPath"),$R=a(function(e,r){var i=e,n;if(Oa(c0,i)&&(n=c0[i],i="%"+n[0]+"%"),Oa(ai,i)){var o=ai[i];if(o===on&&(o=AR(i)),typeof o>"u"&&!r)throw new sn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new an("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");d0.exports=a(function(e,r){if(typeof e!="string"||e.length===0)throw new sn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new sn('"allowMissing" argument must be a boolean');if(CR(/^%?[^%]*%?$/,e)===null)throw new an("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=LR(e),n=i.length>0?i[0]:"",o=$R("%"+n+"%",r),s=o.name,l=o.value,f=!1,c=o.alias;c&&(n=c[0],DR(i,IR([0,1],c)));for(var u=1,h=!0;u<i.length;u+=1){var d=i[u],p=Ra(d,0,1),m=Ra(d,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new an("property names with quotes must have matching quotes");if((d==="constructor"||!h)&&(f=!0),n+="."+d,s="%"+n+"%",Oa(ai,s))l=ai[s];else if(l!=null){if(!(d in l)){if(!r)throw new sn("base intrinsic for "+e+" exists, but the property is not available.");return}if(_o&&u+1>=i.length){var w=_o(l,d);h=!!w,h&&"get"in w&&!("originalValue"in w.get)?l=w.get:l=l[d]}else h=Oa(l,d),l=l[d];h&&!f&&(ai[s]=l)}}return l},"GetIntrinsic")});var xo=T((bj,w0)=>{"use strict";var p0=So(),m0=Ta(),MR=m0([p0("%String.prototype.indexOf%")]);w0.exports=a(function(e,r){var i=p0(e,!!r);return typeof i=="function"&&MR(e,".prototype.")>-1?m0([i]):i},"callBoundIntrinsic")});var Iu=T((_j,g0)=>{"use strict";var jR=So(),To=xo(),UR=bo(),HR=Ht(),y0=jR("%Map%",!0),qR=To("Map.prototype.get",!0),zR=To("Map.prototype.set",!0),WR=To("Map.prototype.has",!0),VR=To("Map.prototype.delete",!0),GR=To("Map.prototype.size",!0);g0.exports=!!y0&&a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new HR("Side channel does not contain "+UR(i))},"assert"),delete:a(function(i){if(e){var n=VR(e,i);return GR(e)===0&&(e=void 0),n}return!1},"delete"),get:a(function(i){if(e)return qR(e,i)},"get"),has:a(function(i){return e?WR(e,i):!1},"has"),set:a(function(i,n){e||(e=new y0),zR(e,i,n)},"set")};return r},"getSideChannelMap")});var v0=T((Ej,b0)=>{"use strict";var KR=So(),Pa=xo(),ZR=bo(),ka=Iu(),XR=Ht(),ln=KR("%WeakMap%",!0),YR=Pa("WeakMap.prototype.get",!0),JR=Pa("WeakMap.prototype.set",!0),QR=Pa("WeakMap.prototype.has",!0),ek=Pa("WeakMap.prototype.delete",!0);b0.exports=ln?a(function(){var e,r,i={assert:a(function(n){if(!i.has(n))throw new XR("Side channel does not contain "+ZR(n))},"assert"),delete:a(function(n){if(ln&&n&&(typeof n=="object"||typeof n=="function")){if(e)return ek(e,n)}else if(ka&&r)return r.delete(n);return!1},"delete"),get:a(function(n){return ln&&n&&(typeof n=="object"||typeof n=="function")&&e?YR(e,n):r&&r.get(n)},"get"),has:a(function(n){return ln&&n&&(typeof n=="object"||typeof n=="function")&&e?QR(e,n):!!r&&r.has(n)},"has"),set:a(function(n,o){ln&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new ln),JR(e,n,o)):ka&&(r||(r=ka()),r.set(n,o))},"set")};return i},"getSideChannelWeakMap"):ka});var F0=T((xj,_0)=>{"use strict";var tk=Ht(),rk=bo(),ik=ty(),nk=Iu(),ok=v0(),sk=ok||nk||ik;_0.exports=a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new tk("Side channel does not contain "+rk(i))},"assert"),delete:a(function(i){return!!e&&e.delete(i)},"delete"),get:a(function(i){return e&&e.get(i)},"get"),has:a(function(i){return!!e&&e.has(i)},"has"),set:a(function(i,n){e||(e=sk()),e.set(i,n)},"set")};return r},"getSideChannel")});var Aa=T((Oj,E0)=>{"use strict";var ak=String.prototype.replace,lk=/%20/g,Du={RFC1738:"RFC1738",RFC3986:"RFC3986"};E0.exports={default:Du.RFC3986,formatters:{RFC1738:a(function(t){return ak.call(t,lk,"+")},"RFC1738"),RFC3986:a(function(t){return String(t)},"RFC3986")},RFC1738:Du.RFC1738,RFC3986:Du.RFC3986}});var Bu=T((kj,x0)=>{"use strict";var ck=Aa(),Cu=Object.prototype.hasOwnProperty,li=Array.isArray,zt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),fk=a(function(e){for(;e.length>1;){var r=e.pop(),i=r.obj[r.prop];if(li(i)){for(var n=[],o=0;o<i.length;++o)typeof i[o]<"u"&&n.push(i[o]);r.obj[r.prop]=n}}},"compactQueue"),S0=a(function(e,r){for(var i=r&&r.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},"arrayToObject"),uk=a(function t(e,r,i){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(li(e))e.push(r);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Cu.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var n=e;return li(e)&&!li(r)&&(n=S0(e,i)),li(e)&&li(r)?(r.forEach(function(o,s){if(Cu.call(e,s)){var l=e[s];l&&typeof l=="object"&&o&&typeof o=="object"?e[s]=t(l,o,i):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var l=r[s];return Cu.call(o,s)?o[s]=t(o[s],l,i):o[s]=l,o},n)},"merge"),hk=a(function(e,r){return Object.keys(r).reduce(function(i,n){return i[n]=r[n],i},e)},"assignSingleSource"),dk=a(function(t,e,r){var i=t.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},"decode"),Nu=1024,pk=a(function(e,r,i,n,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),i==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var l="",f=0;f<s.length;f+=Nu){for(var c=s.length>=Nu?s.slice(f,f+Nu):s,u=[],h=0;h<c.length;++h){var d=c.charCodeAt(h);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===ck.RFC1738&&(d===40||d===41)){u[u.length]=c.charAt(h);continue}if(d<128){u[u.length]=zt[d];continue}if(d<2048){u[u.length]=zt[192|d>>6]+zt[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=zt[224|d>>12]+zt[128|d>>6&63]+zt[128|d&63];continue}h+=1,d=65536+((d&1023)<<10|c.charCodeAt(h)&1023),u[u.length]=zt[240|d>>18]+zt[128|d>>12&63]+zt[128|d>>6&63]+zt[128|d&63]}l+=u.join("")}return l},"encode"),mk=a(function(e){for(var r=[{obj:{o:e},prop:"o"}],i=[],n=0;n<r.length;++n)for(var o=r[n],s=o.obj[o.prop],l=Object.keys(s),f=0;f<l.length;++f){var c=l[f],u=s[c];typeof u=="object"&&u!==null&&i.indexOf(u)===-1&&(r.push({obj:s,prop:c}),i.push(u))}return fk(r),e},"compact"),wk=a(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),yk=a(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),gk=a(function(e,r){return[].concat(e,r)},"combine"),bk=a(function(e,r){if(li(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(r(e[n]));return i}return r(e)},"maybeMap");x0.exports={arrayToObject:S0,assign:hk,combine:gk,compact:mk,decode:dk,encode:pk,isBuffer:yk,isRegExp:wk,maybeMap:bk,merge:uk}});var A0=T((Aj,P0)=>{"use strict";var O0=F0(),Ia=Bu(),Oo=Aa(),vk=Object.prototype.hasOwnProperty,R0={brackets:a(function(e){return e+"[]"},"brackets"),comma:"comma",indices:a(function(e,r){return e+"["+r+"]"},"indices"),repeat:a(function(e){return e},"repeat")},Wt=Array.isArray,_k=Array.prototype.push,k0=a(function(t,e){_k.apply(t,Wt(e)?e:[e])},"pushToArray"),Fk=Date.prototype.toISOString,T0=Oo.default,ke={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ia.encode,encodeValuesOnly:!1,filter:void 0,format:T0,formatter:Oo.formatters[T0],indices:!1,serializeDate:a(function(e){return Fk.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},Ek=a(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),Lu={},Sk=a(function t(e,r,i,n,o,s,l,f,c,u,h,d,p,m,w,y,v,g){for(var F=e,O=g,S=0,R=!1;(O=O.get(Lu))!==void 0&&!R;){var b=O.get(e);if(S+=1,typeof b<"u"){if(b===S)throw new RangeError("Cyclic object value");R=!0}typeof O.get(Lu)>"u"&&(S=0)}if(typeof u=="function"?F=u(r,F):F instanceof Date?F=p(F):i==="comma"&&Wt(F)&&(F=Ia.maybeMap(F,function(G){return G instanceof Date?p(G):G})),F===null){if(s)return c&&!y?c(r,ke.encoder,v,"key",m):r;F=""}if(Ek(F)||Ia.isBuffer(F)){if(c){var x=y?r:c(r,ke.encoder,v,"key",m);return[w(x)+"="+w(c(F,ke.encoder,v,"value",m))]}return[w(r)+"="+w(String(F))]}var _=[];if(typeof F>"u")return _;var P;if(i==="comma"&&Wt(F))y&&c&&(F=Ia.maybeMap(F,c)),P=[{value:F.length>0?F.join(",")||null:void 0}];else if(Wt(u))P=u;else{var k=Object.keys(F);P=h?k.sort(h):k}var C=f?String(r).replace(/\./g,"%2E"):String(r),N=n&&Wt(F)&&F.length===1?C+"[]":C;if(o&&Wt(F)&&F.length===0)return N+"[]";for(var U=0;U<P.length;++U){var Z=P[U],me=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:F[Z];if(!(l&&me===null)){var Ee=d&&f?String(Z).replace(/\./g,"%2E"):String(Z),$=Wt(F)?typeof i=="function"?i(N,Ee):N:N+(d?"."+Ee:"["+Ee+"]");g.set(e,S);var q=O0();q.set(Lu,g),k0(_,t(me,$,i,n,o,s,l,f,i==="comma"&&y&&Wt(F)?null:c,u,h,d,p,m,w,y,v,q))}}return _},"stringify"),xk=a(function(e){if(!e)return ke;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||ke.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=Oo.default;if(typeof e.format<"u"){if(!vk.call(Oo.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=Oo.formatters[i],o=ke.filter;(typeof e.filter=="function"||Wt(e.filter))&&(o=e.filter);var s;if(e.arrayFormat in R0?s=e.arrayFormat:"indices"in e?s=e.indices?"indices":"repeat":s=ke.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:ke.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:ke.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ke.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ke.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?ke.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:ke.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:ke.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:ke.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:ke.encodeValuesOnly,filter:o,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:ke.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:ke.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ke.strictNullHandling}},"normalizeStringifyOptions");P0.exports=function(t,e){var r=t,i=xk(e),n,o;typeof i.filter=="function"?(o=i.filter,r=o("",r)):Wt(i.filter)&&(o=i.filter,n=o);var s=[];if(typeof r!="object"||r===null)return"";var l=R0[i.arrayFormat],f=l==="comma"&&i.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var c=O0(),u=0;u<n.length;++u){var h=n[u],d=r[h];i.skipNulls&&d===null||k0(s,Sk(d,h,l,f,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}var p=s.join(i.delimiter),m=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),p.length>0?m+p:""}});var N0=T((Dj,C0)=>{"use strict";var ci=Bu(),$u=Object.prototype.hasOwnProperty,I0=Array.isArray,ye={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ci.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},Tk=a(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),D0=a(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),Ok="utf8=%26%2310003%3B",Rk="utf8=%E2%9C%93",kk=a(function(e,r){var i={__proto__:null},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=n.split(r.delimiter,r.throwOnLimitExceeded?o+1:o);if(r.throwOnLimitExceeded&&s.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var l=-1,f,c=r.charset;if(r.charsetSentinel)for(f=0;f<s.length;++f)s[f].indexOf("utf8=")===0&&(s[f]===Rk?c="utf-8":s[f]===Ok&&(c="iso-8859-1"),l=f,f=s.length);for(f=0;f<s.length;++f)if(f!==l){var u=s[f],h=u.indexOf("]="),d=h===-1?u.indexOf("="):h+1,p,m;d===-1?(p=r.decoder(u,ye.decoder,c,"key"),m=r.strictNullHandling?null:""):(p=r.decoder(u.slice(0,d),ye.decoder,c,"key"),m=ci.maybeMap(D0(u.slice(d+1),r,I0(i[p])?i[p].length:0),function(y){return r.decoder(y,ye.decoder,c,"value")})),m&&r.interpretNumericEntities&&c==="iso-8859-1"&&(m=Tk(String(m))),u.indexOf("[]=")>-1&&(m=I0(m)?[m]:m);var w=$u.call(i,p);w&&r.duplicates==="combine"?i[p]=ci.combine(i[p],m):(!w||r.duplicates==="last")&&(i[p]=m)}return i},"parseQueryStringValues"),Pk=a(function(t,e,r,i){var n=0;if(t.length>0&&t[t.length-1]==="[]"){var o=t.slice(0,-1).join("");n=Array.isArray(e)&&e[o]?e[o].length:0}for(var s=i?e:D0(e,r,n),l=t.length-1;l>=0;--l){var f,c=t[l];if(c==="[]"&&r.parseArrays)f=r.allowEmptyArrays&&(s===""||r.strictNullHandling&&s===null)?[]:ci.combine([],s);else{f=r.plainObjects?{__proto__:null}:{};var u=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,h=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,d=parseInt(h,10);!r.parseArrays&&h===""?f={0:s}:!isNaN(d)&&c!==h&&String(d)===h&&d>=0&&r.parseArrays&&d<=r.arrayLimit?(f=[],f[d]=s):h!=="__proto__"&&(f[h]=s)}s=f}return s},"parseObject"),Ak=a(function(e,r,i,n){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,f=i.depth>0&&s.exec(o),c=f?o.slice(0,f.index):o,u=[];if(c){if(!i.plainObjects&&$u.call(Object.prototype,c)&&!i.allowPrototypes)return;u.push(c)}for(var h=0;i.depth>0&&(f=l.exec(o))!==null&&h<i.depth;){if(h+=1,!i.plainObjects&&$u.call(Object.prototype,f[1].slice(1,-1))&&!i.allowPrototypes)return;u.push(f[1])}if(f){if(i.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+i.depth+" and strictDepth is true");u.push("["+o.slice(f.index)+"]")}return Pk(u,r,i,n)}},"parseQueryStringKeys"),Ik=a(function(e){if(!e)return ye;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?ye.charset:e.charset,i=typeof e.duplicates>"u"?ye.duplicates:e.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:ye.allowDots:!!e.allowDots;return{allowDots:n,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ye.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ye.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ye.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ye.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ye.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ye.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:ye.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:ye.decoder,delimiter:typeof e.delimiter=="string"||ci.isRegExp(e.delimiter)?e.delimiter:ye.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ye.depth,duplicates:i,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ye.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ye.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ye.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:ye.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ye.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");C0.exports=function(t,e){var r=Ik(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var i=typeof t=="string"?kk(t,r):t,n=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var l=o[s],f=Ak(l,i[l],r,typeof t=="string");n=ci.merge(n,f,r)}return r.allowSparse===!0?n:ci.compact(n)}});var L0=T((Nj,B0)=>{"use strict";var Dk=A0(),Ck=N0(),Nk=Aa();B0.exports={formats:Nk,parse:Ck,stringify:Dk}});var ko=T(fn=>{"use strict";var Bk=Aw();function pt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}a(pt,"Url");var Lk=/^([a-z0-9.+-]+:)/i,$k=/:[0-9]*$/,Mk=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,jk=["<",">",'"',"`"," ","\r",`
|
|
8
|
-
`," "],Uk=["{","}","|","\\","^","`"].concat(jk),Mu=["'"].concat(Uk),$0=["%","/","?",";","#"].concat(Mu),M0=["/","?","#"],Hk=255,j0=/^[+a-z0-9A-Z_-]{0,63}$/,qk=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,zk={javascript:!0,"javascript:":!0},ju={javascript:!0,"javascript:":!0},cn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Uu=L0();function Ro(t,e,r){if(t&&typeof t=="object"&&t instanceof pt)return t;var i=new pt;return i.parse(t,e,r),i}a(Ro,"urlParse");pt.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",o=t.split(n),s=/\\/g;o[0]=o[0].replace(s,"/"),t=o.join(n);var l=t;if(l=l.trim(),!r&&t.split("#").length===1){var f=Mk.exec(l);if(f)return this.path=l,this.href=l,this.pathname=f[1],f[2]?(this.search=f[2],e?this.query=Uu.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var c=Lk.exec(l);if(c){c=c[0];var u=c.toLowerCase();this.protocol=u,l=l.substr(c.length)}if(r||c||l.match(/^\/\/[^@/]+@[^@/]+/)){var h=l.substr(0,2)==="//";h&&!(c&&ju[c])&&(l=l.substr(2),this.slashes=!0)}if(!ju[c]&&(h||c&&!cn[c])){for(var d=-1,p=0;p<M0.length;p++){var m=l.indexOf(M0[p]);m!==-1&&(d===-1||m<d)&&(d=m)}var w,y;d===-1?y=l.lastIndexOf("@"):y=l.lastIndexOf("@",d),y!==-1&&(w=l.slice(0,y),l=l.slice(y+1),this.auth=decodeURIComponent(w)),d=-1;for(var p=0;p<$0.length;p++){var m=l.indexOf($0[p]);m!==-1&&(d===-1||m<d)&&(d=m)}d===-1&&(d=l.length),this.host=l.slice(0,d),l=l.slice(d),this.parseHost(),this.hostname=this.hostname||"";var v=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!v)for(var g=this.hostname.split(/\./),p=0,F=g.length;p<F;p++){var O=g[p];if(O&&!O.match(j0)){for(var S="",R=0,b=O.length;R<b;R++)O.charCodeAt(R)>127?S+="x":S+=O[R];if(!S.match(j0)){var x=g.slice(0,p),_=g.slice(p+1),P=O.match(qk);P&&(x.push(P[1]),_.unshift(P[2])),_.length&&(l="/"+_.join(".")+l),this.hostname=x.join(".");break}}}this.hostname.length>Hk?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=Bk.toASCII(this.hostname));var k=this.port?":"+this.port:"",C=this.hostname||"";this.host=C+k,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!zk[u])for(var p=0,F=Mu.length;p<F;p++){var N=Mu[p];if(l.indexOf(N)!==-1){var U=encodeURIComponent(N);U===N&&(U=escape(N)),l=l.split(N).join(U)}}var Z=l.indexOf("#");Z!==-1&&(this.hash=l.substr(Z),l=l.slice(0,Z));var me=l.indexOf("?");if(me!==-1?(this.search=l.substr(me),this.query=l.substr(me+1),e&&(this.query=Uu.parse(this.query)),l=l.slice(0,me)):e&&(this.search="",this.query={}),l&&(this.pathname=l),cn[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var k=this.pathname||"",Ee=this.search||"";this.path=k+Ee}return this.href=this.format(),this};function Wk(t){return typeof t=="string"&&(t=Ro(t)),t instanceof pt?t.format():pt.prototype.format.call(t)}a(Wk,"urlFormat");pt.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=Uu.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||cn[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),s&&s.charAt(0)!=="?"&&(s="?"+s),r=r.replace(/[?#]/g,function(l){return encodeURIComponent(l)}),s=s.replace("#","%23"),e+n+r+s+i};function Vk(t,e){return Ro(t,!1,!0).resolve(e)}a(Vk,"urlResolve");pt.prototype.resolve=function(t){return this.resolveObject(Ro(t,!1,!0)).format()};function Gk(t,e){return t?Ro(t,!1,!0).resolveObject(e):e}a(Gk,"urlResolveObject");pt.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new pt;e.parse(t,!1,!0),t=e}for(var r=new pt,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var f=s[l];f!=="protocol"&&(r[f]=t[f])}return cn[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!cn[t.protocol]){for(var c=Object.keys(t),u=0;u<c.length;u++){var h=c[u];r[h]=t[h]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!ju[t.protocol]){for(var F=(t.pathname||"").split("/");F.length&&!(t.host=F.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),F[0]!==""&&F.unshift(""),F.length<2&&F.unshift(""),r.pathname=F.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var m=r.pathname&&r.pathname.charAt(0)==="/",w=t.host||t.pathname&&t.pathname.charAt(0)==="/",y=w||m||r.host&&t.pathname,v=y,g=r.pathname&&r.pathname.split("/")||[],F=t.pathname&&t.pathname.split("/")||[],O=r.protocol&&!cn[r.protocol];if(O&&(r.hostname="",r.port=null,r.host&&(g[0]===""?g[0]=r.host:g.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(F[0]===""?F[0]=t.host:F.unshift(t.host)),t.host=null),y=y&&(F[0]===""||g[0]==="")),w)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,g=F;else if(F.length)g||(g=[]),g.pop(),g=g.concat(F),r.search=t.search,r.query=t.query;else if(t.search!=null){if(O){r.host=g.shift(),r.hostname=r.host;var S=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;S&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var R=g.slice(-1)[0],b=(r.host||t.host||g.length>1)&&(R==="."||R==="..")||R==="",x=0,_=g.length;_>=0;_--)R=g[_],R==="."?g.splice(_,1):R===".."?(g.splice(_,1),x++):x&&(g.splice(_,1),x--);if(!y&&!v)for(;x--;x)g.unshift("..");y&&g[0]!==""&&(!g[0]||g[0].charAt(0)!=="/")&&g.unshift(""),b&&g.join("/").substr(-1)!=="/"&&g.push("");var P=g[0]===""||g[0]&&g[0].charAt(0)==="/";if(O){r.hostname=P?"":g.length?g.shift():"",r.host=r.hostname;var S=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;S&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)}return y=y||r.host&&g.length,y&&!P&&g.unshift(""),g.length>0?r.pathname=g.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r};pt.prototype.parseHost=function(){var t=this.host,e=$k.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};fn.parse=Ro;fn.resolve=Vk;fn.resolveObject=Gk;fn.format=Wk;fn.Url=pt});var Ir=T(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.getWriteSyncArgs=Pe.getWriteArgs=Pe.bufToUint8=void 0;Pe.promisify=Zk;Pe.validateCallback=U0;Pe.modeToNumber=H0;Pe.nullCheck=q0;Pe.pathToFilename=Jk;Pe.createError=pP;Pe.genRndStr6=mP;Pe.flagsToNumber=wP;Pe.streamToBuffer=yP;Pe.bufferToEncoding=_P;Pe.isReadableStream=FP;var Po=Yi(),Hu=fo(),qu=Or(),Kk=cu(),Da=ya();function Zk(t,e,r=i=>i){return(...i)=>new Promise((n,o)=>{t[e].bind(t)(...i,(s,l)=>s?o(s):n(r(l)))})}a(Zk,"promisify");function U0(t){if(typeof t!="function")throw TypeError(Po.ERRSTR.CB);return t}a(U0,"validateCallback");function Xk(t,e){if(typeof t=="number")return t;if(typeof t=="string")return parseInt(t,8);if(e)return H0(e)}a(Xk,"_modeToNumber");function H0(t,e){let r=Xk(t,e);if(typeof r!="number"||isNaN(r))throw new TypeError(Po.ERRSTR.MODE_INT);return r}a(H0,"modeToNumber");function q0(t,e){if((""+t).indexOf("\0")!==-1){let r=new Error("Path must be a string without null bytes");if(r.code="ENOENT",typeof e!="function")throw r;return(0,Kk.default)(()=>{e(r)}),!1}return!0}a(q0,"nullCheck");function Yk(t){if(t.hostname!=="")throw new Hu.TypeError("ERR_INVALID_FILE_URL_HOST",process.platform);let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)|32;if(e[r+1]==="2"&&i===102)throw new Hu.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(e)}a(Yk,"getPathFromURLPosix");function Jk(t){if(t instanceof Uint8Array&&(t=(0,qu.bufferFrom)(t)),typeof t!="string"&&!qu.Buffer.isBuffer(t)){try{if(!(t instanceof ko().URL))throw new TypeError(Po.ERRSTR.PATH_STR)}catch{throw new TypeError(Po.ERRSTR.PATH_STR)}t=Yk(t)}let e=String(t);return q0(e),e}a(Jk,"pathToFilename");var Qk="ENOENT",eP="EBADF",tP="EINVAL",rP="EPERM",iP="EPROTO",nP="EEXIST",oP="ENOTDIR",sP="EMFILE",aP="EACCES",lP="EISDIR",cP="ENOTEMPTY",fP="ENOSYS",uP="ERR_FS_EISDIR",hP="ERR_OUT_OF_RANGE";function dP(t,e="",r="",i=""){let n="";switch(r&&(n=` '${r}'`),i&&(n+=` -> '${i}'`),t){case Qk:return`ENOENT: no such file or directory, ${e}${n}`;case eP:return`EBADF: bad file descriptor, ${e}${n}`;case tP:return`EINVAL: invalid argument, ${e}${n}`;case rP:return`EPERM: operation not permitted, ${e}${n}`;case iP:return`EPROTO: protocol error, ${e}${n}`;case nP:return`EEXIST: file already exists, ${e}${n}`;case oP:return`ENOTDIR: not a directory, ${e}${n}`;case lP:return`EISDIR: illegal operation on a directory, ${e}${n}`;case aP:return`EACCES: permission denied, ${e}${n}`;case cP:return`ENOTEMPTY: directory not empty, ${e}${n}`;case sP:return`EMFILE: too many open files, ${e}${n}`;case fP:return`ENOSYS: function not implemented, ${e}${n}`;case uP:return`[ERR_FS_EISDIR]: Path is a directory: ${e} returned EISDIR (is a directory) ${r}`;case hP:return`[ERR_OUT_OF_RANGE]: value out of range, ${e}${n}`;default:return`${t}: error occurred, ${e}${n}`}}a(dP,"formatError");function pP(t,e="",r="",i="",n=Error){let o=new n(dP(t,e,r,i));return o.code=t,r&&(o.path=r),o}a(pP,"createError");function mP(){return Math.random().toString(36).slice(2,8).padEnd(6,"0")}a(mP,"genRndStr6");function wP(t){if(typeof t=="number")return t;if(typeof t=="string"){let e=Po.FLAGS[t];if(typeof e<"u")return e}throw new Hu.TypeError("ERR_INVALID_OPT_VALUE","flags",t)}a(wP,"flagsToNumber");function yP(t){let e=[];return new Promise((r,i)=>{t.on("data",n=>e.push(n)),t.on("end",()=>r(qu.Buffer.concat(e))),t.on("error",i)})}a(yP,"streamToBuffer");var gP=a(t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),"bufToUint8");Pe.bufToUint8=gP;var bP=a((t,e,r,i,n,o)=>{(0,Da.validateFd)(t);let s=0,l,f=null,c,u,h=typeof e,d=typeof r,p=typeof i,m=typeof n;h!=="string"?d==="function"?u=r:p==="function"?(s=r|0,u=i):m==="function"?(s=r|0,l=i,u=n):(s=r|0,l=i,f=n,u=o):d==="function"?u=r:p==="function"?(f=r,u=i):m==="function"&&(f=r,c=i,u=n);let w=(0,Da.dataToBuffer)(e,c);h!=="string"?typeof l>"u"&&(l=w.length):(s=0,l=w.length);let y=U0(u);return[t,h==="string",w,s,l,f,y]},"getWriteArgs");Pe.getWriteArgs=bP;var vP=a((t,e,r,i,n)=>{(0,Da.validateFd)(t);let o,s,l,f,c=typeof e!="string";c?(s=(r||0)|0,l=i,f=n):(f=r,o=i);let u=(0,Da.dataToBuffer)(e,o);return c?typeof l>"u"&&(l=u.length):(s=0,l=u.length),[t,u,s||0,l,f]},"getWriteSyncArgs");Pe.getWriteSyncArgs=vP;function _P(t,e){return!e||e==="buffer"?t:t.toString(e)}a(_P,"bufferToEncoding");function FP(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"&&t.readable===!0}a(FP,"isReadableStream")});var Z0=T(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.Superblock=void 0;var Ne=Gi(),EP=ru(),z0=nu(),SP=au(),xP=Or(),W0=na(),Vt=Pt(),V0=Yi(),V=Ir(),At=ya(),TP=Xf(),un=Ne.posix?Ne.posix.sep:Ne.sep,G0=Ne.posix?Ne.posix.relative:Ne.relative,OP=Ne.posix?Ne.posix.join:Ne.join,{O_RDONLY:zu,O_WRONLY:Ca,O_RDWR:Wu,O_CREAT:K0,O_EXCL:RP,O_TRUNC:kP,O_APPEND:PP,O_DIRECTORY:AP}=Vt.constants,hn=class hn{static fromJSON(e,r){let i=new hn;return i.fromJSON(e,r),i}static fromNestedJSON(e,r){let i=new hn;return i.fromNestedJSON(e,r),i}constructor(e={}){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.open=(i,n,o,s=!0)=>{let l=this.openFile(i,n,o,s);if(!l)throw(0,V.createError)("ENOENT","open",i);return l.fd},this.writeFile=(i,n,o,s)=>{let l=typeof i=="number",f;l?f=i:f=this.open((0,V.pathToFilename)(i),o,s);let c=0,u=n.length,h=o&PP?void 0:0;try{for(;u>0;){let d=this.write(f,n,c,u,h);c+=d,u-=d,h!==void 0&&(h+=d)}}finally{l||this.close(f)}},this.read=(i,n,o,s,l)=>{if(n.byteLength<s)throw(0,V.createError)("ERR_OUT_OF_RANGE","read",void 0,void 0,RangeError);let f=this.getFileByFdOrThrow(i);if(f.node.isSymlink())throw(0,V.createError)("EPERM","read",f.link.getPath());return f.read(n,Number(o),Number(s),l===-1||typeof l!="number"?void 0:l)},this.readv=(i,n,o)=>{let s=this.getFileByFdOrThrow(i),l=o??void 0;l===-1&&(l=void 0);let f=0;for(let c of n){let u=s.read(c,0,c.byteLength,l);if(l=void 0,f+=u,u<c.byteLength)break}return f},this.link=(i,n)=>{let o;try{o=this.getLinkOrThrow(i,"link")}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"link",i,n)),u}let s=(0,Ne.dirname)(n),l;try{l=this.getLinkOrThrow(s,"link")}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"link",i,n)),u}let f=(0,Ne.basename)(n);if(l.getChild(f))throw(0,V.createError)("EEXIST","link",i,n);let c=o.getNode();c.nlink++,l.createChild(f,c)},this.unlink=i=>{let n=this.getLinkOrThrow(i,"unlink");if(n.length)throw Error("Dir not empty...");this.deleteLink(n);let o=n.getNode();o.nlink--,o.nlink<=0&&this.deleteNode(o)},this.symlink=(i,n)=>{let o=(0,At.filenameToSteps)(n),s;try{s=this.getLinkParentAsDirOrThrow(o)}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"symlink",i,n)),u}let l=o[o.length-1];if(s.getChild(l))throw(0,V.createError)("EEXIST","symlink",i,n);let f=s.getNode();if(!f.canExecute()||!f.canWrite())throw(0,V.createError)("EACCES","symlink",i,n);let c=s.createChild(l);return c.getNode().makeSymlink(i),c},this.rename=(i,n)=>{let o;try{o=this.getResolvedLinkOrThrow(i)}catch(h){throw h.code&&(h=(0,V.createError)(h.code,"rename",i,n)),h}let s;try{s=this.getLinkParentAsDirOrThrow(n)}catch(h){throw h.code&&(h=(0,V.createError)(h.code,"rename",i,n)),h}let l=o.parent;if(!l)throw(0,V.createError)("EINVAL","rename",i,n);let f=l.getNode(),c=s.getNode();if(!f.canExecute()||!f.canWrite()||!c.canExecute()||!c.canWrite())throw(0,V.createError)("EACCES","rename",i,n);l.deleteChild(o);let u=(0,Ne.basename)(n);o.name=u,o.steps=[...s.steps,u],s.setChild(o.getName(),o)},this.mkdir=(i,n)=>{let o=(0,At.filenameToSteps)(i);if(!o.length)throw(0,V.createError)("EEXIST","mkdir",i);let s=this.getLinkParentAsDirOrThrow(i,"mkdir"),l=o[o.length-1];if(s.getChild(l))throw(0,V.createError)("EEXIST","mkdir",i);let f=s.getNode();if(!f.canWrite()||!f.canExecute())throw(0,V.createError)("EACCES","mkdir",i);s.createChild(l,this.createNode(Vt.constants.S_IFDIR|n))},this.mkdirp=(i,n)=>{let o=!1,s=(0,At.filenameToSteps)(i),l=null,f=s.length;for(f=s.length;f>=0&&(l=this.getResolvedLink(s.slice(0,f)),!l);f--);for(l||(l=this.root,f=0),l=this.getResolvedLinkOrThrow(Ne.sep+s.slice(0,f).join(Ne.sep),"mkdir"),f;f<s.length;f++){let c=l.getNode();if(c.isDirectory()){if(!c.canExecute()||!c.canWrite())throw(0,V.createError)("EACCES","mkdir",i)}else throw(0,V.createError)("ENOTDIR","mkdir",i);o=!0,l=l.createChild(s[f],this.createNode(Vt.constants.S_IFDIR|n))}return o?i:void 0},this.rmdir=(i,n=!1)=>{let o=this.getLinkAsDirOrThrow(i,"rmdir");if(o.length&&!n)throw(0,V.createError)("ENOTEMPTY","rmdir",i);this.deleteLink(o)},this.rm=(i,n=!1,o=!1)=>{let s;try{s=this.getResolvedLinkOrThrow(i,"stat")}catch(l){if(l.code==="ENOENT"&&n)return;throw l}if(s.getNode().isDirectory()&&!o)throw(0,V.createError)("ERR_FS_EISDIR","rm",i);if(!s.parent?.getNode().canWrite())throw(0,V.createError)("EACCES","rm",i);this.deleteLink(s)},this.close=i=>{(0,At.validateFd)(i);let n=this.getFileByFdOrThrow(i,"close");this.closeFile(n)};let r=this.createLink();r.setNode(this.createNode(Vt.constants.S_IFDIR|511)),r.setChild(".",r),r.getNode().nlink++,r.setChild("..",r),r.getNode().nlink++,this.root=r}createLink(e,r,i=!1,n){if(!e)return new z0.Link(this,void 0,"");if(!r)throw new Error("createLink: name cannot be empty");let o=n??(i?511:438),l=n&&n&Vt.constants.S_IFMT?n&Vt.constants.S_IFMT:i?Vt.constants.S_IFDIR:Vt.constants.S_IFREG,f=o&~Vt.constants.S_IFMT|l;return e.createChild(r,this.createNode(f))}deleteLink(e){let r=e.parent;return r?(r.deleteChild(e),!0):!1}newInoNumber(){let e=this.releasedInos.pop();return e||(this.ino=(this.ino+1)%4294967295,this.ino)}newFdNumber(){let e=this.releasedFds.pop();return typeof e=="number"?e:hn.fd--}createNode(e){let r=new EP.Node(this.newInoNumber(),e);return this.inodes[r.ino]=r,r}deleteNode(e){e.del(),delete this.inodes[e.ino],this.releasedInos.push(e.ino)}walk(e,r=!1,i=!1,n=!1,o){let s,l;e instanceof z0.Link?(s=e.steps,l=un+s.join(un)):typeof e=="string"?(s=(0,At.filenameToSteps)(e),l=e):(s=e,l=un+s.join(un));let f=this.root,c=0;for(;c<s.length;){let u=f.getNode();if(u.isDirectory()){if(n&&!u.canExecute())throw(0,V.createError)("EACCES",o,l)}else if(c<s.length-1)throw(0,V.createError)("ENOTDIR",o,l);if(f=f.getChild(s[c])??null,!f){if(i)throw(0,V.createError)("ENOENT",o,l);return null}if(u=f?.getNode(),u.isSymlink()&&(r||c<s.length-1)){let h=(0,Ne.isAbsolute)(u.symlink)?u.symlink:OP((0,Ne.dirname)(f.getPath()),u.symlink);s=(0,At.filenameToSteps)(h).concat(s.slice(c+1)),f=this.root,c=0;continue}if(i&&!u.isDirectory()&&c<s.length-1){let h=W0.default.platform==="win32"?"ENOENT":"ENOTDIR";throw(0,V.createError)(h,o,l)}c++}return f}getLink(e){return this.walk(e,!1,!1,!1)}getLinkOrThrow(e,r){return this.walk(e,!1,!0,!0,r)}getResolvedLink(e){return this.walk(e,!0,!1,!1)}getResolvedLinkOrThrow(e,r){return this.walk(e,!0,!0,!0,r)}resolveSymlinks(e){return this.getResolvedLink(e.steps.slice(1))}getLinkAsDirOrThrow(e,r){let i=this.getLinkOrThrow(e,r);if(!i.getNode().isDirectory())throw(0,V.createError)("ENOTDIR",r,e);return i}getLinkParent(e){return this.getLink(e.slice(0,-1))}getLinkParentAsDirOrThrow(e,r){let i=(e instanceof Array?e:(0,At.filenameToSteps)(e)).slice(0,-1),n=un+i.join(un),o=this.getLinkOrThrow(n,r);if(!o.getNode().isDirectory())throw(0,V.createError)("ENOTDIR",r,n);return o}getFileByFd(e){return this.fds[String(e)]}getFileByFdOrThrow(e,r){if(!(0,At.isFd)(e))throw TypeError(V0.ERRSTR.FD);let i=this.getFileByFd(e);if(!i)throw(0,V.createError)("EBADF",r);return i}_toJSON(e=this.root,r={},i,n){let o=!0,s=e.children;e.getNode().isFile()&&(s=new Map([[e.getName(),e.parent.getChild(e.getName())]]),e=e.parent);for(let f of s.keys()){if(f==="."||f==="..")continue;o=!1;let c=e.getChild(f);if(!c)throw new Error("_toJSON: unexpected undefined");let u=c.getNode();if(u.isFile()){let h=c.getPath();i&&(h=G0(i,h)),r[h]=n?u.getBuffer():u.getString()}else u.isDirectory()&&this._toJSON(c,r,i,n)}let l=e.getPath();return i&&(l=G0(i,l)),l&&o&&(r[l]=null),r}toJSON(e,r={},i=!1,n=!1){let o=[];if(e){Array.isArray(e)||(e=[e]);for(let s of e){let l=(0,V.pathToFilename)(s),f=this.getResolvedLink(l);f&&o.push(f)}}else o.push(this.root);if(!o.length)return r;for(let s of o)this._toJSON(s,r,i?s.getPath():"",n);return r}fromJSON(e,r=W0.default.cwd()){for(let i in e){let n=e[i];if(i=(0,At.resolve)(i,r),typeof n=="string"||n instanceof xP.Buffer){let o=(0,Ne.dirname)(i);this.mkdirp(o,511);let s=(0,At.dataToBuffer)(n);this.writeFile(i,s,V0.FLAGS.w,438)}else this.mkdirp(i,511)}}fromNestedJSON(e,r){this.fromJSON((0,TP.flattenJSON)(e),r)}reset(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(Vt.constants.S_IFDIR|511))}mountSync(e,r){this.fromJSON(r,e)}openLink(e,r,i=!0){if(this.openFiles>=this.maxFiles)throw(0,V.createError)("EMFILE","open",e.getPath());let n=e;i&&(n=this.getResolvedLinkOrThrow(e.getPath(),"open"));let o=n.getNode();if(o.isDirectory()){if((r&(zu|Wu|Ca))!==zu)throw(0,V.createError)("EISDIR","open",e.getPath())}else if(r&AP)throw(0,V.createError)("ENOTDIR","open",e.getPath());if((r&(zu|Wu|Ca))!==Ca&&!o.canRead()||r&(Ca|Wu)&&!o.canWrite())throw(0,V.createError)("EACCES","open",e.getPath());let s=new SP.File(e,o,r,this.newFdNumber());return this.fds[s.fd]=s,this.openFiles++,r&kP&&s.truncate(),s}openFile(e,r,i,n=!0){let o=(0,At.filenameToSteps)(e),s;try{if(s=n?this.getResolvedLinkOrThrow(e,"open"):this.getLinkOrThrow(e,"open"),s&&r&K0&&r&RP)throw(0,V.createError)("EEXIST","open",e)}catch(l){if(l.code==="ENOENT"&&r&K0){let f=(0,Ne.dirname)(e),c=this.getResolvedLinkOrThrow(f),u=c.getNode();if(!u.isDirectory())throw(0,V.createError)("ENOTDIR","open",e);if(!u.canExecute()||!u.canWrite())throw(0,V.createError)("EACCES","open",e);i??(i=438),s=this.createLink(c,o[o.length-1],!1,i)}else throw l}if(s)return this.openLink(s,r,n);throw(0,V.createError)("ENOENT","open",e)}closeFile(e){this.fds[e.fd]&&(this.openFiles--,delete this.fds[e.fd],this.releasedFds.push(e.fd))}write(e,r,i,n,o){let s=this.getFileByFdOrThrow(e,"write");if(s.node.isSymlink())throw(0,V.createError)("EBADF","write",s.link.getPath());return s.write(r,i,n,o===-1||typeof o!="number"?void 0:o)}};a(hn,"Superblock");var Na=hn;Ba.Superblock=Na;Na.fd=2147483647});var Y0=T(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.Superblock=mt.File=mt.Link=mt.Node=void 0;var X0=(Kf(),bm(Gf));X0.__exportStar(_w(),mt);X0.__exportStar(Xf(),mt);var IP=ru();Object.defineProperty(mt,"Node",{enumerable:!0,get:a(function(){return IP.Node},"get")});var DP=nu();Object.defineProperty(mt,"Link",{enumerable:!0,get:a(function(){return DP.Link},"get")});var CP=au();Object.defineProperty(mt,"File",{enumerable:!0,get:a(function(){return CP.File},"get")});var NP=Z0();Object.defineProperty(mt,"Superblock",{enumerable:!0,get:a(function(){return NP.Superblock},"get")})});var J0=T(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.StatFs=void 0;var $a=class $a{static build(e,r=!1){let i=new $a,n=r?u=>BigInt(u):u=>u;i.type=n(2240043254),i.bsize=n(4096);let o=Object.keys(e.inodes).length,s=1e6,l=Math.min(o*2,s),f=s-l;i.blocks=n(s),i.bfree=n(f),i.bavail=n(f);let c=1e6;return i.files=n(c),i.ffree=n(c-o),i}};a($a,"StatFs");var La=$a;Ao.StatFs=La;Ao.default=La});var Q0=T(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});function BP(t,e,r){let i=setTimeout.apply(globalThis,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}a(BP,"setTimeoutUnref");Vu.default=BP});var Io=T((Kj,Gu)=>{"use strict";var dn=typeof Reflect=="object"?Reflect:null,eg=dn&&typeof dn.apply=="function"?dn.apply:a(function(e,r,i){return Function.prototype.apply.call(e,r,i)},"ReflectApply"),Ma;dn&&typeof dn.ownKeys=="function"?Ma=dn.ownKeys:Object.getOwnPropertySymbols?Ma=a(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ma=a(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function LP(t){console&&console.warn&&console.warn(t)}a(LP,"ProcessEmitWarning");var rg=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function le(){le.init.call(this)}a(le,"EventEmitter");Gu.exports=le;Gu.exports.once=UP;le.EventEmitter=le;le.prototype._events=void 0;le.prototype._eventsCount=0;le.prototype._maxListeners=void 0;var tg=10;function ja(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}a(ja,"checkListener");Object.defineProperty(le,"defaultMaxListeners",{enumerable:!0,get:a(function(){return tg},"get"),set:a(function(t){if(typeof t!="number"||t<0||rg(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");tg=t},"set")});le.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};le.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||rg(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function ig(t){return t._maxListeners===void 0?le.defaultMaxListeners:t._maxListeners}a(ig,"_getMaxListeners");le.prototype.getMaxListeners=a(function(){return ig(this)},"getMaxListeners");le.prototype.emit=a(function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var l=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw l.context=s,l}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")eg(f,this,r);else for(var c=f.length,u=lg(f,c),i=0;i<c;++i)eg(u[i],this,r);return!0},"emit");function ng(t,e,r,i){var n,o,s;if(ja(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),n=ig(t),n>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,LP(l)}return t}a(ng,"_addListener");le.prototype.addListener=a(function(e,r){return ng(this,e,r,!1)},"addListener");le.prototype.on=le.prototype.addListener;le.prototype.prependListener=a(function(e,r){return ng(this,e,r,!0)},"prependListener");function $P(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}a($P,"onceWrapper");function og(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=$P.bind(i);return n.listener=r,i.wrapFn=n,n}a(og,"_onceWrap");le.prototype.once=a(function(e,r){return ja(r),this.on(e,og(this,e,r)),this},"once");le.prototype.prependOnceListener=a(function(e,r){return ja(r),this.prependListener(e,og(this,e,r)),this},"prependOnceListener");le.prototype.removeListener=a(function(e,r){var i,n,o,s,l;if(ja(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===r||i[s].listener===r){l=i[s].listener,o=s;break}if(o<0)return this;o===0?i.shift():MP(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},"removeListener");le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=a(function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),s;for(n=0;n<o.length;++n)s=o[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this},"removeAllListeners");function sg(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?jP(n):lg(n,n.length)}a(sg,"_listeners");le.prototype.listeners=a(function(e){return sg(this,e,!0)},"listeners");le.prototype.rawListeners=a(function(e){return sg(this,e,!1)},"rawListeners");le.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ag.call(t,e)};le.prototype.listenerCount=ag;function ag(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}a(ag,"listenerCount");le.prototype.eventNames=a(function(){return this._eventsCount>0?Ma(this._events):[]},"eventNames");function lg(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}a(lg,"arrayClone");function MP(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}a(MP,"spliceOne");function jP(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}a(jP,"unwrapListeners");function UP(t,e){return new Promise(function(r,i){function n(s){t.removeListener(e,o),i(s)}a(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}a(o,"resolver"),cg(t,e,o,{once:!0}),e!=="error"&&HP(t,n,{once:!0})})}a(UP,"once");function HP(t,e,r){typeof t.on=="function"&&cg(t,"error",e,r)}a(HP,"addErrorHandlerIfEventEmitter");function cg(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,a(function n(o){i.once&&t.removeEventListener(e,n),r(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}a(cg,"eventTargetAgnosticAddListener")});var Gt=T((Xj,Ku)=>{typeof Object.create=="function"?Ku.exports=a(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Ku.exports=a(function(e,r){if(r){e.super_=r;var i=a(function(){},"TempCtor");i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}},"inherits")});var Zu=T((Jj,fg)=>{fg.exports=Io().EventEmitter});var Xu=T(()=>{});var wg=T((t6,mg)=>{"use strict";function ug(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}a(ug,"ownKeys");function hg(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ug(Object(r),!0).forEach(function(i){qP(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ug(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}a(hg,"_objectSpread");function qP(t,e,r){return e=pg(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a(qP,"_defineProperty");function zP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}a(zP,"_classCallCheck");function dg(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,pg(i.key),i)}}a(dg,"_defineProperties");function WP(t,e,r){return e&&dg(t.prototype,e),r&&dg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}a(WP,"_createClass");function pg(t){var e=VP(t,"string");return typeof e=="symbol"?e:String(e)}a(pg,"_toPropertyKey");function VP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}a(VP,"_toPrimitive");var GP=ni(),Ua=GP.Buffer,KP=Xu(),Yu=KP.inspect,ZP=Yu&&Yu.custom||"inspect";function XP(t,e,r){Ua.prototype.copy.call(t,e,r)}a(XP,"copyBuffer");mg.exports=function(){function t(){zP(this,t),this.head=null,this.tail=null,this.length=0}return a(t,"BufferList"),WP(t,[{key:"push",value:a(function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},"push")},{key:"unshift",value:a(function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},"unshift")},{key:"shift",value:a(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:a(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:a(function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},"join")},{key:"concat",value:a(function(r){if(this.length===0)return Ua.alloc(0);for(var i=Ua.allocUnsafe(r>>>0),n=this.head,o=0;n;)XP(n.data,i,o),o+=n.data.length,n=n.next;return i},"concat")},{key:"consume",value:a(function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n},"consume")},{key:"first",value:a(function(){return this.head.data},"first")},{key:"_getString",value:a(function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var s=i.data,l=r>s.length?s.length:r;if(l===s.length?o+=s:o+=s.slice(0,r),r-=l,r===0){l===s.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(l));break}++n}return this.length-=n,o},"_getString")},{key:"_getBuffer",value:a(function(r){var i=Ua.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var s=n.data,l=r>s.length?s.length:r;if(s.copy(i,i.length-r,0,l),r-=l,r===0){l===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(l));break}++o}return this.length-=o,i},"_getBuffer")},{key:ZP,value:a(function(r,i){return Yu(this,hg(hg({},i),{},{depth:0,customInspect:!1}))},"value")}]),t}()});var Qu=T((i6,gg)=>{"use strict";function YP(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Ju,this,t)):process.nextTick(Ju,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Ha,r):(r._writableState.errorEmitted=!0,process.nextTick(yg,r,o)):process.nextTick(yg,r,o):e?(process.nextTick(Ha,r),e(o)):process.nextTick(Ha,r)}),this)}a(YP,"destroy");function yg(t,e){Ju(t,e),Ha(t)}a(yg,"emitErrorAndCloseNT");function Ha(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}a(Ha,"emitCloseNT");function JP(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}a(JP,"undestroy");function Ju(t,e){t.emit("error",e)}a(Ju,"emitErrorNT");function QP(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}a(QP,"errorOrDestroy");gg.exports={destroy:YP,undestroy:JP,errorOrDestroy:QP}});var fi=T((o6,_g)=>{"use strict";function eA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}a(eA,"_inheritsLoose");var vg={};function wt(t,e,r){r||(r=Error);function i(o,s,l){return typeof e=="string"?e:e(o,s,l)}a(i,"getMessage");var n=function(o){eA(s,o);function s(l,f,c){return o.call(this,i(l,f,c))||this}return a(s,"NodeError"),s}(r);n.prototype.name=r.name,n.prototype.code=t,vg[t]=n}a(wt,"createErrorType");function bg(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}a(bg,"oneOf");function tA(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}a(tA,"startsWith");function rA(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}a(rA,"endsWith");function iA(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}a(iA,"includes");wt("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);wt("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&tA(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(rA(t," argument"))n="The ".concat(t," ").concat(i," ").concat(bg(e,"type"));else{var o=iA(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(bg(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);wt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");wt("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});wt("ERR_STREAM_PREMATURE_CLOSE","Premature close");wt("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});wt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");wt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");wt("ERR_STREAM_WRITE_AFTER_END","write after end");wt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);wt("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);wt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");_g.exports.codes=vg});var eh=T((a6,Fg)=>{"use strict";var nA=fi().codes.ERR_INVALID_OPT_VALUE;function oA(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}a(oA,"highWaterMarkFrom");function sA(t,e,r,i){var n=oA(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new nA(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}a(sA,"getHighWaterMark");Fg.exports={getHighWaterMark:sA}});var Sg=T((c6,Eg)=>{Eg.exports=aA;function aA(t,e){if(th("noDeprecation"))return t;var r=!1;function i(){if(!r){if(th("throwDeprecation"))throw new Error(e);th("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return a(i,"deprecated"),i}a(aA,"deprecate");function th(t){try{if(!globalThis.localStorage)return!1}catch{return!1}var e=globalThis.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}a(th,"config")});var Wa=T((u6,Pg)=>{"use strict";Pg.exports=ge;function Tg(t){var e=this;this.next=null,this.entry=null,this.finish=function(){CA(e,t)}}a(Tg,"CorkedRequest");var pn;ge.WritableState=Co;var lA={deprecate:Sg()},Og=Zu(),za=ni().Buffer,cA=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function fA(t){return za.from(t)}a(fA,"_uint8ArrayToBuffer");function uA(t){return za.isBuffer(t)||t instanceof cA}a(uA,"_isUint8Array");var ih=Qu(),hA=eh(),dA=hA.getHighWaterMark,Dr=fi().codes,pA=Dr.ERR_INVALID_ARG_TYPE,mA=Dr.ERR_METHOD_NOT_IMPLEMENTED,wA=Dr.ERR_MULTIPLE_CALLBACK,yA=Dr.ERR_STREAM_CANNOT_PIPE,gA=Dr.ERR_STREAM_DESTROYED,bA=Dr.ERR_STREAM_NULL_VALUES,vA=Dr.ERR_STREAM_WRITE_AFTER_END,_A=Dr.ERR_UNKNOWN_ENCODING,mn=ih.errorOrDestroy;Gt()(ge,Og);function FA(){}a(FA,"nop");function Co(t,e,r){pn=pn||Cr(),t=t||{},typeof r!="boolean"&&(r=e instanceof pn),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=dA(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){kA(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Tg(this)}a(Co,"WritableState");Co.prototype.getBuffer=a(function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},"getBuffer");(function(){try{Object.defineProperty(Co.prototype,"buffer",{get:lA.deprecate(a(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var qa;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(qa=Function.prototype[Symbol.hasInstance],Object.defineProperty(ge,Symbol.hasInstance,{value:a(function(e){return qa.call(this,e)?!0:this!==ge?!1:e&&e._writableState instanceof Co},"value")})):qa=a(function(e){return e instanceof this},"realHasInstance");function ge(t){pn=pn||Cr();var e=this instanceof pn;if(!e&&!qa.call(ge,this))return new ge(t);this._writableState=new Co(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Og.call(this)}a(ge,"Writable");ge.prototype.pipe=function(){mn(this,new yA)};function EA(t,e){var r=new vA;mn(t,r),process.nextTick(e,r)}a(EA,"writeAfterEnd");function SA(t,e,r,i){var n;return r===null?n=new bA:typeof r!="string"&&!e.objectMode&&(n=new pA("chunk",["string","Buffer"],r)),n?(mn(t,n),process.nextTick(i,n),!1):!0}a(SA,"validChunk");ge.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&uA(t);return o&&!za.isBuffer(t)&&(t=fA(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=FA),i.ending?EA(this,r):(o||SA(this,i,t,r))&&(i.pendingcb++,n=TA(this,i,o,t,e,r)),n};ge.prototype.cork=function(){this._writableState.corked++};ge.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Rg(this,t))};ge.prototype.setDefaultEncoding=a(function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _A(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");Object.defineProperty(ge.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function xA(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=za.from(e,r)),e}a(xA,"decodeChunk");Object.defineProperty(ge.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});function TA(t,e,r,i,n,o){if(!r){var s=xA(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var l=e.objectMode?1:i.length;e.length+=l;var f=e.length<e.highWaterMark;if(f||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else rh(t,e,!1,l,i,n,o);return f}a(TA,"writeOrBuffer");function rh(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new gA("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}a(rh,"doWrite");function OA(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(Do,t,e),t._writableState.errorEmitted=!0,mn(t,i)):(n(i),t._writableState.errorEmitted=!0,mn(t,i),Do(t,e))}a(OA,"onwriteError");function RA(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}a(RA,"onwriteStateUpdate");function kA(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new wA;if(RA(r),e)OA(t,r,i,e,n);else{var o=kg(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Rg(t,r),i?process.nextTick(xg,t,r,o,n):xg(t,r,o,n)}}a(kA,"onwrite");function xg(t,e,r,i){r||PA(t,e),e.pendingcb--,i(),Do(t,e)}a(xg,"afterWrite");function PA(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}a(PA,"onwriteDrain");function Rg(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,rh(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Tg(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,u=r.callback,h=e.objectMode?1:f.length;if(rh(t,e,!1,h,f,c,u),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}a(Rg,"clearBuffer");ge.prototype._write=function(t,e,r){r(new mA("_write()"))};ge.prototype._writev=null;ge.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||DA(this,i,r),this};Object.defineProperty(ge.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function kg(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}a(kg,"needFinish");function AA(t,e){t._final(function(r){e.pendingcb--,r&&mn(t,r),e.prefinished=!0,t.emit("prefinish"),Do(t,e)})}a(AA,"callFinal");function IA(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(AA,t,e)):(e.prefinished=!0,t.emit("prefinish")))}a(IA,"prefinish");function Do(t,e){var r=kg(e);if(r&&(IA(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}a(Do,"finishMaybe");function DA(t,e,r){e.ending=!0,Do(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}a(DA,"endWritable");function CA(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}a(CA,"onCorkedFinish");Object.defineProperty(ge.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:a(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")});ge.prototype.destroy=ih.destroy;ge.prototype._undestroy=ih.undestroy;ge.prototype._destroy=function(t,e){e(t)}});var Cr=T((d6,Ig)=>{"use strict";var NA=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Ig.exports=Kt;var Ag=Ka(),oh=Wa();Gt()(Kt,Ag);for(nh=NA(oh.prototype),Va=0;Va<nh.length;Va++)Ga=nh[Va],Kt.prototype[Ga]||(Kt.prototype[Ga]=oh.prototype[Ga]);var nh,Ga,Va;function Kt(t){if(!(this instanceof Kt))return new Kt(t);Ag.call(this,t),oh.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",BA)))}a(Kt,"Duplex");Object.defineProperty(Kt.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(Kt.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(Kt.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function BA(){this._writableState.ended||process.nextTick(LA,this)}a(BA,"onend");function LA(t){t.end()}a(LA,"onEndNT");Object.defineProperty(Kt.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:a(function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")})});var No=T((sh,Cg)=>{var Za=ni(),Zt=Za.Buffer;function Dg(t,e){for(var r in t)e[r]=t[r]}a(Dg,"copyProps");Zt.from&&Zt.alloc&&Zt.allocUnsafe&&Zt.allocUnsafeSlow?Cg.exports=Za:(Dg(Za,sh),sh.Buffer=ui);function ui(t,e,r){return Zt(t,e,r)}a(ui,"SafeBuffer");ui.prototype=Object.create(Zt.prototype);Dg(Zt,ui);ui.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Zt(t,e,r)};ui.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Zt(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};ui.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Zt(t)};ui.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Za.SlowBuffer(t)}});var ch=T(Bg=>{"use strict";var lh=No().Buffer,Ng=lh.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function $A(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}a($A,"_normalizeEncoding");function MA(t){var e=$A(t);if(typeof e!="string"&&(lh.isEncoding===Ng||!Ng(t)))throw new Error("Unknown encoding: "+t);return e||t}a(MA,"normalizeEncoding");Bg.StringDecoder=Bo;function Bo(t){this.encoding=MA(t);var e;switch(this.encoding){case"utf16le":this.text=WA,this.end=VA,e=4;break;case"utf8":this.fillLast=HA,e=4;break;case"base64":this.text=GA,this.end=KA,e=3;break;default:this.write=ZA,this.end=XA;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lh.allocUnsafe(e)}a(Bo,"StringDecoder");Bo.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Bo.prototype.end=zA;Bo.prototype.text=qA;Bo.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function ah(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}a(ah,"utf8CheckByte");function jA(t,e,r){var i=e.length-1;if(i<r)return 0;var n=ah(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=ah(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=ah(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}a(jA,"utf8CheckIncomplete");function UA(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}a(UA,"utf8CheckExtraBytes");function HA(t){var e=this.lastTotal-this.lastNeed,r=UA(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}a(HA,"utf8FillLast");function qA(t,e){var r=jA(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}a(qA,"utf8Text");function zA(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}a(zA,"utf8End");function WA(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}a(WA,"utf16Text");function VA(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}a(VA,"utf16End");function GA(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}a(GA,"base64Text");function KA(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}a(KA,"base64End");function ZA(t){return t.toString(this.encoding)}a(ZA,"simpleWrite");function XA(t){return t&&t.length?this.write(t):""}a(XA,"simpleEnd")});var Lo=T((g6,Mg)=>{"use strict";var Lg=fi().codes.ERR_STREAM_PREMATURE_CLOSE;function YA(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}a(YA,"once");function JA(){}a(JA,"noop");function QA(t){return t.setHeader&&typeof t.abort=="function"}a(QA,"isRequest");function $g(t,e,r){if(typeof e=="function")return $g(t,null,e);e||(e={}),r=YA(r||JA);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,o=a(function(){t.writable||l()},"onlegacyfinish"),s=t._writableState&&t._writableState.finished,l=a(function(){n=!1,s=!0,i||r.call(t)},"onfinish"),f=t._readableState&&t._readableState.endEmitted,c=a(function(){i=!1,f=!0,n||r.call(t)},"onend"),u=a(function(m){r.call(t,m)},"onerror"),h=a(function(){var m;if(i&&!f)return(!t._readableState||!t._readableState.ended)&&(m=new Lg),r.call(t,m);if(n&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new Lg),r.call(t,m)},"onclose"),d=a(function(){t.req.on("finish",l)},"onrequest");return QA(t)?(t.on("complete",l),t.on("abort",h),t.req?d():t.on("request",d)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",l),e.error!==!1&&t.on("error",u),t.on("close",h),function(){t.removeListener("complete",l),t.removeListener("abort",h),t.removeListener("request",d),t.req&&t.req.removeListener("finish",l),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",l),t.removeListener("end",c),t.removeListener("error",u),t.removeListener("close",h)}}a($g,"eos");Mg.exports=$g});var Ug=T((v6,jg)=>{"use strict";var Xa;function Nr(t,e,r){return e=eI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a(Nr,"_defineProperty");function eI(t){var e=tI(t,"string");return typeof e=="symbol"?e:String(e)}a(eI,"_toPropertyKey");function tI(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}a(tI,"_toPrimitive");var rI=Lo(),Br=Symbol("lastResolve"),hi=Symbol("lastReject"),$o=Symbol("error"),Ya=Symbol("ended"),di=Symbol("lastPromise"),fh=Symbol("handlePromise"),pi=Symbol("stream");function Lr(t,e){return{value:t,done:e}}a(Lr,"createIterResult");function iI(t){var e=t[Br];if(e!==null){var r=t[pi].read();r!==null&&(t[di]=null,t[Br]=null,t[hi]=null,e(Lr(r,!1)))}}a(iI,"readAndResolve");function nI(t){process.nextTick(iI,t)}a(nI,"onReadable");function oI(t,e){return function(r,i){t.then(function(){if(e[Ya]){r(Lr(void 0,!0));return}e[fh](r,i)},i)}}a(oI,"wrapForNext");var sI=Object.getPrototypeOf(function(){}),aI=Object.setPrototypeOf((Xa={get stream(){return this[pi]},next:a(function(){var e=this,r=this[$o];if(r!==null)return Promise.reject(r);if(this[Ya])return Promise.resolve(Lr(void 0,!0));if(this[pi].destroyed)return new Promise(function(s,l){process.nextTick(function(){e[$o]?l(e[$o]):s(Lr(void 0,!0))})});var i=this[di],n;if(i)n=new Promise(oI(i,this));else{var o=this[pi].read();if(o!==null)return Promise.resolve(Lr(o,!1));n=new Promise(this[fh])}return this[di]=n,n},"next")},Nr(Xa,Symbol.asyncIterator,function(){return this}),Nr(Xa,"return",a(function(){var e=this;return new Promise(function(r,i){e[pi].destroy(null,function(n){if(n){i(n);return}r(Lr(void 0,!0))})})},"_return")),Xa),sI),lI=a(function(e){var r,i=Object.create(aI,(r={},Nr(r,pi,{value:e,writable:!0}),Nr(r,Br,{value:null,writable:!0}),Nr(r,hi,{value:null,writable:!0}),Nr(r,$o,{value:null,writable:!0}),Nr(r,Ya,{value:e._readableState.endEmitted,writable:!0}),Nr(r,fh,{value:a(function(o,s){var l=i[pi].read();l?(i[di]=null,i[Br]=null,i[hi]=null,o(Lr(l,!1))):(i[Br]=o,i[hi]=s)},"value"),writable:!0}),r));return i[di]=null,rI(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[hi];o!==null&&(i[di]=null,i[Br]=null,i[hi]=null,o(n)),i[$o]=n;return}var s=i[Br];s!==null&&(i[di]=null,i[Br]=null,i[hi]=null,s(Lr(void 0,!0))),i[Ya]=!0}),e.on("readable",nI.bind(null,i)),i},"createReadableStreamAsyncIterator");jg.exports=lI});var qg=T((F6,Hg)=>{Hg.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Ka=T((S6,Qg)=>{"use strict";Qg.exports=ie;var wn;ie.ReadableState=Gg;var E6=Io().EventEmitter,Vg=a(function(e,r){return e.listeners(r).length},"EElistenerCount"),jo=Zu(),Ja=ni().Buffer,cI=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function fI(t){return Ja.from(t)}a(fI,"_uint8ArrayToBuffer");function uI(t){return Ja.isBuffer(t)||t instanceof cI}a(uI,"_isUint8Array");var uh=Xu(),K;uh&&uh.debuglog?K=uh.debuglog("stream"):K=a(function(){},"debug");var hI=wg(),gh=Qu(),dI=eh(),pI=dI.getHighWaterMark,Qa=fi().codes,mI=Qa.ERR_INVALID_ARG_TYPE,wI=Qa.ERR_STREAM_PUSH_AFTER_EOF,yI=Qa.ERR_METHOD_NOT_IMPLEMENTED,gI=Qa.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,yn,hh,dh;Gt()(ie,jo);var Mo=gh.errorOrDestroy,ph=["error","close","destroy","pause","resume"];function bI(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}a(bI,"prependListener");function Gg(t,e,r){wn=wn||Cr(),t=t||{},typeof r!="boolean"&&(r=e instanceof wn),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=pI(this,t,"readableHighWaterMark",r),this.buffer=new hI,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(yn||(yn=ch().StringDecoder),this.decoder=new yn(t.encoding),this.encoding=t.encoding)}a(Gg,"ReadableState");function ie(t){if(wn=wn||Cr(),!(this instanceof ie))return new ie(t);var e=this instanceof wn;this._readableState=new Gg(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),jo.call(this)}a(ie,"Readable");Object.defineProperty(ie.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:a(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")});ie.prototype.destroy=gh.destroy;ie.prototype._undestroy=gh.undestroy;ie.prototype._destroy=function(t,e){e(t)};ie.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Ja.from(t,e),e=""),i=!0),Kg(this,t,e,!1,i)};ie.prototype.unshift=function(t){return Kg(this,t,null,!0,!1)};function Kg(t,e,r,i,n){K("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,FI(t,o);else{var s;if(n||(s=vI(o,e)),s)Mo(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Ja.prototype&&(e=fI(e)),i)o.endEmitted?Mo(t,new gI):mh(t,o,e,!0);else if(o.ended)Mo(t,new wI);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?mh(t,o,e,!1):yh(t,o)):mh(t,o,e,!1)}else i||(o.reading=!1,yh(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}a(Kg,"readableAddChunk");function mh(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&el(t)),yh(t,e)}a(mh,"addChunk");function vI(t,e){var r;return!uI(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new mI("chunk",["string","Buffer","Uint8Array"],e)),r}a(vI,"chunkInvalid");ie.prototype.isPaused=function(){return this._readableState.flowing===!1};ie.prototype.setEncoding=function(t){yn||(yn=ch().StringDecoder);var e=new yn(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var zg=1073741824;function _I(t){return t>=zg?t=zg:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}a(_I,"computeNewHighWaterMark");function Wg(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=_I(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}a(Wg,"howMuchToRead");ie.prototype.read=function(t){K("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return K("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?wh(this):el(this),null;if(t=Wg(t,e),t===0&&e.ended)return e.length===0&&wh(this),null;var i=e.needReadable;K("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,K("length less than watermark",i)),e.ended||e.reading?(i=!1,K("reading or ended",i)):i&&(K("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Wg(r,e)));var n;return t>0?n=Yg(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&wh(this)),n!==null&&this.emit("data",n),n};function FI(t,e){if(K("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?el(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Zg(t)))}}a(FI,"onEofChunk");function el(t){var e=t._readableState;K("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(K("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Zg,t))}a(el,"emitReadable");function Zg(t){var e=t._readableState;K("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,bh(t)}a(Zg,"emitReadable_");function yh(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(EI,t,e))}a(yh,"maybeReadMore");function EI(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(K("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}a(EI,"maybeReadMore_");ie.prototype._read=function(t){Mo(this,new yI("_read()"))};ie.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,K("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=n?l:w;i.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(y,v){K("onunpipe"),y===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,u())}a(s,"onunpipe");function l(){K("onend"),t.end()}a(l,"onend");var f=SI(r);t.on("drain",f);var c=!1;function u(){K("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",w),r.removeListener("data",h),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f()}a(u,"cleanup"),r.on("data",h);function h(y){K("ondata");var v=t.write(y);K("dest.write",v),v===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&Jg(i.pipes,t)!==-1)&&!c&&(K("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}a(h,"ondata");function d(y){K("onerror",y),w(),t.removeListener("error",d),Vg(t,"error")===0&&Mo(t,y)}a(d,"onerror"),bI(t,"error",d);function p(){t.removeListener("finish",m),w()}a(p,"onclose"),t.once("close",p);function m(){K("onfinish"),t.removeListener("close",p),w()}a(m,"onfinish"),t.once("finish",m);function w(){K("unpipe"),r.unpipe(t)}return a(w,"unpipe"),t.emit("pipe",r),i.flowing||(K("pipe resume"),r.resume()),t};function SI(t){return a(function(){var r=t._readableState;K("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Vg(t,"data")&&(r.flowing=!0,bh(t))},"pipeOnDrainFunctionResult")}a(SI,"pipeOnDrain");ie.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Jg(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ie.prototype.on=function(t,e){var r=jo.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,K("on readable",i.length,i.reading),i.length?el(this):i.reading||process.nextTick(xI,this)),r};ie.prototype.addListener=ie.prototype.on;ie.prototype.removeListener=function(t,e){var r=jo.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Xg,this),r};ie.prototype.removeAllListeners=function(t){var e=jo.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Xg,this),e};function Xg(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}a(Xg,"updateReadableListening");function xI(t){K("readable nexttick read 0"),t.read(0)}a(xI,"nReadingNextTick");ie.prototype.resume=function(){var t=this._readableState;return t.flowing||(K("resume"),t.flowing=!t.readableListening,TI(this,t)),t.paused=!1,this};function TI(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(OI,t,e))}a(TI,"resume");function OI(t,e){K("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),bh(t),e.flowing&&!e.reading&&t.read(0)}a(OI,"resume_");ie.prototype.pause=function(){return K("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(K("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function bh(t){var e=t._readableState;for(K("flow",e.flowing);e.flowing&&t.read()!==null;);}a(bh,"flow");ie.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(K("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(K("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var l=e.push(s);l||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=a(function(l){return a(function(){return t[l].apply(t,arguments)},"methodWrapReturnFunction")},"methodWrap")(n));for(var o=0;o<ph.length;o++)t.on(ph[o],this.emit.bind(this,ph[o]));return this._read=function(s){K("wrapped _read",s),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(ie.prototype[Symbol.asyncIterator]=function(){return hh===void 0&&(hh=Ug()),hh(this)});Object.defineProperty(ie.prototype,"readableHighWaterMark",{enumerable:!1,get:a(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(ie.prototype,"readableBuffer",{enumerable:!1,get:a(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(ie.prototype,"readableFlowing",{enumerable:!1,get:a(function(){return this._readableState.flowing},"get"),set:a(function(e){this._readableState&&(this._readableState.flowing=e)},"set")});ie._fromList=Yg;Object.defineProperty(ie.prototype,"readableLength",{enumerable:!1,get:a(function(){return this._readableState.length},"get")});function Yg(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}a(Yg,"fromList");function wh(t){var e=t._readableState;K("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(RI,e,t))}a(wh,"endReadable");function RI(t,e){if(K("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}a(RI,"endReadableNT");typeof Symbol=="function"&&(ie.from=function(t,e){return dh===void 0&&(dh=qg()),dh(ie,t,e)});function Jg(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}a(Jg,"indexOf")});var il=T((T6,tb)=>{"use strict";tb.exports=cr;var tl=fi().codes,kI=tl.ERR_METHOD_NOT_IMPLEMENTED,PI=tl.ERR_MULTIPLE_CALLBACK,AI=tl.ERR_TRANSFORM_ALREADY_TRANSFORMING,II=tl.ERR_TRANSFORM_WITH_LENGTH_0,rl=Cr();Gt()(cr,rl);function DI(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new PI);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}a(DI,"afterTransform");function cr(t){if(!(this instanceof cr))return new cr(t);rl.call(this,t),this._transformState={afterTransform:DI.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",CI)}a(cr,"Transform");function CI(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){eb(t,e,r)}):eb(this,null,null)}a(CI,"prefinish");cr.prototype.push=function(t,e){return this._transformState.needTransform=!1,rl.prototype.push.call(this,t,e)};cr.prototype._transform=function(t,e,r){r(new kI("_transform()"))};cr.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};cr.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};cr.prototype._destroy=function(t,e){rl.prototype._destroy.call(this,t,function(r){e(r)})};function eb(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new II;if(t._transformState.transforming)throw new AI;return t.push(null)}a(eb,"done")});var vh=T((R6,ib)=>{"use strict";ib.exports=Uo;var rb=il();Gt()(Uo,rb);function Uo(t){if(!(this instanceof Uo))return new Uo(t);rb.call(this,t)}a(Uo,"PassThrough");Uo.prototype._transform=function(t,e,r){r(null,t)}});var Fh=T((P6,ab)=>{"use strict";var _h;function NI(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}a(NI,"once");var sb=fi().codes,BI=sb.ERR_MISSING_ARGS,LI=sb.ERR_STREAM_DESTROYED;function nb(t){if(t)throw t}a(nb,"noop");function $I(t){return t.setHeader&&typeof t.abort=="function"}a($I,"isRequest");function MI(t,e,r,i){i=NI(i);var n=!1;t.on("close",function(){n=!0}),_h===void 0&&(_h=Lo()),_h(t,{readable:e,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,$I(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(s||new LI("pipe"))}}}a(MI,"destroyer");function ob(t){t()}a(ob,"call");function jI(t,e){return t.pipe(e)}a(jI,"pipe");function UI(t){return!t.length||typeof t[t.length-1]!="function"?nb:t.pop()}a(UI,"popCallback");function HI(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=UI(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new BI("streams");var n,o=e.map(function(s,l){var f=l<e.length-1,c=l>0;return MI(s,f,c,function(u){n||(n=u),u&&o.forEach(ob),!f&&(o.forEach(ob),i(n))})});return e.reduce(jI)}a(HI,"pipeline");ab.exports=HI});var cb=T((I6,lb)=>{lb.exports=yt;var Eh=Io().EventEmitter,qI=Gt();qI(yt,Eh);yt.Readable=Ka();yt.Writable=Wa();yt.Duplex=Cr();yt.Transform=il();yt.PassThrough=vh();yt.finished=Lo();yt.pipeline=Fh();yt.Stream=yt;function yt(){Eh.call(this)}a(yt,"Stream");yt.prototype.pipe=function(t,e){var r=this;function i(u){t.writable&&t.write(u)===!1&&r.pause&&r.pause()}a(i,"ondata"),r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}a(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}a(s,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}a(l,"onclose");function f(u){if(c(),Eh.listenerCount(this,"error")===0)throw u}a(f,"onerror"),r.on("error",f),t.on("error",f);function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return a(c,"cleanup"),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}});var ub=T(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.Writable=gn.Readable=void 0;var fb=cb();Object.defineProperty(gn,"Readable",{enumerable:!0,get:a(function(){return fb.Readable},"get")});Object.defineProperty(gn,"Writable",{enumerable:!0,get:a(function(){return fb.Writable},"get")})});var Sh=T(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.EventEmitter=void 0;var zI=Io();Object.defineProperty(nl,"EventEmitter",{enumerable:!0,get:a(function(){return zI.EventEmitter},"get")})});var hb=T(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.FileHandle=void 0;var He=Ir(),WI=Sh(),Th=class Th extends WI.EventEmitter{constructor(e,r){super(),this.refs=1,this.closePromise=null,this.position=0,this.readableWebStreamLocked=!1,this.fs=e,this.fd=r}getAsyncId(){return this.fd}appendFile(e,r){return(0,He.promisify)(this.fs,"appendFile")(this.fd,e,r)}chmod(e){return(0,He.promisify)(this.fs,"fchmod")(this.fd,e)}chown(e,r){return(0,He.promisify)(this.fs,"fchown")(this.fd,e,r)}close(){if(this.fd===-1)return Promise.resolve();if(this.closePromise)return this.closePromise;if(this.refs--,this.refs===0){let e=this.fd;this.fd=-1,this.closePromise=(0,He.promisify)(this.fs,"close")(e).finally(()=>{this.closePromise=null})}else this.closePromise=new Promise((e,r)=>{this.closeResolve=e,this.closeReject=r}).finally(()=>{this.closePromise=null,this.closeReject=void 0,this.closeResolve=void 0});return this.emit("close"),this.closePromise}datasync(){return(0,He.promisify)(this.fs,"fdatasync")(this.fd)}createReadStream(e){return this.fs.createReadStream("",{...e,fd:this})}createWriteStream(e){return this.fs.createWriteStream("",{...e,fd:this})}readableWebStream(e={}){let{type:r="bytes",autoClose:i=!1}=e,n=0;if(this.fd===-1)throw new Error("The FileHandle is closed");if(this.closePromise)throw new Error("The FileHandle is closing");if(this.readableWebStreamLocked)throw new Error("An error will be thrown if this method is called more than once or is called after the FileHandle is closed or closing.");this.readableWebStreamLocked=!0,this.ref();let o=a(()=>{this.readableWebStreamLocked=!1,this.unref(),i&&this.close().catch(()=>{})},"unlockAndCleanup");return new ReadableStream({type:r==="bytes"?"bytes":void 0,autoAllocateChunkSize:16384,pull:a(async s=>{try{let l=s.byobRequest?.view;if(!l){let c=new Uint8Array(16384),u=await this.read(c,0,c.length,n);if(u.bytesRead===0){s.close(),o();return}n+=u.bytesRead,s.enqueue(c.slice(0,u.bytesRead));return}let f=await this.read(l,l.byteOffset,l.byteLength,n);if(f.bytesRead===0){s.close(),o();return}n+=f.bytesRead,s.byobRequest.respond(f.bytesRead)}catch(l){s.error(l),o()}},"pull"),cancel:a(async()=>{o()},"cancel")})}async read(e,r,i,n){let o=n??this.position,s=await(0,He.promisify)(this.fs,"read",l=>({bytesRead:l,buffer:e}))(this.fd,e,r,i,o);return n==null&&(this.position+=s.bytesRead),s}readv(e,r){return(0,He.promisify)(this.fs,"readv",i=>({bytesRead:i,buffers:e}))(this.fd,e,r)}readFile(e){return(0,He.promisify)(this.fs,"readFile")(this.fd,e)}stat(e){return(0,He.promisify)(this.fs,"fstat")(this.fd,e)}sync(){return(0,He.promisify)(this.fs,"fsync")(this.fd)}truncate(e){return(0,He.promisify)(this.fs,"ftruncate")(this.fd,e)}utimes(e,r){return(0,He.promisify)(this.fs,"futimes")(this.fd,e,r)}async write(e,r,i,n){let o=typeof n!="number",s=o?this.position:n,l=await(0,He.promisify)(this.fs,"write",f=>({bytesWritten:f,buffer:e}))(this.fd,e,r,i,s);return o&&(this.position+=l.bytesWritten),l}writev(e,r){return(0,He.promisify)(this.fs,"writev",i=>({bytesWritten:i,buffers:e}))(this.fd,e,r)}writeFile(e,r){return(0,He.promisify)(this.fs,"writeFile")(this.fd,e,r)}async[Symbol.asyncDispose](){await this.close()}ref(){this.refs++}unref(){this.refs--,this.refs===0&&(this.fd=-1,this.closeResolve&&(0,He.promisify)(this.fs,"close")(this.fd).then(this.closeResolve,this.closeReject))}};a(Th,"FileHandle");var xh=Th;ol.FileHandle=xh});var db=T(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.FsPromises=void 0;var ne=Ir(),VI=Pt(),kh=class kh{constructor(e,r,i={}){if(this.fs=e,this.path=r,this.options=i,this.eventQueue=[],this.resolveQueue=[],this.finished=!1,this.maxQueue=i.maxQueue||2048,this.overflow=i.overflow||"ignore",this.startWatching(),i.signal){if(i.signal.aborted){this.finish();return}i.signal.addEventListener("abort",()=>{this.finish()})}}startWatching(){try{this.watcher=this.fs.watch(this.path,this.options,(e,r)=>{this.enqueueEvent({eventType:e,filename:r})})}catch(e){throw this.finish(),e}}enqueueEvent(e){if(!this.finished){if(this.eventQueue.length>=this.maxQueue)if(this.overflow==="throw"){let r=new Error(`Watch queue overflow: more than ${this.maxQueue} events queued`);this.finish(r);return}else this.eventQueue.shift(),console.warn(`Watch queue overflow: dropping event due to exceeding maxQueue of ${this.maxQueue}`);if(this.eventQueue.push(e),this.resolveQueue.length>0){let{resolve:r}=this.resolveQueue.shift(),i=this.eventQueue.shift();r({value:i,done:!1})}}}finish(e){if(!this.finished)for(this.finished=!0,this.watcher&&(this.watcher.close(),this.watcher=null);this.resolveQueue.length>0;){let{resolve:r,reject:i}=this.resolveQueue.shift();e?i(e):r({value:void 0,done:!0})}}async next(){return this.finished?{value:void 0,done:!0}:this.eventQueue.length>0?{value:this.eventQueue.shift(),done:!1}:new Promise((e,r)=>{this.resolveQueue.push({resolve:e,reject:r})})}async return(){return this.finish(),{value:void 0,done:!0}}async throw(e){throw this.finish(e),e}[Symbol.asyncIterator](){return this}};a(kh,"FSWatchAsyncIterator");var Oh=kh,Ph=class Ph{constructor(e,r){this.fs=e,this.FileHandle=r,this.constants=VI.constants,this.cp=(0,ne.promisify)(this.fs,"cp"),this.opendir=(0,ne.promisify)(this.fs,"opendir"),this.statfs=(0,ne.promisify)(this.fs,"statfs"),this.lutimes=(0,ne.promisify)(this.fs,"lutimes"),this.glob=(0,ne.promisify)(this.fs,"glob"),this.access=(0,ne.promisify)(this.fs,"access"),this.chmod=(0,ne.promisify)(this.fs,"chmod"),this.chown=(0,ne.promisify)(this.fs,"chown"),this.copyFile=(0,ne.promisify)(this.fs,"copyFile"),this.lchmod=(0,ne.promisify)(this.fs,"lchmod"),this.lchown=(0,ne.promisify)(this.fs,"lchown"),this.link=(0,ne.promisify)(this.fs,"link"),this.lstat=(0,ne.promisify)(this.fs,"lstat"),this.mkdir=(0,ne.promisify)(this.fs,"mkdir"),this.mkdtemp=(0,ne.promisify)(this.fs,"mkdtemp"),this.readdir=(0,ne.promisify)(this.fs,"readdir"),this.readlink=(0,ne.promisify)(this.fs,"readlink"),this.realpath=(0,ne.promisify)(this.fs,"realpath"),this.rename=(0,ne.promisify)(this.fs,"rename"),this.rmdir=(0,ne.promisify)(this.fs,"rmdir"),this.rm=(0,ne.promisify)(this.fs,"rm"),this.stat=(0,ne.promisify)(this.fs,"stat"),this.symlink=(0,ne.promisify)(this.fs,"symlink"),this.truncate=(0,ne.promisify)(this.fs,"truncate"),this.unlink=(0,ne.promisify)(this.fs,"unlink"),this.utimes=(0,ne.promisify)(this.fs,"utimes"),this.readFile=(i,n)=>(0,ne.promisify)(this.fs,"readFile")(i instanceof this.FileHandle?i.fd:i,n),this.appendFile=(i,n,o)=>(0,ne.promisify)(this.fs,"appendFile")(i instanceof this.FileHandle?i.fd:i,n,o),this.open=(i,n="r",o)=>(0,ne.promisify)(this.fs,"open",s=>new this.FileHandle(this.fs,s))(i,n,o),this.writeFile=(i,n,o)=>((0,ne.isReadableStream)(n)?(0,ne.streamToBuffer)(n):Promise.resolve(n)).then(l=>(0,ne.promisify)(this.fs,"writeFile")(i instanceof this.FileHandle?i.fd:i,l,o)),this.watch=(i,n)=>{let o=typeof n=="string"?{encoding:n}:n||{};return new Oh(this.fs,i,o)}}};a(Ph,"FsPromises");var Rh=Ph;sl.FsPromises=Rh});var pb=T(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.printTree=void 0;var GI=a((t="",e)=>{let r="",i=e.length-1;for(;i>=0&&!e[i];i--);for(let n=0;n<=i;n++){let o=e[n];if(!o)continue;let s=n===i,l=o(t+(s?" ":"\u2502")+" "),f=l?s?"\u2514\u2500":"\u251C\u2500":"\u2502";r+=`
|
|
9
|
-
`+t+f+(l?" "+l:"")}return r},"printTree");
|
|
4
|
+
var Ox=Object.create;var Ui=Object.defineProperty;var kx=Object.getOwnPropertyDescriptor;var Rx=Object.getOwnPropertyNames;var Px=Object.getPrototypeOf,Ax=Object.prototype.hasOwnProperty;var Ix=(t,e,r)=>e in t?Ui(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var a=(t,e)=>Ui(t,"name",{value:e,configurable:!0}),Cx=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Dx=(t,e)=>()=>(t&&(e=t(t=0)),e);var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Nx=(t,e)=>{for(var r in e)Ui(t,r,{get:e[r],enumerable:!0})},_m=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Rx(e))!Ax.call(t,n)&&n!==r&&Ui(t,n,{get:()=>e[n],enumerable:!(i=kx(e,n))||i.enumerable});return t};var oe=(t,e,r)=>(r=t!=null?Ox(Px(t)):{},_m(e||!t||!t.__esModule?Ui(r,"default",{value:t,enumerable:!0}):r,t)),Fm=t=>_m(Ui({},"__esModule",{value:!0}),t);var H=(t,e,r)=>Ix(t,typeof e!="symbol"?e+"":e,r);var Tr=O((NM,Sm)=>{"use strict";function Ut(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}a(Ut,"assertPath");function Em(t,e){for(var r="",i=0,n=-1,o=0,s,l=0;l<=t.length;++l){if(l<t.length)s=t.charCodeAt(l);else{if(s===47)break;s=47}if(s===47){if(!(n===l-1||o===1))if(n!==l-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",i=0):(r=r.slice(0,f),i=r.length-1-r.lastIndexOf("/")),n=l,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=l,o=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(n+1,l):r=t.slice(n+1,l),i=l-n-1;n=l,o=0}else s===46&&o!==-1?++o:o=-1}return r}a(Em,"normalizeStringPosix");function Bx(t,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+t+i:i}a(Bx,"_format");var Hi={resolve:a(function(){for(var e="",r=!1,i,n=arguments.length-1;n>=-1&&!r;n--){var o;n>=0?o=arguments[n]:(i===void 0&&(i=process.cwd()),o=i),Ut(o),o.length!==0&&(e=o+"/"+e,r=o.charCodeAt(0)===47)}return e=Em(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},"resolve"),normalize:a(function(e){if(Ut(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=Em(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},"normalize"),isAbsolute:a(function(e){return Ut(e),e.length>0&&e.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];Ut(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":Hi.normalize(e)},"join"),relative:a(function(e,r){if(Ut(e),Ut(r),e===r||(e=Hi.resolve(e),r=Hi.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var n=e.length,o=n-i,s=1;s<r.length&&r.charCodeAt(s)===47;++s);for(var l=r.length,f=l-s,c=o<f?o:f,u=-1,h=0;h<=c;++h){if(h===c){if(f>c){if(r.charCodeAt(s+h)===47)return r.slice(s+h+1);if(h===0)return r.slice(s+h)}else o>c&&(e.charCodeAt(i+h)===47?u=h:h===0&&(u=0));break}var d=e.charCodeAt(i+h),p=r.charCodeAt(s+h);if(d!==p)break;d===47&&(u=h)}var m="";for(h=i+u+1;h<=n;++h)(h===n||e.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(s+u):(s+=u,r.charCodeAt(s)===47&&++s,r.slice(s))},"relative"),_makeLong:a(function(e){return e},"_makeLong"),dirname:a(function(e){if(Ut(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,n=-1,o=!0,s=e.length-1;s>=1;--s)if(r=e.charCodeAt(s),r===47){if(!o){n=s;break}}else o=!1;return n===-1?i?"/":".":i&&n===1?"//":e.slice(0,n)},"dirname"),basename:a(function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Ut(e);var i=0,n=-1,o=!0,s;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,f=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!o){i=s+1;break}}else f===-1&&(o=!1,f=s+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(n=s):(l=-1,n=f))}return i===n?n=f:n===-1&&(n=e.length),e.slice(i,n)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){i=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":e.slice(i,n)}},"basename"),extname:a(function(e){Ut(e);for(var r=-1,i=0,n=-1,o=!0,s=0,l=e.length-1;l>=0;--l){var f=e.charCodeAt(l);if(f===47){if(!o){i=l+1;break}continue}n===-1&&(o=!1,n=l+1),f===46?r===-1?r=l:s!==1&&(s=1):r!==-1&&(s=-1)}return r===-1||n===-1||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)},"extname"),format:a(function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return Bx("/",e)},"format"),parse:a(function(e){Ut(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),n=i===47,o;n?(r.root="/",o=1):o=0;for(var s=-1,l=0,f=-1,c=!0,u=e.length-1,h=0;u>=o;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}f===-1&&(c=!1,f=u+1),i===46?s===-1?s=u:h!==1&&(h=1):s!==-1&&(h=-1)}return s===-1||f===-1||h===0||h===1&&s===f-1&&s===l+1?f!==-1&&(l===0&&n?r.base=r.name=e.slice(1,f):r.base=r.name=e.slice(l,f)):(l===0&&n?(r.name=e.slice(1,s),r.base=e.slice(1,f)):(r.name=e.slice(l,s),r.base=e.slice(l,f)),r.ext=e.slice(s,f)),l>0?r.dir=e.slice(0,l-1):n&&(r.dir="/"),r},"parse"),sep:"/",delimiter:":",win32:null,posix:null};Hi.posix=Hi;Sm.exports=Hi});var At=O(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.constants=zi.SEP=void 0;zi.SEP="/";zi.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_SYMLINK:2097152,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});var Of=O(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.Stats=void 0;var Lx=At(),{S_IFMT:$x,S_IFDIR:Mx,S_IFREG:jx,S_IFBLK:Ux,S_IFCHR:Hx,S_IFLNK:qx,S_IFIFO:zx,S_IFSOCK:Wx}=Lx.constants,zs=class zs{static build(e,r=!1){let i=new zs,{uid:n,gid:o,atime:s,mtime:l,ctime:f}=e,c=r?h=>BigInt(h):h=>h;i.uid=c(n),i.gid=c(o),i.rdev=c(e.rdev),i.blksize=c(4096),i.ino=c(e.ino),i.size=c(e.getSize()),i.blocks=c(1),i.atime=s,i.mtime=l,i.ctime=f,i.birthtime=f,i.atimeMs=c(s.getTime()),i.mtimeMs=c(l.getTime());let u=c(f.getTime());if(i.ctimeMs=u,i.birthtimeMs=u,r){i.atimeNs=BigInt(s.getTime())*BigInt(1e6),i.mtimeNs=BigInt(l.getTime())*BigInt(1e6);let h=BigInt(f.getTime())*BigInt(1e6);i.ctimeNs=h,i.birthtimeNs=h}return i.dev=c(0),i.mode=c(e.mode),i.nlink=c(e.nlink),i}_checkModeProperty(e){return(Number(this.mode)&$x)===e}isDirectory(){return this._checkModeProperty(Mx)}isFile(){return this._checkModeProperty(jx)}isBlockDevice(){return this._checkModeProperty(Ux)}isCharacterDevice(){return this._checkModeProperty(Hx)}isSymbolicLink(){return this._checkModeProperty(qx)}isFIFO(){return this._checkModeProperty(zx)}isSocket(){return this._checkModeProperty(Wx)}};a(zs,"Stats");var qs=zs;co.Stats=qs;co.default=qs});var Om=O(Ws=>{"use strict";Ws.byteLength=Gx;Ws.toByteArray=Zx;Ws.fromByteArray=Jx;var Ht=[],pt=[],Vx=typeof Uint8Array<"u"?Uint8Array:Array,kf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oi=0,xm=kf.length;oi<xm;++oi)Ht[oi]=kf[oi],pt[kf.charCodeAt(oi)]=oi;var oi,xm;pt[45]=62;pt[95]=63;function Tm(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}a(Tm,"getLens");function Gx(t){var e=Tm(t),r=e[0],i=e[1];return(r+i)*3/4-i}a(Gx,"byteLength");function Kx(t,e,r){return(e+r)*3/4-r}a(Kx,"_byteLength");function Zx(t){var e,r=Tm(t),i=r[0],n=r[1],o=new Vx(Kx(t,i,n)),s=0,l=n>0?i-4:i,f;for(f=0;f<l;f+=4)e=pt[t.charCodeAt(f)]<<18|pt[t.charCodeAt(f+1)]<<12|pt[t.charCodeAt(f+2)]<<6|pt[t.charCodeAt(f+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=pt[t.charCodeAt(f)]<<2|pt[t.charCodeAt(f+1)]>>4,o[s++]=e&255),n===1&&(e=pt[t.charCodeAt(f)]<<10|pt[t.charCodeAt(f+1)]<<4|pt[t.charCodeAt(f+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}a(Zx,"toByteArray");function Xx(t){return Ht[t>>18&63]+Ht[t>>12&63]+Ht[t>>6&63]+Ht[t&63]}a(Xx,"tripletToBase64");function Yx(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(Xx(i));return n.join("")}a(Yx,"encodeChunk");function Jx(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,l=r-i;s<l;s+=o)n.push(Yx(t,s,s+o>l?l:s+o));return i===1?(e=t[r-1],n.push(Ht[e>>2]+Ht[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(Ht[e>>10]+Ht[e>>4&63]+Ht[e<<2&63]+"=")),n.join("")}a(Jx,"fromByteArray")});var km=O(Rf=>{Rf.read=function(t,e,r,i,n){var o,s,l=n*8-i-1,f=(1<<l)-1,c=f>>1,u=-7,h=r?n-1:0,d=r?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=l;u>0;o=o*256+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=s*256+t[e+h],h+=d,u-=8);if(o===0)o=1-c;else{if(o===f)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c}return(p?-1:1)*s*Math.pow(2,o-i)};Rf.write=function(t,e,r,i,n,o){var s,l,f,c=o*8-n-1,u=(1<<c)-1,h=u>>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,m=i?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+h>=1?e+=d/f:e+=d*Math.pow(2,1-h),e*f>=2&&(s++,f/=2),s+h>=u?(l=0,s=u):s+h>=1?(l=(e*f-1)*Math.pow(2,n),s=s+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;t[r+p]=l&255,p+=m,l/=256,n-=8);for(s=s<<n|l,c+=n;c>0;t[r+p]=s&255,p+=m,s/=256,c-=8);t[r+p-m]|=w*128}});var ai=O(Ki=>{"use strict";var Pf=Om(),Vi=km(),Rm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ki.Buffer=A;Ki.SlowBuffer=nT;Ki.INSPECT_MAX_BYTES=50;var Vs=2147483647;Ki.kMaxLength=Vs;A.TYPED_ARRAY_SUPPORT=Qx();!A.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 Qx(){try{let t=new Uint8Array(1),e={foo:a(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}a(Qx,"typedArraySupport");Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:a(function(){if(A.isBuffer(this))return this.buffer},"get")});Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:a(function(){if(A.isBuffer(this))return this.byteOffset},"get")});function ar(t){if(t>Vs)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,A.prototype),e}a(ar,"createBuffer");function A(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Df(t)}return Cm(t,e,r)}a(A,"Buffer");A.poolSize=8192;function Cm(t,e,r){if(typeof t=="string")return tT(t,e);if(ArrayBuffer.isView(t))return rT(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(qt(t,ArrayBuffer)||t&&qt(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qt(t,SharedArrayBuffer)||t&&qt(t.buffer,SharedArrayBuffer)))return If(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return A.from(i,e,r);let n=iT(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return A.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}a(Cm,"from");A.from=function(t,e,r){return Cm(t,e,r)};Object.setPrototypeOf(A.prototype,Uint8Array.prototype);Object.setPrototypeOf(A,Uint8Array);function Dm(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"')}a(Dm,"assertSize");function eT(t,e,r){return Dm(t),t<=0?ar(t):e!==void 0?typeof r=="string"?ar(t).fill(e,r):ar(t).fill(e):ar(t)}a(eT,"alloc");A.alloc=function(t,e,r){return eT(t,e,r)};function Df(t){return Dm(t),ar(t<0?0:Nf(t)|0)}a(Df,"allocUnsafe");A.allocUnsafe=function(t){return Df(t)};A.allocUnsafeSlow=function(t){return Df(t)};function tT(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!A.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Nm(t,e)|0,i=ar(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}a(tT,"fromString");function Af(t){let e=t.length<0?0:Nf(t.length)|0,r=ar(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}a(Af,"fromArrayLike");function rT(t){if(qt(t,Uint8Array)){let e=new Uint8Array(t);return If(e.buffer,e.byteOffset,e.byteLength)}return Af(t)}a(rT,"fromArrayView");function If(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,A.prototype),i}a(If,"fromArrayBuffer");function iT(t){if(A.isBuffer(t)){let e=Nf(t.length)|0,r=ar(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Lf(t.length)?ar(0):Af(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Af(t.data)}a(iT,"fromObject");function Nf(t){if(t>=Vs)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Vs.toString(16)+" bytes");return t|0}a(Nf,"checked");function nT(t){return+t!=t&&(t=0),A.alloc(+t)}a(nT,"SlowBuffer");A.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!==A.prototype},"isBuffer");A.compare=a(function(e,r){if(qt(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),qt(r,Uint8Array)&&(r=A.from(r,r.offset,r.byteLength)),!A.isBuffer(e)||!A.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0},"compare");A.isEncoding=a(function(e){switch(String(e).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}},"isEncoding");A.concat=a(function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return A.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=A.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let s=e[i];if(qt(s,Uint8Array))o+s.length>n.length?(A.isBuffer(s)||(s=A.from(s)),s.copy(n,o)):Uint8Array.prototype.set.call(n,s,o);else if(A.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return n},"concat");function Nm(t,e){if(A.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||qt(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 r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Cf(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return zm(t).length;default:if(n)return i?-1:Cf(t).length;e=(""+e).toLowerCase(),n=!0}}a(Nm,"byteLength");A.byteLength=Nm;function oT(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return mT(this,e,r);case"utf8":case"utf-8":return Lm(this,e,r);case"ascii":return dT(this,e,r);case"latin1":case"binary":return pT(this,e,r);case"base64":return uT(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wT(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a(oT,"slowToString");A.prototype._isBuffer=!0;function si(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}a(si,"swap");A.prototype.swap16=a(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)si(this,r,r+1);return this},"swap16");A.prototype.swap32=a(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)si(this,r,r+3),si(this,r+1,r+2);return this},"swap32");A.prototype.swap64=a(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)si(this,r,r+7),si(this,r+1,r+6),si(this,r+2,r+5),si(this,r+3,r+4);return this},"swap64");A.prototype.toString=a(function(){let e=this.length;return e===0?"":arguments.length===0?Lm(this,0,e):oT.apply(this,arguments)},"toString");A.prototype.toLocaleString=A.prototype.toString;A.prototype.equals=a(function(e){if(!A.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:A.compare(this,e)===0},"equals");A.prototype.inspect=a(function(){let e="",r=Ki.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Rm&&(A.prototype[Rm]=A.prototype.inspect);A.prototype.compare=a(function(e,r,i,n,o){if(qt(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let s=o-n,l=i-r,f=Math.min(s,l),c=this.slice(n,o),u=e.slice(r,i);for(let h=0;h<f;++h)if(c[h]!==u[h]){s=c[h],l=u[h];break}return s<l?-1:l<s?1:0},"compare");function Bm(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Lf(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=A.from(e,i)),A.isBuffer(e))return e.length===0?-1:Pm(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Pm(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}a(Bm,"bidirectionalIndexOf");function Pm(t,e,r,i,n){let o=1,s=t.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function f(u,h){return o===1?u[h]:u.readUInt16BE(h*o)}a(f,"read");let c;if(n){let u=-1;for(c=r;c<s;c++)if(f(t,c)===f(e,u===-1?0:c-u)){if(u===-1&&(u=c),c-u+1===l)return u*o}else u!==-1&&(c-=c-u),u=-1}else for(r+l>s&&(r=s-l),c=r;c>=0;c--){let u=!0;for(let h=0;h<l;h++)if(f(t,c+h)!==f(e,h)){u=!1;break}if(u)return c}return-1}a(Pm,"arrayIndexOf");A.prototype.includes=a(function(e,r,i){return this.indexOf(e,r,i)!==-1},"includes");A.prototype.indexOf=a(function(e,r,i){return Bm(this,e,r,i,!0)},"indexOf");A.prototype.lastIndexOf=a(function(e,r,i){return Bm(this,e,r,i,!1)},"lastIndexOf");function sT(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let s;for(s=0;s<i;++s){let l=parseInt(e.substr(s*2,2),16);if(Lf(l))return s;t[r+s]=l}return s}a(sT,"hexWrite");function aT(t,e,r,i){return Gs(Cf(e,t.length-r),t,r,i)}a(aT,"utf8Write");function lT(t,e,r,i){return Gs(vT(e),t,r,i)}a(lT,"asciiWrite");function cT(t,e,r,i){return Gs(zm(e),t,r,i)}a(cT,"base64Write");function fT(t,e,r,i){return Gs(_T(e,t.length-r),t,r,i)}a(fT,"ucs2Write");A.prototype.write=a(function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return sT(this,e,r,i);case"utf8":case"utf-8":return aT(this,e,r,i);case"ascii":case"latin1":case"binary":return lT(this,e,r,i);case"base64":return cT(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fT(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write");A.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function uT(t,e,r){return e===0&&r===t.length?Pf.fromByteArray(t):Pf.fromByteArray(t.slice(e,r))}a(uT,"base64Slice");function Lm(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],s=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=r){let f,c,u,h;switch(l){case 1:o<128&&(s=o);break;case 2:f=t[n+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(s=h));break;case 3:f=t[n+1],c=t[n+2],(f&192)===128&&(c&192)===128&&(h=(o&15)<<12|(f&63)<<6|c&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:f=t[n+1],c=t[n+2],u=t[n+3],(f&192)===128&&(c&192)===128&&(u&192)===128&&(h=(o&15)<<18|(f&63)<<12|(c&63)<<6|u&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,l=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=l}return hT(i)}a(Lm,"utf8Slice");var Am=4096;function hT(t){let e=t.length;if(e<=Am)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Am));return r}a(hT,"decodeCodePointsArray");function dT(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}a(dT,"asciiSlice");function pT(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}a(pT,"latin1Slice");function mT(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=FT[t[o]];return n}a(mT,"hexSlice");function wT(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a(wT,"utf16leSlice");A.prototype.slice=a(function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,A.prototype),n},"slice");function Ce(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}a(Ce,"checkOffset");A.prototype.readUintLE=A.prototype.readUIntLE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ce(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return n},"readUIntLE");A.prototype.readUintBE=A.prototype.readUIntBE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ce(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n},"readUIntBE");A.prototype.readUint8=A.prototype.readUInt8=a(function(e,r){return e=e>>>0,r||Ce(e,1,this.length),this[e]},"readUInt8");A.prototype.readUint16LE=A.prototype.readUInt16LE=a(function(e,r){return e=e>>>0,r||Ce(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");A.prototype.readUint16BE=A.prototype.readUInt16BE=a(function(e,r){return e=e>>>0,r||Ce(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");A.prototype.readUint32LE=A.prototype.readUInt32LE=a(function(e,r){return e=e>>>0,r||Ce(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");A.prototype.readUint32BE=A.prototype.readUInt32BE=a(function(e,r){return e=e>>>0,r||Ce(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");A.prototype.readBigUInt64LE=Or(a(function(e){e=e>>>0,Gi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&fo(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));A.prototype.readBigUInt64BE=Or(a(function(e){e=e>>>0,Gi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&fo(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));A.prototype.readIntLE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ce(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},"readIntLE");A.prototype.readIntBE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ce(e,r,this.length);let n=r,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s},"readIntBE");A.prototype.readInt8=a(function(e,r){return e=e>>>0,r||Ce(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");A.prototype.readInt16LE=a(function(e,r){e=e>>>0,r||Ce(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},"readInt16LE");A.prototype.readInt16BE=a(function(e,r){e=e>>>0,r||Ce(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},"readInt16BE");A.prototype.readInt32LE=a(function(e,r){return e=e>>>0,r||Ce(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");A.prototype.readInt32BE=a(function(e,r){return e=e>>>0,r||Ce(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");A.prototype.readBigInt64LE=Or(a(function(e){e=e>>>0,Gi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&fo(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));A.prototype.readBigInt64BE=Or(a(function(e){e=e>>>0,Gi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&fo(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)},"readBigInt64BE"));A.prototype.readFloatLE=a(function(e,r){return e=e>>>0,r||Ce(e,4,this.length),Vi.read(this,e,!0,23,4)},"readFloatLE");A.prototype.readFloatBE=a(function(e,r){return e=e>>>0,r||Ce(e,4,this.length),Vi.read(this,e,!1,23,4)},"readFloatBE");A.prototype.readDoubleLE=a(function(e,r){return e=e>>>0,r||Ce(e,8,this.length),Vi.read(this,e,!0,52,8)},"readDoubleLE");A.prototype.readDoubleBE=a(function(e,r){return e=e>>>0,r||Ce(e,8,this.length),Vi.read(this,e,!1,52,8)},"readDoubleBE");function Qe(t,e,r,i,n,o){if(!A.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}a(Qe,"checkInt");A.prototype.writeUintLE=A.prototype.writeUIntLE=a(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;Qe(this,e,r,i,l,0)}let o=1,s=0;for(this[r]=e&255;++s<i&&(o*=256);)this[r+s]=e/o&255;return r+i},"writeUIntLE");A.prototype.writeUintBE=A.prototype.writeUIntBE=a(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;Qe(this,e,r,i,l,0)}let o=i-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+i},"writeUIntBE");A.prototype.writeUint8=A.prototype.writeUInt8=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,1,255,0),this[r]=e&255,r+1},"writeUInt8");A.prototype.writeUint16LE=A.prototype.writeUInt16LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeUInt16LE");A.prototype.writeUint16BE=A.prototype.writeUInt16BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeUInt16BE");A.prototype.writeUint32LE=A.prototype.writeUInt32LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},"writeUInt32LE");A.prototype.writeUint32BE=A.prototype.writeUInt32BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeUInt32BE");function $m(t,e,r,i,n){qm(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}a($m,"wrtBigUInt64LE");function Mm(t,e,r,i,n){qm(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}a(Mm,"wrtBigUInt64BE");A.prototype.writeBigUInt64LE=Or(a(function(e,r=0){return $m(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));A.prototype.writeBigUInt64BE=Or(a(function(e,r=0){return Mm(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));A.prototype.writeIntLE=a(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let f=Math.pow(2,8*i-1);Qe(this,e,r,i,f-1,-f)}let o=0,s=1,l=0;for(this[r]=e&255;++o<i&&(s*=256);)e<0&&l===0&&this[r+o-1]!==0&&(l=1),this[r+o]=(e/s>>0)-l&255;return r+i},"writeIntLE");A.prototype.writeIntBE=a(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let f=Math.pow(2,8*i-1);Qe(this,e,r,i,f-1,-f)}let o=i-1,s=1,l=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&l===0&&this[r+o+1]!==0&&(l=1),this[r+o]=(e/s>>0)-l&255;return r+i},"writeIntBE");A.prototype.writeInt8=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},"writeInt8");A.prototype.writeInt16LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeInt16LE");A.prototype.writeInt16BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeInt16BE");A.prototype.writeInt32LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},"writeInt32LE");A.prototype.writeInt32BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Qe(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeInt32BE");A.prototype.writeBigInt64LE=Or(a(function(e,r=0){return $m(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));A.prototype.writeBigInt64BE=Or(a(function(e,r=0){return Mm(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function jm(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}a(jm,"checkIEEE754");function Um(t,e,r,i,n){return e=+e,r=r>>>0,n||jm(t,e,r,4,34028234663852886e22,-34028234663852886e22),Vi.write(t,e,r,i,23,4),r+4}a(Um,"writeFloat");A.prototype.writeFloatLE=a(function(e,r,i){return Um(this,e,r,!0,i)},"writeFloatLE");A.prototype.writeFloatBE=a(function(e,r,i){return Um(this,e,r,!1,i)},"writeFloatBE");function Hm(t,e,r,i,n){return e=+e,r=r>>>0,n||jm(t,e,r,8,17976931348623157e292,-17976931348623157e292),Vi.write(t,e,r,i,52,8),r+8}a(Hm,"writeDouble");A.prototype.writeDoubleLE=a(function(e,r,i){return Hm(this,e,r,!0,i)},"writeDoubleLE");A.prototype.writeDoubleBE=a(function(e,r,i){return Hm(this,e,r,!1,i)},"writeDoubleBE");A.prototype.copy=a(function(e,r,i,n){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o},"copy");A.prototype.fill=a(function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!A.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let s=e.charCodeAt(0);(n==="utf8"&&s<128||n==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else{let s=A.isBuffer(e)?e:A.from(e,n),l=s.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=s[o%l]}return this},"fill");var Wi={};function Bf(t,e,r){var i;Wi[t]=(i=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},a(i,"NodeError"),i)}a(Bf,"E");Bf("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Bf("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Bf("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Im(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Im(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Im(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}a(Im,"addNumericalSeparator");function yT(t,e,r){Gi(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&fo(e,t.length-(r+1))}a(yT,"checkBounds");function qm(t,e,r,i,n,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:l=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:l=`>= ${e}${s} and <= ${r}${s}`,new Wi.ERR_OUT_OF_RANGE("value",l,t)}yT(i,n,o)}a(qm,"checkIntBI");function Gi(t,e){if(typeof t!="number")throw new Wi.ERR_INVALID_ARG_TYPE(e,"number",t)}a(Gi,"validateNumber");function fo(t,e,r){throw Math.floor(t)!==t?(Gi(t,r),new Wi.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Wi.ERR_BUFFER_OUT_OF_BOUNDS:new Wi.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}a(fo,"boundsError");var gT=/[^+/0-9A-Za-z-_]/g;function bT(t){if(t=t.split("=")[0],t=t.trim().replace(gT,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}a(bT,"base64clean");function Cf(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}a(Cf,"utf8ToBytes");function vT(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}a(vT,"asciiToBytes");function _T(t,e){let r,i,n,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}a(_T,"utf16leToBytes");function zm(t){return Pf.toByteArray(bT(t))}a(zm,"base64ToBytes");function Gs(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}a(Gs,"blitBuffer");function qt(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}a(qt,"isInstance");function Lf(t){return t!==t}a(Lf,"numberIsNaN");var FT=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function Or(t){return typeof BigInt>"u"?ET:t}a(Or,"defineBigIntMethod");function ET(){throw new Error("BigInt not supported")}a(ET,"BufferBigIntNotDefined")});var Wm=O(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.Buffer=void 0;var ST=ai();Object.defineProperty(Ks,"Buffer",{enumerable:!0,get:a(function(){return ST.Buffer},"get")})});var Rr=O(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.bufferFrom=kr.bufferAllocUnsafe=kr.Buffer=void 0;var Zs=Wm();Object.defineProperty(kr,"Buffer",{enumerable:!0,get:a(function(){return Zs.Buffer},"get")});function Vm(t,...e){return new Zs.Buffer(t,...e)}a(Vm,"bufferV0P12Ponyfill");var xT=Zs.Buffer.allocUnsafe||Vm;kr.bufferAllocUnsafe=xT;var TT=Zs.Buffer.from||Vm;kr.bufferFrom=TT});var Mf=O(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.inherits=OT;Zi.promisify=kT;Zi.inspect=$f;Zi.format=RT;function OT(t,e){if(t==null)throw new TypeError("The constructor to inherit from is not defined");if(e==null)throw new TypeError("The super constructor to inherit from is not defined");t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}a(OT,"inherits");function kT(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type function');return function(...e){return new Promise((r,i)=>{t.call(this,...e,(n,o)=>{n?i(n):r(o)})})}}a(kT,"promisify");function $f(t){return t===null?"null":t===void 0?"undefined":typeof t=="string"?`'${t}'`:typeof t=="number"||typeof t=="boolean"?String(t):Array.isArray(t)?`[ ${t.map(r=>$f(r)).join(", ")} ]`:typeof t=="object"?`{ ${Object.entries(t).map(([r,i])=>`${r}: ${$f(i)}`).join(", ")} }`:String(t)}a($f,"inspect");function RT(t,...e){if(e.length===0)return t;let r=t,i=0;for(r=r.replace(/%[sdj%]/g,n=>{if(i>=e.length)return n;let o=e[i++];switch(n){case"%s":return String(o);case"%d":return Number(o).toString();case"%j":try{return JSON.stringify(o)}catch{return"[Circular]"}case"%%":return"%";default:return n}});i<e.length;)r+=" "+String(e[i++]);return r}a(RT,"format")});var uo=O(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.AssertionError=Ue.RangeError=Ue.TypeError=Ue.Error=void 0;Ue.message=Zm;Ue.E=Pr;var jf=Mf(),Gm=typeof Symbol>"u"?"_kCode":Symbol("code"),Km={};function Hf(t){var e;return e=class extends t{constructor(i,...n){super(Zm(i,n)),this.code=i,this[Gm]=i,this.name=`${super.name} [${this[Gm]}]`}},a(e,"NodeError"),e}a(Hf,"makeNodeError");var Xs=globalThis,qf=class qf extends Xs.Error{constructor(e){if(typeof e!="object"||e===null)throw new Ue.TypeError("ERR_INVALID_ARG_TYPE","options","object");e.message?super(e.message):super(`${(0,jf.inspect)(e.actual).slice(0,128)} ${e.operator} ${(0,jf.inspect)(e.expected).slice(0,128)}`),this.generatedMessage=!e.message,this.name="AssertionError [ERR_ASSERTION]",this.code="ERR_ASSERTION",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,Ue.Error.captureStackTrace(this,e.stackStartFunction)}};a(qf,"AssertionError");var Uf=qf;Ue.AssertionError=Uf;function Zm(t,e){if(typeof t!="string")throw new Ue.Error("Error message key must be a string");let r=Km[t];if(!r)throw new Ue.Error(`An invalid error message key was used: ${t}.`);let i;if(typeof r=="function")i=r;else{if(i=jf.format,e===void 0||e.length===0)return r;e.unshift(r)}return String(i.apply(null,e))}a(Zm,"message");function Pr(t,e){Km[t]=typeof e=="function"?e:String(e)}a(Pr,"E");Ue.Error=Hf(Xs.Error);Ue.TypeError=Hf(Xs.TypeError);Ue.RangeError=Hf(Xs.RangeError);Pr("ERR_DIR_CLOSED","Directory handle was closed");Pr("ERR_DIR_CONCURRENT_OPERATION","Cannot do synchronous work on directory handle with concurrent asynchronous operations");Pr("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');Pr("ERR_INVALID_FILE_URL_PATH","File URL path %s");Pr("ERR_INVALID_OPT_VALUE",(t,e)=>`The value "${String(e)}" is invalid for option "${t}"`);Pr("ERR_INVALID_OPT_VALUE_ENCODING",t=>`The value "${String(t)}" is invalid for option "encoding"`);Pr("ERR_INVALID_ARG_VALUE","Unable to open file as blob")});var ho=O(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.ENCODING_UTF8=void 0;li.assertEncoding=AT;li.strToEncoding=IT;var zf=Rr(),PT=uo();li.ENCODING_UTF8="utf8";function AT(t){if(t&&!zf.Buffer.isEncoding(t))throw new PT.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",t)}a(AT,"assertEncoding");function IT(t,e){return!e||e===li.ENCODING_UTF8?t:e==="buffer"?new zf.Buffer(t):new zf.Buffer(t).toString(e)}a(IT,"strToEncoding")});var Qs=O(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.Dirent=void 0;var CT=At(),DT=ho(),{S_IFMT:NT,S_IFDIR:BT,S_IFREG:LT,S_IFBLK:$T,S_IFCHR:MT,S_IFLNK:jT,S_IFIFO:UT,S_IFSOCK:HT}=CT.constants,Js=class Js{constructor(){this.name="",this.path="",this.parentPath="",this.mode=0}static build(e,r){let i=new Js,{mode:n}=e.getNode();return i.name=(0,DT.strToEncoding)(e.getName(),r),i.mode=n,i.path=e.getParentPath(),i.parentPath=i.path,i}_checkModeProperty(e){return(this.mode&NT)===e}isDirectory(){return this._checkModeProperty(BT)}isFile(){return this._checkModeProperty(LT)}isBlockDevice(){return this._checkModeProperty($T)}isCharacterDevice(){return this._checkModeProperty(MT)}isSymbolicLink(){return this._checkModeProperty(jT)}isFIFO(){return this._checkModeProperty(UT)}isSocket(){return this._checkModeProperty(HT)}};a(Js,"Dirent");var Ys=Js;po.Dirent=Ys;po.default=Ys});var Xi=O(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.basename=Se.isAbsolute=Se.normalize=Se.dirname=Se.relative=Se.join=Se.posix=Se.sep=Se.resolve=void 0;var lr=Tr();Object.defineProperty(Se,"resolve",{enumerable:!0,get:a(function(){return lr.resolve},"get")});Object.defineProperty(Se,"sep",{enumerable:!0,get:a(function(){return lr.sep},"get")});Object.defineProperty(Se,"posix",{enumerable:!0,get:a(function(){return lr.posix},"get")});Object.defineProperty(Se,"join",{enumerable:!0,get:a(function(){return lr.join},"get")});Object.defineProperty(Se,"relative",{enumerable:!0,get:a(function(){return lr.relative},"get")});Object.defineProperty(Se,"dirname",{enumerable:!0,get:a(function(){return lr.dirname},"get")});Object.defineProperty(Se,"normalize",{enumerable:!0,get:a(function(){return lr.normalize},"get")});Object.defineProperty(Se,"isAbsolute",{enumerable:!0,get:a(function(){return lr.isAbsolute},"get")});Object.defineProperty(Se,"basename",{enumerable:!0,get:a(function(){return lr.basename},"get")})});var Kf={};Nx(Kf,{__addDisposableResource:()=>vw,__assign:()=>ea,__asyncDelegator:()=>hw,__asyncGenerator:()=>uw,__asyncValues:()=>dw,__await:()=>Yi,__awaiter:()=>ow,__classPrivateFieldGet:()=>yw,__classPrivateFieldIn:()=>bw,__classPrivateFieldSet:()=>gw,__createBinding:()=>ra,__decorate:()=>Jm,__disposeResources:()=>_w,__esDecorate:()=>ew,__exportStar:()=>aw,__extends:()=>Xm,__generator:()=>sw,__importDefault:()=>ww,__importStar:()=>mw,__makeTemplateObject:()=>pw,__metadata:()=>nw,__param:()=>Qm,__propKey:()=>rw,__read:()=>Gf,__rest:()=>Ym,__rewriteRelativeImportExtension:()=>Fw,__runInitializers:()=>tw,__setFunctionName:()=>iw,__spread:()=>lw,__spreadArray:()=>fw,__spreadArrays:()=>cw,__values:()=>ta,default:()=>WT});function Xm(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Wf(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Ym(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Jm(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}function Qm(t,e){return function(r,i){e(r,i,t)}}function ew(t,e,r,i,n,o){function s(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}a(s,"accept");for(var l=i.kind,f=l==="getter"?"get":l==="setter"?"set":"value",c=!e&&t?i.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),h,d=!1,p=r.length-1;p>=0;p--){var m={};for(var w in i)m[w]=w==="access"?{}:i[w];for(var w in i.access)m.access[w]=i.access[w];m.addInitializer=function(v){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(v||null))};var y=(0,r[p])(l==="accessor"?{get:u.get,set:u.set}:u[f],m);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(h=s(y.get))&&(u.get=h),(h=s(y.set))&&(u.set=h),(h=s(y.init))&&n.unshift(h)}else(h=s(y))&&(l==="field"?n.unshift(h):u[f]=h)}c&&Object.defineProperty(c,i.name,u),d=!0}function tw(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function rw(t){return typeof t=="symbol"?t:"".concat(t)}function iw(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function nw(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ow(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return a(n,"adopt"),new(r||(r=Promise))(function(o,s){function l(u){try{c(i.next(u))}catch(h){s(h)}}a(l,"fulfilled");function f(u){try{c(i.throw(u))}catch(h){s(h)}}a(f,"rejected");function c(u){u.done?o(u.value):n(u.value).then(l,f)}a(c,"step"),c((i=i.apply(t,e||[])).next())})}function sw(t,e){var r={label:0,sent:a(function(){if(o[0]&1)throw o[1];return o[1]},"sent"),trys:[],ops:[]},i,n,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(c){return function(u){return f([c,u])}}function f(c){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(o=c[0]&2?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],n=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function aw(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ra(e,t,r)}function ta(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Gf(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,o=[],s;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(l){s={error:l}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function lw(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Gf(arguments[e]));return t}function cw(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var o=arguments[e],s=0,l=o.length;s<l;s++,n++)i[n]=o[s];return i}function fw(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function Yi(t){return this instanceof Yi?(this.v=t,this):new Yi(t)}function uw(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",s),n[Symbol.asyncIterator]=function(){return this},n;function s(p){return function(m){return Promise.resolve(m).then(p,h)}}function l(p,m){i[p]&&(n[p]=function(w){return new Promise(function(y,v){o.push([p,w,y,v])>1||f(p,w)})},m&&(n[p]=m(n[p])))}function f(p,m){try{c(i[p](m))}catch(w){d(o[0][3],w)}}function c(p){p.value instanceof Yi?Promise.resolve(p.value.v).then(u,h):d(o[0][2],p)}function u(p){f("next",p)}function h(p){f("throw",p)}function d(p,m){p(m),o.shift(),o.length&&f(o[0][0],o[0][1])}}function hw(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=t[n]?function(s){return(r=!r)?{value:Yi(t[n](s)),done:!1}:o?o(s):s}:o}}function dw(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ta=="function"?ta(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(s){return new Promise(function(l,f){s=t[o](s),n(l,f,s.done,s.value)})}}function n(o,s,l,f){Promise.resolve(f).then(function(c){o({value:c,done:l})},s)}}function pw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function mw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Vf(t),i=0;i<r.length;i++)r[i]!=="default"&&ra(e,t,r[i]);return qT(e,t),e}function ww(t){return t&&t.__esModule?t:{default:t}}function yw(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function gw(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function bw(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function vw(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=a(function(){try{n.call(this)}catch(o){return Promise.reject(o)}},"dispose")),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function _w(t){function e(o){t.error=t.hasError?new zT(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}a(e,"fail");var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(o).then(n,function(s){return e(s),n()})}else i|=1}catch(s){e(s)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a(n,"next"),n()}function Fw(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,o,s){return i?e?".jsx":".js":n&&(!o||!s)?r:n+o+"."+s.toLowerCase()+"js"}):t}var Wf,ea,ra,qT,Vf,zT,WT,Zf=Dx(()=>{Wf=a(function(t,e){return Wf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Wf(t,e)},"extendStatics");a(Xm,"__extends");ea=a(function(){return ea=Object.assign||a(function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},"__assign"),ea.apply(this,arguments)},"__assign");a(Ym,"__rest");a(Jm,"__decorate");a(Qm,"__param");a(ew,"__esDecorate");a(tw,"__runInitializers");a(rw,"__propKey");a(iw,"__setFunctionName");a(nw,"__metadata");a(ow,"__awaiter");a(sw,"__generator");ra=Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]};a(aw,"__exportStar");a(ta,"__values");a(Gf,"__read");a(lw,"__spread");a(cw,"__spreadArrays");a(fw,"__spreadArray");a(Yi,"__await");a(uw,"__asyncGenerator");a(hw,"__asyncDelegator");a(dw,"__asyncValues");a(pw,"__makeTemplateObject");qT=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Vf=a(function(t){return Vf=Object.getOwnPropertyNames||function(e){var r=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[r.length]=i);return r},Vf(t)},"ownKeys");a(mw,"__importStar");a(ww,"__importDefault");a(yw,"__classPrivateFieldGet");a(gw,"__classPrivateFieldSet");a(bw,"__classPrivateFieldIn");a(vw,"__addDisposableResource");zT=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};a(_w,"__disposeResources");a(Fw,"__rewriteRelativeImportExtension");WT={__extends:Xm,__assign:ea,__rest:Ym,__decorate:Jm,__param:Qm,__esDecorate:ew,__runInitializers:tw,__propKey:rw,__setFunctionName:iw,__metadata:nw,__awaiter:ow,__generator:sw,__createBinding:ra,__exportStar:aw,__values:ta,__read:Gf,__spread:lw,__spreadArrays:cw,__spreadArray:fw,__await:Yi,__asyncGenerator:uw,__asyncDelegator:hw,__asyncValues:dw,__makeTemplateObject:pw,__importStar:mw,__importDefault:ww,__classPrivateFieldGet:yw,__classPrivateFieldSet:gw,__classPrivateFieldIn:bw,__addDisposableResource:vw,__disposeResources:_w,__rewriteRelativeImportExtension:Fw}});var Sw=O(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0})});var Yf=O(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.flattenJSON=void 0;var xw=Rr(),Xf=Xi(),VT=Xf.posix?Xf.posix.join:Xf.join,GT=a(t=>{let e={};function r(i,n){for(let o in n){let s=n[o],l=VT(i,o);typeof s=="string"||s instanceof xw.Buffer?e[l]=s:typeof s=="object"&&s!==null&&!(s instanceof xw.Buffer)&&Object.keys(s).length>0?r(l,s):e[l]=null}}return a(r,"flatten"),r("",t),e},"flattenJSON");ia.flattenJSON=GT});var eu=O(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.FanOut=void 0;var Qf=class Qf{constructor(){this.listeners=new Set}emit(e){this.listeners.forEach(r=>r(e))}listen(e){let r=this.listeners;return r.add(e),()=>r.delete(e)}};a(Qf,"FanOut");var Jf=Qf;na.FanOut=Jf});var sa=O(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.createProcess=Tw;var KT=a(()=>{if(typeof process<"u")return process;try{return Cx("process")}catch{return}},"maybeReturnProcess");function Tw(){let t=KT()||{};return t.cwd||(t.cwd=()=>"/"),t.emitWarning||(t.emitWarning=(e,r)=>{console.warn(`${r}${r?": ":""}${e}`)}),t.env||(t.env={}),t}a(Tw,"createProcess");oa.default=Tw()});var iu=O(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.Node=void 0;var ZT=eu(),kw=sa(),mt=Rr(),XT=At(),{S_IFMT:cr,S_IFDIR:YT,S_IFREG:JT,S_IFLNK:Ow,S_IFCHR:QT}=XT.constants,aa=a(()=>kw.default.getuid?.()??0,"getuid"),la=a(()=>kw.default.getgid?.()??0,"getgid"),ru=class ru{constructor(e,r=438){this.changes=new ZT.FanOut,this._uid=aa(),this._gid=la(),this._atime=new Date,this._mtime=new Date,this._ctime=new Date,this.rdev=0,this._nlink=1,this.mode=r,this.ino=e}set ctime(e){this._ctime=e}get ctime(){return this._ctime}set uid(e){this._uid=e,this.ctime=new Date}get uid(){return this._uid}set gid(e){this._gid=e,this.ctime=new Date}get gid(){return this._gid}set atime(e){this._atime=e}get atime(){return this._atime}set mtime(e){this._mtime=e,this.ctime=new Date}get mtime(){return this._mtime}get perm(){return this.mode&~cr}set perm(e){this.mode=this.mode&cr|e&~cr,this.ctime=new Date}set nlink(e){this._nlink=e,this.ctime=new Date}get nlink(){return this._nlink}getString(e="utf8"){return this.atime=new Date,this.getBuffer().toString(e)}setString(e){this.buf=(0,mt.bufferFrom)(e,"utf8"),this.touch()}getBuffer(){return this.atime=new Date,this.buf||(this.buf=(0,mt.bufferAllocUnsafe)(0)),(0,mt.bufferFrom)(this.buf)}setBuffer(e){this.buf=(0,mt.bufferFrom)(e),this.touch()}getSize(){return this.buf?this.buf.length:0}setModeProperty(e){this.mode=e}isFile(){return(this.mode&cr)===JT}isDirectory(){return(this.mode&cr)===YT}isSymlink(){return(this.mode&cr)===Ow}isCharacterDevice(){return(this.mode&cr)===QT}makeSymlink(e){this.mode=Ow|438,this.symlink=e}write(e,r=0,i=e.length,n=0){if(this.buf||(this.buf=(0,mt.bufferAllocUnsafe)(0)),n+i>this.buf.length){let o=(0,mt.bufferAllocUnsafe)(n+i);this.buf.copy(o,0,0,this.buf.length),this.buf=o}return e.copy(this.buf,n,r,r+i),this.touch(),i}read(e,r=0,i=e.byteLength,n=0){if(this.atime=new Date,this.buf||(this.buf=(0,mt.bufferAllocUnsafe)(0)),n>=this.buf.length)return 0;let o=i;o>e.byteLength&&(o=e.byteLength),o+n>this.buf.length&&(o=this.buf.length-n);let s=e instanceof mt.Buffer?e:mt.Buffer.from(e.buffer,e.byteOffset,e.byteLength);return this.buf.copy(s,r,n,n+o),o}truncate(e=0){if(!e)this.buf=(0,mt.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,mt.bufferAllocUnsafe)(0)),e<=this.buf.length)this.buf=this.buf.slice(0,e);else{let r=(0,mt.bufferAllocUnsafe)(e);this.buf.copy(r),r.fill(0,this.buf.length),this.buf=r}this.touch()}chmod(e){this.mode=this.mode&cr|e&~cr,this.touch()}chown(e,r){this.uid=e,this.gid=r,this.touch()}touch(){this.mtime=new Date,this.changes.emit(["modify"])}canRead(e=aa(),r=la()){return!!(this.perm&4||r===this.gid&&this.perm&32||e===this.uid&&this.perm&256)}canWrite(e=aa(),r=la()){return!!(this.perm&2||r===this.gid&&this.perm&16||e===this.uid&&this.perm&128)}canExecute(e=aa(),r=la()){return!!(this.perm&1||r===this.gid&&this.perm&8||e===this.uid&&this.perm&64)}del(){this.changes.emit(["delete"])}toJSON(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}}};a(ru,"Node");var tu=ru;ca.Node=tu});var ou=O(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.Link=void 0;var eO=At(),tO=eu(),{S_IFREG:rO}=eO.constants,mo=class mo{get steps(){return this._steps}set steps(e){this._steps=e;for(let[r,i]of this.children.entries())r==="."||r===".."||i?.syncSteps()}constructor(e,r,i){this.changes=new tO.FanOut,this.children=new Map,this._steps=[],this.ino=0,this.length=0,this.vol=e,this.parent=r,this.name=i,this.syncSteps()}setNode(e){this.node=e,this.ino=e.ino}getNode(){return this.node}createChild(e,r=this.vol.createNode(rO|438)){let i=new mo(this.vol,this,e);return i.setNode(r),r.isDirectory()&&(i.children.set(".",i),i.getNode().nlink++),this.setChild(e,i),i}setChild(e,r=new mo(this.vol,this,e)){return this.children.set(e,r),r.parent=this,this.length++,r.getNode().isDirectory()&&(r.children.set("..",this),this.getNode().nlink++),this.getNode().mtime=new Date,this.changes.emit(["child:add",r,this]),r}deleteChild(e){e.getNode().isDirectory()&&(e.children.delete(".."),this.getNode().nlink--),this.children.delete(e.getName()),this.length--,this.getNode().mtime=new Date,this.changes.emit(["child:del",e,this])}getChild(e){return this.getNode().atime=new Date,this.children.get(e)}getPath(){return this.steps.join("/")}getParentPath(){return this.steps.slice(0,-1).join("/")}getName(){return this.steps[this.steps.length-1]}toJSON(){return{steps:this.steps,ino:this.ino,children:Array.from(this.children.keys())}}syncSteps(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]}};a(mo,"Link");var nu=mo;fa.Link=nu});var lu=O(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.File=void 0;var iO=At(),{O_APPEND:nO}=iO.constants,au=class au{constructor(e,r,i,n){this.link=e,this.node=r,this.flags=i,this.fd=n,this.position=0,this.flags&nO&&(this.position=this.getSize())}getString(e="utf8"){return this.node.getString()}setString(e){this.node.setString(e)}getBuffer(){return this.node.getBuffer()}setBuffer(e){this.node.setBuffer(e)}getSize(){return this.node.getSize()}truncate(e){this.node.truncate(e)}seekTo(e){this.position=e}write(e,r=0,i=e.length,n){typeof n!="number"&&(n=this.position);let o=this.node.write(e,r,i,n);return this.position=n+o,o}read(e,r=0,i=e.byteLength,n){typeof n!="number"&&(n=this.position);let o=this.node.read(e,r,i,n);return this.position=n+o,o}chmod(e){this.node.chmod(e)}chown(e,r){this.node.chown(e,r)}};a(au,"File");var su=au;ua.File=su});var en=O(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.FLAGS=Qi.ERRSTR=void 0;var oO=At();Qi.ERRSTR={PATH_STR:"path must be a string, Buffer, or Uint8Array",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};var{O_RDONLY:Rw,O_WRONLY:ha,O_RDWR:Ji,O_CREAT:Ar,O_EXCL:da,O_TRUNC:pa,O_APPEND:ma,O_SYNC:Pw}=oO.constants,Aw;(function(t){t[t.r=Rw]="r",t[t["r+"]=Ji]="r+",t[t.rs=Rw|Pw]="rs",t[t.sr=t.rs]="sr",t[t["rs+"]=Ji|Pw]="rs+",t[t["sr+"]=t["rs+"]]="sr+",t[t.w=ha|Ar|pa]="w",t[t.wx=ha|Ar|pa|da]="wx",t[t.xw=t.wx]="xw",t[t["w+"]=Ji|Ar|pa]="w+",t[t["wx+"]=Ji|Ar|pa|da]="wx+",t[t["xw+"]=t["wx+"]]="xw+",t[t.a=ha|ma|Ar]="a",t[t.ax=ha|ma|Ar|da]="ax",t[t.xa=t.ax]="xa",t[t["a+"]=Ji|ma|Ar]="a+",t[t["ax+"]=Ji|ma|Ar|da]="ax+",t[t["xa+"]=t["ax+"]]="xa+"})(Aw||(Qi.FLAGS=Aw={}))});var fu=O(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.default=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(()=>t()).catch(()=>{})});var ba=O(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.filenameToSteps=De.resolve=De.unixify=De.isWin=void 0;De.isFd=Cw;De.validateFd=mO;De.dataToBuffer=wO;var ya=Xi(),wa=Rr(),Iw=sa(),sO=ho(),aO=en();De.isWin=Iw.default.platform==="win32";var lO=ya.resolve,cO=ya.posix?ya.posix.sep:ya.sep,fO=a((t,e)=>{let r=t[e];return e>0&&(r==="/"||De.isWin&&r==="\\")},"isSeparator"),uO=a(t=>{let e=t.length-1;if(e<2)return t;for(;fO(t,e);)e--;return t.substr(0,e+1)},"removeTrailingSeparator"),hO=a((t,e)=>{if(typeof t!="string")throw new TypeError("expected a string");return t=t.replace(/[\\\/]+/g,"/"),e!==!1&&(t=uO(t)),t},"normalizePath"),dO=a((t,e=!0)=>De.isWin?(t=hO(t,e),t.replace(/^([a-zA-Z]+:|\.\/)/,"")):t,"unixify");De.unixify=dO;var ga=a((t,e=Iw.default.cwd())=>lO(e,t),"resolve");De.resolve=ga;if(De.isWin){let t=ga;De.resolve=ga=a((e,r)=>(0,De.unixify)(t(e,r)),"resolve")}var pO=a((t,e)=>{let i=ga(t,e).substring(1);return i?i.split(cO):[]},"filenameToSteps");De.filenameToSteps=pO;function Cw(t){return t>>>0===t}a(Cw,"isFd");function mO(t){if(!Cw(t))throw TypeError(aO.ERRSTR.FD)}a(mO,"validateFd");function wO(t,e=sO.ENCODING_UTF8){return wa.Buffer.isBuffer(t)?t:t instanceof Uint8Array?(0,wa.bufferFrom)(t):e==="buffer"?(0,wa.bufferFrom)(String(t),"utf8"):(0,wa.bufferFrom)(String(t),e)}a(wO,"dataToBuffer")});var Dw=O((tn,rn)=>{(function(t){var e=typeof tn=="object"&&tn&&!tn.nodeType&&tn,r=typeof rn=="object"&&rn&&!rn.nodeType&&rn,i=typeof globalThis=="object"&&globalThis;(i.global===i||i.window===i||i.self===i)&&(t=i);var n,o=2147483647,s=36,l=1,f=26,c=38,u=700,h=72,d=128,p="-",m=/^xn--/,w=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=s-l,_=Math.floor,E=String.fromCharCode,x;function R($){throw new RangeError(v[$])}a(R,"error");function b($,q){for(var G=$.length,X=[];G--;)X[G]=q($[G]);return X}a(b,"map");function T($,q){var G=$.split("@"),X="";G.length>1&&(X=G[0]+"@",$=G[1]),$=$.replace(y,".");var z=$.split("."),ue=b(z,q).join(".");return X+ue}a(T,"mapDomain");function F($){for(var q=[],G=0,X=$.length,z,ue;G<X;)z=$.charCodeAt(G++),z>=55296&&z<=56319&&G<X?(ue=$.charCodeAt(G++),(ue&64512)==56320?q.push(((z&1023)<<10)+(ue&1023)+65536):(q.push(z),G--)):q.push(z);return q}a(F,"ucs2decode");function P($){return b($,function(q){var G="";return q>65535&&(q-=65536,G+=E(q>>>10&1023|55296),q=56320|q&1023),G+=E(q),G}).join("")}a(P,"ucs2encode");function k($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:s}a(k,"basicToDigit");function D($,q){return $+22+75*($<26)-((q!=0)<<5)}a(D,"digitToBasic");function B($,q,G){var X=0;for($=G?_($/u):$>>1,$+=_($/q);$>g*f>>1;X+=s)$=_($/g);return _(X+(g+1)*$/($+c))}a(B,"adapt");function U($){var q=[],G=$.length,X,z=0,ue=d,te=h,Oe,ke,le,Rt,ve,Ge,Le,Y,he;for(Oe=$.lastIndexOf(p),Oe<0&&(Oe=0),ke=0;ke<Oe;++ke)$.charCodeAt(ke)>=128&&R("not-basic"),q.push($.charCodeAt(ke));for(le=Oe>0?Oe+1:0;le<G;){for(Rt=z,ve=1,Ge=s;le>=G&&R("invalid-input"),Le=k($.charCodeAt(le++)),(Le>=s||Le>_((o-z)/ve))&&R("overflow"),z+=Le*ve,Y=Ge<=te?l:Ge>=te+f?f:Ge-te,!(Le<Y);Ge+=s)he=s-Y,ve>_(o/he)&&R("overflow"),ve*=he;X=q.length+1,te=B(z-Rt,X,Rt==0),_(z/X)>o-ue&&R("overflow"),ue+=_(z/X),z%=X,q.splice(z++,0,ue)}return P(q)}a(U,"decode");function Z($){var q,G,X,z,ue,te,Oe,ke,le,Rt,ve,Ge=[],Le,Y,he,je;for($=F($),Le=$.length,q=d,G=0,ue=h,te=0;te<Le;++te)ve=$[te],ve<128&&Ge.push(E(ve));for(X=z=Ge.length,z&&Ge.push(p);X<Le;){for(Oe=o,te=0;te<Le;++te)ve=$[te],ve>=q&&ve<Oe&&(Oe=ve);for(Y=X+1,Oe-q>_((o-G)/Y)&&R("overflow"),G+=(Oe-q)*Y,q=Oe,te=0;te<Le;++te)if(ve=$[te],ve<q&&++G>o&&R("overflow"),ve==q){for(ke=G,le=s;Rt=le<=ue?l:le>=ue+f?f:le-ue,!(ke<Rt);le+=s)je=ke-Rt,he=s-Rt,Ge.push(E(D(Rt+je%he,0))),ke=_(je/he);Ge.push(E(D(ke,0))),ue=B(G,Y,X==z),G=0,++X}++G,++q}return Ge.join("")}a(Z,"encode");function me($){return T($,function(q){return m.test(q)?U(q.slice(4).toLowerCase()):q})}a(me,"toUnicode");function Ee($){return T($,function(q){return w.test(q)?"xn--"+Z(q):q})}if(a(Ee,"toASCII"),n={version:"1.4.1",ucs2:{decode:F,encode:P},decode:U,encode:Z,toASCII:Ee,toUnicode:me},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return n});else if(e&&r)if(rn.exports==e)r.exports=n;else for(x in n)n.hasOwnProperty(x)&&(e[x]=n[x]);else t.punycode=n})(tn)});var zt=O((k8,Nw)=>{"use strict";Nw.exports=TypeError});var Bw=O(()=>{});var vo=O((A8,ry)=>{var vu=typeof Map=="function"&&Map.prototype,uu=Object.getOwnPropertyDescriptor&&vu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,_a=vu&&uu&&typeof uu.get=="function"?uu.get:null,Lw=vu&&Map.prototype.forEach,_u=typeof Set=="function"&&Set.prototype,hu=Object.getOwnPropertyDescriptor&&_u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Fa=_u&&hu&&typeof hu.get=="function"?hu.get:null,$w=_u&&Set.prototype.forEach,yO=typeof WeakMap=="function"&&WeakMap.prototype,yo=yO?WeakMap.prototype.has:null,gO=typeof WeakSet=="function"&&WeakSet.prototype,go=gO?WeakSet.prototype.has:null,bO=typeof WeakRef=="function"&&WeakRef.prototype,Mw=bO?WeakRef.prototype.deref:null,vO=Boolean.prototype.valueOf,_O=Object.prototype.toString,FO=Function.prototype.toString,EO=String.prototype.match,Fu=String.prototype.slice,Ir=String.prototype.replace,SO=String.prototype.toUpperCase,jw=String.prototype.toLowerCase,Zw=RegExp.prototype.test,Uw=Array.prototype.concat,Wt=Array.prototype.join,xO=Array.prototype.slice,Hw=Math.floor,mu=typeof BigInt=="function"?BigInt.prototype.valueOf:null,du=Object.getOwnPropertySymbols,wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,nn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",bo=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===nn||!0)?Symbol.toStringTag:null,Xw=Object.prototype.propertyIsEnumerable,qw=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function zw(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Zw.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-Hw(-t):Hw(t);if(i!==t){var n=String(i),o=Fu.call(e,n.length+1);return Ir.call(n,r,"$&_")+"."+Ir.call(Ir.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ir.call(e,r,"$&_")}a(zw,"addNumericSeparator");var yu=Bw(),Ww=yu.custom,Vw=Qw(Ww)?Ww:null,Yw={__proto__:null,double:'"',single:"'"},TO={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ry.exports=a(function t(e,r,i,n){var o=r||{};if(fr(o,"quoteStyle")&&!fr(Yw,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(fr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=fr(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(fr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(fr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ty(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return l?zw(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return l?zw(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof e=="object")return gu(e)?"[Array]":"[Object]";var h=zO(o,i);if(typeof n>"u")n=[];else if(ey(n,e)>=0)return"[Circular]";function d(B,U,Z){if(U&&(n=xO.call(n),n.push(U)),Z){var me={depth:o.depth};return fr(o,"quoteStyle")&&(me.quoteStyle=o.quoteStyle),t(B,me,i+1,n)}return t(B,o,i+1,n)}if(a(d,"inspect"),typeof e=="function"&&!Gw(e)){var p=NO(e),m=va(e,d);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(m.length>0?" { "+Wt.call(m,", ")+" }":"")}if(Qw(e)){var w=nn?Ir.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):wu.call(e);return typeof e=="object"&&!nn?wo(w):w}if(UO(e)){for(var y="<"+jw.call(String(e.nodeName)),v=e.attributes||[],g=0;g<v.length;g++)y+=" "+v[g].name+"="+Jw(OO(v[g].value),"double",o);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+jw.call(String(e.nodeName))+">",y}if(gu(e)){if(e.length===0)return"[]";var _=va(e,d);return h&&!qO(_)?"["+bu(_,h)+"]":"[ "+Wt.call(_,", ")+" ]"}if(RO(e)){var E=va(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!Xw.call(e,"cause")?"{ ["+String(e)+"] "+Wt.call(Uw.call("[cause]: "+d(e.cause),E),", ")+" }":E.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Wt.call(E,", ")+" }"}if(typeof e=="object"&&s){if(Vw&&typeof e[Vw]=="function"&&yu)return yu(e,{depth:u-i});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(BO(e)){var x=[];return Lw&&Lw.call(e,function(B,U){x.push(d(U,e,!0)+" => "+d(B,e))}),Kw("Map",_a.call(e),x,h)}if(MO(e)){var R=[];return $w&&$w.call(e,function(B){R.push(d(B,e))}),Kw("Set",Fa.call(e),R,h)}if(LO(e))return pu("WeakMap");if(jO(e))return pu("WeakSet");if($O(e))return pu("WeakRef");if(AO(e))return wo(d(Number(e)));if(CO(e))return wo(d(mu.call(e)));if(IO(e))return wo(vO.call(e));if(PO(e))return wo(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof globalThis<"u"&&e===globalThis)return"{ [object globalThis] }";if(!kO(e)&&!Gw(e)){var b=va(e,d),T=qw?qw(e)===Object.prototype:e instanceof Object||e.constructor===Object,F=e instanceof Object?"":"null prototype",P=!T&&bo&&Object(e)===e&&bo in e?Fu.call(Cr(e),8,-1):F?"Object":"",k=T||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",D=k+(P||F?"["+Wt.call(Uw.call([],P||[],F||[]),": ")+"] ":"");return b.length===0?D+"{}":h?D+"{"+bu(b,h)+"}":D+"{ "+Wt.call(b,", ")+" }"}return String(e)},"inspect_");function Jw(t,e,r){var i=r.quoteStyle||e,n=Yw[i];return n+t+n}a(Jw,"wrapQuotes");function OO(t){return Ir.call(String(t),/"/g,""")}a(OO,"quote");function ci(t){return!bo||!(typeof t=="object"&&(bo in t||typeof t[bo]<"u"))}a(ci,"canTrustToString");function gu(t){return Cr(t)==="[object Array]"&&ci(t)}a(gu,"isArray");function kO(t){return Cr(t)==="[object Date]"&&ci(t)}a(kO,"isDate");function Gw(t){return Cr(t)==="[object RegExp]"&&ci(t)}a(Gw,"isRegExp");function RO(t){return Cr(t)==="[object Error]"&&ci(t)}a(RO,"isError");function PO(t){return Cr(t)==="[object String]"&&ci(t)}a(PO,"isString");function AO(t){return Cr(t)==="[object Number]"&&ci(t)}a(AO,"isNumber");function IO(t){return Cr(t)==="[object Boolean]"&&ci(t)}a(IO,"isBoolean");function Qw(t){if(nn)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!wu)return!1;try{return wu.call(t),!0}catch{}return!1}a(Qw,"isSymbol");function CO(t){if(!t||typeof t!="object"||!mu)return!1;try{return mu.call(t),!0}catch{}return!1}a(CO,"isBigInt");var DO=Object.prototype.hasOwnProperty||function(t){return t in this};function fr(t,e){return DO.call(t,e)}a(fr,"has");function Cr(t){return _O.call(t)}a(Cr,"toStr");function NO(t){if(t.name)return t.name;var e=EO.call(FO.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}a(NO,"nameOf");function ey(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}a(ey,"indexOf");function BO(t){if(!_a||!t||typeof t!="object")return!1;try{_a.call(t);try{Fa.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}a(BO,"isMap");function LO(t){if(!yo||!t||typeof t!="object")return!1;try{yo.call(t,yo);try{go.call(t,go)}catch{return!0}return t instanceof WeakMap}catch{}return!1}a(LO,"isWeakMap");function $O(t){if(!Mw||!t||typeof t!="object")return!1;try{return Mw.call(t),!0}catch{}return!1}a($O,"isWeakRef");function MO(t){if(!Fa||!t||typeof t!="object")return!1;try{Fa.call(t);try{_a.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}a(MO,"isSet");function jO(t){if(!go||!t||typeof t!="object")return!1;try{go.call(t,go);try{yo.call(t,yo)}catch{return!0}return t instanceof WeakSet}catch{}return!1}a(jO,"isWeakSet");function UO(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}a(UO,"isElement");function ty(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return ty(Fu.call(t,0,e.maxStringLength),e)+i}var n=TO[e.quoteStyle||"single"];n.lastIndex=0;var o=Ir.call(Ir.call(t,n,"\\$1"),/[\x00-\x1f]/g,HO);return Jw(o,"single",e)}a(ty,"inspectString");function HO(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+SO.call(e.toString(16))}a(HO,"lowbyte");function wo(t){return"Object("+t+")"}a(wo,"markBoxed");function pu(t){return t+" { ? }"}a(pu,"weakCollectionOf");function Kw(t,e,r,i){var n=i?bu(r,i):Wt.call(r,", ");return t+" ("+e+") {"+n+"}"}a(Kw,"collectionOf");function qO(t){for(var e=0;e<t.length;e++)if(ey(t[e],`
|
|
5
|
+
`)>=0)return!1;return!0}a(qO,"singleLineValues");function zO(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Wt.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Wt.call(Array(e+1),r)}}a(zO,"getIndent");function bu(t,e){if(t.length===0)return"";var r=`
|
|
6
|
+
`+e.prev+e.base;return r+Wt.call(t,","+r)+`
|
|
7
|
+
`+e.prev}a(bu,"indentedJoin");function va(t,e){var r=gu(t),i=[];if(r){i.length=t.length;for(var n=0;n<t.length;n++)i[n]=fr(t,n)?e(t[n],t):""}var o=typeof du=="function"?du(t):[],s;if(nn){s={};for(var l=0;l<o.length;l++)s["$"+o[l]]=o[l]}for(var f in t)fr(t,f)&&(r&&String(Number(f))===f&&f<t.length||nn&&s["$"+f]instanceof Symbol||(Zw.call(/[^\w$]/,f)?i.push(e(f,t)+": "+e(t[f],t)):i.push(f+": "+e(t[f],t))));if(typeof du=="function")for(var c=0;c<o.length;c++)Xw.call(t,o[c])&&i.push("["+e(o[c])+"]: "+e(t[o[c]],t));return i}a(va,"arrObjKeys")});var ny=O((C8,iy)=>{"use strict";var WO=vo(),VO=zt(),Ea=a(function(t,e,r){for(var i=t,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,r||(n.next=t.next,t.next=n),n},"listGetNode"),GO=a(function(t,e){if(t){var r=Ea(t,e);return r&&r.value}},"listGet"),KO=a(function(t,e,r){var i=Ea(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),ZO=a(function(t,e){return t?!!Ea(t,e):!1},"listHas"),XO=a(function(t,e){if(t)return Ea(t,e,!0)},"listDelete");iy.exports=a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new VO("Side channel does not contain "+WO(i))},"assert"),delete:a(function(i){var n=e&&e.next,o=XO(e,i);return o&&n&&n===o&&(e=void 0),!!o},"delete"),get:a(function(i){return GO(e,i)},"get"),has:a(function(i){return ZO(e,i)},"has"),set:a(function(i,n){e||(e={next:void 0}),KO(e,i,n)},"set")};return r},"getSideChannelList")});var Eu=O((N8,oy)=>{"use strict";oy.exports=Object});var ay=O((B8,sy)=>{"use strict";sy.exports=Error});var cy=O((L8,ly)=>{"use strict";ly.exports=EvalError});var uy=O(($8,fy)=>{"use strict";fy.exports=RangeError});var dy=O((M8,hy)=>{"use strict";hy.exports=ReferenceError});var Su=O((j8,py)=>{"use strict";py.exports=SyntaxError});var wy=O((U8,my)=>{"use strict";my.exports=URIError});var gy=O((H8,yy)=>{"use strict";yy.exports=Math.abs});var vy=O((q8,by)=>{"use strict";by.exports=Math.floor});var Fy=O((z8,_y)=>{"use strict";_y.exports=Math.max});var Sy=O((W8,Ey)=>{"use strict";Ey.exports=Math.min});var Ty=O((V8,xy)=>{"use strict";xy.exports=Math.pow});var ky=O((G8,Oy)=>{"use strict";Oy.exports=Math.round});var Py=O((K8,Ry)=>{"use strict";Ry.exports=Number.isNaN||a(function(e){return e!==e},"isNaN")});var Iy=O((X8,Ay)=>{"use strict";var YO=Py();Ay.exports=a(function(e){return YO(e)||e===0?e:e<0?-1:1},"sign")});var Dy=O((J8,Cy)=>{"use strict";Cy.exports=Object.getOwnPropertyDescriptor});var on=O((Q8,Ny)=>{"use strict";var Sa=Dy();if(Sa)try{Sa([],"length")}catch{Sa=null}Ny.exports=Sa});var _o=O((ej,By)=>{"use strict";var xa=Object.defineProperty||!1;if(xa)try{xa({},"a",{value:1})}catch{xa=!1}By.exports=xa});var xu=O((tj,Ly)=>{"use strict";Ly.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,r);if(l.value!==n||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var jy=O((ij,My)=>{"use strict";var $y=typeof Symbol<"u"&&Symbol,JO=xu();My.exports=a(function(){return typeof $y!="function"||typeof Symbol!="function"||typeof $y("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:JO()},"hasNativeSymbols")});var Tu=O((oj,Uy)=>{"use strict";Uy.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Ou=O((sj,Hy)=>{"use strict";var QO=Eu();Hy.exports=QO.getPrototypeOf||null});var Wy=O((aj,zy)=>{"use strict";var ek="Function.prototype.bind called on incompatible ",tk=Object.prototype.toString,rk=Math.max,ik="[object Function]",qy=a(function(e,r){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<r.length;o+=1)i[o+e.length]=r[o];return i},"concatty"),nk=a(function(e,r){for(var i=[],n=r||0,o=0;n<e.length;n+=1,o+=1)i[o]=e[n];return i},"slicy"),ok=a(function(t,e){for(var r="",i=0;i<t.length;i+=1)r+=t[i],i+1<t.length&&(r+=e);return r},"joiny");zy.exports=a(function(e){var r=this;if(typeof r!="function"||tk.apply(r)!==ik)throw new TypeError(ek+r);for(var i=nk(arguments,1),n,o=a(function(){if(this instanceof n){var u=r.apply(this,qy(i,arguments));return Object(u)===u?u:this}return r.apply(e,qy(i,arguments))},"binder"),s=rk(0,r.length-i.length),l=[],f=0;f<s;f++)l[f]="$"+f;if(n=Function("binder","return function ("+ok(l,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=a(function(){},"Empty");c.prototype=r.prototype,n.prototype=new c,c.prototype=null}return n},"bind")});var sn=O((cj,Vy)=>{"use strict";var sk=Wy();Vy.exports=Function.prototype.bind||sk});var Ta=O((fj,Gy)=>{"use strict";Gy.exports=Function.prototype.call});var Oa=O((uj,Ky)=>{"use strict";Ky.exports=Function.prototype.apply});var Xy=O((hj,Zy)=>{"use strict";Zy.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ku=O((dj,Yy)=>{"use strict";var ak=sn(),lk=Oa(),ck=Ta(),fk=Xy();Yy.exports=fk||ak.call(ck,lk)});var ka=O((pj,Jy)=>{"use strict";var uk=sn(),hk=zt(),dk=Ta(),pk=ku();Jy.exports=a(function(e){if(e.length<1||typeof e[0]!="function")throw new hk("a function is required");return pk(uk,dk,e)},"callBindBasic")});var n0=O((wj,i0)=>{"use strict";var mk=ka(),Qy=on(),t0;try{t0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ru=!!t0&&Qy&&Qy(Object.prototype,"__proto__"),r0=Object,e0=r0.getPrototypeOf;i0.exports=Ru&&typeof Ru.get=="function"?mk([Ru.get]):typeof e0=="function"?a(function(e){return e0(e==null?e:r0(e))},"getDunder"):!1});var Pu=O((gj,l0)=>{"use strict";var o0=Tu(),s0=Ou(),a0=n0();l0.exports=o0?a(function(e){return o0(e)},"getProto"):s0?a(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return s0(e)},"getProto"):a0?a(function(e){return a0(e)},"getProto"):null});var f0=O((vj,c0)=>{"use strict";var wk=Function.prototype.call,yk=Object.prototype.hasOwnProperty,gk=sn();c0.exports=gk.call(wk,yk)});var xo=O((_j,w0)=>{"use strict";var J,bk=Eu(),vk=ay(),_k=cy(),Fk=uy(),Ek=dy(),fn=Su(),cn=zt(),Sk=wy(),xk=gy(),Tk=vy(),Ok=Fy(),kk=Sy(),Rk=Ty(),Pk=ky(),Ak=Iy(),p0=Function,Au=a(function(t){try{return p0('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),Fo=on(),Ik=_o(),Iu=a(function(){throw new cn},"throwTypeError"),Ck=Fo?function(){try{return arguments.callee,Iu}catch{try{return Fo(arguments,"callee").get}catch{return Iu}}}():Iu,an=jy()(),Ne=Pu(),Dk=Ou(),Nk=Tu(),m0=Oa(),Eo=Ta(),ln={},Bk=typeof Uint8Array>"u"||!Ne?J:Ne(Uint8Array),fi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?J:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?J:ArrayBuffer,"%ArrayIteratorPrototype%":an&&Ne?Ne([][Symbol.iterator]()):J,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":ln,"%AsyncGenerator%":ln,"%AsyncGeneratorFunction%":ln,"%AsyncIteratorPrototype%":ln,"%Atomics%":typeof Atomics>"u"?J:Atomics,"%BigInt%":typeof BigInt>"u"?J:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?J:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?J:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?J:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":vk,"%eval%":eval,"%EvalError%":_k,"%Float16Array%":typeof Float16Array>"u"?J:Float16Array,"%Float32Array%":typeof Float32Array>"u"?J:Float32Array,"%Float64Array%":typeof Float64Array>"u"?J:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?J:FinalizationRegistry,"%Function%":p0,"%GeneratorFunction%":ln,"%Int8Array%":typeof Int8Array>"u"?J:Int8Array,"%Int16Array%":typeof Int16Array>"u"?J:Int16Array,"%Int32Array%":typeof Int32Array>"u"?J:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":an&&Ne?Ne(Ne([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%Map%":typeof Map>"u"?J:Map,"%MapIteratorPrototype%":typeof Map>"u"||!an||!Ne?J:Ne(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":bk,"%Object.getOwnPropertyDescriptor%":Fo,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?J:Promise,"%Proxy%":typeof Proxy>"u"?J:Proxy,"%RangeError%":Fk,"%ReferenceError%":Ek,"%Reflect%":typeof Reflect>"u"?J:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?J:Set,"%SetIteratorPrototype%":typeof Set>"u"||!an||!Ne?J:Ne(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?J:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":an&&Ne?Ne(""[Symbol.iterator]()):J,"%Symbol%":an?Symbol:J,"%SyntaxError%":fn,"%ThrowTypeError%":Ck,"%TypedArray%":Bk,"%TypeError%":cn,"%Uint8Array%":typeof Uint8Array>"u"?J:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?J:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?J:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?J:Uint32Array,"%URIError%":Sk,"%WeakMap%":typeof WeakMap>"u"?J:WeakMap,"%WeakRef%":typeof WeakRef>"u"?J:WeakRef,"%WeakSet%":typeof WeakSet>"u"?J:WeakSet,"%Function.prototype.call%":Eo,"%Function.prototype.apply%":m0,"%Object.defineProperty%":Ik,"%Object.getPrototypeOf%":Dk,"%Math.abs%":xk,"%Math.floor%":Tk,"%Math.max%":Ok,"%Math.min%":kk,"%Math.pow%":Rk,"%Math.round%":Pk,"%Math.sign%":Ak,"%Reflect.getPrototypeOf%":Nk};if(Ne)try{null.error}catch(t){u0=Ne(Ne(t)),fi["%Error.prototype%"]=u0}var u0,Lk=a(function t(e){var r;if(e==="%AsyncFunction%")r=Au("async function () {}");else if(e==="%GeneratorFunction%")r=Au("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Au("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Ne&&(r=Ne(n.prototype))}return fi[e]=r,r},"doEval"),h0={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},So=sn(),Ra=f0(),$k=So.call(Eo,Array.prototype.concat),Mk=So.call(m0,Array.prototype.splice),d0=So.call(Eo,String.prototype.replace),Pa=So.call(Eo,String.prototype.slice),jk=So.call(Eo,RegExp.prototype.exec),Uk=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Hk=/\\(\\)?/g,qk=a(function(e){var r=Pa(e,0,1),i=Pa(e,-1);if(r==="%"&&i!=="%")throw new fn("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new fn("invalid intrinsic syntax, expected opening `%`");var n=[];return d0(e,Uk,function(o,s,l,f){n[n.length]=l?d0(f,Hk,"$1"):s||o}),n},"stringToPath"),zk=a(function(e,r){var i=e,n;if(Ra(h0,i)&&(n=h0[i],i="%"+n[0]+"%"),Ra(fi,i)){var o=fi[i];if(o===ln&&(o=Lk(i)),typeof o>"u"&&!r)throw new cn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new fn("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");w0.exports=a(function(e,r){if(typeof e!="string"||e.length===0)throw new cn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new cn('"allowMissing" argument must be a boolean');if(jk(/^%?[^%]*%?$/,e)===null)throw new fn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=qk(e),n=i.length>0?i[0]:"",o=zk("%"+n+"%",r),s=o.name,l=o.value,f=!1,c=o.alias;c&&(n=c[0],Mk(i,$k([0,1],c)));for(var u=1,h=!0;u<i.length;u+=1){var d=i[u],p=Pa(d,0,1),m=Pa(d,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new fn("property names with quotes must have matching quotes");if((d==="constructor"||!h)&&(f=!0),n+="."+d,s="%"+n+"%",Ra(fi,s))l=fi[s];else if(l!=null){if(!(d in l)){if(!r)throw new cn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Fo&&u+1>=i.length){var w=Fo(l,d);h=!!w,h&&"get"in w&&!("originalValue"in w.get)?l=w.get:l=l[d]}else h=Ra(l,d),l=l[d];h&&!f&&(fi[s]=l)}}return l},"GetIntrinsic")});var To=O((Ej,b0)=>{"use strict";var y0=xo(),g0=ka(),Wk=g0([y0("%String.prototype.indexOf%")]);b0.exports=a(function(e,r){var i=y0(e,!!r);return typeof i=="function"&&Wk(e,".prototype.")>-1?g0([i]):i},"callBoundIntrinsic")});var Cu=O((xj,_0)=>{"use strict";var Vk=xo(),Oo=To(),Gk=vo(),Kk=zt(),v0=Vk("%Map%",!0),Zk=Oo("Map.prototype.get",!0),Xk=Oo("Map.prototype.set",!0),Yk=Oo("Map.prototype.has",!0),Jk=Oo("Map.prototype.delete",!0),Qk=Oo("Map.prototype.size",!0);_0.exports=!!v0&&a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new Kk("Side channel does not contain "+Gk(i))},"assert"),delete:a(function(i){if(e){var n=Jk(e,i);return Qk(e)===0&&(e=void 0),n}return!1},"delete"),get:a(function(i){if(e)return Zk(e,i)},"get"),has:a(function(i){return e?Yk(e,i):!1},"has"),set:a(function(i,n){e||(e=new v0),Xk(e,i,n)},"set")};return r},"getSideChannelMap")});var E0=O((Oj,F0)=>{"use strict";var eR=xo(),Ia=To(),tR=vo(),Aa=Cu(),rR=zt(),un=eR("%WeakMap%",!0),iR=Ia("WeakMap.prototype.get",!0),nR=Ia("WeakMap.prototype.set",!0),oR=Ia("WeakMap.prototype.has",!0),sR=Ia("WeakMap.prototype.delete",!0);F0.exports=un?a(function(){var e,r,i={assert:a(function(n){if(!i.has(n))throw new rR("Side channel does not contain "+tR(n))},"assert"),delete:a(function(n){if(un&&n&&(typeof n=="object"||typeof n=="function")){if(e)return sR(e,n)}else if(Aa&&r)return r.delete(n);return!1},"delete"),get:a(function(n){return un&&n&&(typeof n=="object"||typeof n=="function")&&e?iR(e,n):r&&r.get(n)},"get"),has:a(function(n){return un&&n&&(typeof n=="object"||typeof n=="function")&&e?oR(e,n):!!r&&r.has(n)},"has"),set:a(function(n,o){un&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new un),nR(e,n,o)):Aa&&(r||(r=Aa()),r.set(n,o))},"set")};return i},"getSideChannelWeakMap"):Aa});var x0=O((Rj,S0)=>{"use strict";var aR=zt(),lR=vo(),cR=ny(),fR=Cu(),uR=E0(),hR=uR||fR||cR;S0.exports=a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new aR("Side channel does not contain "+lR(i))},"assert"),delete:a(function(i){return!!e&&e.delete(i)},"delete"),get:a(function(i){return e&&e.get(i)},"get"),has:a(function(i){return!!e&&e.has(i)},"has"),set:a(function(i,n){e||(e=hR()),e.set(i,n)},"set")};return r},"getSideChannel")});var Ca=O((Aj,T0)=>{"use strict";var dR=String.prototype.replace,pR=/%20/g,Du={RFC1738:"RFC1738",RFC3986:"RFC3986"};T0.exports={default:Du.RFC3986,formatters:{RFC1738:a(function(t){return dR.call(t,pR,"+")},"RFC1738"),RFC3986:a(function(t){return String(t)},"RFC3986")},RFC1738:Du.RFC1738,RFC3986:Du.RFC3986}});var Lu=O((Cj,k0)=>{"use strict";var mR=Ca(),Nu=Object.prototype.hasOwnProperty,ui=Array.isArray,Vt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),wR=a(function(e){for(;e.length>1;){var r=e.pop(),i=r.obj[r.prop];if(ui(i)){for(var n=[],o=0;o<i.length;++o)typeof i[o]<"u"&&n.push(i[o]);r.obj[r.prop]=n}}},"compactQueue"),O0=a(function(e,r){for(var i=r&&r.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},"arrayToObject"),yR=a(function t(e,r,i){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(ui(e))e.push(r);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Nu.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var n=e;return ui(e)&&!ui(r)&&(n=O0(e,i)),ui(e)&&ui(r)?(r.forEach(function(o,s){if(Nu.call(e,s)){var l=e[s];l&&typeof l=="object"&&o&&typeof o=="object"?e[s]=t(l,o,i):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var l=r[s];return Nu.call(o,s)?o[s]=t(o[s],l,i):o[s]=l,o},n)},"merge"),gR=a(function(e,r){return Object.keys(r).reduce(function(i,n){return i[n]=r[n],i},e)},"assignSingleSource"),bR=a(function(t,e,r){var i=t.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},"decode"),Bu=1024,vR=a(function(e,r,i,n,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),i==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var l="",f=0;f<s.length;f+=Bu){for(var c=s.length>=Bu?s.slice(f,f+Bu):s,u=[],h=0;h<c.length;++h){var d=c.charCodeAt(h);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===mR.RFC1738&&(d===40||d===41)){u[u.length]=c.charAt(h);continue}if(d<128){u[u.length]=Vt[d];continue}if(d<2048){u[u.length]=Vt[192|d>>6]+Vt[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=Vt[224|d>>12]+Vt[128|d>>6&63]+Vt[128|d&63];continue}h+=1,d=65536+((d&1023)<<10|c.charCodeAt(h)&1023),u[u.length]=Vt[240|d>>18]+Vt[128|d>>12&63]+Vt[128|d>>6&63]+Vt[128|d&63]}l+=u.join("")}return l},"encode"),_R=a(function(e){for(var r=[{obj:{o:e},prop:"o"}],i=[],n=0;n<r.length;++n)for(var o=r[n],s=o.obj[o.prop],l=Object.keys(s),f=0;f<l.length;++f){var c=l[f],u=s[c];typeof u=="object"&&u!==null&&i.indexOf(u)===-1&&(r.push({obj:s,prop:c}),i.push(u))}return wR(r),e},"compact"),FR=a(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),ER=a(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),SR=a(function(e,r){return[].concat(e,r)},"combine"),xR=a(function(e,r){if(ui(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(r(e[n]));return i}return r(e)},"maybeMap");k0.exports={arrayToObject:O0,assign:gR,combine:SR,compact:_R,decode:bR,encode:vR,isBuffer:ER,isRegExp:FR,maybeMap:xR,merge:yR}});var D0=O((Nj,C0)=>{"use strict";var P0=x0(),Da=Lu(),ko=Ca(),TR=Object.prototype.hasOwnProperty,A0={brackets:a(function(e){return e+"[]"},"brackets"),comma:"comma",indices:a(function(e,r){return e+"["+r+"]"},"indices"),repeat:a(function(e){return e},"repeat")},Gt=Array.isArray,OR=Array.prototype.push,I0=a(function(t,e){OR.apply(t,Gt(e)?e:[e])},"pushToArray"),kR=Date.prototype.toISOString,R0=ko.default,Re={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Da.encode,encodeValuesOnly:!1,filter:void 0,format:R0,formatter:ko.formatters[R0],indices:!1,serializeDate:a(function(e){return kR.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},RR=a(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),$u={},PR=a(function t(e,r,i,n,o,s,l,f,c,u,h,d,p,m,w,y,v,g){for(var _=e,E=g,x=0,R=!1;(E=E.get($u))!==void 0&&!R;){var b=E.get(e);if(x+=1,typeof b<"u"){if(b===x)throw new RangeError("Cyclic object value");R=!0}typeof E.get($u)>"u"&&(x=0)}if(typeof u=="function"?_=u(r,_):_ instanceof Date?_=p(_):i==="comma"&&Gt(_)&&(_=Da.maybeMap(_,function(G){return G instanceof Date?p(G):G})),_===null){if(s)return c&&!y?c(r,Re.encoder,v,"key",m):r;_=""}if(RR(_)||Da.isBuffer(_)){if(c){var T=y?r:c(r,Re.encoder,v,"key",m);return[w(T)+"="+w(c(_,Re.encoder,v,"value",m))]}return[w(r)+"="+w(String(_))]}var F=[];if(typeof _>"u")return F;var P;if(i==="comma"&&Gt(_))y&&c&&(_=Da.maybeMap(_,c)),P=[{value:_.length>0?_.join(",")||null:void 0}];else if(Gt(u))P=u;else{var k=Object.keys(_);P=h?k.sort(h):k}var D=f?String(r).replace(/\./g,"%2E"):String(r),B=n&&Gt(_)&&_.length===1?D+"[]":D;if(o&&Gt(_)&&_.length===0)return B+"[]";for(var U=0;U<P.length;++U){var Z=P[U],me=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:_[Z];if(!(l&&me===null)){var Ee=d&&f?String(Z).replace(/\./g,"%2E"):String(Z),$=Gt(_)?typeof i=="function"?i(B,Ee):B:B+(d?"."+Ee:"["+Ee+"]");g.set(e,x);var q=P0();q.set($u,g),I0(F,t(me,$,i,n,o,s,l,f,i==="comma"&&y&&Gt(_)?null:c,u,h,d,p,m,w,y,v,q))}}return F},"stringify"),AR=a(function(e){if(!e)return Re;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Re.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=ko.default;if(typeof e.format<"u"){if(!TR.call(ko.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=ko.formatters[i],o=Re.filter;(typeof e.filter=="function"||Gt(e.filter))&&(o=e.filter);var s;if(e.arrayFormat in A0?s=e.arrayFormat:"indices"in e?s=e.indices?"indices":"repeat":s=Re.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:Re.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Re.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Re.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Re.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Re.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Re.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:Re.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:Re.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Re.encodeValuesOnly,filter:o,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Re.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Re.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Re.strictNullHandling}},"normalizeStringifyOptions");C0.exports=function(t,e){var r=t,i=AR(e),n,o;typeof i.filter=="function"?(o=i.filter,r=o("",r)):Gt(i.filter)&&(o=i.filter,n=o);var s=[];if(typeof r!="object"||r===null)return"";var l=A0[i.arrayFormat],f=l==="comma"&&i.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var c=P0(),u=0;u<n.length;++u){var h=n[u],d=r[h];i.skipNulls&&d===null||I0(s,PR(d,h,l,f,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}var p=s.join(i.delimiter),m=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),p.length>0?m+p:""}});var $0=O((Lj,L0)=>{"use strict";var hi=Lu(),Mu=Object.prototype.hasOwnProperty,N0=Array.isArray,ye={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:hi.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},IR=a(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),B0=a(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),CR="utf8=%26%2310003%3B",DR="utf8=%E2%9C%93",NR=a(function(e,r){var i={__proto__:null},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=n.split(r.delimiter,r.throwOnLimitExceeded?o+1:o);if(r.throwOnLimitExceeded&&s.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var l=-1,f,c=r.charset;if(r.charsetSentinel)for(f=0;f<s.length;++f)s[f].indexOf("utf8=")===0&&(s[f]===DR?c="utf-8":s[f]===CR&&(c="iso-8859-1"),l=f,f=s.length);for(f=0;f<s.length;++f)if(f!==l){var u=s[f],h=u.indexOf("]="),d=h===-1?u.indexOf("="):h+1,p,m;d===-1?(p=r.decoder(u,ye.decoder,c,"key"),m=r.strictNullHandling?null:""):(p=r.decoder(u.slice(0,d),ye.decoder,c,"key"),m=hi.maybeMap(B0(u.slice(d+1),r,N0(i[p])?i[p].length:0),function(y){return r.decoder(y,ye.decoder,c,"value")})),m&&r.interpretNumericEntities&&c==="iso-8859-1"&&(m=IR(String(m))),u.indexOf("[]=")>-1&&(m=N0(m)?[m]:m);var w=Mu.call(i,p);w&&r.duplicates==="combine"?i[p]=hi.combine(i[p],m):(!w||r.duplicates==="last")&&(i[p]=m)}return i},"parseQueryStringValues"),BR=a(function(t,e,r,i){var n=0;if(t.length>0&&t[t.length-1]==="[]"){var o=t.slice(0,-1).join("");n=Array.isArray(e)&&e[o]?e[o].length:0}for(var s=i?e:B0(e,r,n),l=t.length-1;l>=0;--l){var f,c=t[l];if(c==="[]"&&r.parseArrays)f=r.allowEmptyArrays&&(s===""||r.strictNullHandling&&s===null)?[]:hi.combine([],s);else{f=r.plainObjects?{__proto__:null}:{};var u=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,h=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,d=parseInt(h,10);!r.parseArrays&&h===""?f={0:s}:!isNaN(d)&&c!==h&&String(d)===h&&d>=0&&r.parseArrays&&d<=r.arrayLimit?(f=[],f[d]=s):h!=="__proto__"&&(f[h]=s)}s=f}return s},"parseObject"),LR=a(function(e,r,i,n){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,f=i.depth>0&&s.exec(o),c=f?o.slice(0,f.index):o,u=[];if(c){if(!i.plainObjects&&Mu.call(Object.prototype,c)&&!i.allowPrototypes)return;u.push(c)}for(var h=0;i.depth>0&&(f=l.exec(o))!==null&&h<i.depth;){if(h+=1,!i.plainObjects&&Mu.call(Object.prototype,f[1].slice(1,-1))&&!i.allowPrototypes)return;u.push(f[1])}if(f){if(i.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+i.depth+" and strictDepth is true");u.push("["+o.slice(f.index)+"]")}return BR(u,r,i,n)}},"parseQueryStringKeys"),$R=a(function(e){if(!e)return ye;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?ye.charset:e.charset,i=typeof e.duplicates>"u"?ye.duplicates:e.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:ye.allowDots:!!e.allowDots;return{allowDots:n,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ye.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ye.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ye.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ye.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ye.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ye.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:ye.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:ye.decoder,delimiter:typeof e.delimiter=="string"||hi.isRegExp(e.delimiter)?e.delimiter:ye.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ye.depth,duplicates:i,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ye.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ye.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ye.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:ye.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ye.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");L0.exports=function(t,e){var r=$R(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var i=typeof t=="string"?NR(t,r):t,n=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var l=o[s],f=LR(l,i[l],r,typeof t=="string");n=hi.merge(n,f,r)}return r.allowSparse===!0?n:hi.compact(n)}});var j0=O((Mj,M0)=>{"use strict";var MR=D0(),jR=$0(),UR=Ca();M0.exports={formats:UR,parse:jR,stringify:MR}});var Po=O(dn=>{"use strict";var HR=Dw();function wt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}a(wt,"Url");var qR=/^([a-z0-9.+-]+:)/i,zR=/:[0-9]*$/,WR=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,VR=["<",">",'"',"`"," ","\r",`
|
|
8
|
+
`," "],GR=["{","}","|","\\","^","`"].concat(VR),ju=["'"].concat(GR),U0=["%","/","?",";","#"].concat(ju),H0=["/","?","#"],KR=255,q0=/^[+a-z0-9A-Z_-]{0,63}$/,ZR=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,XR={javascript:!0,"javascript:":!0},Uu={javascript:!0,"javascript:":!0},hn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Hu=j0();function Ro(t,e,r){if(t&&typeof t=="object"&&t instanceof wt)return t;var i=new wt;return i.parse(t,e,r),i}a(Ro,"urlParse");wt.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",o=t.split(n),s=/\\/g;o[0]=o[0].replace(s,"/"),t=o.join(n);var l=t;if(l=l.trim(),!r&&t.split("#").length===1){var f=WR.exec(l);if(f)return this.path=l,this.href=l,this.pathname=f[1],f[2]?(this.search=f[2],e?this.query=Hu.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var c=qR.exec(l);if(c){c=c[0];var u=c.toLowerCase();this.protocol=u,l=l.substr(c.length)}if(r||c||l.match(/^\/\/[^@/]+@[^@/]+/)){var h=l.substr(0,2)==="//";h&&!(c&&Uu[c])&&(l=l.substr(2),this.slashes=!0)}if(!Uu[c]&&(h||c&&!hn[c])){for(var d=-1,p=0;p<H0.length;p++){var m=l.indexOf(H0[p]);m!==-1&&(d===-1||m<d)&&(d=m)}var w,y;d===-1?y=l.lastIndexOf("@"):y=l.lastIndexOf("@",d),y!==-1&&(w=l.slice(0,y),l=l.slice(y+1),this.auth=decodeURIComponent(w)),d=-1;for(var p=0;p<U0.length;p++){var m=l.indexOf(U0[p]);m!==-1&&(d===-1||m<d)&&(d=m)}d===-1&&(d=l.length),this.host=l.slice(0,d),l=l.slice(d),this.parseHost(),this.hostname=this.hostname||"";var v=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!v)for(var g=this.hostname.split(/\./),p=0,_=g.length;p<_;p++){var E=g[p];if(E&&!E.match(q0)){for(var x="",R=0,b=E.length;R<b;R++)E.charCodeAt(R)>127?x+="x":x+=E[R];if(!x.match(q0)){var T=g.slice(0,p),F=g.slice(p+1),P=E.match(ZR);P&&(T.push(P[1]),F.unshift(P[2])),F.length&&(l="/"+F.join(".")+l),this.hostname=T.join(".");break}}}this.hostname.length>KR?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=HR.toASCII(this.hostname));var k=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+k,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!XR[u])for(var p=0,_=ju.length;p<_;p++){var B=ju[p];if(l.indexOf(B)!==-1){var U=encodeURIComponent(B);U===B&&(U=escape(B)),l=l.split(B).join(U)}}var Z=l.indexOf("#");Z!==-1&&(this.hash=l.substr(Z),l=l.slice(0,Z));var me=l.indexOf("?");if(me!==-1?(this.search=l.substr(me),this.query=l.substr(me+1),e&&(this.query=Hu.parse(this.query)),l=l.slice(0,me)):e&&(this.search="",this.query={}),l&&(this.pathname=l),hn[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var k=this.pathname||"",Ee=this.search||"";this.path=k+Ee}return this.href=this.format(),this};function YR(t){return typeof t=="string"&&(t=Ro(t)),t instanceof wt?t.format():wt.prototype.format.call(t)}a(YR,"urlFormat");wt.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=Hu.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||hn[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),s&&s.charAt(0)!=="?"&&(s="?"+s),r=r.replace(/[?#]/g,function(l){return encodeURIComponent(l)}),s=s.replace("#","%23"),e+n+r+s+i};function JR(t,e){return Ro(t,!1,!0).resolve(e)}a(JR,"urlResolve");wt.prototype.resolve=function(t){return this.resolveObject(Ro(t,!1,!0)).format()};function QR(t,e){return t?Ro(t,!1,!0).resolveObject(e):e}a(QR,"urlResolveObject");wt.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new wt;e.parse(t,!1,!0),t=e}for(var r=new wt,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var f=s[l];f!=="protocol"&&(r[f]=t[f])}return hn[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!hn[t.protocol]){for(var c=Object.keys(t),u=0;u<c.length;u++){var h=c[u];r[h]=t[h]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!Uu[t.protocol]){for(var _=(t.pathname||"").split("/");_.length&&!(t.host=_.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),_[0]!==""&&_.unshift(""),_.length<2&&_.unshift(""),r.pathname=_.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var m=r.pathname&&r.pathname.charAt(0)==="/",w=t.host||t.pathname&&t.pathname.charAt(0)==="/",y=w||m||r.host&&t.pathname,v=y,g=r.pathname&&r.pathname.split("/")||[],_=t.pathname&&t.pathname.split("/")||[],E=r.protocol&&!hn[r.protocol];if(E&&(r.hostname="",r.port=null,r.host&&(g[0]===""?g[0]=r.host:g.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(_[0]===""?_[0]=t.host:_.unshift(t.host)),t.host=null),y=y&&(_[0]===""||g[0]==="")),w)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,g=_;else if(_.length)g||(g=[]),g.pop(),g=g.concat(_),r.search=t.search,r.query=t.query;else if(t.search!=null){if(E){r.host=g.shift(),r.hostname=r.host;var x=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;x&&(r.auth=x.shift(),r.hostname=x.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var R=g.slice(-1)[0],b=(r.host||t.host||g.length>1)&&(R==="."||R==="..")||R==="",T=0,F=g.length;F>=0;F--)R=g[F],R==="."?g.splice(F,1):R===".."?(g.splice(F,1),T++):T&&(g.splice(F,1),T--);if(!y&&!v)for(;T--;T)g.unshift("..");y&&g[0]!==""&&(!g[0]||g[0].charAt(0)!=="/")&&g.unshift(""),b&&g.join("/").substr(-1)!=="/"&&g.push("");var P=g[0]===""||g[0]&&g[0].charAt(0)==="/";if(E){r.hostname=P?"":g.length?g.shift():"",r.host=r.hostname;var x=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;x&&(r.auth=x.shift(),r.hostname=x.shift(),r.host=r.hostname)}return y=y||r.host&&g.length,y&&!P&&g.unshift(""),g.length>0?r.pathname=g.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r};wt.prototype.parseHost=function(){var t=this.host,e=zR.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};dn.parse=Ro;dn.resolve=JR;dn.resolveObject=QR;dn.format=YR;dn.Url=wt});var Dr=O(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.getWriteSyncArgs=Pe.getWriteArgs=Pe.bufToUint8=void 0;Pe.promisify=tP;Pe.validateCallback=z0;Pe.modeToNumber=W0;Pe.nullCheck=V0;Pe.pathToFilename=nP;Pe.createError=vP;Pe.genRndStr6=_P;Pe.flagsToNumber=FP;Pe.streamToBuffer=EP;Pe.bufferToEncoding=OP;Pe.isReadableStream=kP;var Ao=en(),qu=uo(),zu=Rr(),eP=fu(),Na=ba();function tP(t,e,r=i=>i){return(...i)=>new Promise((n,o)=>{t[e].bind(t)(...i,(s,l)=>s?o(s):n(r(l)))})}a(tP,"promisify");function z0(t){if(typeof t!="function")throw TypeError(Ao.ERRSTR.CB);return t}a(z0,"validateCallback");function rP(t,e){if(typeof t=="number")return t;if(typeof t=="string")return parseInt(t,8);if(e)return W0(e)}a(rP,"_modeToNumber");function W0(t,e){let r=rP(t,e);if(typeof r!="number"||isNaN(r))throw new TypeError(Ao.ERRSTR.MODE_INT);return r}a(W0,"modeToNumber");function V0(t,e){if((""+t).indexOf("\0")!==-1){let r=new Error("Path must be a string without null bytes");if(r.code="ENOENT",typeof e!="function")throw r;return(0,eP.default)(()=>{e(r)}),!1}return!0}a(V0,"nullCheck");function iP(t){if(t.hostname!=="")throw new qu.TypeError("ERR_INVALID_FILE_URL_HOST",process.platform);let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)|32;if(e[r+1]==="2"&&i===102)throw new qu.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(e)}a(iP,"getPathFromURLPosix");function nP(t){if(t instanceof Uint8Array&&(t=(0,zu.bufferFrom)(t)),typeof t!="string"&&!zu.Buffer.isBuffer(t)){try{if(!(t instanceof Po().URL))throw new TypeError(Ao.ERRSTR.PATH_STR)}catch{throw new TypeError(Ao.ERRSTR.PATH_STR)}t=iP(t)}let e=String(t);return V0(e),e}a(nP,"pathToFilename");var oP="ENOENT",sP="EBADF",aP="EINVAL",lP="EPERM",cP="EPROTO",fP="EEXIST",uP="ENOTDIR",hP="EMFILE",dP="EACCES",pP="EISDIR",mP="ENOTEMPTY",wP="ENOSYS",yP="ERR_FS_EISDIR",gP="ERR_OUT_OF_RANGE";function bP(t,e="",r="",i=""){let n="";switch(r&&(n=` '${r}'`),i&&(n+=` -> '${i}'`),t){case oP:return`ENOENT: no such file or directory, ${e}${n}`;case sP:return`EBADF: bad file descriptor, ${e}${n}`;case aP:return`EINVAL: invalid argument, ${e}${n}`;case lP:return`EPERM: operation not permitted, ${e}${n}`;case cP:return`EPROTO: protocol error, ${e}${n}`;case fP:return`EEXIST: file already exists, ${e}${n}`;case uP:return`ENOTDIR: not a directory, ${e}${n}`;case pP:return`EISDIR: illegal operation on a directory, ${e}${n}`;case dP:return`EACCES: permission denied, ${e}${n}`;case mP:return`ENOTEMPTY: directory not empty, ${e}${n}`;case hP:return`EMFILE: too many open files, ${e}${n}`;case wP:return`ENOSYS: function not implemented, ${e}${n}`;case yP:return`[ERR_FS_EISDIR]: Path is a directory: ${e} returned EISDIR (is a directory) ${r}`;case gP:return`[ERR_OUT_OF_RANGE]: value out of range, ${e}${n}`;default:return`${t}: error occurred, ${e}${n}`}}a(bP,"formatError");function vP(t,e="",r="",i="",n=Error){let o=new n(bP(t,e,r,i));return o.code=t,r&&(o.path=r),o}a(vP,"createError");function _P(){return Math.random().toString(36).slice(2,8).padEnd(6,"0")}a(_P,"genRndStr6");function FP(t){if(typeof t=="number")return t;if(typeof t=="string"){let e=Ao.FLAGS[t];if(typeof e<"u")return e}throw new qu.TypeError("ERR_INVALID_OPT_VALUE","flags",t)}a(FP,"flagsToNumber");function EP(t){let e=[];return new Promise((r,i)=>{t.on("data",n=>e.push(n)),t.on("end",()=>r(zu.Buffer.concat(e))),t.on("error",i)})}a(EP,"streamToBuffer");var SP=a(t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),"bufToUint8");Pe.bufToUint8=SP;var xP=a((t,e,r,i,n,o)=>{(0,Na.validateFd)(t);let s=0,l,f=null,c,u,h=typeof e,d=typeof r,p=typeof i,m=typeof n;h!=="string"?d==="function"?u=r:p==="function"?(s=r|0,u=i):m==="function"?(s=r|0,l=i,u=n):(s=r|0,l=i,f=n,u=o):d==="function"?u=r:p==="function"?(f=r,u=i):m==="function"&&(f=r,c=i,u=n);let w=(0,Na.dataToBuffer)(e,c);h!=="string"?typeof l>"u"&&(l=w.length):(s=0,l=w.length);let y=z0(u);return[t,h==="string",w,s,l,f,y]},"getWriteArgs");Pe.getWriteArgs=xP;var TP=a((t,e,r,i,n)=>{(0,Na.validateFd)(t);let o,s,l,f,c=typeof e!="string";c?(s=(r||0)|0,l=i,f=n):(f=r,o=i);let u=(0,Na.dataToBuffer)(e,o);return c?typeof l>"u"&&(l=u.length):(s=0,l=u.length),[t,u,s||0,l,f]},"getWriteSyncArgs");Pe.getWriteSyncArgs=TP;function OP(t,e){return!e||e==="buffer"?t:t.toString(e)}a(OP,"bufferToEncoding");function kP(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"&&t.readable===!0}a(kP,"isReadableStream")});var J0=O($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.Superblock=void 0;var Be=Xi(),RP=iu(),G0=ou(),PP=lu(),AP=Rr(),K0=sa(),Kt=At(),Z0=en(),V=Dr(),It=ba(),IP=Yf(),pn=Be.posix?Be.posix.sep:Be.sep,X0=Be.posix?Be.posix.relative:Be.relative,CP=Be.posix?Be.posix.join:Be.join,{O_RDONLY:Wu,O_WRONLY:Ba,O_RDWR:Vu,O_CREAT:Y0,O_EXCL:DP,O_TRUNC:NP,O_APPEND:BP,O_DIRECTORY:LP}=Kt.constants,mn=class mn{static fromJSON(e,r){let i=new mn;return i.fromJSON(e,r),i}static fromNestedJSON(e,r){let i=new mn;return i.fromNestedJSON(e,r),i}constructor(e={}){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.open=(i,n,o,s=!0)=>{let l=this.openFile(i,n,o,s);if(!l)throw(0,V.createError)("ENOENT","open",i);return l.fd},this.writeFile=(i,n,o,s)=>{let l=typeof i=="number",f;l?f=i:f=this.open((0,V.pathToFilename)(i),o,s);let c=0,u=n.length,h=o&BP?void 0:0;try{for(;u>0;){let d=this.write(f,n,c,u,h);c+=d,u-=d,h!==void 0&&(h+=d)}}finally{l||this.close(f)}},this.read=(i,n,o,s,l)=>{if(n.byteLength<s)throw(0,V.createError)("ERR_OUT_OF_RANGE","read",void 0,void 0,RangeError);let f=this.getFileByFdOrThrow(i);if(f.node.isSymlink())throw(0,V.createError)("EPERM","read",f.link.getPath());return f.read(n,Number(o),Number(s),l===-1||typeof l!="number"?void 0:l)},this.readv=(i,n,o)=>{let s=this.getFileByFdOrThrow(i),l=o??void 0;l===-1&&(l=void 0);let f=0;for(let c of n){let u=s.read(c,0,c.byteLength,l);if(l=void 0,f+=u,u<c.byteLength)break}return f},this.link=(i,n)=>{let o;try{o=this.getLinkOrThrow(i,"link")}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"link",i,n)),u}let s=(0,Be.dirname)(n),l;try{l=this.getLinkOrThrow(s,"link")}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"link",i,n)),u}let f=(0,Be.basename)(n);if(l.getChild(f))throw(0,V.createError)("EEXIST","link",i,n);let c=o.getNode();c.nlink++,l.createChild(f,c)},this.unlink=i=>{let n=this.getLinkOrThrow(i,"unlink");if(n.length)throw Error("Dir not empty...");this.deleteLink(n);let o=n.getNode();o.nlink--,o.nlink<=0&&this.deleteNode(o)},this.symlink=(i,n)=>{let o=(0,It.filenameToSteps)(n),s;try{s=this.getLinkParentAsDirOrThrow(o)}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"symlink",i,n)),u}let l=o[o.length-1];if(s.getChild(l))throw(0,V.createError)("EEXIST","symlink",i,n);let f=s.getNode();if(!f.canExecute()||!f.canWrite())throw(0,V.createError)("EACCES","symlink",i,n);let c=s.createChild(l);return c.getNode().makeSymlink(i),c},this.rename=(i,n)=>{let o;try{o=this.getResolvedLinkOrThrow(i)}catch(h){throw h.code&&(h=(0,V.createError)(h.code,"rename",i,n)),h}let s;try{s=this.getLinkParentAsDirOrThrow(n)}catch(h){throw h.code&&(h=(0,V.createError)(h.code,"rename",i,n)),h}let l=o.parent;if(!l)throw(0,V.createError)("EINVAL","rename",i,n);let f=l.getNode(),c=s.getNode();if(!f.canExecute()||!f.canWrite()||!c.canExecute()||!c.canWrite())throw(0,V.createError)("EACCES","rename",i,n);l.deleteChild(o);let u=(0,Be.basename)(n);o.name=u,o.steps=[...s.steps,u],s.setChild(o.getName(),o)},this.mkdir=(i,n)=>{let o=(0,It.filenameToSteps)(i);if(!o.length)throw(0,V.createError)("EEXIST","mkdir",i);let s=this.getLinkParentAsDirOrThrow(i,"mkdir"),l=o[o.length-1];if(s.getChild(l))throw(0,V.createError)("EEXIST","mkdir",i);let f=s.getNode();if(!f.canWrite()||!f.canExecute())throw(0,V.createError)("EACCES","mkdir",i);s.createChild(l,this.createNode(Kt.constants.S_IFDIR|n))},this.mkdirp=(i,n)=>{let o=!1,s=(0,It.filenameToSteps)(i),l=null,f=s.length;for(f=s.length;f>=0&&(l=this.getResolvedLink(s.slice(0,f)),!l);f--);for(l||(l=this.root,f=0),l=this.getResolvedLinkOrThrow(Be.sep+s.slice(0,f).join(Be.sep),"mkdir"),f;f<s.length;f++){let c=l.getNode();if(c.isDirectory()){if(!c.canExecute()||!c.canWrite())throw(0,V.createError)("EACCES","mkdir",i)}else throw(0,V.createError)("ENOTDIR","mkdir",i);o=!0,l=l.createChild(s[f],this.createNode(Kt.constants.S_IFDIR|n))}return o?i:void 0},this.rmdir=(i,n=!1)=>{let o=this.getLinkAsDirOrThrow(i,"rmdir");if(o.length&&!n)throw(0,V.createError)("ENOTEMPTY","rmdir",i);this.deleteLink(o)},this.rm=(i,n=!1,o=!1)=>{let s;try{s=this.getResolvedLinkOrThrow(i,"stat")}catch(l){if(l.code==="ENOENT"&&n)return;throw l}if(s.getNode().isDirectory()&&!o)throw(0,V.createError)("ERR_FS_EISDIR","rm",i);if(!s.parent?.getNode().canWrite())throw(0,V.createError)("EACCES","rm",i);this.deleteLink(s)},this.close=i=>{(0,It.validateFd)(i);let n=this.getFileByFdOrThrow(i,"close");this.closeFile(n)};let r=this.createLink();r.setNode(this.createNode(Kt.constants.S_IFDIR|511)),r.setChild(".",r),r.getNode().nlink++,r.setChild("..",r),r.getNode().nlink++,this.root=r}createLink(e,r,i=!1,n){if(!e)return new G0.Link(this,void 0,"");if(!r)throw new Error("createLink: name cannot be empty");let o=n??(i?511:438),l=n&&n&Kt.constants.S_IFMT?n&Kt.constants.S_IFMT:i?Kt.constants.S_IFDIR:Kt.constants.S_IFREG,f=o&~Kt.constants.S_IFMT|l;return e.createChild(r,this.createNode(f))}deleteLink(e){let r=e.parent;return r?(r.deleteChild(e),!0):!1}newInoNumber(){let e=this.releasedInos.pop();return e||(this.ino=(this.ino+1)%4294967295,this.ino)}newFdNumber(){let e=this.releasedFds.pop();return typeof e=="number"?e:mn.fd--}createNode(e){let r=new RP.Node(this.newInoNumber(),e);return this.inodes[r.ino]=r,r}deleteNode(e){e.del(),delete this.inodes[e.ino],this.releasedInos.push(e.ino)}walk(e,r=!1,i=!1,n=!1,o){let s,l;e instanceof G0.Link?(s=e.steps,l=pn+s.join(pn)):typeof e=="string"?(s=(0,It.filenameToSteps)(e),l=e):(s=e,l=pn+s.join(pn));let f=this.root,c=0;for(;c<s.length;){let u=f.getNode();if(u.isDirectory()){if(n&&!u.canExecute())throw(0,V.createError)("EACCES",o,l)}else if(c<s.length-1)throw(0,V.createError)("ENOTDIR",o,l);if(f=f.getChild(s[c])??null,!f){if(i)throw(0,V.createError)("ENOENT",o,l);return null}if(u=f?.getNode(),u.isSymlink()&&(r||c<s.length-1)){let h=(0,Be.isAbsolute)(u.symlink)?u.symlink:CP((0,Be.dirname)(f.getPath()),u.symlink);s=(0,It.filenameToSteps)(h).concat(s.slice(c+1)),f=this.root,c=0;continue}if(i&&!u.isDirectory()&&c<s.length-1){let h=K0.default.platform==="win32"?"ENOENT":"ENOTDIR";throw(0,V.createError)(h,o,l)}c++}return f}getLink(e){return this.walk(e,!1,!1,!1)}getLinkOrThrow(e,r){return this.walk(e,!1,!0,!0,r)}getResolvedLink(e){return this.walk(e,!0,!1,!1)}getResolvedLinkOrThrow(e,r){return this.walk(e,!0,!0,!0,r)}resolveSymlinks(e){return this.getResolvedLink(e.steps.slice(1))}getLinkAsDirOrThrow(e,r){let i=this.getLinkOrThrow(e,r);if(!i.getNode().isDirectory())throw(0,V.createError)("ENOTDIR",r,e);return i}getLinkParent(e){return this.getLink(e.slice(0,-1))}getLinkParentAsDirOrThrow(e,r){let i=(e instanceof Array?e:(0,It.filenameToSteps)(e)).slice(0,-1),n=pn+i.join(pn),o=this.getLinkOrThrow(n,r);if(!o.getNode().isDirectory())throw(0,V.createError)("ENOTDIR",r,n);return o}getFileByFd(e){return this.fds[String(e)]}getFileByFdOrThrow(e,r){if(!(0,It.isFd)(e))throw TypeError(Z0.ERRSTR.FD);let i=this.getFileByFd(e);if(!i)throw(0,V.createError)("EBADF",r);return i}_toJSON(e=this.root,r={},i,n){let o=!0,s=e.children;e.getNode().isFile()&&(s=new Map([[e.getName(),e.parent.getChild(e.getName())]]),e=e.parent);for(let f of s.keys()){if(f==="."||f==="..")continue;o=!1;let c=e.getChild(f);if(!c)throw new Error("_toJSON: unexpected undefined");let u=c.getNode();if(u.isFile()){let h=c.getPath();i&&(h=X0(i,h)),r[h]=n?u.getBuffer():u.getString()}else u.isDirectory()&&this._toJSON(c,r,i,n)}let l=e.getPath();return i&&(l=X0(i,l)),l&&o&&(r[l]=null),r}toJSON(e,r={},i=!1,n=!1){let o=[];if(e){Array.isArray(e)||(e=[e]);for(let s of e){let l=(0,V.pathToFilename)(s),f=this.getResolvedLink(l);f&&o.push(f)}}else o.push(this.root);if(!o.length)return r;for(let s of o)this._toJSON(s,r,i?s.getPath():"",n);return r}fromJSON(e,r=K0.default.cwd()){for(let i in e){let n=e[i];if(i=(0,It.resolve)(i,r),typeof n=="string"||n instanceof AP.Buffer){let o=(0,Be.dirname)(i);this.mkdirp(o,511);let s=(0,It.dataToBuffer)(n);this.writeFile(i,s,Z0.FLAGS.w,438)}else this.mkdirp(i,511)}}fromNestedJSON(e,r){this.fromJSON((0,IP.flattenJSON)(e),r)}reset(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(Kt.constants.S_IFDIR|511))}mountSync(e,r){this.fromJSON(r,e)}openLink(e,r,i=!0){if(this.openFiles>=this.maxFiles)throw(0,V.createError)("EMFILE","open",e.getPath());let n=e;i&&(n=this.getResolvedLinkOrThrow(e.getPath(),"open"));let o=n.getNode();if(o.isDirectory()){if((r&(Wu|Vu|Ba))!==Wu)throw(0,V.createError)("EISDIR","open",e.getPath())}else if(r&LP)throw(0,V.createError)("ENOTDIR","open",e.getPath());if((r&(Wu|Vu|Ba))!==Ba&&!o.canRead()||r&(Ba|Vu)&&!o.canWrite())throw(0,V.createError)("EACCES","open",e.getPath());let s=new PP.File(e,o,r,this.newFdNumber());return this.fds[s.fd]=s,this.openFiles++,r&NP&&s.truncate(),s}openFile(e,r,i,n=!0){let o=(0,It.filenameToSteps)(e),s;try{if(s=n?this.getResolvedLinkOrThrow(e,"open"):this.getLinkOrThrow(e,"open"),s&&r&Y0&&r&DP)throw(0,V.createError)("EEXIST","open",e)}catch(l){if(l.code==="ENOENT"&&r&Y0){let f=(0,Be.dirname)(e),c=this.getResolvedLinkOrThrow(f),u=c.getNode();if(!u.isDirectory())throw(0,V.createError)("ENOTDIR","open",e);if(!u.canExecute()||!u.canWrite())throw(0,V.createError)("EACCES","open",e);i??(i=438),s=this.createLink(c,o[o.length-1],!1,i)}else throw l}if(s)return this.openLink(s,r,n);throw(0,V.createError)("ENOENT","open",e)}closeFile(e){this.fds[e.fd]&&(this.openFiles--,delete this.fds[e.fd],this.releasedFds.push(e.fd))}write(e,r,i,n,o){let s=this.getFileByFdOrThrow(e,"write");if(s.node.isSymlink())throw(0,V.createError)("EBADF","write",s.link.getPath());return s.write(r,i,n,o===-1||typeof o!="number"?void 0:o)}};a(mn,"Superblock");var La=mn;$a.Superblock=La;La.fd=2147483647});var eg=O(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.Superblock=yt.File=yt.Link=yt.Node=void 0;var Q0=(Zf(),Fm(Kf));Q0.__exportStar(Sw(),yt);Q0.__exportStar(Yf(),yt);var $P=iu();Object.defineProperty(yt,"Node",{enumerable:!0,get:a(function(){return $P.Node},"get")});var MP=ou();Object.defineProperty(yt,"Link",{enumerable:!0,get:a(function(){return MP.Link},"get")});var jP=lu();Object.defineProperty(yt,"File",{enumerable:!0,get:a(function(){return jP.File},"get")});var UP=J0();Object.defineProperty(yt,"Superblock",{enumerable:!0,get:a(function(){return UP.Superblock},"get")})});var tg=O(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.StatFs=void 0;var ja=class ja{static build(e,r=!1){let i=new ja,n=r?u=>BigInt(u):u=>u;i.type=n(2240043254),i.bsize=n(4096);let o=Object.keys(e.inodes).length,s=1e6,l=Math.min(o*2,s),f=s-l;i.blocks=n(s),i.bfree=n(f),i.bavail=n(f);let c=1e6;return i.files=n(c),i.ffree=n(c-o),i}};a(ja,"StatFs");var Ma=ja;Io.StatFs=Ma;Io.default=Ma});var rg=O(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});function HP(t,e,r){let i=setTimeout.apply(globalThis,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}a(HP,"setTimeoutUnref");Gu.default=HP});var Co=O((Jj,Ku)=>{"use strict";var wn=typeof Reflect=="object"?Reflect:null,ig=wn&&typeof wn.apply=="function"?wn.apply:a(function(e,r,i){return Function.prototype.apply.call(e,r,i)},"ReflectApply"),Ua;wn&&typeof wn.ownKeys=="function"?Ua=wn.ownKeys:Object.getOwnPropertySymbols?Ua=a(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ua=a(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function qP(t){console&&console.warn&&console.warn(t)}a(qP,"ProcessEmitWarning");var og=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function ce(){ce.init.call(this)}a(ce,"EventEmitter");Ku.exports=ce;Ku.exports.once=GP;ce.EventEmitter=ce;ce.prototype._events=void 0;ce.prototype._eventsCount=0;ce.prototype._maxListeners=void 0;var ng=10;function Ha(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}a(Ha,"checkListener");Object.defineProperty(ce,"defaultMaxListeners",{enumerable:!0,get:a(function(){return ng},"get"),set:a(function(t){if(typeof t!="number"||t<0||og(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ng=t},"set")});ce.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};ce.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||og(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function sg(t){return t._maxListeners===void 0?ce.defaultMaxListeners:t._maxListeners}a(sg,"_getMaxListeners");ce.prototype.getMaxListeners=a(function(){return sg(this)},"getMaxListeners");ce.prototype.emit=a(function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var l=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw l.context=s,l}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")ig(f,this,r);else for(var c=f.length,u=ug(f,c),i=0;i<c;++i)ig(u[i],this,r);return!0},"emit");function ag(t,e,r,i){var n,o,s;if(Ha(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),n=sg(t),n>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,qP(l)}return t}a(ag,"_addListener");ce.prototype.addListener=a(function(e,r){return ag(this,e,r,!1)},"addListener");ce.prototype.on=ce.prototype.addListener;ce.prototype.prependListener=a(function(e,r){return ag(this,e,r,!0)},"prependListener");function zP(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(zP,"onceWrapper");function lg(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=zP.bind(i);return n.listener=r,i.wrapFn=n,n}a(lg,"_onceWrap");ce.prototype.once=a(function(e,r){return Ha(r),this.on(e,lg(this,e,r)),this},"once");ce.prototype.prependOnceListener=a(function(e,r){return Ha(r),this.prependListener(e,lg(this,e,r)),this},"prependOnceListener");ce.prototype.removeListener=a(function(e,r){var i,n,o,s,l;if(Ha(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===r||i[s].listener===r){l=i[s].listener,o=s;break}if(o<0)return this;o===0?i.shift():WP(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},"removeListener");ce.prototype.off=ce.prototype.removeListener;ce.prototype.removeAllListeners=a(function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),s;for(n=0;n<o.length;++n)s=o[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this},"removeAllListeners");function cg(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?VP(n):ug(n,n.length)}a(cg,"_listeners");ce.prototype.listeners=a(function(e){return cg(this,e,!0)},"listeners");ce.prototype.rawListeners=a(function(e){return cg(this,e,!1)},"rawListeners");ce.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):fg.call(t,e)};ce.prototype.listenerCount=fg;function fg(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}a(fg,"listenerCount");ce.prototype.eventNames=a(function(){return this._eventsCount>0?Ua(this._events):[]},"eventNames");function ug(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}a(ug,"arrayClone");function WP(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}a(WP,"spliceOne");function VP(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}a(VP,"unwrapListeners");function GP(t,e){return new Promise(function(r,i){function n(s){t.removeListener(e,o),i(s)}a(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}a(o,"resolver"),hg(t,e,o,{once:!0}),e!=="error"&&KP(t,n,{once:!0})})}a(GP,"once");function KP(t,e,r){typeof t.on=="function"&&hg(t,"error",e,r)}a(KP,"addErrorHandlerIfEventEmitter");function hg(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,a(function n(o){i.once&&t.removeEventListener(e,n),r(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}a(hg,"eventTargetAgnosticAddListener")});var Zt=O((e6,Zu)=>{typeof Object.create=="function"?Zu.exports=a(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Zu.exports=a(function(e,r){if(r){e.super_=r;var i=a(function(){},"TempCtor");i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}},"inherits")});var Xu=O((r6,dg)=>{dg.exports=Co().EventEmitter});var Yu=O(()=>{});var bg=O((o6,gg)=>{"use strict";function pg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}a(pg,"ownKeys");function mg(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pg(Object(r),!0).forEach(function(i){ZP(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pg(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}a(mg,"_objectSpread");function ZP(t,e,r){return e=yg(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a(ZP,"_defineProperty");function XP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}a(XP,"_classCallCheck");function wg(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,yg(i.key),i)}}a(wg,"_defineProperties");function YP(t,e,r){return e&&wg(t.prototype,e),r&&wg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}a(YP,"_createClass");function yg(t){var e=JP(t,"string");return typeof e=="symbol"?e:String(e)}a(yg,"_toPropertyKey");function JP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}a(JP,"_toPrimitive");var QP=ai(),qa=QP.Buffer,eA=Yu(),Ju=eA.inspect,tA=Ju&&Ju.custom||"inspect";function rA(t,e,r){qa.prototype.copy.call(t,e,r)}a(rA,"copyBuffer");gg.exports=function(){function t(){XP(this,t),this.head=null,this.tail=null,this.length=0}return a(t,"BufferList"),YP(t,[{key:"push",value:a(function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},"push")},{key:"unshift",value:a(function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},"unshift")},{key:"shift",value:a(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:a(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:a(function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},"join")},{key:"concat",value:a(function(r){if(this.length===0)return qa.alloc(0);for(var i=qa.allocUnsafe(r>>>0),n=this.head,o=0;n;)rA(n.data,i,o),o+=n.data.length,n=n.next;return i},"concat")},{key:"consume",value:a(function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n},"consume")},{key:"first",value:a(function(){return this.head.data},"first")},{key:"_getString",value:a(function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var s=i.data,l=r>s.length?s.length:r;if(l===s.length?o+=s:o+=s.slice(0,r),r-=l,r===0){l===s.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(l));break}++n}return this.length-=n,o},"_getString")},{key:"_getBuffer",value:a(function(r){var i=qa.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var s=n.data,l=r>s.length?s.length:r;if(s.copy(i,i.length-r,0,l),r-=l,r===0){l===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(l));break}++o}return this.length-=o,i},"_getBuffer")},{key:tA,value:a(function(r,i){return Ju(this,mg(mg({},i),{},{depth:0,customInspect:!1}))},"value")}]),t}()});var eh=O((a6,_g)=>{"use strict";function iA(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Qu,this,t)):process.nextTick(Qu,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(za,r):(r._writableState.errorEmitted=!0,process.nextTick(vg,r,o)):process.nextTick(vg,r,o):e?(process.nextTick(za,r),e(o)):process.nextTick(za,r)}),this)}a(iA,"destroy");function vg(t,e){Qu(t,e),za(t)}a(vg,"emitErrorAndCloseNT");function za(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}a(za,"emitCloseNT");function nA(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}a(nA,"undestroy");function Qu(t,e){t.emit("error",e)}a(Qu,"emitErrorNT");function oA(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}a(oA,"errorOrDestroy");_g.exports={destroy:iA,undestroy:nA,errorOrDestroy:oA}});var di=O((c6,Sg)=>{"use strict";function sA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}a(sA,"_inheritsLoose");var Eg={};function gt(t,e,r){r||(r=Error);function i(o,s,l){return typeof e=="string"?e:e(o,s,l)}a(i,"getMessage");var n=function(o){sA(s,o);function s(l,f,c){return o.call(this,i(l,f,c))||this}return a(s,"NodeError"),s}(r);n.prototype.name=r.name,n.prototype.code=t,Eg[t]=n}a(gt,"createErrorType");function Fg(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}a(Fg,"oneOf");function aA(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}a(aA,"startsWith");function lA(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}a(lA,"endsWith");function cA(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}a(cA,"includes");gt("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);gt("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&aA(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(lA(t," argument"))n="The ".concat(t," ").concat(i," ").concat(Fg(e,"type"));else{var o=cA(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(Fg(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);gt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");gt("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});gt("ERR_STREAM_PREMATURE_CLOSE","Premature close");gt("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});gt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");gt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");gt("ERR_STREAM_WRITE_AFTER_END","write after end");gt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);gt("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);gt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Sg.exports.codes=Eg});var th=O((u6,xg)=>{"use strict";var fA=di().codes.ERR_INVALID_OPT_VALUE;function uA(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}a(uA,"highWaterMarkFrom");function hA(t,e,r,i){var n=uA(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new fA(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}a(hA,"getHighWaterMark");xg.exports={getHighWaterMark:hA}});var Og=O((d6,Tg)=>{Tg.exports=dA;function dA(t,e){if(rh("noDeprecation"))return t;var r=!1;function i(){if(!r){if(rh("throwDeprecation"))throw new Error(e);rh("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return a(i,"deprecated"),i}a(dA,"deprecate");function rh(t){try{if(!globalThis.localStorage)return!1}catch{return!1}var e=globalThis.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}a(rh,"config")});var Ga=O((m6,Cg)=>{"use strict";Cg.exports=ge;function Rg(t){var e=this;this.next=null,this.entry=null,this.finish=function(){jA(e,t)}}a(Rg,"CorkedRequest");var yn;ge.WritableState=No;var pA={deprecate:Og()},Pg=Xu(),Va=ai().Buffer,mA=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function wA(t){return Va.from(t)}a(wA,"_uint8ArrayToBuffer");function yA(t){return Va.isBuffer(t)||t instanceof mA}a(yA,"_isUint8Array");var nh=eh(),gA=th(),bA=gA.getHighWaterMark,Nr=di().codes,vA=Nr.ERR_INVALID_ARG_TYPE,_A=Nr.ERR_METHOD_NOT_IMPLEMENTED,FA=Nr.ERR_MULTIPLE_CALLBACK,EA=Nr.ERR_STREAM_CANNOT_PIPE,SA=Nr.ERR_STREAM_DESTROYED,xA=Nr.ERR_STREAM_NULL_VALUES,TA=Nr.ERR_STREAM_WRITE_AFTER_END,OA=Nr.ERR_UNKNOWN_ENCODING,gn=nh.errorOrDestroy;Zt()(ge,Pg);function kA(){}a(kA,"nop");function No(t,e,r){yn=yn||Br(),t=t||{},typeof r!="boolean"&&(r=e instanceof yn),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=bA(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){NA(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Rg(this)}a(No,"WritableState");No.prototype.getBuffer=a(function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},"getBuffer");(function(){try{Object.defineProperty(No.prototype,"buffer",{get:pA.deprecate(a(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Wa;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Wa=Function.prototype[Symbol.hasInstance],Object.defineProperty(ge,Symbol.hasInstance,{value:a(function(e){return Wa.call(this,e)?!0:this!==ge?!1:e&&e._writableState instanceof No},"value")})):Wa=a(function(e){return e instanceof this},"realHasInstance");function ge(t){yn=yn||Br();var e=this instanceof yn;if(!e&&!Wa.call(ge,this))return new ge(t);this._writableState=new No(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Pg.call(this)}a(ge,"Writable");ge.prototype.pipe=function(){gn(this,new EA)};function RA(t,e){var r=new TA;gn(t,r),process.nextTick(e,r)}a(RA,"writeAfterEnd");function PA(t,e,r,i){var n;return r===null?n=new xA:typeof r!="string"&&!e.objectMode&&(n=new vA("chunk",["string","Buffer"],r)),n?(gn(t,n),process.nextTick(i,n),!1):!0}a(PA,"validChunk");ge.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&yA(t);return o&&!Va.isBuffer(t)&&(t=wA(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=kA),i.ending?RA(this,r):(o||PA(this,i,t,r))&&(i.pendingcb++,n=IA(this,i,o,t,e,r)),n};ge.prototype.cork=function(){this._writableState.corked++};ge.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Ag(this,t))};ge.prototype.setDefaultEncoding=a(function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new OA(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");Object.defineProperty(ge.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function AA(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Va.from(e,r)),e}a(AA,"decodeChunk");Object.defineProperty(ge.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});function IA(t,e,r,i,n,o){if(!r){var s=AA(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var l=e.objectMode?1:i.length;e.length+=l;var f=e.length<e.highWaterMark;if(f||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else ih(t,e,!1,l,i,n,o);return f}a(IA,"writeOrBuffer");function ih(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new SA("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}a(ih,"doWrite");function CA(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(Do,t,e),t._writableState.errorEmitted=!0,gn(t,i)):(n(i),t._writableState.errorEmitted=!0,gn(t,i),Do(t,e))}a(CA,"onwriteError");function DA(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}a(DA,"onwriteStateUpdate");function NA(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new FA;if(DA(r),e)CA(t,r,i,e,n);else{var o=Ig(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Ag(t,r),i?process.nextTick(kg,t,r,o,n):kg(t,r,o,n)}}a(NA,"onwrite");function kg(t,e,r,i){r||BA(t,e),e.pendingcb--,i(),Do(t,e)}a(kg,"afterWrite");function BA(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}a(BA,"onwriteDrain");function Ag(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,ih(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Rg(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,u=r.callback,h=e.objectMode?1:f.length;if(ih(t,e,!1,h,f,c,u),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}a(Ag,"clearBuffer");ge.prototype._write=function(t,e,r){r(new _A("_write()"))};ge.prototype._writev=null;ge.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||MA(this,i,r),this};Object.defineProperty(ge.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function Ig(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}a(Ig,"needFinish");function LA(t,e){t._final(function(r){e.pendingcb--,r&&gn(t,r),e.prefinished=!0,t.emit("prefinish"),Do(t,e)})}a(LA,"callFinal");function $A(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(LA,t,e)):(e.prefinished=!0,t.emit("prefinish")))}a($A,"prefinish");function Do(t,e){var r=Ig(e);if(r&&($A(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}a(Do,"finishMaybe");function MA(t,e,r){e.ending=!0,Do(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}a(MA,"endWritable");function jA(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}a(jA,"onCorkedFinish");Object.defineProperty(ge.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:a(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")});ge.prototype.destroy=nh.destroy;ge.prototype._undestroy=nh.undestroy;ge.prototype._destroy=function(t,e){e(t)}});var Br=O((y6,Ng)=>{"use strict";var UA=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Ng.exports=Xt;var Dg=Xa(),sh=Ga();Zt()(Xt,Dg);for(oh=UA(sh.prototype),Ka=0;Ka<oh.length;Ka++)Za=oh[Ka],Xt.prototype[Za]||(Xt.prototype[Za]=sh.prototype[Za]);var oh,Za,Ka;function Xt(t){if(!(this instanceof Xt))return new Xt(t);Dg.call(this,t),sh.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",HA)))}a(Xt,"Duplex");Object.defineProperty(Xt.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(Xt.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(Xt.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function HA(){this._writableState.ended||process.nextTick(qA,this)}a(HA,"onend");function qA(t){t.end()}a(qA,"onEndNT");Object.defineProperty(Xt.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:a(function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")})});var Bo=O((ah,Lg)=>{var Ya=ai(),Yt=Ya.Buffer;function Bg(t,e){for(var r in t)e[r]=t[r]}a(Bg,"copyProps");Yt.from&&Yt.alloc&&Yt.allocUnsafe&&Yt.allocUnsafeSlow?Lg.exports=Ya:(Bg(Ya,ah),ah.Buffer=pi);function pi(t,e,r){return Yt(t,e,r)}a(pi,"SafeBuffer");pi.prototype=Object.create(Yt.prototype);Bg(Yt,pi);pi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Yt(t,e,r)};pi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Yt(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};pi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Yt(t)};pi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ya.SlowBuffer(t)}});var fh=O(Mg=>{"use strict";var ch=Bo().Buffer,$g=ch.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function zA(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}a(zA,"_normalizeEncoding");function WA(t){var e=zA(t);if(typeof e!="string"&&(ch.isEncoding===$g||!$g(t)))throw new Error("Unknown encoding: "+t);return e||t}a(WA,"normalizeEncoding");Mg.StringDecoder=Lo;function Lo(t){this.encoding=WA(t);var e;switch(this.encoding){case"utf16le":this.text=YA,this.end=JA,e=4;break;case"utf8":this.fillLast=KA,e=4;break;case"base64":this.text=QA,this.end=eI,e=3;break;default:this.write=tI,this.end=rI;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ch.allocUnsafe(e)}a(Lo,"StringDecoder");Lo.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Lo.prototype.end=XA;Lo.prototype.text=ZA;Lo.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function lh(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}a(lh,"utf8CheckByte");function VA(t,e,r){var i=e.length-1;if(i<r)return 0;var n=lh(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=lh(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=lh(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}a(VA,"utf8CheckIncomplete");function GA(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}a(GA,"utf8CheckExtraBytes");function KA(t){var e=this.lastTotal-this.lastNeed,r=GA(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}a(KA,"utf8FillLast");function ZA(t,e){var r=VA(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}a(ZA,"utf8Text");function XA(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}a(XA,"utf8End");function YA(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}a(YA,"utf16Text");function JA(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}a(JA,"utf16End");function QA(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}a(QA,"base64Text");function eI(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}a(eI,"base64End");function tI(t){return t.toString(this.encoding)}a(tI,"simpleWrite");function rI(t){return t&&t.length?this.write(t):""}a(rI,"simpleEnd")});var $o=O((F6,Hg)=>{"use strict";var jg=di().codes.ERR_STREAM_PREMATURE_CLOSE;function iI(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}a(iI,"once");function nI(){}a(nI,"noop");function oI(t){return t.setHeader&&typeof t.abort=="function"}a(oI,"isRequest");function Ug(t,e,r){if(typeof e=="function")return Ug(t,null,e);e||(e={}),r=iI(r||nI);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,o=a(function(){t.writable||l()},"onlegacyfinish"),s=t._writableState&&t._writableState.finished,l=a(function(){n=!1,s=!0,i||r.call(t)},"onfinish"),f=t._readableState&&t._readableState.endEmitted,c=a(function(){i=!1,f=!0,n||r.call(t)},"onend"),u=a(function(m){r.call(t,m)},"onerror"),h=a(function(){var m;if(i&&!f)return(!t._readableState||!t._readableState.ended)&&(m=new jg),r.call(t,m);if(n&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new jg),r.call(t,m)},"onclose"),d=a(function(){t.req.on("finish",l)},"onrequest");return oI(t)?(t.on("complete",l),t.on("abort",h),t.req?d():t.on("request",d)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",l),e.error!==!1&&t.on("error",u),t.on("close",h),function(){t.removeListener("complete",l),t.removeListener("abort",h),t.removeListener("request",d),t.req&&t.req.removeListener("finish",l),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",l),t.removeListener("end",c),t.removeListener("error",u),t.removeListener("close",h)}}a(Ug,"eos");Hg.exports=Ug});var zg=O((S6,qg)=>{"use strict";var Ja;function Lr(t,e,r){return e=sI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a(Lr,"_defineProperty");function sI(t){var e=aI(t,"string");return typeof e=="symbol"?e:String(e)}a(sI,"_toPropertyKey");function aI(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}a(aI,"_toPrimitive");var lI=$o(),$r=Symbol("lastResolve"),mi=Symbol("lastReject"),Mo=Symbol("error"),Qa=Symbol("ended"),wi=Symbol("lastPromise"),uh=Symbol("handlePromise"),yi=Symbol("stream");function Mr(t,e){return{value:t,done:e}}a(Mr,"createIterResult");function cI(t){var e=t[$r];if(e!==null){var r=t[yi].read();r!==null&&(t[wi]=null,t[$r]=null,t[mi]=null,e(Mr(r,!1)))}}a(cI,"readAndResolve");function fI(t){process.nextTick(cI,t)}a(fI,"onReadable");function uI(t,e){return function(r,i){t.then(function(){if(e[Qa]){r(Mr(void 0,!0));return}e[uh](r,i)},i)}}a(uI,"wrapForNext");var hI=Object.getPrototypeOf(function(){}),dI=Object.setPrototypeOf((Ja={get stream(){return this[yi]},next:a(function(){var e=this,r=this[Mo];if(r!==null)return Promise.reject(r);if(this[Qa])return Promise.resolve(Mr(void 0,!0));if(this[yi].destroyed)return new Promise(function(s,l){process.nextTick(function(){e[Mo]?l(e[Mo]):s(Mr(void 0,!0))})});var i=this[wi],n;if(i)n=new Promise(uI(i,this));else{var o=this[yi].read();if(o!==null)return Promise.resolve(Mr(o,!1));n=new Promise(this[uh])}return this[wi]=n,n},"next")},Lr(Ja,Symbol.asyncIterator,function(){return this}),Lr(Ja,"return",a(function(){var e=this;return new Promise(function(r,i){e[yi].destroy(null,function(n){if(n){i(n);return}r(Mr(void 0,!0))})})},"_return")),Ja),hI),pI=a(function(e){var r,i=Object.create(dI,(r={},Lr(r,yi,{value:e,writable:!0}),Lr(r,$r,{value:null,writable:!0}),Lr(r,mi,{value:null,writable:!0}),Lr(r,Mo,{value:null,writable:!0}),Lr(r,Qa,{value:e._readableState.endEmitted,writable:!0}),Lr(r,uh,{value:a(function(o,s){var l=i[yi].read();l?(i[wi]=null,i[$r]=null,i[mi]=null,o(Mr(l,!1))):(i[$r]=o,i[mi]=s)},"value"),writable:!0}),r));return i[wi]=null,lI(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[mi];o!==null&&(i[wi]=null,i[$r]=null,i[mi]=null,o(n)),i[Mo]=n;return}var s=i[$r];s!==null&&(i[wi]=null,i[$r]=null,i[mi]=null,s(Mr(void 0,!0))),i[Qa]=!0}),e.on("readable",fI.bind(null,i)),i},"createReadableStreamAsyncIterator");qg.exports=pI});var Vg=O((T6,Wg)=>{Wg.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Xa=O((k6,rb)=>{"use strict";rb.exports=ne;var bn;ne.ReadableState=Xg;var O6=Co().EventEmitter,Zg=a(function(e,r){return e.listeners(r).length},"EElistenerCount"),Uo=Xu(),el=ai().Buffer,mI=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function wI(t){return el.from(t)}a(wI,"_uint8ArrayToBuffer");function yI(t){return el.isBuffer(t)||t instanceof mI}a(yI,"_isUint8Array");var hh=Yu(),K;hh&&hh.debuglog?K=hh.debuglog("stream"):K=a(function(){},"debug");var gI=bg(),bh=eh(),bI=th(),vI=bI.getHighWaterMark,tl=di().codes,_I=tl.ERR_INVALID_ARG_TYPE,FI=tl.ERR_STREAM_PUSH_AFTER_EOF,EI=tl.ERR_METHOD_NOT_IMPLEMENTED,SI=tl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,vn,dh,ph;Zt()(ne,Uo);var jo=bh.errorOrDestroy,mh=["error","close","destroy","pause","resume"];function xI(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}a(xI,"prependListener");function Xg(t,e,r){bn=bn||Br(),t=t||{},typeof r!="boolean"&&(r=e instanceof bn),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=vI(this,t,"readableHighWaterMark",r),this.buffer=new gI,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(vn||(vn=fh().StringDecoder),this.decoder=new vn(t.encoding),this.encoding=t.encoding)}a(Xg,"ReadableState");function ne(t){if(bn=bn||Br(),!(this instanceof ne))return new ne(t);var e=this instanceof bn;this._readableState=new Xg(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Uo.call(this)}a(ne,"Readable");Object.defineProperty(ne.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:a(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")});ne.prototype.destroy=bh.destroy;ne.prototype._undestroy=bh.undestroy;ne.prototype._destroy=function(t,e){e(t)};ne.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=el.from(t,e),e=""),i=!0),Yg(this,t,e,!1,i)};ne.prototype.unshift=function(t){return Yg(this,t,null,!0,!1)};function Yg(t,e,r,i,n){K("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,kI(t,o);else{var s;if(n||(s=TI(o,e)),s)jo(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==el.prototype&&(e=wI(e)),i)o.endEmitted?jo(t,new SI):wh(t,o,e,!0);else if(o.ended)jo(t,new FI);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?wh(t,o,e,!1):gh(t,o)):wh(t,o,e,!1)}else i||(o.reading=!1,gh(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}a(Yg,"readableAddChunk");function wh(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&rl(t)),gh(t,e)}a(wh,"addChunk");function TI(t,e){var r;return!yI(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new _I("chunk",["string","Buffer","Uint8Array"],e)),r}a(TI,"chunkInvalid");ne.prototype.isPaused=function(){return this._readableState.flowing===!1};ne.prototype.setEncoding=function(t){vn||(vn=fh().StringDecoder);var e=new vn(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var Gg=1073741824;function OI(t){return t>=Gg?t=Gg:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}a(OI,"computeNewHighWaterMark");function Kg(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=OI(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}a(Kg,"howMuchToRead");ne.prototype.read=function(t){K("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return K("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?yh(this):rl(this),null;if(t=Kg(t,e),t===0&&e.ended)return e.length===0&&yh(this),null;var i=e.needReadable;K("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,K("length less than watermark",i)),e.ended||e.reading?(i=!1,K("reading or ended",i)):i&&(K("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Kg(r,e)));var n;return t>0?n=eb(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&yh(this)),n!==null&&this.emit("data",n),n};function kI(t,e){if(K("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?rl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Jg(t)))}}a(kI,"onEofChunk");function rl(t){var e=t._readableState;K("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(K("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Jg,t))}a(rl,"emitReadable");function Jg(t){var e=t._readableState;K("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,vh(t)}a(Jg,"emitReadable_");function gh(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(RI,t,e))}a(gh,"maybeReadMore");function RI(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(K("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}a(RI,"maybeReadMore_");ne.prototype._read=function(t){jo(this,new EI("_read()"))};ne.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,K("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=n?l:w;i.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(y,v){K("onunpipe"),y===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,u())}a(s,"onunpipe");function l(){K("onend"),t.end()}a(l,"onend");var f=PI(r);t.on("drain",f);var c=!1;function u(){K("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",w),r.removeListener("data",h),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f()}a(u,"cleanup"),r.on("data",h);function h(y){K("ondata");var v=t.write(y);K("dest.write",v),v===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&tb(i.pipes,t)!==-1)&&!c&&(K("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}a(h,"ondata");function d(y){K("onerror",y),w(),t.removeListener("error",d),Zg(t,"error")===0&&jo(t,y)}a(d,"onerror"),xI(t,"error",d);function p(){t.removeListener("finish",m),w()}a(p,"onclose"),t.once("close",p);function m(){K("onfinish"),t.removeListener("close",p),w()}a(m,"onfinish"),t.once("finish",m);function w(){K("unpipe"),r.unpipe(t)}return a(w,"unpipe"),t.emit("pipe",r),i.flowing||(K("pipe resume"),r.resume()),t};function PI(t){return a(function(){var r=t._readableState;K("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Zg(t,"data")&&(r.flowing=!0,vh(t))},"pipeOnDrainFunctionResult")}a(PI,"pipeOnDrain");ne.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=tb(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ne.prototype.on=function(t,e){var r=Uo.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,K("on readable",i.length,i.reading),i.length?rl(this):i.reading||process.nextTick(AI,this)),r};ne.prototype.addListener=ne.prototype.on;ne.prototype.removeListener=function(t,e){var r=Uo.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Qg,this),r};ne.prototype.removeAllListeners=function(t){var e=Uo.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Qg,this),e};function Qg(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}a(Qg,"updateReadableListening");function AI(t){K("readable nexttick read 0"),t.read(0)}a(AI,"nReadingNextTick");ne.prototype.resume=function(){var t=this._readableState;return t.flowing||(K("resume"),t.flowing=!t.readableListening,II(this,t)),t.paused=!1,this};function II(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(CI,t,e))}a(II,"resume");function CI(t,e){K("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),vh(t),e.flowing&&!e.reading&&t.read(0)}a(CI,"resume_");ne.prototype.pause=function(){return K("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(K("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function vh(t){var e=t._readableState;for(K("flow",e.flowing);e.flowing&&t.read()!==null;);}a(vh,"flow");ne.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(K("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(K("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var l=e.push(s);l||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=a(function(l){return a(function(){return t[l].apply(t,arguments)},"methodWrapReturnFunction")},"methodWrap")(n));for(var o=0;o<mh.length;o++)t.on(mh[o],this.emit.bind(this,mh[o]));return this._read=function(s){K("wrapped _read",s),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(ne.prototype[Symbol.asyncIterator]=function(){return dh===void 0&&(dh=zg()),dh(this)});Object.defineProperty(ne.prototype,"readableHighWaterMark",{enumerable:!1,get:a(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(ne.prototype,"readableBuffer",{enumerable:!1,get:a(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(ne.prototype,"readableFlowing",{enumerable:!1,get:a(function(){return this._readableState.flowing},"get"),set:a(function(e){this._readableState&&(this._readableState.flowing=e)},"set")});ne._fromList=eb;Object.defineProperty(ne.prototype,"readableLength",{enumerable:!1,get:a(function(){return this._readableState.length},"get")});function eb(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}a(eb,"fromList");function yh(t){var e=t._readableState;K("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(DI,e,t))}a(yh,"endReadable");function DI(t,e){if(K("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}a(DI,"endReadableNT");typeof Symbol=="function"&&(ne.from=function(t,e){return ph===void 0&&(ph=Vg()),ph(ne,t,e)});function tb(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}a(tb,"indexOf")});var ol=O((P6,nb)=>{"use strict";nb.exports=ur;var il=di().codes,NI=il.ERR_METHOD_NOT_IMPLEMENTED,BI=il.ERR_MULTIPLE_CALLBACK,LI=il.ERR_TRANSFORM_ALREADY_TRANSFORMING,$I=il.ERR_TRANSFORM_WITH_LENGTH_0,nl=Br();Zt()(ur,nl);function MI(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new BI);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}a(MI,"afterTransform");function ur(t){if(!(this instanceof ur))return new ur(t);nl.call(this,t),this._transformState={afterTransform:MI.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",jI)}a(ur,"Transform");function jI(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){ib(t,e,r)}):ib(this,null,null)}a(jI,"prefinish");ur.prototype.push=function(t,e){return this._transformState.needTransform=!1,nl.prototype.push.call(this,t,e)};ur.prototype._transform=function(t,e,r){r(new NI("_transform()"))};ur.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};ur.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};ur.prototype._destroy=function(t,e){nl.prototype._destroy.call(this,t,function(r){e(r)})};function ib(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new $I;if(t._transformState.transforming)throw new LI;return t.push(null)}a(ib,"done")});var _h=O((I6,sb)=>{"use strict";sb.exports=Ho;var ob=ol();Zt()(Ho,ob);function Ho(t){if(!(this instanceof Ho))return new Ho(t);ob.call(this,t)}a(Ho,"PassThrough");Ho.prototype._transform=function(t,e,r){r(null,t)}});var Eh=O((D6,fb)=>{"use strict";var Fh;function UI(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}a(UI,"once");var cb=di().codes,HI=cb.ERR_MISSING_ARGS,qI=cb.ERR_STREAM_DESTROYED;function ab(t){if(t)throw t}a(ab,"noop");function zI(t){return t.setHeader&&typeof t.abort=="function"}a(zI,"isRequest");function WI(t,e,r,i){i=UI(i);var n=!1;t.on("close",function(){n=!0}),Fh===void 0&&(Fh=$o()),Fh(t,{readable:e,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,zI(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(s||new qI("pipe"))}}}a(WI,"destroyer");function lb(t){t()}a(lb,"call");function VI(t,e){return t.pipe(e)}a(VI,"pipe");function GI(t){return!t.length||typeof t[t.length-1]!="function"?ab:t.pop()}a(GI,"popCallback");function KI(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=GI(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new HI("streams");var n,o=e.map(function(s,l){var f=l<e.length-1,c=l>0;return WI(s,f,c,function(u){n||(n=u),u&&o.forEach(lb),!f&&(o.forEach(lb),i(n))})});return e.reduce(VI)}a(KI,"pipeline");fb.exports=KI});var hb=O((B6,ub)=>{ub.exports=bt;var Sh=Co().EventEmitter,ZI=Zt();ZI(bt,Sh);bt.Readable=Xa();bt.Writable=Ga();bt.Duplex=Br();bt.Transform=ol();bt.PassThrough=_h();bt.finished=$o();bt.pipeline=Eh();bt.Stream=bt;function bt(){Sh.call(this)}a(bt,"Stream");bt.prototype.pipe=function(t,e){var r=this;function i(u){t.writable&&t.write(u)===!1&&r.pause&&r.pause()}a(i,"ondata"),r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}a(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}a(s,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}a(l,"onclose");function f(u){if(c(),Sh.listenerCount(this,"error")===0)throw u}a(f,"onerror"),r.on("error",f),t.on("error",f);function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return a(c,"cleanup"),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}});var pb=O(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.Writable=_n.Readable=void 0;var db=hb();Object.defineProperty(_n,"Readable",{enumerable:!0,get:a(function(){return db.Readable},"get")});Object.defineProperty(_n,"Writable",{enumerable:!0,get:a(function(){return db.Writable},"get")})});var xh=O(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.EventEmitter=void 0;var XI=Co();Object.defineProperty(sl,"EventEmitter",{enumerable:!0,get:a(function(){return XI.EventEmitter},"get")})});var mb=O(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.FileHandle=void 0;var He=Dr(),YI=xh(),Oh=class Oh extends YI.EventEmitter{constructor(e,r){super(),this.refs=1,this.closePromise=null,this.position=0,this.readableWebStreamLocked=!1,this.fs=e,this.fd=r}getAsyncId(){return this.fd}appendFile(e,r){return(0,He.promisify)(this.fs,"appendFile")(this.fd,e,r)}chmod(e){return(0,He.promisify)(this.fs,"fchmod")(this.fd,e)}chown(e,r){return(0,He.promisify)(this.fs,"fchown")(this.fd,e,r)}close(){if(this.fd===-1)return Promise.resolve();if(this.closePromise)return this.closePromise;if(this.refs--,this.refs===0){let e=this.fd;this.fd=-1,this.closePromise=(0,He.promisify)(this.fs,"close")(e).finally(()=>{this.closePromise=null})}else this.closePromise=new Promise((e,r)=>{this.closeResolve=e,this.closeReject=r}).finally(()=>{this.closePromise=null,this.closeReject=void 0,this.closeResolve=void 0});return this.emit("close"),this.closePromise}datasync(){return(0,He.promisify)(this.fs,"fdatasync")(this.fd)}createReadStream(e){return this.fs.createReadStream("",{...e,fd:this})}createWriteStream(e){return this.fs.createWriteStream("",{...e,fd:this})}readableWebStream(e={}){let{type:r="bytes",autoClose:i=!1}=e,n=0;if(this.fd===-1)throw new Error("The FileHandle is closed");if(this.closePromise)throw new Error("The FileHandle is closing");if(this.readableWebStreamLocked)throw new Error("An error will be thrown if this method is called more than once or is called after the FileHandle is closed or closing.");this.readableWebStreamLocked=!0,this.ref();let o=a(()=>{this.readableWebStreamLocked=!1,this.unref(),i&&this.close().catch(()=>{})},"unlockAndCleanup");return new ReadableStream({type:r==="bytes"?"bytes":void 0,autoAllocateChunkSize:16384,pull:a(async s=>{try{let l=s.byobRequest?.view;if(!l){let c=new Uint8Array(16384),u=await this.read(c,0,c.length,n);if(u.bytesRead===0){s.close(),o();return}n+=u.bytesRead,s.enqueue(c.slice(0,u.bytesRead));return}let f=await this.read(l,l.byteOffset,l.byteLength,n);if(f.bytesRead===0){s.close(),o();return}n+=f.bytesRead,s.byobRequest.respond(f.bytesRead)}catch(l){s.error(l),o()}},"pull"),cancel:a(async()=>{o()},"cancel")})}async read(e,r,i,n){let o=n??this.position,s=await(0,He.promisify)(this.fs,"read",l=>({bytesRead:l,buffer:e}))(this.fd,e,r,i,o);return n==null&&(this.position+=s.bytesRead),s}readv(e,r){return(0,He.promisify)(this.fs,"readv",i=>({bytesRead:i,buffers:e}))(this.fd,e,r)}readFile(e){return(0,He.promisify)(this.fs,"readFile")(this.fd,e)}stat(e){return(0,He.promisify)(this.fs,"fstat")(this.fd,e)}sync(){return(0,He.promisify)(this.fs,"fsync")(this.fd)}truncate(e){return(0,He.promisify)(this.fs,"ftruncate")(this.fd,e)}utimes(e,r){return(0,He.promisify)(this.fs,"futimes")(this.fd,e,r)}async write(e,r,i,n){let o=typeof n!="number",s=o?this.position:n,l=await(0,He.promisify)(this.fs,"write",f=>({bytesWritten:f,buffer:e}))(this.fd,e,r,i,s);return o&&(this.position+=l.bytesWritten),l}writev(e,r){return(0,He.promisify)(this.fs,"writev",i=>({bytesWritten:i,buffers:e}))(this.fd,e,r)}writeFile(e,r){return(0,He.promisify)(this.fs,"writeFile")(this.fd,e,r)}async[Symbol.asyncDispose](){await this.close()}ref(){this.refs++}unref(){this.refs--,this.refs===0&&(this.fd=-1,this.closeResolve&&(0,He.promisify)(this.fs,"close")(this.fd).then(this.closeResolve,this.closeReject))}};a(Oh,"FileHandle");var Th=Oh;al.FileHandle=Th});var wb=O(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.FsPromises=void 0;var se=Dr(),JI=At(),Ph=class Ph{constructor(e,r,i={}){if(this.fs=e,this.path=r,this.options=i,this.eventQueue=[],this.resolveQueue=[],this.finished=!1,this.maxQueue=i.maxQueue||2048,this.overflow=i.overflow||"ignore",this.startWatching(),i.signal){if(i.signal.aborted){this.finish();return}i.signal.addEventListener("abort",()=>{this.finish()})}}startWatching(){try{this.watcher=this.fs.watch(this.path,this.options,(e,r)=>{this.enqueueEvent({eventType:e,filename:r})})}catch(e){throw this.finish(),e}}enqueueEvent(e){if(!this.finished){if(this.eventQueue.length>=this.maxQueue)if(this.overflow==="throw"){let r=new Error(`Watch queue overflow: more than ${this.maxQueue} events queued`);this.finish(r);return}else this.eventQueue.shift(),console.warn(`Watch queue overflow: dropping event due to exceeding maxQueue of ${this.maxQueue}`);if(this.eventQueue.push(e),this.resolveQueue.length>0){let{resolve:r}=this.resolveQueue.shift(),i=this.eventQueue.shift();r({value:i,done:!1})}}}finish(e){if(!this.finished)for(this.finished=!0,this.watcher&&(this.watcher.close(),this.watcher=null);this.resolveQueue.length>0;){let{resolve:r,reject:i}=this.resolveQueue.shift();e?i(e):r({value:void 0,done:!0})}}async next(){return this.finished?{value:void 0,done:!0}:this.eventQueue.length>0?{value:this.eventQueue.shift(),done:!1}:new Promise((e,r)=>{this.resolveQueue.push({resolve:e,reject:r})})}async return(){return this.finish(),{value:void 0,done:!0}}async throw(e){throw this.finish(e),e}[Symbol.asyncIterator](){return this}};a(Ph,"FSWatchAsyncIterator");var kh=Ph,Ah=class Ah{constructor(e,r){this.fs=e,this.FileHandle=r,this.constants=JI.constants,this.cp=(0,se.promisify)(this.fs,"cp"),this.opendir=(0,se.promisify)(this.fs,"opendir"),this.statfs=(0,se.promisify)(this.fs,"statfs"),this.lutimes=(0,se.promisify)(this.fs,"lutimes"),this.glob=(0,se.promisify)(this.fs,"glob"),this.access=(0,se.promisify)(this.fs,"access"),this.chmod=(0,se.promisify)(this.fs,"chmod"),this.chown=(0,se.promisify)(this.fs,"chown"),this.copyFile=(0,se.promisify)(this.fs,"copyFile"),this.lchmod=(0,se.promisify)(this.fs,"lchmod"),this.lchown=(0,se.promisify)(this.fs,"lchown"),this.link=(0,se.promisify)(this.fs,"link"),this.lstat=(0,se.promisify)(this.fs,"lstat"),this.mkdir=(0,se.promisify)(this.fs,"mkdir"),this.mkdtemp=(0,se.promisify)(this.fs,"mkdtemp"),this.readdir=(0,se.promisify)(this.fs,"readdir"),this.readlink=(0,se.promisify)(this.fs,"readlink"),this.realpath=(0,se.promisify)(this.fs,"realpath"),this.rename=(0,se.promisify)(this.fs,"rename"),this.rmdir=(0,se.promisify)(this.fs,"rmdir"),this.rm=(0,se.promisify)(this.fs,"rm"),this.stat=(0,se.promisify)(this.fs,"stat"),this.symlink=(0,se.promisify)(this.fs,"symlink"),this.truncate=(0,se.promisify)(this.fs,"truncate"),this.unlink=(0,se.promisify)(this.fs,"unlink"),this.utimes=(0,se.promisify)(this.fs,"utimes"),this.readFile=(i,n)=>(0,se.promisify)(this.fs,"readFile")(i instanceof this.FileHandle?i.fd:i,n),this.appendFile=(i,n,o)=>(0,se.promisify)(this.fs,"appendFile")(i instanceof this.FileHandle?i.fd:i,n,o),this.open=(i,n="r",o)=>(0,se.promisify)(this.fs,"open",s=>new this.FileHandle(this.fs,s))(i,n,o),this.writeFile=(i,n,o)=>((0,se.isReadableStream)(n)?(0,se.streamToBuffer)(n):Promise.resolve(n)).then(l=>(0,se.promisify)(this.fs,"writeFile")(i instanceof this.FileHandle?i.fd:i,l,o)),this.watch=(i,n)=>{let o=typeof n=="string"?{encoding:n}:n||{};return new kh(this.fs,i,o)}}};a(Ah,"FsPromises");var Rh=Ah;ll.FsPromises=Rh});var yb=O(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.printTree=void 0;var QI=a((t="",e)=>{let r="",i=e.length-1;for(;i>=0&&!e[i];i--);for(let n=0;n<=i;n++){let o=e[n];if(!o)continue;let s=n===i,l=o(t+(s?" ":"\u2502")+" "),f=l?s?"\u2514\u2500":"\u251C\u2500":"\u2502";r+=`
|
|
9
|
+
`+t+f+(l?" "+l:"")}return r},"printTree");cl.printTree=QI});var gb=O(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.printBinary=void 0;var eC=a((t="",e)=>{let r=e[0],i=e[1],n="";return r&&(n+=`
|
|
10
10
|
`+t+"\u2190 "+r(t+" ")),i&&(n+=`
|
|
11
|
-
`+t+"\u2192 "+i(t+" ")),n},"printBinary");
|
|
11
|
+
`+t+"\u2192 "+i(t+" ")),n},"printBinary");fl.printBinary=eC});var bb=O(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.printJson=void 0;var tC=a((t="",e,r=2)=>(JSON.stringify(e,null,r)||"nil").split(`
|
|
12
12
|
`).join(`
|
|
13
|
-
`+t),"printJson");cl.printJson=ZI});var yb=T(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var Ah=(Kf(),bm(Gf));Ah.__exportStar(pb(),Ho);Ah.__exportStar(mb(),Ho);Ah.__exportStar(wb(),Ho)});var gb=T(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.newNotAllowedError=qe.newTypeMismatchError=qe.newNotFoundError=qe.assertCanWrite=qe.assertName=qe.basename=qe.ctx=void 0;var XI=a((t={})=>({separator:"/",syncHandleAllowed:!1,mode:"read",...t}),"ctx");qe.ctx=XI;var YI=a((t,e)=>{t[t.length-1]===e&&(t=t.slice(0,-1));let r=t.lastIndexOf(e);return r===-1?t:t.slice(r+1)},"basename");qe.basename=YI;var JI=/^(\.{1,2})$|^(.*([\/\\]).*)$/,QI=a((t,e,r)=>{if(!t||JI.test(t))throw new TypeError(`Failed to execute '${e}' on '${r}': Name is not allowed.`)},"assertName");qe.assertName=QI;var eD=a(t=>{if(t!=="readwrite")throw new DOMException("The request is not allowed by the user agent or the platform in the current context.","NotAllowedError")},"assertCanWrite");qe.assertCanWrite=eD;var tD=a(()=>new DOMException("A requested file or directory could not be found at the time an operation was processed.","NotFoundError"),"newNotFoundError");qe.newNotFoundError=tD;var rD=a(()=>new DOMException("The path supplied exists, but was not an entry of requested type.","TypeMismatchError"),"newTypeMismatchError");qe.newTypeMismatchError=rD;var iD=a(()=>new DOMException("Permission not granted.","NotAllowedError"),"newNotAllowedError");qe.newNotAllowedError=iD});var bb=T(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.toTreeSync=void 0;var nD=yb(),oD=gb(),sD=a((t,e={})=>{let r=e.separator||"/",i=e.dir||r;i[i.length-1]!==r&&(i+=r);let n=e.tab||"",o=e.depth??10,s=" (...)";if(o>0){let f=t.readdirSync(i,{withFileTypes:!0});s=(0,nD.printTree)(n,f.map(c=>u=>c.isDirectory()?(0,qo.toTreeSync)(t,{dir:i+c.name,depth:o-1,tab:u}):c.isSymbolicLink()?""+c.name+" \u2192 "+t.readlinkSync(i+c.name):""+c.name))}return(0,oD.basename)(i,r)+r+s},"toTreeSync");qo.toTreeSync=sD});var Fb=T(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.getWriteFileOptions=j.writeFileDefaults=j.getRealpathOptsAndCb=j.getRealpathOptions=j.getStatfsOptsAndCb=j.getStatfsOptions=j.getStatOptsAndCb=j.getStatOptions=j.getAppendFileOptsAndCb=j.getAppendFileOpts=j.getOpendirOptsAndCb=j.getOpendirOptions=j.getReaddirOptsAndCb=j.getReaddirOptions=j.getReadFileOptions=j.getRmOptsAndCb=j.getRmdirOptions=j.getDefaultOptsAndCb=j.getDefaultOpts=j.optsDefaults=j.getMkdirOptions=void 0;j.getOptions=_b;j.optsGenerator=fr;j.optsAndCbGenerator=mi;var fl=Yi(),aD=uo(),Ih=Ir(),vb={mode:511,recursive:!1},lD=a(t=>typeof t=="number"?Object.assign({},vb,{mode:t}):Object.assign({},vb,t),"getMkdirOptions");j.getMkdirOptions=lD;var cD=a(t=>`Expected options to be either an object or a string, but got ${t} instead`,"ERRSTR_OPTS");function _b(t,e){let r;if(e){let i=typeof e;switch(i){case"string":r=Object.assign({},t,{encoding:e});break;case"object":r=Object.assign({},t,e);break;default:throw TypeError(cD(i))}}else return t;return r.encoding!=="buffer"&&(0,aD.assertEncoding)(r.encoding),r}a(_b,"getOptions");function fr(t){return e=>_b(t,e)}a(fr,"optsGenerator");function mi(t){return(e,r)=>typeof e=="function"?[t(),e]:[t(e),(0,Ih.validateCallback)(r)]}a(mi,"optsAndCbGenerator");j.optsDefaults={encoding:"utf8"};j.getDefaultOpts=fr(j.optsDefaults);j.getDefaultOptsAndCb=mi(j.getDefaultOpts);var fD={recursive:!1},uD=a(t=>Object.assign({},fD,t),"getRmdirOptions");j.getRmdirOptions=uD;var hD=fr(j.optsDefaults);j.getRmOptsAndCb=mi(hD);var dD={flag:"r"};j.getReadFileOptions=fr(dD);var pD={encoding:"utf8",recursive:!1,withFileTypes:!1};j.getReaddirOptions=fr(pD);j.getReaddirOptsAndCb=mi(j.getReaddirOptions);var mD={encoding:"utf8",bufferSize:32,recursive:!1};j.getOpendirOptions=fr(mD);j.getOpendirOptsAndCb=mi(j.getOpendirOptions);var wD={encoding:"utf8",mode:438,flag:fl.FLAGS[fl.FLAGS.a]};j.getAppendFileOpts=fr(wD);j.getAppendFileOptsAndCb=mi(j.getAppendFileOpts);var yD={bigint:!1},gD=a((t={})=>Object.assign({},yD,t),"getStatOptions");j.getStatOptions=gD;var bD=a((t,e)=>typeof t=="function"?[(0,j.getStatOptions)(),t]:[(0,j.getStatOptions)(t),(0,Ih.validateCallback)(e)],"getStatOptsAndCb");j.getStatOptsAndCb=bD;var vD={bigint:!1},_D=a((t={})=>Object.assign({},vD,t),"getStatfsOptions");j.getStatfsOptions=_D;var FD=a((t,e)=>typeof t=="function"?[(0,j.getStatfsOptions)(),t]:[(0,j.getStatfsOptions)(t),(0,Ih.validateCallback)(e)],"getStatfsOptsAndCb");j.getStatfsOptsAndCb=FD;var ED=j.optsDefaults;j.getRealpathOptions=fr(ED);j.getRealpathOptsAndCb=mi(j.getRealpathOptions);j.writeFileDefaults={encoding:"utf8",mode:438,flag:fl.FLAGS[fl.FLAGS.w]};j.getWriteFileOptions=fr(j.writeFileDefaults)});var Sb=T(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.Dir=void 0;var Eb=Ir(),SD=Ys(),wi=fo(),Ch=class Ch{constructor(e,r){this.link=e,this.options=r,this.iteratorInfo=[],this.closed=!1,this.operationQueue=null,this.path=e.getPath(),this.iteratorInfo.push(e.children[Symbol.iterator]())}closeBase(){}readBase(e){let r,i,n,o;do{do if({done:r,value:i}=e[e.length-1].next(),!r)[n,o]=i;else break;while(n==="."||n==="..");if(r){if(e.pop(),e.length===0)break;r=!1}else return this.options.recursive&&o.children.size&&e.push(o.children[Symbol.iterator]()),SD.default.build(o,this.options.encoding)}while(!r);return null}close(e){if(e===void 0)return this.closed?Promise.reject(new wi.Error("ERR_DIR_CLOSED")):new Promise((r,i)=>{this.close(n=>{n?i(n):r()})});if((0,Eb.validateCallback)(e),this.closed){process.nextTick(e,new wi.Error("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.close(e)});return}this.closed=!0;try{this.closeBase(),process.nextTick(e)}catch(r){process.nextTick(e,r)}}closeSync(){if(this.closed)throw new wi.Error("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new wi.Error("ERR_DIR_CONCURRENT_OPERATION");this.closed=!0,this.closeBase()}read(e){if(e===void 0)return new Promise((r,i)=>{this.read((n,o)=>{n?i(n):r(o??null)})});if((0,Eb.validateCallback)(e),this.closed){process.nextTick(e,new wi.Error("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.read(e)});return}this.operationQueue=[];try{let r=this.readBase(this.iteratorInfo);process.nextTick(()=>{let i=this.operationQueue;this.operationQueue=null;for(let n of i)n();e(null,r)})}catch(r){process.nextTick(()=>{let i=this.operationQueue;this.operationQueue=null;for(let n of i)n();e(r)})}}readSync(){if(this.closed)throw new wi.Error("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new wi.Error("ERR_DIR_CONCURRENT_OPERATION");return this.readBase(this.iteratorInfo)}[Symbol.asyncIterator](){return{next:a(async()=>{try{let e=await this.read();return e!==null?{done:!1,value:e}:{done:!0,value:void 0}}catch(e){throw e}},"next"),[Symbol.asyncIterator](){return this}}}};a(Ch,"Dir");var Dh=Ch;ul.Dir=Dh});var xb=T(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.toMatcher=ur.toRegex=void 0;var xD=a(t=>/[.^$+{}()|\\]/.test(t)?`\\${t}`:t,"escapeRe"),TD=a((t,e,r,i)=>{let n=e,o=[],s="",l=1;for(;n<t.length&&l>0;){let u=t[n];if(u==="(")l++,s+=u,n++;else if(u===")")if(l--,l===0){o.push(s),n++;break}else s+=u,n++;else u==="|"&&l===1?(o.push(s),s="",n++):(s+=u,n++)}if(l!==0)return;let f="",c=o.length;for(let u=0;u<c;u++)f+=(f?"|":"")+(0,ur.toRegex)(o[u],i).source.replace(/^\^/,"").replace(/\$$/,"");switch(r){case"?":return[`(?:${f})?`,n];case"*":return[`(?:${f})*`,n];case"+":return[`(?:${f})+`,n];case"@":return[`(?:${f})`,n];case"!":return[`(?!${f})[^/]*`,n]}},"parseExtGlob"),OD=a((t,e)=>{let r="",i=0,n=a(()=>{i++;let l=[],f="",c=!1;for(;i<t.length;){let h=t[i];if(h==="}"){l.push(f),i++,c=!0;break}if(h===","){l.push(f),f="",i++;continue}f+=h,i++}return c?`(?:${l.map(h=>(0,ur.toRegex)(h,e).source.replace(/^\^/,"").replace(/\$$/,"")).join("|")})`:"\\{"+xD(f)},"parseBraceGroup"),o=!!e?.extglob;for(;i<t.length;){let l=t[i];if(o&&t[i+1]==="("&&(l==="?"||l==="*"||l==="+"||l==="@"||l==="!")){let f=TD(t,i+2,l,e);if(f){r+=f[0],i=f[1];continue}}switch(l){case"*":{if(t[i+1]==="*"){let f=i+2;for(;t[f]==="*";)f++;t[f]==="/"?(r+="(?:.*/)?",i=f+1):(r+=".*",i=f)}else r+="[^/]*",i++;break}case"?":r+="[^/]",i++;break;case"[":{let f="[";for(i++,i<t.length&&t[i]==="!"&&(f+="^",i++),i<t.length&&t[i]==="]"&&(f+="]",i++);i<t.length&&t[i]!=="]";){let c=t[i];f+=c==="\\"?"\\\\":c,i++}if(i<t.length&&t[i]==="]")f+="]",i++;else{r+="\\[";continue}r+=f;break}case"{":{r+=n();break}case"/":r+="/",i++;break;case".":case"^":case"$":case"+":case"(":case")":case"|":case"\\":r+=`\\${l}`,i++;break;default:r+=l,i++;break}}let s=e?.nocase?"i":"";return new RegExp("^"+r+"$",s)},"toRegex");ur.toRegex=OD;var RD=/^\/(.{1,4096})\/([gimsuy]{0,6})$/,kD=a((t,e)=>{let r=[],i=Array.isArray(t)?t:[t];for(let n of i)if(typeof n=="string"){let o=RD.exec(n);if(o){let[,s,l]=o;r.push(new RegExp(s,l))}else r.push((0,ur.toRegex)(n,e))}else r.push(n);return r.length?new Function("p","return "+r.map(n=>n+".test(p)").join("||")):()=>!1},"toMatcher");ur.toMatcher=kD});var Rb=T(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.globSync=ND;var yi=Gi(),PD=xb(),Tb=Ir(),AD=yi.posix.join,ID=yi.posix.relative,DD=yi.posix.resolve;function Ob(t,e){return(0,PD.toRegex)(e).test(t)}a(Ob,"matchesPattern");function CD(t,e){return e?typeof e=="function"?e(t):(Array.isArray(e)?e:[e]).some(i=>Ob(t,i)):!1}a(CD,"isExcluded");function Nh(t,e,r,i,n=0){let o=[],s=i.maxdepth??1/0,l=i.cwd?(0,Tb.pathToFilename)(i.cwd):process.cwd();if(n>s)return o;try{let f=t.readdirSync(e,{withFileTypes:!0});for(let c of f){let u=AD(e,c.name.toString()),h=ID(l,u);if(CD(h,i.exclude))continue;if(r.some(p=>Ob(h,p))&&o.push(h),c.isDirectory()&&n<s){let p=Nh(t,u,r,i,n+1);o.push(...p)}}}catch{}return o}a(Nh,"walkDirectory");function ND(t,e,r={}){let i=r.cwd?(0,Tb.pathToFilename)(r.cwd):process.cwd(),n=DD(i),o={cwd:n,exclude:r.exclude,maxdepth:r.maxdepth,withFileTypes:r.withFileTypes||!1},s=[];if(yi.posix.isAbsolute(e)){let l=yi.posix.dirname(e),f=yi.posix.basename(e),c=Nh(t,l,[f],{...o,cwd:l});s.push(...c.map(u=>yi.posix.resolve(l,u)))}else{let l=Nh(t,n,[e],o);s.push(...l)}return s=[...new Set(s)].sort(),s}a(ND,"globSync")});var Nb=T(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.FSWatcher=st.StatWatcher=st.Volume=void 0;st.pathToSteps=JD;st.dataToStr=QD;st.toUnixTimestamp=ot;var xe=Gi(),jh=Y0(),Lh=Tf(),BD=Ys(),LD=J0(),_n=Or(),wl=cu(),$D=Q0(),yl=ub(),MD=Pt(),Ib=Sh(),gi=uo(),jD=hb(),Db=$f(),UD=db(),HD=bb(),dl=Yi(),qD=fo(),te=Fb(),I=Ir(),zD=Sb(),Le=ya(),WD=xe.resolve,{O_SYMLINK:kb,F_OK:$h,R_OK:VD,W_OK:GD,X_OK:KD,COPYFILE_EXCL:ZD,COPYFILE_FICLONE_FORCE:XD}=MD.constants,a4=xe.posix?xe.posix.sep:xe.sep,hl=xe.posix?xe.posix.relative:xe.relative,Mh=xe.posix?xe.posix.join:xe.join,Pb=xe.posix?xe.posix.dirname:xe.dirname,Ab=xe.posix?xe.posix.normalize:xe.normalize,YD=128;function JD(t){return(0,Le.filenameToSteps)((0,I.pathToFilename)(t))}a(JD,"pathToSteps");function QD(t,e=gi.ENCODING_UTF8){return _n.Buffer.isBuffer(t)?t.toString(e):t instanceof Uint8Array?(0,_n.bufferFrom)(t).toString(e):String(t)}a(QD,"dataToStr");function ot(t){if(typeof t=="string"&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return t<0?Date.now()/1e3:t;throw new Error("Cannot parse time: "+t)}a(ot,"toUnixTimestamp");function bn(t){if(typeof t!="number")throw TypeError(dl.ERRSTR.UID)}a(bn,"validateUid");function vn(t){if(typeof t!="number")throw TypeError(dl.ERRSTR.GID)}a(vn,"validateGid");var Uh=class Uh{get promises(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi}constructor(e=new jh.Superblock){this._core=e,this.promisesApi=new UD.FsPromises(this,jD.FileHandle),this.openSync=(f,c,u=438)=>{let h=(0,I.modeToNumber)(u),d=(0,I.pathToFilename)(f),p=(0,I.flagsToNumber)(c);return this._core.open(d,p,h,!(p&kb))},this.open=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&(d=438,p=u),d=d||438;let m=(0,I.modeToNumber)(d),w=(0,I.pathToFilename)(f),y=(0,I.flagsToNumber)(c);this.wrapAsync(this._core.open,[w,y,m,!(y&kb)],p)},this.closeSync=f=>{this._core.close(f)},this.close=(f,c)=>{(0,Le.validateFd)(f);let u=this._core.getFileByFdOrThrow(f,"close");this.wrapAsync(this._core.close,[u.fd],c)},this.readSync=(f,c,u,h,d)=>((0,Le.validateFd)(f),this._core.read(f,c,u,h,d)),this.read=(f,c,u,h,d,p)=>{if((0,I.validateCallback)(p),h===0)return(0,wl.default)(()=>{p&&p(null,0,c)});Promise.resolve().then(()=>{try{let m=this._core.read(f,c,u,h,d);p(null,m,c)}catch(m){p(m)}})},this.readv=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[null,u]),(0,I.validateCallback)(p),Promise.resolve().then(()=>{try{let m=this._core.readv(f,c,d);p(null,m,c)}catch(m){p(m)}})},this.readvSync=(f,c,u)=>((0,Le.validateFd)(f),this._core.readv(f,c,u??null)),this._readfile=(f,c,u)=>{let h,p=typeof f=="number"&&(0,Le.isFd)(f),m;if(p)m=f;else{let w=(0,I.pathToFilename)(f),y=String(f),v=y.length>1&&y.endsWith("/"),g=this._core.getResolvedLinkOrThrow(w,"open"),F=g.getNode();if(F.isDirectory())throw(0,I.createError)("EISDIR","open",g.getPath());if(v&&F.isFile())throw(0,I.createError)("ENOTDIR","open",y);m=this.openSync(f,c)}try{h=(0,I.bufferToEncoding)(this._core.getFileByFdOrThrow(m).getBuffer(),u)}finally{p||this.closeSync(m)}return h},this.readFileSync=(f,c)=>{let u=(0,te.getReadFileOptions)(c),h=(0,I.flagsToNumber)(u.flag);return this._readfile(f,h,u.encoding)},this.readFile=(f,c,u)=>{let[h,d]=(0,te.optsAndCbGenerator)(te.getReadFileOptions)(c,u),p=(0,I.flagsToNumber)(h.flag);this.wrapAsync(this._readfile,[f,p,h.encoding],d)},this.writeSync=(f,c,u,h,d)=>{let[,p,m,w,y]=(0,I.getWriteSyncArgs)(f,c,u,h,d);return this._write(f,p,m,w,y)},this.write=(f,c,u,h,d,p)=>{let[,m,w,y,v,g,F]=(0,I.getWriteArgs)(f,c,u,h,d,p);Promise.resolve().then(()=>{try{let O=this._write(f,w,y,v,g);m?F(null,O,c):F(null,O,w)}catch(O){F(O)}})},this.writev=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[null,u]),(0,I.validateCallback)(p),Promise.resolve().then(()=>{try{let m=this.writevBase(f,c,d);p(null,m,c)}catch(m){p(m)}})},this.writevSync=(f,c,u)=>((0,Le.validateFd)(f),this.writevBase(f,c,u??null)),this.writeFileSync=(f,c,u)=>{let h=(0,te.getWriteFileOptions)(u),d=(0,I.flagsToNumber)(h.flag),p=(0,I.modeToNumber)(h.mode),m=(0,Le.dataToBuffer)(c,h.encoding);this._core.writeFile(f,m,d,p)},this.writeFile=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[te.writeFileDefaults,u]);let m=(0,I.validateCallback)(p),w=(0,te.getWriteFileOptions)(d),y=(0,I.flagsToNumber)(w.flag),v=(0,I.modeToNumber)(w.mode),g=(0,Le.dataToBuffer)(c,w.encoding);this.wrapAsync(this._core.writeFile,[f,g,y,v],m)},this.copyFileSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);return this._copyFile(h,d,(u||0)|0)},this.copyFile=(f,c,u,h)=>{let d=(0,I.pathToFilename)(f),p=(0,I.pathToFilename)(c),m,w;typeof u=="function"?[m,w]=[0,u]:[m,w]=[u,h],(0,I.validateCallback)(w),this.wrapAsync(this._copyFile,[d,p,m],w)},this._cp=(f,c,u)=>{if(u.filter&&!u.filter(f,c))return;let h=u.dereference?this.statSync(f):this.lstatSync(f),d=null;try{d=this.lstatSync(c)}catch(p){if(p.code!=="ENOENT")throw p}if(d&&h.ino===d.ino&&h.dev===d.dev)throw(0,I.createError)("EINVAL","cp",f,c);if(d){if(h.isDirectory()&&!d.isDirectory())throw(0,I.createError)("EISDIR","cp",f,c);if(!h.isDirectory()&&d.isDirectory())throw(0,I.createError)("ENOTDIR","cp",f,c)}if(h.isDirectory()&&this.isSrcSubdir(f,c))throw(0,I.createError)("EINVAL","cp",f,c);{let p=Pb(c);this.existsSync(p)||this.mkdirSync(p,{recursive:!0})}if(h.isDirectory()){if(!u.recursive)throw(0,I.createError)("EISDIR","cp",f);this.cpDirSync(h,d,f,c,u)}else if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())this.cpFileSync(h,d,f,c,u);else if(h.isSymbolicLink()&&!u.dereference)this.cpSymlinkSync(d,f,c,u);else throw(0,I.createError)("EINVAL","cp",f)},this.linkSync=(f,c)=>{let u=(0,I.pathToFilename)(f),h=(0,I.pathToFilename)(c);this._core.link(u,h)},this.link=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this.wrapAsync(this._core.link,[h,d],u)},this.unlinkSync=f=>{let c=(0,I.pathToFilename)(f);this._core.unlink(c)},this.unlink=(f,c)=>{let u=(0,I.pathToFilename)(f);this.wrapAsync(this._core.unlink,[u],c)},this.symlinkSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this._core.symlink(h,d)},this.symlink=(f,c,u,h)=>{let d=(0,I.validateCallback)(typeof u=="function"?u:h),p=(0,I.pathToFilename)(f),m=(0,I.pathToFilename)(c);this.wrapAsync(this._core.symlink,[p,m],d)},this._lstat=(f,c=!1,u=!1)=>{let h;try{h=this._core.getLinkOrThrow(f,"lstat")}catch(d){if(d.code==="ENOENT"&&!u)return;throw d}return Lh.default.build(h.getNode(),c)},this.lstatSync=(f,c)=>{let{throwIfNoEntry:u=!0,bigint:h=!1}=(0,te.getStatOptions)(c);return this._lstat((0,I.pathToFilename)(f),h,u)},this.renameSync=(f,c)=>{let u=(0,I.pathToFilename)(f),h=(0,I.pathToFilename)(c);this._core.rename(u,h)},this.rename=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this.wrapAsync(this._core.rename,[h,d],u)},this.existsSync=f=>{try{return this._exists((0,I.pathToFilename)(f))}catch{return!1}},this.exists=(f,c)=>{let u=(0,I.pathToFilename)(f);if(typeof c!="function")throw Error(dl.ERRSTR.CB);Promise.resolve().then(()=>{try{c(this._exists(u))}catch{c(!1)}})},this.accessSync=(f,c=$h)=>{let u=(0,I.pathToFilename)(f);c=c|0,this._access(u,c)},this.access=(f,c,u)=>{let h=$h,d;typeof c!="function"?[h,d]=[c|0,(0,I.validateCallback)(u)]:d=c;let p=(0,I.pathToFilename)(f);this.wrapAsync(this._access,[p,h],d)},this.appendFileSync=(f,c,u)=>{let h=(0,te.getAppendFileOpts)(u);(!h.flag||(0,Le.isFd)(f))&&(h.flag="a"),this.writeFileSync(f,c,h)},this.appendFile=(f,c,u,h)=>{let[d,p]=(0,te.getAppendFileOptsAndCb)(u,h);(!d.flag||(0,Le.isFd)(f))&&(d.flag="a"),this.writeFile(f,c,d,p)},this._readdir=(f,c)=>{let u=(0,Le.filenameToSteps)(f),h=this._core.getResolvedLinkOrThrow(f,"scandir"),d=h.getNode();if(!d.isDirectory())throw(0,I.createError)("ENOTDIR","scandir",f);if(!d.canRead())throw(0,I.createError)("EACCES","scandir",f);let p=[];for(let w of h.children.keys()){let y=h.getChild(w);if(!(!y||w==="."||w==="..")&&(p.push(BD.default.build(y,c.encoding)),c.recursive&&y.children.size)){let v={...c,recursive:!0,withFileTypes:!0},g=this._readdir(y.getPath(),v);p.push(...g)}}if(!Le.isWin&&c.encoding!=="buffer"&&p.sort((w,y)=>w.name<y.name?-1:w.name>y.name?1:0),c.withFileTypes)return p;let m=f;return Le.isWin&&(m=m.replace(/\\/g,"/")),p.map(w=>{if(c.recursive){let y=Mh(w.parentPath,w.name.toString());return Le.isWin&&(y=y.replace(/\\/g,"/")),y.replace(m+xe.posix.sep,"")}return w.name})},this.readdirSync=(f,c)=>{let u=(0,te.getReaddirOptions)(c),h=(0,I.pathToFilename)(f);return this._readdir(h,u)},this.readdir=(f,c,u)=>{let[h,d]=(0,te.getReaddirOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._readdir,[p,h],d)},this._readlink=(f,c)=>{let h=this._core.getLinkOrThrow(f,"readlink").getNode();if(!h.isSymlink())throw(0,I.createError)("EINVAL","readlink",f);return(0,gi.strToEncoding)(h.symlink,c)},this.readlinkSync=(f,c)=>{let u=(0,te.getDefaultOpts)(c),h=(0,I.pathToFilename)(f);return this._readlink(h,u.encoding)},this.readlink=(f,c,u)=>{let[h,d]=(0,te.getDefaultOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._readlink,[p,h.encoding],d)},this._fsync=f=>{this._core.getFileByFdOrThrow(f,"fsync")},this.fsyncSync=f=>{this._fsync(f)},this.fsync=(f,c)=>{this.wrapAsync(this._fsync,[f],c)},this._fdatasync=f=>{this._core.getFileByFdOrThrow(f,"fdatasync")},this.fdatasyncSync=f=>{this._fdatasync(f)},this.fdatasync=(f,c)=>{this.wrapAsync(this._fdatasync,[f],c)},this._ftruncate=(f,c)=>{this._core.getFileByFdOrThrow(f,"ftruncate").truncate(c)},this.ftruncateSync=(f,c)=>{this._ftruncate(f,c)},this.ftruncate=(f,c,u)=>{let h=typeof c=="number"?c:0,d=(0,I.validateCallback)(typeof c=="number"?u:c);this.wrapAsync(this._ftruncate,[f,h],d)},this._truncate=(f,c)=>{let u=this.openSync(f,"r+");try{this.ftruncateSync(u,c)}finally{this.closeSync(u)}},this.truncateSync=(f,c)=>{if((0,Le.isFd)(f))return this.ftruncateSync(f,c);this._truncate(f,c)},this.truncate=(f,c,u)=>{let h=typeof c=="number"?c:0,d=(0,I.validateCallback)(typeof c=="number"?u:c);if((0,Le.isFd)(f))return this.ftruncate(f,h,d);this.wrapAsync(this._truncate,[f,h],d)},this._futimes=(f,c,u)=>{let d=this._core.getFileByFdOrThrow(f,"futimes").node;d.atime=new Date(c*1e3),d.mtime=new Date(u*1e3)},this.futimesSync=(f,c,u)=>{this._futimes(f,ot(c),ot(u))},this.futimes=(f,c,u,h)=>{this.wrapAsync(this._futimes,[f,ot(c),ot(u)],h)},this._utimes=(f,c,u,h=!0)=>{let d=this._core,m=(h?d.getResolvedLinkOrThrow(f,"utimes"):d.getLinkOrThrow(f,"lutimes")).getNode();m.atime=new Date(c*1e3),m.mtime=new Date(u*1e3)},this.utimesSync=(f,c,u)=>{this._utimes((0,I.pathToFilename)(f),ot(c),ot(u),!0)},this.utimes=(f,c,u,h)=>{this.wrapAsync(this._utimes,[(0,I.pathToFilename)(f),ot(c),ot(u),!0],h)},this.lutimesSync=(f,c,u)=>{this._utimes((0,I.pathToFilename)(f),ot(c),ot(u),!1)},this.lutimes=(f,c,u,h)=>{this.wrapAsync(this._utimes,[(0,I.pathToFilename)(f),ot(c),ot(u),!1],h)},this.mkdirSync=(f,c)=>{let u=(0,te.getMkdirOptions)(c),h=(0,I.modeToNumber)(u.mode,511),d=(0,I.pathToFilename)(f);if(u.recursive)return this._core.mkdirp(d,h);this._core.mkdir(d,h)},this.mkdir=(f,c,u)=>{let h=(0,te.getMkdirOptions)(c),d=(0,I.validateCallback)(typeof c=="function"?c:u),p=(0,I.modeToNumber)(h.mode,511),m=(0,I.pathToFilename)(f);h.recursive?this.wrapAsync(this._core.mkdirp,[m,p],d):this.wrapAsync(this._core.mkdir,[m,p],d)},this._mkdtemp=(f,c,u=5)=>{let h=f+(0,I.genRndStr6)();try{return this._core.mkdir(h,511),(0,gi.strToEncoding)(h,c)}catch(d){if(d.code==="EEXIST"){if(u>1)return this._mkdtemp(f,c,u-1);throw Error("Could not create temp dir.")}else throw d}},this.mkdtempSync=(f,c)=>{let{encoding:u}=(0,te.getDefaultOpts)(c);if(!f||typeof f!="string")throw new TypeError("filename prefix is required");return(0,I.nullCheck)(f),this._mkdtemp(f,u)},this.mkdtemp=(f,c,u)=>{let[{encoding:h},d]=(0,te.getDefaultOptsAndCb)(c,u);if(!f||typeof f!="string")throw new TypeError("filename prefix is required");(0,I.nullCheck)(f)&&this.wrapAsync(this._mkdtemp,[f,h],d)},this.rmdirSync=(f,c)=>{let u=(0,te.getRmdirOptions)(c);this._core.rmdir((0,I.pathToFilename)(f),u.recursive)},this.rmdir=(f,c,u)=>{let h=(0,te.getRmdirOptions)(c),d=(0,I.validateCallback)(typeof c=="function"?c:u);this.wrapAsync(this._core.rmdir,[(0,I.pathToFilename)(f),h.recursive],d)},this.rmSync=(f,c)=>{this._core.rm((0,I.pathToFilename)(f),c?.force,c?.recursive)},this.rm=(f,c,u)=>{let[h,d]=(0,te.getRmOptsAndCb)(c,u);this.wrapAsync(this._core.rm,[(0,I.pathToFilename)(f),h?.force,h?.recursive],d)},this._fchmod=(f,c)=>{this._core.getFileByFdOrThrow(f,"fchmod").chmod(c)},this.fchmodSync=(f,c)=>{this._fchmod(f,(0,I.modeToNumber)(c))},this.fchmod=(f,c,u)=>{this.wrapAsync(this._fchmod,[f,(0,I.modeToNumber)(c)],u)},this._chmod=(f,c,u=!0)=>{(u?this._core.getResolvedLinkOrThrow(f,"chmod"):this._core.getLinkOrThrow(f,"chmod")).getNode().chmod(c)},this.chmodSync=(f,c)=>{let u=(0,I.modeToNumber)(c),h=(0,I.pathToFilename)(f);this._chmod(h,u,!0)},this.chmod=(f,c,u)=>{let h=(0,I.modeToNumber)(c),d=(0,I.pathToFilename)(f);this.wrapAsync(this._chmod,[d,h],u)},this._lchmod=(f,c)=>{this._chmod(f,c,!1)},this.lchmodSync=(f,c)=>{let u=(0,I.modeToNumber)(c),h=(0,I.pathToFilename)(f);this._lchmod(h,u)},this.lchmod=(f,c,u)=>{let h=(0,I.modeToNumber)(c),d=(0,I.pathToFilename)(f);this.wrapAsync(this._lchmod,[d,h],u)},this._fchown=(f,c,u)=>{this._core.getFileByFdOrThrow(f,"fchown").chown(c,u)},this.fchownSync=(f,c,u)=>{bn(c),vn(u),this._fchown(f,c,u)},this.fchown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._fchown,[f,c,u],h)},this._chown=(f,c,u)=>{this._core.getResolvedLinkOrThrow(f,"chown").getNode().chown(c,u)},this.chownSync=(f,c,u)=>{bn(c),vn(u),this._chown((0,I.pathToFilename)(f),c,u)},this.chown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._chown,[(0,I.pathToFilename)(f),c,u],h)},this._lchown=(f,c,u)=>{this._core.getLinkOrThrow(f,"lchown").getNode().chown(c,u)},this.lchownSync=(f,c,u)=>{bn(c),vn(u),this._lchown((0,I.pathToFilename)(f),c,u)},this.lchown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._lchown,[(0,I.pathToFilename)(f),c,u],h)},this.statWatchers={},this.cpSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c),p={dereference:u?.dereference??!1,errorOnExist:u?.errorOnExist??!1,filter:u?.filter,force:u?.force??!0,mode:u?.mode??0,preserveTimestamps:u?.preserveTimestamps??!1,recursive:u?.recursive??!1,verbatimSymlinks:u?.verbatimSymlinks??!1};return this._cp(h,d,p)},this.cp=(f,c,u,h)=>{let d=(0,I.pathToFilename)(f),p=(0,I.pathToFilename)(c),m,w;typeof u=="function"?[m,w]=[{},u]:[m,w]=[u||{},h],(0,I.validateCallback)(w);let y={dereference:m?.dereference??!1,errorOnExist:m?.errorOnExist??!1,filter:m?.filter,force:m?.force??!0,mode:m?.mode??0,preserveTimestamps:m?.preserveTimestamps??!1,recursive:m?.recursive??!1,verbatimSymlinks:m?.verbatimSymlinks??!1};this.wrapAsync(this._cp,[d,p,y],w)},this.openAsBlob=async(f,c)=>{let u=(0,I.pathToFilename)(f),h;try{h=this._core.getResolvedLinkOrThrow(u,"open")}catch(w){throw w&&typeof w=="object"&&w.code==="ENOENT"?new qD.TypeError("ERR_INVALID_ARG_VALUE"):w}let p=h.getNode().getBuffer(),m=c?.type||"";return new Blob([p],{type:m})},this.glob=(f,...c)=>{let[u,h]=c.length===1?[{},c[0]]:[c[0],c[1]];this.wrapAsync(this._globSync,[f,u||{}],h)},this.globSync=(f,c={})=>this._globSync(f,c),this._globSync=(f,c={})=>{let{globSync:u}=Rb();return u(this,f,c)},this._opendir=(f,c)=>{let u=this._core.getResolvedLinkOrThrow(f,"scandir");if(!u.getNode().isDirectory())throw(0,I.createError)("ENOTDIR","scandir",f);return new zD.Dir(u,c)},this.opendirSync=(f,c)=>{let u=(0,te.getOpendirOptions)(c),h=(0,I.pathToFilename)(f);return this._opendir(h,u)},this.opendir=(f,c,u)=>{let[h,d]=(0,te.getOpendirOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._opendir,[p,h],d)};let r=this;this.StatWatcher=class extends pl{constructor(){super(r)}};let i=Xt;this.ReadStream=class extends i{constructor(...f){super(r,...f)}};let n=bt;this.WriteStream=class extends n{constructor(...f){super(r,...f)}},this.FSWatcher=class extends ml{constructor(){super(r)}};let o=a((f,c)=>{let u=this._core.getResolvedLinkOrThrow(f,"realpath");return(0,gi.strToEncoding)(u.getPath()||"/",c)},"_realpath"),s=a((f,c,u)=>{let[h,d]=(0,te.getRealpathOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);r.wrapAsync(o,[p,h.encoding],d)},"realpathImpl"),l=a((f,c)=>o((0,I.pathToFilename)(f),(0,te.getRealpathOptions)(c).encoding),"realpathSyncImpl");this.realpath=s,this.realpath.native=s,this.realpathSync=l,this.realpathSync.native=l}wrapAsync(e,r,i){(0,I.validateCallback)(i),Promise.resolve().then(()=>{let n;try{n=e.apply(this,r)}catch(o){i(o);return}i(null,n)})}toTree(e={separator:xe.sep}){return(0,HD.toTreeSync)(this,e)}reset(){this._core.reset()}toJSON(e,r={},i=!1,n=!1){return this._core.toJSON(e,r,i,n)}fromJSON(e,r){return this._core.fromJSON(e,r)}fromNestedJSON(e,r){return this._core.fromNestedJSON(e,r)}mountSync(e,r){this._core.fromJSON(r,e)}_write(e,r,i,n,o){let s=this._core.getFileByFdOrThrow(e,"write");if(s.node.isSymlink())throw(0,I.createError)("EBADF","write",s.link.getPath());return s.write(r,i,n,o===-1||typeof o!="number"?void 0:o)}writevBase(e,r,i){let n=this._core.getFileByFdOrThrow(e),o=i??void 0;o===-1&&(o=void 0);let s=0;for(let l of r){let f=_n.Buffer.from(l.buffer,l.byteOffset,l.byteLength),c=n.write(f,0,f.byteLength,o);if(o=void 0,s+=c,c<f.byteLength)break}return s}_copyFile(e,r,i){let n=this.readFileSync(e);if(i&ZD&&this.existsSync(r))throw(0,I.createError)("EEXIST","copyFile",e,r);if(i&XD)throw(0,I.createError)("ENOSYS","copyFile",e,r);this._core.writeFile(r,n,dl.FLAGS.w,438)}isSrcSubdir(e,r){try{let i=Ab(e.startsWith("/")?e:"/"+e),n=Ab(r.startsWith("/")?r:"/"+r);if(i===n)return!0;let o=hl(i,n);return o===""||!o.startsWith("..")&&!(0,xe.isAbsolute)(o)}catch{return!1}}cpFileSync(e,r,i,n,o){if(r){if(o.errorOnExist)throw(0,I.createError)("EEXIST","cp",n);if(!o.force)return;this.unlinkSync(n)}this.copyFileSync(i,n,o.mode),o.preserveTimestamps&&this.utimesSync(n,e.atime,e.mtime),this.chmodSync(n,Number(e.mode))}cpDirSync(e,r,i,n,o){r||this.mkdirSync(n);let s=this.readdirSync(i);for(let l of s){let f=Mh(i,String(l)),c=Mh(n,String(l));o.filter&&!o.filter(f,c)||this._cp(f,c,o)}this.chmodSync(n,Number(e.mode))}cpSymlinkSync(e,r,i,n){let o=String(this.readlinkSync(r));!n.verbatimSymlinks&&!(0,xe.isAbsolute)(o)&&(o=WD(Pb(r),o)),e&&this.unlinkSync(i),this.symlinkSync(o,i)}lstat(e,r,i){let[{throwIfNoEntry:n=!0,bigint:o=!1},s]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this._lstat,[(0,I.pathToFilename)(e),o,n],s)}_stat(e,r=!1,i=!0){let n;try{n=this._core.getResolvedLinkOrThrow(e,"stat")}catch(o){if(o.code==="ENOENT"&&!i)return;throw o}return Lh.default.build(n.getNode(),r)}statSync(e,r){let{bigint:i=!0,throwIfNoEntry:n=!0}=(0,te.getStatOptions)(r);return this._stat((0,I.pathToFilename)(e),i,n)}stat(e,r,i){let[{bigint:n=!1,throwIfNoEntry:o=!0},s]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this._stat,[(0,I.pathToFilename)(e),n,o],s)}fstatBase(e,r=!1){let i=this._core.getFileByFd(e);if(!i)throw(0,I.createError)("EBADF","fstat");return Lh.default.build(i.node,r)}fstatSync(e,r){return this.fstatBase(e,(0,te.getStatOptions)(r).bigint)}fstat(e,r,i){let[n,o]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this.fstatBase,[e,n.bigint],o)}_exists(e){return!!this._stat(e)}_access(e,r){let n=this._core.getLinkOrThrow(e,"access").getNode();if(r!==$h&&(r&VD&&!n.canRead()||r&GD&&!n.canWrite()||r&KD&&!n.canExecute()))throw(0,I.createError)("EACCES","access",e)}watchFile(e,r,i){let n=(0,I.pathToFilename)(e),o=r,s=i;if(typeof o=="function"&&(s=r,o=null),typeof s!="function")throw Error('"watchFile()" requires a listener function');let l=5007,f=!0;o&&typeof o=="object"&&(typeof o.interval=="number"&&(l=o.interval),typeof o.persistent=="boolean"&&(f=o.persistent));let c=this.statWatchers[n];return c||(c=new this.StatWatcher,c.start(n,f,l),this.statWatchers[n]=c),c.addListener("change",s),c}unwatchFile(e,r){let i=(0,I.pathToFilename)(e),n=this.statWatchers[i];n&&(typeof r=="function"?n.removeListener("change",r):n.removeAllListeners("change"),n.listenerCount("change")===0&&(n.stop(),delete this.statWatchers[i]))}createReadStream(e,r){return new this.ReadStream(e,r)}createWriteStream(e,r){return new this.WriteStream(e,r)}watch(e,r,i){let n=(0,I.pathToFilename)(e),o=r;typeof r=="function"&&(i=r,o=null);let{persistent:s,recursive:l,encoding:f}=(0,te.getDefaultOpts)(o);s===void 0&&(s=!0),l===void 0&&(l=!1);let c=new this.FSWatcher;return c.start(n,s,l,f),i&&c.addListener("change",i),c}_statfs(e,r=!1){return this._core.getResolvedLinkOrThrow(e,"statfs"),LD.default.build(this._core,r)}statfsSync(e,r){let{bigint:i=!1}=(0,te.getStatfsOptions)(r);return this._statfs((0,I.pathToFilename)(e),i)}statfs(e,r,i){let[{bigint:n=!1},o]=(0,te.getStatfsOptsAndCb)(r,i);this.wrapAsync(this._statfs,[(0,I.pathToFilename)(e),n],o)}};a(Uh,"Volume");var bi=Uh;st.Volume=bi;bi.fromJSON=(t,e)=>new bi(jh.Superblock.fromJSON(t,e));bi.fromNestedJSON=(t,e)=>new bi(jh.Superblock.fromNestedJSON(t,e));function eC(t){t.emit("stop")}a(eC,"emitStop");var Hh=class Hh extends Ib.EventEmitter{constructor(e){super(),this.onInterval=()=>{try{let r=this.vol.statSync(this.filename);this.hasChanged(r)&&(this.emit("change",r,this.prev),this.prev=r)}finally{this.loop()}},this.vol=e}loop(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)}hasChanged(e){return e.mtimeMs>this.prev.mtimeMs||e.nlink!==this.prev.nlink}start(e,r=!0,i=5007){this.filename=(0,I.pathToFilename)(e),this.setTimeout=r?setTimeout.bind(globalThis):$D.default,this.interval=i,this.prev=this.vol.statSync(this.filename),this.loop()}stop(){clearTimeout(this.timeoutRef),(0,wl.default)(()=>{eC.call(this,this)})}};a(Hh,"StatWatcher");var pl=Hh;st.StatWatcher=pl;var gt;function tC(t){gt=(0,_n.bufferAllocUnsafe)(t),gt.used=0}a(tC,"allocNewPool");(0,Db.inherits)(Xt,yl.Readable);st.ReadStream=Xt;function Xt(t,e,r){if(!(this instanceof Xt))return new Xt(t,e,r);if(this._vol=t,r=Object.assign({},(0,te.getOptions)(r,{})),r.highWaterMark===void 0&&(r.highWaterMark=64*1024),yl.Readable.call(this,r),this.path=(0,I.pathToFilename)(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}a(Xt,"FsReadStream");Xt.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(e,r)=>{if(e){t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e);return}t.fd=r,t.emit("open",r),t.read()})};Xt.prototype._read=function(t){if(typeof this.fd!="number")return this.once("open",function(){this._read(t)});if(this.destroyed)return;(!gt||gt.length-gt.used<YD)&&tC(this._readableState.highWaterMark);var e=gt,r=Math.min(gt.length-gt.used,t),i=gt.used;if(this.pos!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);var n=this;this._vol.read(this.fd,gt,gt.used,r,this.pos,o),this.pos!==void 0&&(this.pos+=r),gt.used+=r;function o(s,l){if(s)n.autoClose&&n.destroy&&n.destroy(),n.emit("error",s);else{var f=null;l>0&&(n.bytesRead+=l,f=e.slice(i,i+l)),n.push(f)}}a(o,"onread")};Xt.prototype._destroy=function(t,e){this.close(r=>{e(t||r)})};Xt.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Cb);return}return(0,wl.default)(()=>this.emit("close"))}typeof this._readableState?.closed=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};function Cb(t){this.close()}a(Cb,"closeOnOpen");(0,Db.inherits)(bt,yl.Writable);st.WriteStream=bt;function bt(t,e,r){if(!(this instanceof bt))return new bt(t,e,r);if(this._vol=t,r=Object.assign({},(0,te.getOptions)(r,{})),yl.Writable.call(this,r),this.path=(0,I.pathToFilename)(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:!!r.autoClose,this.pos=void 0,this.bytesWritten=0,this.pending=!0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}a(bt,"FsWriteStream");bt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(t,e){if(t){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",t);return}this.fd=e,this.pending=!1,this.emit("open",e)}.bind(this))};bt.prototype._write=function(t,e,r){if(!(t instanceof _n.Buffer||t instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(t,e,r)});var i=this;this._vol.write(this.fd,t,0,t.length,this.pos,(n,o)=>{if(n)return i.autoClose&&i.destroy&&i.destroy(),r(n);i.bytesWritten+=o,r()}),this.pos!==void 0&&(this.pos+=t.length)};bt.prototype._writev=function(t,e){if(typeof this.fd!="number")return this.once("open",function(){this._writev(t,e)});let r=this,i=t.length,n=new Array(i);for(var o=0,s=0;s<i;s++){var l=t[s].chunk;n[s]=l,o+=l.length}let f=_n.Buffer.concat(n);this._vol.write(this.fd,f,0,f.length,this.pos,(c,u)=>{if(c)return r.destroy&&r.destroy(),e(c);r.bytesWritten+=u,e()}),this.pos!==void 0&&(this.pos+=o)};bt.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Cb);return}return(0,wl.default)(()=>this.emit("close"))}typeof this._writableState?.closed=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};bt.prototype._destroy=Xt.prototype._destroy;bt.prototype.destroySoon=bt.prototype.end;var qh=class qh extends Ib.EventEmitter{constructor(e){super(),this._filename="",this._filenameEncoded="",this._recursive=!1,this._encoding=gi.ENCODING_UTF8,this._listenerRemovers=new Map,this._onParentChild=r=>{r.getName()===this._getName()&&this._emit("rename")},this._emit=r=>{this.emit("change",r,this._filenameEncoded)},this._persist=()=>{this._timer=setTimeout(this._persist,1e6)},this._vol=e}_getName(){return this._steps[this._steps.length-1]}start(e,r=!0,i=!1,n=gi.ENCODING_UTF8){this._filename=(0,I.pathToFilename)(e),this._steps=(0,Le.filenameToSteps)(this._filename),this._filenameEncoded=(0,gi.strToEncoding)(this._filename),this._recursive=i,this._encoding=n;try{this._link=this._vol._core.getLinkOrThrow(this._filename,"FSWatcher")}catch(f){let c=new Error(`watch ${this._filename} ${f.code}`);throw c.code=f.code,c.errno=f.code,c}let o=a(f=>{let c=f.getPath(),u=f.getNode(),h=a(()=>{let m=hl(this._filename,c);return m||(m=this._getName()),this.emit("change","change",m)},"onNodeChange"),d=u.changes.listen(([m])=>{m==="modify"&&h()}),p=this._listenerRemovers.get(u.ino)??[];p.push(()=>d()),this._listenerRemovers.set(u.ino,p)},"watchLinkNodeChanged"),s=a(f=>{let c=f.getNode(),u=a(m=>{this.emit("change","rename",hl(this._filename,m.getPath())),o(m),s(m)},"onLinkChildAdd"),h=a(m=>{let w=a(y=>{let v=y.getNode().ino,g=this._listenerRemovers.get(v);g&&(g.forEach(F=>F()),this._listenerRemovers.delete(v));for(let[F,O]of y.children.entries())O&&F!=="."&&F!==".."&&w(O)},"removeLinkNodeListeners");w(m),this.emit("change","rename",hl(this._filename,m.getPath()))},"onLinkChildDelete");for(let[m,w]of f.children.entries())w&&m!=="."&&m!==".."&&o(w);let d=f.changes.listen(([m,w])=>{m==="child:add"?u(w):m==="child:del"&&h(w)});if((this._listenerRemovers.get(c.ino)??[]).push(()=>{d()}),i)for(let[m,w]of f.children.entries())w&&m!=="."&&m!==".."&&s(w)},"watchLinkChildrenChanged");o(this._link),s(this._link);let l=this._link.parent;l&&l.changes.listen(([f,c])=>{f==="child:del"&&this._onParentChild(c)}),r&&this._persist()}close(){clearTimeout(this._timer),this._listenerRemovers.forEach(e=>{e.forEach(r=>r())}),this._listenerRemovers.clear(),this._parentChangesUnsub?.()}};a(qh,"FSWatcher");var ml=qh;st.FSWatcher=ml});var Bb=T(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.fsSynchronousApiList=void 0;gl.fsSynchronousApiList=["accessSync","appendFileSync","chmodSync","chownSync","closeSync","copyFileSync","existsSync","fchmodSync","fchownSync","fdatasyncSync","fstatSync","fsyncSync","ftruncateSync","futimesSync","lchmodSync","lchownSync","linkSync","lstatSync","mkdirSync","mkdtempSync","openSync","opendirSync","readdirSync","readFileSync","readlinkSync","readSync","readvSync","realpathSync","renameSync","rmdirSync","rmSync","statSync","symlinkSync","truncateSync","unlinkSync","utimesSync","lutimesSync","writeFileSync","writeSync","writevSync"]});var Lb=T(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.fsCallbackApiList=void 0;bl.fsCallbackApiList=["access","appendFile","chmod","chown","close","copyFile","cp","createReadStream","createWriteStream","exists","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","openAsBlob","opendir","read","readv","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","unwatchFile","utimes","lutimes","watch","watchFile","write","writev","writeFile"]});var Fn=T((at,vl)=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.memfs=at.fs=at.vol=at.Volume=void 0;at.createFsFromVolume=zh;var rC=Tf(),iC=Ys(),_l=Nb();Object.defineProperty(at,"Volume",{enumerable:!0,get:a(function(){return _l.Volume},"get")});var $b=Pt(),nC=Bb(),oC=Lb(),{F_OK:sC,R_OK:aC,W_OK:lC,X_OK:cC}=$b.constants;at.vol=new _l.Volume;function zh(t){let e={F_OK:sC,R_OK:aC,W_OK:lC,X_OK:cC,constants:$b.constants,Stats:rC.default,Dirent:iC.default};for(let r of nC.fsSynchronousApiList)typeof t[r]=="function"&&(e[r]=t[r].bind(t));for(let r of oC.fsCallbackApiList)typeof t[r]=="function"&&(e[r]=t[r].bind(t));return e.StatWatcher=t.StatWatcher,e.FSWatcher=t.FSWatcher,e.WriteStream=t.WriteStream,e.ReadStream=t.ReadStream,e.promises=t.promises,typeof t.realpath=="function"&&(e.realpath=t.realpath.bind(t),typeof t.realpath.native=="function"&&(e.realpath.native=t.realpath.native.bind(t))),typeof t.realpathSync=="function"&&(e.realpathSync=t.realpathSync.bind(t),typeof t.realpathSync.native=="function"&&(e.realpathSync.native=t.realpathSync.native.bind(t))),e._toUnixTimestamp=_l.toUnixTimestamp,e.__vol=t,e}a(zh,"createFsFromVolume");at.fs=zh(at.vol);var fC=a((t={},e="/")=>{let r=_l.Volume.fromNestedJSON(t,e);return{fs:zh(r),vol:r}},"memfs");at.memfs=fC;vl.exports={...vl.exports,...at.fs};vl.exports.semantic=!0});var od=T((D4,Rl)=>{function qb(t){return Array.isArray(t)?t:[t]}a(qb,"makeArray");var uC=void 0,Yh="",Ub=" ",Xh="\\",hC=/^\s+$/,dC=/(?:[^\\]|^)\\$/,pC=/^\\!/,mC=/^\\#/,wC=/\r?\n/g,yC=/^\.{0,2}\/|^\.{1,2}$/,gC=/\/$/,En="/",zb="node-ignore";typeof Symbol<"u"&&(zb=Symbol.for("node-ignore"));var Wb=zb,Sn=a((t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),"define"),bC=/([0-z])-([0-z])/g,Vb=a(()=>!1,"RETURN_FALSE"),vC=a(t=>t.replace(bC,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:Yh),"sanitizeRange"),_C=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),FC=[[/^\uFEFF/,()=>Yh],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?Ub:Yh)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+Ub}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,a(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Xh],[/\\\\/g,()=>Xh],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Xh?`\\[${r}${_C(i)}${n}`:n==="]"&&i.length%2===0?`[${vC(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],EC=/(^|\\\/)?\\\*$/,Wo="regex",Tl="checkRegex",Hb="_",SC={[Wo](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Tl](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},xC=a(t=>FC.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),"makeRegexPrefix"),Ol=a(t=>typeof t=="string","isString"),TC=a(t=>t&&Ol(t)&&!hC.test(t)&&!dC.test(t)&&t.indexOf("#")!==0,"checkPattern"),OC=a(t=>t.split(wC).filter(Boolean),"splitPattern"),rd=class rd{constructor(e,r,i,n,o,s){this.pattern=e,this.mark=r,this.negative=o,Sn(this,"body",i),Sn(this,"ignoreCase",n),Sn(this,"regexPrefix",s)}get regex(){let e=Hb+Wo;return this[e]?this[e]:this._make(Wo,e)}get checkRegex(){let e=Hb+Tl;return this[e]?this[e]:this._make(Tl,e)}_make(e,r){let i=this.regexPrefix.replace(EC,SC[e]),n=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return Sn(this,r,n)}};a(rd,"IgnoreRule");var Jh=rd,RC=a(({pattern:t,mark:e},r)=>{let i=!1,n=t;n.indexOf("!")===0&&(i=!0,n=n.substr(1)),n=n.replace(pC,"!").replace(mC,"#");let o=xC(n);return new Jh(t,e,n,r,i,o)},"createRule"),id=class id{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[Wb]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(Ol(e)&&(e={pattern:e}),TC(e.pattern)){let r=RC(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,qb(Ol(e)?OC(e):e).forEach(this._add,this),this._added}test(e,r,i){let n=!1,o=!1,s;this._rules.forEach(f=>{let{negative:c}=f;o===c&&n!==o||c&&!n&&!o&&!r||!f[i].test(e)||(n=!c,o=c,s=c?uC:f)});let l={ignored:n,unignored:o};return s&&(l.rule=s),l}};a(id,"RuleManager");var Qh=id,kC=a((t,e)=>{throw new e(t)},"throwError"),hr=a((t,e,r)=>Ol(t)?t?hr.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),Gb=a(t=>yC.test(t),"isNotRelative");hr.isNotRelative=Gb;hr.convert=t=>t;var nd=class nd{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){Sn(this,Wb,!0),this._rules=new Qh(r),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,i,n){let o=e&&hr.convert(e);return hr(o,e,this._strictPathCheck?kC:Vb),this._t(o,r,i,n)}checkIgnore(e){if(!gC.test(e))return this.test(e);let r=e.split(En).filter(Boolean);if(r.pop(),r.length){let i=this._t(r.join(En)+En,this._testCache,!0,r);if(i.ignored)return i}return this._rules.test(e,!1,Tl)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(En).filter(Boolean)),n.pop(),!n.length)return r[e]=this._rules.test(e,i,Wo);let o=this._t(n.join(En)+En,r,i,n);return r[e]=o.ignored?o:this._rules.test(e,i,Wo)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return qb(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};a(nd,"Ignore");var ed=nd,td=a(t=>new ed(t),"factory"),PC=a(t=>hr(t&&hr.convert(t),t,Vb),"isPathValid"),Kb=a(()=>{let t=a(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");hr.convert=t;let e=/^[a-z]:\//i;hr.isNotRelative=r=>e.test(r)||Gb(r)},"setupWindows");typeof process<"u"&&process.platform==="win32"&&Kb();Rl.exports=td;td.default=td;Rl.exports.isPathValid=PC;Sn(Rl.exports,Symbol.for("setupWindows"),Kb)});var Jb=T((H4,Yb)=>{"use strict";var lt=a(function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||lt.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||lt.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||lt.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=lt.DEFAULT_MAX_PENDING},"AsyncLock");lt.DEFAULT_TIMEOUT=0;lt.DEFAULT_MAX_OCCUPATION_TIME=0;lt.DEFAULT_MAX_EXECUTION_TIME=0;lt.DEFAULT_MAX_PENDING=1e3;lt.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if(typeof e!="function")throw new Error("You must pass a function to execute");var n=null,o=null,s=null;typeof r!="function"&&(i=r,r=null,s=new this.Promise(function(g,F){n=g,o=F})),i=i||{};var l=!1,f=null,c=null,u=null,h=this,d=a(function(g,F,O){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),g&&(h.queues[t]&&h.queues[t].length===0&&delete h.queues[t],h.domainReentrant&&delete h.domains[t]),l||(s?F?o(F):n(O):typeof r=="function"&&r(F,O),l=!0),g&&h.queues[t]&&h.queues[t].length>0&&h.queues[t].shift()()},"done"),p=a(function(g){if(l)return d(g);f&&(clearTimeout(f),f=null),h.domainReentrant&&g&&(h.domains[t]=process.domain);var F=i.maxExecutionTime||h.maxExecutionTime;if(F&&(u=setTimeout(function(){h.queues[t]&&d(g,new Error("Maximum execution time is exceeded "+t))},F)),e.length===1){var O=!1;try{e(function(S,R){O||(O=!0,d(g,S,R))})}catch(S){O||(O=!0,d(g,S))}}else h._promiseTry(function(){return e()}).then(function(S){d(g,void 0,S)},function(S){d(g,S)})},"exec");h.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=i.maxPending||h.maxPending;if(!h.queues[t])h.queues[t]=[],p(!0);else if(h.domainReentrant&&process.domain&&process.domain===h.domains[t])p(!1);else if(h.queues[t].length>=m)d(!1,new Error("Too many pending tasks in queue "+t));else{var w=a(function(){p(!0)},"taskFn");i.skipQueue?h.queues[t].unshift(w):h.queues[t].push(w);var y=i.timeout||h.timeout;y&&(f=setTimeout(function(){f=null,d(!1,new Error("async-lock timed out in queue "+t))},y))}var v=i.maxOccupationTime||h.maxOccupationTime;if(v&&(c=setTimeout(function(){h.queues[t]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+t))},v)),s)return s};lt.prototype._acquireBatch=function(t,e,r,i){typeof r!="function"&&(i=r,r=null);var n=this,o=a(function(l,f){return function(c){n.acquire(l,f,c,i)}},"getFn"),s=t.reduceRight(function(l,f){return o(f,l)},e);if(typeof r=="function")s(r);else return new this.Promise(function(l,f){s.length===1?s(function(c,u){c?f(c):l(u)}):l(s())})};lt.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};lt.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};Yb.exports=lt});var ev=T((z4,Qb)=>{"use strict";Qb.exports=Jb()});var rv=T((W4,tv)=>{var AC={}.toString;tv.exports=Array.isArray||function(t){return AC.call(t)=="[object Array]"}});var sv=T((V4,ov)=>{"use strict";var nv=Function.prototype.toString,xn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,cd,Al;if(typeof xn=="function"&&typeof Object.defineProperty=="function")try{cd=Object.defineProperty({},"length",{get:a(function(){throw Al},"get")}),Al={},xn(function(){throw 42},null,cd)}catch(t){t!==Al&&(xn=null)}else xn=null;var IC=/^\s*class\b/,fd=a(function(e){try{var r=nv.call(e);return IC.test(r)}catch{return!1}},"isES6ClassFunction"),ld=a(function(e){try{return fd(e)?!1:(nv.call(e),!0)}catch{return!1}},"tryFunctionToStr"),Il=Object.prototype.toString,DC="[object Object]",CC="[object Function]",NC="[object GeneratorFunction]",BC="[object HTMLAllCollection]",LC="[object HTML document.all class]",$C="[object HTMLCollection]",MC=typeof Symbol=="function"&&!!Symbol.toStringTag,jC=!(0 in[,]),ud=a(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(iv=document.all,Il.call(iv)===Il.call(document.all)&&(ud=a(function(e){if((jC||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Il.call(e);return(r===BC||r===LC||r===$C||r===DC)&&e("")==null}catch{}return!1},"isDocumentDotAll")));var iv;ov.exports=a(xn?function(e){if(ud(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{xn(e,null,cd)}catch(r){if(r!==Al)return!1}return!fd(e)&&ld(e)}:function(e){if(ud(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(MC)return ld(e);if(fd(e))return!1;var r=Il.call(e);return r!==CC&&r!==NC&&!/^\[object HTML/.test(r)?!1:ld(e)},"isCallable")});var cv=T((K4,lv)=>{"use strict";var UC=sv(),HC=Object.prototype.toString,av=Object.prototype.hasOwnProperty,qC=a(function(e,r,i){for(var n=0,o=e.length;n<o;n++)av.call(e,n)&&(i==null?r(e[n],n,e):r.call(i,e[n],n,e))},"forEachArray"),zC=a(function(e,r,i){for(var n=0,o=e.length;n<o;n++)i==null?r(e.charAt(n),n,e):r.call(i,e.charAt(n),n,e)},"forEachString"),WC=a(function(e,r,i){for(var n in e)av.call(e,n)&&(i==null?r(e[n],n,e):r.call(i,e[n],n,e))},"forEachObject");function VC(t){return HC.call(t)==="[object Array]"}a(VC,"isArray");lv.exports=a(function(e,r,i){if(!UC(r))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),VC(e)?qC(e,r,n):typeof e=="string"?zC(e,r,n):WC(e,r,n)},"forEach")});var uv=T((X4,fv)=>{"use strict";fv.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var dv=T((Y4,hv)=>{"use strict";var hd=uv(),GC=globalThis;hv.exports=a(function(){for(var e=[],r=0;r<hd.length;r++)typeof GC[hd[r]]=="function"&&(e[e.length]=hd[r]);return e},"availableTypedArrays")});var yv=T((Q4,wv)=>{"use strict";var pv=vo(),KC=Eu(),Tn=Ht(),mv=tn();wv.exports=a(function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new Tn("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Tn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Tn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Tn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Tn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Tn("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,f=!!mv&&mv(e,r);if(pv)pv(e,r,{configurable:s===null&&f?f.configurable:!s,enumerable:n===null&&f?f.enumerable:!n,value:i,writable:o===null&&f?f.writable:!o});else if(l||!n&&!o&&!s)e[r]=i;else throw new KC("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var vv=T((tU,bv)=>{"use strict";var dd=vo(),gv=a(function(){return!!dd},"hasPropertyDescriptors");gv.hasArrayLengthDefineBug=a(function(){if(!dd)return null;try{return dd([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");bv.exports=gv});var xv=T((iU,Sv)=>{"use strict";var ZC=So(),_v=yv(),XC=vv()(),Fv=tn(),Ev=Ht(),YC=ZC("%Math.floor%");Sv.exports=a(function(e,r){if(typeof e!="function")throw new Ev("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||YC(r)!==r)throw new Ev("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in e&&Fv){var s=Fv(e,"length");s&&!s.configurable&&(n=!1),s&&!s.writable&&(o=!1)}return(n||o||!i)&&(XC?_v(e,"length",r,!0,!0):_v(e,"length",r)),e},"setFunctionLength")});var Ov=T((oU,Tv)=>{"use strict";var JC=rn(),QC=xa(),e2=Ou();Tv.exports=a(function(){return e2(JC,QC,arguments)},"applyBind")});var Pv=T((aU,Dl)=>{"use strict";var t2=xv(),Rv=vo(),r2=Ta(),kv=Ov();Dl.exports=a(function(e){var r=r2(arguments),i=e.length-(arguments.length-1);return t2(r,1+(i>0?i:0),!0)},"callBind");Rv?Rv(Dl.exports,"apply",{value:kv}):Dl.exports.apply=kv});var Iv=T((cU,Av)=>{"use strict";var i2=Su();Av.exports=a(function(){return i2()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Lv=T((uU,Bv)=>{"use strict";var Bl=cv(),n2=dv(),Dv=Pv(),md=xo(),Nl=tn(),Cl=ku(),o2=md("Object.prototype.toString"),Nv=Iv()(),Cv=globalThis,pd=n2(),wd=md("String.prototype.slice"),s2=md("Array.prototype.indexOf",!0)||a(function(e,r){for(var i=0;i<e.length;i+=1)if(e[i]===r)return i;return-1},"indexOf"),Ll={__proto__:null};Nv&&Nl&&Cl?Bl(pd,function(t){var e=new Cv[t];if(Symbol.toStringTag in e&&Cl){var r=Cl(e),i=Nl(r,Symbol.toStringTag);if(!i&&r){var n=Cl(r);i=Nl(n,Symbol.toStringTag)}Ll["$"+t]=Dv(i.get)}}):Bl(pd,function(t){var e=new Cv[t],r=e.slice||e.set;r&&(Ll["$"+t]=Dv(r))});var a2=a(function(e){var r=!1;return Bl(Ll,function(i,n){if(!r)try{"$"+i(e)===n&&(r=wd(n,1))}catch{}}),r},"tryAllTypedArrays"),l2=a(function(e){var r=!1;return Bl(Ll,function(i,n){if(!r)try{i(e),r=wd(n,1)}catch{}}),r},"tryAllSlices");Bv.exports=a(function(e){if(!e||typeof e!="object")return!1;if(!Nv){var r=wd(o2(e),8,-1);return s2(pd,r)>-1?r:r!=="Object"?!1:l2(e)}return Nl?a2(e):null},"whichTypedArray")});var Mv=T((dU,$v)=>{"use strict";var c2=Lv();$v.exports=a(function(e){return!!c2(e)},"isTypedArray")});var Uv=T((mU,jv)=>{"use strict";var f2=Ht(),u2=xo(),h2=u2("TypedArray.prototype.buffer",!0),d2=Mv();jv.exports=h2||a(function(e){if(!d2(e))throw new f2("Not a Typed Array");return e.buffer},"typedArrayBuffer")});var zv=T((yU,qv)=>{"use strict";var It=No().Buffer,p2=rv(),m2=Uv(),w2=ArrayBuffer.isView||a(function(e){try{return m2(e),!0}catch{return!1}},"isView"),y2=typeof Uint8Array<"u",Hv=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",g2=Hv&&(It.prototype instanceof Uint8Array||It.TYPED_ARRAY_SUPPORT);qv.exports=a(function(e,r){if(It.isBuffer(e))return e.constructor&&!("isBuffer"in e)?It.from(e):e;if(typeof e=="string")return It.from(e,r);if(Hv&&w2(e)){if(e.byteLength===0)return It.alloc(0);if(g2){var i=It.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var n=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=It.from(n);if(o.length===e.byteLength)return o}if(y2&&e instanceof Uint8Array)return It.from(e);var s=p2(e);if(s)for(var l=0;l<e.length;l+=1){var f=e[l];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(s||It.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return It.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},"toBuffer")});var Vv=T((bU,Wv)=>{"use strict";var b2=No().Buffer,v2=zv();function $l(t,e){this._block=b2.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}a($l,"Hash");$l.prototype.update=function(t,e){t=v2(t,e||"utf8");for(var r=this._block,i=this._blockSize,n=t.length,o=this._len,s=0;s<n;){for(var l=o%i,f=Math.min(n-s,i-l),c=0;c<f;c++)r[l+c]=t[s+c];o+=f,s+=f,o%i===0&&this._update(r)}return this._len+=n,this};$l.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o};$l.prototype._update=function(){throw new Error("_update must be implemented by subclass")};Wv.exports=$l});var Zv=T((_U,Kv)=>{"use strict";var _2=Gt(),Gv=Vv(),F2=No().Buffer,E2=[1518500249,1859775393,-1894007588,-899497514],S2=new Array(80);function Ko(){this.init(),this._w=S2,Gv.call(this,64,56)}a(Ko,"Sha1");_2(Ko,Gv);Ko.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function x2(t){return t<<1|t>>>31}a(x2,"rotl1");function T2(t){return t<<5|t>>>27}a(T2,"rotl5");function O2(t){return t<<30|t>>>2}a(O2,"rotl30");function R2(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}a(R2,"ft");Ko.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,s=this._e|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<80;++l)e[l]=x2(e[l-3]^e[l-8]^e[l-14]^e[l-16]);for(var f=0;f<80;++f){var c=~~(f/20),u=T2(r)+R2(c,i,n,o)+s+e[f]+E2[c]|0;s=o,o=n,n=O2(i),i=r,r=u}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0};Ko.prototype._hash=function(){var t=F2.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};Kv.exports=Ko});var Yv=T(yd=>{var Xv;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof yd=="object"?t(yd):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(Xv={}):t(Xv={})})(function(t){t.version="1.2.2";function e(){for(var b=0,x=new Array(256),_=0;_!=256;++_)b=_,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,x[_]=b;return typeof Int32Array<"u"?new Int32Array(x):x}a(e,"signed_crc_table");var r=e();function i(b){var x=0,_=0,P=0,k=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(P=0;P!=256;++P)k[P]=b[P];for(P=0;P!=256;++P)for(_=b[P],x=256+P;x<4096;x+=256)_=k[x]=_>>>8^b[_&255];var C=[];for(P=1;P!=16;++P)C[P-1]=typeof Int32Array<"u"?k.subarray(P*256,P*256+256):k.slice(P*256,P*256+256);return C}a(i,"slice_by_16_tables");var n=i(r),o=n[0],s=n[1],l=n[2],f=n[3],c=n[4],u=n[5],h=n[6],d=n[7],p=n[8],m=n[9],w=n[10],y=n[11],v=n[12],g=n[13],F=n[14];function O(b,x){for(var _=x^-1,P=0,k=b.length;P<k;)_=_>>>8^r[(_^b.charCodeAt(P++))&255];return~_}a(O,"crc32_bstr");function S(b,x){for(var _=x^-1,P=b.length-15,k=0;k<P;)_=F[b[k++]^_&255]^g[b[k++]^_>>8&255]^v[b[k++]^_>>16&255]^y[b[k++]^_>>>24]^w[b[k++]]^m[b[k++]]^p[b[k++]]^d[b[k++]]^h[b[k++]]^u[b[k++]]^c[b[k++]]^f[b[k++]]^l[b[k++]]^s[b[k++]]^o[b[k++]]^r[b[k++]];for(P+=15;k<P;)_=_>>>8^r[(_^b[k++])&255];return~_}a(S,"crc32_buf");function R(b,x){for(var _=x^-1,P=0,k=b.length,C=0,N=0;P<k;)C=b.charCodeAt(P++),C<128?_=_>>>8^r[(_^C)&255]:C<2048?(_=_>>>8^r[(_^(192|C>>6&31))&255],_=_>>>8^r[(_^(128|C&63))&255]):C>=55296&&C<57344?(C=(C&1023)+64,N=b.charCodeAt(P++)&1023,_=_>>>8^r[(_^(240|C>>8&7))&255],_=_>>>8^r[(_^(128|C>>2&63))&255],_=_>>>8^r[(_^(128|N>>6&15|(C&3)<<4))&255],_=_>>>8^r[(_^(128|N&63))&255]):(_=_>>>8^r[(_^(224|C>>12&15))&255],_=_>>>8^r[(_^(128|C>>6&63))&255],_=_>>>8^r[(_^(128|C&63))&255]);return~_}a(R,"crc32_str"),t.table=r,t.bstr=O,t.buf=S,t.str=R})});var dr=T(Ge=>{"use strict";var k2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function P2(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(P2,"_has");Ge.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)P2(r,i)&&(t[i]=r[i])}}return t};Ge.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var A2={arraySet:a(function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var o=0;o<i;o++)t[n+o]=e[r+o]},"arraySet"),flattenChunks:a(function(t){var e,r,i,n,o,s;for(i=0,e=0,r=t.length;e<r;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,r=t.length;e<r;e++)o=t[e],s.set(o,n),n+=o.length;return s},"flattenChunks")},I2={arraySet:a(function(t,e,r,i,n){for(var o=0;o<i;o++)t[n+o]=e[r+o]},"arraySet"),flattenChunks:a(function(t){return[].concat.apply([],t)},"flattenChunks")};Ge.setTyped=function(t){t?(Ge.Buf8=Uint8Array,Ge.Buf16=Uint16Array,Ge.Buf32=Int32Array,Ge.assign(Ge,A2)):(Ge.Buf8=Array,Ge.Buf16=Array,Ge.Buf32=Array,Ge.assign(Ge,I2))};Ge.setTyped(k2)});var v_=T(kn=>{"use strict";var D2=dr(),C2=4,Jv=0,Qv=1,N2=2;function Rn(t){for(var e=t.length;--e>=0;)t[e]=0}a(Rn,"zero");var B2=0,o_=1,L2=2,$2=3,M2=258,Sd=29,es=256,Xo=es+1+Sd,On=30,xd=19,s_=2*Xo+1,vi=15,gd=16,j2=7,Td=256,a_=16,l_=17,c_=18,Fd=[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],Ml=[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],U2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],H2=512,pr=new Array((Xo+2)*2);Rn(pr);var Zo=new Array(On*2);Rn(Zo);var Yo=new Array(H2);Rn(Yo);var Jo=new Array(M2-$2+1);Rn(Jo);var Od=new Array(Sd);Rn(Od);var jl=new Array(On);Rn(jl);function bd(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}a(bd,"StaticTreeDesc");var u_,h_,d_;function vd(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}a(vd,"TreeDesc");function p_(t){return t<256?Yo[t]:Yo[256+(t>>>7)]}a(p_,"d_code");function Qo(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}a(Qo,"put_short");function Je(t,e,r){t.bi_valid>gd-r?(t.bi_buf|=e<<t.bi_valid&65535,Qo(t,t.bi_buf),t.bi_buf=e>>gd-t.bi_valid,t.bi_valid+=r-gd):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}a(Je,"send_bits");function Yt(t,e,r){Je(t,r[e*2],r[e*2+1])}a(Yt,"send_code");function m_(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}a(m_,"bi_reverse");function q2(t){t.bi_valid===16?(Qo(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}a(q2,"bi_flush");function z2(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,u,h,d,p,m,w=0;for(d=0;d<=vi;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<s_;c++)u=t.heap[c],d=r[r[u*2+1]*2+1]+1,d>f&&(d=f,w++),r[u*2+1]=d,!(u>i)&&(t.bl_count[d]++,p=0,u>=l&&(p=s[u-l]),m=r[u*2],t.opt_len+=m*(d+p),o&&(t.static_len+=m*(n[u*2+1]+p)));if(w!==0){do{for(d=f-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[f]--,w-=2}while(w>0);for(d=f;d!==0;d--)for(u=t.bl_count[d];u!==0;)h=t.heap[--c],!(h>i)&&(r[h*2+1]!==d&&(t.opt_len+=(d-r[h*2+1])*r[h*2],r[h*2+1]=d),u--)}}a(z2,"gen_bitlen");function w_(t,e,r){var i=new Array(vi+1),n=0,o,s;for(o=1;o<=vi;o++)i[o]=n=n+r[o-1]<<1;for(s=0;s<=e;s++){var l=t[s*2+1];l!==0&&(t[s*2]=m_(i[l]++,l))}}a(w_,"gen_codes");function W2(){var t,e,r,i,n,o=new Array(vi+1);for(r=0,i=0;i<Sd-1;i++)for(Od[i]=r,t=0;t<1<<Fd[i];t++)Jo[r++]=i;for(Jo[r-1]=i,n=0,i=0;i<16;i++)for(jl[i]=n,t=0;t<1<<Ml[i];t++)Yo[n++]=i;for(n>>=7;i<On;i++)for(jl[i]=n<<7,t=0;t<1<<Ml[i]-7;t++)Yo[256+n++]=i;for(e=0;e<=vi;e++)o[e]=0;for(t=0;t<=143;)pr[t*2+1]=8,t++,o[8]++;for(;t<=255;)pr[t*2+1]=9,t++,o[9]++;for(;t<=279;)pr[t*2+1]=7,t++,o[7]++;for(;t<=287;)pr[t*2+1]=8,t++,o[8]++;for(w_(pr,Xo+1,o),t=0;t<On;t++)Zo[t*2+1]=5,Zo[t*2]=m_(t,5);u_=new bd(pr,Fd,es+1,Xo,vi),h_=new bd(Zo,Ml,0,On,vi),d_=new bd(new Array(0),U2,0,xd,j2)}a(W2,"tr_static_init");function y_(t){var e;for(e=0;e<Xo;e++)t.dyn_ltree[e*2]=0;for(e=0;e<On;e++)t.dyn_dtree[e*2]=0;for(e=0;e<xd;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Td*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}a(y_,"init_block");function g_(t){t.bi_valid>8?Qo(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}a(g_,"bi_windup");function V2(t,e,r,i){g_(t),i&&(Qo(t,r),Qo(t,~r)),D2.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}a(V2,"copy_block");function e_(t,e,r,i){var n=e*2,o=r*2;return t[n]<t[o]||t[n]===t[o]&&i[e]<=i[r]}a(e_,"smaller");function _d(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&e_(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!e_(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}a(_d,"pqdownheap");function t_(t,e,r){var i,n,o=0,s,l;if(t.last_lit!==0)do i=t.pending_buf[t.d_buf+o*2]<<8|t.pending_buf[t.d_buf+o*2+1],n=t.pending_buf[t.l_buf+o],o++,i===0?Yt(t,n,e):(s=Jo[n],Yt(t,s+es+1,e),l=Fd[s],l!==0&&(n-=Od[s],Je(t,n,l)),i--,s=p_(i),Yt(t,s,r),l=Ml[s],l!==0&&(i-=jl[s],Je(t,i,l)));while(o<t.last_lit);Yt(t,Td,e)}a(t_,"compress_block");function Ed(t,e){var r=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,o=e.stat_desc.elems,s,l,f=-1,c;for(t.heap_len=0,t.heap_max=s_,s=0;s<o;s++)r[s*2]!==0?(t.heap[++t.heap_len]=f=s,t.depth[s]=0):r[s*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,n&&(t.static_len-=i[c*2+1]);for(e.max_code=f,s=t.heap_len>>1;s>=1;s--)_d(t,r,s);c=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],_d(t,r,1),l=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=l,r[c*2]=r[s*2]+r[l*2],t.depth[c]=(t.depth[s]>=t.depth[l]?t.depth[s]:t.depth[l])+1,r[s*2+1]=r[l*2+1]=c,t.heap[1]=c++,_d(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],z2(t,e),w_(r,f,t.bl_count)}a(Ed,"build_tree");function r_(t,e,r){var i,n=-1,o,s=e[0*2+1],l=0,f=7,c=4;for(s===0&&(f=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)o=s,s=e[(i+1)*2+1],!(++l<f&&o===s)&&(l<c?t.bl_tree[o*2]+=l:o!==0?(o!==n&&t.bl_tree[o*2]++,t.bl_tree[a_*2]++):l<=10?t.bl_tree[l_*2]++:t.bl_tree[c_*2]++,l=0,n=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4))}a(r_,"scan_tree");function i_(t,e,r){var i,n=-1,o,s=e[0*2+1],l=0,f=7,c=4;for(s===0&&(f=138,c=3),i=0;i<=r;i++)if(o=s,s=e[(i+1)*2+1],!(++l<f&&o===s)){if(l<c)do Yt(t,o,t.bl_tree);while(--l!==0);else o!==0?(o!==n&&(Yt(t,o,t.bl_tree),l--),Yt(t,a_,t.bl_tree),Je(t,l-3,2)):l<=10?(Yt(t,l_,t.bl_tree),Je(t,l-3,3)):(Yt(t,c_,t.bl_tree),Je(t,l-11,7));l=0,n=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4)}}a(i_,"send_tree");function G2(t){var e;for(r_(t,t.dyn_ltree,t.l_desc.max_code),r_(t,t.dyn_dtree,t.d_desc.max_code),Ed(t,t.bl_desc),e=xd-1;e>=3&&t.bl_tree[f_[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}a(G2,"build_bl_tree");function K2(t,e,r,i){var n;for(Je(t,e-257,5),Je(t,r-1,5),Je(t,i-4,4),n=0;n<i;n++)Je(t,t.bl_tree[f_[n]*2+1],3);i_(t,t.dyn_ltree,e-1),i_(t,t.dyn_dtree,r-1)}a(K2,"send_all_trees");function Z2(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Jv;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Qv;for(r=32;r<es;r++)if(t.dyn_ltree[r*2]!==0)return Qv;return Jv}a(Z2,"detect_data_type");var n_=!1;function X2(t){n_||(W2(),n_=!0),t.l_desc=new vd(t.dyn_ltree,u_),t.d_desc=new vd(t.dyn_dtree,h_),t.bl_desc=new vd(t.bl_tree,d_),t.bi_buf=0,t.bi_valid=0,y_(t)}a(X2,"_tr_init");function b_(t,e,r,i){Je(t,(B2<<1)+(i?1:0),3),V2(t,e,r,!0)}a(b_,"_tr_stored_block");function Y2(t){Je(t,o_<<1,3),Yt(t,Td,pr),q2(t)}a(Y2,"_tr_align");function J2(t,e,r,i){var n,o,s=0;t.level>0?(t.strm.data_type===N2&&(t.strm.data_type=Z2(t)),Ed(t,t.l_desc),Ed(t,t.d_desc),s=G2(t),n=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=n&&(n=o)):n=o=r+5,r+4<=n&&e!==-1?b_(t,e,r,i):t.strategy===C2||o===n?(Je(t,(o_<<1)+(i?1:0),3),t_(t,pr,Zo)):(Je(t,(L2<<1)+(i?1:0),3),K2(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),t_(t,t.dyn_ltree,t.dyn_dtree)),y_(t),i&&g_(t)}a(J2,"_tr_flush_block");function Q2(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Jo[r]+es+1)*2]++,t.dyn_dtree[p_(e)*2]++),t.last_lit===t.lit_bufsize-1}a(Q2,"_tr_tally");kn._tr_init=X2;kn._tr_stored_block=b_;kn._tr_flush_block=J2;kn._tr_tally=Q2;kn._tr_align=Y2});var Rd=T((kU,__)=>{"use strict";function eN(t,e,r,i){for(var n=t&65535|0,o=t>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do n=n+e[i++]|0,o=o+n|0;while(--s);n%=65521,o%=65521}return n|o<<16|0}a(eN,"adler32");__.exports=eN});var kd=T((AU,F_)=>{"use strict";function tN(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}a(tN,"makeTable");var rN=tN();function iN(t,e,r,i){var n=rN,o=i+r;t^=-1;for(var s=i;s<o;s++)t=t>>>8^n[(t^e[s])&255];return t^-1}a(iN,"crc32");F_.exports=iN});var Ul=T((DU,E_)=>{"use strict";E_.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 I_=T(er=>{"use strict";var Ke=dr(),_t=v_(),O_=Rd(),$r=kd(),nN=Ul(),Si=0,oN=1,sN=3,qr=4,S_=5,Qt=0,x_=1,Ft=-2,aN=-3,Pd=-5,lN=-1,cN=1,Hl=2,fN=3,uN=4,hN=0,dN=2,Vl=8,pN=9,mN=15,wN=8,yN=29,gN=256,Id=gN+1+yN,bN=30,vN=19,_N=2*Id+1,FN=15,Q=3,Ur=258,Dt=Ur+Q+1,EN=32,Gl=42,Dd=69,ql=73,zl=91,Wl=103,_i=113,rs=666,Ae=1,is=2,Fi=3,In=4,SN=3;function Hr(t,e){return t.msg=nN[e],e}a(Hr,"err");function T_(t){return(t<<1)-(t>4?9:0)}a(T_,"rank");function jr(t){for(var e=t.length;--e>=0;)t[e]=0}a(jr,"zero");function Mr(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(Ke.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}a(Mr,"flush_pending");function $e(t,e){_t._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Mr(t.strm)}a($e,"flush_block_only");function oe(t,e){t.pending_buf[t.pending++]=e}a(oe,"put_byte");function ts(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}a(ts,"putShortMSB");function xN(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,Ke.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=O_(t.adler,e,n,r):t.state.wrap===2&&(t.adler=$r(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}a(xN,"read_buf");function R_(t,e){var r=t.max_chain_length,i=t.strstart,n,o,s=t.prev_length,l=t.nice_match,f=t.strstart>t.w_size-Dt?t.strstart-(t.w_size-Dt):0,c=t.window,u=t.w_mask,h=t.prev,d=t.strstart+Ur,p=c[i+s-1],m=c[i+s];t.prev_length>=t.good_match&&(r>>=2),l>t.lookahead&&(l=t.lookahead);do if(n=e,!(c[n+s]!==m||c[n+s-1]!==p||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<d);if(o=Ur-(d-i),i=d-Ur,o>s){if(t.match_start=e,s=o,o>=l)break;p=c[i+s-1],m=c[i+s]}}while((e=h[e&u])>f&&--r!==0);return s<=t.lookahead?s:t.lookahead}a(R_,"longest_match");function Ei(t){var e=t.w_size,r,i,n,o,s;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Dt)){Ke.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);o+=e}if(t.strm.avail_in===0)break;if(i=xN(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=i,t.lookahead+t.insert>=Q)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+Q-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<Q)););}while(t.lookahead<Dt&&t.strm.avail_in!==0)}a(Ei,"fill_window");function TN(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ei(t),t.lookahead===0&&e===Si)return Ae;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,$e(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Dt&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):(t.strstart>t.block_start&&($e(t,!1),t.strm.avail_out===0),Ae)}a(TN,"deflate_stored");function Ad(t,e){for(var r,i;;){if(t.lookahead<Dt){if(Ei(t),t.lookahead<Dt&&e===Si)return Ae;if(t.lookahead===0)break}if(r=0,t.lookahead>=Q&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Dt&&(t.match_length=R_(t,r)),t.match_length>=Q)if(i=_t._tr_tally(t,t.strstart-t.match_start,t.match_length-Q),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Q){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=t.strstart<Q-1?t.strstart:Q-1,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(Ad,"deflate_fast");function Pn(t,e){for(var r,i,n;;){if(t.lookahead<Dt){if(Ei(t),t.lookahead<Dt&&e===Si)return Ae;if(t.lookahead===0)break}if(r=0,t.lookahead>=Q&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Q-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Dt&&(t.match_length=R_(t,r),t.match_length<=5&&(t.strategy===cN||t.match_length===Q&&t.strstart-t.match_start>4096)&&(t.match_length=Q-1)),t.prev_length>=Q&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-Q,i=_t._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-Q),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Q-1,t.strstart++,i&&($e(t,!1),t.strm.avail_out===0))return Ae}else if(t.match_available){if(i=_t._tr_tally(t,0,t.window[t.strstart-1]),i&&$e(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Ae}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=_t._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Q-1?t.strstart:Q-1,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(Pn,"deflate_slow");function ON(t,e){for(var r,i,n,o,s=t.window;;){if(t.lookahead<=Ur){if(Ei(t),t.lookahead<=Ur&&e===Si)return Ae;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Q&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){o=t.strstart+Ur;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<o);t.match_length=Ur-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Q?(r=_t._tr_tally(t,1,t.match_length-Q),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(ON,"deflate_rle");function RN(t,e){for(var r;;){if(t.lookahead===0&&(Ei(t),t.lookahead===0)){if(e===Si)return Ae;break}if(t.match_length=0,r=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(RN,"deflate_huff");function Jt(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}a(Jt,"Config");var An;An=[new Jt(0,0,0,0,TN),new Jt(4,4,8,4,Ad),new Jt(4,5,16,8,Ad),new Jt(4,6,32,32,Ad),new Jt(4,4,16,16,Pn),new Jt(8,16,32,32,Pn),new Jt(8,16,128,128,Pn),new Jt(8,32,128,256,Pn),new Jt(32,128,258,1024,Pn),new Jt(32,258,258,4096,Pn)];function kN(t){t.window_size=2*t.w_size,jr(t.head),t.max_lazy_match=An[t.level].max_lazy,t.good_match=An[t.level].good_length,t.nice_match=An[t.level].nice_length,t.max_chain_length=An[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Q-1,t.match_available=0,t.ins_h=0}a(kN,"lm_init");function PN(){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=Vl,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ke.Buf16(_N*2),this.dyn_dtree=new Ke.Buf16((2*bN+1)*2),this.bl_tree=new Ke.Buf16((2*vN+1)*2),jr(this.dyn_ltree),jr(this.dyn_dtree),jr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ke.Buf16(FN+1),this.heap=new Ke.Buf16(2*Id+1),jr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ke.Buf16(2*Id+1),jr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}a(PN,"DeflateState");function k_(t){var e;return!t||!t.state?Hr(t,Ft):(t.total_in=t.total_out=0,t.data_type=dN,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Gl:_i,t.adler=e.wrap===2?0:1,e.last_flush=Si,_t._tr_init(e),Qt)}a(k_,"deflateResetKeep");function P_(t){var e=k_(t);return e===Qt&&kN(t.state),e}a(P_,"deflateReset");function AN(t,e){return!t||!t.state||t.state.wrap!==2?Ft:(t.state.gzhead=e,Qt)}a(AN,"deflateSetHeader");function A_(t,e,r,i,n,o){if(!t)return Ft;var s=1;if(e===lN&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>pN||r!==Vl||i<8||i>15||e<0||e>9||o<0||o>uN)return Hr(t,Ft);i===8&&(i=9);var l=new PN;return t.state=l,l.strm=t,l.wrap=s,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=n+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Q-1)/Q),l.window=new Ke.Buf8(l.w_size*2),l.head=new Ke.Buf16(l.hash_size),l.prev=new Ke.Buf16(l.w_size),l.lit_bufsize=1<<n+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Ke.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=r,P_(t)}a(A_,"deflateInit2");function IN(t,e){return A_(t,e,Vl,mN,wN,hN)}a(IN,"deflateInit");function DN(t,e){var r,i,n,o;if(!t||!t.state||e>S_||e<0)return t?Hr(t,Ft):Ft;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===rs&&e!==qr)return Hr(t,t.avail_out===0?Pd:Ft);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===Gl)if(i.wrap===2)t.adler=0,oe(i,31),oe(i,139),oe(i,8),i.gzhead?(oe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),oe(i,i.gzhead.time&255),oe(i,i.gzhead.time>>8&255),oe(i,i.gzhead.time>>16&255),oe(i,i.gzhead.time>>24&255),oe(i,i.level===9?2:i.strategy>=Hl||i.level<2?4:0),oe(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(oe(i,i.gzhead.extra.length&255),oe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=$r(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Dd):(oe(i,0),oe(i,0),oe(i,0),oe(i,0),oe(i,0),oe(i,i.level===9?2:i.strategy>=Hl||i.level<2?4:0),oe(i,SN),i.status=_i);else{var s=Vl+(i.w_bits-8<<4)<<8,l=-1;i.strategy>=Hl||i.level<2?l=0:i.level<6?l=1:i.level===6?l=2:l=3,s|=l<<6,i.strstart!==0&&(s|=EN),s+=31-s%31,i.status=_i,ts(i,s),i.strstart!==0&&(ts(i,t.adler>>>16),ts(i,t.adler&65535)),t.adler=1}if(i.status===Dd)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size));)oe(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=ql)}else i.status=ql;if(i.status===ql)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,oe(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.gzindex=0,i.status=zl)}else i.status=zl;if(i.status===zl)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,oe(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.status=Wl)}else i.status=Wl;if(i.status===Wl&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Mr(t),i.pending+2<=i.pending_buf_size&&(oe(i,t.adler&255),oe(i,t.adler>>8&255),t.adler=0,i.status=_i)):i.status=_i),i.pending!==0){if(Mr(t),t.avail_out===0)return i.last_flush=-1,Qt}else if(t.avail_in===0&&T_(e)<=T_(r)&&e!==qr)return Hr(t,Pd);if(i.status===rs&&t.avail_in!==0)return Hr(t,Pd);if(t.avail_in!==0||i.lookahead!==0||e!==Si&&i.status!==rs){var f=i.strategy===Hl?RN(i,e):i.strategy===fN?ON(i,e):An[i.level].func(i,e);if((f===Fi||f===In)&&(i.status=rs),f===Ae||f===Fi)return t.avail_out===0&&(i.last_flush=-1),Qt;if(f===is&&(e===oN?_t._tr_align(i):e!==S_&&(_t._tr_stored_block(i,0,0,!1),e===sN&&(jr(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Mr(t),t.avail_out===0))return i.last_flush=-1,Qt}return e!==qr?Qt:i.wrap<=0?x_:(i.wrap===2?(oe(i,t.adler&255),oe(i,t.adler>>8&255),oe(i,t.adler>>16&255),oe(i,t.adler>>24&255),oe(i,t.total_in&255),oe(i,t.total_in>>8&255),oe(i,t.total_in>>16&255),oe(i,t.total_in>>24&255)):(ts(i,t.adler>>>16),ts(i,t.adler&65535)),Mr(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Qt:x_)}a(DN,"deflate");function CN(t){var e;return!t||!t.state?Ft:(e=t.state.status,e!==Gl&&e!==Dd&&e!==ql&&e!==zl&&e!==Wl&&e!==_i&&e!==rs?Hr(t,Ft):(t.state=null,e===_i?Hr(t,aN):Qt))}a(CN,"deflateEnd");function NN(t,e){var r=e.length,i,n,o,s,l,f,c,u;if(!t||!t.state||(i=t.state,s=i.wrap,s===2||s===1&&i.status!==Gl||i.lookahead))return Ft;for(s===1&&(t.adler=O_(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(s===0&&(jr(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new Ke.Buf8(i.w_size),Ke.arraySet(u,e,r-i.w_size,i.w_size,0),e=u,r=i.w_size),l=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,Ei(i);i.lookahead>=Q;){n=i.strstart,o=i.lookahead-(Q-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+Q-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--o);i.strstart=n,i.lookahead=Q-1,Ei(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Q-1,i.match_available=0,t.next_in=f,t.input=c,t.avail_in=l,i.wrap=s,Qt}a(NN,"deflateSetDictionary");er.deflateInit=IN;er.deflateInit2=A_;er.deflateReset=P_;er.deflateResetKeep=k_;er.deflateSetHeader=AN;er.deflate=DN;er.deflateEnd=CN;er.deflateSetDictionary=NN;er.deflateInfo="pako deflate (from Nodeca project)"});var Cd=T(Dn=>{"use strict";var Kl=dr(),D_=!0,C_=!0;try{String.fromCharCode.apply(null,[0])}catch{D_=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{C_=!1}var ns=new Kl.Buf8(256);for(mr=0;mr<256;mr++)ns[mr]=mr>=252?6:mr>=248?5:mr>=240?4:mr>=224?3:mr>=192?2:1;var mr;ns[254]=ns[254]=1;Dn.string2buf=function(t){var e,r,i,n,o,s=t.length,l=0;for(n=0;n<s;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Kl.Buf8(l),o=0,n=0;o<l;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|r&63):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|r&63):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|r&63);return e};function N_(t,e){if(e<65534&&(t.subarray&&C_||!t.subarray&&D_))return String.fromCharCode.apply(null,Kl.shrinkBuf(t,e));for(var r="",i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r}a(N_,"buf2binstring");Dn.buf2binstring=function(t){return N_(t,t.length)};Dn.binstring2buf=function(t){for(var e=new Kl.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e};Dn.buf2string=function(t,e){var r,i,n,o,s=e||t.length,l=new Array(s*2);for(i=0,r=0;r<s;){if(n=t[r++],n<128){l[i++]=n;continue}if(o=ns[n],o>4){l[i++]=65533,r+=o-1;continue}for(n&=o===2?31:o===3?15:7;o>1&&r<s;)n=n<<6|t[r++]&63,o--;if(o>1){l[i++]=65533;continue}n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|n&1023)}return N_(l,i)};Dn.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+ns[t[r]]>e?r:e}});var Nd=T(($U,B_)=>{"use strict";function BN(){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}a(BN,"ZStream");B_.exports=BN});var j_=T(as=>{"use strict";var os=I_(),ss=dr(),Ld=Cd(),$d=Ul(),LN=Nd(),M_=Object.prototype.toString,$N=0,Bd=4,Cn=0,L_=1,$_=2,MN=-1,jN=0,UN=8;function xi(t){if(!(this instanceof xi))return new xi(t);this.options=ss.assign({level:MN,method:UN,chunkSize:16384,windowBits:15,memLevel:8,strategy:jN,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new LN,this.strm.avail_out=0;var r=os.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Cn)throw new Error($d[r]);if(e.header&&os.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=Ld.string2buf(e.dictionary):M_.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=os.deflateSetDictionary(this.strm,i),r!==Cn)throw new Error($d[r]);this._dict_set=!0}}a(xi,"Deflate");xi.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,o;if(this.ended)return!1;o=e===~~e?e:e===!0?Bd:$N,typeof t=="string"?r.input=Ld.string2buf(t):M_.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new ss.Buf8(i),r.next_out=0,r.avail_out=i),n=os.deflate(r,o),n!==L_&&n!==Cn)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Bd||o===$_))&&(this.options.to==="string"?this.onData(Ld.buf2binstring(ss.shrinkBuf(r.output,r.next_out))):this.onData(ss.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==L_);return o===Bd?(n=os.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Cn):(o===$_&&(this.onEnd(Cn),r.avail_out=0),!0)};xi.prototype.onData=function(t){this.chunks.push(t)};xi.prototype.onEnd=function(t){t===Cn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ss.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Md(t,e){var r=new xi(e);if(r.push(t,!0),r.err)throw r.msg||$d[r.err];return r.result}a(Md,"deflate");function HN(t,e){return e=e||{},e.raw=!0,Md(t,e)}a(HN,"deflateRaw");function qN(t,e){return e=e||{},e.gzip=!0,Md(t,e)}a(qN,"gzip");as.Deflate=xi;as.deflate=Md;as.deflateRaw=HN;as.gzip=qN});var H_=T((HU,U_)=>{"use strict";var Zl=30,zN=12;U_.exports=a(function(e,r){var i,n,o,s,l,f,c,u,h,d,p,m,w,y,v,g,F,O,S,R,b,x,_,P,k;i=e.state,n=e.next_in,P=e.input,o=n+(e.avail_in-5),s=e.next_out,k=e.output,l=s-(r-e.avail_out),f=s+(e.avail_out-257),c=i.dmax,u=i.wsize,h=i.whave,d=i.wnext,p=i.window,m=i.hold,w=i.bits,y=i.lencode,v=i.distcode,g=(1<<i.lenbits)-1,F=(1<<i.distbits)-1;e:do{w<15&&(m+=P[n++]<<w,w+=8,m+=P[n++]<<w,w+=8),O=y[m&g];t:for(;;){if(S=O>>>24,m>>>=S,w-=S,S=O>>>16&255,S===0)k[s++]=O&65535;else if(S&16){R=O&65535,S&=15,S&&(w<S&&(m+=P[n++]<<w,w+=8),R+=m&(1<<S)-1,m>>>=S,w-=S),w<15&&(m+=P[n++]<<w,w+=8,m+=P[n++]<<w,w+=8),O=v[m&F];r:for(;;){if(S=O>>>24,m>>>=S,w-=S,S=O>>>16&255,S&16){if(b=O&65535,S&=15,w<S&&(m+=P[n++]<<w,w+=8,w<S&&(m+=P[n++]<<w,w+=8)),b+=m&(1<<S)-1,b>c){e.msg="invalid distance too far back",i.mode=Zl;break e}if(m>>>=S,w-=S,S=s-l,b>S){if(S=b-S,S>h&&i.sane){e.msg="invalid distance too far back",i.mode=Zl;break e}if(x=0,_=p,d===0){if(x+=u-S,S<R){R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}}else if(d<S){if(x+=u+d-S,S-=d,S<R){R-=S;do k[s++]=p[x++];while(--S);if(x=0,d<R){S=d,R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}}}else if(x+=d-S,S<R){R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}for(;R>2;)k[s++]=_[x++],k[s++]=_[x++],k[s++]=_[x++],R-=3;R&&(k[s++]=_[x++],R>1&&(k[s++]=_[x++]))}else{x=s-b;do k[s++]=k[x++],k[s++]=k[x++],k[s++]=k[x++],R-=3;while(R>2);R&&(k[s++]=k[x++],R>1&&(k[s++]=k[x++]))}}else if(S&64){e.msg="invalid distance code",i.mode=Zl;break e}else{O=v[(O&65535)+(m&(1<<S)-1)];continue r}break}}else if(S&64)if(S&32){i.mode=zN;break e}else{e.msg="invalid literal/length code",i.mode=Zl;break e}else{O=y[(O&65535)+(m&(1<<S)-1)];continue t}break}}while(n<o&&s<f);R=w>>3,n-=R,w-=R<<3,m&=(1<<w)-1,e.next_in=n,e.next_out=s,e.avail_in=n<o?5+(o-n):5-(n-o),e.avail_out=s<f?257+(f-s):257-(s-f),i.hold=m,i.bits=w},"inflate_fast")});var Z_=T((zU,K_)=>{"use strict";var q_=dr(),Nn=15,z_=852,W_=592,V_=0,jd=1,G_=2,WN=[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],VN=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],GN=[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],KN=[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];K_.exports=a(function(e,r,i,n,o,s,l,f){var c=f.bits,u=0,h=0,d=0,p=0,m=0,w=0,y=0,v=0,g=0,F=0,O,S,R,b,x,_=null,P=0,k,C=new q_.Buf16(Nn+1),N=new q_.Buf16(Nn+1),U=null,Z=0,me,Ee,$;for(u=0;u<=Nn;u++)C[u]=0;for(h=0;h<n;h++)C[r[i+h]]++;for(m=c,p=Nn;p>=1&&C[p]===0;p--);if(m>p&&(m=p),p===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,f.bits=1,0;for(d=1;d<p&&C[d]===0;d++);for(m<d&&(m=d),v=1,u=1;u<=Nn;u++)if(v<<=1,v-=C[u],v<0)return-1;if(v>0&&(e===V_||p!==1))return-1;for(N[1]=0,u=1;u<Nn;u++)N[u+1]=N[u]+C[u];for(h=0;h<n;h++)r[i+h]!==0&&(l[N[r[i+h]]++]=h);if(e===V_?(_=U=l,k=19):e===jd?(_=WN,P-=257,U=VN,Z-=257,k=256):(_=GN,U=KN,k=-1),F=0,h=0,u=d,x=s,w=m,y=0,R=-1,g=1<<m,b=g-1,e===jd&&g>z_||e===G_&&g>W_)return 1;for(;;){me=u-y,l[h]<k?(Ee=0,$=l[h]):l[h]>k?(Ee=U[Z+l[h]],$=_[P+l[h]]):(Ee=96,$=0),O=1<<u-y,S=1<<w,d=S;do S-=O,o[x+(F>>y)+S]=me<<24|Ee<<16|$|0;while(S!==0);for(O=1<<u-1;F&O;)O>>=1;if(O!==0?(F&=O-1,F+=O):F=0,h++,--C[u]===0){if(u===p)break;u=r[i+l[h]]}if(u>m&&(F&b)!==R){for(y===0&&(y=m),x+=d,w=u-y,v=1<<w;w+y<p&&(v-=C[w+y],!(v<=0));)w++,v<<=1;if(g+=1<<w,e===jd&&g>z_||e===G_&&g>W_)return 1;R=F&b,o[R]=m<<24|w<<16|x-s|0}}return F!==0&&(o[x+F]=u-y<<24|64<<16|0),f.bits=m,0},"inflate_table")});var PF=T(Ct=>{"use strict";var ct=dr(),Vd=Rd(),tr=kd(),ZN=H_(),ls=Z_(),XN=0,_F=1,FF=2,X_=4,YN=5,Xl=6,Ti=0,JN=1,QN=2,Et=-2,EF=-3,Gd=-4,eB=-5,Y_=8,SF=1,J_=2,Q_=3,eF=4,tF=5,rF=6,iF=7,nF=8,oF=9,sF=10,Ql=11,wr=12,Ud=13,aF=14,Hd=15,lF=16,cF=17,fF=18,uF=19,Yl=20,Jl=21,hF=22,dF=23,pF=24,mF=25,wF=26,qd=27,yF=28,gF=29,pe=30,Kd=31,tB=32,rB=852,iB=592,nB=15,oB=nB;function bF(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}a(bF,"zswap32");function sB(){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 ct.Buf16(320),this.work=new ct.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}a(sB,"InflateState");function xF(t){var e;return!t||!t.state?Et:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=SF,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new ct.Buf32(rB),e.distcode=e.distdyn=new ct.Buf32(iB),e.sane=1,e.back=-1,Ti)}a(xF,"inflateResetKeep");function TF(t){var e;return!t||!t.state?Et:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,xF(t))}a(TF,"inflateReset");function OF(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Et:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,TF(t))}a(OF,"inflateReset2");function RF(t,e){var r,i;return t?(i=new sB,t.state=i,i.window=null,r=OF(t,e),r!==Ti&&(t.state=null),r):Et}a(RF,"inflateInit2");function aB(t){return RF(t,oB)}a(aB,"inflateInit");var vF=!0,zd,Wd;function lB(t){if(vF){var e;for(zd=new ct.Buf32(512),Wd=new ct.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ls(_F,t.lens,0,288,zd,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ls(FF,t.lens,0,32,Wd,0,t.work,{bits:5}),vF=!1}t.lencode=zd,t.lenbits=9,t.distcode=Wd,t.distbits=5}a(lB,"fixedtables");function kF(t,e,r,i){var n,o=t.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new ct.Buf8(o.wsize)),i>=o.wsize?(ct.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),ct.arraySet(o.window,e,r-i,n,o.wnext),i-=n,i?(ct.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}a(kF,"updatewindow");function cB(t,e){var r,i,n,o,s,l,f,c,u,h,d,p,m,w,y=0,v,g,F,O,S,R,b,x,_=new ct.Buf8(4),P,k,C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Et;r=t.state,r.mode===wr&&(r.mode=Ud),s=t.next_out,n=t.output,f=t.avail_out,o=t.next_in,i=t.input,l=t.avail_in,c=r.hold,u=r.bits,h=l,d=f,x=Ti;e:for(;;)switch(r.mode){case SF:if(r.wrap===0){r.mode=Ud;break}for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0),c=0,u=0,r.mode=J_;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=pe;break}if((c&15)!==Y_){t.msg="unknown compression method",r.mode=pe;break}if(c>>>=4,u-=4,b=(c&15)+8,r.wbits===0)r.wbits=b;else if(b>r.wbits){t.msg="invalid window size",r.mode=pe;break}r.dmax=1<<b,t.adler=r.check=1,r.mode=c&512?sF:wr,c=0,u=0;break;case J_:for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==Y_){t.msg="unknown compression method",r.mode=pe;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=pe;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0,r.mode=Q_;case Q_:for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,r.check=tr(r.check,_,4,0)),c=0,u=0,r.mode=eF;case eF:for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0,r.mode=tF;case tF:if(r.flags&1024){for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=rF;case rF:if(r.flags&1024&&(p=r.length,p>l&&(p=l),p&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),ct.arraySet(r.head.extra,i,o,p,b)),r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,r.length-=p),r.length))break e;r.length=0,r.mode=iF;case iF:if(r.flags&2048){if(l===0)break e;p=0;do b=i[o+p++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b));while(b&&p<l);if(r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,b)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=nF;case nF:if(r.flags&4096){if(l===0)break e;p=0;do b=i[o+p++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b));while(b&&p<l);if(r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,b)break e}else r.head&&(r.head.comment=null);r.mode=oF;case oF:if(r.flags&512){for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=pe;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=wr;break;case sF:for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}t.adler=r.check=bF(c),c=0,u=0,r.mode=Ql;case Ql:if(r.havedict===0)return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,QN;t.adler=r.check=1,r.mode=wr;case wr:if(e===YN||e===Xl)break e;case Ud:if(r.last){c>>>=u&7,u-=u&7,r.mode=qd;break}for(;u<3;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=aF;break;case 1:if(lB(r),r.mode=Yl,e===Xl){c>>>=2,u-=2;break e}break;case 2:r.mode=cF;break;case 3:t.msg="invalid block type",r.mode=pe}c>>>=2,u-=2;break;case aF:for(c>>>=u&7,u-=u&7;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=pe;break}if(r.length=c&65535,c=0,u=0,r.mode=Hd,e===Xl)break e;case Hd:r.mode=lF;case lF:if(p=r.length,p){if(p>l&&(p=l),p>f&&(p=f),p===0)break e;ct.arraySet(n,i,o,p,s),l-=p,o+=p,f-=p,s+=p,r.length-=p;break}r.mode=wr;break;case cF:for(;u<14;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=pe;break}r.have=0,r.mode=fF;case fF:for(;r.have<r.ncode;){for(;u<3;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.lens[C[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},x=ls(XN,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid code lengths set",r.mode=pe;break}r.have=0,r.mode=uF;case uF:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(F<16)c>>>=v,u-=v,r.lens[r.have++]=F;else{if(F===16){for(k=v+2;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c>>>=v,u-=v,r.have===0){t.msg="invalid bit length repeat",r.mode=pe;break}b=r.lens[r.have-1],p=3+(c&3),c>>>=2,u-=2}else if(F===17){for(k=v+3;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=v,u-=v,b=0,p=3+(c&7),c>>>=3,u-=3}else{for(k=v+7;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=v,u-=v,b=0,p=11+(c&127),c>>>=7,u-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=pe;break}for(;p--;)r.lens[r.have++]=b}}if(r.mode===pe)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=pe;break}if(r.lenbits=9,P={bits:r.lenbits},x=ls(_F,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid literal/lengths set",r.mode=pe;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},x=ls(FF,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,x){t.msg="invalid distances set",r.mode=pe;break}if(r.mode=Yl,e===Xl)break e;case Yl:r.mode=Jl;case Jl:if(l>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,ZN(t,d),s=t.next_out,n=t.output,f=t.avail_out,o=t.next_in,i=t.input,l=t.avail_in,c=r.hold,u=r.bits,r.mode===wr&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(g&&!(g&240)){for(O=v,S=g,R=F;y=r.lencode[R+((c&(1<<O+S)-1)>>O)],v=y>>>24,g=y>>>16&255,F=y&65535,!(O+v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=O,u-=O,r.back+=O}if(c>>>=v,u-=v,r.back+=v,r.length=F,g===0){r.mode=wF;break}if(g&32){r.back=-1,r.mode=wr;break}if(g&64){t.msg="invalid literal/length code",r.mode=pe;break}r.extra=g&15,r.mode=hF;case hF:if(r.extra){for(k=r.extra;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=dF;case dF:for(;y=r.distcode[c&(1<<r.distbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(!(g&240)){for(O=v,S=g,R=F;y=r.distcode[R+((c&(1<<O+S)-1)>>O)],v=y>>>24,g=y>>>16&255,F=y&65535,!(O+v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=O,u-=O,r.back+=O}if(c>>>=v,u-=v,r.back+=v,g&64){t.msg="invalid distance code",r.mode=pe;break}r.offset=F,r.extra=g&15,r.mode=pF;case pF:if(r.extra){for(k=r.extra;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=pe;break}r.mode=mF;case mF:if(f===0)break e;if(p=d-f,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=pe;break}p>r.wnext?(p-=r.wnext,m=r.wsize-p):m=r.wnext-p,p>r.length&&(p=r.length),w=r.window}else w=n,m=s-r.offset,p=r.length;p>f&&(p=f),f-=p,r.length-=p;do n[s++]=w[m++];while(--p);r.length===0&&(r.mode=Jl);break;case wF:if(f===0)break e;n[s++]=r.length,f--,r.mode=Jl;break;case qd:if(r.wrap){for(;u<32;){if(l===0)break e;l--,c|=i[o++]<<u,u+=8}if(d-=f,t.total_out+=d,r.total+=d,d&&(t.adler=r.check=r.flags?tr(r.check,n,d,s-d):Vd(r.check,n,d,s-d)),d=f,(r.flags?c:bF(c))!==r.check){t.msg="incorrect data check",r.mode=pe;break}c=0,u=0}r.mode=yF;case yF:if(r.wrap&&r.flags){for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=pe;break}c=0,u=0}r.mode=gF;case gF:x=JN;break e;case pe:x=EF;break e;case Kd:return Gd;case tB:default:return Et}return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,(r.wsize||d!==t.avail_out&&r.mode<pe&&(r.mode<qd||e!==X_))&&kF(t,t.output,t.next_out,d-t.avail_out)?(r.mode=Kd,Gd):(h-=t.avail_in,d-=t.avail_out,t.total_in+=h,t.total_out+=d,r.total+=d,r.wrap&&d&&(t.adler=r.check=r.flags?tr(r.check,n,d,t.next_out-d):Vd(r.check,n,d,t.next_out-d)),t.data_type=r.bits+(r.last?64:0)+(r.mode===wr?128:0)+(r.mode===Yl||r.mode===Hd?256:0),(h===0&&d===0||e===X_)&&x===Ti&&(x=eB),x)}a(cB,"inflate");function fB(t){if(!t||!t.state)return Et;var e=t.state;return e.window&&(e.window=null),t.state=null,Ti}a(fB,"inflateEnd");function uB(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Et:(r.head=e,e.done=!1,Ti)}a(uB,"inflateGetHeader");function hB(t,e){var r=e.length,i,n,o;return!t||!t.state||(i=t.state,i.wrap!==0&&i.mode!==Ql)?Et:i.mode===Ql&&(n=1,n=Vd(n,e,r,0),n!==i.check)?EF:(o=kF(t,e,r,r),o?(i.mode=Kd,Gd):(i.havedict=1,Ti))}a(hB,"inflateSetDictionary");Ct.inflateReset=TF;Ct.inflateReset2=OF;Ct.inflateResetKeep=xF;Ct.inflateInit=aB;Ct.inflateInit2=RF;Ct.inflate=cB;Ct.inflateEnd=fB;Ct.inflateGetHeader=uB;Ct.inflateSetDictionary=hB;Ct.inflateInfo="pako inflate (from Nodeca project)"});var Zd=T((KU,AF)=>{"use strict";AF.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var DF=T((ZU,IF)=>{"use strict";function dB(){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}a(dB,"GZheader");IF.exports=dB});var NF=T(fs=>{"use strict";var Bn=PF(),cs=dr(),ec=Cd(),_e=Zd(),Xd=Ul(),pB=Nd(),mB=DF(),CF=Object.prototype.toString;function Oi(t){if(!(this instanceof Oi))return new Oi(t);this.options=cs.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pB,this.strm.avail_out=0;var r=Bn.inflateInit2(this.strm,e.windowBits);if(r!==_e.Z_OK)throw new Error(Xd[r]);if(this.header=new mB,Bn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=ec.string2buf(e.dictionary):CF.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Bn.inflateSetDictionary(this.strm,e.dictionary),r!==_e.Z_OK)))throw new Error(Xd[r])}a(Oi,"Inflate");Oi.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,o,s,l,f,c,u=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?_e.Z_FINISH:_e.Z_NO_FLUSH,typeof t=="string"?r.input=ec.binstring2buf(t):CF.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new cs.Buf8(i),r.next_out=0,r.avail_out=i),o=Bn.inflate(r,_e.Z_NO_FLUSH),o===_e.Z_NEED_DICT&&n&&(o=Bn.inflateSetDictionary(this.strm,n)),o===_e.Z_BUF_ERROR&&u===!0&&(o=_e.Z_OK,u=!1),o!==_e.Z_STREAM_END&&o!==_e.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===_e.Z_STREAM_END||r.avail_in===0&&(s===_e.Z_FINISH||s===_e.Z_SYNC_FLUSH))&&(this.options.to==="string"?(l=ec.utf8border(r.output,r.next_out),f=r.next_out-l,c=ec.buf2string(r.output,l),r.next_out=f,r.avail_out=i-f,f&&cs.arraySet(r.output,r.output,l,f,0),this.onData(c)):this.onData(cs.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==_e.Z_STREAM_END);return o===_e.Z_STREAM_END&&(s=_e.Z_FINISH),s===_e.Z_FINISH?(o=Bn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===_e.Z_OK):(s===_e.Z_SYNC_FLUSH&&(this.onEnd(_e.Z_OK),r.avail_out=0),!0)};Oi.prototype.onData=function(t){this.chunks.push(t)};Oi.prototype.onEnd=function(t){t===_e.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=cs.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Yd(t,e){var r=new Oi(e);if(r.push(t,!0),r.err)throw r.msg||Xd[r.err];return r.result}a(Yd,"inflate");function wB(t,e){return e=e||{},e.raw=!0,Yd(t,e)}a(wB,"inflateRaw");fs.Inflate=Oi;fs.inflate=Yd;fs.inflateRaw=wB;fs.ungzip=Yd});var $F=T((QU,LF)=>{"use strict";var yB=dr().assign,gB=j_(),bB=NF(),vB=Zd(),BF={};yB(BF,gB,bB,vB);LF.exports=BF});var UF=T((eH,jF)=>{"use strict";var MF=a((t,e)=>function(...r){let i=e.promiseModule;return new i((n,o)=>{e.multiArgs?r.push((...s)=>{e.errorFirst?s[0]?o(s):(s.shift(),n(s)):n(s)}):e.errorFirst?r.push((s,l)=>{s?o(s):n(l)}):r.push(n),t.apply(this,r)})},"processFn");jF.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let i=a(o=>{let s=a(l=>typeof l=="string"?o===l:l.test(o),"match");return e.include?e.include.some(s):!e.exclude.some(s)},"filter"),n;r==="function"?n=a(function(...o){return e.excludeMain?t(...o):MF(t,e).apply(this,o)},"ret"):n=Object.create(Object.getPrototypeOf(t));for(let o in t){let s=t[o];n[o]=typeof s=="function"&&i(o)?MF(s,e):s}return n}});var XF=T((rH,ZF)=>{function HF(t){return Array.isArray(t)?t:[t]}a(HF,"makeArray");var ep="",qF=" ",Jd="\\",_B=/^\s+$/,FB=/(?:[^\\]|^)\\$/,EB=/^\\!/,SB=/^\\#/,xB=/\r?\n/g,TB=/^\.*\/|^\.+$/,Qd="/",VF="node-ignore";typeof Symbol<"u"&&(VF=Symbol.for("node-ignore"));var zF=VF,OB=a((t,e,r)=>Object.defineProperty(t,e,{value:r}),"define"),RB=/([0-z])-([0-z])/g,GF=a(()=>!1,"RETURN_FALSE"),kB=a(t=>t.replace(RB,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:ep),"sanitizeRange"),PB=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),AB=[[/^\uFEFF/,()=>ep],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?qF:ep)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+qF}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,a(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Jd],[/\\\\/g,()=>Jd],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Jd?`\\[${r}${PB(i)}${n}`:n==="]"&&i.length%2===0?`[${kB(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],WF=Object.create(null),IB=a((t,e)=>{let r=WF[t];return r||(r=AB.reduce((i,[n,o])=>i.replace(n,o.bind(t)),t),WF[t]=r),e?new RegExp(r,"i"):new RegExp(r)},"makeRegex"),ip=a(t=>typeof t=="string","isString"),DB=a(t=>t&&ip(t)&&!_B.test(t)&&!FB.test(t)&&t.indexOf("#")!==0,"checkPattern"),CB=a(t=>t.split(xB),"splitPattern"),np=class np{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}};a(np,"IgnoreRule");var tp=np,NB=a((t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(EB,"!").replace(SB,"#");let n=IB(t,e);return new tp(r,t,i,n)},"createRule"),BB=a((t,e)=>{throw new e(t)},"throwError"),yr=a((t,e,r)=>ip(t)?t?yr.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),KF=a(t=>TB.test(t),"isNotRelative");yr.isNotRelative=KF;yr.convert=t=>t;var op=class op{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){OB(this,zF,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[zF]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(DB(e)){let r=NB(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,HF(ip(e)?CB(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(o=>{let{negative:s}=o;if(n===s&&i!==n||s&&!i&&!n&&!r)return;o.regex.test(e)&&(i=!s,n=s)}),{ignored:i,unignored:n}}_test(e,r,i,n){let o=e&&yr.convert(e);return yr(o,e,this._allowRelativePaths?GF:BB),this._t(o,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(Qd)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let o=this._t(n.join(Qd)+Qd,r,i,n);return r[e]=o.ignored?o:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return HF(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};a(op,"Ignore");var rp=op,tc=a(t=>new rp(t),"factory"),LB=a(t=>yr(t&&yr.convert(t),t,GF),"isPathValid");tc.isPathValid=LB;tc.default=tc;ZF.exports=tc;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=a(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");yr.convert=t;let e=/^[a-z]:\//i;yr.isNotRelative=r=>e.test(r)||KF(r)}});var JF=T((nH,YF)=>{"use strict";function $B(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a($B,"escapeRegExp");function rr(t,e,r){return e=e instanceof RegExp?e:new RegExp($B(e),"g"),t.replace(e,r)}a(rr,"replaceAll");var MB={clean:a(function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=rr(e,"./","/"),e=rr(e,"..","."),e=rr(e," ","-"),e=rr(e,/^[~^:?*\\\-]/g,""),e=rr(e,/[~^:?*\\]/g,"-"),e=rr(e,/[~^:?*\\\-]$/g,""),e=rr(e,"@{","-"),e=rr(e,/\.$/g,""),e=rr(e,/\/$/g,""),e=rr(e,/\.lock$/g,""),e},"clean")};YF.exports=MB});var eE=T((sH,QF)=>{"use strict";var jB=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;QF.exports=a(function(e,r){if(typeof e!="string")throw new TypeError("Reference name must be a string");return!jB.test(e)&&(!!r||e.includes("/"))},"validRef")});var rE=T((lH,tE)=>{tE.exports=function(t,e){var r=t,i=e,n=r.length,o=i.length,s=!1,l=null,f=n+1,c=[],u=[],h=[],d="",p=-1,m=0,w=1,y,v,g=a(function(){n>=o&&(y=r,v=n,r=i,i=y,n=o,o=v,s=!0,f=n+1)},"init"),F=a(function(b,x,_){return{x:b,y:x,k:_}},"P"),O=a(function(b,x){return{elem:b,t:x}},"seselem"),S=a(function(b,x,_){var P,k,C;for(x>_?P=c[b-1+f]:P=c[b+1+f],C=Math.max(x,_),k=C-b;k<n&&C<o&&r[k]===i[C];)++k,++C;return c[b+f]=u.length,u[u.length]=new F(k,C,P),C},"snake"),R=a(function(b){var x,_,P,k,C;for(x=_=1,P=k=0,C=b.length-1;C>=0;--C)for(;P<b[C].x||k<b[C].y;)b[C].y-b[C].x>k-P?(s?h[h.length]=new O(i[k],p):h[h.length]=new O(i[k],w),++_,++k):b[C].y-b[C].x<k-P?(s?h[h.length]=new O(r[P],w):h[h.length]=new O(r[P],p),++x,++P):(h[h.length]=new O(r[P],m),d+=r[P],++x,++_,++P,++k)},"recordseq");return g(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:a(function(){return l},"editdistance"),getlcs:a(function(){return d},"getlcs"),getses:a(function(){return h},"getses"),compose:a(function(){var b,x,_,P,k,C,N,U;for(b=o-n,x=n+o+3,_={},N=0;N<x;++N)_[N]=-1,c[N]=-1;P=-1;do{for(++P,U=-P;U<=b-1;++U)_[U+f]=S(U,_[U-1+f]+1,_[U+1+f]);for(U=b+P;U>=b+1;--U)_[U+f]=S(U,_[U-1+f]+1,_[U+1+f]);_[b+f]=S(b,_[b-1+f]+1,_[b+1+f])}while(_[b+f]!==o);for(l=b+2*P,k=c[b+f],C=[];k!==-1;)C[C.length]=new F(u[k].x,u[k].y,null),k=u[k].k;R(C)},"compose")}}});var oE=T((fH,nE)=>{var UB=rE();function HB(t,e){var r=new UB(t,e);r.compose();for(var i=r.getses(),n,o,s=t.length-1,l=e.length-1,f=i.length-1;f>=0;--f)i[f].t===r.SES_COMMON?(o?(o.chain={file1index:s,file2index:l,chain:null},o=o.chain):(n={file1index:s,file2index:l,chain:null},o=n),s--,l--):i[f].t===r.SES_DELETE?s--:i[f].t===r.SES_ADD&&l--;var c={file1index:-1,file2index:-1,chain:null};return o?(o.chain=c,n):c}a(HB,"longestCommonSubsequence");function iE(t,e){for(var r=[],i=t.length,n=e.length,o=HB(t,e);o!==null;o=o.chain){var s=i-o.file1index-1,l=n-o.file2index-1;i=o.file1index,n=o.file2index,(s||l)&&r.push({file1:[i+1,s],file2:[n+1,l]})}return r.reverse(),r}a(iE,"diffIndices");function qB(t,e,r){var i,n=iE(e,t),o=iE(e,r),s=[];function l(N,U){s.push([N.file1[0],U,N.file1[1],N.file2[0],N.file2[1]])}for(a(l,"addHunk"),i=0;i<n.length;i++)l(n[i],0);for(i=0;i<o.length;i++)l(o[i],2);s.sort(function(N,U){return N[0]-U[0]});var f=[],c=0;function u(N){N>c&&(f.push([1,c,N-c]),c=N)}a(u,"copyCommon");for(var h=0;h<s.length;h++){for(var d=h,p=s[h],m=p[0],w=m+p[2];h<s.length-1;){var y=s[h+1],v=y[0];if(v>w)break;w=Math.max(w,v+y[2]),h++}if(u(m),d==h)p[4]>0&&f.push([p[1],p[3],p[4]]);else{var g={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=h;i++){p=s[i];var F=p[1],O=g[F],S=p[0],R=S+p[2],b=p[3],x=b+p[4];O[0]=Math.min(b,O[0]),O[1]=Math.max(x,O[1]),O[2]=Math.min(S,O[2]),O[3]=Math.max(R,O[3])}var _=g[0][0]+(m-g[0][2]),P=g[0][1]+(w-g[0][3]),k=g[2][0]+(m-g[2][2]),C=g[2][1]+(w-g[2][3]);f.push([-1,_,P-_,m,w-m,k,C-k])}c=w}return u(e.length),f}a(qB,"diff3MergeIndices");function zB(t,e,r){var i=[],n=[t,e,r],o=qB(t,e,r),s=[];function l(){s.length&&i.push({ok:s}),s=[]}a(l,"flushOk");function f(p){for(var m=0;m<p.length;m++)s.push(p[m])}a(f,"pushOk");function c(p){if(p[2]!=p[6])return!0;for(var m=p[1],w=p[5],y=0;y<p[2];y++)if(t[y+m]!=r[y+w])return!0;return!1}a(c,"isTrueConflict");for(var u=0;u<o.length;u++){var h=o[u],d=h[0];d==-1?c(h)?(l(),i.push({conflict:{a:t.slice(h[1],h[1]+h[2]),aIndex:h[1],o:e.slice(h[3],h[3]+h[4]),oIndex:h[3],b:r.slice(h[5],h[5]+h[6]),bIndex:h[5]}})):f(n[0].slice(h[1],h[1]+h[2])):f(n[d].slice(h[1],h[1]+h[2]))}return l(),i}a(zB,"diff3Merge");nE.exports=zB});var Me=T(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});function vr(t){return t&&typeof t=="object"&&"default"in t?t.default:t}a(vr,"_interopDefault");var ds=vr(ev()),RE=vr(Zv()),D=Sr(),WB=vr(Yv()),Ap=vr($F()),sp=vr(UF()),VB=vr(XF()),ps=vr(JF()),ms=vr(eE()),GB=vr(oE()),pc=class pc extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let r=new pc(e.message);return r.code=e.code,r.data=e.data,r.caller=e.caller,r.stack=e.stack,r}get isIsomorphicGitError(){return!0}};a(pc,"BaseError");var re=pc,mc=class mc extends re{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=mc.code,this.data={filepaths:e}}};a(mc,"UnmergedPathsError");var ws=mc;ws.code="UnmergedPathsError";var wc=class wc extends re{constructor(e){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=wc.code,this.data={message:e}}};a(wc,"InternalError");var W=wc;W.code="InternalError";var yc=class yc extends re{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=yc.code,this.data={filepath:e}}};a(yc,"UnsafeFilepathError");var jn=yc;jn.code="UnsafeFilepathError";var $p=class $p{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};a($p,"BufferCursor");var St=$p;function Qc(t,e){return-(t<e)||+(t>e)}a(Qc,"compareStrings");function kE(t,e){return Qc(t.path,e.path)}a(kE,"comparePath");function PE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}a(PE,"normalizeMode");var ir=2**32;function sE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),o=(r-n*1e3)*1e6;return[n,o]}a(sE,"SecondsNanoseconds");function Un(t){let[e,r]=sE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=sE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%ir,ctimeNanoseconds:r%ir,mtimeSeconds:i%ir,mtimeNanoseconds:n%ir,dev:t.dev%ir,ino:t.ino%ir,mode:PE(t.mode%ir),uid:t.uid%ir,gid:t.gid%ir,size:t.size>-1?t.size%ir:0}}a(Un,"normalizeStats");function KB(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}a(KB,"toHex");var ap=null;async function br(t){return ap===null&&(ap=await XB()),ap?AE(t):ZB(t)}a(br,"shasum");function ZB(t){return new RE().update(t).digest("hex")}a(ZB,"shasumSync");async function AE(t){let e=await crypto.subtle.digest("SHA-1",t);return KB(e)}a(AE,"subtleSHA1");async function XB(){try{return await AE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch{}return!1}a(XB,"testSubtleSHA1");function YB(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}a(YB,"parseCacheEntryFlags");function JB(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}a(JB,"renderCacheEntryFlags");var Wr=class Wr{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(Buffer.isBuffer(e))return Wr.fromBuffer(e);if(e===null)return new Wr(null);throw new W("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new W("Index file is empty (.git/index)");let r=new Wr,i=new St(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new W(`Invalid dircache magic file number: ${n}`);let o=await br(e.slice(0,-20)),s=e.slice(-20).toString("hex");if(s!==o)throw new W(`Invalid checksum in GitIndex buffer: expected ${s} but saw ${o}`);let l=i.readUInt32BE();if(l!==2)throw new W(`Unsupported dircache version: ${l}`);let f=i.readUInt32BE(),c=0;for(;!i.eof()&&c<f;){let u={};u.ctimeSeconds=i.readUInt32BE(),u.ctimeNanoseconds=i.readUInt32BE(),u.mtimeSeconds=i.readUInt32BE(),u.mtimeNanoseconds=i.readUInt32BE(),u.dev=i.readUInt32BE(),u.ino=i.readUInt32BE(),u.mode=i.readUInt32BE(),u.uid=i.readUInt32BE(),u.gid=i.readUInt32BE(),u.size=i.readUInt32BE(),u.oid=i.slice(20).toString("hex");let h=i.readUInt16BE();u.flags=YB(h);let d=e.indexOf(0,i.tell()+1)-i.tell();if(d<1)throw new W(`Got a path length of: ${d}`);if(u.path=i.toString("utf8",d),u.path.includes("..\\")||u.path.includes("../"))throw new jn(u.path);let p=8-(i.tell()-12)%8;for(p===0&&(p=8);p--;){let m=i.readUInt8();if(m!==0)throw new W(`Expected 1-8 null characters but got '${m}' after ${u.path}`);if(i.eof())throw new W("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(kE)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=Un(r);let o=Buffer.from(e),s={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:e,oid:i,flags:{assumeValid:!1,extended:!1,stage:n,nameLength:o.length<4095?o.length:4095},stages:[]};this._addEntry(s),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let r of this._entries.keys())r.startsWith(e+"/")&&this._entries.delete(r);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(`
|
|
14
|
-
`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=Buffer.alloc(i),o=new
|
|
13
|
+
`+t),"printJson");ul.printJson=tC});var vb=O(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});var Ih=(Zf(),Fm(Kf));Ih.__exportStar(yb(),qo);Ih.__exportStar(gb(),qo);Ih.__exportStar(bb(),qo)});var _b=O(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.newNotAllowedError=qe.newTypeMismatchError=qe.newNotFoundError=qe.assertCanWrite=qe.assertName=qe.basename=qe.ctx=void 0;var rC=a((t={})=>({separator:"/",syncHandleAllowed:!1,mode:"read",...t}),"ctx");qe.ctx=rC;var iC=a((t,e)=>{t[t.length-1]===e&&(t=t.slice(0,-1));let r=t.lastIndexOf(e);return r===-1?t:t.slice(r+1)},"basename");qe.basename=iC;var nC=/^(\.{1,2})$|^(.*([\/\\]).*)$/,oC=a((t,e,r)=>{if(!t||nC.test(t))throw new TypeError(`Failed to execute '${e}' on '${r}': Name is not allowed.`)},"assertName");qe.assertName=oC;var sC=a(t=>{if(t!=="readwrite")throw new DOMException("The request is not allowed by the user agent or the platform in the current context.","NotAllowedError")},"assertCanWrite");qe.assertCanWrite=sC;var aC=a(()=>new DOMException("A requested file or directory could not be found at the time an operation was processed.","NotFoundError"),"newNotFoundError");qe.newNotFoundError=aC;var lC=a(()=>new DOMException("The path supplied exists, but was not an entry of requested type.","TypeMismatchError"),"newTypeMismatchError");qe.newTypeMismatchError=lC;var cC=a(()=>new DOMException("Permission not granted.","NotAllowedError"),"newNotAllowedError");qe.newNotAllowedError=cC});var Fb=O(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.toTreeSync=void 0;var fC=vb(),uC=_b(),hC=a((t,e={})=>{let r=e.separator||"/",i=e.dir||r;i[i.length-1]!==r&&(i+=r);let n=e.tab||"",o=e.depth??10,s=" (...)";if(o>0){let f=t.readdirSync(i,{withFileTypes:!0});s=(0,fC.printTree)(n,f.map(c=>u=>c.isDirectory()?(0,zo.toTreeSync)(t,{dir:i+c.name,depth:o-1,tab:u}):c.isSymbolicLink()?""+c.name+" \u2192 "+t.readlinkSync(i+c.name):""+c.name))}return(0,uC.basename)(i,r)+r+s},"toTreeSync");zo.toTreeSync=hC});var xb=O(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.getWriteFileOptions=j.writeFileDefaults=j.getRealpathOptsAndCb=j.getRealpathOptions=j.getStatfsOptsAndCb=j.getStatfsOptions=j.getStatOptsAndCb=j.getStatOptions=j.getAppendFileOptsAndCb=j.getAppendFileOpts=j.getOpendirOptsAndCb=j.getOpendirOptions=j.getReaddirOptsAndCb=j.getReaddirOptions=j.getReadFileOptions=j.getRmOptsAndCb=j.getRmdirOptions=j.getDefaultOptsAndCb=j.getDefaultOpts=j.optsDefaults=j.getMkdirOptions=void 0;j.getOptions=Sb;j.optsGenerator=hr;j.optsAndCbGenerator=gi;var hl=en(),dC=ho(),Ch=Dr(),Eb={mode:511,recursive:!1},pC=a(t=>typeof t=="number"?Object.assign({},Eb,{mode:t}):Object.assign({},Eb,t),"getMkdirOptions");j.getMkdirOptions=pC;var mC=a(t=>`Expected options to be either an object or a string, but got ${t} instead`,"ERRSTR_OPTS");function Sb(t,e){let r;if(e){let i=typeof e;switch(i){case"string":r=Object.assign({},t,{encoding:e});break;case"object":r=Object.assign({},t,e);break;default:throw TypeError(mC(i))}}else return t;return r.encoding!=="buffer"&&(0,dC.assertEncoding)(r.encoding),r}a(Sb,"getOptions");function hr(t){return e=>Sb(t,e)}a(hr,"optsGenerator");function gi(t){return(e,r)=>typeof e=="function"?[t(),e]:[t(e),(0,Ch.validateCallback)(r)]}a(gi,"optsAndCbGenerator");j.optsDefaults={encoding:"utf8"};j.getDefaultOpts=hr(j.optsDefaults);j.getDefaultOptsAndCb=gi(j.getDefaultOpts);var wC={recursive:!1},yC=a(t=>Object.assign({},wC,t),"getRmdirOptions");j.getRmdirOptions=yC;var gC=hr(j.optsDefaults);j.getRmOptsAndCb=gi(gC);var bC={flag:"r"};j.getReadFileOptions=hr(bC);var vC={encoding:"utf8",recursive:!1,withFileTypes:!1};j.getReaddirOptions=hr(vC);j.getReaddirOptsAndCb=gi(j.getReaddirOptions);var _C={encoding:"utf8",bufferSize:32,recursive:!1};j.getOpendirOptions=hr(_C);j.getOpendirOptsAndCb=gi(j.getOpendirOptions);var FC={encoding:"utf8",mode:438,flag:hl.FLAGS[hl.FLAGS.a]};j.getAppendFileOpts=hr(FC);j.getAppendFileOptsAndCb=gi(j.getAppendFileOpts);var EC={bigint:!1},SC=a((t={})=>Object.assign({},EC,t),"getStatOptions");j.getStatOptions=SC;var xC=a((t,e)=>typeof t=="function"?[(0,j.getStatOptions)(),t]:[(0,j.getStatOptions)(t),(0,Ch.validateCallback)(e)],"getStatOptsAndCb");j.getStatOptsAndCb=xC;var TC={bigint:!1},OC=a((t={})=>Object.assign({},TC,t),"getStatfsOptions");j.getStatfsOptions=OC;var kC=a((t,e)=>typeof t=="function"?[(0,j.getStatfsOptions)(),t]:[(0,j.getStatfsOptions)(t),(0,Ch.validateCallback)(e)],"getStatfsOptsAndCb");j.getStatfsOptsAndCb=kC;var RC=j.optsDefaults;j.getRealpathOptions=hr(RC);j.getRealpathOptsAndCb=gi(j.getRealpathOptions);j.writeFileDefaults={encoding:"utf8",mode:438,flag:hl.FLAGS[hl.FLAGS.w]};j.getWriteFileOptions=hr(j.writeFileDefaults)});var Ob=O(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.Dir=void 0;var Tb=Dr(),PC=Qs(),bi=uo(),Nh=class Nh{constructor(e,r){this.link=e,this.options=r,this.iteratorInfo=[],this.closed=!1,this.operationQueue=null,this.path=e.getPath(),this.iteratorInfo.push(e.children[Symbol.iterator]())}closeBase(){}readBase(e){let r,i,n,o;do{do if({done:r,value:i}=e[e.length-1].next(),!r)[n,o]=i;else break;while(n==="."||n==="..");if(r){if(e.pop(),e.length===0)break;r=!1}else return this.options.recursive&&o.children.size&&e.push(o.children[Symbol.iterator]()),PC.default.build(o,this.options.encoding)}while(!r);return null}close(e){if(e===void 0)return this.closed?Promise.reject(new bi.Error("ERR_DIR_CLOSED")):new Promise((r,i)=>{this.close(n=>{n?i(n):r()})});if((0,Tb.validateCallback)(e),this.closed){process.nextTick(e,new bi.Error("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.close(e)});return}this.closed=!0;try{this.closeBase(),process.nextTick(e)}catch(r){process.nextTick(e,r)}}closeSync(){if(this.closed)throw new bi.Error("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new bi.Error("ERR_DIR_CONCURRENT_OPERATION");this.closed=!0,this.closeBase()}read(e){if(e===void 0)return new Promise((r,i)=>{this.read((n,o)=>{n?i(n):r(o??null)})});if((0,Tb.validateCallback)(e),this.closed){process.nextTick(e,new bi.Error("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.read(e)});return}this.operationQueue=[];try{let r=this.readBase(this.iteratorInfo);process.nextTick(()=>{let i=this.operationQueue;this.operationQueue=null;for(let n of i)n();e(null,r)})}catch(r){process.nextTick(()=>{let i=this.operationQueue;this.operationQueue=null;for(let n of i)n();e(r)})}}readSync(){if(this.closed)throw new bi.Error("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new bi.Error("ERR_DIR_CONCURRENT_OPERATION");return this.readBase(this.iteratorInfo)}[Symbol.asyncIterator](){return{next:a(async()=>{try{let e=await this.read();return e!==null?{done:!1,value:e}:{done:!0,value:void 0}}catch(e){throw e}},"next"),[Symbol.asyncIterator](){return this}}}};a(Nh,"Dir");var Dh=Nh;dl.Dir=Dh});var kb=O(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.toMatcher=dr.toRegex=void 0;var AC=a(t=>/[.^$+{}()|\\]/.test(t)?`\\${t}`:t,"escapeRe"),IC=a((t,e,r,i)=>{let n=e,o=[],s="",l=1;for(;n<t.length&&l>0;){let u=t[n];if(u==="(")l++,s+=u,n++;else if(u===")")if(l--,l===0){o.push(s),n++;break}else s+=u,n++;else u==="|"&&l===1?(o.push(s),s="",n++):(s+=u,n++)}if(l!==0)return;let f="",c=o.length;for(let u=0;u<c;u++)f+=(f?"|":"")+(0,dr.toRegex)(o[u],i).source.replace(/^\^/,"").replace(/\$$/,"");switch(r){case"?":return[`(?:${f})?`,n];case"*":return[`(?:${f})*`,n];case"+":return[`(?:${f})+`,n];case"@":return[`(?:${f})`,n];case"!":return[`(?!${f})[^/]*`,n]}},"parseExtGlob"),CC=a((t,e)=>{let r="",i=0,n=a(()=>{i++;let l=[],f="",c=!1;for(;i<t.length;){let h=t[i];if(h==="}"){l.push(f),i++,c=!0;break}if(h===","){l.push(f),f="",i++;continue}f+=h,i++}return c?`(?:${l.map(h=>(0,dr.toRegex)(h,e).source.replace(/^\^/,"").replace(/\$$/,"")).join("|")})`:"\\{"+AC(f)},"parseBraceGroup"),o=!!e?.extglob;for(;i<t.length;){let l=t[i];if(o&&t[i+1]==="("&&(l==="?"||l==="*"||l==="+"||l==="@"||l==="!")){let f=IC(t,i+2,l,e);if(f){r+=f[0],i=f[1];continue}}switch(l){case"*":{if(t[i+1]==="*"){let f=i+2;for(;t[f]==="*";)f++;t[f]==="/"?(r+="(?:.*/)?",i=f+1):(r+=".*",i=f)}else r+="[^/]*",i++;break}case"?":r+="[^/]",i++;break;case"[":{let f="[";for(i++,i<t.length&&t[i]==="!"&&(f+="^",i++),i<t.length&&t[i]==="]"&&(f+="]",i++);i<t.length&&t[i]!=="]";){let c=t[i];f+=c==="\\"?"\\\\":c,i++}if(i<t.length&&t[i]==="]")f+="]",i++;else{r+="\\[";continue}r+=f;break}case"{":{r+=n();break}case"/":r+="/",i++;break;case".":case"^":case"$":case"+":case"(":case")":case"|":case"\\":r+=`\\${l}`,i++;break;default:r+=l,i++;break}}let s=e?.nocase?"i":"";return new RegExp("^"+r+"$",s)},"toRegex");dr.toRegex=CC;var DC=/^\/(.{1,4096})\/([gimsuy]{0,6})$/,NC=a((t,e)=>{let r=[],i=Array.isArray(t)?t:[t];for(let n of i)if(typeof n=="string"){let o=DC.exec(n);if(o){let[,s,l]=o;r.push(new RegExp(s,l))}else r.push((0,dr.toRegex)(n,e))}else r.push(n);return r.length?new Function("p","return "+r.map(n=>n+".test(p)").join("||")):()=>!1},"toMatcher");dr.toMatcher=NC});var Ab=O(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.globSync=UC;var vi=Xi(),BC=kb(),Rb=Dr(),LC=vi.posix.join,$C=vi.posix.relative,MC=vi.posix.resolve;function Pb(t,e){return(0,BC.toRegex)(e).test(t)}a(Pb,"matchesPattern");function jC(t,e){return e?typeof e=="function"?e(t):(Array.isArray(e)?e:[e]).some(i=>Pb(t,i)):!1}a(jC,"isExcluded");function Bh(t,e,r,i,n=0){let o=[],s=i.maxdepth??1/0,l=i.cwd?(0,Rb.pathToFilename)(i.cwd):process.cwd();if(n>s)return o;try{let f=t.readdirSync(e,{withFileTypes:!0});for(let c of f){let u=LC(e,c.name.toString()),h=$C(l,u);if(jC(h,i.exclude))continue;if(r.some(p=>Pb(h,p))&&o.push(h),c.isDirectory()&&n<s){let p=Bh(t,u,r,i,n+1);o.push(...p)}}}catch{}return o}a(Bh,"walkDirectory");function UC(t,e,r={}){let i=r.cwd?(0,Rb.pathToFilename)(r.cwd):process.cwd(),n=MC(i),o={cwd:n,exclude:r.exclude,maxdepth:r.maxdepth,withFileTypes:r.withFileTypes||!1},s=[];if(vi.posix.isAbsolute(e)){let l=vi.posix.dirname(e),f=vi.posix.basename(e),c=Bh(t,l,[f],{...o,cwd:l});s.push(...c.map(u=>vi.posix.resolve(l,u)))}else{let l=Bh(t,n,[e],o);s.push(...l)}return s=[...new Set(s)].sort(),s}a(UC,"globSync")});var $b=O(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.FSWatcher=lt.StatWatcher=lt.Volume=void 0;lt.pathToSteps=nD;lt.dataToStr=oD;lt.toUnixTimestamp=at;var xe=Xi(),Uh=eg(),$h=Of(),HC=Qs(),qC=tg(),Sn=Rr(),gl=fu(),zC=rg(),bl=pb(),WC=At(),Nb=xh(),_i=ho(),VC=mb(),Bb=Mf(),GC=wb(),KC=Fb(),ml=en(),ZC=uo(),re=xb(),I=Dr(),XC=Ob(),$e=ba(),YC=xe.resolve,{O_SYMLINK:Ib,F_OK:Mh,R_OK:JC,W_OK:QC,X_OK:eD,COPYFILE_EXCL:tD,COPYFILE_FICLONE_FORCE:rD}=WC.constants,u4=xe.posix?xe.posix.sep:xe.sep,pl=xe.posix?xe.posix.relative:xe.relative,jh=xe.posix?xe.posix.join:xe.join,Cb=xe.posix?xe.posix.dirname:xe.dirname,Db=xe.posix?xe.posix.normalize:xe.normalize,iD=128;function nD(t){return(0,$e.filenameToSteps)((0,I.pathToFilename)(t))}a(nD,"pathToSteps");function oD(t,e=_i.ENCODING_UTF8){return Sn.Buffer.isBuffer(t)?t.toString(e):t instanceof Uint8Array?(0,Sn.bufferFrom)(t).toString(e):String(t)}a(oD,"dataToStr");function at(t){if(typeof t=="string"&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return t<0?Date.now()/1e3:t;throw new Error("Cannot parse time: "+t)}a(at,"toUnixTimestamp");function Fn(t){if(typeof t!="number")throw TypeError(ml.ERRSTR.UID)}a(Fn,"validateUid");function En(t){if(typeof t!="number")throw TypeError(ml.ERRSTR.GID)}a(En,"validateGid");var Hh=class Hh{get promises(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi}constructor(e=new Uh.Superblock){this._core=e,this.promisesApi=new GC.FsPromises(this,VC.FileHandle),this.openSync=(f,c,u=438)=>{let h=(0,I.modeToNumber)(u),d=(0,I.pathToFilename)(f),p=(0,I.flagsToNumber)(c);return this._core.open(d,p,h,!(p&Ib))},this.open=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&(d=438,p=u),d=d||438;let m=(0,I.modeToNumber)(d),w=(0,I.pathToFilename)(f),y=(0,I.flagsToNumber)(c);this.wrapAsync(this._core.open,[w,y,m,!(y&Ib)],p)},this.closeSync=f=>{this._core.close(f)},this.close=(f,c)=>{(0,$e.validateFd)(f);let u=this._core.getFileByFdOrThrow(f,"close");this.wrapAsync(this._core.close,[u.fd],c)},this.readSync=(f,c,u,h,d)=>((0,$e.validateFd)(f),this._core.read(f,c,u,h,d)),this.read=(f,c,u,h,d,p)=>{if((0,I.validateCallback)(p),h===0)return(0,gl.default)(()=>{p&&p(null,0,c)});Promise.resolve().then(()=>{try{let m=this._core.read(f,c,u,h,d);p(null,m,c)}catch(m){p(m)}})},this.readv=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[null,u]),(0,I.validateCallback)(p),Promise.resolve().then(()=>{try{let m=this._core.readv(f,c,d);p(null,m,c)}catch(m){p(m)}})},this.readvSync=(f,c,u)=>((0,$e.validateFd)(f),this._core.readv(f,c,u??null)),this._readfile=(f,c,u)=>{let h,p=typeof f=="number"&&(0,$e.isFd)(f),m;if(p)m=f;else{let w=(0,I.pathToFilename)(f),y=String(f),v=y.length>1&&y.endsWith("/"),g=this._core.getResolvedLinkOrThrow(w,"open"),_=g.getNode();if(_.isDirectory())throw(0,I.createError)("EISDIR","open",g.getPath());if(v&&_.isFile())throw(0,I.createError)("ENOTDIR","open",y);m=this.openSync(f,c)}try{h=(0,I.bufferToEncoding)(this._core.getFileByFdOrThrow(m).getBuffer(),u)}finally{p||this.closeSync(m)}return h},this.readFileSync=(f,c)=>{let u=(0,re.getReadFileOptions)(c),h=(0,I.flagsToNumber)(u.flag);return this._readfile(f,h,u.encoding)},this.readFile=(f,c,u)=>{let[h,d]=(0,re.optsAndCbGenerator)(re.getReadFileOptions)(c,u),p=(0,I.flagsToNumber)(h.flag);this.wrapAsync(this._readfile,[f,p,h.encoding],d)},this.writeSync=(f,c,u,h,d)=>{let[,p,m,w,y]=(0,I.getWriteSyncArgs)(f,c,u,h,d);return this._write(f,p,m,w,y)},this.write=(f,c,u,h,d,p)=>{let[,m,w,y,v,g,_]=(0,I.getWriteArgs)(f,c,u,h,d,p);Promise.resolve().then(()=>{try{let E=this._write(f,w,y,v,g);m?_(null,E,c):_(null,E,w)}catch(E){_(E)}})},this.writev=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[null,u]),(0,I.validateCallback)(p),Promise.resolve().then(()=>{try{let m=this.writevBase(f,c,d);p(null,m,c)}catch(m){p(m)}})},this.writevSync=(f,c,u)=>((0,$e.validateFd)(f),this.writevBase(f,c,u??null)),this.writeFileSync=(f,c,u)=>{let h=(0,re.getWriteFileOptions)(u),d=(0,I.flagsToNumber)(h.flag),p=(0,I.modeToNumber)(h.mode),m=(0,$e.dataToBuffer)(c,h.encoding);this._core.writeFile(f,m,d,p)},this.writeFile=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[re.writeFileDefaults,u]);let m=(0,I.validateCallback)(p),w=(0,re.getWriteFileOptions)(d),y=(0,I.flagsToNumber)(w.flag),v=(0,I.modeToNumber)(w.mode),g=(0,$e.dataToBuffer)(c,w.encoding);this.wrapAsync(this._core.writeFile,[f,g,y,v],m)},this.copyFileSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);return this._copyFile(h,d,(u||0)|0)},this.copyFile=(f,c,u,h)=>{let d=(0,I.pathToFilename)(f),p=(0,I.pathToFilename)(c),m,w;typeof u=="function"?[m,w]=[0,u]:[m,w]=[u,h],(0,I.validateCallback)(w),this.wrapAsync(this._copyFile,[d,p,m],w)},this._cp=(f,c,u)=>{if(u.filter&&!u.filter(f,c))return;let h=u.dereference?this.statSync(f):this.lstatSync(f),d=null;try{d=this.lstatSync(c)}catch(p){if(p.code!=="ENOENT")throw p}if(d&&h.ino===d.ino&&h.dev===d.dev)throw(0,I.createError)("EINVAL","cp",f,c);if(d){if(h.isDirectory()&&!d.isDirectory())throw(0,I.createError)("EISDIR","cp",f,c);if(!h.isDirectory()&&d.isDirectory())throw(0,I.createError)("ENOTDIR","cp",f,c)}if(h.isDirectory()&&this.isSrcSubdir(f,c))throw(0,I.createError)("EINVAL","cp",f,c);{let p=Cb(c);this.existsSync(p)||this.mkdirSync(p,{recursive:!0})}if(h.isDirectory()){if(!u.recursive)throw(0,I.createError)("EISDIR","cp",f);this.cpDirSync(h,d,f,c,u)}else if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())this.cpFileSync(h,d,f,c,u);else if(h.isSymbolicLink()&&!u.dereference)this.cpSymlinkSync(d,f,c,u);else throw(0,I.createError)("EINVAL","cp",f)},this.linkSync=(f,c)=>{let u=(0,I.pathToFilename)(f),h=(0,I.pathToFilename)(c);this._core.link(u,h)},this.link=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this.wrapAsync(this._core.link,[h,d],u)},this.unlinkSync=f=>{let c=(0,I.pathToFilename)(f);this._core.unlink(c)},this.unlink=(f,c)=>{let u=(0,I.pathToFilename)(f);this.wrapAsync(this._core.unlink,[u],c)},this.symlinkSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this._core.symlink(h,d)},this.symlink=(f,c,u,h)=>{let d=(0,I.validateCallback)(typeof u=="function"?u:h),p=(0,I.pathToFilename)(f),m=(0,I.pathToFilename)(c);this.wrapAsync(this._core.symlink,[p,m],d)},this._lstat=(f,c=!1,u=!1)=>{let h;try{h=this._core.getLinkOrThrow(f,"lstat")}catch(d){if(d.code==="ENOENT"&&!u)return;throw d}return $h.default.build(h.getNode(),c)},this.lstatSync=(f,c)=>{let{throwIfNoEntry:u=!0,bigint:h=!1}=(0,re.getStatOptions)(c);return this._lstat((0,I.pathToFilename)(f),h,u)},this.renameSync=(f,c)=>{let u=(0,I.pathToFilename)(f),h=(0,I.pathToFilename)(c);this._core.rename(u,h)},this.rename=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this.wrapAsync(this._core.rename,[h,d],u)},this.existsSync=f=>{try{return this._exists((0,I.pathToFilename)(f))}catch{return!1}},this.exists=(f,c)=>{let u=(0,I.pathToFilename)(f);if(typeof c!="function")throw Error(ml.ERRSTR.CB);Promise.resolve().then(()=>{try{c(this._exists(u))}catch{c(!1)}})},this.accessSync=(f,c=Mh)=>{let u=(0,I.pathToFilename)(f);c=c|0,this._access(u,c)},this.access=(f,c,u)=>{let h=Mh,d;typeof c!="function"?[h,d]=[c|0,(0,I.validateCallback)(u)]:d=c;let p=(0,I.pathToFilename)(f);this.wrapAsync(this._access,[p,h],d)},this.appendFileSync=(f,c,u)=>{let h=(0,re.getAppendFileOpts)(u);(!h.flag||(0,$e.isFd)(f))&&(h.flag="a"),this.writeFileSync(f,c,h)},this.appendFile=(f,c,u,h)=>{let[d,p]=(0,re.getAppendFileOptsAndCb)(u,h);(!d.flag||(0,$e.isFd)(f))&&(d.flag="a"),this.writeFile(f,c,d,p)},this._readdir=(f,c)=>{let u=(0,$e.filenameToSteps)(f),h=this._core.getResolvedLinkOrThrow(f,"scandir"),d=h.getNode();if(!d.isDirectory())throw(0,I.createError)("ENOTDIR","scandir",f);if(!d.canRead())throw(0,I.createError)("EACCES","scandir",f);let p=[];for(let w of h.children.keys()){let y=h.getChild(w);if(!(!y||w==="."||w==="..")&&(p.push(HC.default.build(y,c.encoding)),c.recursive&&y.children.size)){let v={...c,recursive:!0,withFileTypes:!0},g=this._readdir(y.getPath(),v);p.push(...g)}}if(!$e.isWin&&c.encoding!=="buffer"&&p.sort((w,y)=>w.name<y.name?-1:w.name>y.name?1:0),c.withFileTypes)return p;let m=f;return $e.isWin&&(m=m.replace(/\\/g,"/")),p.map(w=>{if(c.recursive){let y=jh(w.parentPath,w.name.toString());return $e.isWin&&(y=y.replace(/\\/g,"/")),y.replace(m+xe.posix.sep,"")}return w.name})},this.readdirSync=(f,c)=>{let u=(0,re.getReaddirOptions)(c),h=(0,I.pathToFilename)(f);return this._readdir(h,u)},this.readdir=(f,c,u)=>{let[h,d]=(0,re.getReaddirOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._readdir,[p,h],d)},this._readlink=(f,c)=>{let h=this._core.getLinkOrThrow(f,"readlink").getNode();if(!h.isSymlink())throw(0,I.createError)("EINVAL","readlink",f);return(0,_i.strToEncoding)(h.symlink,c)},this.readlinkSync=(f,c)=>{let u=(0,re.getDefaultOpts)(c),h=(0,I.pathToFilename)(f);return this._readlink(h,u.encoding)},this.readlink=(f,c,u)=>{let[h,d]=(0,re.getDefaultOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._readlink,[p,h.encoding],d)},this._fsync=f=>{this._core.getFileByFdOrThrow(f,"fsync")},this.fsyncSync=f=>{this._fsync(f)},this.fsync=(f,c)=>{this.wrapAsync(this._fsync,[f],c)},this._fdatasync=f=>{this._core.getFileByFdOrThrow(f,"fdatasync")},this.fdatasyncSync=f=>{this._fdatasync(f)},this.fdatasync=(f,c)=>{this.wrapAsync(this._fdatasync,[f],c)},this._ftruncate=(f,c)=>{this._core.getFileByFdOrThrow(f,"ftruncate").truncate(c)},this.ftruncateSync=(f,c)=>{this._ftruncate(f,c)},this.ftruncate=(f,c,u)=>{let h=typeof c=="number"?c:0,d=(0,I.validateCallback)(typeof c=="number"?u:c);this.wrapAsync(this._ftruncate,[f,h],d)},this._truncate=(f,c)=>{let u=this.openSync(f,"r+");try{this.ftruncateSync(u,c)}finally{this.closeSync(u)}},this.truncateSync=(f,c)=>{if((0,$e.isFd)(f))return this.ftruncateSync(f,c);this._truncate(f,c)},this.truncate=(f,c,u)=>{let h=typeof c=="number"?c:0,d=(0,I.validateCallback)(typeof c=="number"?u:c);if((0,$e.isFd)(f))return this.ftruncate(f,h,d);this.wrapAsync(this._truncate,[f,h],d)},this._futimes=(f,c,u)=>{let d=this._core.getFileByFdOrThrow(f,"futimes").node;d.atime=new Date(c*1e3),d.mtime=new Date(u*1e3)},this.futimesSync=(f,c,u)=>{this._futimes(f,at(c),at(u))},this.futimes=(f,c,u,h)=>{this.wrapAsync(this._futimes,[f,at(c),at(u)],h)},this._utimes=(f,c,u,h=!0)=>{let d=this._core,m=(h?d.getResolvedLinkOrThrow(f,"utimes"):d.getLinkOrThrow(f,"lutimes")).getNode();m.atime=new Date(c*1e3),m.mtime=new Date(u*1e3)},this.utimesSync=(f,c,u)=>{this._utimes((0,I.pathToFilename)(f),at(c),at(u),!0)},this.utimes=(f,c,u,h)=>{this.wrapAsync(this._utimes,[(0,I.pathToFilename)(f),at(c),at(u),!0],h)},this.lutimesSync=(f,c,u)=>{this._utimes((0,I.pathToFilename)(f),at(c),at(u),!1)},this.lutimes=(f,c,u,h)=>{this.wrapAsync(this._utimes,[(0,I.pathToFilename)(f),at(c),at(u),!1],h)},this.mkdirSync=(f,c)=>{let u=(0,re.getMkdirOptions)(c),h=(0,I.modeToNumber)(u.mode,511),d=(0,I.pathToFilename)(f);if(u.recursive)return this._core.mkdirp(d,h);this._core.mkdir(d,h)},this.mkdir=(f,c,u)=>{let h=(0,re.getMkdirOptions)(c),d=(0,I.validateCallback)(typeof c=="function"?c:u),p=(0,I.modeToNumber)(h.mode,511),m=(0,I.pathToFilename)(f);h.recursive?this.wrapAsync(this._core.mkdirp,[m,p],d):this.wrapAsync(this._core.mkdir,[m,p],d)},this._mkdtemp=(f,c,u=5)=>{let h=f+(0,I.genRndStr6)();try{return this._core.mkdir(h,511),(0,_i.strToEncoding)(h,c)}catch(d){if(d.code==="EEXIST"){if(u>1)return this._mkdtemp(f,c,u-1);throw Error("Could not create temp dir.")}else throw d}},this.mkdtempSync=(f,c)=>{let{encoding:u}=(0,re.getDefaultOpts)(c);if(!f||typeof f!="string")throw new TypeError("filename prefix is required");return(0,I.nullCheck)(f),this._mkdtemp(f,u)},this.mkdtemp=(f,c,u)=>{let[{encoding:h},d]=(0,re.getDefaultOptsAndCb)(c,u);if(!f||typeof f!="string")throw new TypeError("filename prefix is required");(0,I.nullCheck)(f)&&this.wrapAsync(this._mkdtemp,[f,h],d)},this.rmdirSync=(f,c)=>{let u=(0,re.getRmdirOptions)(c);this._core.rmdir((0,I.pathToFilename)(f),u.recursive)},this.rmdir=(f,c,u)=>{let h=(0,re.getRmdirOptions)(c),d=(0,I.validateCallback)(typeof c=="function"?c:u);this.wrapAsync(this._core.rmdir,[(0,I.pathToFilename)(f),h.recursive],d)},this.rmSync=(f,c)=>{this._core.rm((0,I.pathToFilename)(f),c?.force,c?.recursive)},this.rm=(f,c,u)=>{let[h,d]=(0,re.getRmOptsAndCb)(c,u);this.wrapAsync(this._core.rm,[(0,I.pathToFilename)(f),h?.force,h?.recursive],d)},this._fchmod=(f,c)=>{this._core.getFileByFdOrThrow(f,"fchmod").chmod(c)},this.fchmodSync=(f,c)=>{this._fchmod(f,(0,I.modeToNumber)(c))},this.fchmod=(f,c,u)=>{this.wrapAsync(this._fchmod,[f,(0,I.modeToNumber)(c)],u)},this._chmod=(f,c,u=!0)=>{(u?this._core.getResolvedLinkOrThrow(f,"chmod"):this._core.getLinkOrThrow(f,"chmod")).getNode().chmod(c)},this.chmodSync=(f,c)=>{let u=(0,I.modeToNumber)(c),h=(0,I.pathToFilename)(f);this._chmod(h,u,!0)},this.chmod=(f,c,u)=>{let h=(0,I.modeToNumber)(c),d=(0,I.pathToFilename)(f);this.wrapAsync(this._chmod,[d,h],u)},this._lchmod=(f,c)=>{this._chmod(f,c,!1)},this.lchmodSync=(f,c)=>{let u=(0,I.modeToNumber)(c),h=(0,I.pathToFilename)(f);this._lchmod(h,u)},this.lchmod=(f,c,u)=>{let h=(0,I.modeToNumber)(c),d=(0,I.pathToFilename)(f);this.wrapAsync(this._lchmod,[d,h],u)},this._fchown=(f,c,u)=>{this._core.getFileByFdOrThrow(f,"fchown").chown(c,u)},this.fchownSync=(f,c,u)=>{Fn(c),En(u),this._fchown(f,c,u)},this.fchown=(f,c,u,h)=>{Fn(c),En(u),this.wrapAsync(this._fchown,[f,c,u],h)},this._chown=(f,c,u)=>{this._core.getResolvedLinkOrThrow(f,"chown").getNode().chown(c,u)},this.chownSync=(f,c,u)=>{Fn(c),En(u),this._chown((0,I.pathToFilename)(f),c,u)},this.chown=(f,c,u,h)=>{Fn(c),En(u),this.wrapAsync(this._chown,[(0,I.pathToFilename)(f),c,u],h)},this._lchown=(f,c,u)=>{this._core.getLinkOrThrow(f,"lchown").getNode().chown(c,u)},this.lchownSync=(f,c,u)=>{Fn(c),En(u),this._lchown((0,I.pathToFilename)(f),c,u)},this.lchown=(f,c,u,h)=>{Fn(c),En(u),this.wrapAsync(this._lchown,[(0,I.pathToFilename)(f),c,u],h)},this.statWatchers={},this.cpSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c),p={dereference:u?.dereference??!1,errorOnExist:u?.errorOnExist??!1,filter:u?.filter,force:u?.force??!0,mode:u?.mode??0,preserveTimestamps:u?.preserveTimestamps??!1,recursive:u?.recursive??!1,verbatimSymlinks:u?.verbatimSymlinks??!1};return this._cp(h,d,p)},this.cp=(f,c,u,h)=>{let d=(0,I.pathToFilename)(f),p=(0,I.pathToFilename)(c),m,w;typeof u=="function"?[m,w]=[{},u]:[m,w]=[u||{},h],(0,I.validateCallback)(w);let y={dereference:m?.dereference??!1,errorOnExist:m?.errorOnExist??!1,filter:m?.filter,force:m?.force??!0,mode:m?.mode??0,preserveTimestamps:m?.preserveTimestamps??!1,recursive:m?.recursive??!1,verbatimSymlinks:m?.verbatimSymlinks??!1};this.wrapAsync(this._cp,[d,p,y],w)},this.openAsBlob=async(f,c)=>{let u=(0,I.pathToFilename)(f),h;try{h=this._core.getResolvedLinkOrThrow(u,"open")}catch(w){throw w&&typeof w=="object"&&w.code==="ENOENT"?new ZC.TypeError("ERR_INVALID_ARG_VALUE"):w}let p=h.getNode().getBuffer(),m=c?.type||"";return new Blob([p],{type:m})},this.glob=(f,...c)=>{let[u,h]=c.length===1?[{},c[0]]:[c[0],c[1]];this.wrapAsync(this._globSync,[f,u||{}],h)},this.globSync=(f,c={})=>this._globSync(f,c),this._globSync=(f,c={})=>{let{globSync:u}=Ab();return u(this,f,c)},this._opendir=(f,c)=>{let u=this._core.getResolvedLinkOrThrow(f,"scandir");if(!u.getNode().isDirectory())throw(0,I.createError)("ENOTDIR","scandir",f);return new XC.Dir(u,c)},this.opendirSync=(f,c)=>{let u=(0,re.getOpendirOptions)(c),h=(0,I.pathToFilename)(f);return this._opendir(h,u)},this.opendir=(f,c,u)=>{let[h,d]=(0,re.getOpendirOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._opendir,[p,h],d)};let r=this;this.StatWatcher=class extends wl{constructor(){super(r)}};let i=Jt;this.ReadStream=class extends i{constructor(...f){super(r,...f)}};let n=_t;this.WriteStream=class extends n{constructor(...f){super(r,...f)}},this.FSWatcher=class extends yl{constructor(){super(r)}};let o=a((f,c)=>{let u=this._core.getResolvedLinkOrThrow(f,"realpath");return(0,_i.strToEncoding)(u.getPath()||"/",c)},"_realpath"),s=a((f,c,u)=>{let[h,d]=(0,re.getRealpathOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);r.wrapAsync(o,[p,h.encoding],d)},"realpathImpl"),l=a((f,c)=>o((0,I.pathToFilename)(f),(0,re.getRealpathOptions)(c).encoding),"realpathSyncImpl");this.realpath=s,this.realpath.native=s,this.realpathSync=l,this.realpathSync.native=l}wrapAsync(e,r,i){(0,I.validateCallback)(i),Promise.resolve().then(()=>{let n;try{n=e.apply(this,r)}catch(o){i(o);return}i(null,n)})}toTree(e={separator:xe.sep}){return(0,KC.toTreeSync)(this,e)}reset(){this._core.reset()}toJSON(e,r={},i=!1,n=!1){return this._core.toJSON(e,r,i,n)}fromJSON(e,r){return this._core.fromJSON(e,r)}fromNestedJSON(e,r){return this._core.fromNestedJSON(e,r)}mountSync(e,r){this._core.fromJSON(r,e)}_write(e,r,i,n,o){let s=this._core.getFileByFdOrThrow(e,"write");if(s.node.isSymlink())throw(0,I.createError)("EBADF","write",s.link.getPath());return s.write(r,i,n,o===-1||typeof o!="number"?void 0:o)}writevBase(e,r,i){let n=this._core.getFileByFdOrThrow(e),o=i??void 0;o===-1&&(o=void 0);let s=0;for(let l of r){let f=Sn.Buffer.from(l.buffer,l.byteOffset,l.byteLength),c=n.write(f,0,f.byteLength,o);if(o=void 0,s+=c,c<f.byteLength)break}return s}_copyFile(e,r,i){let n=this.readFileSync(e);if(i&tD&&this.existsSync(r))throw(0,I.createError)("EEXIST","copyFile",e,r);if(i&rD)throw(0,I.createError)("ENOSYS","copyFile",e,r);this._core.writeFile(r,n,ml.FLAGS.w,438)}isSrcSubdir(e,r){try{let i=Db(e.startsWith("/")?e:"/"+e),n=Db(r.startsWith("/")?r:"/"+r);if(i===n)return!0;let o=pl(i,n);return o===""||!o.startsWith("..")&&!(0,xe.isAbsolute)(o)}catch{return!1}}cpFileSync(e,r,i,n,o){if(r){if(o.errorOnExist)throw(0,I.createError)("EEXIST","cp",n);if(!o.force)return;this.unlinkSync(n)}this.copyFileSync(i,n,o.mode),o.preserveTimestamps&&this.utimesSync(n,e.atime,e.mtime),this.chmodSync(n,Number(e.mode))}cpDirSync(e,r,i,n,o){r||this.mkdirSync(n);let s=this.readdirSync(i);for(let l of s){let f=jh(i,String(l)),c=jh(n,String(l));o.filter&&!o.filter(f,c)||this._cp(f,c,o)}this.chmodSync(n,Number(e.mode))}cpSymlinkSync(e,r,i,n){let o=String(this.readlinkSync(r));!n.verbatimSymlinks&&!(0,xe.isAbsolute)(o)&&(o=YC(Cb(r),o)),e&&this.unlinkSync(i),this.symlinkSync(o,i)}lstat(e,r,i){let[{throwIfNoEntry:n=!0,bigint:o=!1},s]=(0,re.getStatOptsAndCb)(r,i);this.wrapAsync(this._lstat,[(0,I.pathToFilename)(e),o,n],s)}_stat(e,r=!1,i=!0){let n;try{n=this._core.getResolvedLinkOrThrow(e,"stat")}catch(o){if(o.code==="ENOENT"&&!i)return;throw o}return $h.default.build(n.getNode(),r)}statSync(e,r){let{bigint:i=!0,throwIfNoEntry:n=!0}=(0,re.getStatOptions)(r);return this._stat((0,I.pathToFilename)(e),i,n)}stat(e,r,i){let[{bigint:n=!1,throwIfNoEntry:o=!0},s]=(0,re.getStatOptsAndCb)(r,i);this.wrapAsync(this._stat,[(0,I.pathToFilename)(e),n,o],s)}fstatBase(e,r=!1){let i=this._core.getFileByFd(e);if(!i)throw(0,I.createError)("EBADF","fstat");return $h.default.build(i.node,r)}fstatSync(e,r){return this.fstatBase(e,(0,re.getStatOptions)(r).bigint)}fstat(e,r,i){let[n,o]=(0,re.getStatOptsAndCb)(r,i);this.wrapAsync(this.fstatBase,[e,n.bigint],o)}_exists(e){return!!this._stat(e)}_access(e,r){let n=this._core.getLinkOrThrow(e,"access").getNode();if(r!==Mh&&(r&JC&&!n.canRead()||r&QC&&!n.canWrite()||r&eD&&!n.canExecute()))throw(0,I.createError)("EACCES","access",e)}watchFile(e,r,i){let n=(0,I.pathToFilename)(e),o=r,s=i;if(typeof o=="function"&&(s=r,o=null),typeof s!="function")throw Error('"watchFile()" requires a listener function');let l=5007,f=!0;o&&typeof o=="object"&&(typeof o.interval=="number"&&(l=o.interval),typeof o.persistent=="boolean"&&(f=o.persistent));let c=this.statWatchers[n];return c||(c=new this.StatWatcher,c.start(n,f,l),this.statWatchers[n]=c),c.addListener("change",s),c}unwatchFile(e,r){let i=(0,I.pathToFilename)(e),n=this.statWatchers[i];n&&(typeof r=="function"?n.removeListener("change",r):n.removeAllListeners("change"),n.listenerCount("change")===0&&(n.stop(),delete this.statWatchers[i]))}createReadStream(e,r){return new this.ReadStream(e,r)}createWriteStream(e,r){return new this.WriteStream(e,r)}watch(e,r,i){let n=(0,I.pathToFilename)(e),o=r;typeof r=="function"&&(i=r,o=null);let{persistent:s,recursive:l,encoding:f}=(0,re.getDefaultOpts)(o);s===void 0&&(s=!0),l===void 0&&(l=!1);let c=new this.FSWatcher;return c.start(n,s,l,f),i&&c.addListener("change",i),c}_statfs(e,r=!1){return this._core.getResolvedLinkOrThrow(e,"statfs"),qC.default.build(this._core,r)}statfsSync(e,r){let{bigint:i=!1}=(0,re.getStatfsOptions)(r);return this._statfs((0,I.pathToFilename)(e),i)}statfs(e,r,i){let[{bigint:n=!1},o]=(0,re.getStatfsOptsAndCb)(r,i);this.wrapAsync(this._statfs,[(0,I.pathToFilename)(e),n],o)}};a(Hh,"Volume");var Fi=Hh;lt.Volume=Fi;Fi.fromJSON=(t,e)=>new Fi(Uh.Superblock.fromJSON(t,e));Fi.fromNestedJSON=(t,e)=>new Fi(Uh.Superblock.fromNestedJSON(t,e));function sD(t){t.emit("stop")}a(sD,"emitStop");var qh=class qh extends Nb.EventEmitter{constructor(e){super(),this.onInterval=()=>{try{let r=this.vol.statSync(this.filename);this.hasChanged(r)&&(this.emit("change",r,this.prev),this.prev=r)}finally{this.loop()}},this.vol=e}loop(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)}hasChanged(e){return e.mtimeMs>this.prev.mtimeMs||e.nlink!==this.prev.nlink}start(e,r=!0,i=5007){this.filename=(0,I.pathToFilename)(e),this.setTimeout=r?setTimeout.bind(globalThis):zC.default,this.interval=i,this.prev=this.vol.statSync(this.filename),this.loop()}stop(){clearTimeout(this.timeoutRef),(0,gl.default)(()=>{sD.call(this,this)})}};a(qh,"StatWatcher");var wl=qh;lt.StatWatcher=wl;var vt;function aD(t){vt=(0,Sn.bufferAllocUnsafe)(t),vt.used=0}a(aD,"allocNewPool");(0,Bb.inherits)(Jt,bl.Readable);lt.ReadStream=Jt;function Jt(t,e,r){if(!(this instanceof Jt))return new Jt(t,e,r);if(this._vol=t,r=Object.assign({},(0,re.getOptions)(r,{})),r.highWaterMark===void 0&&(r.highWaterMark=64*1024),bl.Readable.call(this,r),this.path=(0,I.pathToFilename)(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}a(Jt,"FsReadStream");Jt.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(e,r)=>{if(e){t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e);return}t.fd=r,t.emit("open",r),t.read()})};Jt.prototype._read=function(t){if(typeof this.fd!="number")return this.once("open",function(){this._read(t)});if(this.destroyed)return;(!vt||vt.length-vt.used<iD)&&aD(this._readableState.highWaterMark);var e=vt,r=Math.min(vt.length-vt.used,t),i=vt.used;if(this.pos!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);var n=this;this._vol.read(this.fd,vt,vt.used,r,this.pos,o),this.pos!==void 0&&(this.pos+=r),vt.used+=r;function o(s,l){if(s)n.autoClose&&n.destroy&&n.destroy(),n.emit("error",s);else{var f=null;l>0&&(n.bytesRead+=l,f=e.slice(i,i+l)),n.push(f)}}a(o,"onread")};Jt.prototype._destroy=function(t,e){this.close(r=>{e(t||r)})};Jt.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Lb);return}return(0,gl.default)(()=>this.emit("close"))}typeof this._readableState?.closed=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};function Lb(t){this.close()}a(Lb,"closeOnOpen");(0,Bb.inherits)(_t,bl.Writable);lt.WriteStream=_t;function _t(t,e,r){if(!(this instanceof _t))return new _t(t,e,r);if(this._vol=t,r=Object.assign({},(0,re.getOptions)(r,{})),bl.Writable.call(this,r),this.path=(0,I.pathToFilename)(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:!!r.autoClose,this.pos=void 0,this.bytesWritten=0,this.pending=!0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}a(_t,"FsWriteStream");_t.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(t,e){if(t){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",t);return}this.fd=e,this.pending=!1,this.emit("open",e)}.bind(this))};_t.prototype._write=function(t,e,r){if(!(t instanceof Sn.Buffer||t instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(t,e,r)});var i=this;this._vol.write(this.fd,t,0,t.length,this.pos,(n,o)=>{if(n)return i.autoClose&&i.destroy&&i.destroy(),r(n);i.bytesWritten+=o,r()}),this.pos!==void 0&&(this.pos+=t.length)};_t.prototype._writev=function(t,e){if(typeof this.fd!="number")return this.once("open",function(){this._writev(t,e)});let r=this,i=t.length,n=new Array(i);for(var o=0,s=0;s<i;s++){var l=t[s].chunk;n[s]=l,o+=l.length}let f=Sn.Buffer.concat(n);this._vol.write(this.fd,f,0,f.length,this.pos,(c,u)=>{if(c)return r.destroy&&r.destroy(),e(c);r.bytesWritten+=u,e()}),this.pos!==void 0&&(this.pos+=o)};_t.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Lb);return}return(0,gl.default)(()=>this.emit("close"))}typeof this._writableState?.closed=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};_t.prototype._destroy=Jt.prototype._destroy;_t.prototype.destroySoon=_t.prototype.end;var zh=class zh extends Nb.EventEmitter{constructor(e){super(),this._filename="",this._filenameEncoded="",this._recursive=!1,this._encoding=_i.ENCODING_UTF8,this._listenerRemovers=new Map,this._onParentChild=r=>{r.getName()===this._getName()&&this._emit("rename")},this._emit=r=>{this.emit("change",r,this._filenameEncoded)},this._persist=()=>{this._timer=setTimeout(this._persist,1e6)},this._vol=e}_getName(){return this._steps[this._steps.length-1]}start(e,r=!0,i=!1,n=_i.ENCODING_UTF8){this._filename=(0,I.pathToFilename)(e),this._steps=(0,$e.filenameToSteps)(this._filename),this._filenameEncoded=(0,_i.strToEncoding)(this._filename),this._recursive=i,this._encoding=n;try{this._link=this._vol._core.getLinkOrThrow(this._filename,"FSWatcher")}catch(f){let c=new Error(`watch ${this._filename} ${f.code}`);throw c.code=f.code,c.errno=f.code,c}let o=a(f=>{let c=f.getPath(),u=f.getNode(),h=a(()=>{let m=pl(this._filename,c);return m||(m=this._getName()),this.emit("change","change",m)},"onNodeChange"),d=u.changes.listen(([m])=>{m==="modify"&&h()}),p=this._listenerRemovers.get(u.ino)??[];p.push(()=>d()),this._listenerRemovers.set(u.ino,p)},"watchLinkNodeChanged"),s=a(f=>{let c=f.getNode(),u=a(m=>{this.emit("change","rename",pl(this._filename,m.getPath())),o(m),s(m)},"onLinkChildAdd"),h=a(m=>{let w=a(y=>{let v=y.getNode().ino,g=this._listenerRemovers.get(v);g&&(g.forEach(_=>_()),this._listenerRemovers.delete(v));for(let[_,E]of y.children.entries())E&&_!=="."&&_!==".."&&w(E)},"removeLinkNodeListeners");w(m),this.emit("change","rename",pl(this._filename,m.getPath()))},"onLinkChildDelete");for(let[m,w]of f.children.entries())w&&m!=="."&&m!==".."&&o(w);let d=f.changes.listen(([m,w])=>{m==="child:add"?u(w):m==="child:del"&&h(w)});if((this._listenerRemovers.get(c.ino)??[]).push(()=>{d()}),i)for(let[m,w]of f.children.entries())w&&m!=="."&&m!==".."&&s(w)},"watchLinkChildrenChanged");o(this._link),s(this._link);let l=this._link.parent;l&&l.changes.listen(([f,c])=>{f==="child:del"&&this._onParentChild(c)}),r&&this._persist()}close(){clearTimeout(this._timer),this._listenerRemovers.forEach(e=>{e.forEach(r=>r())}),this._listenerRemovers.clear(),this._parentChangesUnsub?.()}};a(zh,"FSWatcher");var yl=zh;lt.FSWatcher=yl});var Mb=O(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.fsSynchronousApiList=void 0;vl.fsSynchronousApiList=["accessSync","appendFileSync","chmodSync","chownSync","closeSync","copyFileSync","existsSync","fchmodSync","fchownSync","fdatasyncSync","fstatSync","fsyncSync","ftruncateSync","futimesSync","lchmodSync","lchownSync","linkSync","lstatSync","mkdirSync","mkdtempSync","openSync","opendirSync","readdirSync","readFileSync","readlinkSync","readSync","readvSync","realpathSync","renameSync","rmdirSync","rmSync","statSync","symlinkSync","truncateSync","unlinkSync","utimesSync","lutimesSync","writeFileSync","writeSync","writevSync"]});var jb=O(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.fsCallbackApiList=void 0;_l.fsCallbackApiList=["access","appendFile","chmod","chown","close","copyFile","cp","createReadStream","createWriteStream","exists","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","openAsBlob","opendir","read","readv","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","unwatchFile","utimes","lutimes","watch","watchFile","write","writev","writeFile"]});var xn=O((ct,Fl)=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.memfs=ct.fs=ct.vol=ct.Volume=void 0;ct.createFsFromVolume=Wh;var lD=Of(),cD=Qs(),El=$b();Object.defineProperty(ct,"Volume",{enumerable:!0,get:a(function(){return El.Volume},"get")});var Ub=At(),fD=Mb(),uD=jb(),{F_OK:hD,R_OK:dD,W_OK:pD,X_OK:mD}=Ub.constants;ct.vol=new El.Volume;function Wh(t){let e={F_OK:hD,R_OK:dD,W_OK:pD,X_OK:mD,constants:Ub.constants,Stats:lD.default,Dirent:cD.default};for(let r of fD.fsSynchronousApiList)typeof t[r]=="function"&&(e[r]=t[r].bind(t));for(let r of uD.fsCallbackApiList)typeof t[r]=="function"&&(e[r]=t[r].bind(t));return e.StatWatcher=t.StatWatcher,e.FSWatcher=t.FSWatcher,e.WriteStream=t.WriteStream,e.ReadStream=t.ReadStream,e.promises=t.promises,typeof t.realpath=="function"&&(e.realpath=t.realpath.bind(t),typeof t.realpath.native=="function"&&(e.realpath.native=t.realpath.native.bind(t))),typeof t.realpathSync=="function"&&(e.realpathSync=t.realpathSync.bind(t),typeof t.realpathSync.native=="function"&&(e.realpathSync.native=t.realpathSync.native.bind(t))),e._toUnixTimestamp=El.toUnixTimestamp,e.__vol=t,e}a(Wh,"createFsFromVolume");ct.fs=Wh(ct.vol);var wD=a((t={},e="/")=>{let r=El.Volume.fromNestedJSON(t,e);return{fs:Wh(r),vol:r}},"memfs");ct.memfs=wD;Fl.exports={...Fl.exports,...ct.fs};Fl.exports.semantic=!0});var sd=O((L4,Pl)=>{function Vb(t){return Array.isArray(t)?t:[t]}a(Vb,"makeArray");var yD=void 0,Jh="",zb=" ",Yh="\\",gD=/^\s+$/,bD=/(?:[^\\]|^)\\$/,vD=/^\\!/,_D=/^\\#/,FD=/\r?\n/g,ED=/^\.{0,2}\/|^\.{1,2}$/,SD=/\/$/,Tn="/",Gb="node-ignore";typeof Symbol<"u"&&(Gb=Symbol.for("node-ignore"));var Kb=Gb,On=a((t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),"define"),xD=/([0-z])-([0-z])/g,Zb=a(()=>!1,"RETURN_FALSE"),TD=a(t=>t.replace(xD,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:Jh),"sanitizeRange"),OD=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),kD=[[/^\uFEFF/,()=>Jh],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?zb:Jh)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+zb}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,a(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Yh],[/\\\\/g,()=>Yh],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Yh?`\\[${r}${OD(i)}${n}`:n==="]"&&i.length%2===0?`[${TD(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],RD=/(^|\\\/)?\\\*$/,Vo="regex",kl="checkRegex",Wb="_",PD={[Vo](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[kl](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},AD=a(t=>kD.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),"makeRegexPrefix"),Rl=a(t=>typeof t=="string","isString"),ID=a(t=>t&&Rl(t)&&!gD.test(t)&&!bD.test(t)&&t.indexOf("#")!==0,"checkPattern"),CD=a(t=>t.split(FD).filter(Boolean),"splitPattern"),id=class id{constructor(e,r,i,n,o,s){this.pattern=e,this.mark=r,this.negative=o,On(this,"body",i),On(this,"ignoreCase",n),On(this,"regexPrefix",s)}get regex(){let e=Wb+Vo;return this[e]?this[e]:this._make(Vo,e)}get checkRegex(){let e=Wb+kl;return this[e]?this[e]:this._make(kl,e)}_make(e,r){let i=this.regexPrefix.replace(RD,PD[e]),n=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return On(this,r,n)}};a(id,"IgnoreRule");var Qh=id,DD=a(({pattern:t,mark:e},r)=>{let i=!1,n=t;n.indexOf("!")===0&&(i=!0,n=n.substr(1)),n=n.replace(vD,"!").replace(_D,"#");let o=AD(n);return new Qh(t,e,n,r,i,o)},"createRule"),nd=class nd{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[Kb]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(Rl(e)&&(e={pattern:e}),ID(e.pattern)){let r=DD(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,Vb(Rl(e)?CD(e):e).forEach(this._add,this),this._added}test(e,r,i){let n=!1,o=!1,s;this._rules.forEach(f=>{let{negative:c}=f;o===c&&n!==o||c&&!n&&!o&&!r||!f[i].test(e)||(n=!c,o=c,s=c?yD:f)});let l={ignored:n,unignored:o};return s&&(l.rule=s),l}};a(nd,"RuleManager");var ed=nd,ND=a((t,e)=>{throw new e(t)},"throwError"),pr=a((t,e,r)=>Rl(t)?t?pr.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),Xb=a(t=>ED.test(t),"isNotRelative");pr.isNotRelative=Xb;pr.convert=t=>t;var od=class od{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){On(this,Kb,!0),this._rules=new ed(r),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,i,n){let o=e&&pr.convert(e);return pr(o,e,this._strictPathCheck?ND:Zb),this._t(o,r,i,n)}checkIgnore(e){if(!SD.test(e))return this.test(e);let r=e.split(Tn).filter(Boolean);if(r.pop(),r.length){let i=this._t(r.join(Tn)+Tn,this._testCache,!0,r);if(i.ignored)return i}return this._rules.test(e,!1,kl)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(Tn).filter(Boolean)),n.pop(),!n.length)return r[e]=this._rules.test(e,i,Vo);let o=this._t(n.join(Tn)+Tn,r,i,n);return r[e]=o.ignored?o:this._rules.test(e,i,Vo)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return Vb(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};a(od,"Ignore");var td=od,rd=a(t=>new td(t),"factory"),BD=a(t=>pr(t&&pr.convert(t),t,Zb),"isPathValid"),Yb=a(()=>{let t=a(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");pr.convert=t;let e=/^[a-z]:\//i;pr.isNotRelative=r=>e.test(r)||Xb(r)},"setupWindows");typeof process<"u"&&process.platform==="win32"&&Yb();Pl.exports=rd;rd.default=rd;Pl.exports.isPathValid=BD;On(Pl.exports,Symbol.for("setupWindows"),Yb)});var tv=O((V4,ev)=>{"use strict";var ft=a(function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||ft.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||ft.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||ft.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=ft.DEFAULT_MAX_PENDING},"AsyncLock");ft.DEFAULT_TIMEOUT=0;ft.DEFAULT_MAX_OCCUPATION_TIME=0;ft.DEFAULT_MAX_EXECUTION_TIME=0;ft.DEFAULT_MAX_PENDING=1e3;ft.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if(typeof e!="function")throw new Error("You must pass a function to execute");var n=null,o=null,s=null;typeof r!="function"&&(i=r,r=null,s=new this.Promise(function(g,_){n=g,o=_})),i=i||{};var l=!1,f=null,c=null,u=null,h=this,d=a(function(g,_,E){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),g&&(h.queues[t]&&h.queues[t].length===0&&delete h.queues[t],h.domainReentrant&&delete h.domains[t]),l||(s?_?o(_):n(E):typeof r=="function"&&r(_,E),l=!0),g&&h.queues[t]&&h.queues[t].length>0&&h.queues[t].shift()()},"done"),p=a(function(g){if(l)return d(g);f&&(clearTimeout(f),f=null),h.domainReentrant&&g&&(h.domains[t]=process.domain);var _=i.maxExecutionTime||h.maxExecutionTime;if(_&&(u=setTimeout(function(){h.queues[t]&&d(g,new Error("Maximum execution time is exceeded "+t))},_)),e.length===1){var E=!1;try{e(function(x,R){E||(E=!0,d(g,x,R))})}catch(x){E||(E=!0,d(g,x))}}else h._promiseTry(function(){return e()}).then(function(x){d(g,void 0,x)},function(x){d(g,x)})},"exec");h.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=i.maxPending||h.maxPending;if(!h.queues[t])h.queues[t]=[],p(!0);else if(h.domainReentrant&&process.domain&&process.domain===h.domains[t])p(!1);else if(h.queues[t].length>=m)d(!1,new Error("Too many pending tasks in queue "+t));else{var w=a(function(){p(!0)},"taskFn");i.skipQueue?h.queues[t].unshift(w):h.queues[t].push(w);var y=i.timeout||h.timeout;y&&(f=setTimeout(function(){f=null,d(!1,new Error("async-lock timed out in queue "+t))},y))}var v=i.maxOccupationTime||h.maxOccupationTime;if(v&&(c=setTimeout(function(){h.queues[t]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+t))},v)),s)return s};ft.prototype._acquireBatch=function(t,e,r,i){typeof r!="function"&&(i=r,r=null);var n=this,o=a(function(l,f){return function(c){n.acquire(l,f,c,i)}},"getFn"),s=t.reduceRight(function(l,f){return o(f,l)},e);if(typeof r=="function")s(r);else return new this.Promise(function(l,f){s.length===1?s(function(c,u){c?f(c):l(u)}):l(s())})};ft.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};ft.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};ev.exports=ft});var iv=O((K4,rv)=>{"use strict";rv.exports=tv()});var ov=O((Z4,nv)=>{var LD={}.toString;nv.exports=Array.isArray||function(t){return LD.call(t)=="[object Array]"}});var cv=O((X4,lv)=>{"use strict";var av=Function.prototype.toString,kn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,fd,Cl;if(typeof kn=="function"&&typeof Object.defineProperty=="function")try{fd=Object.defineProperty({},"length",{get:a(function(){throw Cl},"get")}),Cl={},kn(function(){throw 42},null,fd)}catch(t){t!==Cl&&(kn=null)}else kn=null;var $D=/^\s*class\b/,ud=a(function(e){try{var r=av.call(e);return $D.test(r)}catch{return!1}},"isES6ClassFunction"),cd=a(function(e){try{return ud(e)?!1:(av.call(e),!0)}catch{return!1}},"tryFunctionToStr"),Dl=Object.prototype.toString,MD="[object Object]",jD="[object Function]",UD="[object GeneratorFunction]",HD="[object HTMLAllCollection]",qD="[object HTML document.all class]",zD="[object HTMLCollection]",WD=typeof Symbol=="function"&&!!Symbol.toStringTag,VD=!(0 in[,]),hd=a(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(sv=document.all,Dl.call(sv)===Dl.call(document.all)&&(hd=a(function(e){if((VD||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Dl.call(e);return(r===HD||r===qD||r===zD||r===MD)&&e("")==null}catch{}return!1},"isDocumentDotAll")));var sv;lv.exports=a(kn?function(e){if(hd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{kn(e,null,fd)}catch(r){if(r!==Cl)return!1}return!ud(e)&&cd(e)}:function(e){if(hd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(WD)return cd(e);if(ud(e))return!1;var r=Dl.call(e);return r!==jD&&r!==UD&&!/^\[object HTML/.test(r)?!1:cd(e)},"isCallable")});var hv=O((J4,uv)=>{"use strict";var GD=cv(),KD=Object.prototype.toString,fv=Object.prototype.hasOwnProperty,ZD=a(function(e,r,i){for(var n=0,o=e.length;n<o;n++)fv.call(e,n)&&(i==null?r(e[n],n,e):r.call(i,e[n],n,e))},"forEachArray"),XD=a(function(e,r,i){for(var n=0,o=e.length;n<o;n++)i==null?r(e.charAt(n),n,e):r.call(i,e.charAt(n),n,e)},"forEachString"),YD=a(function(e,r,i){for(var n in e)fv.call(e,n)&&(i==null?r(e[n],n,e):r.call(i,e[n],n,e))},"forEachObject");function JD(t){return KD.call(t)==="[object Array]"}a(JD,"isArray");uv.exports=a(function(e,r,i){if(!GD(r))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),JD(e)?ZD(e,r,n):typeof e=="string"?XD(e,r,n):YD(e,r,n)},"forEach")});var pv=O((eU,dv)=>{"use strict";dv.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var wv=O((tU,mv)=>{"use strict";var dd=pv(),QD=globalThis;mv.exports=a(function(){for(var e=[],r=0;r<dd.length;r++)typeof QD[dd[r]]=="function"&&(e[e.length]=dd[r]);return e},"availableTypedArrays")});var vv=O((iU,bv)=>{"use strict";var yv=_o(),eN=Su(),Rn=zt(),gv=on();bv.exports=a(function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new Rn("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Rn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Rn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Rn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Rn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Rn("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,f=!!gv&&gv(e,r);if(yv)yv(e,r,{configurable:s===null&&f?f.configurable:!s,enumerable:n===null&&f?f.enumerable:!n,value:i,writable:o===null&&f?f.writable:!o});else if(l||!n&&!o&&!s)e[r]=i;else throw new eN("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var Ev=O((oU,Fv)=>{"use strict";var pd=_o(),_v=a(function(){return!!pd},"hasPropertyDescriptors");_v.hasArrayLengthDefineBug=a(function(){if(!pd)return null;try{return pd([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");Fv.exports=_v});var kv=O((aU,Ov)=>{"use strict";var tN=xo(),Sv=vv(),rN=Ev()(),xv=on(),Tv=zt(),iN=tN("%Math.floor%");Ov.exports=a(function(e,r){if(typeof e!="function")throw new Tv("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||iN(r)!==r)throw new Tv("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in e&&xv){var s=xv(e,"length");s&&!s.configurable&&(n=!1),s&&!s.writable&&(o=!1)}return(n||o||!i)&&(rN?Sv(e,"length",r,!0,!0):Sv(e,"length",r)),e},"setFunctionLength")});var Pv=O((cU,Rv)=>{"use strict";var nN=sn(),oN=Oa(),sN=ku();Rv.exports=a(function(){return sN(nN,oN,arguments)},"applyBind")});var Cv=O((uU,Nl)=>{"use strict";var aN=kv(),Av=_o(),lN=ka(),Iv=Pv();Nl.exports=a(function(e){var r=lN(arguments),i=e.length-(arguments.length-1);return aN(r,1+(i>0?i:0),!0)},"callBind");Av?Av(Nl.exports,"apply",{value:Iv}):Nl.exports.apply=Iv});var Nv=O((dU,Dv)=>{"use strict";var cN=xu();Dv.exports=a(function(){return cN()&&!!Symbol.toStringTag},"hasToStringTagShams")});var jv=O((mU,Mv)=>{"use strict";var $l=hv(),fN=wv(),Bv=Cv(),wd=To(),Ll=on(),Bl=Pu(),uN=wd("Object.prototype.toString"),$v=Nv()(),Lv=globalThis,md=fN(),yd=wd("String.prototype.slice"),hN=wd("Array.prototype.indexOf",!0)||a(function(e,r){for(var i=0;i<e.length;i+=1)if(e[i]===r)return i;return-1},"indexOf"),Ml={__proto__:null};$v&&Ll&&Bl?$l(md,function(t){var e=new Lv[t];if(Symbol.toStringTag in e&&Bl){var r=Bl(e),i=Ll(r,Symbol.toStringTag);if(!i&&r){var n=Bl(r);i=Ll(n,Symbol.toStringTag)}Ml["$"+t]=Bv(i.get)}}):$l(md,function(t){var e=new Lv[t],r=e.slice||e.set;r&&(Ml["$"+t]=Bv(r))});var dN=a(function(e){var r=!1;return $l(Ml,function(i,n){if(!r)try{"$"+i(e)===n&&(r=yd(n,1))}catch{}}),r},"tryAllTypedArrays"),pN=a(function(e){var r=!1;return $l(Ml,function(i,n){if(!r)try{i(e),r=yd(n,1)}catch{}}),r},"tryAllSlices");Mv.exports=a(function(e){if(!e||typeof e!="object")return!1;if(!$v){var r=yd(uN(e),8,-1);return hN(md,r)>-1?r:r!=="Object"?!1:pN(e)}return Ll?dN(e):null},"whichTypedArray")});var Hv=O((yU,Uv)=>{"use strict";var mN=jv();Uv.exports=a(function(e){return!!mN(e)},"isTypedArray")});var zv=O((bU,qv)=>{"use strict";var wN=zt(),yN=To(),gN=yN("TypedArray.prototype.buffer",!0),bN=Hv();qv.exports=gN||a(function(e){if(!bN(e))throw new wN("Not a Typed Array");return e.buffer},"typedArrayBuffer")});var Gv=O((_U,Vv)=>{"use strict";var Ct=Bo().Buffer,vN=ov(),_N=zv(),FN=ArrayBuffer.isView||a(function(e){try{return _N(e),!0}catch{return!1}},"isView"),EN=typeof Uint8Array<"u",Wv=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",SN=Wv&&(Ct.prototype instanceof Uint8Array||Ct.TYPED_ARRAY_SUPPORT);Vv.exports=a(function(e,r){if(Ct.isBuffer(e))return e.constructor&&!("isBuffer"in e)?Ct.from(e):e;if(typeof e=="string")return Ct.from(e,r);if(Wv&&FN(e)){if(e.byteLength===0)return Ct.alloc(0);if(SN){var i=Ct.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var n=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=Ct.from(n);if(o.length===e.byteLength)return o}if(EN&&e instanceof Uint8Array)return Ct.from(e);var s=vN(e);if(s)for(var l=0;l<e.length;l+=1){var f=e[l];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(s||Ct.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return Ct.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},"toBuffer")});var Zv=O((EU,Kv)=>{"use strict";var xN=Bo().Buffer,TN=Gv();function jl(t,e){this._block=xN.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}a(jl,"Hash");jl.prototype.update=function(t,e){t=TN(t,e||"utf8");for(var r=this._block,i=this._blockSize,n=t.length,o=this._len,s=0;s<n;){for(var l=o%i,f=Math.min(n-s,i-l),c=0;c<f;c++)r[l+c]=t[s+c];o+=f,s+=f,o%i===0&&this._update(r)}return this._len+=n,this};jl.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o};jl.prototype._update=function(){throw new Error("_update must be implemented by subclass")};Kv.exports=jl});var Jv=O((xU,Yv)=>{"use strict";var ON=Zt(),Xv=Zv(),kN=Bo().Buffer,RN=[1518500249,1859775393,-1894007588,-899497514],PN=new Array(80);function Zo(){this.init(),this._w=PN,Xv.call(this,64,56)}a(Zo,"Sha1");ON(Zo,Xv);Zo.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function AN(t){return t<<1|t>>>31}a(AN,"rotl1");function IN(t){return t<<5|t>>>27}a(IN,"rotl5");function CN(t){return t<<30|t>>>2}a(CN,"rotl30");function DN(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}a(DN,"ft");Zo.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,s=this._e|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<80;++l)e[l]=AN(e[l-3]^e[l-8]^e[l-14]^e[l-16]);for(var f=0;f<80;++f){var c=~~(f/20),u=IN(r)+DN(c,i,n,o)+s+e[f]+RN[c]|0;s=o,o=n,n=CN(i),i=r,r=u}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0};Zo.prototype._hash=function(){var t=kN.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};Yv.exports=Zo});var e_=O(gd=>{var Qv;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof gd=="object"?t(gd):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(Qv={}):t(Qv={})})(function(t){t.version="1.2.2";function e(){for(var b=0,T=new Array(256),F=0;F!=256;++F)b=F,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,T[F]=b;return typeof Int32Array<"u"?new Int32Array(T):T}a(e,"signed_crc_table");var r=e();function i(b){var T=0,F=0,P=0,k=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(P=0;P!=256;++P)k[P]=b[P];for(P=0;P!=256;++P)for(F=b[P],T=256+P;T<4096;T+=256)F=k[T]=F>>>8^b[F&255];var D=[];for(P=1;P!=16;++P)D[P-1]=typeof Int32Array<"u"?k.subarray(P*256,P*256+256):k.slice(P*256,P*256+256);return D}a(i,"slice_by_16_tables");var n=i(r),o=n[0],s=n[1],l=n[2],f=n[3],c=n[4],u=n[5],h=n[6],d=n[7],p=n[8],m=n[9],w=n[10],y=n[11],v=n[12],g=n[13],_=n[14];function E(b,T){for(var F=T^-1,P=0,k=b.length;P<k;)F=F>>>8^r[(F^b.charCodeAt(P++))&255];return~F}a(E,"crc32_bstr");function x(b,T){for(var F=T^-1,P=b.length-15,k=0;k<P;)F=_[b[k++]^F&255]^g[b[k++]^F>>8&255]^v[b[k++]^F>>16&255]^y[b[k++]^F>>>24]^w[b[k++]]^m[b[k++]]^p[b[k++]]^d[b[k++]]^h[b[k++]]^u[b[k++]]^c[b[k++]]^f[b[k++]]^l[b[k++]]^s[b[k++]]^o[b[k++]]^r[b[k++]];for(P+=15;k<P;)F=F>>>8^r[(F^b[k++])&255];return~F}a(x,"crc32_buf");function R(b,T){for(var F=T^-1,P=0,k=b.length,D=0,B=0;P<k;)D=b.charCodeAt(P++),D<128?F=F>>>8^r[(F^D)&255]:D<2048?(F=F>>>8^r[(F^(192|D>>6&31))&255],F=F>>>8^r[(F^(128|D&63))&255]):D>=55296&&D<57344?(D=(D&1023)+64,B=b.charCodeAt(P++)&1023,F=F>>>8^r[(F^(240|D>>8&7))&255],F=F>>>8^r[(F^(128|D>>2&63))&255],F=F>>>8^r[(F^(128|B>>6&15|(D&3)<<4))&255],F=F>>>8^r[(F^(128|B&63))&255]):(F=F>>>8^r[(F^(224|D>>12&15))&255],F=F>>>8^r[(F^(128|D>>6&63))&255],F=F>>>8^r[(F^(128|D&63))&255]);return~F}a(R,"crc32_str"),t.table=r,t.bstr=E,t.buf=x,t.str=R})});var mr=O(Ke=>{"use strict";var NN=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function BN(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(BN,"_has");Ke.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)BN(r,i)&&(t[i]=r[i])}}return t};Ke.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var LN={arraySet:a(function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var o=0;o<i;o++)t[n+o]=e[r+o]},"arraySet"),flattenChunks:a(function(t){var e,r,i,n,o,s;for(i=0,e=0,r=t.length;e<r;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,r=t.length;e<r;e++)o=t[e],s.set(o,n),n+=o.length;return s},"flattenChunks")},$N={arraySet:a(function(t,e,r,i,n){for(var o=0;o<i;o++)t[n+o]=e[r+o]},"arraySet"),flattenChunks:a(function(t){return[].concat.apply([],t)},"flattenChunks")};Ke.setTyped=function(t){t?(Ke.Buf8=Uint8Array,Ke.Buf16=Uint16Array,Ke.Buf32=Int32Array,Ke.assign(Ke,LN)):(Ke.Buf8=Array,Ke.Buf16=Array,Ke.Buf32=Array,Ke.assign(Ke,$N))};Ke.setTyped(NN)});var E_=O(In=>{"use strict";var MN=mr(),jN=4,t_=0,r_=1,UN=2;function An(t){for(var e=t.length;--e>=0;)t[e]=0}a(An,"zero");var HN=0,l_=1,qN=2,zN=3,WN=258,xd=29,ts=256,Yo=ts+1+xd,Pn=30,Td=19,c_=2*Yo+1,Ei=15,bd=16,VN=7,Od=256,f_=16,u_=17,h_=18,Ed=[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],Ul=[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],GN=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],KN=512,wr=new Array((Yo+2)*2);An(wr);var Xo=new Array(Pn*2);An(Xo);var Jo=new Array(KN);An(Jo);var Qo=new Array(WN-zN+1);An(Qo);var kd=new Array(xd);An(kd);var Hl=new Array(Pn);An(Hl);function vd(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}a(vd,"StaticTreeDesc");var p_,m_,w_;function _d(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}a(_d,"TreeDesc");function y_(t){return t<256?Jo[t]:Jo[256+(t>>>7)]}a(y_,"d_code");function es(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}a(es,"put_short");function et(t,e,r){t.bi_valid>bd-r?(t.bi_buf|=e<<t.bi_valid&65535,es(t,t.bi_buf),t.bi_buf=e>>bd-t.bi_valid,t.bi_valid+=r-bd):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}a(et,"send_bits");function Qt(t,e,r){et(t,r[e*2],r[e*2+1])}a(Qt,"send_code");function g_(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}a(g_,"bi_reverse");function ZN(t){t.bi_valid===16?(es(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}a(ZN,"bi_flush");function XN(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,u,h,d,p,m,w=0;for(d=0;d<=Ei;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<c_;c++)u=t.heap[c],d=r[r[u*2+1]*2+1]+1,d>f&&(d=f,w++),r[u*2+1]=d,!(u>i)&&(t.bl_count[d]++,p=0,u>=l&&(p=s[u-l]),m=r[u*2],t.opt_len+=m*(d+p),o&&(t.static_len+=m*(n[u*2+1]+p)));if(w!==0){do{for(d=f-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[f]--,w-=2}while(w>0);for(d=f;d!==0;d--)for(u=t.bl_count[d];u!==0;)h=t.heap[--c],!(h>i)&&(r[h*2+1]!==d&&(t.opt_len+=(d-r[h*2+1])*r[h*2],r[h*2+1]=d),u--)}}a(XN,"gen_bitlen");function b_(t,e,r){var i=new Array(Ei+1),n=0,o,s;for(o=1;o<=Ei;o++)i[o]=n=n+r[o-1]<<1;for(s=0;s<=e;s++){var l=t[s*2+1];l!==0&&(t[s*2]=g_(i[l]++,l))}}a(b_,"gen_codes");function YN(){var t,e,r,i,n,o=new Array(Ei+1);for(r=0,i=0;i<xd-1;i++)for(kd[i]=r,t=0;t<1<<Ed[i];t++)Qo[r++]=i;for(Qo[r-1]=i,n=0,i=0;i<16;i++)for(Hl[i]=n,t=0;t<1<<Ul[i];t++)Jo[n++]=i;for(n>>=7;i<Pn;i++)for(Hl[i]=n<<7,t=0;t<1<<Ul[i]-7;t++)Jo[256+n++]=i;for(e=0;e<=Ei;e++)o[e]=0;for(t=0;t<=143;)wr[t*2+1]=8,t++,o[8]++;for(;t<=255;)wr[t*2+1]=9,t++,o[9]++;for(;t<=279;)wr[t*2+1]=7,t++,o[7]++;for(;t<=287;)wr[t*2+1]=8,t++,o[8]++;for(b_(wr,Yo+1,o),t=0;t<Pn;t++)Xo[t*2+1]=5,Xo[t*2]=g_(t,5);p_=new vd(wr,Ed,ts+1,Yo,Ei),m_=new vd(Xo,Ul,0,Pn,Ei),w_=new vd(new Array(0),GN,0,Td,VN)}a(YN,"tr_static_init");function v_(t){var e;for(e=0;e<Yo;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Pn;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Td;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Od*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}a(v_,"init_block");function __(t){t.bi_valid>8?es(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}a(__,"bi_windup");function JN(t,e,r,i){__(t),i&&(es(t,r),es(t,~r)),MN.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}a(JN,"copy_block");function i_(t,e,r,i){var n=e*2,o=r*2;return t[n]<t[o]||t[n]===t[o]&&i[e]<=i[r]}a(i_,"smaller");function Fd(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&i_(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!i_(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}a(Fd,"pqdownheap");function n_(t,e,r){var i,n,o=0,s,l;if(t.last_lit!==0)do i=t.pending_buf[t.d_buf+o*2]<<8|t.pending_buf[t.d_buf+o*2+1],n=t.pending_buf[t.l_buf+o],o++,i===0?Qt(t,n,e):(s=Qo[n],Qt(t,s+ts+1,e),l=Ed[s],l!==0&&(n-=kd[s],et(t,n,l)),i--,s=y_(i),Qt(t,s,r),l=Ul[s],l!==0&&(i-=Hl[s],et(t,i,l)));while(o<t.last_lit);Qt(t,Od,e)}a(n_,"compress_block");function Sd(t,e){var r=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,o=e.stat_desc.elems,s,l,f=-1,c;for(t.heap_len=0,t.heap_max=c_,s=0;s<o;s++)r[s*2]!==0?(t.heap[++t.heap_len]=f=s,t.depth[s]=0):r[s*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,n&&(t.static_len-=i[c*2+1]);for(e.max_code=f,s=t.heap_len>>1;s>=1;s--)Fd(t,r,s);c=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Fd(t,r,1),l=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=l,r[c*2]=r[s*2]+r[l*2],t.depth[c]=(t.depth[s]>=t.depth[l]?t.depth[s]:t.depth[l])+1,r[s*2+1]=r[l*2+1]=c,t.heap[1]=c++,Fd(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],XN(t,e),b_(r,f,t.bl_count)}a(Sd,"build_tree");function o_(t,e,r){var i,n=-1,o,s=e[0*2+1],l=0,f=7,c=4;for(s===0&&(f=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)o=s,s=e[(i+1)*2+1],!(++l<f&&o===s)&&(l<c?t.bl_tree[o*2]+=l:o!==0?(o!==n&&t.bl_tree[o*2]++,t.bl_tree[f_*2]++):l<=10?t.bl_tree[u_*2]++:t.bl_tree[h_*2]++,l=0,n=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4))}a(o_,"scan_tree");function s_(t,e,r){var i,n=-1,o,s=e[0*2+1],l=0,f=7,c=4;for(s===0&&(f=138,c=3),i=0;i<=r;i++)if(o=s,s=e[(i+1)*2+1],!(++l<f&&o===s)){if(l<c)do Qt(t,o,t.bl_tree);while(--l!==0);else o!==0?(o!==n&&(Qt(t,o,t.bl_tree),l--),Qt(t,f_,t.bl_tree),et(t,l-3,2)):l<=10?(Qt(t,u_,t.bl_tree),et(t,l-3,3)):(Qt(t,h_,t.bl_tree),et(t,l-11,7));l=0,n=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4)}}a(s_,"send_tree");function QN(t){var e;for(o_(t,t.dyn_ltree,t.l_desc.max_code),o_(t,t.dyn_dtree,t.d_desc.max_code),Sd(t,t.bl_desc),e=Td-1;e>=3&&t.bl_tree[d_[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}a(QN,"build_bl_tree");function e2(t,e,r,i){var n;for(et(t,e-257,5),et(t,r-1,5),et(t,i-4,4),n=0;n<i;n++)et(t,t.bl_tree[d_[n]*2+1],3);s_(t,t.dyn_ltree,e-1),s_(t,t.dyn_dtree,r-1)}a(e2,"send_all_trees");function t2(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return t_;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return r_;for(r=32;r<ts;r++)if(t.dyn_ltree[r*2]!==0)return r_;return t_}a(t2,"detect_data_type");var a_=!1;function r2(t){a_||(YN(),a_=!0),t.l_desc=new _d(t.dyn_ltree,p_),t.d_desc=new _d(t.dyn_dtree,m_),t.bl_desc=new _d(t.bl_tree,w_),t.bi_buf=0,t.bi_valid=0,v_(t)}a(r2,"_tr_init");function F_(t,e,r,i){et(t,(HN<<1)+(i?1:0),3),JN(t,e,r,!0)}a(F_,"_tr_stored_block");function i2(t){et(t,l_<<1,3),Qt(t,Od,wr),ZN(t)}a(i2,"_tr_align");function n2(t,e,r,i){var n,o,s=0;t.level>0?(t.strm.data_type===UN&&(t.strm.data_type=t2(t)),Sd(t,t.l_desc),Sd(t,t.d_desc),s=QN(t),n=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=n&&(n=o)):n=o=r+5,r+4<=n&&e!==-1?F_(t,e,r,i):t.strategy===jN||o===n?(et(t,(l_<<1)+(i?1:0),3),n_(t,wr,Xo)):(et(t,(qN<<1)+(i?1:0),3),e2(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),n_(t,t.dyn_ltree,t.dyn_dtree)),v_(t),i&&__(t)}a(n2,"_tr_flush_block");function o2(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Qo[r]+ts+1)*2]++,t.dyn_dtree[y_(e)*2]++),t.last_lit===t.lit_bufsize-1}a(o2,"_tr_tally");In._tr_init=r2;In._tr_stored_block=F_;In._tr_flush_block=n2;In._tr_tally=o2;In._tr_align=i2});var Rd=O((CU,S_)=>{"use strict";function s2(t,e,r,i){for(var n=t&65535|0,o=t>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do n=n+e[i++]|0,o=o+n|0;while(--s);n%=65521,o%=65521}return n|o<<16|0}a(s2,"adler32");S_.exports=s2});var Pd=O((NU,x_)=>{"use strict";function a2(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}a(a2,"makeTable");var l2=a2();function c2(t,e,r,i){var n=l2,o=i+r;t^=-1;for(var s=i;s<o;s++)t=t>>>8^n[(t^e[s])&255];return t^-1}a(c2,"crc32");x_.exports=c2});var ql=O((LU,T_)=>{"use strict";T_.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 N_=O(rr=>{"use strict";var Ze=mr(),Et=E_(),P_=Rd(),jr=Pd(),f2=ql(),Oi=0,u2=1,h2=3,Wr=4,O_=5,tr=0,k_=1,St=-2,d2=-3,Ad=-5,p2=-1,m2=1,zl=2,w2=3,y2=4,g2=0,b2=2,Kl=8,v2=9,_2=15,F2=8,E2=29,S2=256,Cd=S2+1+E2,x2=30,T2=19,O2=2*Cd+1,k2=15,ee=3,qr=258,Dt=qr+ee+1,R2=32,Zl=42,Dd=69,Wl=73,Vl=91,Gl=103,Si=113,is=666,Ae=1,ns=2,xi=3,Nn=4,P2=3;function zr(t,e){return t.msg=f2[e],e}a(zr,"err");function R_(t){return(t<<1)-(t>4?9:0)}a(R_,"rank");function Hr(t){for(var e=t.length;--e>=0;)t[e]=0}a(Hr,"zero");function Ur(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(Ze.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}a(Ur,"flush_pending");function Me(t,e){Et._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Ur(t.strm)}a(Me,"flush_block_only");function ae(t,e){t.pending_buf[t.pending++]=e}a(ae,"put_byte");function rs(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}a(rs,"putShortMSB");function A2(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,Ze.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=P_(t.adler,e,n,r):t.state.wrap===2&&(t.adler=jr(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}a(A2,"read_buf");function A_(t,e){var r=t.max_chain_length,i=t.strstart,n,o,s=t.prev_length,l=t.nice_match,f=t.strstart>t.w_size-Dt?t.strstart-(t.w_size-Dt):0,c=t.window,u=t.w_mask,h=t.prev,d=t.strstart+qr,p=c[i+s-1],m=c[i+s];t.prev_length>=t.good_match&&(r>>=2),l>t.lookahead&&(l=t.lookahead);do if(n=e,!(c[n+s]!==m||c[n+s-1]!==p||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<d);if(o=qr-(d-i),i=d-qr,o>s){if(t.match_start=e,s=o,o>=l)break;p=c[i+s-1],m=c[i+s]}}while((e=h[e&u])>f&&--r!==0);return s<=t.lookahead?s:t.lookahead}a(A_,"longest_match");function Ti(t){var e=t.w_size,r,i,n,o,s;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Dt)){Ze.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);o+=e}if(t.strm.avail_in===0)break;if(i=A2(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=i,t.lookahead+t.insert>=ee)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+ee-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<ee)););}while(t.lookahead<Dt&&t.strm.avail_in!==0)}a(Ti,"fill_window");function I2(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ti(t),t.lookahead===0&&e===Oi)return Ae;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,Me(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Dt&&(Me(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===Wr?(Me(t,!0),t.strm.avail_out===0?xi:Nn):(t.strstart>t.block_start&&(Me(t,!1),t.strm.avail_out===0),Ae)}a(I2,"deflate_stored");function Id(t,e){for(var r,i;;){if(t.lookahead<Dt){if(Ti(t),t.lookahead<Dt&&e===Oi)return Ae;if(t.lookahead===0)break}if(r=0,t.lookahead>=ee&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ee-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Dt&&(t.match_length=A_(t,r)),t.match_length>=ee)if(i=Et._tr_tally(t,t.strstart-t.match_start,t.match_length-ee),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ee){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ee-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=Et._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Me(t,!1),t.strm.avail_out===0))return Ae}return t.insert=t.strstart<ee-1?t.strstart:ee-1,e===Wr?(Me(t,!0),t.strm.avail_out===0?xi:Nn):t.last_lit&&(Me(t,!1),t.strm.avail_out===0)?Ae:ns}a(Id,"deflate_fast");function Cn(t,e){for(var r,i,n;;){if(t.lookahead<Dt){if(Ti(t),t.lookahead<Dt&&e===Oi)return Ae;if(t.lookahead===0)break}if(r=0,t.lookahead>=ee&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ee-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ee-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Dt&&(t.match_length=A_(t,r),t.match_length<=5&&(t.strategy===m2||t.match_length===ee&&t.strstart-t.match_start>4096)&&(t.match_length=ee-1)),t.prev_length>=ee&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ee,i=Et._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ee),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ee-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=ee-1,t.strstart++,i&&(Me(t,!1),t.strm.avail_out===0))return Ae}else if(t.match_available){if(i=Et._tr_tally(t,0,t.window[t.strstart-1]),i&&Me(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Ae}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=Et._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ee-1?t.strstart:ee-1,e===Wr?(Me(t,!0),t.strm.avail_out===0?xi:Nn):t.last_lit&&(Me(t,!1),t.strm.avail_out===0)?Ae:ns}a(Cn,"deflate_slow");function C2(t,e){for(var r,i,n,o,s=t.window;;){if(t.lookahead<=qr){if(Ti(t),t.lookahead<=qr&&e===Oi)return Ae;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=ee&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){o=t.strstart+qr;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<o);t.match_length=qr-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ee?(r=Et._tr_tally(t,1,t.match_length-ee),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Et._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Me(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===Wr?(Me(t,!0),t.strm.avail_out===0?xi:Nn):t.last_lit&&(Me(t,!1),t.strm.avail_out===0)?Ae:ns}a(C2,"deflate_rle");function D2(t,e){for(var r;;){if(t.lookahead===0&&(Ti(t),t.lookahead===0)){if(e===Oi)return Ae;break}if(t.match_length=0,r=Et._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Me(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===Wr?(Me(t,!0),t.strm.avail_out===0?xi:Nn):t.last_lit&&(Me(t,!1),t.strm.avail_out===0)?Ae:ns}a(D2,"deflate_huff");function er(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}a(er,"Config");var Dn;Dn=[new er(0,0,0,0,I2),new er(4,4,8,4,Id),new er(4,5,16,8,Id),new er(4,6,32,32,Id),new er(4,4,16,16,Cn),new er(8,16,32,32,Cn),new er(8,16,128,128,Cn),new er(8,32,128,256,Cn),new er(32,128,258,1024,Cn),new er(32,258,258,4096,Cn)];function N2(t){t.window_size=2*t.w_size,Hr(t.head),t.max_lazy_match=Dn[t.level].max_lazy,t.good_match=Dn[t.level].good_length,t.nice_match=Dn[t.level].nice_length,t.max_chain_length=Dn[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ee-1,t.match_available=0,t.ins_h=0}a(N2,"lm_init");function B2(){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=Kl,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ze.Buf16(O2*2),this.dyn_dtree=new Ze.Buf16((2*x2+1)*2),this.bl_tree=new Ze.Buf16((2*T2+1)*2),Hr(this.dyn_ltree),Hr(this.dyn_dtree),Hr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ze.Buf16(k2+1),this.heap=new Ze.Buf16(2*Cd+1),Hr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ze.Buf16(2*Cd+1),Hr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}a(B2,"DeflateState");function I_(t){var e;return!t||!t.state?zr(t,St):(t.total_in=t.total_out=0,t.data_type=b2,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Zl:Si,t.adler=e.wrap===2?0:1,e.last_flush=Oi,Et._tr_init(e),tr)}a(I_,"deflateResetKeep");function C_(t){var e=I_(t);return e===tr&&N2(t.state),e}a(C_,"deflateReset");function L2(t,e){return!t||!t.state||t.state.wrap!==2?St:(t.state.gzhead=e,tr)}a(L2,"deflateSetHeader");function D_(t,e,r,i,n,o){if(!t)return St;var s=1;if(e===p2&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>v2||r!==Kl||i<8||i>15||e<0||e>9||o<0||o>y2)return zr(t,St);i===8&&(i=9);var l=new B2;return t.state=l,l.strm=t,l.wrap=s,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=n+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+ee-1)/ee),l.window=new Ze.Buf8(l.w_size*2),l.head=new Ze.Buf16(l.hash_size),l.prev=new Ze.Buf16(l.w_size),l.lit_bufsize=1<<n+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Ze.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=r,C_(t)}a(D_,"deflateInit2");function $2(t,e){return D_(t,e,Kl,_2,F2,g2)}a($2,"deflateInit");function M2(t,e){var r,i,n,o;if(!t||!t.state||e>O_||e<0)return t?zr(t,St):St;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===is&&e!==Wr)return zr(t,t.avail_out===0?Ad:St);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===Zl)if(i.wrap===2)t.adler=0,ae(i,31),ae(i,139),ae(i,8),i.gzhead?(ae(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ae(i,i.gzhead.time&255),ae(i,i.gzhead.time>>8&255),ae(i,i.gzhead.time>>16&255),ae(i,i.gzhead.time>>24&255),ae(i,i.level===9?2:i.strategy>=zl||i.level<2?4:0),ae(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(ae(i,i.gzhead.extra.length&255),ae(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=jr(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Dd):(ae(i,0),ae(i,0),ae(i,0),ae(i,0),ae(i,0),ae(i,i.level===9?2:i.strategy>=zl||i.level<2?4:0),ae(i,P2),i.status=Si);else{var s=Kl+(i.w_bits-8<<4)<<8,l=-1;i.strategy>=zl||i.level<2?l=0:i.level<6?l=1:i.level===6?l=2:l=3,s|=l<<6,i.strstart!==0&&(s|=R2),s+=31-s%31,i.status=Si,rs(i,s),i.strstart!==0&&(rs(i,t.adler>>>16),rs(i,t.adler&65535)),t.adler=1}if(i.status===Dd)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=jr(t.adler,i.pending_buf,i.pending-n,n)),Ur(t),n=i.pending,i.pending===i.pending_buf_size));)ae(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=jr(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Wl)}else i.status=Wl;if(i.status===Wl)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=jr(t.adler,i.pending_buf,i.pending-n,n)),Ur(t),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,ae(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(t.adler=jr(t.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.gzindex=0,i.status=Vl)}else i.status=Vl;if(i.status===Vl)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=jr(t.adler,i.pending_buf,i.pending-n,n)),Ur(t),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,ae(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(t.adler=jr(t.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.status=Gl)}else i.status=Gl;if(i.status===Gl&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Ur(t),i.pending+2<=i.pending_buf_size&&(ae(i,t.adler&255),ae(i,t.adler>>8&255),t.adler=0,i.status=Si)):i.status=Si),i.pending!==0){if(Ur(t),t.avail_out===0)return i.last_flush=-1,tr}else if(t.avail_in===0&&R_(e)<=R_(r)&&e!==Wr)return zr(t,Ad);if(i.status===is&&t.avail_in!==0)return zr(t,Ad);if(t.avail_in!==0||i.lookahead!==0||e!==Oi&&i.status!==is){var f=i.strategy===zl?D2(i,e):i.strategy===w2?C2(i,e):Dn[i.level].func(i,e);if((f===xi||f===Nn)&&(i.status=is),f===Ae||f===xi)return t.avail_out===0&&(i.last_flush=-1),tr;if(f===ns&&(e===u2?Et._tr_align(i):e!==O_&&(Et._tr_stored_block(i,0,0,!1),e===h2&&(Hr(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Ur(t),t.avail_out===0))return i.last_flush=-1,tr}return e!==Wr?tr:i.wrap<=0?k_:(i.wrap===2?(ae(i,t.adler&255),ae(i,t.adler>>8&255),ae(i,t.adler>>16&255),ae(i,t.adler>>24&255),ae(i,t.total_in&255),ae(i,t.total_in>>8&255),ae(i,t.total_in>>16&255),ae(i,t.total_in>>24&255)):(rs(i,t.adler>>>16),rs(i,t.adler&65535)),Ur(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?tr:k_)}a(M2,"deflate");function j2(t){var e;return!t||!t.state?St:(e=t.state.status,e!==Zl&&e!==Dd&&e!==Wl&&e!==Vl&&e!==Gl&&e!==Si&&e!==is?zr(t,St):(t.state=null,e===Si?zr(t,d2):tr))}a(j2,"deflateEnd");function U2(t,e){var r=e.length,i,n,o,s,l,f,c,u;if(!t||!t.state||(i=t.state,s=i.wrap,s===2||s===1&&i.status!==Zl||i.lookahead))return St;for(s===1&&(t.adler=P_(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(s===0&&(Hr(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new Ze.Buf8(i.w_size),Ze.arraySet(u,e,r-i.w_size,i.w_size,0),e=u,r=i.w_size),l=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,Ti(i);i.lookahead>=ee;){n=i.strstart,o=i.lookahead-(ee-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+ee-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--o);i.strstart=n,i.lookahead=ee-1,Ti(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ee-1,i.match_available=0,t.next_in=f,t.input=c,t.avail_in=l,i.wrap=s,tr}a(U2,"deflateSetDictionary");rr.deflateInit=$2;rr.deflateInit2=D_;rr.deflateReset=C_;rr.deflateResetKeep=I_;rr.deflateSetHeader=L2;rr.deflate=M2;rr.deflateEnd=j2;rr.deflateSetDictionary=U2;rr.deflateInfo="pako deflate (from Nodeca project)"});var Nd=O(Bn=>{"use strict";var Xl=mr(),B_=!0,L_=!0;try{String.fromCharCode.apply(null,[0])}catch{B_=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{L_=!1}var os=new Xl.Buf8(256);for(yr=0;yr<256;yr++)os[yr]=yr>=252?6:yr>=248?5:yr>=240?4:yr>=224?3:yr>=192?2:1;var yr;os[254]=os[254]=1;Bn.string2buf=function(t){var e,r,i,n,o,s=t.length,l=0;for(n=0;n<s;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Xl.Buf8(l),o=0,n=0;o<l;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|r&63):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|r&63):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|r&63);return e};function $_(t,e){if(e<65534&&(t.subarray&&L_||!t.subarray&&B_))return String.fromCharCode.apply(null,Xl.shrinkBuf(t,e));for(var r="",i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r}a($_,"buf2binstring");Bn.buf2binstring=function(t){return $_(t,t.length)};Bn.binstring2buf=function(t){for(var e=new Xl.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e};Bn.buf2string=function(t,e){var r,i,n,o,s=e||t.length,l=new Array(s*2);for(i=0,r=0;r<s;){if(n=t[r++],n<128){l[i++]=n;continue}if(o=os[n],o>4){l[i++]=65533,r+=o-1;continue}for(n&=o===2?31:o===3?15:7;o>1&&r<s;)n=n<<6|t[r++]&63,o--;if(o>1){l[i++]=65533;continue}n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|n&1023)}return $_(l,i)};Bn.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+os[t[r]]>e?r:e}});var Bd=O((HU,M_)=>{"use strict";function H2(){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}a(H2,"ZStream");M_.exports=H2});var q_=O(ls=>{"use strict";var ss=N_(),as=mr(),$d=Nd(),Md=ql(),q2=Bd(),H_=Object.prototype.toString,z2=0,Ld=4,Ln=0,j_=1,U_=2,W2=-1,V2=0,G2=8;function ki(t){if(!(this instanceof ki))return new ki(t);this.options=as.assign({level:W2,method:G2,chunkSize:16384,windowBits:15,memLevel:8,strategy:V2,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new q2,this.strm.avail_out=0;var r=ss.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Ln)throw new Error(Md[r]);if(e.header&&ss.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=$d.string2buf(e.dictionary):H_.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=ss.deflateSetDictionary(this.strm,i),r!==Ln)throw new Error(Md[r]);this._dict_set=!0}}a(ki,"Deflate");ki.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,o;if(this.ended)return!1;o=e===~~e?e:e===!0?Ld:z2,typeof t=="string"?r.input=$d.string2buf(t):H_.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new as.Buf8(i),r.next_out=0,r.avail_out=i),n=ss.deflate(r,o),n!==j_&&n!==Ln)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Ld||o===U_))&&(this.options.to==="string"?this.onData($d.buf2binstring(as.shrinkBuf(r.output,r.next_out))):this.onData(as.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==j_);return o===Ld?(n=ss.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Ln):(o===U_&&(this.onEnd(Ln),r.avail_out=0),!0)};ki.prototype.onData=function(t){this.chunks.push(t)};ki.prototype.onEnd=function(t){t===Ln&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=as.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function jd(t,e){var r=new ki(e);if(r.push(t,!0),r.err)throw r.msg||Md[r.err];return r.result}a(jd,"deflate");function K2(t,e){return e=e||{},e.raw=!0,jd(t,e)}a(K2,"deflateRaw");function Z2(t,e){return e=e||{},e.gzip=!0,jd(t,e)}a(Z2,"gzip");ls.Deflate=ki;ls.deflate=jd;ls.deflateRaw=K2;ls.gzip=Z2});var W_=O((VU,z_)=>{"use strict";var Yl=30,X2=12;z_.exports=a(function(e,r){var i,n,o,s,l,f,c,u,h,d,p,m,w,y,v,g,_,E,x,R,b,T,F,P,k;i=e.state,n=e.next_in,P=e.input,o=n+(e.avail_in-5),s=e.next_out,k=e.output,l=s-(r-e.avail_out),f=s+(e.avail_out-257),c=i.dmax,u=i.wsize,h=i.whave,d=i.wnext,p=i.window,m=i.hold,w=i.bits,y=i.lencode,v=i.distcode,g=(1<<i.lenbits)-1,_=(1<<i.distbits)-1;e:do{w<15&&(m+=P[n++]<<w,w+=8,m+=P[n++]<<w,w+=8),E=y[m&g];t:for(;;){if(x=E>>>24,m>>>=x,w-=x,x=E>>>16&255,x===0)k[s++]=E&65535;else if(x&16){R=E&65535,x&=15,x&&(w<x&&(m+=P[n++]<<w,w+=8),R+=m&(1<<x)-1,m>>>=x,w-=x),w<15&&(m+=P[n++]<<w,w+=8,m+=P[n++]<<w,w+=8),E=v[m&_];r:for(;;){if(x=E>>>24,m>>>=x,w-=x,x=E>>>16&255,x&16){if(b=E&65535,x&=15,w<x&&(m+=P[n++]<<w,w+=8,w<x&&(m+=P[n++]<<w,w+=8)),b+=m&(1<<x)-1,b>c){e.msg="invalid distance too far back",i.mode=Yl;break e}if(m>>>=x,w-=x,x=s-l,b>x){if(x=b-x,x>h&&i.sane){e.msg="invalid distance too far back",i.mode=Yl;break e}if(T=0,F=p,d===0){if(T+=u-x,x<R){R-=x;do k[s++]=p[T++];while(--x);T=s-b,F=k}}else if(d<x){if(T+=u+d-x,x-=d,x<R){R-=x;do k[s++]=p[T++];while(--x);if(T=0,d<R){x=d,R-=x;do k[s++]=p[T++];while(--x);T=s-b,F=k}}}else if(T+=d-x,x<R){R-=x;do k[s++]=p[T++];while(--x);T=s-b,F=k}for(;R>2;)k[s++]=F[T++],k[s++]=F[T++],k[s++]=F[T++],R-=3;R&&(k[s++]=F[T++],R>1&&(k[s++]=F[T++]))}else{T=s-b;do k[s++]=k[T++],k[s++]=k[T++],k[s++]=k[T++],R-=3;while(R>2);R&&(k[s++]=k[T++],R>1&&(k[s++]=k[T++]))}}else if(x&64){e.msg="invalid distance code",i.mode=Yl;break e}else{E=v[(E&65535)+(m&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){i.mode=X2;break e}else{e.msg="invalid literal/length code",i.mode=Yl;break e}else{E=y[(E&65535)+(m&(1<<x)-1)];continue t}break}}while(n<o&&s<f);R=w>>3,n-=R,w-=R<<3,m&=(1<<w)-1,e.next_in=n,e.next_out=s,e.avail_in=n<o?5+(o-n):5-(n-o),e.avail_out=s<f?257+(f-s):257-(s-f),i.hold=m,i.bits=w},"inflate_fast")});var J_=O((KU,Y_)=>{"use strict";var V_=mr(),$n=15,G_=852,K_=592,Z_=0,Ud=1,X_=2,Y2=[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],J2=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Q2=[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],eB=[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];Y_.exports=a(function(e,r,i,n,o,s,l,f){var c=f.bits,u=0,h=0,d=0,p=0,m=0,w=0,y=0,v=0,g=0,_=0,E,x,R,b,T,F=null,P=0,k,D=new V_.Buf16($n+1),B=new V_.Buf16($n+1),U=null,Z=0,me,Ee,$;for(u=0;u<=$n;u++)D[u]=0;for(h=0;h<n;h++)D[r[i+h]]++;for(m=c,p=$n;p>=1&&D[p]===0;p--);if(m>p&&(m=p),p===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,f.bits=1,0;for(d=1;d<p&&D[d]===0;d++);for(m<d&&(m=d),v=1,u=1;u<=$n;u++)if(v<<=1,v-=D[u],v<0)return-1;if(v>0&&(e===Z_||p!==1))return-1;for(B[1]=0,u=1;u<$n;u++)B[u+1]=B[u]+D[u];for(h=0;h<n;h++)r[i+h]!==0&&(l[B[r[i+h]]++]=h);if(e===Z_?(F=U=l,k=19):e===Ud?(F=Y2,P-=257,U=J2,Z-=257,k=256):(F=Q2,U=eB,k=-1),_=0,h=0,u=d,T=s,w=m,y=0,R=-1,g=1<<m,b=g-1,e===Ud&&g>G_||e===X_&&g>K_)return 1;for(;;){me=u-y,l[h]<k?(Ee=0,$=l[h]):l[h]>k?(Ee=U[Z+l[h]],$=F[P+l[h]]):(Ee=96,$=0),E=1<<u-y,x=1<<w,d=x;do x-=E,o[T+(_>>y)+x]=me<<24|Ee<<16|$|0;while(x!==0);for(E=1<<u-1;_&E;)E>>=1;if(E!==0?(_&=E-1,_+=E):_=0,h++,--D[u]===0){if(u===p)break;u=r[i+l[h]]}if(u>m&&(_&b)!==R){for(y===0&&(y=m),T+=d,w=u-y,v=1<<w;w+y<p&&(v-=D[w+y],!(v<=0));)w++,v<<=1;if(g+=1<<w,e===Ud&&g>G_||e===X_&&g>K_)return 1;R=_&b,o[R]=m<<24|w<<16|T-s|0}}return _!==0&&(o[T+_]=u-y<<24|64<<16|0),f.bits=m,0},"inflate_table")});var CF=O(Nt=>{"use strict";var ut=mr(),Gd=Rd(),ir=Pd(),tB=W_(),cs=J_(),rB=0,SF=1,xF=2,Q_=4,iB=5,Jl=6,Ri=0,nB=1,oB=2,xt=-2,TF=-3,Kd=-4,sB=-5,eF=8,OF=1,tF=2,rF=3,iF=4,nF=5,oF=6,sF=7,aF=8,lF=9,cF=10,tc=11,gr=12,Hd=13,fF=14,qd=15,uF=16,hF=17,dF=18,pF=19,Ql=20,ec=21,mF=22,wF=23,yF=24,gF=25,bF=26,zd=27,vF=28,_F=29,pe=30,Zd=31,aB=32,lB=852,cB=592,fB=15,uB=fB;function FF(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}a(FF,"zswap32");function hB(){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 ut.Buf16(320),this.work=new ut.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}a(hB,"InflateState");function kF(t){var e;return!t||!t.state?xt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=OF,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new ut.Buf32(lB),e.distcode=e.distdyn=new ut.Buf32(cB),e.sane=1,e.back=-1,Ri)}a(kF,"inflateResetKeep");function RF(t){var e;return!t||!t.state?xt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,kF(t))}a(RF,"inflateReset");function PF(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?xt:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,RF(t))}a(PF,"inflateReset2");function AF(t,e){var r,i;return t?(i=new hB,t.state=i,i.window=null,r=PF(t,e),r!==Ri&&(t.state=null),r):xt}a(AF,"inflateInit2");function dB(t){return AF(t,uB)}a(dB,"inflateInit");var EF=!0,Wd,Vd;function pB(t){if(EF){var e;for(Wd=new ut.Buf32(512),Vd=new ut.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(cs(SF,t.lens,0,288,Wd,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;cs(xF,t.lens,0,32,Vd,0,t.work,{bits:5}),EF=!1}t.lencode=Wd,t.lenbits=9,t.distcode=Vd,t.distbits=5}a(pB,"fixedtables");function IF(t,e,r,i){var n,o=t.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new ut.Buf8(o.wsize)),i>=o.wsize?(ut.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),ut.arraySet(o.window,e,r-i,n,o.wnext),i-=n,i?(ut.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}a(IF,"updatewindow");function mB(t,e){var r,i,n,o,s,l,f,c,u,h,d,p,m,w,y=0,v,g,_,E,x,R,b,T,F=new ut.Buf8(4),P,k,D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return xt;r=t.state,r.mode===gr&&(r.mode=Hd),s=t.next_out,n=t.output,f=t.avail_out,o=t.next_in,i=t.input,l=t.avail_in,c=r.hold,u=r.bits,h=l,d=f,T=Ri;e:for(;;)switch(r.mode){case OF:if(r.wrap===0){r.mode=Hd;break}for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,F[0]=c&255,F[1]=c>>>8&255,r.check=ir(r.check,F,2,0),c=0,u=0,r.mode=tF;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=pe;break}if((c&15)!==eF){t.msg="unknown compression method",r.mode=pe;break}if(c>>>=4,u-=4,b=(c&15)+8,r.wbits===0)r.wbits=b;else if(b>r.wbits){t.msg="invalid window size",r.mode=pe;break}r.dmax=1<<b,t.adler=r.check=1,r.mode=c&512?cF:gr,c=0,u=0;break;case tF:for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==eF){t.msg="unknown compression method",r.mode=pe;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=pe;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(F[0]=c&255,F[1]=c>>>8&255,r.check=ir(r.check,F,2,0)),c=0,u=0,r.mode=rF;case rF:for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=ir(r.check,F,4,0)),c=0,u=0,r.mode=iF;case iF:for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(F[0]=c&255,F[1]=c>>>8&255,r.check=ir(r.check,F,2,0)),c=0,u=0,r.mode=nF;case nF:if(r.flags&1024){for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(F[0]=c&255,F[1]=c>>>8&255,r.check=ir(r.check,F,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=oF;case oF:if(r.flags&1024&&(p=r.length,p>l&&(p=l),p&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),ut.arraySet(r.head.extra,i,o,p,b)),r.flags&512&&(r.check=ir(r.check,i,p,o)),l-=p,o+=p,r.length-=p),r.length))break e;r.length=0,r.mode=sF;case sF:if(r.flags&2048){if(l===0)break e;p=0;do b=i[o+p++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b));while(b&&p<l);if(r.flags&512&&(r.check=ir(r.check,i,p,o)),l-=p,o+=p,b)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=aF;case aF:if(r.flags&4096){if(l===0)break e;p=0;do b=i[o+p++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b));while(b&&p<l);if(r.flags&512&&(r.check=ir(r.check,i,p,o)),l-=p,o+=p,b)break e}else r.head&&(r.head.comment=null);r.mode=lF;case lF:if(r.flags&512){for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=pe;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=gr;break;case cF:for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}t.adler=r.check=FF(c),c=0,u=0,r.mode=tc;case tc:if(r.havedict===0)return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,oB;t.adler=r.check=1,r.mode=gr;case gr:if(e===iB||e===Jl)break e;case Hd:if(r.last){c>>>=u&7,u-=u&7,r.mode=zd;break}for(;u<3;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=fF;break;case 1:if(pB(r),r.mode=Ql,e===Jl){c>>>=2,u-=2;break e}break;case 2:r.mode=hF;break;case 3:t.msg="invalid block type",r.mode=pe}c>>>=2,u-=2;break;case fF:for(c>>>=u&7,u-=u&7;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=pe;break}if(r.length=c&65535,c=0,u=0,r.mode=qd,e===Jl)break e;case qd:r.mode=uF;case uF:if(p=r.length,p){if(p>l&&(p=l),p>f&&(p=f),p===0)break e;ut.arraySet(n,i,o,p,s),l-=p,o+=p,f-=p,s+=p,r.length-=p;break}r.mode=gr;break;case hF:for(;u<14;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=pe;break}r.have=0,r.mode=dF;case dF:for(;r.have<r.ncode;){for(;u<3;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.lens[D[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},T=cs(rB,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,T){t.msg="invalid code lengths set",r.mode=pe;break}r.have=0,r.mode=pF;case pF:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],v=y>>>24,g=y>>>16&255,_=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(_<16)c>>>=v,u-=v,r.lens[r.have++]=_;else{if(_===16){for(k=v+2;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c>>>=v,u-=v,r.have===0){t.msg="invalid bit length repeat",r.mode=pe;break}b=r.lens[r.have-1],p=3+(c&3),c>>>=2,u-=2}else if(_===17){for(k=v+3;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=v,u-=v,b=0,p=3+(c&7),c>>>=3,u-=3}else{for(k=v+7;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=v,u-=v,b=0,p=11+(c&127),c>>>=7,u-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=pe;break}for(;p--;)r.lens[r.have++]=b}}if(r.mode===pe)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=pe;break}if(r.lenbits=9,P={bits:r.lenbits},T=cs(SF,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,T){t.msg="invalid literal/lengths set",r.mode=pe;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},T=cs(xF,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,T){t.msg="invalid distances set",r.mode=pe;break}if(r.mode=Ql,e===Jl)break e;case Ql:r.mode=ec;case ec:if(l>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,tB(t,d),s=t.next_out,n=t.output,f=t.avail_out,o=t.next_in,i=t.input,l=t.avail_in,c=r.hold,u=r.bits,r.mode===gr&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],v=y>>>24,g=y>>>16&255,_=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(g&&!(g&240)){for(E=v,x=g,R=_;y=r.lencode[R+((c&(1<<E+x)-1)>>E)],v=y>>>24,g=y>>>16&255,_=y&65535,!(E+v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=E,u-=E,r.back+=E}if(c>>>=v,u-=v,r.back+=v,r.length=_,g===0){r.mode=bF;break}if(g&32){r.back=-1,r.mode=gr;break}if(g&64){t.msg="invalid literal/length code",r.mode=pe;break}r.extra=g&15,r.mode=mF;case mF:if(r.extra){for(k=r.extra;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=wF;case wF:for(;y=r.distcode[c&(1<<r.distbits)-1],v=y>>>24,g=y>>>16&255,_=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(!(g&240)){for(E=v,x=g,R=_;y=r.distcode[R+((c&(1<<E+x)-1)>>E)],v=y>>>24,g=y>>>16&255,_=y&65535,!(E+v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=E,u-=E,r.back+=E}if(c>>>=v,u-=v,r.back+=v,g&64){t.msg="invalid distance code",r.mode=pe;break}r.offset=_,r.extra=g&15,r.mode=yF;case yF:if(r.extra){for(k=r.extra;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=pe;break}r.mode=gF;case gF:if(f===0)break e;if(p=d-f,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=pe;break}p>r.wnext?(p-=r.wnext,m=r.wsize-p):m=r.wnext-p,p>r.length&&(p=r.length),w=r.window}else w=n,m=s-r.offset,p=r.length;p>f&&(p=f),f-=p,r.length-=p;do n[s++]=w[m++];while(--p);r.length===0&&(r.mode=ec);break;case bF:if(f===0)break e;n[s++]=r.length,f--,r.mode=ec;break;case zd:if(r.wrap){for(;u<32;){if(l===0)break e;l--,c|=i[o++]<<u,u+=8}if(d-=f,t.total_out+=d,r.total+=d,d&&(t.adler=r.check=r.flags?ir(r.check,n,d,s-d):Gd(r.check,n,d,s-d)),d=f,(r.flags?c:FF(c))!==r.check){t.msg="incorrect data check",r.mode=pe;break}c=0,u=0}r.mode=vF;case vF:if(r.wrap&&r.flags){for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=pe;break}c=0,u=0}r.mode=_F;case _F:T=nB;break e;case pe:T=TF;break e;case Zd:return Kd;case aB:default:return xt}return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,(r.wsize||d!==t.avail_out&&r.mode<pe&&(r.mode<zd||e!==Q_))&&IF(t,t.output,t.next_out,d-t.avail_out)?(r.mode=Zd,Kd):(h-=t.avail_in,d-=t.avail_out,t.total_in+=h,t.total_out+=d,r.total+=d,r.wrap&&d&&(t.adler=r.check=r.flags?ir(r.check,n,d,t.next_out-d):Gd(r.check,n,d,t.next_out-d)),t.data_type=r.bits+(r.last?64:0)+(r.mode===gr?128:0)+(r.mode===Ql||r.mode===qd?256:0),(h===0&&d===0||e===Q_)&&T===Ri&&(T=sB),T)}a(mB,"inflate");function wB(t){if(!t||!t.state)return xt;var e=t.state;return e.window&&(e.window=null),t.state=null,Ri}a(wB,"inflateEnd");function yB(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?xt:(r.head=e,e.done=!1,Ri)}a(yB,"inflateGetHeader");function gB(t,e){var r=e.length,i,n,o;return!t||!t.state||(i=t.state,i.wrap!==0&&i.mode!==tc)?xt:i.mode===tc&&(n=1,n=Gd(n,e,r,0),n!==i.check)?TF:(o=IF(t,e,r,r),o?(i.mode=Zd,Kd):(i.havedict=1,Ri))}a(gB,"inflateSetDictionary");Nt.inflateReset=RF;Nt.inflateReset2=PF;Nt.inflateResetKeep=kF;Nt.inflateInit=dB;Nt.inflateInit2=AF;Nt.inflate=mB;Nt.inflateEnd=wB;Nt.inflateGetHeader=yB;Nt.inflateSetDictionary=gB;Nt.inflateInfo="pako inflate (from Nodeca project)"});var Xd=O((JU,DF)=>{"use strict";DF.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var BF=O((QU,NF)=>{"use strict";function bB(){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}a(bB,"GZheader");NF.exports=bB});var $F=O(us=>{"use strict";var Mn=CF(),fs=mr(),rc=Nd(),_e=Xd(),Yd=ql(),vB=Bd(),_B=BF(),LF=Object.prototype.toString;function Pi(t){if(!(this instanceof Pi))return new Pi(t);this.options=fs.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vB,this.strm.avail_out=0;var r=Mn.inflateInit2(this.strm,e.windowBits);if(r!==_e.Z_OK)throw new Error(Yd[r]);if(this.header=new _B,Mn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=rc.string2buf(e.dictionary):LF.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Mn.inflateSetDictionary(this.strm,e.dictionary),r!==_e.Z_OK)))throw new Error(Yd[r])}a(Pi,"Inflate");Pi.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,o,s,l,f,c,u=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?_e.Z_FINISH:_e.Z_NO_FLUSH,typeof t=="string"?r.input=rc.binstring2buf(t):LF.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new fs.Buf8(i),r.next_out=0,r.avail_out=i),o=Mn.inflate(r,_e.Z_NO_FLUSH),o===_e.Z_NEED_DICT&&n&&(o=Mn.inflateSetDictionary(this.strm,n)),o===_e.Z_BUF_ERROR&&u===!0&&(o=_e.Z_OK,u=!1),o!==_e.Z_STREAM_END&&o!==_e.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===_e.Z_STREAM_END||r.avail_in===0&&(s===_e.Z_FINISH||s===_e.Z_SYNC_FLUSH))&&(this.options.to==="string"?(l=rc.utf8border(r.output,r.next_out),f=r.next_out-l,c=rc.buf2string(r.output,l),r.next_out=f,r.avail_out=i-f,f&&fs.arraySet(r.output,r.output,l,f,0),this.onData(c)):this.onData(fs.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==_e.Z_STREAM_END);return o===_e.Z_STREAM_END&&(s=_e.Z_FINISH),s===_e.Z_FINISH?(o=Mn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===_e.Z_OK):(s===_e.Z_SYNC_FLUSH&&(this.onEnd(_e.Z_OK),r.avail_out=0),!0)};Pi.prototype.onData=function(t){this.chunks.push(t)};Pi.prototype.onEnd=function(t){t===_e.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fs.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Jd(t,e){var r=new Pi(e);if(r.push(t,!0),r.err)throw r.msg||Yd[r.err];return r.result}a(Jd,"inflate");function FB(t,e){return e=e||{},e.raw=!0,Jd(t,e)}a(FB,"inflateRaw");us.Inflate=Pi;us.inflate=Jd;us.inflateRaw=FB;us.ungzip=Jd});var UF=O((iH,jF)=>{"use strict";var EB=mr().assign,SB=q_(),xB=$F(),TB=Xd(),MF={};EB(MF,SB,xB,TB);jF.exports=MF});var zF=O((nH,qF)=>{"use strict";var HF=a((t,e)=>function(...r){let i=e.promiseModule;return new i((n,o)=>{e.multiArgs?r.push((...s)=>{e.errorFirst?s[0]?o(s):(s.shift(),n(s)):n(s)}):e.errorFirst?r.push((s,l)=>{s?o(s):n(l)}):r.push(n),t.apply(this,r)})},"processFn");qF.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let i=a(o=>{let s=a(l=>typeof l=="string"?o===l:l.test(o),"match");return e.include?e.include.some(s):!e.exclude.some(s)},"filter"),n;r==="function"?n=a(function(...o){return e.excludeMain?t(...o):HF(t,e).apply(this,o)},"ret"):n=Object.create(Object.getPrototypeOf(t));for(let o in t){let s=t[o];n[o]=typeof s=="function"&&i(o)?HF(s,e):s}return n}});var QF=O((sH,JF)=>{function WF(t){return Array.isArray(t)?t:[t]}a(WF,"makeArray");var tp="",VF=" ",Qd="\\",OB=/^\s+$/,kB=/(?:[^\\]|^)\\$/,RB=/^\\!/,PB=/^\\#/,AB=/\r?\n/g,IB=/^\.*\/|^\.+$/,ep="/",ZF="node-ignore";typeof Symbol<"u"&&(ZF=Symbol.for("node-ignore"));var GF=ZF,CB=a((t,e,r)=>Object.defineProperty(t,e,{value:r}),"define"),DB=/([0-z])-([0-z])/g,XF=a(()=>!1,"RETURN_FALSE"),NB=a(t=>t.replace(DB,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:tp),"sanitizeRange"),BB=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),LB=[[/^\uFEFF/,()=>tp],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?VF:tp)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+VF}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,a(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Qd],[/\\\\/g,()=>Qd],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Qd?`\\[${r}${BB(i)}${n}`:n==="]"&&i.length%2===0?`[${NB(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],KF=Object.create(null),$B=a((t,e)=>{let r=KF[t];return r||(r=LB.reduce((i,[n,o])=>i.replace(n,o.bind(t)),t),KF[t]=r),e?new RegExp(r,"i"):new RegExp(r)},"makeRegex"),np=a(t=>typeof t=="string","isString"),MB=a(t=>t&&np(t)&&!OB.test(t)&&!kB.test(t)&&t.indexOf("#")!==0,"checkPattern"),jB=a(t=>t.split(AB),"splitPattern"),op=class op{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}};a(op,"IgnoreRule");var rp=op,UB=a((t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(RB,"!").replace(PB,"#");let n=$B(t,e);return new rp(r,t,i,n)},"createRule"),HB=a((t,e)=>{throw new e(t)},"throwError"),br=a((t,e,r)=>np(t)?t?br.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),YF=a(t=>IB.test(t),"isNotRelative");br.isNotRelative=YF;br.convert=t=>t;var sp=class sp{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){CB(this,GF,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[GF]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(MB(e)){let r=UB(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,WF(np(e)?jB(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(o=>{let{negative:s}=o;if(n===s&&i!==n||s&&!i&&!n&&!r)return;o.regex.test(e)&&(i=!s,n=s)}),{ignored:i,unignored:n}}_test(e,r,i,n){let o=e&&br.convert(e);return br(o,e,this._allowRelativePaths?XF:HB),this._t(o,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(ep)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let o=this._t(n.join(ep)+ep,r,i,n);return r[e]=o.ignored?o:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return WF(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};a(sp,"Ignore");var ip=sp,ic=a(t=>new ip(t),"factory"),qB=a(t=>br(t&&br.convert(t),t,XF),"isPathValid");ic.isPathValid=qB;ic.default=ic;JF.exports=ic;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=a(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");br.convert=t;let e=/^[a-z]:\//i;br.isNotRelative=r=>e.test(r)||YF(r)}});var tE=O((lH,eE)=>{"use strict";function zB(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(zB,"escapeRegExp");function nr(t,e,r){return e=e instanceof RegExp?e:new RegExp(zB(e),"g"),t.replace(e,r)}a(nr,"replaceAll");var WB={clean:a(function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=nr(e,"./","/"),e=nr(e,"..","."),e=nr(e," ","-"),e=nr(e,/^[~^:?*\\\-]/g,""),e=nr(e,/[~^:?*\\]/g,"-"),e=nr(e,/[~^:?*\\\-]$/g,""),e=nr(e,"@{","-"),e=nr(e,/\.$/g,""),e=nr(e,/\/$/g,""),e=nr(e,/\.lock$/g,""),e},"clean")};eE.exports=WB});var iE=O((fH,rE)=>{"use strict";var VB=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;rE.exports=a(function(e,r){if(typeof e!="string")throw new TypeError("Reference name must be a string");return!VB.test(e)&&(!!r||e.includes("/"))},"validRef")});var oE=O((hH,nE)=>{nE.exports=function(t,e){var r=t,i=e,n=r.length,o=i.length,s=!1,l=null,f=n+1,c=[],u=[],h=[],d="",p=-1,m=0,w=1,y,v,g=a(function(){n>=o&&(y=r,v=n,r=i,i=y,n=o,o=v,s=!0,f=n+1)},"init"),_=a(function(b,T,F){return{x:b,y:T,k:F}},"P"),E=a(function(b,T){return{elem:b,t:T}},"seselem"),x=a(function(b,T,F){var P,k,D;for(T>F?P=c[b-1+f]:P=c[b+1+f],D=Math.max(T,F),k=D-b;k<n&&D<o&&r[k]===i[D];)++k,++D;return c[b+f]=u.length,u[u.length]=new _(k,D,P),D},"snake"),R=a(function(b){var T,F,P,k,D;for(T=F=1,P=k=0,D=b.length-1;D>=0;--D)for(;P<b[D].x||k<b[D].y;)b[D].y-b[D].x>k-P?(s?h[h.length]=new E(i[k],p):h[h.length]=new E(i[k],w),++F,++k):b[D].y-b[D].x<k-P?(s?h[h.length]=new E(r[P],w):h[h.length]=new E(r[P],p),++T,++P):(h[h.length]=new E(r[P],m),d+=r[P],++T,++F,++P,++k)},"recordseq");return g(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:a(function(){return l},"editdistance"),getlcs:a(function(){return d},"getlcs"),getses:a(function(){return h},"getses"),compose:a(function(){var b,T,F,P,k,D,B,U;for(b=o-n,T=n+o+3,F={},B=0;B<T;++B)F[B]=-1,c[B]=-1;P=-1;do{for(++P,U=-P;U<=b-1;++U)F[U+f]=x(U,F[U-1+f]+1,F[U+1+f]);for(U=b+P;U>=b+1;--U)F[U+f]=x(U,F[U-1+f]+1,F[U+1+f]);F[b+f]=x(b,F[b-1+f]+1,F[b+1+f])}while(F[b+f]!==o);for(l=b+2*P,k=c[b+f],D=[];k!==-1;)D[D.length]=new _(u[k].x,u[k].y,null),k=u[k].k;R(D)},"compose")}}});var lE=O((pH,aE)=>{var GB=oE();function KB(t,e){var r=new GB(t,e);r.compose();for(var i=r.getses(),n,o,s=t.length-1,l=e.length-1,f=i.length-1;f>=0;--f)i[f].t===r.SES_COMMON?(o?(o.chain={file1index:s,file2index:l,chain:null},o=o.chain):(n={file1index:s,file2index:l,chain:null},o=n),s--,l--):i[f].t===r.SES_DELETE?s--:i[f].t===r.SES_ADD&&l--;var c={file1index:-1,file2index:-1,chain:null};return o?(o.chain=c,n):c}a(KB,"longestCommonSubsequence");function sE(t,e){for(var r=[],i=t.length,n=e.length,o=KB(t,e);o!==null;o=o.chain){var s=i-o.file1index-1,l=n-o.file2index-1;i=o.file1index,n=o.file2index,(s||l)&&r.push({file1:[i+1,s],file2:[n+1,l]})}return r.reverse(),r}a(sE,"diffIndices");function ZB(t,e,r){var i,n=sE(e,t),o=sE(e,r),s=[];function l(B,U){s.push([B.file1[0],U,B.file1[1],B.file2[0],B.file2[1]])}for(a(l,"addHunk"),i=0;i<n.length;i++)l(n[i],0);for(i=0;i<o.length;i++)l(o[i],2);s.sort(function(B,U){return B[0]-U[0]});var f=[],c=0;function u(B){B>c&&(f.push([1,c,B-c]),c=B)}a(u,"copyCommon");for(var h=0;h<s.length;h++){for(var d=h,p=s[h],m=p[0],w=m+p[2];h<s.length-1;){var y=s[h+1],v=y[0];if(v>w)break;w=Math.max(w,v+y[2]),h++}if(u(m),d==h)p[4]>0&&f.push([p[1],p[3],p[4]]);else{var g={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=h;i++){p=s[i];var _=p[1],E=g[_],x=p[0],R=x+p[2],b=p[3],T=b+p[4];E[0]=Math.min(b,E[0]),E[1]=Math.max(T,E[1]),E[2]=Math.min(x,E[2]),E[3]=Math.max(R,E[3])}var F=g[0][0]+(m-g[0][2]),P=g[0][1]+(w-g[0][3]),k=g[2][0]+(m-g[2][2]),D=g[2][1]+(w-g[2][3]);f.push([-1,F,P-F,m,w-m,k,D-k])}c=w}return u(e.length),f}a(ZB,"diff3MergeIndices");function XB(t,e,r){var i=[],n=[t,e,r],o=ZB(t,e,r),s=[];function l(){s.length&&i.push({ok:s}),s=[]}a(l,"flushOk");function f(p){for(var m=0;m<p.length;m++)s.push(p[m])}a(f,"pushOk");function c(p){if(p[2]!=p[6])return!0;for(var m=p[1],w=p[5],y=0;y<p[2];y++)if(t[y+m]!=r[y+w])return!0;return!1}a(c,"isTrueConflict");for(var u=0;u<o.length;u++){var h=o[u],d=h[0];d==-1?c(h)?(l(),i.push({conflict:{a:t.slice(h[1],h[1]+h[2]),aIndex:h[1],o:e.slice(h[3],h[3]+h[4]),oIndex:h[3],b:r.slice(h[5],h[5]+h[6]),bIndex:h[5]}})):f(n[0].slice(h[1],h[1]+h[2])):f(n[d].slice(h[1],h[1]+h[2]))}return l(),i}a(XB,"diff3Merge");aE.exports=XB});var Ie=O(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});function Fr(t){return t&&typeof t=="object"&&"default"in t?t.default:t}a(Fr,"_interopDefault");var ps=Fr(iv()),AE=Fr(Jv()),C=Tr(),YB=Fr(e_()),Ip=Fr(UF()),ap=Fr(zF()),JB=Fr(QF()),ms=Fr(tE()),ws=Fr(iE()),QB=Fr(lE()),wc=class wc extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let r=new wc(e.message);return r.code=e.code,r.data=e.data,r.caller=e.caller,r.stack=e.stack,r}get isIsomorphicGitError(){return!0}};a(wc,"BaseError");var ie=wc,yc=class yc extends ie{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=yc.code,this.data={filepaths:e}}};a(yc,"UnmergedPathsError");var ys=yc;ys.code="UnmergedPathsError";var gc=class gc extends ie{constructor(e){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=gc.code,this.data={message:e}}};a(gc,"InternalError");var W=gc;W.code="InternalError";var bc=class bc extends ie{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=bc.code,this.data={filepath:e}}};a(bc,"UnsafeFilepathError");var qn=bc;qn.code="UnsafeFilepathError";var Mp=class Mp{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};a(Mp,"BufferCursor");var Tt=Mp;function tf(t,e){return-(t<e)||+(t>e)}a(tf,"compareStrings");function IE(t,e){return tf(t.path,e.path)}a(IE,"comparePath");function CE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}a(CE,"normalizeMode");var or=2**32;function cE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),o=(r-n*1e3)*1e6;return[n,o]}a(cE,"SecondsNanoseconds");function zn(t){let[e,r]=cE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=cE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%or,ctimeNanoseconds:r%or,mtimeSeconds:i%or,mtimeNanoseconds:n%or,dev:t.dev%or,ino:t.ino%or,mode:CE(t.mode%or),uid:t.uid%or,gid:t.gid%or,size:t.size>-1?t.size%or:0}}a(zn,"normalizeStats");function eL(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}a(eL,"toHex");var lp=null;async function _r(t){return lp===null&&(lp=await rL()),lp?DE(t):tL(t)}a(_r,"shasum");function tL(t){return new AE().update(t).digest("hex")}a(tL,"shasumSync");async function DE(t){let e=await crypto.subtle.digest("SHA-1",t);return eL(e)}a(DE,"subtleSHA1");async function rL(){try{return await DE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch{}return!1}a(rL,"testSubtleSHA1");function iL(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}a(iL,"parseCacheEntryFlags");function nL(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}a(nL,"renderCacheEntryFlags");var Gr=class Gr{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(Buffer.isBuffer(e))return Gr.fromBuffer(e);if(e===null)return new Gr(null);throw new W("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new W("Index file is empty (.git/index)");let r=new Gr,i=new Tt(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new W(`Invalid dircache magic file number: ${n}`);let o=await _r(e.slice(0,-20)),s=e.slice(-20).toString("hex");if(s!==o)throw new W(`Invalid checksum in GitIndex buffer: expected ${s} but saw ${o}`);let l=i.readUInt32BE();if(l!==2)throw new W(`Unsupported dircache version: ${l}`);let f=i.readUInt32BE(),c=0;for(;!i.eof()&&c<f;){let u={};u.ctimeSeconds=i.readUInt32BE(),u.ctimeNanoseconds=i.readUInt32BE(),u.mtimeSeconds=i.readUInt32BE(),u.mtimeNanoseconds=i.readUInt32BE(),u.dev=i.readUInt32BE(),u.ino=i.readUInt32BE(),u.mode=i.readUInt32BE(),u.uid=i.readUInt32BE(),u.gid=i.readUInt32BE(),u.size=i.readUInt32BE(),u.oid=i.slice(20).toString("hex");let h=i.readUInt16BE();u.flags=iL(h);let d=e.indexOf(0,i.tell()+1)-i.tell();if(d<1)throw new W(`Got a path length of: ${d}`);if(u.path=i.toString("utf8",d),u.path.includes("..\\")||u.path.includes("../"))throw new qn(u.path);let p=8-(i.tell()-12)%8;for(p===0&&(p=8);p--;){let m=i.readUInt8();if(m!==0)throw new W(`Expected 1-8 null characters but got '${m}' after ${u.path}`);if(i.eof())throw new W("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(IE)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=zn(r);let o=Buffer.from(e),s={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:e,oid:i,flags:{assumeValid:!1,extended:!1,stage:n,nameLength:o.length<4095?o.length:4095},stages:[]};this._addEntry(s),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let r of this._entries.keys())r.startsWith(e+"/")&&this._entries.delete(r);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(`
|
|
14
|
+
`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=Buffer.alloc(i),o=new Tt(n),s=zn(e);return o.writeUInt32BE(s.ctimeSeconds),o.writeUInt32BE(s.ctimeNanoseconds),o.writeUInt32BE(s.mtimeSeconds),o.writeUInt32BE(s.mtimeNanoseconds),o.writeUInt32BE(s.dev),o.writeUInt32BE(s.ino),o.writeUInt32BE(s.mode),o.writeUInt32BE(s.uid),o.writeUInt32BE(s.gid),o.writeUInt32BE(s.size),o.write(e.oid,20,"hex"),o.writeUInt16BE(nL(e)),o.write(e.path,r.length,"utf8"),n}async toObject(){let e=Buffer.alloc(12),r=new Tt(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let i=[];for(let l of this.entries)if(i.push(Gr._entryToBuffer(l)),l.stages.length>1)for(let f of l.stages)f&&f!==l&&i.push(Gr._entryToBuffer(f));i=await Promise.all(i);let n=Buffer.concat(i),o=Buffer.concat([e,n]),s=await _r(o);return Buffer.concat([o,Buffer.from(s,"hex")])}};a(Gr,"GitIndex");var vp=Gr;function sc(t,e,r=!0,i=!0){let n=zn(t),o=zn(e);return r&&n.mode!==o.mode||n.mtimeSeconds!==o.mtimeSeconds||n.ctimeSeconds!==o.ctimeSeconds||n.uid!==o.uid||n.gid!==o.gid||i&&n.ino!==o.ino||n.size!==o.size}a(sc,"compareStats");var cp=null,fp=Symbol("IndexCache");function oL(){return{map:new Map,stats:new Map}}a(oL,"createCache");async function sL(t,e,r){let[i,n]=await Promise.all([t.lstat(e),t.read(e)]),o=await vp.from(n);r.map.set(e,o),r.stats.set(e,i)}a(sL,"updateCachedIndexFile");async function aL(t,e,r){let i=r.stats.get(e);if(i===void 0)return!0;if(i===null)return!1;let n=await t.lstat(e);return n===null?!1:sc(i,n)}a(aL,"isIndexStale");var jp=class jp{static async acquire({fs:e,gitdir:r,cache:i,allowUnmerged:n=!0},o){i[fp]||(i[fp]=oL());let s=`${r}/index`;cp===null&&(cp=new ps({maxPending:1/0}));let l,f=[];return await cp.acquire(s,async()=>{let c=i[fp];await aL(e,s,c)&&await sL(e,s,c);let u=c.map.get(s);if(f=u.unmergedPaths,f.length&&!n)throw new ys(f);if(l=await o(u),u._dirty){let h=await u.toObject();await e.write(s,h),c.stats.set(s,await e.lstat(s)),u._dirty=!1}}),l}};a(jp,"GitIndexManager");var Fe=jp;function ac(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}a(ac,"basename");function Wn(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}a(Wn,"dirname");function NE(t){let e=new Map,r=a(function(n){if(!e.has(n)){let o={type:"tree",fullpath:n,basename:ac(n),metadata:{},children:[]};e.set(n,o),o.parent=r(Wn(n)),o.parent&&o.parent!==o&&o.parent.children.push(o)}return e.get(n)},"mkdir"),i=a(function(n,o){if(!e.has(n)){let s={type:"blob",fullpath:n,basename:ac(n),metadata:o,parent:r(Wn(n)),children:[]};s.parent&&s.parent.children.push(s),e.set(n,s)}return e.get(n)},"mkfile");r(".");for(let n of t)i(n.path,n);return e}a(NE,"flatFileListToDirectoryStructure");function lL(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new W(`Unexpected GitTree entry mode: ${t.toString(8)}`)}a(lL,"mode2type");var Up=class Up{constructor({fs:e,gitdir:r,cache:i}){var o;this.treePromise=Fe.acquire({fs:e,gitdir:r,cache:i},async function(s){return NE(s.entries)});let n=this;this.ConstructEntry=(o=class{constructor(l){this._fullpath=l,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}},a(o,"StageEntry"),o)}async readdir(e){let r=e._fullpath,n=(await this.treePromise).get(r);if(!n||n.type==="blob")return null;if(n.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let o=n.children.map(s=>s.fullpath);return o.sort(tf),o}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let i=(await this.treePromise).get(e._fullpath);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=i.type==="tree"?{}:zn(i.metadata);e._type=i.type==="tree"?"tree":lL(n.mode),e._mode=n.mode,i.type==="tree"?e._stat=void 0:e._stat=n}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let i=(await this.treePromise).get(e._fullpath);e._oid=i.metadata.oid}return e._oid}};a(Up,"GitWalkerIndex");var _p=Up,rf=Symbol("GitWalkSymbol");function Bi(){let t=Object.create(null);return Object.defineProperty(t,rf,{value:a(function({fs:e,gitdir:r,cache:i}){return new _p({fs:e,gitdir:r,cache:i})},"value")}),Object.freeze(t),t}a(Bi,"STAGE");var vc=class vc extends ie{constructor(e){super(`Could not find ${e}.`),this.code=this.name=vc.code,this.data={what:e}}};a(vc,"NotFoundError");var fe=vc;fe.code="NotFoundError";var _c=class _c extends ie{constructor(e,r,i,n){super(`Object ${e} ${n?`at ${n}`:""}was anticipated to be a ${i} but it is a ${r}.`),this.code=this.name=_c.code,this.data={oid:e,actual:r,expected:i,filepath:n}}};a(_c,"ObjectTypeError");var Xe=_c;Xe.code="ObjectTypeError";var Fc=class Fc extends ie{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=Fc.code,this.data={value:e}}};a(Fc,"InvalidOidError");var Zr=Fc;Zr.code="InvalidOidError";var Ec=class Ec extends ie{constructor(e){super(`Could not find a fetch refspec for remote "${e}". Make sure the config file has an entry like the following:
|
|
15
15
|
[remote "${e}"]
|
|
16
16
|
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
17
|
-
`),this.code=this.name=
|
|
18
|
-
`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let o=i.slice(1);return this.refs.set(r+"^{}",o),{line:i,ref:r,peeled:o}}else{let o=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,o),{line:i,ref:r,oid:o}}})}return this}static from(e){return new
|
|
17
|
+
`),this.code=this.name=Ec.code,this.data={remote:e}}};a(Ec,"NoRefspecError");var gs=Ec;gs.code="NoRefspecError";var Sc=class Sc{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(`
|
|
18
|
+
`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let o=i.slice(1);return this.refs.set(r+"^{}",o),{line:i,ref:r,peeled:o}}else{let o=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,o),{line:i,ref:r,oid:o}}})}return this}static from(e){return new Sc(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(`
|
|
19
19
|
`)+`
|
|
20
|
-
`}};a(
|
|
21
|
-
`).map(n=>{let o=null,s=null,l=n.trim(),f=
|
|
22
|
-
`)}};a(
|
|
23
|
-
`,"utf8"));return{pruned:w}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new
|
|
24
|
-
`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await
|
|
25
|
-
`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return Te.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(l=>e.rm(
|
|
26
|
-
`)}toObject(){let e=[...this._entries];return e.sort(wL),Buffer.concat(e.map(r=>{let i=Buffer.from(r.mode.replace(/^0/,"")),n=Buffer.from(" "),o=Buffer.from(r.path,"utf8"),s=Buffer.from([0]),l=Buffer.from(r.oid,"hex");return Buffer.concat([i,n,o,s,l])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}};a(Tc,"GitTree");var tt=Tc,Hp=class Hp{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,o=n+r.length,s=new Uint8Array(o);for(let l=0;l<n;l++)s[l]=i.charCodeAt(l);return s.set(r,n),s}static unwrap(e){let r=e.indexOf(32),i=e.indexOf(0),n=e.slice(0,r).toString("utf8"),o=e.slice(r+1,i).toString("utf8"),s=e.length-(i+1);if(parseInt(o)!==s)throw new W(`Length mismatch: expected ${o} bytes but got ${s} instead.`);return{type:n,object:Buffer.from(e.slice(i+1))}}};a(Hp,"GitObject");var Kr=Hp;async function CE({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`,n=await t.read(`${e}/${i}`);return n?{object:n,format:"deflated",source:i}:null}a(CE,"readObjectLoose");function vL(t,e){let r=new St(t),i=hE(r);if(i!==e.byteLength)throw new W(`applyDelta expected source buffer to be ${i} bytes but the provided buffer was ${e.length} bytes`);let n=hE(r),o,s=pE(r,e);if(s.byteLength===n)o=s;else{o=Buffer.alloc(n);let l=new St(o);for(l.copy(s);!r.eof();)l.copy(pE(r,e));let f=l.tell();if(n!==f)throw new W(`applyDelta expected target buffer to be ${n} bytes but the resulting buffer was ${f} bytes`)}return o}a(vL,"applyDelta");function hE(t){let e=0,r=0,i=null;do i=t.readUInt8(),e|=(i&127)<<r,r+=7;while(i&128);return e}a(hE,"readVarIntLE");function dE(t,e,r){let i=0,n=0;for(;r--;)e&1&&(i|=t.readUInt8()<<n),e>>=1,n+=8;return i}a(dE,"readCompactLE");function pE(t,e){let r=t.readUInt8(),i=128,n=15,o=112;if(r&i){let s=dE(t,r&n,4),l=dE(t,(r&o)>>4,3);return l===0&&(l=65536),e.slice(s,s+l)}else return t.slice(r)}a(pE,"readOp");function _L(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}a(_L,"fromValue");function NE(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:_L(t)}a(NE,"getIterator");var qp=class qp{constructor(e){if(typeof Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=NE(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>FL(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};a(qp,"StreamReader");var lc=qp;function FL(t){return t.reduce((e,r)=>e+r.length,0)}a(FL,"lengthBuffers");async function EL(t,e){let r=new lc(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new W(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new W(`Invalid packfile version: ${n}`);let o=await r.read(4);if(o=o.readUInt32BE(0),!(o<1))for(;!r.eof()&&o--;){let s=r.tell(),{type:l,length:f,ofs:c,reference:u}=await SL(r),h=new Ap.Inflate;for(;!h.result;){let d=await r.chunk();if(!d)break;if(h.push(d,!1),h.err)throw new W(`Pako error: ${h.msg}`);if(h.result){if(h.result.length!==f)throw new W("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-h.strm.avail_in);let p=r.tell();await e({data:h.result,type:l,num:o,offset:s,end:p,reference:u,ofs:c})}}}}a(EL,"listpack");async function SL(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let s=4;do e=await t.byte(),i|=(e&127)<<s,s+=7;while(e&128)}let n,o;if(r===6){let s=0;n=0;let l=[];do e=await t.byte(),n|=(e&127)<<s,s+=7,l.push(e);while(e&128);o=Buffer.from(l)}return r===7&&(o=await t.read(20)),{type:r,length:i,ofs:n,reference:o}}a(SL,"parseHeader");var up=!1;async function BE(t){return up===null&&(up=TL()),up?xL(t):Ap.inflate(t)}a(BE,"inflate");async function xL(t){let e=new DecompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}a(xL,"browserInflate");function TL(){try{if(new DecompressionStream("deflate"))return!0}catch{}return!1}a(TL,"testDecompressionStream");function OL(t){let e=[],r=0,i=0;do{r=t.readUInt8();let n=r&127;e.push(n),i=r&128}while(i);return e.reduce((n,o)=>n+1<<7|o,-1)}a(OL,"decodeVarInt");function RL(t,e){let r=e,i=4,n=null;do n=t.readUInt8(),r|=(n&127)<<i,i+=7;while(n&128);return r}a(RL,"otherVarIntDecode");var hs=class hs{constructor(e){Object.assign(this,e),this.offsetCache={}}static async fromIdx({idx:e,getExternalRefDelta:r}){let i=new St(e);if(i.slice(4).toString("hex")!=="ff744f63")return;let o=i.readUInt32BE();if(o!==2)throw new W(`Unable to read version ${o} packfile IDX. (Only version 2 supported)`);if(e.byteLength>2048*1024*1024)throw new W("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");i.seek(i.tell()+4*255);let s=i.readUInt32BE(),l=[];for(let u=0;u<s;u++){let h=i.slice(20).toString("hex");l[u]=h}i.seek(i.tell()+4*s);let f=new Map;for(let u=0;u<s;u++)f.set(l[u],i.readUInt32BE());let c=i.slice(20).toString("hex");return new hs({hashes:l,crcs:{},offsets:f,packfileSha:c,getExternalRefDelta:r})}static async fromPack({pack:e,getExternalRefDelta:r,onProgress:i}){let n={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},o={},s=e.slice(-20).toString("hex"),l=[],f={},c=new Map,u=null,h=null;await EL([e],async({data:y,type:v,reference:g,offset:F,num:O})=>{u===null&&(u=O);let S=Math.floor((u-O)*100/u);S!==h&&i&&await i({phase:"Receiving objects",loaded:u-O,total:u}),h=S,v=n[v],["commit","tree","blob","tag"].includes(v)?o[F]={type:v,offset:F}:v==="ofs-delta"?o[F]={type:v,offset:F}:v==="ref-delta"&&(o[F]={type:v,offset:F})});let d=Object.keys(o).map(Number);for(let[y,v]of d.entries()){let g=y+1===d.length?e.byteLength-20:d[y+1],F=o[v],O=WB.buf(e.slice(v,g))>>>0;F.end=g,F.crc=O}let p=new hs({pack:Promise.resolve(e),packfileSha:s,crcs:f,hashes:l,offsets:c,getExternalRefDelta:r});h=null;let m=0,w=[0,0,0,0,0,0,0,0,0,0,0,0];for(let y in o){y=Number(y);let v=Math.floor(m*100/u);v!==h&&i&&await i({phase:"Resolving deltas",loaded:m,total:u}),m++,h=v;let g=o[y];if(!g.oid)try{p.readDepth=0,p.externalReadDepth=0;let{type:F,object:O}=await p.readSlice({start:y});w[p.readDepth]+=1;let S=await br(Kr.wrap({type:F,object:O}));g.oid=S,l.push(S),c.set(S,y),f[S]=g.crc}catch{continue}}return l.sort(),p}async toBuffer(){let e=[],r=a((c,u)=>{e.push(Buffer.from(c,u))},"write");r("ff744f63","hex"),r("00000002","hex");let i=new St(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let h of this.hashes)parseInt(h.slice(0,2),16)<=c&&u++;i.writeUInt32BE(u)}e.push(i.buffer);for(let c of this.hashes)r(c,"hex");let n=new St(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)n.writeUInt32BE(this.crcs[c]);e.push(n.buffer);let o=new St(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)o.writeUInt32BE(this.offsets.get(c));e.push(o.buffer),r(this.packfileSha,"hex");let s=Buffer.concat(e),l=await br(s),f=Buffer.alloc(20);return f.write(l,"hex"),Buffer.concat([s,f])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new W(`Could not read object ${e} from packfile`)}let r=this.offsets.get(e);return this.readSlice({start:r})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new W("Tried to read from a GitPackIndex with no packfile loaded into memory");let i=(await this.pack).slice(e),n=new St(i),o=n.readUInt8(),s=o&112,l=r[s];if(l===void 0)throw new W("Unrecognized type: 0b"+s.toString(2));let f=o&15,c=f;o&128&&(c=RL(n,f));let h=null,d=null;if(l==="ofs_delta"){let m=OL(n),w=e-m;({object:h,type:l}=await this.readSlice({start:w}))}if(l==="ref_delta"){let m=n.slice(20).toString("hex");({object:h,type:l}=await this.read({oid:m}))}let p=i.slice(n.tell());if(d=Buffer.from(await BE(p)),d.byteLength!==c)throw new W(`Packfile told us object would have length ${c} but it had length ${d.byteLength}`);return h&&(d=Buffer.from(vL(d,h))),this.readDepth>3&&(this.offsetCache[e]={type:l,object:d}),{type:l,format:"content",object:d}}};a(hs,"GitPackIndex");var gs=hs,ic=Symbol("PackfileCache");async function kL({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){let o=await t.read(e);return gs.fromIdx({idx:o,getExternalRefDelta:r})}a(kL,"loadPackIndex");function Ip({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:o}){e[ic]||(e[ic]=new Map);let s=e[ic].get(r);return s||(s=kL({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:o}),e[ic].set(r,s)),s}a(Ip,"readPackIndex");async function PL({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:o}){let s=await t.readdir(D.join(r,"objects/pack"));s=s.filter(l=>l.endsWith(".idx"));for(let l of s){let f=`${r}/objects/pack/${l}`,c=await Ip({fs:t,cache:e,filename:f,getExternalRefDelta:o});if(c.error)throw new W(c.error);if(c.offsets.has(i)){if(!c.pack){let h=f.replace(/idx$/,"pack");c.pack=t.read(h)}let u=await c.read({oid:i,getExternalRefDelta:o});return u.format="content",u.source=`objects/pack/${l.replace(/idx$/,"pack")}`,u}}return null}a(PL,"readObjectPacked");async function de({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let o=a(u=>de({fs:t,cache:e,gitdir:r,oid:u}),"getExternalRefDelta"),s;if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(s={format:"wrapped",object:Buffer.from("tree 0\0")}),s||(s=await CE({fs:t,gitdir:r,oid:i})),!s){if(s=await PL({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:o}),!s)throw new ce(i);return s}if(n==="deflated"||(s.format==="deflated"&&(s.object=Buffer.from(await BE(s.object)),s.format="wrapped"),n==="wrapped"))return s;let l=await br(s.object);if(l!==i)throw new W(`SHA check failed! Expected ${i}, computed ${l}`);let{object:f,type:c}=Kr.unwrap(s.object);if(s.type=c,s.object=f,s.format="content",n==="content")return s;throw new W(`invalid requested format "${n}"`)}a(de,"_readObject");var Oc=class Oc extends re{constructor(e,r,i=!0){super(`Failed to create ${e} at ${r} because it already exists.${i?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=Oc.code,this.data={noun:e,where:r,canForce:i}}};a(Oc,"AlreadyExistsError");var Nt=Oc;Nt.code="AlreadyExistsError";var Rc=class Rc extends re{constructor(e,r,i){super(`Found multiple ${e} matching "${r}" (${i.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=Rc.code,this.data={nouns:e,short:r,matches:i}}};a(Rc,"AmbiguousError");var bs=Rc;bs.code="AmbiguousError";var kc=class kc extends re{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=kc.code,this.data={filepaths:e}}};a(kc,"CheckoutConflictError");var vs=kc;vs.code="CheckoutConflictError";var Pc=class Pc extends re{constructor(e,r){super(`Failed to checkout "${e}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Pc.code,this.data={ref:e,oid:r}}};a(Pc,"CommitNotFetchedError");var _s=Pc;_s.code="CommitNotFetchedError";var Ac=class Ac extends re{constructor(){super("Empty response from git server."),this.code=this.name=Ac.code,this.data={}}};a(Ac,"EmptyServerResponseError");var Fs=Ac;Fs.code="EmptyServerResponseError";var Ic=class Ic extends re{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=Ic.code,this.data={}}};a(Ic,"FastForwardError");var Es=Ic;Es.code="FastForwardError";var Dc=class Dc extends re{constructor(e,r){super(`One or more branches were not updated: ${e}`),this.code=this.name=Dc.code,this.data={prettyDetails:e,result:r}}};a(Dc,"GitPushError");var Ss=Dc;Ss.code="GitPushError";var Cc=class Cc extends re{constructor(e,r,i){super(`HTTP Error: ${e} ${r}`),this.code=this.name=Cc.code,this.data={statusCode:e,statusMessage:r,response:i}}};a(Cc,"HttpError");var qn=Cc;qn.code="HttpError";var Nc=class Nc extends re{constructor(e){let r="invalid filepath";e==="leading-slash"||e==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=Nc.code,this.data={reason:e}}};a(Nc,"InvalidFilepathError");var Zr=Nc;Zr.code="InvalidFilepathError";var Bc=class Bc extends re{constructor(e,r){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=Bc.code,this.data={ref:e,suggestion:r}}};a(Bc,"InvalidRefNameError");var Bt=Bc;Bt.code="InvalidRefNameError";var Lc=class Lc extends re{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=Lc.code,this.data={depth:e}}};a(Lc,"MaxDepthError");var xs=Lc;xs.code="MaxDepthError";var $c=class $c extends re{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=$c.code,this.data={}}};a($c,"MergeNotSupportedError");var zn=$c;zn.code="MergeNotSupportedError";var Mc=class Mc extends re{constructor(e,r,i,n){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=Mc.code,this.data={filepaths:e,bothModified:r,deleteByUs:i,deleteByTheirs:n}}};a(Mc,"MergeConflictError");var Wn=Mc;Wn.code="MergeConflictError";var jc=class jc extends re{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=jc.code,this.data={role:e}}};a(jc,"MissingNameError");var ze=jc;ze.code="MissingNameError";var Uc=class Uc extends re{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=Uc.code,this.data={parameter:e}}};a(Uc,"MissingParameterError");var et=Uc;et.code="MissingParameterError";var Hc=class Hc extends re{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=Hc.code,this.data={errors:e},this.errors=e}};a(Hc,"MultipleGitError");var Ts=Hc;Ts.code="MultipleGitError";var qc=class qc extends re{constructor(e,r){super(`Expected "${e}" but received "${r}".`),this.code=this.name=qc.code,this.data={expected:e,actual:r}}};a(qc,"ParseError");var Pi=qc;Pi.code="ParseError";var zc=class zc extends re{constructor(e){let r="";e==="not-fast-forward"?r=" because it was not a simple fast-forward":e==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=zc.code,this.data={reason:e}}};a(zc,"PushRejectedError");var Vn=zc;Vn.code="PushRejectedError";var Wc=class Wc extends re{constructor(e,r){super(`Remote does not support the "${e}" so the "${r}" parameter cannot be used.`),this.code=this.name=Wc.code,this.data={capability:e,parameter:r}}};a(Wc,"RemoteCapabilityError");var Vr=Wc;Vr.code="RemoteCapabilityError";var Vc=class Vc extends re{constructor(e,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=Vc.code,this.data={preview:e,response:r}}};a(Vc,"SmartHttpError");var Os=Vc;Os.code="SmartHttpError";var Gc=class Gc extends re{constructor(e,r,i){super(`Git remote "${e}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=Gc.code,this.data={url:e,transport:r,suggestion:i}}};a(Gc,"UnknownTransportError");var Rs=Gc;Rs.code="UnknownTransportError";var Kc=class Kc extends re{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=Kc.code,this.data={url:e}}};a(Kc,"UrlParseError");var ks=Kc;ks.code="UrlParseError";var Zc=class Zc extends re{constructor(){super("The operation was canceled."),this.code=this.name=Zc.code,this.data={}}};a(Zc,"UserCanceledError");var Gn=Zc;Gn.code="UserCanceledError";var Xc=class Xc extends re{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=Xc.code,this.data={filepath:e}}};a(Xc,"IndexResetError");var Ps=Xc;Ps.code="IndexResetError";var Yc=class Yc extends re{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=Yc.code,this.data={ref:e}}};a(Yc,"NoCommitError");var As=Yc;As.code="NoCommitError";var LE=Object.freeze({__proto__:null,AlreadyExistsError:Nt,AmbiguousError:bs,CheckoutConflictError:vs,CommitNotFetchedError:_s,EmptyServerResponseError:Fs,FastForwardError:Es,GitPushError:Ss,HttpError:qn,InternalError:W,InvalidFilepathError:Zr,InvalidOidError:Gr,InvalidRefNameError:Bt,MaxDepthError:xs,MergeNotSupportedError:zn,MergeConflictError:Wn,MissingNameError:ze,MissingParameterError:et,MultipleGitError:Ts,NoRefspecError:ys,NotFoundError:ce,ObjectTypeError:Ze,ParseError:Pi,PushRejectedError:Vn,RemoteCapabilityError:Vr,SmartHttpError:Os,UnknownTransportError:Rs,UnsafeFilepathError:jn,UrlParseError:ks,UserCanceledError:Gn,UnmergedPathsError:ws,IndexResetError:Ps,NoCommitError:As});function Sp({name:t,email:e,timestamp:r,timezoneOffset:i}){return i=AL(i),`${t} <${e}> ${r} ${i}`}a(Sp,"formatAuthor");function AL(t){let e=IL(DL(t));t=Math.abs(t);let r=Math.floor(t/60);t-=r*60;let i=String(r),n=String(t);return i.length<2&&(i="0"+i),n.length<2&&(n="0"+n),(e===-1?"-":"+")+i+n}a(AL,"formatTimezoneOffset");function IL(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}a(IL,"simpleSign");function DL(t){return t===0?t:-t}a(DL,"negateExceptForZero");function gr(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+`
|
|
27
|
-
`,t}a(
|
|
20
|
+
`}};a(Sc,"GitPackedRefs");var lc=Sc,xc=class xc{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,o,s]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),l=r==="+",f=n==="*";if(f!==(s==="*"))throw new W("Invalid refspec");return new xc({remotePath:i,localPath:o,force:l,matchPrefix:f})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}};a(xc,"GitRefSpec");var cc=xc,Tc=class Tc{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(cc.from(i));return new Tc(r)}add(e){let r=cc.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let o=i.translate(n);o&&r.push([n,o])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};a(Tc,"GitRefSpecSet");var Fp=Tc;function cL(t,e){let r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(r<i)||+(r>i);return n===0?t.endsWith("^{}")?1:-1:n}a(cL,"compareRefNames");var fL=a(t=>{if(typeof t=="number")return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},"num"),hs=a(t=>{if(typeof t=="boolean")return t;if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},"bool"),fE={core:{filemode:hs,bare:hs,logallrefupdates:hs,symlinks:hs,ignorecase:hs,bigFileThreshold:fL}},uL=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,hL=/^[A-Za-z0-9-.]+$/,dL=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,pL=/^[A-Za-z][A-Za-z-]*$/,mL=/^(.*?)( *[#;].*)$/,wL=a(t=>{let e=uL.exec(t);if(e!=null){let[r,i]=e.slice(1);return[r,i]}return null},"extractSectionLine"),yL=a(t=>{let e=dL.exec(t);if(e!=null){let[r,i="true"]=e.slice(1),n=gL(i),o=bL(n);return[r,o]}return null},"extractVariableLine"),gL=a(t=>{let e=mL.exec(t);if(e==null)return t;let[r,i]=e.slice(1);return uE(r)&&uE(i)?`${r}${i}`:r},"removeComments"),uE=a(t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,"hasOddNumberOfQuotes"),bL=a(t=>t.split("").reduce((e,r,i,n)=>{let o=r==='"'&&n[i-1]!=="\\",s=r==="\\"&&n[i+1]==='"';return o||s?e:e+r},""),"removeQuotes"),hE=a(t=>t!=null?t.toLowerCase():null,"lower"),Ep=a((t,e,r)=>[hE(t),e,hE(r)].filter(i=>i!=null).join("."),"getPath"),dE=a(t=>{let e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:Ep(r,n,i),sectionPath:Ep(r,n,null),isSection:!!r}},"normalizePath"),vL=a((t,e)=>t.reduce((r,i,n)=>e(i)?n:r,-1),"findLastIndex"),Oc=class Oc{constructor(e){let r=null,i=null;this.parsedConfig=e?e.split(`
|
|
21
|
+
`).map(n=>{let o=null,s=null,l=n.trim(),f=wL(l),c=f!=null;if(c)[r,i]=f;else{let h=yL(l);h!=null&&([o,s]=h)}let u=Ep(r,i,o);return{line:n,isSection:c,section:r,subsection:i,name:o,value:s,path:u}}):[]}static from(e){return new Oc(e)}async get(e,r=!1){let i=dE(e).path,n=this.parsedConfig.filter(o=>o.path===i).map(({section:o,name:s,value:l})=>{let f=fE[o]&&fE[o][s];return f?f(l):l});return r?n:n.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(r=>r.isSection&&r.section===e).map(r=>r.subsection)}async deleteSection(e,r){this.parsedConfig=this.parsedConfig.filter(i=>!(i.section===e&&i.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,i=!1){let{section:n,subsection:o,name:s,path:l,sectionPath:f,isSection:c}=dE(e),u=vL(this.parsedConfig,h=>h.path===l);if(r==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let h=this.parsedConfig[u],d=Object.assign({},h,{name:s,value:r,modified:!0});i?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let h=this.parsedConfig.findIndex(p=>p.path===f),d={section:n,subsection:o,name:s,value:r,modified:!0,path:l};if(hL.test(n)&&pL.test(s))if(h>=0)this.parsedConfig.splice(h+1,0,d);else{let p={isSection:c,section:n,subsection:o,modified:!0,path:f};this.parsedConfig.push(p,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:i,name:n,value:o,modified:s=!1})=>s?n!=null&&o!=null?typeof o=="string"&&/[#;]/.test(o)?` ${n} = "${o}"`:` ${n} = ${o}`:i!=null?`[${r} "${i}"]`:`[${r}]`:e).join(`
|
|
22
|
+
`)}};a(Oc,"GitConfig");var Sp=Oc,Hp=class Hp{static async get({fs:e,gitdir:r}){let i=await e.read(`${r}/config`,{encoding:"utf8"});return Sp.from(i)}static async save({fs:e,gitdir:r,config:i}){await e.write(`${r}/config`,i.toString(),{encoding:"utf8"})}};a(Hp,"GitConfigManager");var be=Hp,nc=a(t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],"refpaths"),_L=["config","description","index","shallow","commondir"],up;async function Vr(t,e){return up===void 0&&(up=new ps),up.acquire(t,e)}a(Vr,"acquireLock");var Te=class Te{static async updateRemoteRefs({fs:e,gitdir:r,remote:i,refs:n,symrefs:o,tags:s,refspecs:l=void 0,prune:f=!1,pruneTags:c=!1}){for(let y of n.values())if(!y.match(/[0-9a-f]{40}/))throw new Zr(y);let u=await be.get({fs:e,gitdir:r});if(!l){if(l=await u.getall(`remote.${i}.fetch`),l.length===0)throw new gs(i);l.unshift(`+HEAD:refs/remotes/${i}/HEAD`)}let h=Fp.from(l),d=new Map;if(c){let y=await Te.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await Te.deleteRefs({fs:e,gitdir:r,refs:y.map(v=>`refs/tags/${v}`)})}if(s){for(let y of n.keys())if(y.startsWith("refs/tags")&&!y.endsWith("^{}")&&!await Te.exists({fs:e,gitdir:r,ref:y})){let v=n.get(y);d.set(y,v)}}let p=h.translate([...n.keys()]);for(let[y,v]of p){let g=n.get(y);d.set(v,g)}let m=h.translate([...o.keys()]);for(let[y,v]of m){let g=o.get(y),_=h.translateOne(g);_&&d.set(v,`ref: ${_}`)}let w=[];if(f){for(let y of h.localNamespaces()){let v=(await Te.listRefs({fs:e,gitdir:r,filepath:y})).map(g=>`${y}/${g}`);for(let g of v)d.has(g)||w.push(g)}w.length>0&&await Te.deleteRefs({fs:e,gitdir:r,refs:w})}for(let[y,v]of d)await Vr(y,async()=>e.write(C.join(r,y),`${v.trim()}
|
|
23
|
+
`,"utf8"));return{pruned:w}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new Zr(n);await Vr(i,async()=>e.write(C.join(r,i),`${n.trim()}
|
|
24
|
+
`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await Vr(i,async()=>e.write(C.join(r,i),`ref: ${n.trim()}
|
|
25
|
+
`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return Te.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(l=>e.rm(C.join(r,l))));let n=await Vr("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),o=lc.from(n),s=o.refs.size;for(let l of i)o.refs.has(l)&&o.delete(l);o.refs.size<s&&(n=o.toString(),await Vr("packed-refs",async()=>e.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),Te.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let o=await Te.packedRefs({fs:e,gitdir:r}),s=nc(i).filter(l=>!_L.includes(l));for(let l of s){let f=await Vr(l,async()=>await e.read(`${r}/${l}`,{encoding:"utf8"})||o.get(l));if(f)return Te.resolve({fs:e,gitdir:r,ref:f.trim(),depth:n})}throw new fe(i)}static async exists({fs:e,gitdir:r,ref:i}){try{return await Te.expand({fs:e,gitdir:r,ref:i}),!0}catch{return!1}}static async expand({fs:e,gitdir:r,ref:i}){if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let n=await Te.packedRefs({fs:e,gitdir:r}),o=nc(i);for(let s of o)if(await Vr(s,async()=>e.exists(`${r}/${s}`))||n.has(s))return s;throw new fe(i)}static async expandAgainstMap({ref:e,map:r}){let i=nc(e);for(let n of i)if(await r.has(n))return n;throw new fe(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:i=void 0,map:n}){if(i!==void 0&&(i--,i===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),Te.resolveAgainstMap({ref:e,fullref:r,depth:i,map:n});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let o=nc(e);for(let s of o){let l=n.get(s);if(l)return Te.resolveAgainstMap({ref:l.trim(),fullref:s,depth:i,map:n})}throw new fe(e)}static async packedRefs({fs:e,gitdir:r}){let i=await Vr("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return lc.from(i).refs}static async listRefs({fs:e,gitdir:r,filepath:i}){let n=Te.packedRefs({fs:e,gitdir:r}),o=null;try{o=await e.readdirDeep(`${r}/${i}`),o=o.map(s=>s.replace(`${r}/${i}/`,""))}catch{o=[]}for(let s of(await n).keys())s.startsWith(i)&&(s=s.replace(i+"/",""),o.includes(s)||o.push(s));return o.sort(cL),o}static async listBranches({fs:e,gitdir:r,remote:i}){return i?Te.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${i}`}):Te.listRefs({fs:e,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:r}){return(await Te.listRefs({fs:e,gitdir:r,filepath:"refs/tags"})).filter(n=>!n.endsWith("^{}"))}};a(Te,"GitRefManager");var N=Te;function FL(t,e){return tf(pE(t),pE(e))}a(FL,"compareTreeEntryPath");function pE(t){return t.mode==="040000"?t.path+"/":t.path}a(pE,"appendSlashIfDir");function BE(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new W(`Unexpected GitTree entry mode: ${t}`)}a(BE,"mode2type$1");function EL(t){let e=[],r=0;for(;r<t.length;){let i=t.indexOf(32,r);if(i===-1)throw new W(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);let n=t.indexOf(0,r);if(n===-1)throw new W(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let o=t.slice(r,i).toString("utf8");o==="40000"&&(o="040000");let s=BE(o),l=t.slice(i+1,n).toString("utf8");if(l.includes("\\")||l.includes("/"))throw new qn(l);let f=t.slice(n+1,n+21).toString("hex");r=n+21,e.push({mode:o,path:l,oid:f,type:s})}return e}a(EL,"parseBuffer");function SL(t){if(typeof t=="number"&&(t=t.toString(8)),t.match(/^0?4.*/))return"040000";if(t.match(/^1006.*/))return"100644";if(t.match(/^1007.*/))return"100755";if(t.match(/^120.*/))return"120000";if(t.match(/^160.*/))return"160000";throw new W(`Could not understand file mode: ${t}`)}a(SL,"limitModeToAllowed");function xL(t){return!t.oid&&t.sha&&(t.oid=t.sha),t.mode=SL(t.mode),t.type||(t.type=BE(t.mode)),t}a(xL,"nudgeIntoShape");var kc=class kc{constructor(e){if(Buffer.isBuffer(e))this._entries=EL(e);else if(Array.isArray(e))this._entries=e.map(xL);else throw new W("invalid type passed to GitTree constructor");this._entries.sort(IE)}static from(e){return new kc(e)}render(){return this._entries.map(e=>`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(`
|
|
26
|
+
`)}toObject(){let e=[...this._entries];return e.sort(FL),Buffer.concat(e.map(r=>{let i=Buffer.from(r.mode.replace(/^0/,"")),n=Buffer.from(" "),o=Buffer.from(r.path,"utf8"),s=Buffer.from([0]),l=Buffer.from(r.oid,"hex");return Buffer.concat([i,n,o,s,l])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}};a(kc,"GitTree");var it=kc,qp=class qp{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,o=n+r.length,s=new Uint8Array(o);for(let l=0;l<n;l++)s[l]=i.charCodeAt(l);return s.set(r,n),s}static unwrap(e){let r=e.indexOf(32),i=e.indexOf(0),n=e.slice(0,r).toString("utf8"),o=e.slice(r+1,i).toString("utf8"),s=e.length-(i+1);if(parseInt(o)!==s)throw new W(`Length mismatch: expected ${o} bytes but got ${s} instead.`);return{type:n,object:Buffer.from(e.slice(i+1))}}};a(qp,"GitObject");var Xr=qp;async function LE({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`,n=await t.read(`${e}/${i}`);return n?{object:n,format:"deflated",source:i}:null}a(LE,"readObjectLoose");function TL(t,e){let r=new Tt(t),i=mE(r);if(i!==e.byteLength)throw new W(`applyDelta expected source buffer to be ${i} bytes but the provided buffer was ${e.length} bytes`);let n=mE(r),o,s=yE(r,e);if(s.byteLength===n)o=s;else{o=Buffer.alloc(n);let l=new Tt(o);for(l.copy(s);!r.eof();)l.copy(yE(r,e));let f=l.tell();if(n!==f)throw new W(`applyDelta expected target buffer to be ${n} bytes but the resulting buffer was ${f} bytes`)}return o}a(TL,"applyDelta");function mE(t){let e=0,r=0,i=null;do i=t.readUInt8(),e|=(i&127)<<r,r+=7;while(i&128);return e}a(mE,"readVarIntLE");function wE(t,e,r){let i=0,n=0;for(;r--;)e&1&&(i|=t.readUInt8()<<n),e>>=1,n+=8;return i}a(wE,"readCompactLE");function yE(t,e){let r=t.readUInt8(),i=128,n=15,o=112;if(r&i){let s=wE(t,r&n,4),l=wE(t,(r&o)>>4,3);return l===0&&(l=65536),e.slice(s,s+l)}else return t.slice(r)}a(yE,"readOp");function OL(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}a(OL,"fromValue");function $E(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:OL(t)}a($E,"getIterator");var zp=class zp{constructor(e){if(typeof Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=$E(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>kL(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};a(zp,"StreamReader");var fc=zp;function kL(t){return t.reduce((e,r)=>e+r.length,0)}a(kL,"lengthBuffers");async function RL(t,e){let r=new fc(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new W(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new W(`Invalid packfile version: ${n}`);let o=await r.read(4);if(o=o.readUInt32BE(0),!(o<1))for(;!r.eof()&&o--;){let s=r.tell(),{type:l,length:f,ofs:c,reference:u}=await PL(r),h=new Ip.Inflate;for(;!h.result;){let d=await r.chunk();if(!d)break;if(h.push(d,!1),h.err)throw new W(`Pako error: ${h.msg}`);if(h.result){if(h.result.length!==f)throw new W("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-h.strm.avail_in);let p=r.tell();await e({data:h.result,type:l,num:o,offset:s,end:p,reference:u,ofs:c})}}}}a(RL,"listpack");async function PL(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let s=4;do e=await t.byte(),i|=(e&127)<<s,s+=7;while(e&128)}let n,o;if(r===6){let s=0;n=0;let l=[];do e=await t.byte(),n|=(e&127)<<s,s+=7,l.push(e);while(e&128);o=Buffer.from(l)}return r===7&&(o=await t.read(20)),{type:r,length:i,ofs:n,reference:o}}a(PL,"parseHeader");var hp=!1;async function ME(t){return hp===null&&(hp=IL()),hp?AL(t):Ip.inflate(t)}a(ME,"inflate");async function AL(t){let e=new DecompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}a(AL,"browserInflate");function IL(){try{if(new DecompressionStream("deflate"))return!0}catch{}return!1}a(IL,"testDecompressionStream");function CL(t){let e=[],r=0,i=0;do{r=t.readUInt8();let n=r&127;e.push(n),i=r&128}while(i);return e.reduce((n,o)=>n+1<<7|o,-1)}a(CL,"decodeVarInt");function DL(t,e){let r=e,i=4,n=null;do n=t.readUInt8(),r|=(n&127)<<i,i+=7;while(n&128);return r}a(DL,"otherVarIntDecode");var ds=class ds{constructor(e){Object.assign(this,e),this.offsetCache={}}static async fromIdx({idx:e,getExternalRefDelta:r}){let i=new Tt(e);if(i.slice(4).toString("hex")!=="ff744f63")return;let o=i.readUInt32BE();if(o!==2)throw new W(`Unable to read version ${o} packfile IDX. (Only version 2 supported)`);if(e.byteLength>2048*1024*1024)throw new W("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");i.seek(i.tell()+4*255);let s=i.readUInt32BE(),l=[];for(let u=0;u<s;u++){let h=i.slice(20).toString("hex");l[u]=h}i.seek(i.tell()+4*s);let f=new Map;for(let u=0;u<s;u++)f.set(l[u],i.readUInt32BE());let c=i.slice(20).toString("hex");return new ds({hashes:l,crcs:{},offsets:f,packfileSha:c,getExternalRefDelta:r})}static async fromPack({pack:e,getExternalRefDelta:r,onProgress:i}){let n={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},o={},s=e.slice(-20).toString("hex"),l=[],f={},c=new Map,u=null,h=null;await RL([e],async({data:y,type:v,reference:g,offset:_,num:E})=>{u===null&&(u=E);let x=Math.floor((u-E)*100/u);x!==h&&i&&await i({phase:"Receiving objects",loaded:u-E,total:u}),h=x,v=n[v],["commit","tree","blob","tag"].includes(v)?o[_]={type:v,offset:_}:v==="ofs-delta"?o[_]={type:v,offset:_}:v==="ref-delta"&&(o[_]={type:v,offset:_})});let d=Object.keys(o).map(Number);for(let[y,v]of d.entries()){let g=y+1===d.length?e.byteLength-20:d[y+1],_=o[v],E=YB.buf(e.slice(v,g))>>>0;_.end=g,_.crc=E}let p=new ds({pack:Promise.resolve(e),packfileSha:s,crcs:f,hashes:l,offsets:c,getExternalRefDelta:r});h=null;let m=0,w=[0,0,0,0,0,0,0,0,0,0,0,0];for(let y in o){y=Number(y);let v=Math.floor(m*100/u);v!==h&&i&&await i({phase:"Resolving deltas",loaded:m,total:u}),m++,h=v;let g=o[y];if(!g.oid)try{p.readDepth=0,p.externalReadDepth=0;let{type:_,object:E}=await p.readSlice({start:y});w[p.readDepth]+=1;let x=await _r(Xr.wrap({type:_,object:E}));g.oid=x,l.push(x),c.set(x,y),f[x]=g.crc}catch{continue}}return l.sort(),p}async toBuffer(){let e=[],r=a((c,u)=>{e.push(Buffer.from(c,u))},"write");r("ff744f63","hex"),r("00000002","hex");let i=new Tt(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let h of this.hashes)parseInt(h.slice(0,2),16)<=c&&u++;i.writeUInt32BE(u)}e.push(i.buffer);for(let c of this.hashes)r(c,"hex");let n=new Tt(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)n.writeUInt32BE(this.crcs[c]);e.push(n.buffer);let o=new Tt(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)o.writeUInt32BE(this.offsets.get(c));e.push(o.buffer),r(this.packfileSha,"hex");let s=Buffer.concat(e),l=await _r(s),f=Buffer.alloc(20);return f.write(l,"hex"),Buffer.concat([s,f])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new W(`Could not read object ${e} from packfile`)}let r=this.offsets.get(e);return this.readSlice({start:r})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new W("Tried to read from a GitPackIndex with no packfile loaded into memory");let i=(await this.pack).slice(e),n=new Tt(i),o=n.readUInt8(),s=o&112,l=r[s];if(l===void 0)throw new W("Unrecognized type: 0b"+s.toString(2));let f=o&15,c=f;o&128&&(c=DL(n,f));let h=null,d=null;if(l==="ofs_delta"){let m=CL(n),w=e-m;({object:h,type:l}=await this.readSlice({start:w}))}if(l==="ref_delta"){let m=n.slice(20).toString("hex");({object:h,type:l}=await this.read({oid:m}))}let p=i.slice(n.tell());if(d=Buffer.from(await ME(p)),d.byteLength!==c)throw new W(`Packfile told us object would have length ${c} but it had length ${d.byteLength}`);return h&&(d=Buffer.from(TL(d,h))),this.readDepth>3&&(this.offsetCache[e]={type:l,object:d}),{type:l,format:"content",object:d}}};a(ds,"GitPackIndex");var bs=ds,oc=Symbol("PackfileCache");async function NL({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){let o=await t.read(e);return bs.fromIdx({idx:o,getExternalRefDelta:r})}a(NL,"loadPackIndex");function Cp({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:o}){e[oc]||(e[oc]=new Map);let s=e[oc].get(r);return s||(s=NL({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:o}),e[oc].set(r,s)),s}a(Cp,"readPackIndex");async function BL({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:o}){let s=await t.readdir(C.join(r,"objects/pack"));s=s.filter(l=>l.endsWith(".idx"));for(let l of s){let f=`${r}/objects/pack/${l}`,c=await Cp({fs:t,cache:e,filename:f,getExternalRefDelta:o});if(c.error)throw new W(c.error);if(c.offsets.has(i)){if(!c.pack){let h=f.replace(/idx$/,"pack");c.pack=t.read(h)}let u=await c.read({oid:i,getExternalRefDelta:o});return u.format="content",u.source=`objects/pack/${l.replace(/idx$/,"pack")}`,u}}return null}a(BL,"readObjectPacked");async function de({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let o=a(u=>de({fs:t,cache:e,gitdir:r,oid:u}),"getExternalRefDelta"),s;if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(s={format:"wrapped",object:Buffer.from("tree 0\0")}),s||(s=await LE({fs:t,gitdir:r,oid:i})),!s){if(s=await BL({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:o}),!s)throw new fe(i);return s}if(n==="deflated"||(s.format==="deflated"&&(s.object=Buffer.from(await ME(s.object)),s.format="wrapped"),n==="wrapped"))return s;let l=await _r(s.object);if(l!==i)throw new W(`SHA check failed! Expected ${i}, computed ${l}`);let{object:f,type:c}=Xr.unwrap(s.object);if(s.type=c,s.object=f,s.format="content",n==="content")return s;throw new W(`invalid requested format "${n}"`)}a(de,"_readObject");var Rc=class Rc extends ie{constructor(e,r,i=!0){super(`Failed to create ${e} at ${r} because it already exists.${i?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=Rc.code,this.data={noun:e,where:r,canForce:i}}};a(Rc,"AlreadyExistsError");var Bt=Rc;Bt.code="AlreadyExistsError";var Pc=class Pc extends ie{constructor(e,r,i){super(`Found multiple ${e} matching "${r}" (${i.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=Pc.code,this.data={nouns:e,short:r,matches:i}}};a(Pc,"AmbiguousError");var vs=Pc;vs.code="AmbiguousError";var Ac=class Ac extends ie{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=Ac.code,this.data={filepaths:e}}};a(Ac,"CheckoutConflictError");var _s=Ac;_s.code="CheckoutConflictError";var Ic=class Ic extends ie{constructor(e,r){super(`Failed to checkout "${e}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Ic.code,this.data={ref:e,oid:r}}};a(Ic,"CommitNotFetchedError");var Fs=Ic;Fs.code="CommitNotFetchedError";var Cc=class Cc extends ie{constructor(){super("Empty response from git server."),this.code=this.name=Cc.code,this.data={}}};a(Cc,"EmptyServerResponseError");var Es=Cc;Es.code="EmptyServerResponseError";var Dc=class Dc extends ie{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=Dc.code,this.data={}}};a(Dc,"FastForwardError");var Ss=Dc;Ss.code="FastForwardError";var Nc=class Nc extends ie{constructor(e,r){super(`One or more branches were not updated: ${e}`),this.code=this.name=Nc.code,this.data={prettyDetails:e,result:r}}};a(Nc,"GitPushError");var xs=Nc;xs.code="GitPushError";var Bc=class Bc extends ie{constructor(e,r,i){super(`HTTP Error: ${e} ${r}`),this.code=this.name=Bc.code,this.data={statusCode:e,statusMessage:r,response:i}}};a(Bc,"HttpError");var Vn=Bc;Vn.code="HttpError";var Lc=class Lc extends ie{constructor(e){let r="invalid filepath";e==="leading-slash"||e==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=Lc.code,this.data={reason:e}}};a(Lc,"InvalidFilepathError");var Yr=Lc;Yr.code="InvalidFilepathError";var $c=class $c extends ie{constructor(e,r){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=$c.code,this.data={ref:e,suggestion:r}}};a($c,"InvalidRefNameError");var Lt=$c;Lt.code="InvalidRefNameError";var Mc=class Mc extends ie{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=Mc.code,this.data={depth:e}}};a(Mc,"MaxDepthError");var Ts=Mc;Ts.code="MaxDepthError";var jc=class jc extends ie{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=jc.code,this.data={}}};a(jc,"MergeNotSupportedError");var Gn=jc;Gn.code="MergeNotSupportedError";var Uc=class Uc extends ie{constructor(e,r,i,n){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=Uc.code,this.data={filepaths:e,bothModified:r,deleteByUs:i,deleteByTheirs:n}}};a(Uc,"MergeConflictError");var Kn=Uc;Kn.code="MergeConflictError";var Hc=class Hc extends ie{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=Hc.code,this.data={role:e}}};a(Hc,"MissingNameError");var ze=Hc;ze.code="MissingNameError";var qc=class qc extends ie{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=qc.code,this.data={parameter:e}}};a(qc,"MissingParameterError");var rt=qc;rt.code="MissingParameterError";var zc=class zc extends ie{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=zc.code,this.data={errors:e},this.errors=e}};a(zc,"MultipleGitError");var Os=zc;Os.code="MultipleGitError";var Wc=class Wc extends ie{constructor(e,r){super(`Expected "${e}" but received "${r}".`),this.code=this.name=Wc.code,this.data={expected:e,actual:r}}};a(Wc,"ParseError");var Ci=Wc;Ci.code="ParseError";var Vc=class Vc extends ie{constructor(e){let r="";e==="not-fast-forward"?r=" because it was not a simple fast-forward":e==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=Vc.code,this.data={reason:e}}};a(Vc,"PushRejectedError");var Zn=Vc;Zn.code="PushRejectedError";var Gc=class Gc extends ie{constructor(e,r){super(`Remote does not support the "${e}" so the "${r}" parameter cannot be used.`),this.code=this.name=Gc.code,this.data={capability:e,parameter:r}}};a(Gc,"RemoteCapabilityError");var Kr=Gc;Kr.code="RemoteCapabilityError";var Kc=class Kc extends ie{constructor(e,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=Kc.code,this.data={preview:e,response:r}}};a(Kc,"SmartHttpError");var ks=Kc;ks.code="SmartHttpError";var Zc=class Zc extends ie{constructor(e,r,i){super(`Git remote "${e}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=Zc.code,this.data={url:e,transport:r,suggestion:i}}};a(Zc,"UnknownTransportError");var Rs=Zc;Rs.code="UnknownTransportError";var Xc=class Xc extends ie{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=Xc.code,this.data={url:e}}};a(Xc,"UrlParseError");var Ps=Xc;Ps.code="UrlParseError";var Yc=class Yc extends ie{constructor(){super("The operation was canceled."),this.code=this.name=Yc.code,this.data={}}};a(Yc,"UserCanceledError");var Xn=Yc;Xn.code="UserCanceledError";var Jc=class Jc extends ie{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=Jc.code,this.data={filepath:e}}};a(Jc,"IndexResetError");var As=Jc;As.code="IndexResetError";var Qc=class Qc extends ie{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=Qc.code,this.data={ref:e}}};a(Qc,"NoCommitError");var Is=Qc;Is.code="NoCommitError";var jE=Object.freeze({__proto__:null,AlreadyExistsError:Bt,AmbiguousError:vs,CheckoutConflictError:_s,CommitNotFetchedError:Fs,EmptyServerResponseError:Es,FastForwardError:Ss,GitPushError:xs,HttpError:Vn,InternalError:W,InvalidFilepathError:Yr,InvalidOidError:Zr,InvalidRefNameError:Lt,MaxDepthError:Ts,MergeNotSupportedError:Gn,MergeConflictError:Kn,MissingNameError:ze,MissingParameterError:rt,MultipleGitError:Os,NoRefspecError:gs,NotFoundError:fe,ObjectTypeError:Xe,ParseError:Ci,PushRejectedError:Zn,RemoteCapabilityError:Kr,SmartHttpError:ks,UnknownTransportError:Rs,UnsafeFilepathError:qn,UrlParseError:Ps,UserCanceledError:Xn,UnmergedPathsError:ys,IndexResetError:As,NoCommitError:Is});function xp({name:t,email:e,timestamp:r,timezoneOffset:i}){return i=LL(i),`${t} <${e}> ${r} ${i}`}a(xp,"formatAuthor");function LL(t){let e=$L(ML(t));t=Math.abs(t);let r=Math.floor(t/60);t-=r*60;let i=String(r),n=String(t);return i.length<2&&(i="0"+i),n.length<2&&(n="0"+n),(e===-1?"-":"+")+i+n}a(LL,"formatTimezoneOffset");function $L(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}a($L,"simpleSign");function ML(t){return t===0?t:-t}a(ML,"negateExceptForZero");function vr(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+`
|
|
27
|
+
`,t}a(vr,"normalizeNewlines");function uc(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:jL(n)}}a(uc,"parseAuthor");function jL(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=(e==="+"?1:-1)*(Number(r)*60+Number(i)),UL(i)}a(jL,"parseTimezoneOffset");function UL(t){return t===0?t:-t}a(UL,"negateExceptForZero$1");var jn=class jn{constructor(e){if(typeof e=="string")this._tag=e;else if(Buffer.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=jn.render(e);else throw new W("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new jn(e)}static render(e){return`object ${e.object}
|
|
28
28
|
type ${e.type}
|
|
29
29
|
tag ${e.tag}
|
|
30
|
-
tagger ${
|
|
30
|
+
tagger ${xp(e.tagger)}
|
|
31
31
|
|
|
32
32
|
${e.message}
|
|
33
33
|
${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
|
@@ -36,49 +36,49 @@ ${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexO
|
|
|
36
36
|
|
|
37
37
|
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(`
|
|
38
38
|
`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=`
|
|
39
|
-
`+n.slice(1):r.push(n);let i={};for(let n of r){let o=n.slice(0,n.indexOf(" ")),s=n.slice(n.indexOf(" ")+1);Array.isArray(i[o])?i[o].push(s):i[o]=s}return i.tagger&&(i.tagger=
|
|
39
|
+
`+n.slice(1):r.push(n);let i={};for(let n of r){let o=n.slice(0,n.indexOf(" ")),s=n.slice(n.indexOf(" ")+1);Array.isArray(i[o])?i[o].push(s):i[o]=s}return i.tagger&&(i.tagger=uc(i.tagger)),i.committer&&(i.committer=uc(i.committer)),i}withoutSignature(){let e=vr(this._tag);return e.indexOf(`
|
|
40
40
|
-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(`
|
|
41
41
|
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
|
42
|
-
-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return
|
|
43
|
-
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:o}=await r({payload:n,secretKey:i});o=
|
|
42
|
+
-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return vr(e)}payload(){return this.withoutSignature()+`
|
|
43
|
+
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:o}=await r({payload:n,secretKey:i});o=vr(o);let s=n+o;return jn.from(s)}};a(jn,"GitAnnotatedTag");var dt=jn;function dp(t){return t.trim().split(`
|
|
44
44
|
`).map(e=>" "+e).join(`
|
|
45
45
|
`)+`
|
|
46
|
-
`}a(
|
|
46
|
+
`}a(dp,"indent");function HL(t){return t.split(`
|
|
47
47
|
`).map(e=>e.replace(/^ /,"")).join(`
|
|
48
|
-
`)}a(
|
|
49
|
-
gpgsig`+
|
|
50
|
-
`+n);return new
|
|
48
|
+
`)}a(HL,"outdent");var tt=class tt{constructor(e){if(typeof e=="string")this._commit=e;else if(Buffer.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=tt.render(e);else throw new W("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let i=tt.justHeaders(e),n=tt.justMessage(e),o=vr(i+`
|
|
49
|
+
gpgsig`+dp(r)+`
|
|
50
|
+
`+n);return new tt(o)}static from(e){return new tt(e)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return tt.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return vr(e.slice(e.indexOf(`
|
|
51
51
|
|
|
52
52
|
`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(`
|
|
53
53
|
|
|
54
|
-
`))}parseHeaders(){let e=
|
|
54
|
+
`))}parseHeaders(){let e=tt.justHeaders(this._commit).split(`
|
|
55
55
|
`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=`
|
|
56
|
-
`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let o=n.slice(0,n.indexOf(" ")),s=n.slice(n.indexOf(" ")+1);Array.isArray(i[o])?i[o].push(s):i[o]=s}return i.author&&(i.author=
|
|
56
|
+
`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let o=n.slice(0,n.indexOf(" ")),s=n.slice(n.indexOf(" ")+1);Array.isArray(i[o])?i[o].push(s):i[o]=s}return i.author&&(i.author=uc(i.author)),i.committer&&(i.committer=uc(i.committer)),i}static renderHeaders(e){let r="";if(e.tree?r+=`tree ${e.tree}
|
|
57
57
|
`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
|
58
58
|
`,e.parent){if(e.parent.length===void 0)throw new W("commit 'parent' property should be an array");for(let o of e.parent)r+=`parent ${o}
|
|
59
|
-
`}let i=e.author;r+=`author ${
|
|
60
|
-
`;let n=e.committer||e.author;return r+=`committer ${
|
|
61
|
-
`,e.gpgsig&&(r+="gpgsig"+
|
|
62
|
-
`+
|
|
59
|
+
`}let i=e.author;r+=`author ${xp(i)}
|
|
60
|
+
`;let n=e.committer||e.author;return r+=`committer ${xp(n)}
|
|
61
|
+
`,e.gpgsig&&(r+="gpgsig"+dp(e.gpgsig)),r}static render(e){return tt.renderHeaders(e)+`
|
|
62
|
+
`+vr(e.message)}render(){return this._commit}withoutSignature(){let e=vr(this._commit);if(e.indexOf(`
|
|
63
63
|
gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(`
|
|
64
64
|
gpgsig`)),i=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
|
|
65
|
-
`)+28);return
|
|
66
|
-
`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return
|
|
67
|
-
gpgsig`+
|
|
68
|
-
`+o;return
|
|
69
|
-
`),i=new TextEncoder().encode(i)}catch{}return typeof i!="string"&&(i=Buffer.from(i)),i}catch{return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i);return}catch{await this.mkdir(Hn(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e);return}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=Hn(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Qc),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let o=e+"/"+n;return(await this._stat(o)).isDirectory()?this.readdirDeep(o):o}))).reduce((n,o)=>n.concat(o),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return Buffer.isBuffer(i)?i:Buffer.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};a(Gp,"FileSystem");var M=Gp;function E(t,e){if(e===void 0)throw new et(t)}a(E,"assertParameter");async function fc(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}a(fc,"modified");async function ME({fs:t,dir:e,gitdir:r=D.join(e,".git"),commit:i="HEAD",cache:n={}}){try{E("fs",t),E("dir",e),E("gitdir",r);let o=new M(t),s=[ft({ref:i}),eo(),Di()],l=[];await Fe.acquire({fs:o,gitdir:r,cache:n},async function(c){l=c.unmergedPaths});let f=await Xr({fs:o,cache:n,dir:e,gitdir:r,trees:s,map:a(async function(c,[u,h,d]){let p=!await fc(h,d),m=l.includes(c),w=!await fc(d,u);if(p||m)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(w)return!1;throw new Ps(c)},"map")});await Fe.acquire({fs:o,gitdir:r,cache:n},async function(c){for(let u of f)if(u!==!1){if(!u){await o.rmdir(`${e}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){let h=new TextDecoder().decode(u.content);await o.write(`${e}/${u.path}`,h,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(o){throw o.caller="git.abortMerge",o}}a(ME,"abortMerge");var Kp=class Kp{static async isIgnored({fs:e,dir:r,gitdir:i=D.join(r,".git"),filepath:n}){if(oc(n)===".git")return!0;if(n===".")return!1;let o="",s=D.join(i,"info","exclude");await e.exists(s)&&(o=await e.read(s,"utf8"));let l=[{gitignore:D.join(r,".gitignore"),filepath:n}],f=n.split("/").filter(Boolean);for(let u=1;u<f.length;u++){let h=f.slice(0,u).join("/"),d=f.slice(u).join("/");l.push({gitignore:D.join(r,h,".gitignore"),filepath:d})}let c=!1;for(let u of l){let h;try{h=await e.read(u.gitignore,"utf8")}catch(m){if(m.code==="NOENT")continue}let d=VB().add(o);d.add(h);let p=Hn(u.filepath);if(p!=="."&&d.ignores(p))return!0;c?c=!d.test(u.filepath).unignored:c=d.test(u.filepath).ignored}return c}};a(Kp,"GitIgnoreManager");var Yr=Kp;async function UL({fs:t,gitdir:e,object:r,format:i,oid:n}){if(i!=="deflated")throw new W("GitObjectStoreLoose expects objects to write to be in deflated format");let o=`objects/${n.slice(0,2)}/${n.slice(2)}`,s=`${e}/${o}`;await t.exists(s)||await t.write(s,r)}a(UL,"writeObjectLoose");var dp=null;async function jE(t){return dp===null&&(dp=qL()),dp?HL(t):Ap.deflate(t)}a(jE,"deflate");async function HL(t){let e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}a(HL,"browserDeflate");function qL(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}a(qL,"testCompressionStream");async function it({fs:t,gitdir:e,type:r,object:i,format:n="content",oid:o=void 0,dryRun:s=!1}){return n!=="deflated"&&(n!=="wrapped"&&(i=Kr.wrap({type:r,object:i})),o=await br(i),i=Buffer.from(await jE(i))),s||await UL({fs:t,gitdir:e,object:i,format:"deflated",oid:o}),o}a(it,"_writeObject");function UE(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}a(UE,"posixifyPathBuffer");async function HE({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,cache:n={},force:o=!1,parallel:s=!0}){try{E("fs",t),E("dir",e),E("gitdir",r),E("filepath",i);let l=new M(t);await Fe.acquire({fs:l,gitdir:r,cache:n},async f=>{let u=await(await be.get({fs:l,gitdir:r})).get("core.autocrlf");return kp({dir:e,gitdir:r,fs:l,filepath:i,index:f,force:o,parallel:s,autocrlf:u})})}catch(l){throw l.caller="git.add",l}}a(HE,"add");async function kp({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:o,parallel:s,autocrlf:l}){i=Array.isArray(i)?i:[i];let f=i.map(async d=>{if(!o&&await Yr.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let p=await r.lstat(D.join(t,d));if(!p)throw new ce(d);if(p.isDirectory()){let m=await r.readdir(D.join(t,d));if(s){let w=m.map(y=>kp({dir:t,gitdir:e,fs:r,filepath:[D.join(d,y)],index:n,force:o,parallel:s,autocrlf:l}));await Promise.all(w)}else for(let w of m)await kp({dir:t,gitdir:e,fs:r,filepath:[D.join(d,w)],index:n,force:o,parallel:s,autocrlf:l})}else{let m=p.isSymbolicLink()?await r.readlink(D.join(t,d)).then(UE):await r.read(D.join(t,d),{autocrlf:l});if(m===null)throw new ce(d);let w=await it({fs:r,gitdir:e,type:"blob",object:m});n.insert({filepath:d,stats:p,oid:w})}}),c=await Promise.allSettled(f),u=c.filter(d=>d.status==="rejected").map(d=>d.reason);if(u.length>1)throw new Ts(u);if(u.length===1)throw u[0];return c.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}a(kp,"addToIndex");async function Is({fs:t,gitdir:e,path:r}){return(await be.get({fs:t,gitdir:e})).get(r)}a(Is,"_getConfig");function qE(t,...e){for(let r of e)if(r)for(let i of Object.keys(r)){let n=r[i];n!==void 0&&(t[i]=n)}return t}a(qE,"assignDefined");async function Jr({fs:t,gitdir:e,author:r,commit:i}){let n=Math.floor(Date.now()/1e3),o={name:await Is({fs:t,gitdir:e,path:"user.name"}),email:await Is({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(n*1e3).getTimezoneOffset()},s=qE({},o,i?i.author:void 0,r);if(s.name!==void 0)return s}a(Jr,"normalizeAuthorObject");async function Zn({fs:t,gitdir:e,author:r,committer:i,commit:n}){let o=Math.floor(Date.now()/1e3),s={name:await Is({fs:t,gitdir:e,path:"user.name"}),email:await Is({fs:t,gitdir:e,path:"user.email"})||"",timestamp:o,timezoneOffset:new Date(o*1e3).getTimezoneOffset()},l=qE({},s,n?n.committer:void 0,r,i);if(l.name!==void 0)return l}a(Zn,"normalizeCommitterObject");async function zE({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=ut.from(o).parse().object,zE({fs:t,cache:e,gitdir:r,oid:i});if(n!=="commit")throw new Ze(i,n,"commit");return{commit:rt.from(o),oid:i}}a(zE,"resolveCommit");async function Xn({fs:t,cache:e,gitdir:r,oid:i}){let{commit:n,oid:o}=await zE({fs:t,cache:e,gitdir:r,oid:i});return{oid:o,commit:n.parse(),payload:n.withoutSignature()}}a(Xn,"_readCommit");async function tf({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:o,committer:s,signingKey:l,amend:f=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:h,parent:d,tree:p}){let m=!1;h||(h=await B.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2}));let w,y;try{w=await B.resolve({fs:t,gitdir:i,ref:h}),y=await Xn({fs:t,gitdir:i,oid:w,cache:{}})}catch{m=!0}if(f&&m)throw new As(h);let v=f?await Jr({fs:t,gitdir:i,author:o,commit:y.commit}):await Jr({fs:t,gitdir:i,author:o});if(!v)throw new ze("author");let g=f?await Zn({fs:t,gitdir:i,author:v,committer:s,commit:y.commit}):await Zn({fs:t,gitdir:i,author:v,committer:s});if(!g)throw new ze("committer");return Fe.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(F){let S=IE(F.entries).get(".");if(p||(p=await WE({fs:t,gitdir:i,inode:S,dryRun:c})),d?d=await Promise.all(d.map(x=>B.resolve({fs:t,gitdir:i,ref:x}))):f?d=y.commit.parent:d=w?[w]:[],!n)if(f)n=y.commit.message;else throw new et("message");let R=rt.from({tree:p,parent:d,author:v,committer:g,message:n});l&&(R=await rt.sign(R,r,l));let b=await it({fs:t,gitdir:i,type:"commit",object:R.toObject(),dryRun:c});return!u&&!c&&await B.writeRef({fs:t,gitdir:i,ref:h,value:b}),b})}a(tf,"_commit");async function WE({fs:t,gitdir:e,inode:r,dryRun:i}){let n=r.children;for(let f of n)f.type==="tree"&&(f.metadata.mode="040000",f.metadata.oid=await WE({fs:t,gitdir:e,inode:f,dryRun:i}));let o=n.map(f=>({mode:f.metadata.mode,path:f.basename,oid:f.metadata.oid,type:f.type})),s=tt.from(o);return await it({fs:t,gitdir:e,type:"tree",object:s.toObject(),dryRun:i})}a(WE,"constructTree");async function Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new Zr("leading-slash");if(n.endsWith("/"))throw new Zr("trailing-slash");let o=i,s=await Kn({fs:t,cache:e,gitdir:r,oid:i}),l=s.tree;if(n==="")i=s.oid;else{let f=n.split("/");i=await VE({fs:t,cache:e,gitdir:r,tree:l,pathArray:f,oid:o,filepath:n})}return i}a(Ds,"resolveFilepath");async function VE({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:o,filepath:s}){let l=n.shift();for(let f of i)if(f.path===l){if(n.length===0)return f.oid;{let{type:c,object:u}=await de({fs:t,cache:e,gitdir:r,oid:f.oid});if(c!=="tree")throw new Ze(o,c,"tree",s);return i=tt.from(u),VE({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:o,filepath:s})}}throw new ce(`file or directory found at "${o}:${s}"`)}a(VE,"_resolveFilepath");async function to({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){n!==void 0&&(i=await Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));let{tree:o,oid:s}=await Kn({fs:t,cache:e,gitdir:r,oid:i});return{oid:s,tree:o.entries()}}a(to,"_readTree");async function Cs({fs:t,gitdir:e,tree:r}){let i=tt.from(r).toObject();return await it({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}a(Cs,"_writeTree");async function zL({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:o,note:s,force:l,author:f,committer:c,signingKey:u}){let h;try{h=await B.resolve({gitdir:i,fs:t,ref:n})}catch(v){if(!(v instanceof ce))throw v}let p=(await to({fs:t,cache:e,gitdir:i,oid:h||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(l)p=p.filter(v=>v.path!==o);else for(let v of p)if(v.path===o)throw new Nt("note",o);typeof s=="string"&&(s=Buffer.from(s,"utf8"));let m=await it({fs:t,gitdir:i,type:"blob",object:s,format:"content"});p.push({mode:"100644",path:o,oid:m,type:"blob"});let w=await Cs({fs:t,gitdir:i,tree:p});return await tf({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:w,parent:h&&[h],message:`Note added by 'isomorphic-git addNote'
|
|
70
|
-
`,author:f,committer:c,signingKey:u})}a(zL,"_addNote");async function GE({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),ref:n="refs/notes/commits",oid:o,note:s,force:l,author:f,committer:c,signingKey:u,cache:h={}}){try{E("fs",t),E("gitdir",i),E("oid",o),E("note",s),u&&E("onSign",e);let d=new M(t),p=await Jr({fs:d,gitdir:i,author:f});if(!p)throw new ze("author");let m=await Zn({fs:d,gitdir:i,author:p,committer:c});if(!m)throw new ze("committer");return await zL({fs:new M(d),cache:h,onSign:e,gitdir:i,ref:n,oid:o,note:s,force:l,author:p,committer:m,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}a(GE,"addNote");async function KE({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!ms(r,!0))throw new Bt(r,ps.clean(r));let o=await be.get({fs:t,gitdir:e});if(!n&&(await o.getSubsections("remote")).includes(r)&&i!==await o.get(`remote.${r}.url`))throw new Nt("remote",r);await o.set(`remote.${r}.url`,i),await o.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await be.save({fs:t,gitdir:e,config:o})}a(KE,"_addRemote");async function ZE({fs:t,dir:e,gitdir:r=D.join(e,".git"),remote:i,url:n,force:o=!1}){try{return E("fs",t),E("gitdir",r),E("remote",i),E("url",n),await KE({fs:new M(t),gitdir:r,remote:i,url:n,force:o})}catch(s){throw s.caller="git.addRemote",s}}a(ZE,"addRemote");async function WL({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:o,message:s=n,gpgsig:l,object:f,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await B.exists({fs:t,gitdir:i,ref:n}))throw new Nt("tag",n);let h=await B.resolve({fs:t,gitdir:i,ref:f||"HEAD"}),{type:d}=await de({fs:t,cache:e,gitdir:i,oid:h}),p=ut.from({object:h,type:d,tag:n.replace("refs/tags/",""),tagger:o,message:s,gpgsig:l});c&&(p=await ut.sign(p,r,c));let m=await it({fs:t,gitdir:i,type:"tag",object:p.toObject()});await B.writeRef({fs:t,gitdir:i,ref:n,value:m})}a(WL,"_annotatedTag");async function XE({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),ref:n,tagger:o,message:s=n,gpgsig:l,object:f,signingKey:c,force:u=!1,cache:h={}}){try{E("fs",t),E("gitdir",i),E("ref",n),c&&E("onSign",e);let d=new M(t),p=await Jr({fs:d,gitdir:i,author:o});if(!p)throw new ze("tagger");return await WL({fs:d,cache:h,onSign:e,gitdir:i,ref:n,tagger:p,message:s,gpgsig:l,object:f,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}a(XE,"annotatedTag");async function VL({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:o=!1}){if(!ms(r,!0))throw new Bt(r,ps.clean(r));let s=`refs/heads/${r}`;if(!o&&await B.exists({fs:t,gitdir:e,ref:s}))throw new Nt("branch",r,!1);let l;try{l=await B.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch{}l&&await B.writeRef({fs:t,gitdir:e,ref:s,value:l}),n&&await B.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}a(VL,"_branch");async function YE({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,object:n,checkout:o=!1,force:s=!1}){try{return E("fs",t),E("gitdir",r),E("ref",i),await VL({fs:new M(t),gitdir:r,ref:i,object:n,checkout:o,force:s})}catch(l){throw l.caller="git.branch",l}}a(YE,"branch");var JE=a((t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e),"worthWalking");async function Dp({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:o,remote:s,ref:l,filepaths:f,noCheckout:c,noUpdateHead:u,dryRun:h,force:d,track:p=!0,nonBlocking:m=!1,batchSize:w=100}){let y;if(i)try{y=await B.resolve({fs:t,gitdir:o,ref:"HEAD"})}catch{y="0000000000000000000000000000000000000000"}let v;try{v=await B.resolve({fs:t,gitdir:o,ref:l})}catch(g){if(l==="HEAD")throw g;let F=`${s}/${l}`;if(v=await B.resolve({fs:t,gitdir:o,ref:F}),p){let O=await be.get({fs:t,gitdir:o});await O.set(`branch.${l}.remote`,s),await O.set(`branch.${l}.merge`,`refs/heads/${l}`),await be.save({fs:t,gitdir:o,config:O})}await B.writeRef({fs:t,gitdir:o,ref:`refs/heads/${l}`,value:v})}if(!c){let g;try{g=await GL({fs:t,cache:e,onProgress:r,dir:n,gitdir:o,ref:l,force:d,filepaths:f})}catch(b){throw b instanceof ce&&b.data.what===v?new _s(l,v):b}let F=g.filter(([b])=>b==="conflict").map(([b,x])=>x);if(F.length>0)throw new vs(F);let O=g.filter(([b])=>b==="error").map(([b,x])=>x);if(O.length>0)throw new W(O.join(", "));if(h){i&&await i({previousHead:y,newHead:v,type:f!=null&&f.length>0?"file":"branch"});return}let S=0,R=g.length;if(await Fe.acquire({fs:t,gitdir:o,cache:e},async function(b){await Promise.all(g.filter(([x])=>x==="delete"||x==="delete-index").map(async function([x,_]){let P=`${n}/${_}`;x==="delete"&&await t.rm(P),b.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}))}),await Fe.acquire({fs:t,gitdir:o,cache:e},async function(b){for(let[x,_]of g)if(x==="rmdir"||x==="rmdir-index"){let P=`${n}/${_}`;try{x==="rmdir"&&await t.rmdir(P),b.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}catch(k){if(k.code==="ENOTEMPTY")console.log(`Did not delete ${_} because directory is not empty`);else throw k}}}),await Promise.all(g.filter(([b])=>b==="mkdir"||b==="mkdir-index").map(async function([b,x]){let _=`${n}/${x}`;await t.mkdir(_),r&&await r({phase:"Updating workdir",loaded:++S,total:R})})),m){let b=g.filter(([_])=>_==="create"||_==="create-index"||_==="update"||_==="mkdir-index"),x=await bE("Update Working Dir",b.map(([_,P,k,C,N])=>()=>ZL({fs:t,cache:e,gitdir:o,dir:n},[_,P,k,C,N])),r,w);await Fe.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(_){await bE("Update Index",x.map(([P,k,C])=>()=>KL({index:_,fullpath:P,oid:k,stats:C})),r,w)})}else await Fe.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(b){await Promise.all(g.filter(([x])=>x==="create"||x==="create-index"||x==="update"||x==="mkdir-index").map(async function([x,_,P,k,C]){let N=`${n}/${_}`;try{if(x!=="create-index"&&x!=="mkdir-index"){let{object:Z}=await de({fs:t,cache:e,gitdir:o,oid:P});if(C&&await t.rm(N),k===33188)await t.write(N,Z);else if(k===33261)await t.write(N,Z,{mode:511});else if(k===40960)await t.writelink(N,Z);else throw new W(`Invalid mode 0o${k.toString(8)} detected in blob ${P}`)}let U=await t.lstat(N);k===33261&&(U.mode=493),x==="mkdir-index"&&(U.mode=57344),b.insert({filepath:_,stats:U,oid:P}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}catch(U){console.log(U)}}))});i&&await i({previousHead:y,newHead:v,type:f!=null&&f.length>0?"file":"branch"})}if(!u){let g=await B.expand({fs:t,gitdir:o,ref:l});g.startsWith("refs/heads")?await B.writeSymbolicRef({fs:t,gitdir:o,ref:"HEAD",value:g}):await B.writeRef({fs:t,gitdir:o,ref:"HEAD",value:v})}}a(Dp,"_checkout");async function GL({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:o,force:s,filepaths:l}){let f=0;return Xr({fs:t,cache:e,dir:i,gitdir:n,trees:[ft({ref:o}),eo(),Di()],map:a(async function(c,[u,h,d]){if(c===".")return;if(l&&!l.some(m=>JE(c,m)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++f}),[!!d,!!u,!!h].map(Number).join("")){case"000":return;case"001":return s&&l&&l.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await h.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await h.oid()?s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()]:["conflict",c]:await u.mode()!==await h.mode()?s?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await d.type()){case"tree":return["rmdir-index",c];case"blob":return await d.oid()!==await h.oid()?s?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await d.type()}`]}case"110":case"111":switch(`${await d.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await d.oid()===await u.oid()&&await d.mode()===await u.mode()&&!s)return;if(h){if(await h.oid()!==await d.oid()&&await h.oid()!==await u.oid())return s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()]:["conflict",c]}else if(s)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()];return await u.mode()!==await d.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await d.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await d.type()}-${await u.type()}`]}}},"map"),reduce:a(async function(c,u){return u=$E(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u},"reduce")})}a(GL,"analyze");async function KL({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(n){console.warn(`Error inserting ${e} into index:`,n)}}a(KL,"updateIndex");async function ZL({fs:t,cache:e,gitdir:r,dir:i},[n,o,s,l,f]){let c=`${i}/${o}`;if(n!=="create-index"&&n!=="mkdir-index"){let{object:h}=await de({fs:t,cache:e,gitdir:r,oid:s});if(f&&await t.rm(c),l===33188)await t.write(c,h);else if(l===33261)await t.write(c,h,{mode:511});else if(l===40960)await t.writelink(c,h);else throw new W(`Invalid mode 0o${l.toString(8)} detected in blob ${s}`)}let u=await t.lstat(c);return l===33261&&(u.mode=493),n==="mkdir-index"&&(u.mode=57344),[o,s,u]}a(ZL,"updateWorkingDir");async function bE(t,e,r,i){let n=[];try{for(let o=0;o<e.length;o+=i){let s=e.slice(o,o+i).map(f=>f());(await Promise.allSettled(s)).forEach(f=>{f.status==="fulfilled"&&n.push(f.value)}),r&&await r({phase:"Updating workdir",loaded:o+s.length,total:e.length})}return n}catch(o){console.error(`Error during ${t}: ${o}`)}return n}a(bE,"batchAllSettled");async function Cp({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=D.join(i,".git"),remote:o="origin",ref:s,filepaths:l,noCheckout:f=!1,noUpdateHead:c=s===void 0,dryRun:u=!1,force:h=!1,track:d=!0,cache:p={},nonBlocking:m=!1,batchSize:w=100}){try{E("fs",t),E("dir",i),E("gitdir",n);let y=s||"HEAD";return await Dp({fs:new M(t),cache:p,onProgress:e,onPostCheckout:r,dir:i,gitdir:n,remote:o,ref:y,filepaths:l,noCheckout:f,noUpdateHead:c,dryRun:u,force:h,track:d,nonBlocking:m,batchSize:w})}catch(y){throw y.caller="git.checkout",y}}a(Cp,"checkout");var XL=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function ki(t){let e=XL.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}a(ki,"abbreviateRef");async function Qr({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){let n=await B.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await B.resolve({fs:t,gitdir:e,ref:n})}catch{return}if(n.startsWith("refs/"))return r?n:ki(n)}a(Qr,"_currentBranch");function YL(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}a(YL,"translateSSHtoHTTP");function QE({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}a(QE,"calculateBasicAuthHeader");async function Ns(t,e){let r=NE(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}a(Ns,"forAwait");async function uc(t){let e=0,r=[];await Ns(t,o=>{r.push(o),e+=o.byteLength});let i=new Uint8Array(e),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}a(uc,"collect");function vE(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[r,i]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:r,password:i}}}a(vE,"extractAuthFromUrl");function Pp(t,e){let r=e.toString(16);return"0".repeat(t-r.length)+r}a(Pp,"padHex");var Zp=class Zp{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=Buffer.from(e));let r=e.length+4,i=Pp(4,r);return Buffer.concat([Buffer.from(i,"utf8"),e])}static streamReader(e){let r=new lc(e);return a(async function(){try{let n=await r.read(4);if(n==null)return!0;if(n=parseInt(n.toString("utf8"),16),n===0||n===1)return null;let o=await r.read(n-4);return o??!0}catch(n){return e.error=n,!0}},"read")}};a(Zp,"GitPktLine");var we=Zp;async function _E(t){let e={},r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let i=r.indexOf("=");if(i>-1){let n=r.slice(0,i),o=r.slice(i+1);e[n]=o}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}a(_E,"parseCapabilitiesV2");async function FE(t,{service:e}){let r=new Set,i=new Map,n=new Map,o=we.streamReader(t),s=await o();for(;s===null;)s=await o();if(s===!0)throw new Fs;if(s.includes("version 2"))return _E(o);if(s.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new Pi(`# service=${e}\\n`,s.toString("utf8"));let l=await o();for(;l===null;)l=await o();if(l===!0)return{capabilities:r,refs:i,symrefs:n};if(l=l.toString("utf8"),l.includes("version 2"))return _E(o);let[f,c]=pp(l,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),f!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,h]=pp(f," "," ");for(i.set(h,u);;){let d=await o();if(d===!0)break;if(d!==null){let[p,m]=pp(d.toString("utf8")," "," ");i.set(m,p)}}}for(let u of r)if(u.startsWith("symref=")){let h=u.match(/symref=([^:]+):(.*)/);h.length===3&&n.set(h[1],h[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}a(FE,"parseRefsAdResponse");function pp(t,e,r){let i=t.trim().split(e);if(i.length!==2)throw new Pi(`Two strings separated by '${r}'`,t.toString("utf8"));return i}a(pp,"splitAndAssert");var EE=a((t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,"corsProxify"),SE=a((t,e)=>{(e.username||e.password)&&(t.Authorization=QE(e)),e.headers&&Object.assign(t,e.headers)},"updateHeaders"),mp=a(async t=>{try{let e=Buffer.from(await uc(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch{return{}}},"stringifyBody"),Xp=class Xp{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:r,onAuth:i,onAuthSuccess:n,onAuthFailure:o,corsProxy:s,service:l,url:f,headers:c,protocolVersion:u}){let{url:h,auth:d}=vE(f),p=s?EE(s,h):h;(d.username||d.password)&&(c.Authorization=QE(d)),u===2&&(c["Git-Protocol"]="version=2");let m,w,y=!1;do if(m=await e.request({onProgress:r,method:"GET",url:`${p}/info/refs?service=${l}`,headers:c}),w=!1,m.statusCode===401||m.statusCode===203){let v=y?o:i;if(v){if(d=await v(h,{...d,headers:{...c}}),d&&d.cancel)throw new Gn;d&&(SE(c,d),y=!0,w=!0)}}else m.statusCode===200&&y&&n&&await n(h,d);while(w);if(m.statusCode!==200){let{response:v}=await mp(m);throw new qn(m.statusCode,m.statusMessage,v)}if(m.headers["content-type"]===`application/x-${l}-advertisement`){let v=await FE(m.body,{service:l});return v.auth=d,v}else{let{preview:v,response:g,data:F}=await mp(m);try{let O=await FE([F],{service:l});return O.auth=d,O}catch{throw new Os(v,g)}}}static async connect({http:e,onProgress:r,corsProxy:i,service:n,url:o,auth:s,body:l,headers:f}){let c=vE(o);c&&(o=c.url),i&&(o=EE(i,o)),f["content-type"]=`application/x-${n}-request`,f.accept=`application/x-${n}-result`,SE(f,s);let u=await e.request({onProgress:r,method:"POST",url:`${o}/${n}`,body:l,headers:f});if(u.statusCode!==200){let{response:h}=mp(u);throw new qn(u.statusCode,u.statusMessage,h)}return u}};a(Xp,"GitRemoteHTTP");var Yn=Xp,Yp=class Yp{static getRemoteHelperFor({url:e}){let r=new Map;r.set("http",Yn),r.set("https",Yn);let i=JL({url:e});if(!i)throw new ks(e);if(r.has(i.transport))return r.get(i.transport);throw new Rs(e,i.transport,i.transport==="ssh"?YL(e):void 0)}};a(Yp,"GitRemoteManager");var Jn=Yp;function JL({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}a(JL,"parseRemoteUrl");var Ri=null,Jp=class Jp{static async read({fs:e,gitdir:r}){Ri===null&&(Ri=new ds);let i=D.join(r,"shallow"),n=new Set;return await Ri.acquire(i,async function(){let o=await e.read(i,{encoding:"utf8"});if(o===null||o.trim()==="")return n;o.trim().split(`
|
|
71
|
-
`).map(s=>n.add(s))}),n}static async write({fs:e,gitdir:r,oids:i}){
|
|
65
|
+
`)+28);return vr(r+`
|
|
66
|
+
`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return HL(e)}static async sign(e,r,i){let n=e.withoutSignature(),o=tt.justMessage(e._commit),{signature:s}=await r({payload:n,secretKey:i});s=vr(s);let f=tt.justHeaders(e._commit)+`
|
|
67
|
+
gpgsig`+dp(s)+`
|
|
68
|
+
`+o;return tt.from(f)}};a(tt,"GitCommit");var nt=tt;async function Yn({fs:t,cache:e,gitdir:r,oid:i}){if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:it.from([]),oid:i};let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=dt.from(o).parse().object,Yn({fs:t,cache:e,gitdir:r,oid:i});if(n==="commit")return i=nt.from(o).parse().tree,Yn({fs:t,cache:e,gitdir:r,oid:i});if(n!=="tree")throw new Xe(i,n,"tree");return{tree:it.from(o),oid:i}}a(Yn,"resolveTree");var Wp=class Wp{constructor({fs:e,gitdir:r,ref:i,cache:n}){var s;this.fs=e,this.cache=n,this.gitdir=r,this.mapPromise=(async()=>{let l=new Map,f;try{f=await N.resolve({fs:e,gitdir:r,ref:i})}catch(u){u instanceof fe&&(f="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let c=await Yn({fs:e,cache:this.cache,gitdir:r,oid:f});return c.type="tree",c.mode="40000",l.set(".",c),l})();let o=this;this.ConstructEntry=(s=class{constructor(f){this._fullpath=f,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return o.type(this)}async mode(){return o.mode(this)}async stat(){return o.stat(this)}async content(){return o.content(this)}async oid(){return o.oid(this)}},a(s,"TreeEntry"),s)}async readdir(e){let r=e._fullpath,{fs:i,cache:n,gitdir:o}=this,s=await this.mapPromise,l=s.get(r);if(!l)throw new Error(`No obj for ${r}`);let f=l.oid;if(!f)throw new Error(`No oid for obj ${JSON.stringify(l)}`);if(l.type!=="tree")return null;let{type:c,object:u}=await de({fs:i,cache:n,gitdir:o,oid:f});if(c!==l.type)throw new Xe(f,c,l.type);let h=it.from(u);for(let d of h)s.set(C.join(r,d.path),d);return h.entries().map(d=>C.join(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:i}=r.get(e._fullpath);e._type=i}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:i}=r.get(e._fullpath);e._mode=CE(parseInt(i,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:i,cache:n,gitdir:o}=this,l=r.get(e._fullpath).oid,{type:f,object:c}=await de({fs:i,cache:n,gitdir:o,oid:l});f!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let i=(await this.mapPromise).get(e._fullpath);e._oid=i.oid}return e._oid}};a(Wp,"GitWalkerRepo");var Tp=Wp;function ht({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,rf,{value:a(function({fs:r,gitdir:i,cache:n}){return new Tp({fs:r,gitdir:i,ref:t,cache:n})},"value")}),Object.freeze(e),e}a(ht,"TREE");var Vp=class Vp{constructor({fs:e,dir:r,gitdir:i,cache:n}){var s;this.fs=e,this.cache=n,this.dir=r,this.gitdir=i,this.config=null;let o=this;this.ConstructEntry=(s=class{constructor(f){this._fullpath=f,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return o.type(this)}async mode(){return o.mode(this)}async stat(){return o.stat(this)}async content(){return o.content(this)}async oid(){return o.oid(this)}},a(s,"WorkdirEntry"),s)}async readdir(e){let r=e._fullpath,{fs:i,dir:n}=this,o=await i.readdir(C.join(n,r));return o===null?null:o.map(s=>C.join(r,s))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:r,dir:i}=this,n=await r.lstat(`${i}/${e._fullpath}`);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let o=n.isDirectory()?"tree":"blob";o==="blob"&&!n.isFile()&&!n.isSymbolicLink()&&(o="special"),e._type=o,n=zn(n),e._mode=n.mode,n.size===-1&&e._actualSize&&(n.size=e._actualSize),e._stat=n}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:i,gitdir:n}=this;if(await e.type()==="tree")e._content=void 0;else{let s=await(await this._getGitConfig(r,n)).get("core.autocrlf"),l=await r.read(`${i}/${e._fullpath}`,{autocrlf:s});e._actualSize=l.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(l)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:i,gitdir:n,cache:o}=this,s;await Fe.acquire({fs:i,gitdir:n,cache:o},async function(l){let f=l.entriesMap.get(e._fullpath),c=await e.stat(),h=await(await r._getGitConfig(i,n)).get("core.filemode"),d=typeof process<"u"?process.platform!=="win32":!0;if(!f||sc(c,f,h,d)){let p=await e.content();p===void 0?s=void 0:(s=await _r(Xr.wrap({type:"blob",object:p})),f&&s===f.oid&&(!h||c.mode===f.mode)&&sc(c,f,h,d)&&l.insert({filepath:e._fullpath,stats:c,oid:s}))}else s=f.oid}),e._oid=s}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await be.get({fs:e,gitdir:r}),this.config)}};a(Vp,"GitWalkerFs");var Op=Vp;function io(){let t=Object.create(null);return Object.defineProperty(t,rf,{value:a(function({fs:e,dir:r,gitdir:i,cache:n}){return new Op({fs:e,dir:r,gitdir:i,cache:n})},"value")}),Object.freeze(t),t}a(io,"WORKDIR");function qL(t,e){let r=e-t;return Array.from({length:r},(i,n)=>t+n)}a(qL,"arrayRange");var UE=typeof Array.prototype.flat>"u"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),Gp=class Gp{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:e<this.value&&(this.value=e))}reset(){this.value=null}};a(Gp,"RunningMinimum");var kp=Gp;function*zL(t){let e=new kp,r,i=[],n=t.length;for(let o=0;o<n;o++)i[o]=t[o].next().value,i[o]!==void 0&&e.consider(i[o]);if(e.value!==null)for(;;){let o=[];r=e.value,e.reset();for(let s=0;s<n;s++)i[s]!==void 0&&i[s]===r?(o[s]=i[s],i[s]=t[s].next().value):o[s]=null,i[s]!==void 0&&e.consider(i[s]);if(yield o,e.value===null)return}}a(zL,"unionOfIterators");async function Jr({fs:t,cache:e,dir:r,gitdir:i,trees:n,map:o=a(async(f,c)=>c,"map"),reduce:s=a(async(f,c)=>{let u=UE(c);return f!==void 0&&u.unshift(f),u},"reduce"),iterate:l=a((f,c)=>Promise.all([...c].map(f)),"iterate")}){let f=n.map(p=>p[rf]({fs:t,dir:r,gitdir:i,cache:e})),c=new Array(f.length).fill("."),u=qL(0,f.length),h=a(async p=>{u.map(y=>{let v=p[y];p[y]=v&&new f[y].ConstructEntry(v)});let w=(await Promise.all(u.map(y=>{let v=p[y];return v?f[y].readdir(v):[]}))).map(y=>(y===null?[]:y)[Symbol.iterator]());return{entries:p,children:zL(w)}},"unionWalkerFromReaddir"),d=a(async p=>{let{entries:m,children:w}=await h(p),y=m.find(g=>g&&g._fullpath)._fullpath,v=await o(y,m);if(v!==null){let g=await l(d,w);return g=g.filter(_=>_!==void 0),s(v,g)}},"walk");return d(c)}a(Jr,"_walk");async function Rp(t,e){let r=await t.readdir(e);r==null?await t.rm(e):r.length?await Promise.all(r.map(i=>{let n=C.join(e,i);return t.lstat(n).then(o=>{if(o)return o.isDirectory()?Rp(t,n):t.rm(n)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}a(Rp,"rmRecursive");function WL(t){return VL(t)&&gE(t.then)&&gE(t.catch)}a(WL,"isPromiseLike");function VL(t){return t&&typeof t=="object"}a(VL,"isObject");function gE(t){return typeof t=="function"}a(gE,"isFunction");function bE(t){return WL(a(r=>{try{return r.readFile().catch(i=>i)}catch(i){return i}},"test")(t))}a(bE,"isPromiseFs");var vE=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function _E(t,e){if(bE(e))for(let r of vE)t[`_${r}`]=e[r].bind(e);else for(let r of vE)t[`_${r}`]=ap(e[r].bind(e));bE(e)?e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=Rp.bind(null,t):e.rm?t._rm=ap(e.rm.bind(e)):e.rmdir.length>2?t._rm=ap(e.rmdir.bind(e)):t._rm=Rp.bind(null,t)}a(_E,"bindFs");var Kp=class Kp{constructor(e){if(typeof e._original_unwrapped_fs<"u")return e;let r=Object.getOwnPropertyDescriptor(e,"promises");r&&r.enumerable?_E(this,e.promises):_E(this,e),this._original_unwrapped_fs=e}async exists(e,r={}){try{return await this._stat(e),!0}catch(i){if(i.code==="ENOENT"||i.code==="ENOTDIR"||(i.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',i),i}}async read(e,r={}){try{let i=await this._readFile(e,r);if(r.autocrlf==="true")try{i=new TextDecoder("utf8",{fatal:!0}).decode(i),i=i.replace(/\r\n/g,`
|
|
69
|
+
`),i=new TextEncoder().encode(i)}catch{}return typeof i!="string"&&(i=Buffer.from(i)),i}catch{return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i);return}catch{await this.mkdir(Wn(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e);return}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=Wn(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(tf),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let o=e+"/"+n;return(await this._stat(o)).isDirectory()?this.readdirDeep(o):o}))).reduce((n,o)=>n.concat(o),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return Buffer.isBuffer(i)?i:Buffer.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};a(Kp,"FileSystem");var M=Kp;function S(t,e){if(e===void 0)throw new rt(t)}a(S,"assertParameter");async function hc(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}a(hc,"modified");async function HE({fs:t,dir:e,gitdir:r=C.join(e,".git"),commit:i="HEAD",cache:n={}}){try{S("fs",t),S("dir",e),S("gitdir",r);let o=new M(t),s=[ht({ref:i}),io(),Bi()],l=[];await Fe.acquire({fs:o,gitdir:r,cache:n},async function(c){l=c.unmergedPaths});let f=await Jr({fs:o,cache:n,dir:e,gitdir:r,trees:s,map:a(async function(c,[u,h,d]){let p=!await hc(h,d),m=l.includes(c),w=!await hc(d,u);if(p||m)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(w)return!1;throw new As(c)},"map")});await Fe.acquire({fs:o,gitdir:r,cache:n},async function(c){for(let u of f)if(u!==!1){if(!u){await o.rmdir(`${e}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){let h=new TextDecoder().decode(u.content);await o.write(`${e}/${u.path}`,h,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(o){throw o.caller="git.abortMerge",o}}a(HE,"abortMerge");var Zp=class Zp{static async isIgnored({fs:e,dir:r,gitdir:i=C.join(r,".git"),filepath:n}){if(ac(n)===".git")return!0;if(n===".")return!1;let o="",s=C.join(i,"info","exclude");await e.exists(s)&&(o=await e.read(s,"utf8"));let l=[{gitignore:C.join(r,".gitignore"),filepath:n}],f=n.split("/").filter(Boolean);for(let u=1;u<f.length;u++){let h=f.slice(0,u).join("/"),d=f.slice(u).join("/");l.push({gitignore:C.join(r,h,".gitignore"),filepath:d})}let c=!1;for(let u of l){let h;try{h=await e.read(u.gitignore,"utf8")}catch(m){if(m.code==="NOENT")continue}let d=JB().add(o);d.add(h);let p=Wn(u.filepath);if(p!=="."&&d.ignores(p))return!0;c?c=!d.test(u.filepath).unignored:c=d.test(u.filepath).ignored}return c}};a(Zp,"GitIgnoreManager");var Qr=Zp;async function GL({fs:t,gitdir:e,object:r,format:i,oid:n}){if(i!=="deflated")throw new W("GitObjectStoreLoose expects objects to write to be in deflated format");let o=`objects/${n.slice(0,2)}/${n.slice(2)}`,s=`${e}/${o}`;await t.exists(s)||await t.write(s,r)}a(GL,"writeObjectLoose");var pp=null;async function qE(t){return pp===null&&(pp=ZL()),pp?KL(t):Ip.deflate(t)}a(qE,"deflate");async function KL(t){let e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}a(KL,"browserDeflate");function ZL(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}a(ZL,"testCompressionStream");async function ot({fs:t,gitdir:e,type:r,object:i,format:n="content",oid:o=void 0,dryRun:s=!1}){return n!=="deflated"&&(n!=="wrapped"&&(i=Xr.wrap({type:r,object:i})),o=await _r(i),i=Buffer.from(await qE(i))),s||await GL({fs:t,gitdir:e,object:i,format:"deflated",oid:o}),o}a(ot,"_writeObject");function zE(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}a(zE,"posixifyPathBuffer");async function WE({fs:t,dir:e,gitdir:r=C.join(e,".git"),filepath:i,cache:n={},force:o=!1,parallel:s=!0}){try{S("fs",t),S("dir",e),S("gitdir",r),S("filepath",i);let l=new M(t);await Fe.acquire({fs:l,gitdir:r,cache:n},async f=>{let u=await(await be.get({fs:l,gitdir:r})).get("core.autocrlf");return Pp({dir:e,gitdir:r,fs:l,filepath:i,index:f,force:o,parallel:s,autocrlf:u})})}catch(l){throw l.caller="git.add",l}}a(WE,"add");async function Pp({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:o,parallel:s,autocrlf:l}){i=Array.isArray(i)?i:[i];let f=i.map(async d=>{if(!o&&await Qr.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let p=await r.lstat(C.join(t,d));if(!p)throw new fe(d);if(p.isDirectory()){let m=await r.readdir(C.join(t,d));if(s){let w=m.map(y=>Pp({dir:t,gitdir:e,fs:r,filepath:[C.join(d,y)],index:n,force:o,parallel:s,autocrlf:l}));await Promise.all(w)}else for(let w of m)await Pp({dir:t,gitdir:e,fs:r,filepath:[C.join(d,w)],index:n,force:o,parallel:s,autocrlf:l})}else{let m=p.isSymbolicLink()?await r.readlink(C.join(t,d)).then(zE):await r.read(C.join(t,d),{autocrlf:l});if(m===null)throw new fe(d);let w=await ot({fs:r,gitdir:e,type:"blob",object:m});n.insert({filepath:d,stats:p,oid:w})}}),c=await Promise.allSettled(f),u=c.filter(d=>d.status==="rejected").map(d=>d.reason);if(u.length>1)throw new Os(u);if(u.length===1)throw u[0];return c.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}a(Pp,"addToIndex");async function Cs({fs:t,gitdir:e,path:r}){return(await be.get({fs:t,gitdir:e})).get(r)}a(Cs,"_getConfig");function VE(t,...e){for(let r of e)if(r)for(let i of Object.keys(r)){let n=r[i];n!==void 0&&(t[i]=n)}return t}a(VE,"assignDefined");async function ei({fs:t,gitdir:e,author:r,commit:i}){let n=Math.floor(Date.now()/1e3),o={name:await Cs({fs:t,gitdir:e,path:"user.name"}),email:await Cs({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(n*1e3).getTimezoneOffset()},s=VE({},o,i?i.author:void 0,r);if(s.name!==void 0)return s}a(ei,"normalizeAuthorObject");async function Jn({fs:t,gitdir:e,author:r,committer:i,commit:n}){let o=Math.floor(Date.now()/1e3),s={name:await Cs({fs:t,gitdir:e,path:"user.name"}),email:await Cs({fs:t,gitdir:e,path:"user.email"})||"",timestamp:o,timezoneOffset:new Date(o*1e3).getTimezoneOffset()},l=VE({},s,n?n.committer:void 0,r,i);if(l.name!==void 0)return l}a(Jn,"normalizeCommitterObject");async function GE({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=dt.from(o).parse().object,GE({fs:t,cache:e,gitdir:r,oid:i});if(n!=="commit")throw new Xe(i,n,"commit");return{commit:nt.from(o),oid:i}}a(GE,"resolveCommit");async function Qn({fs:t,cache:e,gitdir:r,oid:i}){let{commit:n,oid:o}=await GE({fs:t,cache:e,gitdir:r,oid:i});return{oid:o,commit:n.parse(),payload:n.withoutSignature()}}a(Qn,"_readCommit");async function nf({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:o,committer:s,signingKey:l,amend:f=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:h,parent:d,tree:p}){let m=!1;h||(h=await N.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2}));let w,y;try{w=await N.resolve({fs:t,gitdir:i,ref:h}),y=await Qn({fs:t,gitdir:i,oid:w,cache:{}})}catch{m=!0}if(f&&m)throw new Is(h);let v=f?await ei({fs:t,gitdir:i,author:o,commit:y.commit}):await ei({fs:t,gitdir:i,author:o});if(!v)throw new ze("author");let g=f?await Jn({fs:t,gitdir:i,author:v,committer:s,commit:y.commit}):await Jn({fs:t,gitdir:i,author:v,committer:s});if(!g)throw new ze("committer");return Fe.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(_){let x=NE(_.entries).get(".");if(p||(p=await KE({fs:t,gitdir:i,inode:x,dryRun:c})),d?d=await Promise.all(d.map(T=>N.resolve({fs:t,gitdir:i,ref:T}))):f?d=y.commit.parent:d=w?[w]:[],!n)if(f)n=y.commit.message;else throw new rt("message");let R=nt.from({tree:p,parent:d,author:v,committer:g,message:n});l&&(R=await nt.sign(R,r,l));let b=await ot({fs:t,gitdir:i,type:"commit",object:R.toObject(),dryRun:c});return!u&&!c&&await N.writeRef({fs:t,gitdir:i,ref:h,value:b}),b})}a(nf,"_commit");async function KE({fs:t,gitdir:e,inode:r,dryRun:i}){let n=r.children;for(let f of n)f.type==="tree"&&(f.metadata.mode="040000",f.metadata.oid=await KE({fs:t,gitdir:e,inode:f,dryRun:i}));let o=n.map(f=>({mode:f.metadata.mode,path:f.basename,oid:f.metadata.oid,type:f.type})),s=it.from(o);return await ot({fs:t,gitdir:e,type:"tree",object:s.toObject(),dryRun:i})}a(KE,"constructTree");async function Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new Yr("leading-slash");if(n.endsWith("/"))throw new Yr("trailing-slash");let o=i,s=await Yn({fs:t,cache:e,gitdir:r,oid:i}),l=s.tree;if(n==="")i=s.oid;else{let f=n.split("/");i=await ZE({fs:t,cache:e,gitdir:r,tree:l,pathArray:f,oid:o,filepath:n})}return i}a(Ds,"resolveFilepath");async function ZE({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:o,filepath:s}){let l=n.shift();for(let f of i)if(f.path===l){if(n.length===0)return f.oid;{let{type:c,object:u}=await de({fs:t,cache:e,gitdir:r,oid:f.oid});if(c!=="tree")throw new Xe(o,c,"tree",s);return i=it.from(u),ZE({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:o,filepath:s})}}throw new fe(`file or directory found at "${o}:${s}"`)}a(ZE,"_resolveFilepath");async function no({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){n!==void 0&&(i=await Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));let{tree:o,oid:s}=await Yn({fs:t,cache:e,gitdir:r,oid:i});return{oid:s,tree:o.entries()}}a(no,"_readTree");async function Ns({fs:t,gitdir:e,tree:r}){let i=it.from(r).toObject();return await ot({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}a(Ns,"_writeTree");async function XL({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:o,note:s,force:l,author:f,committer:c,signingKey:u}){let h;try{h=await N.resolve({gitdir:i,fs:t,ref:n})}catch(v){if(!(v instanceof fe))throw v}let p=(await no({fs:t,cache:e,gitdir:i,oid:h||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(l)p=p.filter(v=>v.path!==o);else for(let v of p)if(v.path===o)throw new Bt("note",o);typeof s=="string"&&(s=Buffer.from(s,"utf8"));let m=await ot({fs:t,gitdir:i,type:"blob",object:s,format:"content"});p.push({mode:"100644",path:o,oid:m,type:"blob"});let w=await Ns({fs:t,gitdir:i,tree:p});return await nf({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:w,parent:h&&[h],message:`Note added by 'isomorphic-git addNote'
|
|
70
|
+
`,author:f,committer:c,signingKey:u})}a(XL,"_addNote");async function XE({fs:t,onSign:e,dir:r,gitdir:i=C.join(r,".git"),ref:n="refs/notes/commits",oid:o,note:s,force:l,author:f,committer:c,signingKey:u,cache:h={}}){try{S("fs",t),S("gitdir",i),S("oid",o),S("note",s),u&&S("onSign",e);let d=new M(t),p=await ei({fs:d,gitdir:i,author:f});if(!p)throw new ze("author");let m=await Jn({fs:d,gitdir:i,author:p,committer:c});if(!m)throw new ze("committer");return await XL({fs:new M(d),cache:h,onSign:e,gitdir:i,ref:n,oid:o,note:s,force:l,author:p,committer:m,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}a(XE,"addNote");async function YE({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!ws(r,!0))throw new Lt(r,ms.clean(r));let o=await be.get({fs:t,gitdir:e});if(!n&&(await o.getSubsections("remote")).includes(r)&&i!==await o.get(`remote.${r}.url`))throw new Bt("remote",r);await o.set(`remote.${r}.url`,i),await o.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await be.save({fs:t,gitdir:e,config:o})}a(YE,"_addRemote");async function JE({fs:t,dir:e,gitdir:r=C.join(e,".git"),remote:i,url:n,force:o=!1}){try{return S("fs",t),S("gitdir",r),S("remote",i),S("url",n),await YE({fs:new M(t),gitdir:r,remote:i,url:n,force:o})}catch(s){throw s.caller="git.addRemote",s}}a(JE,"addRemote");async function YL({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:o,message:s=n,gpgsig:l,object:f,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await N.exists({fs:t,gitdir:i,ref:n}))throw new Bt("tag",n);let h=await N.resolve({fs:t,gitdir:i,ref:f||"HEAD"}),{type:d}=await de({fs:t,cache:e,gitdir:i,oid:h}),p=dt.from({object:h,type:d,tag:n.replace("refs/tags/",""),tagger:o,message:s,gpgsig:l});c&&(p=await dt.sign(p,r,c));let m=await ot({fs:t,gitdir:i,type:"tag",object:p.toObject()});await N.writeRef({fs:t,gitdir:i,ref:n,value:m})}a(YL,"_annotatedTag");async function QE({fs:t,onSign:e,dir:r,gitdir:i=C.join(r,".git"),ref:n,tagger:o,message:s=n,gpgsig:l,object:f,signingKey:c,force:u=!1,cache:h={}}){try{S("fs",t),S("gitdir",i),S("ref",n),c&&S("onSign",e);let d=new M(t),p=await ei({fs:d,gitdir:i,author:o});if(!p)throw new ze("tagger");return await YL({fs:d,cache:h,onSign:e,gitdir:i,ref:n,tagger:p,message:s,gpgsig:l,object:f,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}a(QE,"annotatedTag");async function JL({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:o=!1}){if(!ws(r,!0))throw new Lt(r,ms.clean(r));let s=`refs/heads/${r}`;if(!o&&await N.exists({fs:t,gitdir:e,ref:s}))throw new Bt("branch",r,!1);let l;try{l=await N.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch{}l&&await N.writeRef({fs:t,gitdir:e,ref:s,value:l}),n&&await N.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}a(JL,"_branch");async function eS({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i,object:n,checkout:o=!1,force:s=!1}){try{return S("fs",t),S("gitdir",r),S("ref",i),await JL({fs:new M(t),gitdir:r,ref:i,object:n,checkout:o,force:s})}catch(l){throw l.caller="git.branch",l}}a(eS,"branch");var tS=a((t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e),"worthWalking");async function Dp({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:o,remote:s,ref:l,filepaths:f,noCheckout:c,noUpdateHead:u,dryRun:h,force:d,track:p=!0,nonBlocking:m=!1,batchSize:w=100}){let y;if(i)try{y=await N.resolve({fs:t,gitdir:o,ref:"HEAD"})}catch{y="0000000000000000000000000000000000000000"}let v;try{v=await N.resolve({fs:t,gitdir:o,ref:l})}catch(g){if(l==="HEAD")throw g;let _=`${s}/${l}`;if(v=await N.resolve({fs:t,gitdir:o,ref:_}),p){let E=await be.get({fs:t,gitdir:o});await E.set(`branch.${l}.remote`,s),await E.set(`branch.${l}.merge`,`refs/heads/${l}`),await be.save({fs:t,gitdir:o,config:E})}await N.writeRef({fs:t,gitdir:o,ref:`refs/heads/${l}`,value:v})}if(!c){let g;try{g=await QL({fs:t,cache:e,onProgress:r,dir:n,gitdir:o,ref:l,force:d,filepaths:f})}catch(b){throw b instanceof fe&&b.data.what===v?new Fs(l,v):b}let _=g.filter(([b])=>b==="conflict").map(([b,T])=>T);if(_.length>0)throw new _s(_);let E=g.filter(([b])=>b==="error").map(([b,T])=>T);if(E.length>0)throw new W(E.join(", "));if(h){i&&await i({previousHead:y,newHead:v,type:f!=null&&f.length>0?"file":"branch"});return}let x=0,R=g.length;if(await Fe.acquire({fs:t,gitdir:o,cache:e},async function(b){await Promise.all(g.filter(([T])=>T==="delete"||T==="delete-index").map(async function([T,F]){let P=`${n}/${F}`;T==="delete"&&await t.rm(P),b.delete({filepath:F}),r&&await r({phase:"Updating workdir",loaded:++x,total:R})}))}),await Fe.acquire({fs:t,gitdir:o,cache:e},async function(b){for(let[T,F]of g)if(T==="rmdir"||T==="rmdir-index"){let P=`${n}/${F}`;try{T==="rmdir"&&await t.rmdir(P),b.delete({filepath:F}),r&&await r({phase:"Updating workdir",loaded:++x,total:R})}catch(k){if(k.code==="ENOTEMPTY")console.log(`Did not delete ${F} because directory is not empty`);else throw k}}}),await Promise.all(g.filter(([b])=>b==="mkdir"||b==="mkdir-index").map(async function([b,T]){let F=`${n}/${T}`;await t.mkdir(F),r&&await r({phase:"Updating workdir",loaded:++x,total:R})})),m){let b=g.filter(([F])=>F==="create"||F==="create-index"||F==="update"||F==="mkdir-index"),T=await FE("Update Working Dir",b.map(([F,P,k,D,B])=>()=>t$({fs:t,cache:e,gitdir:o,dir:n},[F,P,k,D,B])),r,w);await Fe.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(F){await FE("Update Index",T.map(([P,k,D])=>()=>e$({index:F,fullpath:P,oid:k,stats:D})),r,w)})}else await Fe.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(b){await Promise.all(g.filter(([T])=>T==="create"||T==="create-index"||T==="update"||T==="mkdir-index").map(async function([T,F,P,k,D]){let B=`${n}/${F}`;try{if(T!=="create-index"&&T!=="mkdir-index"){let{object:Z}=await de({fs:t,cache:e,gitdir:o,oid:P});if(D&&await t.rm(B),k===33188)await t.write(B,Z);else if(k===33261)await t.write(B,Z,{mode:511});else if(k===40960)await t.writelink(B,Z);else throw new W(`Invalid mode 0o${k.toString(8)} detected in blob ${P}`)}let U=await t.lstat(B);k===33261&&(U.mode=493),T==="mkdir-index"&&(U.mode=57344),b.insert({filepath:F,stats:U,oid:P}),r&&await r({phase:"Updating workdir",loaded:++x,total:R})}catch(U){console.log(U)}}))});i&&await i({previousHead:y,newHead:v,type:f!=null&&f.length>0?"file":"branch"})}if(!u){let g=await N.expand({fs:t,gitdir:o,ref:l});g.startsWith("refs/heads")?await N.writeSymbolicRef({fs:t,gitdir:o,ref:"HEAD",value:g}):await N.writeRef({fs:t,gitdir:o,ref:"HEAD",value:v})}}a(Dp,"_checkout");async function QL({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:o,force:s,filepaths:l}){let f=0;return Jr({fs:t,cache:e,dir:i,gitdir:n,trees:[ht({ref:o}),io(),Bi()],map:a(async function(c,[u,h,d]){if(c===".")return;if(l&&!l.some(m=>tS(c,m)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++f}),[!!d,!!u,!!h].map(Number).join("")){case"000":return;case"001":return s&&l&&l.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await h.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await h.oid()?s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()]:["conflict",c]:await u.mode()!==await h.mode()?s?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await d.type()){case"tree":return["rmdir-index",c];case"blob":return await d.oid()!==await h.oid()?s?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await d.type()}`]}case"110":case"111":switch(`${await d.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await d.oid()===await u.oid()&&await d.mode()===await u.mode()&&!s)return;if(h){if(await h.oid()!==await d.oid()&&await h.oid()!==await u.oid())return s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()]:["conflict",c]}else if(s)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()];return await u.mode()!==await d.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await d.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await d.type()}-${await u.type()}`]}}},"map"),reduce:a(async function(c,u){return u=UE(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u},"reduce")})}a(QL,"analyze");async function e$({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(n){console.warn(`Error inserting ${e} into index:`,n)}}a(e$,"updateIndex");async function t$({fs:t,cache:e,gitdir:r,dir:i},[n,o,s,l,f]){let c=`${i}/${o}`;if(n!=="create-index"&&n!=="mkdir-index"){let{object:h}=await de({fs:t,cache:e,gitdir:r,oid:s});if(f&&await t.rm(c),l===33188)await t.write(c,h);else if(l===33261)await t.write(c,h,{mode:511});else if(l===40960)await t.writelink(c,h);else throw new W(`Invalid mode 0o${l.toString(8)} detected in blob ${s}`)}let u=await t.lstat(c);return l===33261&&(u.mode=493),n==="mkdir-index"&&(u.mode=57344),[o,s,u]}a(t$,"updateWorkingDir");async function FE(t,e,r,i){let n=[];try{for(let o=0;o<e.length;o+=i){let s=e.slice(o,o+i).map(f=>f());(await Promise.allSettled(s)).forEach(f=>{f.status==="fulfilled"&&n.push(f.value)}),r&&await r({phase:"Updating workdir",loaded:o+s.length,total:e.length})}return n}catch(o){console.error(`Error during ${t}: ${o}`)}return n}a(FE,"batchAllSettled");async function Np({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=C.join(i,".git"),remote:o="origin",ref:s,filepaths:l,noCheckout:f=!1,noUpdateHead:c=s===void 0,dryRun:u=!1,force:h=!1,track:d=!0,cache:p={},nonBlocking:m=!1,batchSize:w=100}){try{S("fs",t),S("dir",i),S("gitdir",n);let y=s||"HEAD";return await Dp({fs:new M(t),cache:p,onProgress:e,onPostCheckout:r,dir:i,gitdir:n,remote:o,ref:y,filepaths:l,noCheckout:f,noUpdateHead:c,dryRun:u,force:h,track:d,nonBlocking:m,batchSize:w})}catch(y){throw y.caller="git.checkout",y}}a(Np,"checkout");var r$=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function Ii(t){let e=r$.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}a(Ii,"abbreviateRef");async function ti({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){let n=await N.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await N.resolve({fs:t,gitdir:e,ref:n})}catch{return}if(n.startsWith("refs/"))return r?n:Ii(n)}a(ti,"_currentBranch");function i$(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}a(i$,"translateSSHtoHTTP");function rS({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}a(rS,"calculateBasicAuthHeader");async function Bs(t,e){let r=$E(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}a(Bs,"forAwait");async function dc(t){let e=0,r=[];await Bs(t,o=>{r.push(o),e+=o.byteLength});let i=new Uint8Array(e),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}a(dc,"collect");function EE(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[r,i]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:r,password:i}}}a(EE,"extractAuthFromUrl");function Ap(t,e){let r=e.toString(16);return"0".repeat(t-r.length)+r}a(Ap,"padHex");var Xp=class Xp{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=Buffer.from(e));let r=e.length+4,i=Ap(4,r);return Buffer.concat([Buffer.from(i,"utf8"),e])}static streamReader(e){let r=new fc(e);return a(async function(){try{let n=await r.read(4);if(n==null)return!0;if(n=parseInt(n.toString("utf8"),16),n===0||n===1)return null;let o=await r.read(n-4);return o??!0}catch(n){return e.error=n,!0}},"read")}};a(Xp,"GitPktLine");var we=Xp;async function SE(t){let e={},r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let i=r.indexOf("=");if(i>-1){let n=r.slice(0,i),o=r.slice(i+1);e[n]=o}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}a(SE,"parseCapabilitiesV2");async function xE(t,{service:e}){let r=new Set,i=new Map,n=new Map,o=we.streamReader(t),s=await o();for(;s===null;)s=await o();if(s===!0)throw new Es;if(s.includes("version 2"))return SE(o);if(s.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new Ci(`# service=${e}\\n`,s.toString("utf8"));let l=await o();for(;l===null;)l=await o();if(l===!0)return{capabilities:r,refs:i,symrefs:n};if(l=l.toString("utf8"),l.includes("version 2"))return SE(o);let[f,c]=mp(l,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),f!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,h]=mp(f," "," ");for(i.set(h,u);;){let d=await o();if(d===!0)break;if(d!==null){let[p,m]=mp(d.toString("utf8")," "," ");i.set(m,p)}}}for(let u of r)if(u.startsWith("symref=")){let h=u.match(/symref=([^:]+):(.*)/);h.length===3&&n.set(h[1],h[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}a(xE,"parseRefsAdResponse");function mp(t,e,r){let i=t.trim().split(e);if(i.length!==2)throw new Ci(`Two strings separated by '${r}'`,t.toString("utf8"));return i}a(mp,"splitAndAssert");var TE=a((t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,"corsProxify"),OE=a((t,e)=>{(e.username||e.password)&&(t.Authorization=rS(e)),e.headers&&Object.assign(t,e.headers)},"updateHeaders"),wp=a(async t=>{try{let e=Buffer.from(await dc(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch{return{}}},"stringifyBody"),Yp=class Yp{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:r,onAuth:i,onAuthSuccess:n,onAuthFailure:o,corsProxy:s,service:l,url:f,headers:c,protocolVersion:u}){let{url:h,auth:d}=EE(f),p=s?TE(s,h):h;(d.username||d.password)&&(c.Authorization=rS(d)),u===2&&(c["Git-Protocol"]="version=2");let m,w,y=!1;do if(m=await e.request({onProgress:r,method:"GET",url:`${p}/info/refs?service=${l}`,headers:c}),w=!1,m.statusCode===401||m.statusCode===203){let v=y?o:i;if(v){if(d=await v(h,{...d,headers:{...c}}),d&&d.cancel)throw new Xn;d&&(OE(c,d),y=!0,w=!0)}}else m.statusCode===200&&y&&n&&await n(h,d);while(w);if(m.statusCode!==200){let{response:v}=await wp(m);throw new Vn(m.statusCode,m.statusMessage,v)}if(m.headers["content-type"]===`application/x-${l}-advertisement`){let v=await xE(m.body,{service:l});return v.auth=d,v}else{let{preview:v,response:g,data:_}=await wp(m);try{let E=await xE([_],{service:l});return E.auth=d,E}catch{throw new ks(v,g)}}}static async connect({http:e,onProgress:r,corsProxy:i,service:n,url:o,auth:s,body:l,headers:f}){let c=EE(o);c&&(o=c.url),i&&(o=TE(i,o)),f["content-type"]=`application/x-${n}-request`,f.accept=`application/x-${n}-result`,OE(f,s);let u=await e.request({onProgress:r,method:"POST",url:`${o}/${n}`,body:l,headers:f});if(u.statusCode!==200){let{response:h}=wp(u);throw new Vn(u.statusCode,u.statusMessage,h)}return u}};a(Yp,"GitRemoteHTTP");var eo=Yp,Jp=class Jp{static getRemoteHelperFor({url:e}){let r=new Map;r.set("http",eo),r.set("https",eo);let i=n$({url:e});if(!i)throw new Ps(e);if(r.has(i.transport))return r.get(i.transport);throw new Rs(e,i.transport,i.transport==="ssh"?i$(e):void 0)}};a(Jp,"GitRemoteManager");var to=Jp;function n$({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}a(n$,"parseRemoteUrl");var Ai=null,Qp=class Qp{static async read({fs:e,gitdir:r}){Ai===null&&(Ai=new ps);let i=C.join(r,"shallow"),n=new Set;return await Ai.acquire(i,async function(){let o=await e.read(i,{encoding:"utf8"});if(o===null||o.trim()==="")return n;o.trim().split(`
|
|
71
|
+
`).map(s=>n.add(s))}),n}static async write({fs:e,gitdir:r,oids:i}){Ai===null&&(Ai=new ps);let n=C.join(r,"shallow");if(i.size>0){let o=[...i].join(`
|
|
72
72
|
`)+`
|
|
73
|
-
`;await
|
|
74
|
-
`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}a(
|
|
73
|
+
`;await Ai.acquire(n,async function(){await e.write(n,o,{encoding:"utf8"})})}else await Ai.acquire(n,async function(){await e.rm(n)})}};a(Qp,"GitShallowManager");var Di=Qp;async function o$({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}a(o$,"hasObjectLoose");async function s$({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let o=await t.readdir(C.join(r,"objects/pack"));o=o.filter(s=>s.endsWith(".idx"));for(let s of o){let l=`${r}/objects/pack/${s}`,f=await Cp({fs:t,cache:e,filename:l,getExternalRefDelta:n});if(f.error)throw new W(f.error);if(f.offsets.has(i))return!0}return!1}a(s$,"hasObjectPacked");async function kE({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let o=a(l=>de({fs:t,cache:e,gitdir:r,oid:l}),"getExternalRefDelta"),s=await o$({fs:t,gitdir:r,oid:i});return s||(s=await s$({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:o})),s}a(kE,"hasObject");function a$(t){let n="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===n}a(a$,"emptyPackfile");function iS(t,e){let r=t.map(i=>i.split("=",1)[0]);return e.filter(i=>{let n=i.split("=",1)[0];return r.includes(n)})}a(iS,"filterCapabilities");var of={name:"isomorphic-git",version:"1.34.0",agent:"git/isomorphic-git@1.34.0"},em=class em{constructor(){this._queue=[]}write(e){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let r=this._waiting;this._waiting=null,r({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(e=>{this._waiting=e})}};a(em,"FIFO");var Hn=em;function l$(t){let e=t.indexOf("\r"),r=t.indexOf(`
|
|
74
|
+
`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}a(l$,"findSplit");function nS(t){let e=new Hn,r="";return(async()=>(await Bs(t,i=>{for(i=i.toString("utf8"),r+=i;;){let n=l$(r);if(n===-1)break;e.write(r.slice(0,n)),r=r.slice(n)}}),r.length>0&&e.write(r),e.end()))(),e}a(nS,"splitLines");var tm=class tm{static demux(e){let r=we.streamReader(e),i=new Hn,n=new Hn,o=new Hn,s=a(async function(){let l=await r();if(l===null)return s();if(l===!0){i.end(),o.end(),e.error?n.destroy(e.error):n.end();return}switch(l[0]){case 1:{n.write(l.slice(1));break}case 2:{o.write(l.slice(1));break}case 3:{let f=l.slice(1);o.write(f),i.end(),o.end(),n.destroy(new Error(f.toString("utf8")));return}default:i.write(l)}s()},"nextBit");return s(),{packetlines:i,packfile:n,progress:o}}};a(tm,"GitSideBand");var pc=tm;async function c$(t){let{packetlines:e,packfile:r,progress:i}=pc.demux(t),n=[],o=[],s=[],l=!1,f=!1;return new Promise((c,u)=>{Bs(e,h=>{let d=h.toString("utf8").trim();if(d.startsWith("shallow")){let p=d.slice(-41).trim();p.length!==40&&u(new Zr(p)),n.push(p)}else if(d.startsWith("unshallow")){let p=d.slice(-41).trim();p.length!==40&&u(new Zr(p)),o.push(p)}else if(d.startsWith("ACK")){let[,p,m]=d.split(" ");s.push({oid:p,status:m}),m||(f=!0)}else d.startsWith("NAK")?(l=!0,f=!0):(f=!0,l=!0);f&&(t.error?u(t.error):c({shallows:n,unshallows:o,acks:s,nak:l,packfile:r,progress:i}))}).finally(()=>{f||(t.error?u(t.error):c({shallows:n,unshallows:o,acks:s,nak:l,packfile:r,progress:i}))})})}a(c$,"parseUploadPackResponse");function f$({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:o=null,exclude:s=[]}){let l=[];e=[...new Set(e)];let f=` ${t.join(" ")}`;for(let c of e)l.push(we.encode(`want ${c}${f}
|
|
75
75
|
`)),f="";for(let c of i)l.push(we.encode(`shallow ${c}
|
|
76
76
|
`));n!==null&&l.push(we.encode(`deepen ${n}
|
|
77
77
|
`)),o!==null&&l.push(we.encode(`deepen-since ${Math.floor(o.valueOf()/1e3)}
|
|
78
78
|
`));for(let c of s)l.push(we.encode(`deepen-not ${c}
|
|
79
79
|
`));l.push(we.flush());for(let c of r)l.push(we.encode(`have ${c}
|
|
80
80
|
`));return l.push(we.encode(`done
|
|
81
|
-
`)),l}a(
|
|
81
|
+
`)),l}a(f$,"writeUploadPackRequest");async function Bp({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,gitdir:f,ref:c,remoteRef:u,remote:h,url:d,corsProxy:p,depth:m=null,since:w=null,exclude:y=[],relative:v=!1,tags:g=!1,singleBranch:_=!1,headers:E={},prune:x=!1,pruneTags:R=!1}){let b=c||await ti({fs:t,gitdir:f,test:!0}),T=await be.get({fs:t,gitdir:f}),F=h||b&&await T.get(`branch.${b}.remote`)||"origin",P=d||await T.get(`remote.${F}.url`);if(typeof P>"u")throw new rt("remote OR url");let k=u||b&&await T.get(`branch.${b}.merge`)||c||"HEAD";p===void 0&&(p=await T.get("http.corsProxy"));let D=to.getRemoteHelperFor({url:P}),B=await D.discover({http:r,onAuth:o,onAuthSuccess:s,onAuthFailure:l,corsProxy:p,service:"git-upload-pack",url:P,headers:E,protocolVersion:1}),U=B.auth,Z=B.refs;if(Z.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(m!==null&&!B.capabilities.has("shallow"))throw new Kr("shallow","depth");if(w!==null&&!B.capabilities.has("deepen-since"))throw new Kr("deepen-since","since");if(y.length>0&&!B.capabilities.has("deepen-not"))throw new Kr("deepen-not","exclude");if(v===!0&&!B.capabilities.has("deepen-relative"))throw new Kr("deepen-relative","relative");let{oid:me,fullref:Ee}=N.resolveAgainstMap({ref:k,map:Z});for(let Y of Z.keys())Y===Ee||Y==="HEAD"||Y.startsWith("refs/heads/")||g&&Y.startsWith("refs/tags/")||Z.delete(Y);let $=iS([...B.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${of.agent}`]);v&&$.push("deepen-relative");let q=_?[me]:Z.values(),G=_?[b]:await N.listRefs({fs:t,gitdir:f,filepath:"refs"}),X=[];for(let Y of G)try{Y=await N.expand({fs:t,gitdir:f,ref:Y});let he=await N.resolve({fs:t,gitdir:f,ref:Y});await kE({fs:t,cache:e,gitdir:f,oid:he})&&X.push(he)}catch{}X=[...new Set(X)];let z=await Di.read({fs:t,gitdir:f}),ue=B.capabilities.has("shallow")?[...z]:[],te=f$({capabilities:$,wants:q,haves:X,shallows:ue,depth:m,since:w,exclude:y}),Oe=Buffer.from(await dc(te)),ke=await D.connect({http:r,onProgress:i,corsProxy:p,service:"git-upload-pack",url:P,auth:U,body:[Oe],headers:E}),le=await c$(ke.body);ke.headers&&(le.headers=ke.headers);for(let Y of le.shallows)if(!z.has(Y))try{let{object:he}=await de({fs:t,cache:e,gitdir:f,oid:Y}),je=new nt(he),jt=await Promise.all(je.headers().parent.map(lo=>kE({fs:t,cache:e,gitdir:f,oid:lo})));jt.length===0||jt.every(lo=>lo)||z.add(Y)}catch{z.add(Y)}for(let Y of le.unshallows)z.delete(Y);if(await Di.write({fs:t,gitdir:f,oids:z}),_){let Y=new Map([[Ee,me]]),he=new Map,je=10,jt=Ee;for(;je--;){let Sf=B.symrefs.get(jt);if(Sf===void 0)break;he.set(jt,Sf),jt=Sf}let Ef=Z.get(jt);Ef&&Y.set(jt,Ef);let{pruned:lo}=await N.updateRemoteRefs({fs:t,gitdir:f,remote:F,refs:Y,symrefs:he,tags:g,prune:x});x&&(le.pruned=lo)}else{let{pruned:Y}=await N.updateRemoteRefs({fs:t,gitdir:f,remote:F,refs:Z,symrefs:B.symrefs,tags:g,prune:x,pruneTags:R});x&&(le.pruned=Y)}if(le.HEAD=B.symrefs.get("HEAD"),le.HEAD===void 0){let{oid:Y}=N.resolveAgainstMap({ref:"HEAD",map:Z});for(let[he,je]of Z.entries())if(he!=="HEAD"&&je===Y){le.HEAD=he;break}}let Rt=Ee.startsWith("refs/tags")?"tag":"branch";if(le.FETCH_HEAD={oid:me,description:`${Rt} '${Ii(Ee)}' of ${P}`},i||n){let Y=nS(le.progress);Bs(Y,async he=>{if(n&&await n(he),i){let je=he.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);je&&await i({phase:je[1].trim(),loaded:parseInt(je[2],10),total:parseInt(je[3],10)})}})}let ve=Buffer.from(await dc(le.packfile));if(ke.body.error)throw ke.body.error;let Ge=ve.slice(-20).toString("hex"),Le={defaultBranch:le.HEAD,fetchHead:le.FETCH_HEAD.oid,fetchHeadDescription:le.FETCH_HEAD.description};if(le.headers&&(Le.headers=le.headers),x&&(Le.pruned=le.pruned),Ge!==""&&!a$(ve)){Le.packfile=`objects/pack/pack-${Ge}.pack`;let Y=C.join(f,Le.packfile);await t.write(Y,ve);let he=a(jt=>de({fs:t,cache:e,gitdir:f,oid:jt}),"getExternalRefDelta"),je=await bs.fromPack({pack:ve,getExternalRefDelta:he,onProgress:i});await t.write(Y.replace(/\.pack$/,".idx"),await je.toBuffer())}return Le}a(Bp,"_fetch");async function oS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:C.join(r,".git"),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let o=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];o=o.map(s=>i+"/"+s);for(let s of o)await t.mkdir(s);await t.write(i+"/config",`[core]
|
|
82
82
|
repositoryformatversion = 0
|
|
83
83
|
filemode = false
|
|
84
84
|
bare = ${e}
|
|
@@ -86,24 +86,25 @@ gpgsig`+hp(s)+`
|
|
|
86
86
|
`)+` symlinks = false
|
|
87
87
|
ignorecase = true
|
|
88
88
|
`),await t.write(i+"/HEAD",`ref: refs/heads/${n}
|
|
89
|
-
`)}a(
|
|
89
|
+
`)}a(oS,"_init");async function u$({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,onPostCheckout:f,dir:c,gitdir:u,url:h,corsProxy:d,ref:p,remote:m,depth:w,since:y,exclude:v,relative:g,singleBranch:_,noCheckout:E,noTags:x,headers:R,nonBlocking:b,batchSize:T=100}){try{if(await oS({fs:t,gitdir:u}),await YE({fs:t,gitdir:u,remote:m,url:h,force:!1}),d){let k=await be.get({fs:t,gitdir:u});await k.set("http.corsProxy",d),await be.save({fs:t,gitdir:u,config:k})}let{defaultBranch:F,fetchHead:P}=await Bp({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,gitdir:u,ref:p,remote:m,corsProxy:d,depth:w,since:y,exclude:v,relative:g,singleBranch:_,headers:R,tags:!x});if(P===null)return;p=p||F,p=p.replace("refs/heads/",""),await Dp({fs:t,cache:e,onProgress:i,onPostCheckout:f,dir:c,gitdir:u,ref:p,remote:m,noCheckout:E,nonBlocking:b,batchSize:T})}catch(F){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),F}}a(u$,"_clone");async function sS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,onPostCheckout:l,dir:f,gitdir:c=C.join(f,".git"),url:u,corsProxy:h=void 0,ref:d=void 0,remote:p="origin",depth:m=void 0,since:w=void 0,exclude:y=[],relative:v=!1,singleBranch:g=!1,noCheckout:_=!1,noTags:E=!1,headers:x={},cache:R={},nonBlocking:b=!1,batchSize:T=100}){try{return S("fs",t),S("http",e),S("gitdir",c),_||S("dir",f),S("url",u),await u$({fs:new M(t),cache:R,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,onPostCheckout:l,dir:f,gitdir:c,url:u,corsProxy:h,ref:d,remote:p,depth:m,since:w,exclude:y,relative:v,singleBranch:g,noCheckout:_,noTags:E,headers:x,nonBlocking:b,batchSize:T})}catch(F){throw F.caller="git.clone",F}}a(sS,"clone");async function aS({fs:t,onSign:e,dir:r,gitdir:i=C.join(r,".git"),message:n,author:o,committer:s,signingKey:l,amend:f=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:h,parent:d,tree:p,cache:m={}}){try{S("fs",t),f||S("message",n),l&&S("onSign",e);let w=new M(t);return await nf({fs:w,cache:m,onSign:e,gitdir:i,message:n,author:o,committer:s,signingKey:l,amend:f,dryRun:c,noUpdateBranch:u,ref:h,parent:d,tree:p})}catch(w){throw w.caller="git.commit",w}}a(aS,"commit");async function lS({fs:t,dir:e,gitdir:r=C.join(e,".git"),fullname:i=!1,test:n=!1}){try{return S("fs",t),S("gitdir",r),await ti({fs:new M(t),gitdir:r,fullname:i,test:n})}catch(o){throw o.caller="git.currentBranch",o}}a(lS,"currentBranch");async function h$({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await N.exists({fs:t,gitdir:e,ref:r}))throw new fe(r);let n=await N.expand({fs:t,gitdir:e,ref:r}),o=await ti({fs:t,gitdir:e,fullname:!0});if(n===o){let f=await N.resolve({fs:t,gitdir:e,ref:n});await N.writeRef({fs:t,gitdir:e,ref:"HEAD",value:f})}await N.deleteRef({fs:t,gitdir:e,ref:n});let s=Ii(r),l=await be.get({fs:t,gitdir:e});await l.deleteSection("branch",s),await be.save({fs:t,gitdir:e,config:l})}a(h$,"_deleteBranch");async function cS({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i}){try{return S("fs",t),S("ref",i),await h$({fs:new M(t),gitdir:r,ref:i})}catch(n){throw n.caller="git.deleteBranch",n}}a(cS,"deleteBranch");async function fS({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i}){try{S("fs",t),S("ref",i),await N.deleteRef({fs:new M(t),gitdir:r,ref:i})}catch(n){throw n.caller="git.deleteRef",n}}a(fS,"deleteRef");async function d$({fs:t,gitdir:e,remote:r}){let i=await be.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await be.save({fs:t,gitdir:e,config:i})}a(d$,"_deleteRemote");async function uS({fs:t,dir:e,gitdir:r=C.join(e,".git"),remote:i}){try{return S("fs",t),S("remote",i),await d$({fs:new M(t),gitdir:r,remote:i})}catch(n){throw n.caller="git.deleteRemote",n}}a(uS,"deleteRemote");async function p$({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await N.deleteRef({fs:t,gitdir:e,ref:r})}a(p$,"_deleteTag");async function hS({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i}){try{return S("fs",t),S("ref",i),await p$({fs:new M(t),gitdir:r,ref:i})}catch(n){throw n.caller="git.deleteTag",n}}a(hS,"deleteTag");async function m$({fs:t,gitdir:e,oid:r}){let i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(o=>`${i}${o}`).filter(o=>o.startsWith(r))}a(m$,"expandOidLoose");async function w$({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let o=[],s=await t.readdir(C.join(r,"objects/pack"));s=s.filter(l=>l.endsWith(".idx"));for(let l of s){let f=`${r}/objects/pack/${l}`,c=await Cp({fs:t,cache:e,filename:f,getExternalRefDelta:n});if(c.error)throw new W(c.error);for(let u of c.offsets.keys())u.startsWith(i)&&o.push(u)}return o}a(w$,"expandOidPacked");async function y$({fs:t,cache:e,gitdir:r,oid:i}){let n=a(l=>de({fs:t,cache:e,gitdir:r,oid:l}),"getExternalRefDelta"),o=await m$({fs:t,gitdir:r,oid:i}),s=await w$({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n});for(let l of s)o.indexOf(l)===-1&&o.push(l);if(o.length===1)return o[0];throw o.length>1?new vs("oids",i,o):new fe(`an object matching "${i}"`)}a(y$,"_expandOid");async function dS({fs:t,dir:e,gitdir:r=C.join(e,".git"),oid:i,cache:n={}}){try{return S("fs",t),S("gitdir",r),S("oid",i),await y$({fs:new M(t),cache:n,gitdir:r,oid:i})}catch(o){throw o.caller="git.expandOid",o}}a(dS,"expandOid");async function pS({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i}){try{return S("fs",t),S("gitdir",r),S("ref",i),await N.expand({fs:new M(t),gitdir:r,ref:i})}catch(n){throw n.caller="git.expandRef",n}}a(pS,"expandRef");async function Lp({fs:t,cache:e,gitdir:r,oids:i}){let n={},o=i.length,s=i.map((l,f)=>({index:f,oid:l}));for(;s.length;){let l=new Set;for(let{oid:c,index:u}of s)n[c]||(n[c]=new Set),n[c].add(u),n[c].size===o&&l.add(c);if(l.size>0)return[...l];let f=new Map;for(let{oid:c,index:u}of s)try{let{object:h}=await de({fs:t,cache:e,gitdir:r,oid:c}),d=nt.from(h),{parent:p}=d.parseHeaders();for(let m of p)(!n[m]||!n[m].has(u))&&f.set(m+":"+u,{oid:m,index:u})}catch{}s=Array.from(f.values())}return[]}a(Lp,"_findMergeBase");var yp=/^.*(\r?\n|$)/gm;function g$({branches:t,contents:e}){let r=t[1],i=t[2],n=e[0],o=e[1],s=e[2],l=o.match(yp),f=n.match(yp),c=s.match(yp),u=QB(l,f,c),h=7,d="",p=!0;for(let m of u)m.ok&&(d+=m.ok.join("")),m.conflict&&(p=!1,d+=`${"<".repeat(h)} ${r}
|
|
90
90
|
`,d+=m.conflict.a.join(""),d+=`${"=".repeat(h)}
|
|
91
91
|
`,d+=m.conflict.b.join(""),d+=`${">".repeat(h)} ${i}
|
|
92
|
-
`);return{cleanMerge:p,mergedText:d}}a(h$,"mergeFile");async function d$({fs:t,cache:e,dir:r,gitdir:i=D.join(r,".git"),index:n,ourOid:o,baseOid:s,theirOid:l,ourName:f="ours",baseName:c="base",theirName:u="theirs",dryRun:h=!1,abortOnConflict:d=!0,mergeDriver:p}){let m=ft({ref:o}),w=ft({ref:s}),y=ft({ref:l}),v=[],g=[],F=[],O=[],S=await Xr({fs:t,cache:e,dir:r,gitdir:i,trees:[m,w,y],map:a(async function(R,[b,x,_]){let P=oc(R),k=await fc(b,x),C=await fc(_,x);switch(`${k}-${C}`){case"false-false":return{mode:await x.mode(),path:P,oid:await x.oid(),type:await x.type()};case"false-true":return!_&&await b.type()==="tree"?{mode:await b.mode(),path:P,oid:await b.oid(),type:await b.type()}:_?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!b&&await _.type()==="tree"?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:b?{mode:await b.mode(),path:P,oid:await b.oid(),type:await b.type()}:void 0;case"true-true":{if(b&&_&&await b.type()==="tree"&&await _.type()==="tree")return{mode:await b.mode(),path:P,oid:await b.oid(),type:"tree"};if(b&&_&&await b.type()==="blob"&&await _.type()==="blob")return p$({fs:t,gitdir:i,path:P,ours:b,base:x,theirs:_,ourName:f,baseName:c,theirName:u,mergeDriver:p}).then(async N=>{if(N.cleanMerge)d||n.insert({filepath:R,oid:N.mergeResult.oid,stage:0});else if(v.push(R),g.push(R),!d){let U="";x&&await x.type()==="blob"&&(U=await x.oid());let Z=await b.oid(),me=await _.oid();n.delete({filepath:R}),U&&n.insert({filepath:R,oid:U,stage:1}),n.insert({filepath:R,oid:Z,stage:2}),n.insert({filepath:R,oid:me,stage:3})}return N.mergeResult});if(x&&!b&&_&&await x.type()==="blob"&&await _.type()==="blob"){if(v.push(R),F.push(R),!d){let N=await x.oid(),U=await _.oid();n.delete({filepath:R}),n.insert({filepath:R,oid:N,stage:1}),n.insert({filepath:R,oid:U,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:P}}if(x&&b&&!_&&await x.type()==="blob"&&await b.type()==="blob"){if(v.push(R),O.push(R),!d){let N=await x.oid(),U=await b.oid();n.delete({filepath:R}),n.insert({filepath:R,oid:N,stage:1}),n.insert({filepath:R,oid:U,stage:2})}return{mode:await b.mode(),oid:await b.oid(),type:"blob",path:P}}if(x&&!b&&!_&&(await x.type()==="blob"||await x.type()==="tree"))return;throw new zn}}},"map"),reduce:v.length!==0&&(!r||d)?void 0:async(R,b)=>{let x=b.filter(Boolean);if(R&&!(R&&R.type==="tree"&&x.length===0&&R.path!==".")){if(x.length>0||R.path==="."&&x.length===0){let P=new tt(x).toObject(),k=await it({fs:t,gitdir:i,type:"tree",object:P,dryRun:h});R.oid=k}return R}}});return v.length!==0?(r&&!d&&await Xr({fs:t,cache:e,dir:r,gitdir:i,trees:[ft({ref:S.oid})],map:a(async function(R,[b]){let x=`${r}/${R}`;if(await b.type()==="blob"){let _=await b.mode(),P=new TextDecoder().decode(await b.content());await t.write(x,P,{mode:_})}return!0},"map")}),new Wn(v,g,F,O)):S.oid}a(d$,"mergeTree");async function p$({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:o,ourName:s,theirName:l,baseName:f,dryRun:c,mergeDriver:u=h$}){let h="blob",d="100755",p="",m="";n&&await n.type()==="blob"&&(d=await n.mode(),p=await n.oid(),m=Buffer.from(await n.content()).toString("utf8"));let w=d===await i.mode()?await o.mode():await i.mode();if(await i.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await i.oid(),type:h}};if(await i.oid()===p)return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await o.oid(),type:h}};if(await o.oid()===p)return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await i.oid(),type:h}};let y=Buffer.from(await i.content()).toString("utf8"),v=Buffer.from(await o.content()).toString("utf8"),{mergedText:g,cleanMerge:F}=await u({branches:[f,s,l],contents:[m,y,v],path:r}),O=await it({fs:t,gitdir:e,type:"blob",object:Buffer.from(g,"utf8"),dryRun:c});return{cleanMerge:F,mergeResult:{mode:w,path:r,oid:O,type:h}}}a(p$,"mergeBlobs");async function hS({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:o,fastForward:s=!0,fastForwardOnly:l=!1,dryRun:f=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:h,author:d,committer:p,signingKey:m,onSign:w,mergeDriver:y,allowUnrelatedHistories:v=!1}){n===void 0&&(n=await Qr({fs:t,gitdir:i,fullname:!0})),n=await B.expand({fs:t,gitdir:i,ref:n}),o=await B.expand({fs:t,gitdir:i,ref:o});let g=await B.resolve({fs:t,gitdir:i,ref:n}),F=await B.resolve({fs:t,gitdir:i,ref:o}),O=await Bp({fs:t,cache:e,gitdir:i,oids:[g,F]});if(O.length!==1)if(O.length===0&&v)O.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new zn;let S=O[0];if(S===F)return{oid:g,alreadyMerged:!0};if(s&&S===g)return!f&&!c&&await B.writeRef({fs:t,gitdir:i,ref:n,value:F}),{oid:F,fastForward:!0};{if(l)throw new Es;let R=await Fe.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async x=>d$({fs:t,cache:e,dir:r,gitdir:i,index:x,ourOid:g,theirOid:F,baseOid:S,ourName:ki(n),baseName:"base",theirName:ki(o),dryRun:f,abortOnConflict:u,mergeDriver:y}));if(R instanceof Wn)throw R;return h||(h=`Merge branch '${ki(o)}' into ${ki(n)}`),{oid:await tf({fs:t,cache:e,gitdir:i,message:h,ref:n,tree:R,parent:[g,F],author:d,committer:p,signingKey:m,onSign:w,dryRun:f,noUpdateBranch:c}),tree:R,mergeCommit:!0}}}a(hS,"_merge");async function dS({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,dir:f,gitdir:c,ref:u,url:h,remote:d,remoteRef:p,prune:m,pruneTags:w,fastForward:y,fastForwardOnly:v,corsProxy:g,singleBranch:F,headers:O,author:S,committer:R,signingKey:b}){try{if(!u){let P=await Qr({fs:t,gitdir:c});if(!P)throw new et("ref");u=P}let{fetchHead:x,fetchHeadDescription:_}=await Np({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,gitdir:c,corsProxy:g,ref:u,url:h,remote:d,remoteRef:p,singleBranch:F,headers:O,prune:m,pruneTags:w});await hS({fs:t,cache:e,gitdir:c,ours:u,theirs:x,fastForward:y,fastForwardOnly:v,message:`Merge ${_}`,author:S,committer:R,signingKey:b,dryRun:!1,noUpdateBranch:!1}),await Dp({fs:t,cache:e,onProgress:i,dir:f,gitdir:c,ref:u,remote:d,noCheckout:!1})}catch(x){throw x.caller="git.pull",x}}a(dS,"_pull");async function pS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=D.join(l,".git"),ref:c,url:u,remote:h,remoteRef:d,corsProxy:p,singleBranch:m,headers:w={},cache:y={}}){try{E("fs",t),E("http",e),E("gitdir",f);let v={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await dS({fs:new M(t),cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f,ref:c,url:u,remote:h,remoteRef:d,fastForwardOnly:!0,corsProxy:p,singleBranch:m,headers:w,author:v,committer:v})}catch(v){throw v.caller="git.fastForward",v}}a(pS,"fastForward");async function mS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=D.join(l,".git"),ref:c,remote:u,remoteRef:h,url:d,corsProxy:p,depth:m=null,since:w=null,exclude:y=[],relative:v=!1,tags:g=!1,singleBranch:F=!1,headers:O={},prune:S=!1,pruneTags:R=!1,cache:b={}}){try{return E("fs",t),E("http",e),E("gitdir",f),await Np({fs:new M(t),cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,gitdir:f,ref:c,remote:u,remoteRef:h,url:d,corsProxy:p,depth:m,since:w,exclude:y,relative:v,tags:g,singleBranch:F,headers:O,prune:S,pruneTags:R})}catch(x){throw x.caller="git.fetch",x}}a(mS,"fetch");async function wS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oids:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),E("oids",i),await Bp({fs:new M(t),cache:n,gitdir:r,oids:i})}catch(o){throw o.caller="git.findMergeBase",o}}a(wS,"findMergeBase");async function yS({fs:t,filepath:e}){if(await t.exists(D.join(e,".git")))return e;{let r=Hn(e);if(r===e)throw new ce(`git root for ${e}`);return yS({fs:t,filepath:r})}}a(yS,"_findRoot");async function gS({fs:t,filepath:e}){try{return E("fs",t),E("filepath",e),await yS({fs:new M(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}a(gS,"findRoot");async function bS({fs:t,dir:e,gitdir:r=D.join(e,".git"),path:i}){try{return E("fs",t),E("gitdir",r),E("path",i),await Is({fs:new M(t),gitdir:r,path:i})}catch(n){throw n.caller="git.getConfig",n}}a(bS,"getConfig");async function m$({fs:t,gitdir:e,path:r}){return(await be.get({fs:t,gitdir:e})).getall(r)}a(m$,"_getConfigAll");async function vS({fs:t,dir:e,gitdir:r=D.join(e,".git"),path:i}){try{return E("fs",t),E("gitdir",r),E("path",i),await m$({fs:new M(t),gitdir:r,path:i})}catch(n){throw n.caller="git.getConfigAll",n}}a(vS,"getConfigAll");async function _S({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1}){try{E("http",t),E("url",o);let c=await Jn.getRemoteHelperFor({url:o}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[h,d]of c.refs){let p=h.split("/"),m=p.pop(),w=u;for(let y of p)w[y]=w[y]||{},w=w[y];w[m]=d}for(let[h,d]of c.symrefs){let p=h.split("/"),m=p.pop(),w=u;for(let y of p)w[y]=w[y]||{},w=w[y];w[m]=d}return u}catch(f){throw f.caller="git.getRemoteInfo",f}}a(_S,"getRemoteInfo");function FS(t,e,r,i){let n=[];for(let[o,s]of t.refs){if(e&&!o.startsWith(e))continue;if(o.endsWith("^{}")){if(i){let f=o.replace("^{}",""),c=n[n.length-1],u=c.ref===f?c:n.find(h=>h.ref===f);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=s}continue}let l={ref:o,oid:s};r&&t.symrefs.has(o)&&(l.target=t.symrefs.get(o)),n.push(l)}return n}a(FS,"formatInfoRefs");async function ES({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1,protocolVersion:f=2}){try{E("http",t),E("url",o);let u=await Jn.getRemoteHelperFor({url:o}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:f});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let h={};for(let d of u.capabilities){let[p,m]=d.split("=");m?h[p]=m:h[p]=!0}return{protocolVersion:1,capabilities:h,refs:FS(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}a(ES,"getRemoteInfo2");async function w$({type:t,object:e,format:r="content",oid:i=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(e=Kr.wrap({type:t,object:e})),i=await br(e)),{oid:i,object:e}}a(w$,"hashObject");async function SS({object:t}){try{E("object",t),typeof t=="string"?t=Buffer.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));let e="blob",{oid:r,object:i}=await w$({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}a(SS,"hashBlob");async function y$({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:o}){try{o=D.join(i,o);let s=await t.read(o),l=a(c=>de({fs:t,cache:e,gitdir:n,oid:c}),"getExternalRefDelta"),f=await gs.fromPack({pack:s,getExternalRefDelta:l,onProgress:r});return await t.write(o.replace(/\.pack$/,".idx"),await f.toBuffer()),{oids:[...f.hashes]}}catch(s){throw s.caller="git.indexPack",s}}a(y$,"_indexPack");async function xS({fs:t,onProgress:e,dir:r,gitdir:i=D.join(r,".git"),filepath:n,cache:o={}}){try{return E("fs",t),E("dir",r),E("gitdir",r),E("filepath",n),await y$({fs:new M(t),cache:o,onProgress:e,dir:r,gitdir:i,filepath:n})}catch(s){throw s.caller="git.indexPack",s}}a(xS,"indexPack");async function TS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:D.join(r,".git"),defaultBranch:n="master"}){try{return E("fs",t),E("gitdir",i),e||E("dir",r),await rS({fs:new M(t),bare:e,dir:r,gitdir:i,defaultBranch:n})}catch(o){throw o.caller="git.init",o}}a(TS,"init");async function OS({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:o}){let s=await Ai.read({fs:t,gitdir:r});if(!i)throw new et("oid");if(!n)throw new et("ancestor");if(i===n)return!1;let l=[i],f=new Set,c=0;for(;l.length;){if(c++===o)throw new xs(o);let u=l.shift(),{type:h,object:d}=await de({fs:t,cache:e,gitdir:r,oid:u});if(h!=="commit")throw new Ze(u,h,"commit");let p=rt.from(d).parse();for(let m of p.parent)if(m===n)return!0;if(!s.has(u))for(let m of p.parent)f.has(m)||(l.push(m),f.add(m))}return!1}a(OS,"_isDescendent");async function RS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,ancestor:n,depth:o=-1,cache:s={}}){try{return E("fs",t),E("gitdir",r),E("oid",i),E("ancestor",n),await OS({fs:new M(t),cache:s,gitdir:r,oid:i,ancestor:n,depth:o})}catch(l){throw l.caller="git.isDescendent",l}}a(RS,"isDescendent");async function kS({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i}){try{return E("fs",t),E("dir",e),E("gitdir",r),E("filepath",i),Yr.isIgnored({fs:new M(t),dir:e,gitdir:r,filepath:i})}catch(n){throw n.caller="git.isIgnored",n}}a(kS,"isIgnored");async function PS({fs:t,dir:e,gitdir:r=D.join(e,".git"),remote:i}){try{return E("fs",t),E("gitdir",r),B.listBranches({fs:new M(t),gitdir:r,remote:i})}catch(n){throw n.caller="git.listBranches",n}}a(PS,"listBranches");async function g$({fs:t,gitdir:e,ref:r,cache:i}){if(r){let n=await B.resolve({gitdir:e,fs:t,ref:r}),o=[];return await AS({fs:t,cache:i,gitdir:e,oid:n,filenames:o,prefix:""}),o}else return Fe.acquire({fs:t,gitdir:e,cache:i},async function(n){return n.entries.map(o=>o.path)})}a(g$,"_listFiles");async function AS({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:o}){let{tree:s}=await to({fs:t,cache:e,gitdir:r,oid:i});for(let l of s)l.type==="tree"?await AS({fs:t,cache:e,gitdir:r,oid:l.oid,filenames:n,prefix:D.join(o,l.path)}):n.push(D.join(o,l.path))}a(AS,"accumulateFilesFromOid");async function IS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),await g$({fs:new M(t),cache:n,gitdir:r,ref:i})}catch(o){throw o.caller="git.listFiles",o}}a(IS,"listFiles");async function b$({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await B.resolve({gitdir:r,fs:t,ref:i})}catch(l){if(l instanceof ce)return[]}return(await to({fs:t,cache:e,gitdir:r,oid:n})).tree.map(l=>({target:l.path,note:l.oid}))}a(b$,"_listNotes");async function DS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{return E("fs",t),E("gitdir",r),E("ref",i),await b$({fs:new M(t),cache:n,gitdir:r,ref:i})}catch(o){throw o.caller="git.listNotes",o}}a(DS,"listNotes");async function CS({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i}){try{return E("fs",t),E("gitdir",r),B.listRefs({fs:new M(t),gitdir:r,filepath:i})}catch(n){throw n.caller="git.listRefs",n}}a(CS,"listRefs");async function v$({fs:t,gitdir:e}){let r=await be.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async o=>{let s=await r.get(`remote.${o}.url`);return{remote:o,url:s}}))}a(v$,"_listRemotes");async function NS({fs:t,dir:e,gitdir:r=D.join(e,".git")}){try{return E("fs",t),E("gitdir",r),await v$({fs:new M(t),gitdir:r})}catch(i){throw i.caller="git.listRemotes",i}}a(NS,"listRemotes");async function _$(t){let e=we.streamReader(t),r=[],i;for(;i=await e(),i!==!0;){if(i===null)continue;i=i.toString("utf8").replace(/\n$/,"");let[n,o,...s]=i.split(" "),l={ref:o,oid:n};for(let f of s){let[c,u]=f.split(":");c==="symref-target"?l.target=u:c==="peeled"&&(l.peeled=u)}r.push(l)}return r}a(_$,"parseListRefsResponse");async function F$({prefix:t,symrefs:e,peelTags:r}){let i=[];return i.push(we.encode(`command=ls-refs
|
|
93
|
-
`)),i.push(we.encode(`agent=${
|
|
94
|
-
`)),(r||e||t)&&i.push(we.delim()),r&&i.push(we.encode("peel")),e&&i.push(we.encode("symrefs")),t&&i.push(we.encode(`ref-prefix ${t}`)),i.push(we.flush()),i}a(
|
|
92
|
+
`);return{cleanMerge:p,mergedText:d}}a(g$,"mergeFile");async function b$({fs:t,cache:e,dir:r,gitdir:i=C.join(r,".git"),index:n,ourOid:o,baseOid:s,theirOid:l,ourName:f="ours",baseName:c="base",theirName:u="theirs",dryRun:h=!1,abortOnConflict:d=!0,mergeDriver:p}){let m=ht({ref:o}),w=ht({ref:s}),y=ht({ref:l}),v=[],g=[],_=[],E=[],x=await Jr({fs:t,cache:e,dir:r,gitdir:i,trees:[m,w,y],map:a(async function(R,[b,T,F]){let P=ac(R),k=await hc(b,T),D=await hc(F,T);switch(`${k}-${D}`){case"false-false":return{mode:await T.mode(),path:P,oid:await T.oid(),type:await T.type()};case"false-true":return!F&&await b.type()==="tree"?{mode:await b.mode(),path:P,oid:await b.oid(),type:await b.type()}:F?{mode:await F.mode(),path:P,oid:await F.oid(),type:await F.type()}:void 0;case"true-false":return!b&&await F.type()==="tree"?{mode:await F.mode(),path:P,oid:await F.oid(),type:await F.type()}:b?{mode:await b.mode(),path:P,oid:await b.oid(),type:await b.type()}:void 0;case"true-true":{if(b&&F&&await b.type()==="tree"&&await F.type()==="tree")return{mode:await b.mode(),path:P,oid:await b.oid(),type:"tree"};if(b&&F&&await b.type()==="blob"&&await F.type()==="blob")return v$({fs:t,gitdir:i,path:P,ours:b,base:T,theirs:F,ourName:f,baseName:c,theirName:u,mergeDriver:p}).then(async B=>{if(B.cleanMerge)d||n.insert({filepath:R,oid:B.mergeResult.oid,stage:0});else if(v.push(R),g.push(R),!d){let U="";T&&await T.type()==="blob"&&(U=await T.oid());let Z=await b.oid(),me=await F.oid();n.delete({filepath:R}),U&&n.insert({filepath:R,oid:U,stage:1}),n.insert({filepath:R,oid:Z,stage:2}),n.insert({filepath:R,oid:me,stage:3})}return B.mergeResult});if(T&&!b&&F&&await T.type()==="blob"&&await F.type()==="blob"){if(v.push(R),_.push(R),!d){let B=await T.oid(),U=await F.oid();n.delete({filepath:R}),n.insert({filepath:R,oid:B,stage:1}),n.insert({filepath:R,oid:U,stage:3})}return{mode:await F.mode(),oid:await F.oid(),type:"blob",path:P}}if(T&&b&&!F&&await T.type()==="blob"&&await b.type()==="blob"){if(v.push(R),E.push(R),!d){let B=await T.oid(),U=await b.oid();n.delete({filepath:R}),n.insert({filepath:R,oid:B,stage:1}),n.insert({filepath:R,oid:U,stage:2})}return{mode:await b.mode(),oid:await b.oid(),type:"blob",path:P}}if(T&&!b&&!F&&(await T.type()==="blob"||await T.type()==="tree"))return;throw new Gn}}},"map"),reduce:v.length!==0&&(!r||d)?void 0:async(R,b)=>{let T=b.filter(Boolean);if(R&&!(R&&R.type==="tree"&&T.length===0&&R.path!==".")){if(T.length>0||R.path==="."&&T.length===0){let P=new it(T).toObject(),k=await ot({fs:t,gitdir:i,type:"tree",object:P,dryRun:h});R.oid=k}return R}}});return v.length!==0?(r&&!d&&await Jr({fs:t,cache:e,dir:r,gitdir:i,trees:[ht({ref:x.oid})],map:a(async function(R,[b]){let T=`${r}/${R}`;if(await b.type()==="blob"){let F=await b.mode(),P=new TextDecoder().decode(await b.content());await t.write(T,P,{mode:F})}return!0},"map")}),new Kn(v,g,_,E)):x.oid}a(b$,"mergeTree");async function v$({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:o,ourName:s,theirName:l,baseName:f,dryRun:c,mergeDriver:u=g$}){let h="blob",d="100755",p="",m="";n&&await n.type()==="blob"&&(d=await n.mode(),p=await n.oid(),m=Buffer.from(await n.content()).toString("utf8"));let w=d===await i.mode()?await o.mode():await i.mode();if(await i.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await i.oid(),type:h}};if(await i.oid()===p)return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await o.oid(),type:h}};if(await o.oid()===p)return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await i.oid(),type:h}};let y=Buffer.from(await i.content()).toString("utf8"),v=Buffer.from(await o.content()).toString("utf8"),{mergedText:g,cleanMerge:_}=await u({branches:[f,s,l],contents:[m,y,v],path:r}),E=await ot({fs:t,gitdir:e,type:"blob",object:Buffer.from(g,"utf8"),dryRun:c});return{cleanMerge:_,mergeResult:{mode:w,path:r,oid:E,type:h}}}a(v$,"mergeBlobs");async function mS({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:o,fastForward:s=!0,fastForwardOnly:l=!1,dryRun:f=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:h,author:d,committer:p,signingKey:m,onSign:w,mergeDriver:y,allowUnrelatedHistories:v=!1}){n===void 0&&(n=await ti({fs:t,gitdir:i,fullname:!0})),n=await N.expand({fs:t,gitdir:i,ref:n}),o=await N.expand({fs:t,gitdir:i,ref:o});let g=await N.resolve({fs:t,gitdir:i,ref:n}),_=await N.resolve({fs:t,gitdir:i,ref:o}),E=await Lp({fs:t,cache:e,gitdir:i,oids:[g,_]});if(E.length!==1)if(E.length===0&&v)E.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new Gn;let x=E[0];if(x===_)return{oid:g,alreadyMerged:!0};if(s&&x===g)return!f&&!c&&await N.writeRef({fs:t,gitdir:i,ref:n,value:_}),{oid:_,fastForward:!0};{if(l)throw new Ss;let R=await Fe.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async T=>b$({fs:t,cache:e,dir:r,gitdir:i,index:T,ourOid:g,theirOid:_,baseOid:x,ourName:Ii(n),baseName:"base",theirName:Ii(o),dryRun:f,abortOnConflict:u,mergeDriver:y}));if(R instanceof Kn)throw R;return h||(h=`Merge branch '${Ii(o)}' into ${Ii(n)}`),{oid:await nf({fs:t,cache:e,gitdir:i,message:h,ref:n,tree:R,parent:[g,_],author:d,committer:p,signingKey:m,onSign:w,dryRun:f,noUpdateBranch:c}),tree:R,mergeCommit:!0}}}a(mS,"_merge");async function wS({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,dir:f,gitdir:c,ref:u,url:h,remote:d,remoteRef:p,prune:m,pruneTags:w,fastForward:y,fastForwardOnly:v,corsProxy:g,singleBranch:_,headers:E,author:x,committer:R,signingKey:b}){try{if(!u){let P=await ti({fs:t,gitdir:c});if(!P)throw new rt("ref");u=P}let{fetchHead:T,fetchHeadDescription:F}=await Bp({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,gitdir:c,corsProxy:g,ref:u,url:h,remote:d,remoteRef:p,singleBranch:_,headers:E,prune:m,pruneTags:w});await mS({fs:t,cache:e,gitdir:c,ours:u,theirs:T,fastForward:y,fastForwardOnly:v,message:`Merge ${F}`,author:x,committer:R,signingKey:b,dryRun:!1,noUpdateBranch:!1}),await Dp({fs:t,cache:e,onProgress:i,dir:f,gitdir:c,ref:u,remote:d,noCheckout:!1})}catch(T){throw T.caller="git.pull",T}}a(wS,"_pull");async function yS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=C.join(l,".git"),ref:c,url:u,remote:h,remoteRef:d,corsProxy:p,singleBranch:m,headers:w={},cache:y={}}){try{S("fs",t),S("http",e),S("gitdir",f);let v={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await wS({fs:new M(t),cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f,ref:c,url:u,remote:h,remoteRef:d,fastForwardOnly:!0,corsProxy:p,singleBranch:m,headers:w,author:v,committer:v})}catch(v){throw v.caller="git.fastForward",v}}a(yS,"fastForward");async function gS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=C.join(l,".git"),ref:c,remote:u,remoteRef:h,url:d,corsProxy:p,depth:m=null,since:w=null,exclude:y=[],relative:v=!1,tags:g=!1,singleBranch:_=!1,headers:E={},prune:x=!1,pruneTags:R=!1,cache:b={}}){try{return S("fs",t),S("http",e),S("gitdir",f),await Bp({fs:new M(t),cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,gitdir:f,ref:c,remote:u,remoteRef:h,url:d,corsProxy:p,depth:m,since:w,exclude:y,relative:v,tags:g,singleBranch:_,headers:E,prune:x,pruneTags:R})}catch(T){throw T.caller="git.fetch",T}}a(gS,"fetch");async function bS({fs:t,dir:e,gitdir:r=C.join(e,".git"),oids:i,cache:n={}}){try{return S("fs",t),S("gitdir",r),S("oids",i),await Lp({fs:new M(t),cache:n,gitdir:r,oids:i})}catch(o){throw o.caller="git.findMergeBase",o}}a(bS,"findMergeBase");async function vS({fs:t,filepath:e}){if(await t.exists(C.join(e,".git")))return e;{let r=Wn(e);if(r===e)throw new fe(`git root for ${e}`);return vS({fs:t,filepath:r})}}a(vS,"_findRoot");async function _S({fs:t,filepath:e}){try{return S("fs",t),S("filepath",e),await vS({fs:new M(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}a(_S,"findRoot");async function FS({fs:t,dir:e,gitdir:r=C.join(e,".git"),path:i}){try{return S("fs",t),S("gitdir",r),S("path",i),await Cs({fs:new M(t),gitdir:r,path:i})}catch(n){throw n.caller="git.getConfig",n}}a(FS,"getConfig");async function _$({fs:t,gitdir:e,path:r}){return(await be.get({fs:t,gitdir:e})).getall(r)}a(_$,"_getConfigAll");async function ES({fs:t,dir:e,gitdir:r=C.join(e,".git"),path:i}){try{return S("fs",t),S("gitdir",r),S("path",i),await _$({fs:new M(t),gitdir:r,path:i})}catch(n){throw n.caller="git.getConfigAll",n}}a(ES,"getConfigAll");async function SS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1}){try{S("http",t),S("url",o);let c=await to.getRemoteHelperFor({url:o}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[h,d]of c.refs){let p=h.split("/"),m=p.pop(),w=u;for(let y of p)w[y]=w[y]||{},w=w[y];w[m]=d}for(let[h,d]of c.symrefs){let p=h.split("/"),m=p.pop(),w=u;for(let y of p)w[y]=w[y]||{},w=w[y];w[m]=d}return u}catch(f){throw f.caller="git.getRemoteInfo",f}}a(SS,"getRemoteInfo");function xS(t,e,r,i){let n=[];for(let[o,s]of t.refs){if(e&&!o.startsWith(e))continue;if(o.endsWith("^{}")){if(i){let f=o.replace("^{}",""),c=n[n.length-1],u=c.ref===f?c:n.find(h=>h.ref===f);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=s}continue}let l={ref:o,oid:s};r&&t.symrefs.has(o)&&(l.target=t.symrefs.get(o)),n.push(l)}return n}a(xS,"formatInfoRefs");async function TS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1,protocolVersion:f=2}){try{S("http",t),S("url",o);let u=await to.getRemoteHelperFor({url:o}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:f});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let h={};for(let d of u.capabilities){let[p,m]=d.split("=");m?h[p]=m:h[p]=!0}return{protocolVersion:1,capabilities:h,refs:xS(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}a(TS,"getRemoteInfo2");async function F$({type:t,object:e,format:r="content",oid:i=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(e=Xr.wrap({type:t,object:e})),i=await _r(e)),{oid:i,object:e}}a(F$,"hashObject");async function OS({object:t}){try{S("object",t),typeof t=="string"?t=Buffer.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));let e="blob",{oid:r,object:i}=await F$({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}a(OS,"hashBlob");async function E$({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:o}){try{o=C.join(i,o);let s=await t.read(o),l=a(c=>de({fs:t,cache:e,gitdir:n,oid:c}),"getExternalRefDelta"),f=await bs.fromPack({pack:s,getExternalRefDelta:l,onProgress:r});return await t.write(o.replace(/\.pack$/,".idx"),await f.toBuffer()),{oids:[...f.hashes]}}catch(s){throw s.caller="git.indexPack",s}}a(E$,"_indexPack");async function kS({fs:t,onProgress:e,dir:r,gitdir:i=C.join(r,".git"),filepath:n,cache:o={}}){try{return S("fs",t),S("dir",r),S("gitdir",r),S("filepath",n),await E$({fs:new M(t),cache:o,onProgress:e,dir:r,gitdir:i,filepath:n})}catch(s){throw s.caller="git.indexPack",s}}a(kS,"indexPack");async function RS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:C.join(r,".git"),defaultBranch:n="master"}){try{return S("fs",t),S("gitdir",i),e||S("dir",r),await oS({fs:new M(t),bare:e,dir:r,gitdir:i,defaultBranch:n})}catch(o){throw o.caller="git.init",o}}a(RS,"init");async function PS({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:o}){let s=await Di.read({fs:t,gitdir:r});if(!i)throw new rt("oid");if(!n)throw new rt("ancestor");if(i===n)return!1;let l=[i],f=new Set,c=0;for(;l.length;){if(c++===o)throw new Ts(o);let u=l.shift(),{type:h,object:d}=await de({fs:t,cache:e,gitdir:r,oid:u});if(h!=="commit")throw new Xe(u,h,"commit");let p=nt.from(d).parse();for(let m of p.parent)if(m===n)return!0;if(!s.has(u))for(let m of p.parent)f.has(m)||(l.push(m),f.add(m))}return!1}a(PS,"_isDescendent");async function AS({fs:t,dir:e,gitdir:r=C.join(e,".git"),oid:i,ancestor:n,depth:o=-1,cache:s={}}){try{return S("fs",t),S("gitdir",r),S("oid",i),S("ancestor",n),await PS({fs:new M(t),cache:s,gitdir:r,oid:i,ancestor:n,depth:o})}catch(l){throw l.caller="git.isDescendent",l}}a(AS,"isDescendent");async function IS({fs:t,dir:e,gitdir:r=C.join(e,".git"),filepath:i}){try{return S("fs",t),S("dir",e),S("gitdir",r),S("filepath",i),Qr.isIgnored({fs:new M(t),dir:e,gitdir:r,filepath:i})}catch(n){throw n.caller="git.isIgnored",n}}a(IS,"isIgnored");async function CS({fs:t,dir:e,gitdir:r=C.join(e,".git"),remote:i}){try{return S("fs",t),S("gitdir",r),N.listBranches({fs:new M(t),gitdir:r,remote:i})}catch(n){throw n.caller="git.listBranches",n}}a(CS,"listBranches");async function S$({fs:t,gitdir:e,ref:r,cache:i}){if(r){let n=await N.resolve({gitdir:e,fs:t,ref:r}),o=[];return await DS({fs:t,cache:i,gitdir:e,oid:n,filenames:o,prefix:""}),o}else return Fe.acquire({fs:t,gitdir:e,cache:i},async function(n){return n.entries.map(o=>o.path)})}a(S$,"_listFiles");async function DS({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:o}){let{tree:s}=await no({fs:t,cache:e,gitdir:r,oid:i});for(let l of s)l.type==="tree"?await DS({fs:t,cache:e,gitdir:r,oid:l.oid,filenames:n,prefix:C.join(o,l.path)}):n.push(C.join(o,l.path))}a(DS,"accumulateFilesFromOid");async function NS({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i,cache:n={}}){try{return S("fs",t),S("gitdir",r),await S$({fs:new M(t),cache:n,gitdir:r,ref:i})}catch(o){throw o.caller="git.listFiles",o}}a(NS,"listFiles");async function x$({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await N.resolve({gitdir:r,fs:t,ref:i})}catch(l){if(l instanceof fe)return[]}return(await no({fs:t,cache:e,gitdir:r,oid:n})).tree.map(l=>({target:l.path,note:l.oid}))}a(x$,"_listNotes");async function BS({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{return S("fs",t),S("gitdir",r),S("ref",i),await x$({fs:new M(t),cache:n,gitdir:r,ref:i})}catch(o){throw o.caller="git.listNotes",o}}a(BS,"listNotes");async function LS({fs:t,dir:e,gitdir:r=C.join(e,".git"),filepath:i}){try{return S("fs",t),S("gitdir",r),N.listRefs({fs:new M(t),gitdir:r,filepath:i})}catch(n){throw n.caller="git.listRefs",n}}a(LS,"listRefs");async function T$({fs:t,gitdir:e}){let r=await be.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async o=>{let s=await r.get(`remote.${o}.url`);return{remote:o,url:s}}))}a(T$,"_listRemotes");async function $S({fs:t,dir:e,gitdir:r=C.join(e,".git")}){try{return S("fs",t),S("gitdir",r),await T$({fs:new M(t),gitdir:r})}catch(i){throw i.caller="git.listRemotes",i}}a($S,"listRemotes");async function O$(t){let e=we.streamReader(t),r=[],i;for(;i=await e(),i!==!0;){if(i===null)continue;i=i.toString("utf8").replace(/\n$/,"");let[n,o,...s]=i.split(" "),l={ref:o,oid:n};for(let f of s){let[c,u]=f.split(":");c==="symref-target"?l.target=u:c==="peeled"&&(l.peeled=u)}r.push(l)}return r}a(O$,"parseListRefsResponse");async function k$({prefix:t,symrefs:e,peelTags:r}){let i=[];return i.push(we.encode(`command=ls-refs
|
|
93
|
+
`)),i.push(we.encode(`agent=${of.agent}
|
|
94
|
+
`)),(r||e||t)&&i.push(we.delim()),r&&i.push(we.encode("peel")),e&&i.push(we.encode("symrefs")),t&&i.push(we.encode(`ref-prefix ${t}`)),i.push(we.flush()),i}a(k$,"writeListRefsRequest");async function MS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1,protocolVersion:f=2,prefix:c,symrefs:u,peelTags:h}){try{S("http",t),S("url",o);let d=await eo.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:f});if(d.protocolVersion===1)return xS(d,c,u,h);let p=await k$({prefix:c,symrefs:u,peelTags:h}),m=await eo.connect({http:t,auth:d.auth,headers:s,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,body:p});return O$(m.body)}catch(d){throw d.caller="git.listServerRefs",d}}a(MS,"listServerRefs");async function jS({fs:t,dir:e,gitdir:r=C.join(e,".git")}){try{return S("fs",t),S("gitdir",r),N.listTags({fs:new M(t),gitdir:r})}catch(i){throw i.caller="git.listTags",i}}a(jS,"listTags");function R$(t,e){return t.committer.timestamp-e.committer.timestamp}a(R$,"compareAge");var P$="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function RE({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===P$)return;let o=i,s,l=await Yn({fs:t,cache:e,gitdir:r,oid:i}),f=l.tree;return n===l.oid?s=l.path:(s=await US({fs:t,cache:e,gitdir:r,tree:f,fileId:n,oid:o}),Array.isArray(s)&&(s.length===0?s=void 0:s.length===1&&(s=s[0]))),s}a(RE,"resolveFileIdInTree");async function US({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:o,filepaths:s=[],parentPath:l=""}){let f=i.entries().map(function(c){let u;return c.oid===n?(u=C.join(l,c.path),s.push(u)):c.type==="tree"&&(u=de({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:h}){return US({fs:t,cache:e,gitdir:r,tree:it.from(h),fileId:n,oid:o,filepaths:s,parentPath:C.join(l,c.path)})})),u});return await Promise.all(f),s}a(US,"_resolveFileId");async function A$({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:o,since:s,force:l,follow:f}){let c=typeof s>"u"?void 0:Math.floor(s.valueOf()/1e3),u=[],h=await Di.read({fs:t,gitdir:r}),d=await N.resolve({fs:t,gitdir:r,ref:n}),p=[await Qn({fs:t,cache:e,gitdir:r,oid:d})],m,w,y;function v(g){y&&i&&u.push(g)}for(a(v,"endCommit");p.length>0;){let g=p.pop();if(c!==void 0&&g.commit.committer.timestamp<=c)break;if(i){let _;try{_=await Ds({fs:t,cache:e,gitdir:r,oid:g.commit.tree,filepath:i}),w&&m!==_&&u.push(w),m=_,w=g,y=!0}catch(E){if(E instanceof fe){let x=f&&m;if(x&&(x=await RE({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:m}),x))if(Array.isArray(x)){if(w){let R=await RE({fs:t,cache:e,gitdir:r,oid:w.commit.tree,fileId:m});if(Array.isArray(R))if(x=x.filter(b=>R.indexOf(b)===-1),x.length===1)x=x[0],i=x,w&&u.push(w);else{x=!1,w&&u.push(w);break}}}else i=x,w&&u.push(w);if(!x){if(y&&m&&(u.push(w),!l))break;if(!l&&!f)throw E}w=g,y=!1}else throw E}}else u.push(g);if(o!==void 0&&u.length===o){v(g);break}if(!h.has(g.oid))for(let _ of g.commit.parent){let E=await Qn({fs:t,cache:e,gitdir:r,oid:_});p.map(x=>x.oid).includes(E.oid)||p.push(E)}p.length===0&&v(g),p.sort((_,E)=>R$(_.commit,E.commit))}return u}a(A$,"_log");async function HS({fs:t,dir:e,gitdir:r=C.join(e,".git"),filepath:i,ref:n="HEAD",depth:o,since:s,force:l,follow:f,cache:c={}}){try{return S("fs",t),S("gitdir",r),S("ref",n),await A$({fs:new M(t),cache:c,gitdir:r,filepath:i,ref:n,depth:o,since:s,force:l,follow:f})}catch(u){throw u.caller="git.log",u}}a(HS,"log");async function qS({fs:t,onSign:e,dir:r,gitdir:i=C.join(r,".git"),ours:n,theirs:o,fastForward:s=!0,fastForwardOnly:l=!1,dryRun:f=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:h,author:d,committer:p,signingKey:m,cache:w={},mergeDriver:y,allowUnrelatedHistories:v=!1}){try{S("fs",t),m&&S("onSign",e);let g=new M(t),_=await ei({fs:g,gitdir:i,author:d});if(!_&&(!l||!s))throw new ze("author");let E=await Jn({fs:g,gitdir:i,author:_,committer:p});if(!E&&(!l||!s))throw new ze("committer");return await mS({fs:g,cache:w,dir:r,gitdir:i,ours:n,theirs:o,fastForward:s,fastForwardOnly:l,dryRun:f,noUpdateBranch:c,abortOnConflict:u,message:h,author:_,committer:E,signingKey:m,onSign:e,mergeDriver:y,allowUnrelatedHistories:v})}catch(g){throw g.caller="git.merge",g}}a(qS,"merge");var I$={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function zS({fs:t,cache:e,dir:r,gitdir:i=C.join(r,".git"),oids:n}){let o=new AE,s=[];function l(u,h){let d=Buffer.from(u,h);s.push(d),o.update(d)}a(l,"write");async function f({stype:u,object:h}){let d=I$[u],p=h.length,m=p>15?128:0,w=p&15;p=p>>>4;let y=(m|d|w).toString(16);for(l(y,"hex");m;)m=p>127?128:0,y=m|p&127,l(Ap(2,y),"hex"),p=p>>>7;l(Buffer.from(await qE(h)))}a(f,"writeObject"),l("PACK"),l("00000002","hex"),l(Ap(8,n.length),"hex");for(let u of n){let{type:h,object:d}=await de({fs:t,cache:e,gitdir:i,oid:u});await f({write:l,object:d,stype:h})}let c=o.digest();return s.push(c),s}a(zS,"_pack");async function C$({fs:t,cache:e,gitdir:r,oids:i,write:n}){let o=await zS({fs:t,cache:e,gitdir:r,oids:i}),s=Buffer.from(await dc(o)),f=`pack-${s.slice(-20).toString("hex")}.pack`;return n?(await t.write(C.join(r,`objects/pack/${f}`),s),{filename:f}):{filename:f,packfile:new Uint8Array(s)}}a(C$,"_packObjects");async function WS({fs:t,dir:e,gitdir:r=C.join(e,".git"),oids:i,write:n=!1,cache:o={}}){try{return S("fs",t),S("gitdir",r),S("oids",i),await C$({fs:new M(t),cache:o,gitdir:r,oids:i,write:n})}catch(s){throw s.caller="git.packObjects",s}}a(WS,"packObjects");async function VS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=C.join(l,".git"),ref:c,url:u,remote:h,remoteRef:d,prune:p=!1,pruneTags:m=!1,fastForward:w=!0,fastForwardOnly:y=!1,corsProxy:v,singleBranch:g,headers:_={},author:E,committer:x,signingKey:R,cache:b={}}){try{S("fs",t),S("gitdir",f);let T=new M(t),F=await ei({fs:T,gitdir:f,author:E});if(!F)throw new ze("author");let P=await Jn({fs:T,gitdir:f,author:F,committer:x});if(!P)throw new ze("committer");return await wS({fs:T,cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f,ref:c,url:u,remote:h,remoteRef:d,fastForward:w,fastForwardOnly:y,corsProxy:v,singleBranch:g,headers:_,author:F,committer:P,signingKey:R,prune:p,pruneTags:m})}catch(T){throw T.caller="git.pull",T}}a(VS,"pull");async function D$({fs:t,cache:e,dir:r,gitdir:i=C.join(r,".git"),start:n,finish:o}){let s=await Di.read({fs:t,gitdir:i}),l=new Set,f=new Set;for(let h of n)l.add(await N.resolve({fs:t,gitdir:i,ref:h}));for(let h of o)try{let d=await N.resolve({fs:t,gitdir:i,ref:h});f.add(d)}catch{}let c=new Set;async function u(h){c.add(h);let{type:d,object:p}=await de({fs:t,cache:e,gitdir:i,oid:h});if(d==="tag"){let w=dt.from(p).headers().object;return u(w)}if(d!=="commit")throw new Xe(h,d,"commit");if(!s.has(h)){let w=nt.from(p).headers().parent;for(h of w)!f.has(h)&&!c.has(h)&&await u(h)}}a(u,"walk");for(let h of l)await u(h);return c}a(D$,"listCommitsAndTags");async function gp({fs:t,cache:e,dir:r,gitdir:i=C.join(r,".git"),oids:n}){let o=new Set;async function s(l){if(o.has(l))return;o.add(l);let{type:f,object:c}=await de({fs:t,cache:e,gitdir:i,oid:l});if(f==="tag"){let h=dt.from(c).headers().object;await s(h)}else if(f==="commit"){let h=nt.from(c).headers().tree;await s(h)}else if(f==="tree"){let u=it.from(c);for(let h of u)h.type==="blob"&&o.add(h.oid),h.type==="tree"&&await s(h.oid)}}a(s,"walk");for(let l of n)await s(l);return o}a(gp,"listObjects");async function N$(t){let e={},r="",i=we.streamReader(t),n=await i();for(;n!==!0;)n!==null&&(r+=n.toString("utf8")+`
|
|
95
95
|
`),n=await i();let o=r.toString("utf8").split(`
|
|
96
|
-
`);if(n=o.shift(),!n.startsWith("unpack "))throw new
|
|
97
|
-
`)),i="";return r.push(we.flush()),r}a(
|
|
98
|
-
- ${
|
|
99
|
-
`,author:s,committer:l,signingKey:f})}a(
|
|
96
|
+
`);if(n=o.shift(),!n.startsWith("unpack "))throw new Ci('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.slice(7)),e.refs={};for(let s of o){if(s.trim()==="")continue;let l=s.slice(0,2),f=s.slice(3),c=f.indexOf(" ");c===-1&&(c=f.length);let u=f.slice(0,c),h=f.slice(c+1);e.refs[u]={ok:l==="ok",error:h}}return e}a(N$,"parseReceivePackResponse");async function B$({capabilities:t=[],triplets:e=[]}){let r=[],i=`\0 ${t.join(" ")}`;for(let n of e)r.push(we.encode(`${n.oldoid} ${n.oid} ${n.fullRef}${i}
|
|
97
|
+
`)),i="";return r.push(we.flush()),r}a(B$,"writeReceivePackRequest");async function L$({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,onPrePush:f,gitdir:c,ref:u,remoteRef:h,remote:d,url:p,force:m=!1,delete:w=!1,corsProxy:y,headers:v={}}){let g=u||await ti({fs:t,gitdir:c});if(typeof g>"u")throw new rt("ref");let _=await be.get({fs:t,gitdir:c});d=d||await _.get(`branch.${g}.pushRemote`)||await _.get("remote.pushDefault")||await _.get(`branch.${g}.remote`)||"origin";let E=p||await _.get(`remote.${d}.pushurl`)||await _.get(`remote.${d}.url`);if(typeof E>"u")throw new rt("remote OR url");let x=h||await _.get(`branch.${g}.merge`);if(typeof E>"u")throw new rt("remoteRef");y===void 0&&(y=await _.get("http.corsProxy"));let R=await N.expand({fs:t,gitdir:c,ref:g}),b=w?"0000000000000000000000000000000000000000":await N.resolve({fs:t,gitdir:c,ref:R}),T=to.getRemoteHelperFor({url:E}),F=await T.discover({http:r,onAuth:o,onAuthSuccess:s,onAuthFailure:l,corsProxy:y,service:"git-receive-pack",url:E,headers:v,protocolVersion:1}),P=F.auth,k;if(!x)k=R;else try{k=await N.expandAgainstMap({ref:x,map:F.refs})}catch(z){if(z instanceof fe)k=x.startsWith("refs/")?x:`refs/heads/${x}`;else throw z}let D=F.refs.get(k)||"0000000000000000000000000000000000000000";if(f&&!await f({remote:d,url:E,localRef:{ref:w?"(delete)":R,oid:b},remoteRef:{ref:k,oid:D}}))throw new Xn;let B=!F.capabilities.has("no-thin"),U=new Set;if(!w){let z=[...F.refs.values()],ue=new Set;if(D!=="0000000000000000000000000000000000000000"){let te=await Lp({fs:t,cache:e,gitdir:c,oids:[b,D]});for(let Oe of te)z.push(Oe);B&&(ue=await gp({fs:t,cache:e,gitdir:c,oids:te}))}if(!z.includes(b)){let te=await D$({fs:t,cache:e,gitdir:c,start:[b],finish:z});U=await gp({fs:t,cache:e,gitdir:c,oids:te})}if(B){try{let te=await N.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:Oe}=await N.resolveAgainstMap({ref:te.replace(`refs/remotes/${d}/`,""),fullref:te,map:F.refs}),ke=[Oe];for(let le of await gp({fs:t,cache:e,gitdir:c,oids:ke}))ue.add(le)}catch{}for(let te of ue)U.delete(te)}if(b===D&&(m=!0),!m){if(R.startsWith("refs/tags")&&D!=="0000000000000000000000000000000000000000")throw new Zn("tag-exists");if(b!=="0000000000000000000000000000000000000000"&&D!=="0000000000000000000000000000000000000000"&&!await PS({fs:t,cache:e,gitdir:c,oid:b,ancestor:D,depth:-1}))throw new Zn("not-fast-forward")}}let Z=iS([...F.capabilities],["report-status","side-band-64k",`agent=${of.agent}`]),me=await B$({capabilities:Z,triplets:[{oldoid:D,oid:b,fullRef:k}]}),Ee=w?[]:await zS({fs:t,cache:e,gitdir:c,oids:[...U]}),$=await T.connect({http:r,onProgress:i,corsProxy:y,service:"git-receive-pack",url:E,auth:P,headers:v,body:[...me,...Ee]}),{packfile:q,progress:G}=await pc.demux($.body);if(n){let z=nS(G);Bs(z,async ue=>{await n(ue)})}let X=await N$(q);if($.headers&&(X.headers=$.headers),d&&X.ok&&X.refs[k].ok&&!R.startsWith("refs/tags")){let z=`refs/remotes/${d}/${k.replace("refs/heads","")}`;w?await N.deleteRef({fs:t,gitdir:c,ref:z}):await N.writeRef({fs:t,gitdir:c,ref:z,value:b})}if(X.ok&&Object.values(X.refs).every(z=>z.ok))return X;{let z=Object.entries(X.refs).filter(([ue,te])=>!te.ok).map(([ue,te])=>`
|
|
98
|
+
- ${ue}: ${te.error}`).join("");throw new xs(z,X)}}a(L$,"_push");async function GS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,onPrePush:l,dir:f,gitdir:c=C.join(f,".git"),ref:u,remoteRef:h,remote:d="origin",url:p,force:m=!1,delete:w=!1,corsProxy:y,headers:v={},cache:g={}}){try{return S("fs",t),S("http",e),S("gitdir",c),await L$({fs:new M(t),cache:g,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,onPrePush:l,gitdir:c,ref:u,remoteRef:h,remote:d,url:p,force:m,delete:w,corsProxy:y,headers:v})}catch(_){throw _.caller="git.push",_}}a(GS,"push");async function KS({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=dt.from(o).parse().object,KS({fs:t,cache:e,gitdir:r,oid:i});if(n!=="blob")throw new Xe(i,n,"blob");return{oid:i,blob:new Uint8Array(o)}}a(KS,"resolveBlob");async function ZS({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){return n!==void 0&&(i=await Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await KS({fs:t,cache:e,gitdir:r,oid:i})}a(ZS,"_readBlob");async function XS({fs:t,dir:e,gitdir:r=C.join(e,".git"),oid:i,filepath:n,cache:o={}}){try{return S("fs",t),S("gitdir",r),S("oid",i),await ZS({fs:new M(t),cache:o,gitdir:r,oid:i,filepath:n})}catch(s){throw s.caller="git.readBlob",s}}a(XS,"readBlob");async function $p({fs:t,dir:e,gitdir:r=C.join(e,".git"),oid:i,cache:n={}}){try{return S("fs",t),S("gitdir",r),S("oid",i),await Qn({fs:new M(t),cache:n,gitdir:r,oid:i})}catch(o){throw o.caller="git.readCommit",o}}a($p,"readCommit");async function $$({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){let o=await N.resolve({gitdir:r,fs:t,ref:i}),{blob:s}=await ZS({fs:t,cache:e,gitdir:r,oid:o,filepath:n});return s}a($$,"_readNote");async function YS({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i="refs/notes/commits",oid:n,cache:o={}}){try{return S("fs",t),S("gitdir",r),S("ref",i),S("oid",n),await $$({fs:new M(t),cache:o,gitdir:r,ref:i,oid:n})}catch(s){throw s.caller="git.readNote",s}}a(YS,"readNote");async function JS({fs:t,dir:e,gitdir:r=C.join(e,".git"),oid:i,format:n="parsed",filepath:o=void 0,encoding:s=void 0,cache:l={}}){try{S("fs",t),S("gitdir",r),S("oid",i);let f=new M(t);o!==void 0&&(i=await Ds({fs:f,cache:l,gitdir:r,oid:i,filepath:o}));let u=await de({fs:f,cache:l,gitdir:r,oid:i,format:n==="parsed"?"content":n});if(u.oid=i,n==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=nt.from(u.object).parse();break;case"tree":u.object=it.from(u.object).entries();break;case"blob":s?u.object=u.object.toString(s):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=dt.from(u.object).parse();break;default:throw new Xe(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(f){throw f.caller="git.readObject",f}}a(JS,"readObject");async function M$({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if(n!=="tag")throw new Xe(i,n,"tag");let s=dt.from(o);return{oid:i,tag:s.parse(),payload:s.payload()}}a(M$,"_readTag");async function QS({fs:t,dir:e,gitdir:r=C.join(e,".git"),oid:i,cache:n={}}){try{return S("fs",t),S("gitdir",r),S("oid",i),await M$({fs:new M(t),cache:n,gitdir:r,oid:i})}catch(o){throw o.caller="git.readTag",o}}a(QS,"readTag");async function e1({fs:t,dir:e,gitdir:r=C.join(e,".git"),oid:i,filepath:n=void 0,cache:o={}}){try{return S("fs",t),S("gitdir",r),S("oid",i),await no({fs:new M(t),cache:o,gitdir:r,oid:i,filepath:n})}catch(s){throw s.caller="git.readTree",s}}a(e1,"readTree");async function t1({fs:t,dir:e,gitdir:r=C.join(e,".git"),filepath:i,cache:n={}}){try{S("fs",t),S("gitdir",r),S("filepath",i),await Fe.acquire({fs:new M(t),gitdir:r,cache:n},async function(o){o.delete({filepath:i})})}catch(o){throw o.caller="git.remove",o}}a(t1,"remove");async function j$({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:o,author:s,committer:l,signingKey:f}){let c;try{c=await N.resolve({gitdir:i,fs:t,ref:n})}catch(m){if(!(m instanceof fe))throw m}let h=(await no({fs:t,gitdir:i,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;h=h.filter(m=>m.path!==o);let d=await Ns({fs:t,gitdir:i,tree:h});return await nf({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
|
|
99
|
+
`,author:s,committer:l,signingKey:f})}a(j$,"_removeNote");async function r1({fs:t,onSign:e,dir:r,gitdir:i=C.join(r,".git"),ref:n="refs/notes/commits",oid:o,author:s,committer:l,signingKey:f,cache:c={}}){try{S("fs",t),S("gitdir",i),S("oid",o);let u=new M(t),h=await ei({fs:u,gitdir:i,author:s});if(!h)throw new ze("author");let d=await Jn({fs:u,gitdir:i,author:h,committer:l});if(!d)throw new ze("committer");return await j$({fs:u,cache:c,onSign:e,gitdir:i,ref:n,oid:o,author:h,committer:d,signingKey:f})}catch(u){throw u.caller="git.removeNote",u}}a(r1,"removeNote");async function U$({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!ws(i,!0))throw new Lt(i,ms.clean(i));if(!ws(r,!0))throw new Lt(r,ms.clean(r));let o=`refs/heads/${r}`,s=`refs/heads/${i}`;if(await N.exists({fs:t,gitdir:e,ref:s}))throw new Bt("branch",i,!1);let f=await N.resolve({fs:t,gitdir:e,ref:o,depth:1});await N.writeRef({fs:t,gitdir:e,ref:s,value:f}),await N.deleteRef({fs:t,gitdir:e,ref:o});let u=await ti({fs:t,gitdir:e,fullname:!0})===o;(n||u)&&await N.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}a(U$,"_renameBranch");async function i1({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i,oldref:n,checkout:o=!1}){try{return S("fs",t),S("gitdir",r),S("ref",i),S("oldref",n),await U$({fs:new M(t),gitdir:r,ref:i,oldref:n,checkout:o})}catch(s){throw s.caller="git.renameBranch",s}}a(i1,"renameBranch");async function n1({gitdir:t,type:e,object:r}){return _r(Xr.wrap({type:e,object:r}))}a(n1,"hashObject$1");async function o1({fs:t,dir:e,gitdir:r=C.join(e,".git"),filepath:i,ref:n,cache:o={}}){try{S("fs",t),S("gitdir",r),S("filepath",i);let s=new M(t),l,f;try{l=await N.resolve({fs:s,gitdir:r,ref:n||"HEAD"})}catch(h){if(n)throw h}if(l)try{l=await Ds({fs:s,cache:o,gitdir:r,oid:l,filepath:i})}catch{l=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},u=e&&await s.read(C.join(e,i));u&&(f=await n1({gitdir:r,type:"blob",object:u}),l===f&&(c=await s.lstat(C.join(e,i)))),await Fe.acquire({fs:s,gitdir:r,cache:o},async function(h){h.delete({filepath:i}),l&&h.insert({filepath:i,stats:c,oid:l})})}catch(s){throw s.caller="git.reset",s}}a(o1,"resetIndex");async function s1({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i,depth:n}){try{return S("fs",t),S("gitdir",r),S("ref",i),await N.resolve({fs:new M(t),gitdir:r,ref:i,depth:n})}catch(o){throw o.caller="git.resolveRef",o}}a(s1,"resolveRef");async function a1({fs:t,dir:e,gitdir:r=C.join(e,".git"),path:i,value:n,append:o=!1}){try{S("fs",t),S("gitdir",r),S("path",i);let s=new M(t),l=await be.get({fs:s,gitdir:r});o?await l.append(i,n):await l.set(i,n),await be.save({fs:s,gitdir:r,config:l})}catch(s){throw s.caller="git.setConfig",s}}a(a1,"setConfig");async function l1({fs:t,gitdir:e,commit:r}){let i=nt.from(r).toObject();return await ot({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}a(l1,"_writeCommit");var ef=class ef{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),i=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${i}`}static createStashReflogEntry(e,r,i){let n=e.name.replace(/\s/g,""),o="0000000000000000000000000000000000000000",s=Math.floor(Date.now()/1e3),l=ef.timezoneOffsetForRefLogEntry;return`${o} ${r} ${n} ${e.email} ${s} ${l} ${i}
|
|
100
100
|
`}static getStashReflogEntry(e,r=!1){return e.split(`
|
|
101
|
-
`).filter(o=>o).reverse().map((o,s)=>r?`stash@{${s}}: ${o.split(" ")[1]}`:o)}};a(
|
|
101
|
+
`).filter(o=>o).reverse().map((o,s)=>r?`stash@{${s}}: ${o.split(" ")[1]}`:o)}};a(ef,"GitRefStash");var mc=ef,H$={stage:Bi,workdir:io},bp;async function ro(t,e){return bp===void 0&&(bp=new ps),bp.acquire(t,e)}a(ro,"acquireLock$1");async function q$(t,e,r,i,n=null){let o=C.join(r,i),s=await t.lstat(o);if(!s)throw new fe(o);if(s.isDirectory())throw new W(`${o}: file expected, but found directory`);let l=n?await LE({fs:t,gitdir:e,oid:n}):void 0,f=l?n:void 0;return l||await ro({fs:t,gitdir:e,currentFilepath:o},async()=>{let c=s.isSymbolicLink()?await t.readlink(o).then(zE):await t.read(o);if(c===null)throw new fe(o);f=await ot({fs:t,gitdir:e,type:"blob",object:c})}),f}a(q$,"checkAndWriteBlob");async function z$({fs:t,dir:e,gitdir:r,entries:i}){async function n(o){if(o.type==="tree"){if(!o.oid){let s=await Promise.all(o.children.map(n));o.oid=await Ns({fs:t,gitdir:r,tree:s}),o.mode=16384}}else o.type==="blob"&&(o.oid=await q$(t,r,e,o.path,o.oid),o.mode=33188);return o.path=o.path.split("/").pop(),o}return a(n,"processTreeEntry"),Promise.all(i.map(n))}a(z$,"processTreeEntries");async function PE({fs:t,dir:e,gitdir:r,treePair:i}){let n=i[1]==="stage",o=i.map(p=>typeof p=="string"?H$[p]():p),s=[],u=await Jr({fs:t,cache:{},dir:e,gitdir:r,trees:o,map:a(async(p,[m,w])=>{if(!(p==="."||await Qr.isIgnored({fs:t,dir:e,gitdir:r,filepath:p}))&&w)return(!m||await m.oid()!==await w.oid()&&await w.oid()!==void 0)&&s.push([m,w]),{mode:await w.mode(),path:p,oid:await w.oid(),type:await w.type()}},"map"),reduce:a(async(p,m)=>(m=m.filter(Boolean),p?(p.children=m,p):m.length>0?m:void 0),"reduce"),iterate:a(async(p,m)=>{let w=[];for(let y of m){let[v,g]=y;n?g&&(await t.exists(`${e}/${g.toString()}`)?w.push(y):s.push([null,g])):v&&(g?w.push(y):s.push([v,null]))}return w.length?Promise.all(w.map(p)):[]},"iterate")});if(s.length===0||u.length===0)return null;let d=(await z$({fs:t,dir:e,gitdir:r,entries:u})).filter(Boolean).map(p=>({mode:p.mode,path:p.path,oid:p.oid,type:p.type}));return Ns({fs:t,gitdir:r,tree:d})}a(PE,"writeTreeChanges");async function W$({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:o}){let s=[],l=[],f=await Jr({fs:t,cache:{},dir:e,gitdir:r,trees:[ht({ref:n}),ht({ref:i})],map:a(async(c,[u,h])=>{if(c==="."||await Qr.isIgnored({fs:t,dir:e,gitdir:r,filepath:c}))return;let d=h?await h.type():await u.type();if(d!=="tree"&&d!=="blob")return;if(!h&&u){let m=d==="tree"?"rmdir":"rm";return d==="tree"&&s.push(c),d==="blob"&&o&&l.push({filepath:c,oid:await u.oid()}),{method:m,filepath:c}}let p=await h.oid();if(!u||await u.oid()!==p)return d==="tree"?{method:"mkdir",filepath:c}:(o&&l.push({filepath:c,oid:p,stats:await t.lstat(C.join(e,c))}),{method:"write",filepath:c,oid:p})},"map")});await ro({fs:t,gitdir:r,dirRemoved:s,ops:f},async()=>{for(let c of f){let u=C.join(e,c.filepath);switch(c.method){case"rmdir":await t.rmdir(u);break;case"mkdir":await t.mkdir(u);break;case"rm":await t.rm(u);break;case"write":if(!s.some(h=>u.startsWith(h))){let{object:h}=await de({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,h)}break}}}),await Fe.acquire({fs:t,gitdir:r,cache:{}},async c=>{l.forEach(({filepath:u,stats:h,oid:d})=>{c.insert({filepath:u,stats:h,oid:d})})})}a(W$,"applyTreeChanges");var Un=class Un{constructor({fs:e,dir:r,gitdir:i=C.join(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:i,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return C.join(this.gitdir,Un.refStash)}get refLogsStashPath(){return C.join(this.gitdir,Un.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await ei({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new ze("author");return this._author}async getStashSHA(e,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:r,parent:i}){return l1({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:i,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let r=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>r.length-1))throw new Lt(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let i=await this.getStashSHA(e,r);return i?Qn({fs:this.fs,cache:{},gitdir:this.gitdir,oid:i}):{}}async writeStashRef(e){return N.writeRef({fs:this.fs,gitdir:this.gitdir,ref:Un.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let i=await this.getAuthor(),n=mc.createStashReflogEntry(i,e,r),o=this.refLogsStashPath;await ro({filepath:o,entry:n},async()=>{let s=await this.fs.exists(o)?await this.fs.read(o,"utf8"):"";await this.fs.write(o,s+n,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return mc.getStashReflogEntry(r,e)}};a(Un,"GitStashManager");var Ni=Un;async function c1({fs:t,dir:e,gitdir:r,message:i=""}){let n=new Ni({fs:t,dir:e,gitdir:r});await n.getAuthor();let o=await ti({fs:t,gitdir:r,fullname:!1}),s=await N.resolve({fs:t,gitdir:r,ref:"HEAD"}),f=(await $p({fs:t,dir:e,gitdir:r,oid:s})).commit.message,c=[s],u=null,h=ht({ref:"HEAD"}),d=await PE({fs:t,dir:e,gitdir:r,treePair:[ht({ref:"HEAD"}),"stage"]});if(d){let y=await n.writeStashCommit({message:`stash-Index: WIP on ${o} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(y),u=d,h=Bi()}let p=await PE({fs:t,dir:e,gitdir:r,treePair:[h,"workdir"]});if(p){let y=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${o} - ${new Date().toISOString()}`,tree:p,parent:[c[c.length-1]]});c.push(y),u=p}if(!u||!d&&!p)throw new fe("changes, nothing to stash");let m=(i.trim()||`WIP on ${o}`)+`: ${s.substring(0,7)} ${f}`;return{stashCommit:await n.writeStashCommit({message:m,tree:u,parent:c}),stashMsg:m,branch:o,stashMgr:n}}a(c1,"_createStashCommit");async function V$({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n,stashMsg:o,branch:s,stashMgr:l}=await c1({fs:t,dir:e,gitdir:r,message:i});return await l.writeStashRef(n),await l.writeStashReflogEntry({stashCommit:n,message:o}),await Np({fs:t,dir:e,gitdir:r,ref:s,track:!1,force:!0}),n}a(V$,"_stashPush");async function G$({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n}=await c1({fs:t,dir:e,gitdir:r,message:i});return n}a(G$,"_stashCreate");async function f1({fs:t,dir:e,gitdir:r,refIdx:i=0}){let o=await new Ni({fs:t,dir:e,gitdir:r}).readStashCommit(i),{parent:s=null}=o.commit?o.commit:{};if(!(!s||!Array.isArray(s)))for(let l=0;l<s.length-1;l++){let c=(await Qn({fs:t,cache:{},gitdir:r,oid:s[l+1]})).commit.message.startsWith("stash-Index");await W$({fs:t,dir:e,gitdir:r,stashCommit:s[l+1],parentCommit:s[l],wasStaged:c})}}a(f1,"_stashApply");async function u1({fs:t,dir:e,gitdir:r,refIdx:i=0}){let n=new Ni({fs:t,dir:e,gitdir:r});if(!(await n.readStashCommit(i)).commit)return;let s=n.refStashPath;await ro(s,async()=>{await t.exists(s)&&await t.rm(s)});let l=await n.readStashReflogs({parsed:!1});if(!l.length)return;l.splice(i,1);let f=n.refLogsStashPath;await ro({reflogEntries:l,stashReflogPath:f,stashMgr:n},async()=>{if(l.length){await t.write(f,l.reverse().join(`
|
|
102
102
|
`)+`
|
|
103
|
-
`,"utf8");let c=l[l.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(f)})}a(l1,"_stashDrop");async function H$({fs:t,dir:e,gitdir:r}){return new Ii({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}a(H$,"_stashList");async function q$({fs:t,dir:e,gitdir:r}){let i=new Ii({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await Qn(n,async()=>{await Promise.all(n.map(async o=>{if(await t.exists(o))return t.rm(o)}))})}a(q$,"_stashClear");async function z$({fs:t,dir:e,gitdir:r,refIdx:i=0}){await a1({fs:t,dir:e,gitdir:r,refIdx:i}),await l1({fs:t,dir:e,gitdir:r,refIdx:i})}a(z$,"_stashPop");async function c1({fs:t,dir:e,gitdir:r=D.join(e,".git"),op:i="push",message:n="",refIdx:o=0}){E("fs",t),E("dir",e),E("gitdir",r),E("op",i);let s={push:j$,apply:a1,drop:l1,list:H$,clear:q$,pop:z$,create:U$},l=["apply","drop","pop"];try{let f=new M(t);["refs","logs","logs/refs"].map(h=>D.join(r,h)).forEach(async h=>{await f.exists(h)||await f.mkdir(h)});let u=s[i];if(u){if(l.includes(i)&&o<0)throw new Bt(`stash@${o}`,"number that is in range of [0, num of stash pushed]");return await u({fs:f,dir:e,gitdir:r,message:n,refIdx:o})}throw new Error(`To be implemented: ${i}`)}catch(f){throw f.caller="git.stash",f}}a(c1,"stash");async function f1({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,cache:n={}}){try{E("fs",t),E("gitdir",r),E("filepath",i);let o=new M(t);if(await Yr.isIgnored({fs:o,gitdir:r,dir:e,filepath:i}))return"ignored";let l=await W$({fs:o,cache:n,gitdir:r}),f=await u1({fs:o,cache:n,gitdir:r,tree:l,path:i}),c=await Fe.acquire({fs:o,gitdir:r,cache:n},async function(w){for(let y of w)if(y.path===i)return y;return null}),u=await o.lstat(D.join(e,i)),h=f!==null,d=c!==null,p=u!==null,m=a(async()=>{if(d&&!nc(c,u))return c.oid;{let w=await o.read(D.join(e,i)),y=await t1({gitdir:r,type:"blob",object:w});return d&&c.oid===y&&u.size!==-1&&Fe.acquire({fs:o,gitdir:r,cache:n},async function(v){v.insert({filepath:i,stats:u,oid:y})}),y}},"getWorkdirOid");if(!h&&!p&&!d)return"absent";if(!h&&!p&&d)return"*absent";if(!h&&p&&!d)return"*added";if(!h&&p&&d)return await m()===c.oid?"added":"*added";if(h&&!p&&!d)return"deleted";if(h&&!p&&d)return f===c.oid,"*deleted";if(h&&p&&!d)return await m()===f?"*undeleted":"*undeletemodified";if(h&&p&&d){let w=await m();return w===f?w===c.oid?"unmodified":"*unmodified":w===c.oid?"modified":"*modified"}}catch(o){throw o.caller="git.status",o}}a(f1,"status");async function u1({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let o=n.shift();for(let s of i)if(s.path===o){if(n.length===0)return s.oid;let{type:l,object:f}=await de({fs:t,cache:e,gitdir:r,oid:s.oid});if(l==="tree"){let c=tt.from(f);return u1({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(l==="blob")throw new Ze(s.oid,l,"blob",n.join("/"))}return null}a(u1,"getOidAtPath");async function W$({fs:t,cache:e,gitdir:r}){let i;try{i=await B.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(o){if(o instanceof ce)return[]}let{tree:n}=await to({fs:t,cache:e,gitdir:r,oid:i});return n}a(W$,"getHeadTree");async function h1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:o,cache:s={},ignored:l=!1}){try{E("fs",t),E("gitdir",r),E("ref",i);let f=new M(t);return await Xr({fs:f,cache:s,dir:e,gitdir:r,trees:[ft({ref:i}),eo(),Di()],map:a(async function(c,[u,h,d]){if(!u&&!d&&h&&!l&&await Yr.isIgnored({fs:f,dir:e,filepath:c})||!n.some(R=>JE(c,R)))return null;if(o&&!o(c))return;let[p,m,w]=await Promise.all([u&&u.type(),h&&h.type(),d&&d.type()]),y=[p,m,w].includes("blob");if((p==="tree"||p==="special")&&!y)return;if(p==="commit")return null;if((m==="tree"||m==="special")&&!y)return;if(w==="commit")return null;if((w==="tree"||w==="special")&&!y)return;let v=p==="blob"?await u.oid():void 0,g=w==="blob"?await d.oid():void 0,F;p!=="blob"&&m==="blob"&&w!=="blob"?F="42":m==="blob"&&(F=await h.oid());let O=[void 0,v,F,g],S=O.map(R=>O.indexOf(R));return S.shift(),[c,...S]},"map")})}catch(f){throw f.caller="git.statusMatrix",f}}a(h1,"statusMatrix");async function d1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,object:n,force:o=!1}){try{E("fs",t),E("gitdir",r),E("ref",i);let s=new M(t);if(i===void 0)throw new et("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let l=await B.resolve({fs:s,gitdir:r,ref:n||"HEAD"});if(!o&&await B.exists({fs:s,gitdir:r,ref:i}))throw new Nt("tag",i);await B.writeRef({fs:s,gitdir:r,ref:i,value:l})}catch(s){throw s.caller="git.tag",s}}a(d1,"tag");async function p1({fs:t,dir:e,gitdir:r=D.join(e,".git"),cache:i={},filepath:n,oid:o,mode:s,add:l,remove:f,force:c}){try{E("fs",t),E("gitdir",r),E("filepath",n);let u=new M(t);if(f)return await Fe.acquire({fs:u,gitdir:r,cache:i},async function(d){if(!c){let p=await u.lstat(D.join(e,n));if(p){if(p.isDirectory())throw new Zr("directory");return}}d.has({filepath:n})&&d.delete({filepath:n})});let h;if(!o){if(h=await u.lstat(D.join(e,n)),!h)throw new ce(`file at "${n}" on disk and "remove" not set`);if(h.isDirectory())throw new Zr("directory")}return await Fe.acquire({fs:u,gitdir:r,cache:i},async function(d){if(!l&&!d.has({filepath:n}))throw new ce(`file at "${n}" in index and "add" not set`);let p;if(o)p={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:s,uid:0,gid:0,size:0};else{p=h;let m=p.isSymbolicLink()?await u.readlink(D.join(e,n)):await u.read(D.join(e,n));o=await it({fs:u,gitdir:r,type:"blob",format:"content",object:m})}return d.insert({filepath:n,oid:o,stats:p}),o})}catch(u){throw u.caller="git.updateIndex",u}}a(p1,"updateIndex$1");function m1(){try{return rf.version}catch(t){throw t.caller="git.version",t}}a(m1,"version");async function w1({fs:t,dir:e,gitdir:r=D.join(e,".git"),trees:i,map:n,reduce:o,iterate:s,cache:l={}}){try{return E("fs",t),E("gitdir",r),E("trees",i),await Xr({fs:new M(t),cache:l,dir:e,gitdir:r,trees:i,map:n,reduce:o,iterate:s})}catch(f){throw f.caller="git.walk",f}}a(w1,"walk");async function y1({fs:t,dir:e,gitdir:r=D.join(e,".git"),blob:i}){try{return E("fs",t),E("gitdir",r),E("blob",i),await it({fs:new M(t),gitdir:r,type:"blob",object:i,format:"content"})}catch(n){throw n.caller="git.writeBlob",n}}a(y1,"writeBlob");async function g1({fs:t,dir:e,gitdir:r=D.join(e,".git"),commit:i}){try{return E("fs",t),E("gitdir",r),E("commit",i),await o1({fs:new M(t),gitdir:r,commit:i})}catch(n){throw n.caller="git.writeCommit",n}}a(g1,"writeCommit");async function b1({fs:t,dir:e,gitdir:r=D.join(e,".git"),type:i,object:n,format:o="parsed",oid:s,encoding:l=void 0}){try{let f=new M(t);if(o==="parsed"){switch(i){case"commit":n=rt.from(n).toObject();break;case"tree":n=tt.from(n).toObject();break;case"blob":n=Buffer.from(n,l);break;case"tag":n=ut.from(n).toObject();break;default:throw new Ze(s||"",i,"blob|commit|tag|tree")}o="content"}return s=await it({fs:f,gitdir:r,type:i,object:n,oid:s,format:o}),s}catch(f){throw f.caller="git.writeObject",f}}a(b1,"writeObject");async function v1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,value:n,force:o=!1,symbolic:s=!1}){try{E("fs",t),E("gitdir",r),E("ref",i),E("value",n);let l=new M(t);if(!ms(i,!0))throw new Bt(i,ps.clean(i));if(!o&&await B.exists({fs:l,gitdir:r,ref:i}))throw new Nt("ref",i);s?await B.writeSymbolicRef({fs:l,gitdir:r,ref:i,value:n}):(n=await B.resolve({fs:l,gitdir:r,ref:n}),await B.writeRef({fs:l,gitdir:r,ref:i,value:n}))}catch(l){throw l.caller="git.writeRef",l}}a(v1,"writeRef");async function V$({fs:t,gitdir:e,tag:r}){let i=ut.from(r).toObject();return await it({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}a(V$,"_writeTag");async function _1({fs:t,dir:e,gitdir:r=D.join(e,".git"),tag:i}){try{return E("fs",t),E("gitdir",r),E("tag",i),await V$({fs:new M(t),gitdir:r,tag:i})}catch(n){throw n.caller="git.writeTag",n}}a(_1,"writeTag");async function F1({fs:t,dir:e,gitdir:r=D.join(e,".git"),tree:i}){try{return E("fs",t),E("gitdir",r),E("tree",i),await Cs({fs:new M(t),gitdir:r,tree:i})}catch(n){throw n.caller="git.writeTree",n}}a(F1,"writeTree");var G$={Errors:LE,STAGE:Di,TREE:ft,WORKDIR:eo,add:HE,abortMerge:ME,addNote:GE,addRemote:ZE,annotatedTag:XE,branch:YE,checkout:Cp,clone:iS,commit:nS,getConfig:bS,getConfigAll:vS,setConfig:n1,currentBranch:oS,deleteBranch:sS,deleteRef:aS,deleteRemote:lS,deleteTag:cS,expandOid:fS,expandRef:uS,fastForward:pS,fetch:mS,findMergeBase:wS,findRoot:gS,getRemoteInfo:_S,getRemoteInfo2:ES,hashBlob:SS,indexPack:xS,init:TS,isDescendent:RS,isIgnored:kS,listBranches:PS,listFiles:IS,listNotes:DS,listRefs:CS,listRemotes:NS,listServerRefs:BS,listTags:LS,log:MS,merge:jS,packObjects:HS,pull:qS,push:zS,readBlob:GS,readCommit:Lp,readNote:KS,readObject:ZS,readTag:XS,readTree:YS,remove:JS,removeNote:QS,renameBranch:e1,resetIndex:r1,updateIndex:p1,resolveRef:i1,status:f1,statusMatrix:h1,tag:d1,version:m1,walk:w1,writeBlob:y1,writeCommit:g1,writeObject:b1,writeRef:v1,writeTag:_1,writeTree:F1,stash:c1};L.Errors=LE;L.STAGE=Di;L.TREE=ft;L.WORKDIR=eo;L.abortMerge=ME;L.add=HE;L.addNote=GE;L.addRemote=ZE;L.annotatedTag=XE;L.branch=YE;L.checkout=Cp;L.clone=iS;L.commit=nS;L.currentBranch=oS;L.default=G$;L.deleteBranch=sS;L.deleteRef=aS;L.deleteRemote=lS;L.deleteTag=cS;L.expandOid=fS;L.expandRef=uS;L.fastForward=pS;L.fetch=mS;L.findMergeBase=wS;L.findRoot=gS;L.getConfig=bS;L.getConfigAll=vS;L.getRemoteInfo=_S;L.getRemoteInfo2=ES;L.hashBlob=SS;L.indexPack=xS;L.init=TS;L.isDescendent=RS;L.isIgnored=kS;L.listBranches=PS;L.listFiles=IS;L.listNotes=DS;L.listRefs=CS;L.listRemotes=NS;L.listServerRefs=BS;L.listTags=LS;L.log=MS;L.merge=jS;L.packObjects=HS;L.pull=qS;L.push=zS;L.readBlob=GS;L.readCommit=Lp;L.readNote=KS;L.readObject=ZS;L.readTag=XS;L.readTree=YS;L.remove=JS;L.removeNote=QS;L.renameBranch=e1;L.resetIndex=r1;L.resolveRef=i1;L.setConfig=n1;L.stash=c1;L.status=f1;L.statusMatrix=h1;L.tag=d1;L.updateIndex=p1;L.version=m1;L.walk=w1;L.writeBlob=y1;L.writeCommit=g1;L.writeObject=b1;L.writeRef=v1;L.writeTag=_1;L.writeTree=F1});var $1=T((Xq,L1)=>{L1.exports=function(t,e){var r=[];t.on("data",function(i){r.push(i)}),t.once("end",function(){e&&e(null,Buffer.concat(r)),e=null}),t.once("error",function(i){e&&e(i),e=null})}});var M1=T(()=>{});var lm=T(xt=>{xt.fetch=Ls(globalThis.fetch)&&Ls(globalThis.ReadableStream);xt.writableStream=Ls(globalThis.WritableStream);xt.abortController=Ls(globalThis.AbortController);var ti;function sm(){if(ti!==void 0)return ti;if(globalThis.XMLHttpRequest){ti=new globalThis.XMLHttpRequest;try{ti.open("GET",globalThis.XDomainRequest?"/":"https://example.com")}catch{ti=null}}else ti=null;return ti}a(sm,"getXHR");function am(t){var e=sm();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch{}return!1}a(am,"checkTypeSupport");xt.arraybuffer=xt.fetch||am("arraybuffer");xt.msstream=!xt.fetch&&am("ms-stream");xt.mozchunkedarraybuffer=!xt.fetch&&am("moz-chunked-arraybuffer");xt.overrideMimeType=xt.fetch||(sm()?Ls(sm().overrideMimeType):!1);function Ls(t){return typeof t=="function"}a(Ls,"isFunction");ti=null});var yf=T((Tt,j1)=>{Tt=j1.exports=Ka();Tt.Stream=Tt;Tt.Readable=Tt;Tt.Writable=Wa();Tt.Duplex=Cr();Tt.Transform=il();Tt.PassThrough=vh();Tt.finished=Lo();Tt.pipeline=Fh()});var um=T(fm=>{var U1=lm(),Q$=Gt(),H1=yf(),gf=fm.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},cm=fm.IncomingMessage=function(t,e,r,i){var n=this;if(H1.Readable.call(n),n._mode=r,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){process.nextTick(function(){n.emit("close")})}),r==="fetch"){let h=function(){s.read().then(function(d){if(!n._destroyed){if(i(d.done),d.done){n.push(null);return}n.push(Buffer.from(d.value)),h()}}).catch(function(d){i(!0),n._destroyed||n.emit("error",d)})};var u=h;if(a(h,"read"),n._fetchResponse=e,n.url=e.url,n.statusCode=e.status,n.statusMessage=e.statusText,e.headers.forEach(function(d,p){n.headers[p.toLowerCase()]=d,n.rawHeaders.push(p,d)}),U1.writableStream){var o=new WritableStream({write:a(function(d){return i(!1),new Promise(function(p,m){n._destroyed?m():n.push(Buffer.from(d))?p():n._resumeFetch=p})},"write"),close:a(function(){i(!0),n._destroyed||n.push(null)},"close"),abort:a(function(d){i(!0),n._destroyed||n.emit("error",d)},"abort")});try{e.body.pipeTo(o).catch(function(d){i(!0),n._destroyed||n.emit("error",d)});return}catch{}}var s=e.body.getReader();h()}else{n._xhr=t,n._pos=0,n.url=t.responseURL,n.statusCode=t.status,n.statusMessage=t.statusText;var l=t.getAllResponseHeaders().split(/\r?\n/);if(l.forEach(function(h){var d=h.match(/^([^:]+):\s*(.*)/);if(d){var p=d[1].toLowerCase();p==="set-cookie"?(n.headers[p]===void 0&&(n.headers[p]=[]),n.headers[p].push(d[2])):n.headers[p]!==void 0?n.headers[p]+=", "+d[2]:n.headers[p]=d[2],n.rawHeaders.push(d[1],d[2])}}),n._charset="x-user-defined",!U1.overrideMimeType){var f=n.rawHeaders["mime-type"];if(f){var c=f.match(/;\s*charset=([^;])(;|$)/);c&&(n._charset=c[1].toLowerCase())}n._charset||(n._charset="utf-8")}}};Q$(cm,H1.Readable);cm.prototype._read=function(){var t=this,e=t._resumeFetch;e&&(t._resumeFetch=null,e())};cm.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,i=null;switch(e._mode){case"text":if(i=r.responseText,i.length>e._pos){var n=i.substr(e._pos);if(e._charset==="x-user-defined"){for(var o=Buffer.alloc(n.length),s=0;s<n.length;s++)o[s]=n.charCodeAt(s)&255;e.push(o)}else e.push(n,e._charset);e._pos=i.length}break;case"arraybuffer":if(r.readyState!==gf.DONE||!r.response)break;i=r.response,e.push(Buffer.from(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=r.response,r.readyState!==gf.LOADING||!i)break;e.push(Buffer.from(new Uint8Array(i)));break;case"ms-stream":if(i=r.response,r.readyState!==gf.LOADING)break;var l=new globalThis.MSStreamReader;l.onprogress=function(){l.result.byteLength>e._pos&&(e.push(Buffer.from(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){t(!0),e.push(null)},l.readAsArrayBuffer(i);break}e._xhr.readyState===gf.DONE&&e._mode!=="ms-stream"&&(t(!0),e.push(null))}});var V1=T((i3,W1)=>{var Li=lm(),eM=Gt(),z1=um(),hm=yf(),tM=z1.IncomingMessage,q1=z1.readyStates;function rM(t,e){return Li.fetch&&e?"fetch":Li.mozchunkedarraybuffer?"moz-chunked-arraybuffer":Li.msstream?"ms-stream":Li.arraybuffer&&t?"arraybuffer":"text"}a(rM,"decideMode");var We=W1.exports=function(t){var e=this;hm.Writable.call(e),e._opts=t,e._body=[],e._headers={},t.auth&&e.setHeader("Authorization","Basic "+Buffer.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(n){e.setHeader(n,t.headers[n])});var r,i=!0;if(t.mode==="disable-fetch"||"requestTimeout"in t&&!Li.abortController)i=!1,r=!0;else if(t.mode==="prefer-streaming")r=!1;else if(t.mode==="allow-wrong-content-type")r=!Li.overrideMimeType;else if(!t.mode||t.mode==="default"||t.mode==="prefer-fast")r=!0;else throw new Error("Invalid value for opts.mode");e._mode=rM(r,i),e._fetchTimer=null,e._socketTimeout=null,e._socketTimer=null,e.on("finish",function(){e._onFinish()})};eM(We,hm.Writable);We.prototype.setHeader=function(t,e){var r=this,i=t.toLowerCase();nM.indexOf(i)===-1&&(r._headers[i]={name:t,value:e})};We.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null};We.prototype.removeHeader=function(t){var e=this;delete e._headers[t.toLowerCase()]};We.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&e.timeout!==0&&t.setTimeout(e.timeout);var r=t._headers,i=null;e.method!=="GET"&&e.method!=="HEAD"&&(i=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var n=[];if(Object.keys(r).forEach(function(f){var c=r[f].name,u=r[f].value;Array.isArray(u)?u.forEach(function(h){n.push([c,h])}):n.push([c,u])}),t._mode==="fetch"){var o=null;if(Li.abortController){var s=new AbortController;o=s.signal,t._fetchAbortController=s,"requestTimeout"in e&&e.requestTimeout!==0&&(t._fetchTimer=globalThis.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))}globalThis.fetch(t._opts.url,{method:t._opts.method,headers:n,body:i||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:o}).then(function(f){t._fetchResponse=f,t._resetTimers(!1),t._connect()},function(f){t._resetTimers(!0),t._destroyed||t.emit("error",f)})}else{var l=t._xhr=new globalThis.XMLHttpRequest;try{l.open(t._opts.method,t._opts.url,!0)}catch(f){process.nextTick(function(){t.emit("error",f)});return}"responseType"in l&&(l.responseType=t._mode),"withCredentials"in l&&(l.withCredentials=!!e.withCredentials),t._mode==="text"&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(l.timeout=e.requestTimeout,l.ontimeout=function(){t.emit("requestTimeout")}),n.forEach(function(f){l.setRequestHeader(f[0],f[1])}),t._response=null,l.onreadystatechange=function(){switch(l.readyState){case q1.LOADING:case q1.DONE:t._onXHRProgress();break}},t._mode==="moz-chunked-arraybuffer"&&(l.onprogress=function(){t._onXHRProgress()}),l.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{l.send(i)}catch(f){process.nextTick(function(){t.emit("error",f)});return}}}};function iM(t){try{var e=t.status;return e!==null&&e!==0}catch{return!1}}a(iM,"statusValid");We.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),!(!iM(t._xhr)||t._destroyed)&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))};We.prototype._connect=function(){var t=this;t._destroyed||(t._response=new tM(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))};We.prototype._write=function(t,e,r){var i=this;i._body.push(t),r()};We.prototype._resetTimers=function(t){var e=this;globalThis.clearTimeout(e._socketTimer),e._socketTimer=null,t?(globalThis.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=globalThis.setTimeout(function(){e.emit("timeout")},e._socketTimeout))};We.prototype.abort=We.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)};We.prototype.end=function(t,e,r){var i=this;typeof t=="function"&&(r=t,t=void 0),hm.Writable.prototype.end.call(i,t,e,r)};We.prototype.setTimeout=function(t,e){var r=this;e&&r.once("timeout",e),r._socketTimeout=t,r._resetTimers(!1)};We.prototype.flushHeaders=function(){};We.prototype.setNoDelay=function(){};We.prototype.setSocketKeepAlive=function(){};var nM=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]});var K1=T((o3,G1)=>{G1.exports=sM;var oM=Object.prototype.hasOwnProperty;function sM(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)oM.call(r,i)&&(t[i]=r[i])}return t}a(sM,"extend")});var X1=T((a3,Z1)=>{Z1.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}});var dm=T(J1=>{var Y1=V1(),aM=um(),lM=K1(),cM=X1(),fM=ko(),Lt=J1;Lt.request=function(t,e){typeof t=="string"?t=fM.parse(t):t=lM(t);var r=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",i=t.protocol||r,n=t.hostname||t.host,o=t.port,s=t.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),t.url=(n?i+"//"+n:"")+(o?":"+o:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var l=new Y1(t);return e&&l.on("response",e),l};Lt.get=a(function(e,r){var i=Lt.request(e,r);return i.end(),i},"get");Lt.ClientRequest=Y1;Lt.IncomingMessage=aM.IncomingMessage;Lt.Agent=function(){};Lt.Agent.defaultMaxSockets=4;Lt.globalAgent=new Lt.Agent;Lt.STATUS_CODES=cM;Lt.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]});var tx=T((f3,ex)=>{var $s=dm(),uM=ko(),pm=ex.exports;for(bf in $s)$s.hasOwnProperty(bf)&&(pm[bf]=$s[bf]);var bf;pm.request=function(t,e){return t=Q1(t),$s.request.call(this,t,e)};pm.get=function(t,e){return t=Q1(t),$s.get.call(this,t,e)};function Q1(t){if(typeof t=="string"&&(t=uM.parse(t)),t.protocol||(t.protocol="https:"),t.protocol!=="https:")throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}a(Q1,"validateParams")});var nx=T((h3,ix)=>{ix.exports=rx;function rx(t,e){if(t&&e)return rx(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=t.apply(this,i),s=i[i.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(l){o[l]=s[l]}),o}a(r,"wrapper")}a(rx,"wrappy")});var ax=T((p3,mm)=>{var ox=nx();mm.exports=ox(vf);mm.exports.strict=ox(sx);vf.proto=vf(function(){Object.defineProperty(Function.prototype,"once",{value:a(function(){return vf(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:a(function(){return sx(this)},"value"),configurable:!0})});function vf(t){var e=a(function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))},"f");return e.called=!1,e}a(vf,"once");function sx(t){var e=a(function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},"f"),r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}a(sx,"onceStrict")});var cx=T((w3,lx)=>{"use strict";function hM(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(hM,"hasOwnProperty");lx.exports=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if(typeof t!="string"||t.length===0)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&typeof i.maxKeys=="number"&&(s=i.maxKeys);var l=t.length;s>0&&l>s&&(l=s);for(var f=0;f<l;++f){var c=t[f].replace(o,"%20"),u=c.indexOf(r),h,d,p,m;u>=0?(h=c.substr(0,u),d=c.substr(u+1)):(h=c,d=""),p=decodeURIComponent(h),m=decodeURIComponent(d),hM(n,p)?dM(n[p])?n[p].push(m):n[p]=[n[p],m]:n[p]=m}return n};var dM=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}});var hx=T((g3,ux)=>{"use strict";var Ms=a(function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},"stringifyPrimitive");ux.exports=function(t,e,r,i){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?fx(mM(t),function(n){var o=encodeURIComponent(Ms(n))+r;return pM(t[n])?fx(t[n],function(s){return o+encodeURIComponent(Ms(s))}).join(e):o+encodeURIComponent(Ms(t[n]))}).join(e):i?encodeURIComponent(Ms(i))+r+encodeURIComponent(Ms(t)):""};var pM=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function fx(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}a(fx,"map");var mM=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}});var dx=T(js=>{"use strict";js.decode=js.parse=cx();js.encode=js.stringify=hx()});var yx=T((_3,wx)=>{wx.exports=so;var wM=$1(),px=M1(),yM=dm(),gM=tx(),bM=ax(),vM=dx(),mx=ko(),wm=a(t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function","isStream");function so(t,e){if(t=Object.assign({maxRedirects:10},typeof t=="string"?{url:t}:t),e=bM(e),t.url){let{hostname:l,port:f,protocol:c,auth:u,path:h}=mx.parse(t.url);delete t.url,!l&&!f&&!c&&!u?t.path=h:Object.assign(t,{hostname:l,port:f,protocol:c,auth:u,path:h})}let r={"accept-encoding":"gzip, deflate"};t.headers&&Object.keys(t.headers).forEach(l=>r[l.toLowerCase()]=t.headers[l]),t.headers=r;let i;t.body?i=t.json&&!wm(t.body)?JSON.stringify(t.body):t.body:t.form&&(i=typeof t.form=="string"?t.form:vM.stringify(t.form),t.headers["content-type"]="application/x-www-form-urlencoded"),i&&(t.method||(t.method="POST"),wm(i)||(t.headers["content-length"]=Buffer.byteLength(i)),t.json&&!t.form&&(t.headers["content-type"]="application/json")),delete t.body,delete t.form,t.json&&(t.headers.accept="application/json"),t.method&&(t.method=t.method.toUpperCase());let n=t.hostname,s=(t.protocol==="https:"?gM:yM).request(t,l=>{if(t.followRedirects!==!1&&l.statusCode>=300&&l.statusCode<400&&l.headers.location){t.url=l.headers.location,delete t.headers.host,l.resume();let c=mx.parse(t.url).hostname;return c!==null&&c!==n&&(delete t.headers.cookie,delete t.headers.authorization),t.method==="POST"&&[301,302].includes(l.statusCode)&&(t.method="GET",delete t.headers["content-length"],delete t.headers["content-type"]),t.maxRedirects--===0?e(new Error("too many redirects")):so(t,e)}let f=typeof px=="function"&&t.method!=="HEAD";e(null,f?px(l):l)});return s.on("timeout",()=>{s.abort(),e(new Error("Request timed out"))}),s.on("error",e),wm(i)?i.on("error",e).pipe(s):s.end(i),s}a(so,"simpleGet");so.concat=(t,e)=>so(t,(r,i)=>{if(r)return e(r);wM(i,(n,o)=>{if(n)return e(n);if(t.json)try{o=JSON.parse(o.toString())}catch(s){return e(s,i,o)}e(null,i,o)})});["get","post","put","patch","head","delete"].forEach(t=>{so[t]=(e,r)=>(typeof e=="string"&&(e={url:e}),so(Object.assign({method:t.toUpperCase()},e),r))})});var Kh=ae(Sr(),1);var Sf=class Sf{constructor(e,r){H(this,"entries",[]);H(this,"currentIndex",0);H(this,"closed",!1);H(this,"compositFs");H(this,"dirPath");H(this,"initialized",!1);this.compositFs=e,this.dirPath=r}async initialize(){if(this.initialized)return;let e=new Set;for(let r of[...this.compositFs.subFilesystems].reverse()){let i=await r.readdir(this.dirPath);for(let n of i)e.add(n)}for(let r of Array.from(e)){let i=this.dirPath+"/"+r;await this.compositFs.hiddenFilesFileSystem?.responsible(i)||this.entries.push({name:r,path:i})}this.initialized=!0}async*[Symbol.asyncIterator](){for(await this.initialize();this.currentIndex<this.entries.length&&!this.closed;){let e=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(e.path);yield{name:e.name,isFile:a(()=>r.isFile(),"isFile"),isDirectory:a(()=>r.isDirectory(),"isDirectory"),isBlockDevice:a(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:a(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:a(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:a(()=>r.isFIFO(),"isFIFO"),isSocket:a(()=>r.isSocket(),"isSocket")}}catch(r){console.debug(`Failed to stat ${e.path}:`,r)}}}async read(){if(this.closed)throw new Error("Directory handle is closed");if(await this.initialize(),this.currentIndex>=this.entries.length)return null;let e=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(e.path);return{name:e.name,isFile:a(()=>r.isFile(),"isFile"),isDirectory:a(()=>r.isDirectory(),"isDirectory"),isBlockDevice:a(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:a(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:a(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:a(()=>r.isFIFO(),"isFIFO"),isSocket:a(()=>r.isSocket(),"isSocket")}}catch{return this.read()}}async close(){this.closed=!0,this.entries=[]}get path(){return this.dirPath}};a(Sf,"CompositeFsDir");var ji=Sf;var xf=class xf{constructor(e){H(this,"delegate");H(this,"_subFsFileDescriptor");H(this,"handleType","file");H(this,"_compositFsFileDescriptor",-1);this.delegate=e.fs,this._subFsFileDescriptor=e.subFsFileDescriptor,this._compositFsFileDescriptor=-1;let r=e.fs.fileType(),i=this._subFsFileDescriptor}get fsType(){return this.delegate.fileType()}get subFsFileDescriptor(){return this._subFsFileDescriptor}get fd(){return this._compositFsFileDescriptor}realize(e){if(this._compositFsFileDescriptor!==-1)throw new Error("was already realized");this._compositFsFileDescriptor=e}readableWebStream(e){throw new Error("Method not implemented.")}async appendFile(e,r){return await this.delegate.appendFile(this,e,r)}async chmod(e){return this.delegate.fchmod(this,e)}async chown(e,r){return this.delegate.fchown(this,e,r)}async close(){return this.delegate.close(this)}async datasync(){return this.delegate.dataSync(this)}async read(e,r,i,n){return await this.delegate.read(this,e,r,i,n)}readv(e,r){return this.delegate.readv(this,e,r)}async stat(e){return this.delegate.fstat(this,e)}async truncate(e){return this.delegate.ftruncate(this,e)}async utimes(e,r){return this.delegate.futimes(this,e,r)}async write(e,r,i,n){return this.delegate.write(this,e,r,i,n)}async writev(e,r){return this.delegate.writev(this,e,r)}async sync(){return this.delegate.dataSync(this)}};a(xf,"CompositFsFileHandle");var kt=xf;var Mb=ae(Sr(),1),El=ae(Fn(),1);var Wh=class Wh{constructor({parentFs:e,gitRoot:r}){H(this,"compositFs");H(this,"gitRoot");this.compositFs=e,this.gitRoot=r}toStr(e){return typeof e=="string"?e:Buffer.isBuffer(e)?e.toString():e&&typeof e=="object"&&"fd"in e?`FileHandle(fd=${e.fd})`:String(e)}async open(e,r,i){throw new Error(`open not implemented for: ${this.toStr(e)}`)}async access(e,r){throw new Error(`access not implemented for: ${this.toStr(e)}`)}async stat(e,r){throw new Error(`lstat not implemented for: ${this.toStr(e)}`)}async lstat(e,r){throw new Error(`lstat not implemented for: ${this.toStr(e)}`)}async opendir(e,r){throw new Error(`opendir not implemented for: ${this.toStr(e)}`)}async link(e,r){throw new Error(`link not implemented for: ${this.toStr(e)}`)}async mkdir(e,r){throw new Error(`mkdir not implemented for: ${this.toStr(e)}`)}async readdir(e,r){throw new Error(`readdir not implemented for: ${this.toStr(e)}`)}async readlink(e,...r){throw new Error(`readlink not implemented for: ${this.toStr(e)}`)}async unlink(e){throw new Error(`unlink not implemented for: ${this.toStr(e)}`)}async rename(e,r){throw new Error(`rename not implemented for: ${this.toStr(e)}`)}async rmdir(e,...r){throw new Error(`rmdir not implemented for: ${this.toStr(e)}`)}async symlink(e,r,i){throw new Error(`symlink not implemented for: ${this.toStr(r)}`)}async lookup(e){throw new Error(`lookup not implemented for: ${this.toStr(e)}`)}resolvePath(e){throw new Error(`resolvePath not implemented for fd: ${e}`)}async close(e){this.compositFs.close(e)}async dataSync(e){throw new Error(`dataSync not implemented for: ${e.subFsFileDescriptor}`)}async read(e,r,i,n,o){throw new Error(`read not implemented for: ${e.subFsFileDescriptor}`)}async appendFile(e,r,i){throw new Error(`appendFile not implemented for: ${e.subFsFileDescriptor}`)}async fchmod(e,r){throw new Error(`fchmod not implemented for: ${e.subFsFileDescriptor}`)}async fchown(e,r,i){throw new Error(`fchown not implemented for: ${e.subFsFileDescriptor}`)}async ftruncate(e,r){throw new Error(`ftruncate not implemented for: ${e.subFsFileDescriptor}`)}async fstat(e,r){throw new Error(`fstat not implemented for: ${e.subFsFileDescriptor}`)}async futimes(e,r,i){throw new Error(`futimes not implemented for: ${e.subFsFileDescriptor}`)}async write(e,r,i,n,o){throw new Error(`write not implemented for: ${e.subFsFileDescriptor}`)}async writev(e,r,i){throw new Error(`writev not implemented for: ${e.subFsFileDescriptor}`)}async readv(e,r,i){throw new Error(`readv not implemented for: ${e.subFsFileDescriptor}`)}async readFile(e,r){throw new Error(`readFile not implemented for: ${this.toStr(e)}`)}async writeFile(e,r,i){throw new Error(`writeFile not implemented for: ${this.toStr(e)}`)}};a(Wh,"BaseCompositeSubFs");var vt=Wh;var Vh=class Vh extends vt{constructor({parentFs:r,gitRoot:i}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,El.createFsFromVolume)(new El.Volume));H(this,"targetFs");if(this.compositFs=r,this.gitRoot=i,this.compositFs.parentFs===void 0)throw new Error("PassThroughSubFs not allowed in root fs");this.targetFs=this.compositFs.parentFs}async responsible(r){return!0}fileType(){return 4}async open(r,i,n){let o=Mb.dirname(r),s=await this.targetFs.promises.open(r,i,n);return this.openFh.set(s.fd,s),new kt({fs:this,subFsFileDescriptor:s.fd,parentFsFileDescriptors:[s.fd]})}async access(r,i){return await this.targetFs.promises.access(r,i)}async stat(r,i){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,i){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,i){return await this.targetFs.promises.opendir(r,i)}async link(r,i){return await this.targetFs.promises.link(r,i)}async mkdir(r,i){let n=typeof r=="string"?r:r.toString();return await this.targetFs.promises.mkdir(n,i)}async readdir(r,...i){return this.targetFs.promises.readdir(r,...i)}async readlink(r,...i){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,i){return await this.targetFs.promises.rename(r,i)}async rmdir(r,i){return await this.targetFs.promises.rmdir(r,i)}async symlink(r,i,n){return await this.targetFs.promises.symlink(r,i,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor)),this.compositFs.close(r)}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.sync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){return typeof r=="string"||Buffer.isBuffer(r)?this.targetFs.readFile(r.toString(),i):super.readFile(r,i)}async writeFile(r,i,n){let o=typeof n=="object"&&n.flag?n.flag:"w",s=await this.targetFs.open(r,o);try{let l;if(typeof i=="string"){let f=typeof n=="object"&&n.encoding?n.encoding:"utf8";l=Buffer.from(i,f)}else Buffer.isBuffer(i)?l=i:l=Buffer.from(i);await s.write(l,0,l.length,0)}finally{await this.targetFs.close(s)}}};a(Vh,"PassThroughSubFs");var Fl=Vh;var jb=ae(Sr(),1),xl=ae(Fn(),1);var Gh=class Gh extends vt{constructor({parentFs:r,gitRoot:i,passThroughFs:n}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,xl.createFsFromVolume)(new xl.Volume));H(this,"targetFs");this.compositFs=r,this.gitRoot=i,this.targetFs=n}async responsible(r){return!0}fileType(){return 4}async open(r,i,n){let o=jb.dirname(r),s=await this.targetFs.promises.open(r,i,n);return this.openFh.set(s.fd,s),new kt({fs:this,subFsFileDescriptor:s.fd,parentFsFileDescriptors:[]})}async access(r,i){return await this.targetFs.promises.access(r,i)}async stat(r,...i){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,...i){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,i){let n=await this.targetFs.promises.opendir(r,i);return new ji(this.compositFs,r.toString())}async link(r,i){return await this.targetFs.promises.link(r,i)}async mkdir(r,i){await this.targetFs.promises.mkdir(r,i)}async readdir(r,...i){return this.targetFs.promises.readdir(r,...i)}async readlink(r,...i){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,i){return await this.targetFs.promises.rename(r,i)}async rmdir(r,i){return await this.targetFs.promises.rmdir(r,i)}async symlink(r,i,n){return await this.targetFs.promises.symlink(r,i,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor)),this.compositFs.close(r)}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.sync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){return this.targetFs.promises.readFile(r,i)}async writeFile(r,i,n){return this.targetFs.promises.writeFile(r,i,n)}};a(Gh,"PassThroughToAsyncFsSubFs");var Sl=Gh;var Zh=class Zh{constructor({name:e,parentFs:r,storageFs:i,gitRoot:n}){H(this,"promises");H(this,"gitRoot");H(this,"ephemeralFilesFileSystem");H(this,"hiddenFilesFileSystem");H(this,"passThroughFileSystem");H(this,"subFilesystems",[]);H(this,"parentFs");H(this,"name");H(this,"pathToFileDescriptors",new Map);H(this,"openFileHandles",new Map);if(this.name=e,this.parentFs=r,this.gitRoot=n,this.promises={access:this.access.bind(this),opendir:this.opendir.bind(this),mkdir:this.mkdir.bind(this),readdir:this.readdir.bind(this),open:this.open.bind(this),stat:this.stat.bind(this),lstat:this.lstat.bind(this),link:this.link.bind(this),readlink:this.readlink.bind(this),unlink:this.unlink.bind(this),rename:this.rename.bind(this),rmdir:this.rmdir.bind(this),symlink:this.symlink.bind(this),readFile:this.readFile.bind(this),writeFile:this.writeFile.bind(this),getFilehandle:this.getFilehandle.bind(this)},!r&&i){this.passThroughFileSystem=new Sl({passThroughFs:i,gitRoot:n,parentFs:this});return}if(!i&&r){this.passThroughFileSystem=new Fl({parentFs:this,gitRoot:n});return}throw new Error("invalid configuration")}getNextFileDescriptor(){let e=Array.from(this.openFileHandles.keys());return e.length===0?1:Math.max(...e)+1}getFilehandle(e){return this.openFileHandles.get(e)}setEphemeralFilesSubFs(e){this.ephemeralFilesFileSystem=e}setHiddenFilesSubFs(e){this.hiddenFilesFileSystem=e}addSubFs(e){this.subFilesystems.push(e)}async getResponsibleFs(e){if(!e.toString().startsWith(this.gitRoot)&&this.gitRoot!=="./")throw new Error("tried to access a file ("+e+") outside of the legit folder: "+this.gitRoot);if(!this.hiddenFilesFileSystem)throw new Error(this.name+" intialize hidden fs first!");if(!this.ephemeralFilesFileSystem)throw new Error(this.name+" intialize ephemeral fs first!");if(await this.hiddenFilesFileSystem.responsible(e.toString()))return this.hiddenFilesFileSystem;if(await this.ephemeralFilesFileSystem.responsible(e.toString()))return this.ephemeralFilesFileSystem;for(let r of this.subFilesystems)if(await r.responsible(e.toString()))return r;return this.passThroughFileSystem}async access(e,r){return(await this.getResponsibleFs(e)).access(e,r)}async opendir(e,r){let i=e.toString();if(!i.startsWith(this.gitRoot))throw new Error("tried to access a directory ("+i+") outside of the legit folder: "+this.gitRoot);return new ji(this,i)}async mkdir(e,r){return(await this.getResponsibleFs(e)).mkdir(e,r)}async readdir(e,r){let i=await this.getResponsibleFs(e);if(i!==this.passThroughFileSystem)return i.readdir(e,r);let n=new Set;for(let s of[...this.subFilesystems].reverse()){let l=await s.readdir(e,r);for(let f of l)await this.ephemeralFilesFileSystem?.responsible((e=="/"?"":e)+"/"+f)||n.add(f)}let o=await this.passThroughFileSystem.readdir(e,r);for(let s of o)await this.ephemeralFilesFileSystem?.responsible((e=="/"?"":e)+"/"+s)||n.add(s);try{let s=await this.ephemeralFilesFileSystem.readdir(e,r);for(let l of s)n.add(l)}catch(s){console.log(s.code)}for(let s of n){let l=(e=="/"?"":e)+"/"+s;await this.hiddenFilesFileSystem.responsible(l)&&n.delete(s)}return Array.from(n)}async open(e,r,i){let o=await(await this.getResponsibleFs(e)).open(e,r,i),s=this.getNextFileDescriptor();return o.realize(s),this.openFileHandles.set(s,o),this.pathToFileDescriptors.get(e)||this.pathToFileDescriptors.set(e,[]),this.pathToFileDescriptors.get(e).push(s),o}async close(e){for(let[r,i]of this.pathToFileDescriptors.entries()){let n=i.indexOf(e.fd);if(n!==-1){i.splice(n,1),i.length===0&&this.pathToFileDescriptors.delete(r);break}}}async stat(e,r){let i=e.toString();return(await this.getResponsibleFs(e)).stat(e)}async lstat(e,r){return(await this.getResponsibleFs(e)).lstat(e,r)}async link(e,r){throw new Error("not implemented")}async readlink(e,r){throw new Error("not implemented")}async unlink(e){return(await this.getResponsibleFs(e)).unlink(e)}async rename(e,r){if(this.hiddenFilesFileSystem){if(await this.hiddenFilesFileSystem.responsible(Kh.basename(e.toString())))throw new Error("Renaming of hidden Files is not allowed "+e);if(await this.hiddenFilesFileSystem.responsible(Kh.basename(r.toString())))throw new Error("Renaming to hidden Files is not allowed "+r)}let i=await this.getResponsibleFs(e),n=await this.getResponsibleFs(r);if(i===n)return i.rename(e,r);let o=await i.open(e.toString(),"r");try{let s=await i.fstat(o),l=Buffer.alloc(s.size);await i.read(o,l,0,s.size,0),await i.close(o),await n.writeFile(r.toString(),l,"utf8"),await i.unlink(e)}catch(s){try{await i.close(o)}catch{}throw s}}async rmdir(e,r){return(await this.getResponsibleFs(e)).rmdir(e,r)}async symlink(e,r,i){throw new Error("not implemented")}async readFile(e,r){let i=!0,n;if(typeof e=="number"){i=!1;let o=this.getFilehandle(e);if(!o)throw new Error("Invalid file descriptor");n=o}else if(typeof e=="string")n=await this.open(e,"r");else throw new Error("only filehandle and path are supported atm");try{let s=(await n.stat()).size;if(typeof s=="bigint"){if(s>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("File too large to read into buffer");s=Number(s)}let l=Buffer.alloc(s),{bytesRead:f}=await n.read(l,0,s,0);if(r&&typeof r.encoding=="string")return l.slice(0,f).toString(r.encoding);if(typeof r=="string"){if(r==="utf8"||r==="utf-8")return l.slice(0,f).toString(r);throw new Error("Unsupported encoding: "+r)}return l.slice(0,f)}finally{n&&i&&await n.close()}}async writeFile(e,r,i){let n=typeof e!="number",o,s,l,f="w";if(typeof i=="string"?s=i:i&&typeof i=="object"&&(s=i.encoding,l=i.mode,f=i.flag||"w"),typeof e=="number"){let c=this.getFilehandle(e);if(!c)throw new Error("Invalid file descriptor");o=c}else if(typeof e=="string")o=await this.open(e,f,l);else throw new Error("only filehandle and path are supported atm");try{let c;if(typeof r=="string")c=Buffer.from(r,s||"utf8");else if(r instanceof Buffer)c=r;else if(r instanceof Uint8Array)c=Buffer.from(r);else throw new Error("Invalid data type for writeFile");let u=0;for(;u<c.length;){let{bytesWritten:h}=await o.write(c,u,c.length-u,u);u+=h}}finally{o&&n&&await o.close()}}};a(Zh,"CompositeFs");var zo=Zh;var Zb=ae(od(),1);var sd=class sd extends vt{constructor({parentFs:r,gitRoot:i,hiddenFiles:n}){super({parentFs:r,gitRoot:i});H(this,"ig");this.ig=(0,Zb.default)(),this.ig.add(n)}async responsible(r){let i=r.replace(/\\/g,"/"),n=i.startsWith("./")?i.slice(2):i;return n=n.startsWith("/")?n.slice(1):n,n===""||n==="."?!1:this.ig.ignores(n)}fileType(){return 255}error(r){return new Error(`Access to hidden file is not allowed: ${this.toStr(r)}`)}async open(r,i,n){throw this.error(r)}async access(r){throw this.error(r)}async stat(r){throw this.error(r)}async lstat(r){throw this.error(r)}async opendir(r){throw this.error(r)}async link(r){throw this.error(r)}async mkdir(r){throw this.error(r)}async readdir(r){throw this.error(r)}async readlink(r){throw this.error(r)}async unlink(r){throw this.error(r)}async rename(r){throw this.error(r)}async rmdir(r){throw this.error(r)}async symlink(r,i){throw this.error(i)}async lookup(r){throw this.error(r)}resolvePath(r){throw new Error(`Access to hidden file is not allowed: resolvePath(${r})`)}async close(r){throw new Error("Access to hidden file is not allowed: close: "+r.subFsFileDescriptor)}async dataSync(r){throw new Error("Access to hidden file is not allowed: dataSync: "+r.subFsFileDescriptor)}async read(r,i,n,o,s){throw new Error("Access to hidden file is not allowed: readFileHandle: "+r.subFsFileDescriptor)}};a(sd,"HiddenFileSubFs");var Vo=sd;var kl=ae(Sr(),1),Pl=ae(Fn(),1);var Xb=ae(od(),1);var ad=class ad extends vt{constructor({parentFs:r,gitRoot:i,ephemeralPatterns:n}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,Pl.createFsFromVolume)(new Pl.Volume));H(this,"ig");H(this,"patterns");this.compositFs=r,this.gitRoot=i,this.ig=(0,Xb.default)(),this.ig.add(n),this.patterns=n}normalizePath(r){let i=typeof r=="string"?r:r.toString();return i.startsWith("/")?i:"/"+i}async responsible(r){let i=r.replace(/\\/g,"/"),n=i.startsWith("./")?i.slice(2):i;return n=n.startsWith("/")?n.slice(1):n,n===""||n==="."?!1:this.ig.ignores(n)}fileType(){return 5}async open(r,i,n){let o=this.normalizePath(r),s=kl.dirname(o);s&&s!=="/"&&s!=="."&&await this.memFs.promises.mkdir(s,{recursive:!0});let l=await this.memFs.promises.open(o,i,n);return this.openFh.set(l.fd,l),new kt({fs:this,subFsFileDescriptor:l.fd,parentFsFileDescriptors:[l.fd]})}async access(r,i){let n=this.normalizePath(r);return await this.memFs.promises.access(n,i)}async stat(r,i){let n=this.normalizePath(r);return this.memFs.promises.stat(n,{bigint:!1})}async lstat(r,i){let n=this.normalizePath(r);return this.memFs.promises.lstat(n,{bigint:!1})}async opendir(r,i){let n=this.normalizePath(r);return await this.memFs.promises.opendir(n,i)}async link(r,i){let n=this.normalizePath(r),o=this.normalizePath(i);return await this.memFs.promises.link(n,o)}async mkdir(r,i){let n=this.normalizePath(r);if(!(typeof i=="object"&&i&&"recursive"in i&&i.recursive)){let s=kl.dirname(n);if(s&&s!=="/"&&s!==".")try{await this.memFs.promises.stat(s)}catch{await this.memFs.promises.mkdir(s,{recursive:!0})}}await this.memFs.promises.mkdir(n,i)}async readdir(r,...i){let n=this.normalizePath(r),o=await this.memFs.promises.readdir(n,...i);return console.log("EPHEMERAL: READDIR: ",o),o}async readlink(r){throw new Error("readlink is not implemented for EphemeralFileSubFs")}async unlink(r){let i=this.normalizePath(r);return await this.memFs.promises.unlink(i)}async rename(r,i){let n=this.normalizePath(r),o=this.normalizePath(i);return await this.memFs.promises.rename(n,o)}async rmdir(r,i){let n=this.normalizePath(r);return await this.memFs.promises.rmdir(n,i)}async symlink(r,i,n){let o=this.normalizePath(r),s=this.normalizePath(i);return await this.memFs.promises.symlink(o,s,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.datasync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){if(typeof r=="string"||Buffer.isBuffer(r)){let n=this.normalizePath(r);return this.memFs.promises.readFile(n,i)}return super.readFile(r,i)}async writeFile(r,i,n){let o=this.normalizePath(r),s=kl.dirname(o);return s&&s!=="/"&&s!=="."&&await this.memFs.promises.mkdir(s,{recursive:!0}),this.memFs.promises.writeFile(o,i,n)}};a(ad,"EphemeralSubFs");var Go=ad;var om=ae(Sr(),1),pf=ae(Fn(),1);var nf=ae(Me(),1);var of={type:"gitBranchesListVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e})=>{let r=t+"/.git";try{return await e.stat(r)}catch{throw new Error(`ENOENT: no such file or directory, stat '${r}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>{try{let r=await nf.default.listBranches({fs:e,dir:t}),i=await nf.default.currentBranch({fs:e,dir:t}),n=await Promise.all(r.map(async o=>{let s=await nf.default.resolveRef({fs:e,dir:t,ref:o});return o}));return{type:"directory",content:n,mode:493,size:n}}catch(r){throw r}},"getFile"),rename:a(async t=>{throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var ue=ae(Me(),1);var _r=ae(Me(),1);async function Fr(t,e,r){try{return await _r.default.resolveRef({fs:t,dir:e,ref:`refs/heads/${r}`})}catch{return}}a(Fr,"tryResolveRef");async function ro({dir:t,fs:e,treeOid:r,deletePathParts:i,addPathParts:n,addObj:o}){let[s,...l]=n??[],[f,...c]=i??[],u=[];if(r){let{tree:h}=await _r.default.readTree({fs:e,dir:t,oid:r});u=[...h]}if(s===f){let h=s;if(h===void 0)throw new Error("illegal arguement - called with out a path part");if(l.length===0)throw new Error("can not move into it self");if(c.length===0)throw new Error("can not move from it self");let d=u.findIndex(v=>v.path===h),m=(d!==-1?u[d]:void 0)?.oid,w=await ro({dir:t,fs:e,treeOid:m,addPathParts:l,deletePathParts:c,addObj:o});if(w===void 0)throw new Error("on the same path we expect an update - respectivly a newly created subTreeOid");let y=!1;if(w!==m){y=!0;let v={mode:"040000",path:h,oid:w,type:"tree"};d!==-1?u[d]=v:u.push(v)}if(r==null&&!y)throw new Error("Illegal state - if the currentOid is undefined - a new tree should have been created (an update should have happened)");if(y)return await _r.default.writeTree({fs:e,dir:t,tree:u});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}else{let h=!1,d;if(f){let p=u.findIndex(w=>w.path===f),m=p!==-1?u[p]:void 0;if(m===void 0)throw new Error("Element doesnt exist in tree");if(c.length>0){if(m&&m.type!=="tree")throw new Error("SubPart of the path for the obj to delete is not a tree");let w=await ro({dir:t,fs:e,treeOid:m.oid,addPathParts:void 0,deletePathParts:c,addObj:o});if(w===m.oid)throw new Error("in case of a delete we expect a different subtree oid");h=!0,w===void 0?u.splice(p,1):u[p]={mode:"040000",path:f,oid:w,type:"tree"}}else h=!0,u.splice(p,1);d=m}if(s){let p=u.findIndex(w=>w.path===s),m=p!==-1?u[p]:void 0;if(l.length>0){if(m&&m.type!=="tree")throw new Error("SubPart of the path for the obj to add is not a tree");let w=await ro({dir:t,fs:e,treeOid:m?.oid,addPathParts:l,deletePathParts:void 0,addObj:o});if(w===void 0)throw new Error("in case we add, we expect an update - respectivly a newly created subTreeOid");if(w!==m?.oid){h=!0;let y={mode:"040000",path:s,oid:w,type:"tree"};p!==-1?u[p]=y:u.push(y)}}else{h=!0;let w={mode:o.type==="tree"?"040000":"100644",path:s,oid:o.oid,type:o.type};p!==-1?u[p]=w:u.push(w)}}if(u.length===0)return;if(h)return await _r.default.writeTree({fs:e,dir:t,tree:u});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}}a(ro,"buildUpdatedTree");async function Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:i,pathParams:n}){if(!n.filePath){let l=await _r.default.readTree({fs:r,dir:e,oid:i});return{type:"tree",entries:l.tree.map(c=>c.path),oid:l.oid}}return(await _r.default.walk({fs:r,dir:e,trees:[_r.default.TREE({ref:i})],map:a(async(l,[f])=>{if(l===n.filePath&&f){let c=await f.type();if(c==="blob")return{type:"blob",oid:await f.oid()};if(c=="tree"){let u=await _r.default.readTree({fs:r,dir:e,oid:await f.oid()});return{type:"tree",entries:u.tree.map(d=>d.path),oid:u.oid}}}},"map")})).find(l=>l!==void 0)}a(Ci,"resolveGitObjAtPath");var sf=class sf extends Error{constructor(r,i){super(r);H(this,"code","ENOENT");H(this,"path");this.name="ENOENTError",this.path=i,Object.setPrototypeOf(this,sf.prototype)}};a(sf,"ENOENTError");var Ni=sf;async function E1(t,e,r,i){let[n,...o]=i;if(!n)return r;let{tree:s}=await ue.default.readTree({fs:t,dir:e,oid:r}),l=[...s],f=l.findIndex(c=>c.path===n);if(f===-1)return r;if(o.length===0)l.splice(f,1);else{let c=l[f];if(c&&c.type==="tree"){let u=await E1(t,e,c.oid,o);if(u!==c.oid)l[f]={mode:c.mode,path:c.path,type:c.type,oid:u};else return r}else return r}return await ue.default.writeTree({fs:t,dir:e,tree:l})}a(E1,"buildTreeWithoutFile");var io={type:"gitBranchFileVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,filePath:r,cacheFs:i,pathParams:n})=>{if(n.branchName===void 0)throw new Error("branchName should be in pathParams");let o=await Fr(e,t,n.branchName);if(!o)throw new Ni(`ENOENT: no such file or directory, stat '${r}'`,r);let s=await Ci({filePath:r,gitRoot:t,nodeFs:e,commitSha:o,pathParams:n});if(!s)throw new Ni(`ENOENT: no such file or directory, stat '${r}'`,r);let l=await ue.default.readCommit({fs:e,dir:t,oid:o}),{commit:f}=l,c=f.committer.timestamp*1e3;if(s.type==="tree")return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!0,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c)};{let{blob:u}=await ue.default.readBlob({fs:e,dir:t,oid:s.oid});return{mode:420,size:u.length,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(u.length/4096),atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c)}}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n})=>{if(n.branchName===void 0)throw new Error("branchName should be in pathParams");let o=[];try{let s=await Fr(r,e,n.branchName),l=await Fr(r,e,"refs/heads/"+n.branchName);if(!s){let c=await ue.default.resolveRef({fs:r,dir:e,ref:"HEAD"});await ue.default.branch({fs:r,dir:e,ref:n.branchName,object:c}),s=await ue.default.resolveRef({fs:r,ref:`refs/heads/${n.branchName}`,dir:e})}let f=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:s,pathParams:n});if(!f)return;if(f.type==="blob"){let{blob:c}=await ue.default.readBlob({fs:r,dir:e,oid:f.oid});return{type:"file",content:Buffer.from(c),mode:420,size:c.length,oid:f.oid}}else{let c=[];try{let h=await i.promises.stat(t);if(h&&h.isDirectory()){let d=await i.promises.readdir(t,{withFileTypes:!1,encoding:"utf-8"});c.push(...d.filter(p=>p!==".keep"))}}catch{}return{type:"directory",content:Array.from(new Set([...f.entries.filter(h=>h!==".keep"),...c])),mode:493}}}catch{return}},"getFile"),unlink:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n})=>{if(!n.branchName)throw new Error("branchName should be in pathParams");if(!n.filePath)throw new Error("filePath should be in pathParams");let o=await ue.default.resolveRef({fs:r,dir:e,ref:n.branchName}),s=await ue.default.readTree({fs:r,dir:e,oid:o}),l=await E1(r,e,s.oid,n.filePath.split("/"));if(l!==s.oid){let f=await ue.default.commit({fs:r,dir:e,message:`Delete ${n.filePath}`,tree:l,noUpdateBranch:!0,parent:[o],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:r,dir:e,ref:`refs/heads/${n.branchName}`,value:f,force:!0})}},"unlink"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");if(o.filePath===void 0)throw new Error("filePath should be in pathParams");let s;typeof i=="string"?s=new TextEncoder().encode(i):s=new Uint8Array(i);let l=await ue.default.writeBlob({fs:r,dir:e,blob:s}),f=await Fr(r,e,o.branchName);if(!f){let h=await ue.default.resolveRef({fs:r,dir:e,ref:"HEAD"});await ue.default.branch({fs:r,dir:e,ref:o.branchName,object:h}),f=await ue.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o.branchName}`})}let c=await ue.default.readTree({fs:r,dir:e,oid:f}),u=await ro({dir:e,fs:r,treeOid:c.oid,addPathParts:o.filePath.split("/"),deletePathParts:void 0,addObj:{type:"blob",oid:l}});if(u!==c.oid){let h=await ue.default.commit({fs:r,dir:e,message:`\u{1F4BE} Change '${o.filePath}'`,tree:u,noUpdateBranch:!0,parent:[f],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:r,dir:e,ref:`refs/heads/${o.branchName}`,value:h,force:!0})}},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){if(n.branchName===void 0)throw new Error("branchName should be in pathParams");if(n.filePath===void 0)throw new Error("filePath should be in pathParams");if(o.branchName===void 0)throw new Error("branchName should be in newPathParams");if(o.filePath===void 0)throw new Error("filePath should be in newPathParams");let s=await Fr(i,r,n.branchName);if(!s)throw new Error("Invalid branch file path - source branch must exist");let l=await Fr(i,r,o.branchName);if(!l){let h=await ue.default.resolveRef({fs:i,dir:r,ref:"HEAD"});await ue.default.branch({fs:i,dir:r,ref:o.branchName,object:h}),l=await ue.default.resolveRef({fs:i,dir:r,ref:`refs/heads/${o.branchName}`})}if(o.branchName!==n.branchName)throw new Error("cross branch move not implemented yet");let f=await Ci({gitRoot:r,nodeFs:i,commitSha:s,filePath:t,pathParams:n});if(f===void 0)throw new Error("no obj at path exists");let c=await ro({dir:r,fs:i,deletePathParts:n.filePath.split("/"),addPathParts:o.filePath.split("/"),addObj:f,treeOid:l}),u=await ue.default.readTree({fs:i,dir:r,oid:s});if(c!==u.oid){let h=await ue.default.commit({fs:i,dir:r,message:`\u{1F500} Rename '${n.filePath}' to '${o.filePath}'`,tree:c,noUpdateBranch:!0,parent:[l],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:i,dir:r,ref:`refs/heads/${o.branchName}`,value:h,force:!0})}},"rename"),mkdir:a(async function(t){try{throw await io.getStats(t),new Error("Folder exists")}catch{}t.filePath.endsWith("/")&&(t.filePath=t.filePath.replace(/\/+$/,"")),t.pathParams&&typeof t.pathParams.filePath=="string"&&(t.pathParams.filePath=t.pathParams.filePath.replace(/\/+$/,""));let e={...t,filePath:t.filePath+=".keep",content:""};e.pathParams.filePath+="/.keep",await io.writeFile(e)},"mkdir")};var ei=ae(Me(),1);var af={type:"gitBranchHeadVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i;try{i=await ei.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await ei.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}let n=await ei.default.readCommit({fs:e,dir:t,oid:i}),{commit:o}=n,s=o.committer.timestamp*1e3;return{mode:420,size:40,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:s,mtimeMs:s,ctimeMs:s,birthtimeMs:s,atime:new Date(s),mtime:new Date(s),ctime:new Date(s),birthtime:new Date(s)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");try{let i;try{i=await ei.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await ei.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}return{type:"file",content:i+`
|
|
104
|
-
`,mode:420,size:i.length}}catch{return}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(console.log("gitBranchHeadVirtualFile writeFile called",{pathParams:o,content:i}),o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=i.toString().trim();try{await
|
|
105
|
-
`,mode:420,size:n.length+1}}catch{return}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var lf=ae(Me(),1);var cf={type:"gitCommitFileVirtualFile",getStats:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!i.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let n=i.sha_1_1_2+i.sha1_3__40,o=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:n,pathParams:i});if(!o)throw new Ni(`ENOENT: no such file or directory, stat '${t}'`,t);let s=await lf.default.readCommit({fs:r,dir:e,oid:n}),{commit:l}=s,f=l.committer.timestamp*1e3;if(o.type==="tree")return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!0,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:f,mtimeMs:f,ctimeMs:f,birthtimeMs:f,atime:new Date(f),mtime:new Date(f),ctime:new Date(f),birthtime:new Date(f)};{let{blob:c}=await lf.default.readBlob({fs:r,dir:e,oid:o.oid});return{mode:420,size:c.length,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(c.length/4096),atimeMs:f,mtimeMs:f,ctimeMs:f,birthtimeMs:f,atime:new Date(f),mtime:new Date(f),ctime:new Date(f),birthtime:new Date(f)}}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!i.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let n=i.sha_1_1_2+i.sha1_3__40;try{let o=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:n,pathParams:i});if(!o)return;if(o.type==="blob"){let{blob:s}=await lf.default.readBlob({fs:r,dir:e,oid:o.oid});return{type:"file",content:Buffer.from(s),mode:420,size:s.length,oid:o.oid}}else return{type:"directory",content:Array.from(new Set([...o.entries.filter(l=>l!==".keep")])),mode:493}}catch{return}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var ff=ae(Me(),1);function K$(t,e,r){return t===0&&e===2&&r===0?"untracked":t===1&&e===0&&r===0?"deleted":t===1&&e===2&&r!==0?"modified":t===0&&e===2&&r===2?"added":"unknown"}a(K$,"getFileStatus");var T1={type:"gitStatusVirtualFile",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.fs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>{try{let r=await ff.default.currentBranch({fs:e,dir:t})||"HEAD",i=await ff.default.resolveRef({fs:e,dir:t,ref:"HEAD"}),o=(await ff.default.statusMatrix({fs:e,dir:t})).filter(([,l,f,c])=>l!==f||f!==c).map(([l,f,c,u])=>({path:l,status:K$(f,c,u)})),s=JSON.stringify({branch:r,commit:i,clean:o.length===0,files:o},null,2);return{type:"file",content:s,mode:33188,size:Buffer.byteLength(s)}}catch(r){throw console.error(r),r}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Bs={type:"legitVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e})=>{let r=t+"/.git";try{return await e.stat(r)}catch{throw new Error(`ENOENT: no such file or directory, stat '${r}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>({type:"directory",content:[],mode:493,size:0}),"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var O1=[Bs,T1,cf,of,io,af,x1];var tm=class tm{constructor(e){this.routes=e;H(this,"compiledRoutes");let r={},i=a((n,o)=>{if(typeof n.type=="string"){r[o]={handler:n,siblings:[]};let s=n}else{let s=[];for(let[l,f]of Object.entries(n))if(l==="."){if(r[o])throw new Error(`Conflict: multiple handlers for path '${o}', '.' and optional '[[parameter_name]]' defined?`);r[o]={handler:f,siblings:s}}else if(l.startsWith("[[")&&l.endsWith("]]")){if(r[o])throw new Error(`Conflict: multiple handlers for path '${o}', '.' and optional '[[parameter_name]]' defined?`);r[o]={handler:f,siblings:s},l.startsWith("[[...")?r[o?`${o}/${l}`:l]={handler:f,siblings:[]}:i(f,o?`${o}/${l}`:l)}else l.startsWith("[")&&l.endsWith("]")?l.startsWith("[...")?r[o?`${o}/${l}`:l]={handler:f,siblings:[]}:i(f,o?`${o}/${l}`:l):(s.push(l),i(f,o?`${o}/${l}`:l))}},"walk");for(let[n,o]of Object.entries(e))i(o,n);this.compiledRoutes=Object.entries(r).map(([n,o])=>{let s=[],l=n.split("/").map(c=>{if(c.startsWith("[[")&&c.endsWith("]]")){let u=c.slice(2,-2).replace(/^\.\.\./,"");return s.push(u),"(.*)"}if(c.startsWith("[")&&c.endsWith("]")){let u=c.slice(1,-1);return s.push(u),"([^/]+)"}return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("/");return{regex:new RegExp(`^${l}$`),paramNames:s,staticSiblings:o.siblings,handler:o.handler}})}match(e){e.length>1&&e.endsWith("/")&&(e=e.replace(/\/+$/,""));for(let{regex:r,paramNames:i,handler:n,staticSiblings:o}of this.compiledRoutes){let s=e.match(r);if(!s)continue;let l={};for(let f=0;f<i.length;f++)l[i[f]]=decodeURIComponent(s[f+1]||"");return{handler:n,params:l,staticSiblings:o}}}};a(tm,"LegitPathRouter");var uf=tm;var hf=ae(Me(),1);var rm={type:"gitCommitVirtualFolder",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.fs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{let n=await hf.default.listBranches({fs:r,dir:e}),o=new Set,s=new Set;for(let c of n){let u=`refs/heads/${c}`;try{let h=await hf.default.resolveRef({fs:r,dir:e,ref:u});o.add(h)}catch{}}for(let c of o){let u=await hf.default.log({fs:r,dir:e,ref:c});for(let h of u)s.add(h.oid)}if(!i.sha_1_1_2){let c=new Set;for(let h of s)if(c.add(h.slice(0,2)),c.size>=256)break;let u=Array.from(c).sort();return{type:"directory",content:u,mode:493,size:u}}let l=new Set;for(let c of s)c.startsWith(i.sha_1_1_2)&&l.add(c.slice(2,40));let f=Array.from(l).sort();return{type:"directory",content:f,mode:493,size:f.length}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var nt=ae(Me(),1);var R1=ae(Me(),1);var im="-operation";async function Xe(t,e,r){return(await R1.default.listBranches({fs:t,dir:e})).filter(n=>n.endsWith("__"+r+im))[0]}a(Xe,"resolveOperationBranchName");var k1={type:"gitBranchOperationVirtualFile",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n;try{n=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let o=await Xe(r,e,i.branchName),s=!1;if(o)try{n=await nt.default.resolveRef({fs:r,dir:e,ref:o}),s=!0}catch{try{n=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o}`}),s=!0}catch{}}let l=await nt.default.readCommit({fs:r,dir:e,oid:n}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o,s=!1;return n?(o=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),s=!0):o=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`}),{type:"file",content:Buffer.from(o),mode:420,size:o.length}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s;typeof i=="string"?s=new TextEncoder().encode(i):s=new Uint8Array(i);let l=await nt.default.writeBlob({fs:r,dir:e,blob:s}),f=await Fr(r,e,o.branchName);if(!f)throw new Error("Invalid branch file path - branch doesn't exist");let c=await Xe(r,e,o.branchName),u=!1;c||(c="legit/__"+o.branchName+im,await nt.default.branch({fs:r,dir:e,ref:c,object:f}),u=!0);let h=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${c}`}),d=await nt.default.readTree({fs:r,dir:e,oid:f}),p;i instanceof ArrayBuffer?p=Buffer.from(i).toString("utf-8"):typeof i=="string"?p=i:i instanceof Uint8Array?p=Buffer.from(i).toString("utf-8"):p=String(i);let m=!1;if(!u){let y=await nt.default.findMergeBase({fs:r,dir:e,oids:m?[h]:[h,f]});y.length===1&&y[0]===f&&(m=!0)}let w=await nt.default.commit({fs:r,dir:e,message:p,tree:d.oid,noUpdateBranch:!0,parent:m?u?[f,f]:[h]:[h,f],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await nt.default.writeRef({fs:r,dir:e,ref:`refs/heads/${c}`,value:w,force:!0})},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Bi=ae(Me(),1);var nm={type:"gitBranchOperationsVirtualFile",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t;if(i.branchName===void 0)throw new Error("branchName should be in pathParams");let n=await Xe(r,e,i.branchName),o,s=!1;if(n)try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:n}),s=!0}catch{try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),s=!0}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}}else try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let l=await Bi.default.readCommit({fs:r,dir:e,oid:o}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:(s?await nm.getFile(t):void 0)?.content?.length??0,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o=[];if(n){let f=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),c=!1,u=f;for(;u&&!c;){let h=await Bi.default.readCommit({fs:r,dir:e,oid:u});o.push({oid:h.oid,parentOids:h.commit.parent,message:h.commit.message,originBranchOid:"unset"}),u=h.commit.parent&&h.commit.parent.length>0?h.commit.parent[0]:null,h.commit.parent.length===2&&h.commit.parent[0]===h.commit.parent[1]&&(c=!0)}}let s;for(let f=o.length-1;f>=0;f--){let c=o[f];if(s===void 0){if(c.parentOids.length!==2&&c.parentOids[0]!==c.parentOids[1])throw new Error(`Operation commit ${c.oid} does not have two parents as expected`);s=c.parentOids[1]}c.parentOids.length===2&&(s=c.parentOids[1]),c.originBranchOid=s}let l=Buffer.from(JSON.stringify(o,null,2),"utf-8");return{type:"file",content:l,mode:420,size:l.length}},"getFile"),rename:a(async function(t){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var no=ae(Me(),1);var Z$=new Set([" ","~","^",":","?","*","[","\\"]),X$=[/^\/|\/$/,/\/\//,/\.$/,/\.lock$/,/^@$/,/@\{/],A1="\u2002";function P1(t){let e=t.codePointAt(0);return!(e>=0&&e<=31||e===127||Z$.has(t))}a(P1,"isValidChar");function I1(t){let e="";for(let r of t)r===" "?e+=A1:P1(r)?e+=r:e+="%"+r.codePointAt(0);for(let r of X$)if(r.test(e))return Array.from(e).map(i=>P1(i)?i:"%"+i.codePointAt(0)).join("");return e}a(I1,"encodeName");function D1(t){return t.replace(/%(\d+)/g,(e,r)=>String.fromCodePoint(parseInt(r,10))).replace(new RegExp(A1,"g")," ")}a(D1,"decodeName");var C1={type:"getThreadName",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n;try{n=await no.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let o=await Xe(r,e,i.branchName),s=!1;if(o)try{n=await no.default.resolveRef({fs:r,dir:e,ref:o}),s=!0}catch{try{n=await no.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o}`}),s=!0}catch{}}let l=await no.default.readCommit({fs:r,dir:e,oid:n}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o;if(n){let s="legit/",l=`__${i.branchName}-operation`;return n.startsWith(s)&&n.endsWith(l)?o=n.slice(s.length,n.length-l.length):o=n,{type:"file",content:Buffer.from(D1(o)),mode:420,size:o.length}}return{type:"file",content:Buffer.from(""),mode:420,size:0}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=await Xe(r,e,o.branchName);if(s){let l=`legit/${I1(i.toString())}__${o.branchName}-operation`;await no.default.renameBranch({fs:r,dir:e,oldref:s,ref:l}),s=l}},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var oo=ae(Me(),1);var N1={type:"gitBranchHistory",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i;try{i=await oo.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await oo.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}let n=await oo.default.readCommit({fs:e,dir:t,oid:i}),{commit:o}=n,s=o.committer.timestamp*1e3;return{mode:420,size:1e4,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:s,mtimeMs:s,ctimeMs:s,birthtimeMs:s,atime:new Date(s),mtime:new Date(s),ctime:new Date(s),birthtime:new Date(s)}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=i.branchName,o=[];if(n){let l=await oo.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),f=!1,c=l;for(;c&&!f;){let u=await oo.default.readCommit({fs:r,dir:e,oid:c});o.push({oid:u.oid,...u.commit}),c=u.commit.parent[0]}}let s=Buffer.from(JSON.stringify(o,null,2),"utf-8");return{type:"file",content:s,mode:420,size:s.length}},"getFile"),rename:a(async t=>{throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var nr=ae(Me(),1);var B1={type:"gitBranchOperationHeadVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i=await Xe(e,t,r.branchName);if(!i){let f=new Date(0);return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:f.getTime(),mtimeMs:f.getTime(),ctimeMs:f.getTime(),birthtimeMs:f.getTime(),atime:f,mtime:f,ctime:f,birthtime:f}}let n;try{n=await nr.default.resolveRef({fs:e,dir:t,ref:i})}catch{n=await nr.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}let o=await nr.default.readCommit({fs:e,dir:t,oid:n}),{commit:s}=o,l=s.committer.timestamp*1e3;return{mode:420,size:40,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:l,mtimeMs:l,ctimeMs:l,birthtimeMs:l,atime:new Date(l),mtime:new Date(l),ctime:new Date(l),birthtime:new Date(l)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i=await Xe(e,t,r.branchName);if(!i)return{type:"file",content:"",mode:420,size:0};try{let n;try{n=await nr.default.resolveRef({fs:e,dir:t,ref:i})}catch{n=await nr.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}return{type:"file",content:n+`
|
|
106
|
-
`,mode:420,size:n.length}}catch{return}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=await Xe(r,e,o.branchName),l=await nr.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${s}`});if(!s)throw new Error(`Operation branch name could not be resolved for branch ${o.branchName}`);let f=i.toString().trim(),c,u,h=!1;if(!l)throw new Error(`Operation branch ref could not be resolved for branch ${s}`);let d=l;for(;d&&!h;){let p=await nr.default.readCommit({fs:r,dir:e,oid:d});if(p.oid===f&&(c=p.oid),d=p.commit.parent&&p.commit.parent.length>0?p.commit.parent[0]:null,p.commit.parent.length===2){if(p.commit.parent[0]===p.commit.parent[1])h=!0;else if(c!==void 0){u=p.commit.parent[1];break}}}if(c===void 0)throw new Error(`Cant rollback to ${f} couldn't find newOperationBranchHead ${c}`);if(u===void 0)throw new Error(`Cant rollback to ${f} couldn't find newBranchHead ${u}`);await nr.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+s,value:c,force:!0}),await nr.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+o.branchName,value:u,force:!0})},"writeFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Er=class Er extends vt{constructor({parentFs:r,gitRoot:i,virtualFiles:n=O1}){super({parentFs:r,gitRoot:i});H(this,"memFs");H(this,"openFh",{});H(this,"virtualFiles");H(this,"legitFileNames");this.gitRoot=i,this.memFs=(0,pf.createFsFromVolume)(new pf.Volume),this.virtualFiles=n,this.legitFileNames=["branches","commits"]}async responsible(r){return this.isLegitPath(r)}isLegitPath(r){return r.includes(`/${Er.LEGIT_DIR}/`)||r.includes(`/${Er.LEGIT_DIR}`)}getRouteHandler(r){let i=r.indexOf(`/${Er.LEGIT_DIR}`);if(i===-1)throw new Error("Not a legit path");let n=r.slice(i+1);return Er.pathRouter.match(n)}async open(r,i,n){let o=this.getRouteHandler(r);if(!o)throw new Error("Not a virtual legit file");if(!(o?.handler.writeFile!==void 0)&&(i.includes("w")||i.includes("a")))throw new Error(`Write operations not allowed for ${o?.handler.type}`);if(i.includes("x")&&o?.handler.type!=="gitBranchFileVirtualFile")throw new Error(`Exclusive operations not allowed for ${o?.handler.type}`);let l=await o.handler.getFile({cacheFs:this.memFs,filePath:r,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:o.params});if(i.includes("x")){for(let d of Object.values(this.openFh))if(d.path===r)throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r});if(l!==void 0)throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r})}if(l&&i.includes("x"))throw new Error("file existed - openend with x flag");if(!l&&!(i.includes("w")||i.includes("a")))throw new Error(`ENOENT: no such file or directory, open '${r}'`);let f=om.dirname(r);if(await this.memFs.promises.mkdir(f,{recursive:!0}),l===void 0&&!i.includes("x")||l&&l.type==="file")try{let d=await this.memFs.promises.access(r)}catch{await this.memFs.promises.writeFile(r,"")}let c=await this.memFs.promises.open(r,i,n),u=c.fd,h=new kt({fs:this,subFsFileDescriptor:u,parentFsFileDescriptors:[]});return this.openFh[u]={path:r,mode:i,fh:c,openSha:l?.oid,readSha:void 0,unflushed:[]},(i.includes("x")||i.includes("w"))&&this.openFh[u].unflushed.push({length:0,start:0}),h}async mkdir(r,i){let n=r.toString(),o=this.getRouteHandler(n),s=i?{options:i}:{};try{await o?.handler.mkdir({cacheFs:this.memFs,filePath:r.toString(),fs:this.compositFs,nodeFs:this.compositFs,gitRoot:this.gitRoot,pathParams:o.params,...s});let l=typeof i=="object"?{...i,recursive:!0}:{recursive:!0};await this.memFs.promises.mkdir(r,l);let f=n.split("/"),c="";for(let u=1;u<=f.length;u++){c="/"+f.slice(0,u).join("/");try{if((await this.memFs.promises.stat(c)).isDirectory()){let d=await this.memFs.promises.open(c,"r");this.openFh[d.fd]={path:c,mode:"r",fh:d,openSha:void 0,readSha:void 0,unflushed:[]}}}catch{}}}catch(l){throw l}}async access(r,i){await this.stat(r)}async futimes(r,i,n){let o=this.openFh[r.subFsFileDescriptor];if(!o)throw new Error("Invalid file handle");return await o.fh.utimes(i,n)}async fstat(r,i){let n=this.openFh[r.subFsFileDescriptor];if(!n)throw new Error("Invalid file handle");return this.stat(n.path,i)}async ftruncate(r,i){let n=this.openFh[r.subFsFileDescriptor];if(!n)throw new Error("Invalid file handle");return await n.fh.truncate(i)}async stat(r,i){let n=r.toString(),o=Object.values(this.openFh).find(f=>f.path===n);if(o&&o.unflushed.length>0)return await o.fh.stat(i);let s=this.getRouteHandler(n);if(!s)throw new Error(`ENOENT: no such file or directory, stat '${n}'`);return await s.handler.getStats({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:s.params})}async lstat(r,i){return this.stat(r,i)}async readdir(r,i){let n=r.toString();if(!this.isLegitPath(n))return[".legit"];let o=this.getRouteHandler(n);if(!o)throw new Error(`ENOENT: no such file or directory, scandir '${n}'`);let s=await o?.handler.getFile({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:o.params});if(s){if(s.type!=="directory")throw new Error("not a folder");let l=o?.staticSiblings??[],f=s.content;return f&&!Array.isArray(s.content)&&(f=JSON.parse(s.content)),Array.from(new Set([...f,...l])).sort((u,h)=>u.localeCompare(h,void 0,{numeric:!0,sensitivity:"base"}))}return[]}async read(r,i,n,o,s){let l=r.subFsFileDescriptor,f=this.openFh[l];if(!f)throw new Error("Invalid file handle");if(f.unflushed.length===0){let c=this.getRouteHandler(f.path),u=await c.handler.getFile({cacheFs:this.memFs,filePath:f.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:c?.params});if(!u?.content)throw new Error("couldnt access content");if(u.type!=="file")throw new Error("not a file");let h=typeof u.content=="string"?Buffer.from(u.content):u.content,d=typeof s=="number"?s:0,p=Math.min(d+o,h.length),m=Math.max(0,p-d);return h.copy(i,n,d,d+m),{bytesRead:m,buffer:i}}return await f.fh.read(i,n,o,s)}async write(r,i,n,o,s){let l=this.openFh[r.subFsFileDescriptor];if(!l)throw new Error("Invalid file handle");let f=l.mode;if(!f.includes("w")&&!f.includes("a")&&!f.includes("+"))throw Object.assign(new Error("EBADF: bad file descriptor, write"),{code:"EBADF",errno:-9,syscall:"write"});if(l.unflushed.length===0){let d=this.getRouteHandler(l.path),p=await d.handler.getFile({cacheFs:this.memFs,filePath:l.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:d.params});p&&p.oid&&(await this.memFs.promises.writeFile(l.path,p.content),l.readSha=p.oid)}let c=await l.fh.write(i,n,o,s),u=n??0,h=s??0;return l.unflushed.push({start:h,length:o||i.byteLength-u+h}),c}async close(r){let i=r.subFsFileDescriptor;if(!this.openFh[i])throw new Error("Invalid file handle");await this.dataSync(r),delete this.openFh[i]}async dataSync(r){let i=r.subFsFileDescriptor,n=this.openFh[i];if(!n)throw new Error("Invalid file handle");if(n.unflushed.length>0){let o=this.getRouteHandler(n.path);if(o&&o.handler.writeFile){let s=await this.memFs.promises.readFile(n.path);await o.handler.writeFile({cacheFs:this.memFs,filePath:n.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,content:s,pathParams:o.params})}n.unflushed=[],await this.memFs.promises.writeFile(n.path,"")}}async readFile(r,i){let n=typeof r=="string"?r:Buffer.isBuffer(r)?r.toString():r.fd?`FileHandle(${r.fd})`:r.toString(),o=null;typeof i=="string"?o=i:i&&typeof i=="object"&&i.encoding&&(o=i.encoding);let s=await this.open(n,"r");try{let f=(await this.fstat(s)).size,c=Buffer.alloc(f);return await this.read(s,c,0,f,0),await this.close(s),o?c.toString(o):c}catch(l){try{await this.close(s)}catch{}throw l}}async writeFile(r,i,n){let o="w",s="utf8",l;typeof n=="string"?s=n:n&&typeof n=="object"&&(n.flag&&(o=String(n.flag)),n.encoding&&(s=n.encoding),n.mode&&(l=typeof n.mode=="string"?parseInt(n.mode,8):n.mode));let f=await this.open(r,o,l);try{let c;typeof i=="string"?c=Buffer.from(i,s):Buffer.isBuffer(i)?c=i:i instanceof Uint8Array?c=Buffer.from(i):ArrayBuffer.isView(i)?c=Buffer.from(i.buffer,i.byteOffset,i.byteLength):c=Buffer.from(i),await this.write(f,c,0,c.length,0)}finally{await this.close(f)}}async rename(r,i){let n=r.toString(),o=i.toString(),s=this.getRouteHandler(n),l=this.getRouteHandler(o);if(s?.handler.type==="gitBranchFileVirtualFile"&&l?.handler.type==="gitBranchFileVirtualFile"){let f=!0;try{await this.memFs.promises.access(o)}catch{f=!1}let c=!0;try{await this.stat(o)}catch{c=!1}let u=!0;try{await this.stat(n)}catch{u=!1}let h=!0;try{await this.memFs.promises.access(n)}catch{h=!1}if(h){let m=om.dirname(o);try{await this.memFs.promises.access(m)}catch{await this.memFs.promises.mkdir(m,{recursive:!0})}await this.memFs.promises.rename(r,i)}let d=this.getRouteHandler(n);if(!d)throw new Error("VF not found");let p=await d.handler.rename({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,newPath:o,pathParams:d?.params??{},newPathParams:l?.params??{}})}else throw new Error(`Unsupported rename operation from ${s?.handler.type} to ${l?.handler.type}`)}async fchmod(r,i){}async unlink(r){let i=r.toString(),n=this.getRouteHandler(i);if(n?.handler.unlink!==void 0){await n.handler.unlink({cacheFs:this.memFs,filePath:i,fs:this.compositFs,nodeFs:this.compositFs,gitRoot:this.gitRoot,pathParams:n.params});for(let[o,s]of Object.entries(this.openFh))s.path===i&&(await s.fh.close(),await this.memFs.promises.unlink(i),delete this.openFh[Number(o)])}else throw new Error(`Cannot unlink ${n?.handler.type} files`)}fileType(){return 10}};a(Er,"GitSubFs"),H(Er,"LEGIT_DIR",".legit"),H(Er,"pathRouter",new uf({".legit":{".":Bs,branches:{".":of,"[branchName]":{".legit":{".":Bs,operation:k1,head:af,operationHead:B1,operationHistory:nm,threadName:C1,history:N1},"[[...filePath]]":io}},commits:{".":rm,"[sha_1_1_2]":{".":rm,"[sha1_3__40]":{"[[...filePath]]":cf}}}}}));var df=Er;var mf=ae(Me(),1);var wf=ae(Fn(),1);async function Gq(){let t=new wf.Volume,e=(0,wf.createFsFromVolume)(t);return Y$(e,"/")}a(Gq,"initMemFSLegitFs");async function Y$(t,e){let r=!1;try{await t.promises.readdir(e+"/.git"),r=!0}catch{}if(r)throw new Error(`cant use initLegitFs on a folder with a git repo (${e}), use openLegitFs instead`);return await mf.default.init({fs:t,dir:"/",defaultBranch:"main"}),await t.promises.writeFile(e+"/.keep",""),await mf.default.add({fs:t,dir:"/",filepath:".keep"}),await mf.default.commit({fs:t,dir:"/",message:"Initial commit",author:{name:"Test",email:"test@example.com"}}),J$(t,e)}a(Y$,"initLegitFs");function J$(t,e){let r=new zo({name:"root",parentFs:void 0,storageFs:t,gitRoot:e}),i=new Go({parentFs:r,gitRoot:e,ephemeralPatterns:[]}),n=new Vo({parentFs:r,gitRoot:e,hiddenFiles:[]});r.setHiddenFilesSubFs(n),r.setEphemeralFilesSubFs(i);let o=new zo({name:"git",parentFs:r,storageFs:void 0,gitRoot:e}),s=new df({parentFs:r,gitRoot:e}),l=new Vo({parentFs:o,gitRoot:e,hiddenFiles:[".git"]}),f=new Go({parentFs:o,gitRoot:e,ephemeralPatterns:["**/._*","**/.DS_Store","**/.AppleDouble/","**/.AppleDB","**/.AppleDesktop","**/.Spotlight-V100","**/.TemporaryItems","**/.Trashes","**/.fseventsd","**/.VolumeIcon.icns","**/.ql_disablethumbnails","**/.~lock.*","**/lu[0-9a-zA-Z]*.tmp","**/.metaentries.json.tmp"]});return o.addSubFs(s),o.setHiddenFilesSubFs(l),o.setEphemeralFilesSubFs(f),o}a(J$,"openLegitFs");var Ot=ae(Me(),1);var gx=ae(yx(),1);function _M(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}a(_M,"fromValue");function FM(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:_M(t)}a(FM,"getIterator");async function bx(t,e){let r=FM(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}a(bx,"forAwait");function EM(t){let{PassThrough:e}=yf(),r=new e;return setTimeout(async()=>{await bx(t,i=>r.write(i)),r.end()},1),r}a(EM,"asyncIteratorToStream");async function SM(t){let e=0,r=[];await bx(t,o=>{r.push(o),e+=o.byteLength});let i=new Uint8Array(e),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}a(SM,"collect");function xM(t){let e=Object.getOwnPropertyDescriptor(t,Symbol.asyncIterator);if(e&&e.enumerable)return t;let r=!1,i=[],n={};return t.on("data",o=>{i.push(o),n.resolve&&(n.resolve({value:i.shift(),done:!1}),n={})}),t.on("error",o=>{n.reject&&(n.reject(o),n={})}),t.on("end",()=>{r=!0,n.resolve&&(n.resolve({done:!0}),n={})}),{next(){return new Promise((o,s)=>{if(i.length===0&&r)return o({done:!0});if(i.length>0)return o({value:i.shift(),done:!1});i.length===0&&!r&&(n={resolve:o,reject:s})})},return(){t.removeAllListeners(),t.destroy&&t.destroy()},[Symbol.asyncIterator](){return this}}}a(xM,"fromNodeStream");async function TM({onProgress:t,url:e,method:r="GET",headers:i={},agent:n,body:o}){return o&&Array.isArray(o)?o=Buffer.from(await SM(o)):o&&(o=EM(o)),new Promise((s,l)=>{(0,gx.default)({url:e,method:r,headers:i,agent:n,body:o},(f,c)=>{if(f)return l(f);try{let u=xM(c);s({url:c.url,method:c.method,statusCode:c.statusCode,statusMessage:c.statusMessage,body:u,headers:c.headers})}catch(u){l(u)}})})}a(TM,"request");var OM={request:TM},_f=OM;function RM(t){let e=/^git@([^:]+):(.+)$/,r=t.match(e);if(r){let i=r[1],n=r[2];return`https://${i}/${n}`}return t}a(RM,"normalizeRemoteUrl");var O3=a(({fs:t,gitRepoPath:e,originPrefix:r,corsProxy:i,user:n,password:o})=>{let s=!1,l,f;async function c(){let m=await Ot.default.fetch({fs:t,http:_f,dir:e,url:f,corsProxy:i,onAuth:a(()=>({username:n,password:o}),"onAuth")}),w="origin",y=await Ot.default.listBranches({fs:t,dir:e}),v=[];for(let g of y){let F=`${w}/${g}`,O,S;try{O=await Ot.default.resolveRef({fs:t,dir:e,ref:g})}catch(R){console.log(`Could not resolve local ref ${g}:`,R)}try{S=await Ot.default.resolveRef({fs:t,dir:e,ref:F})}catch{S=void 0}if(O&&S&&O!==S){let R=await Ot.default.findMergeBase({fs:t,dir:e,oids:[O,S]});if(R[0]!==O&&R[0]!==S){let b=await Ot.default.merge({fs:t,dir:e,ours:O,theirs:S,fastForwardOnly:!1,abortOnConflict:!1,author:{name:"Your Name",email:"your.email@example.com"},mergeDriver:a(async({branches:x,contents:_,path:P})=>{let[k,C,N]=_;return console.log(`Merging ${x[0]} with ${x[1]}...`),console.log("merged:"),console.log(_),{cleanMerge:!0,mergedText:N===void 0?C:N}},"mergeDriver")});await Ot.default.writeRef({fs:t,dir:e,ref:`refs/heads/${g}`,value:b.oid,force:!0})}R[0]===O?(console.log(`branch ${g} differs - remote ahaed, not behind`),await Ot.default.writeRef({fs:t,dir:e,ref:`refs/heads/${g}`,value:S,force:!0})):R[0]===S?(console.log(`branch ${g} differs - local ahead, not behind`),v.push(g)):(console.log(`branch ${g} differs - both changed`),v.push(g))}}v.length!==0&&await u(v)}a(c,"pull");async function u(m){for(let w of m)await Ot.default.push({fs:t,http:_f,dir:e,corsProxy:i,url:f,ref:w,onAuth:a(()=>({username:n,password:o}),"onAuth")})}a(u,"push");async function h(){let m=await Ot.default.getConfig({fs:t,dir:e,path:"remote.origin.url"});f=RM(m);try{await c()}catch(w){console.error("Error monitoring changes:",w)}finally{s&&setTimeout(h,1e3)}}a(h,"monitorChanges");function d(){s=!0,h()}a(d,"startPolling");function p(){s=!1}return a(p,"stopPolling"),{clone:a(async m=>Ot.default.clone({fs:t,http:_f,corsProxy:i,dir:e,url:m,onAuth:a(()=>({username:n,password:o}),"onAuth")}),"clone"),start:a(()=>{s||(d(),s=!0)},"start"),stop:a(()=>{p()},"stop")}},"createGitSyncService");var ym=ae(ni(),1);function vx(t){let e=t.name||"untitled";return{kind:"file",name:e,async getFile(){let i=(await t.stat()).size;console.log("reading data into buffer of size"+i);let n=ym.Buffer.alloc(i);await t.read(n,0,i,0);let o=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);console.log("buffer read",o);let s=o;return new File([s],e||"untitled")},async createWritable(){return{async write(r){console.log("writing data to handle",t);let i;if(typeof r=="string")i=ym.Buffer.from(r,"utf-8");else if(r instanceof Blob){let n=await r.arrayBuffer();i=new Uint8Array(n)}else if(ArrayBuffer.isView(r))i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);else throw console.log("data",r),new Error("Unsupported data type for write");await t.write(i),await t.sync(),console.log("write completed")},async close(){await t.close()}}}}}a(vx,"fileHandleToFileSystemFileHandle");async function kM(t){let e=await t.getFile();return e.handle=t,e}a(kM,"fileSystemFileHandleToFileWithHandle");async function P3(t){return{openFile:a(async e=>{let r=await t.promises.open(e,"w");return r.name=e,await kM(vx(r))},"openFile"),fileSave:a(async(e,r,i,n,o)=>{if(i)console.log("using existing handle",i);else{let f=window.prompt("Save as",r?.fileName??"untitled");if(console.log("result of prompt",f),!f)throw new Error("no file choosen");try{let c=await t.promises.open(`${f}`,"w");i=vx(c)}catch(c){throw console.error("Failed to open file in legitFs",c),new Error("Failed to open file in legitFs")}}let s=e instanceof Blob?e:await e;return await(await i.createWritable()).write(s),i},"fileSave")}}a(P3,"getLegitFsAccess");export{zo as CompositeFs,Go as EphemeralSubFs,df as GitSubFs,Vo as HiddenFileSubFs,Fl as PassThroughSubFs,O3 as createGitSyncService,P3 as getLegitFsAccess,nm as gitBranchOperationsVirtualFile,Y$ as initLegitFs,Gq as initMemFSLegitFs,J$ as openLegitFs};
|
|
103
|
+
`,"utf8");let c=l[l.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(f)})}a(u1,"_stashDrop");async function K$({fs:t,dir:e,gitdir:r}){return new Ni({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}a(K$,"_stashList");async function Z$({fs:t,dir:e,gitdir:r}){let i=new Ni({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await ro(n,async()=>{await Promise.all(n.map(async o=>{if(await t.exists(o))return t.rm(o)}))})}a(Z$,"_stashClear");async function X$({fs:t,dir:e,gitdir:r,refIdx:i=0}){await f1({fs:t,dir:e,gitdir:r,refIdx:i}),await u1({fs:t,dir:e,gitdir:r,refIdx:i})}a(X$,"_stashPop");async function h1({fs:t,dir:e,gitdir:r=C.join(e,".git"),op:i="push",message:n="",refIdx:o=0}){S("fs",t),S("dir",e),S("gitdir",r),S("op",i);let s={push:V$,apply:f1,drop:u1,list:K$,clear:Z$,pop:X$,create:G$},l=["apply","drop","pop"];try{let f=new M(t);["refs","logs","logs/refs"].map(h=>C.join(r,h)).forEach(async h=>{await f.exists(h)||await f.mkdir(h)});let u=s[i];if(u){if(l.includes(i)&&o<0)throw new Lt(`stash@${o}`,"number that is in range of [0, num of stash pushed]");return await u({fs:f,dir:e,gitdir:r,message:n,refIdx:o})}throw new Error(`To be implemented: ${i}`)}catch(f){throw f.caller="git.stash",f}}a(h1,"stash");async function d1({fs:t,dir:e,gitdir:r=C.join(e,".git"),filepath:i,cache:n={}}){try{S("fs",t),S("gitdir",r),S("filepath",i);let o=new M(t);if(await Qr.isIgnored({fs:o,gitdir:r,dir:e,filepath:i}))return"ignored";let l=await Y$({fs:o,cache:n,gitdir:r}),f=await p1({fs:o,cache:n,gitdir:r,tree:l,path:i}),c=await Fe.acquire({fs:o,gitdir:r,cache:n},async function(w){for(let y of w)if(y.path===i)return y;return null}),u=await o.lstat(C.join(e,i)),h=f!==null,d=c!==null,p=u!==null,m=a(async()=>{if(d&&!sc(c,u))return c.oid;{let w=await o.read(C.join(e,i)),y=await n1({gitdir:r,type:"blob",object:w});return d&&c.oid===y&&u.size!==-1&&Fe.acquire({fs:o,gitdir:r,cache:n},async function(v){v.insert({filepath:i,stats:u,oid:y})}),y}},"getWorkdirOid");if(!h&&!p&&!d)return"absent";if(!h&&!p&&d)return"*absent";if(!h&&p&&!d)return"*added";if(!h&&p&&d)return await m()===c.oid?"added":"*added";if(h&&!p&&!d)return"deleted";if(h&&!p&&d)return f===c.oid,"*deleted";if(h&&p&&!d)return await m()===f?"*undeleted":"*undeletemodified";if(h&&p&&d){let w=await m();return w===f?w===c.oid?"unmodified":"*unmodified":w===c.oid?"modified":"*modified"}}catch(o){throw o.caller="git.status",o}}a(d1,"status");async function p1({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let o=n.shift();for(let s of i)if(s.path===o){if(n.length===0)return s.oid;let{type:l,object:f}=await de({fs:t,cache:e,gitdir:r,oid:s.oid});if(l==="tree"){let c=it.from(f);return p1({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(l==="blob")throw new Xe(s.oid,l,"blob",n.join("/"))}return null}a(p1,"getOidAtPath");async function Y$({fs:t,cache:e,gitdir:r}){let i;try{i=await N.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(o){if(o instanceof fe)return[]}let{tree:n}=await no({fs:t,cache:e,gitdir:r,oid:i});return n}a(Y$,"getHeadTree");async function m1({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:o,cache:s={},ignored:l=!1}){try{S("fs",t),S("gitdir",r),S("ref",i);let f=new M(t);return await Jr({fs:f,cache:s,dir:e,gitdir:r,trees:[ht({ref:i}),io(),Bi()],map:a(async function(c,[u,h,d]){if(!u&&!d&&h&&!l&&await Qr.isIgnored({fs:f,dir:e,filepath:c})||!n.some(R=>tS(c,R)))return null;if(o&&!o(c))return;let[p,m,w]=await Promise.all([u&&u.type(),h&&h.type(),d&&d.type()]),y=[p,m,w].includes("blob");if((p==="tree"||p==="special")&&!y)return;if(p==="commit")return null;if((m==="tree"||m==="special")&&!y)return;if(w==="commit")return null;if((w==="tree"||w==="special")&&!y)return;let v=p==="blob"?await u.oid():void 0,g=w==="blob"?await d.oid():void 0,_;p!=="blob"&&m==="blob"&&w!=="blob"?_="42":m==="blob"&&(_=await h.oid());let E=[void 0,v,_,g],x=E.map(R=>E.indexOf(R));return x.shift(),[c,...x]},"map")})}catch(f){throw f.caller="git.statusMatrix",f}}a(m1,"statusMatrix");async function w1({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i,object:n,force:o=!1}){try{S("fs",t),S("gitdir",r),S("ref",i);let s=new M(t);if(i===void 0)throw new rt("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let l=await N.resolve({fs:s,gitdir:r,ref:n||"HEAD"});if(!o&&await N.exists({fs:s,gitdir:r,ref:i}))throw new Bt("tag",i);await N.writeRef({fs:s,gitdir:r,ref:i,value:l})}catch(s){throw s.caller="git.tag",s}}a(w1,"tag");async function y1({fs:t,dir:e,gitdir:r=C.join(e,".git"),cache:i={},filepath:n,oid:o,mode:s,add:l,remove:f,force:c}){try{S("fs",t),S("gitdir",r),S("filepath",n);let u=new M(t);if(f)return await Fe.acquire({fs:u,gitdir:r,cache:i},async function(d){if(!c){let p=await u.lstat(C.join(e,n));if(p){if(p.isDirectory())throw new Yr("directory");return}}d.has({filepath:n})&&d.delete({filepath:n})});let h;if(!o){if(h=await u.lstat(C.join(e,n)),!h)throw new fe(`file at "${n}" on disk and "remove" not set`);if(h.isDirectory())throw new Yr("directory")}return await Fe.acquire({fs:u,gitdir:r,cache:i},async function(d){if(!l&&!d.has({filepath:n}))throw new fe(`file at "${n}" in index and "add" not set`);let p;if(o)p={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:s,uid:0,gid:0,size:0};else{p=h;let m=p.isSymbolicLink()?await u.readlink(C.join(e,n)):await u.read(C.join(e,n));o=await ot({fs:u,gitdir:r,type:"blob",format:"content",object:m})}return d.insert({filepath:n,oid:o,stats:p}),o})}catch(u){throw u.caller="git.updateIndex",u}}a(y1,"updateIndex$1");function g1(){try{return of.version}catch(t){throw t.caller="git.version",t}}a(g1,"version");async function b1({fs:t,dir:e,gitdir:r=C.join(e,".git"),trees:i,map:n,reduce:o,iterate:s,cache:l={}}){try{return S("fs",t),S("gitdir",r),S("trees",i),await Jr({fs:new M(t),cache:l,dir:e,gitdir:r,trees:i,map:n,reduce:o,iterate:s})}catch(f){throw f.caller="git.walk",f}}a(b1,"walk");async function v1({fs:t,dir:e,gitdir:r=C.join(e,".git"),blob:i}){try{return S("fs",t),S("gitdir",r),S("blob",i),await ot({fs:new M(t),gitdir:r,type:"blob",object:i,format:"content"})}catch(n){throw n.caller="git.writeBlob",n}}a(v1,"writeBlob");async function _1({fs:t,dir:e,gitdir:r=C.join(e,".git"),commit:i}){try{return S("fs",t),S("gitdir",r),S("commit",i),await l1({fs:new M(t),gitdir:r,commit:i})}catch(n){throw n.caller="git.writeCommit",n}}a(_1,"writeCommit");async function F1({fs:t,dir:e,gitdir:r=C.join(e,".git"),type:i,object:n,format:o="parsed",oid:s,encoding:l=void 0}){try{let f=new M(t);if(o==="parsed"){switch(i){case"commit":n=nt.from(n).toObject();break;case"tree":n=it.from(n).toObject();break;case"blob":n=Buffer.from(n,l);break;case"tag":n=dt.from(n).toObject();break;default:throw new Xe(s||"",i,"blob|commit|tag|tree")}o="content"}return s=await ot({fs:f,gitdir:r,type:i,object:n,oid:s,format:o}),s}catch(f){throw f.caller="git.writeObject",f}}a(F1,"writeObject");async function E1({fs:t,dir:e,gitdir:r=C.join(e,".git"),ref:i,value:n,force:o=!1,symbolic:s=!1}){try{S("fs",t),S("gitdir",r),S("ref",i),S("value",n);let l=new M(t);if(!ws(i,!0))throw new Lt(i,ms.clean(i));if(!o&&await N.exists({fs:l,gitdir:r,ref:i}))throw new Bt("ref",i);s?await N.writeSymbolicRef({fs:l,gitdir:r,ref:i,value:n}):(n=await N.resolve({fs:l,gitdir:r,ref:n}),await N.writeRef({fs:l,gitdir:r,ref:i,value:n}))}catch(l){throw l.caller="git.writeRef",l}}a(E1,"writeRef");async function J$({fs:t,gitdir:e,tag:r}){let i=dt.from(r).toObject();return await ot({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}a(J$,"_writeTag");async function S1({fs:t,dir:e,gitdir:r=C.join(e,".git"),tag:i}){try{return S("fs",t),S("gitdir",r),S("tag",i),await J$({fs:new M(t),gitdir:r,tag:i})}catch(n){throw n.caller="git.writeTag",n}}a(S1,"writeTag");async function x1({fs:t,dir:e,gitdir:r=C.join(e,".git"),tree:i}){try{return S("fs",t),S("gitdir",r),S("tree",i),await Ns({fs:new M(t),gitdir:r,tree:i})}catch(n){throw n.caller="git.writeTree",n}}a(x1,"writeTree");var Q$={Errors:jE,STAGE:Bi,TREE:ht,WORKDIR:io,add:WE,abortMerge:HE,addNote:XE,addRemote:JE,annotatedTag:QE,branch:eS,checkout:Np,clone:sS,commit:aS,getConfig:FS,getConfigAll:ES,setConfig:a1,currentBranch:lS,deleteBranch:cS,deleteRef:fS,deleteRemote:uS,deleteTag:hS,expandOid:dS,expandRef:pS,fastForward:yS,fetch:gS,findMergeBase:bS,findRoot:_S,getRemoteInfo:SS,getRemoteInfo2:TS,hashBlob:OS,indexPack:kS,init:RS,isDescendent:AS,isIgnored:IS,listBranches:CS,listFiles:NS,listNotes:BS,listRefs:LS,listRemotes:$S,listServerRefs:MS,listTags:jS,log:HS,merge:qS,packObjects:WS,pull:VS,push:GS,readBlob:XS,readCommit:$p,readNote:YS,readObject:JS,readTag:QS,readTree:e1,remove:t1,removeNote:r1,renameBranch:i1,resetIndex:o1,updateIndex:y1,resolveRef:s1,status:d1,statusMatrix:m1,tag:w1,version:g1,walk:b1,writeBlob:v1,writeCommit:_1,writeObject:F1,writeRef:E1,writeTag:S1,writeTree:x1,stash:h1};L.Errors=jE;L.STAGE=Bi;L.TREE=ht;L.WORKDIR=io;L.abortMerge=HE;L.add=WE;L.addNote=XE;L.addRemote=JE;L.annotatedTag=QE;L.branch=eS;L.checkout=Np;L.clone=sS;L.commit=aS;L.currentBranch=lS;L.default=Q$;L.deleteBranch=cS;L.deleteRef=fS;L.deleteRemote=uS;L.deleteTag=hS;L.expandOid=dS;L.expandRef=pS;L.fastForward=yS;L.fetch=gS;L.findMergeBase=bS;L.findRoot=_S;L.getConfig=FS;L.getConfigAll=ES;L.getRemoteInfo=SS;L.getRemoteInfo2=TS;L.hashBlob=OS;L.indexPack=kS;L.init=RS;L.isDescendent=AS;L.isIgnored=IS;L.listBranches=CS;L.listFiles=NS;L.listNotes=BS;L.listRefs=LS;L.listRemotes=$S;L.listServerRefs=MS;L.listTags=jS;L.log=HS;L.merge=qS;L.packObjects=WS;L.pull=VS;L.push=GS;L.readBlob=XS;L.readCommit=$p;L.readNote=YS;L.readObject=JS;L.readTag=QS;L.readTree=e1;L.remove=t1;L.removeNote=r1;L.renameBranch=i1;L.resetIndex=o1;L.resolveRef=s1;L.setConfig=a1;L.stash=h1;L.status=d1;L.statusMatrix=m1;L.tag=w1;L.updateIndex=y1;L.version=g1;L.walk=b1;L.writeBlob=v1;L.writeCommit=_1;L.writeObject=F1;L.writeRef=E1;L.writeTag=S1;L.writeTree=x1});var j1=O((Gq,M1)=>{M1.exports=function(t,e){var r=[];t.on("data",function(i){r.push(i)}),t.once("end",function(){e&&e(null,Buffer.concat(r)),e=null}),t.once("error",function(i){e&&e(i),e=null})}});var U1=O(()=>{});var fm=O(Ot=>{Ot.fetch=Ms(globalThis.fetch)&&Ms(globalThis.ReadableStream);Ot.writableStream=Ms(globalThis.WritableStream);Ot.abortController=Ms(globalThis.AbortController);var ii;function lm(){if(ii!==void 0)return ii;if(globalThis.XMLHttpRequest){ii=new globalThis.XMLHttpRequest;try{ii.open("GET",globalThis.XDomainRequest?"/":"https://example.com")}catch{ii=null}}else ii=null;return ii}a(lm,"getXHR");function cm(t){var e=lm();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch{}return!1}a(cm,"checkTypeSupport");Ot.arraybuffer=Ot.fetch||cm("arraybuffer");Ot.msstream=!Ot.fetch&&cm("ms-stream");Ot.mozchunkedarraybuffer=!Ot.fetch&&cm("moz-chunked-arraybuffer");Ot.overrideMimeType=Ot.fetch||(lm()?Ms(lm().overrideMimeType):!1);function Ms(t){return typeof t=="function"}a(Ms,"isFunction");ii=null});var yf=O((kt,H1)=>{kt=H1.exports=Xa();kt.Stream=kt;kt.Readable=kt;kt.Writable=Ga();kt.Duplex=Br();kt.Transform=ol();kt.PassThrough=_h();kt.finished=$o();kt.pipeline=Eh()});var dm=O(hm=>{var q1=fm(),iM=Zt(),z1=yf(),gf=hm.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},um=hm.IncomingMessage=function(t,e,r,i){var n=this;if(z1.Readable.call(n),n._mode=r,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){process.nextTick(function(){n.emit("close")})}),r==="fetch"){let h=function(){s.read().then(function(d){if(!n._destroyed){if(i(d.done),d.done){n.push(null);return}n.push(Buffer.from(d.value)),h()}}).catch(function(d){i(!0),n._destroyed||n.emit("error",d)})};var u=h;if(a(h,"read"),n._fetchResponse=e,n.url=e.url,n.statusCode=e.status,n.statusMessage=e.statusText,e.headers.forEach(function(d,p){n.headers[p.toLowerCase()]=d,n.rawHeaders.push(p,d)}),q1.writableStream){var o=new WritableStream({write:a(function(d){return i(!1),new Promise(function(p,m){n._destroyed?m():n.push(Buffer.from(d))?p():n._resumeFetch=p})},"write"),close:a(function(){i(!0),n._destroyed||n.push(null)},"close"),abort:a(function(d){i(!0),n._destroyed||n.emit("error",d)},"abort")});try{e.body.pipeTo(o).catch(function(d){i(!0),n._destroyed||n.emit("error",d)});return}catch{}}var s=e.body.getReader();h()}else{n._xhr=t,n._pos=0,n.url=t.responseURL,n.statusCode=t.status,n.statusMessage=t.statusText;var l=t.getAllResponseHeaders().split(/\r?\n/);if(l.forEach(function(h){var d=h.match(/^([^:]+):\s*(.*)/);if(d){var p=d[1].toLowerCase();p==="set-cookie"?(n.headers[p]===void 0&&(n.headers[p]=[]),n.headers[p].push(d[2])):n.headers[p]!==void 0?n.headers[p]+=", "+d[2]:n.headers[p]=d[2],n.rawHeaders.push(d[1],d[2])}}),n._charset="x-user-defined",!q1.overrideMimeType){var f=n.rawHeaders["mime-type"];if(f){var c=f.match(/;\s*charset=([^;])(;|$)/);c&&(n._charset=c[1].toLowerCase())}n._charset||(n._charset="utf-8")}}};iM(um,z1.Readable);um.prototype._read=function(){var t=this,e=t._resumeFetch;e&&(t._resumeFetch=null,e())};um.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,i=null;switch(e._mode){case"text":if(i=r.responseText,i.length>e._pos){var n=i.substr(e._pos);if(e._charset==="x-user-defined"){for(var o=Buffer.alloc(n.length),s=0;s<n.length;s++)o[s]=n.charCodeAt(s)&255;e.push(o)}else e.push(n,e._charset);e._pos=i.length}break;case"arraybuffer":if(r.readyState!==gf.DONE||!r.response)break;i=r.response,e.push(Buffer.from(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=r.response,r.readyState!==gf.LOADING||!i)break;e.push(Buffer.from(new Uint8Array(i)));break;case"ms-stream":if(i=r.response,r.readyState!==gf.LOADING)break;var l=new globalThis.MSStreamReader;l.onprogress=function(){l.result.byteLength>e._pos&&(e.push(Buffer.from(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){t(!0),e.push(null)},l.readAsArrayBuffer(i);break}e._xhr.readyState===gf.DONE&&e._mode!=="ms-stream"&&(t(!0),e.push(null))}});var K1=O((e3,G1)=>{var ji=fm(),nM=Zt(),V1=dm(),pm=yf(),oM=V1.IncomingMessage,W1=V1.readyStates;function sM(t,e){return ji.fetch&&e?"fetch":ji.mozchunkedarraybuffer?"moz-chunked-arraybuffer":ji.msstream?"ms-stream":ji.arraybuffer&&t?"arraybuffer":"text"}a(sM,"decideMode");var We=G1.exports=function(t){var e=this;pm.Writable.call(e),e._opts=t,e._body=[],e._headers={},t.auth&&e.setHeader("Authorization","Basic "+Buffer.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(n){e.setHeader(n,t.headers[n])});var r,i=!0;if(t.mode==="disable-fetch"||"requestTimeout"in t&&!ji.abortController)i=!1,r=!0;else if(t.mode==="prefer-streaming")r=!1;else if(t.mode==="allow-wrong-content-type")r=!ji.overrideMimeType;else if(!t.mode||t.mode==="default"||t.mode==="prefer-fast")r=!0;else throw new Error("Invalid value for opts.mode");e._mode=sM(r,i),e._fetchTimer=null,e._socketTimeout=null,e._socketTimer=null,e.on("finish",function(){e._onFinish()})};nM(We,pm.Writable);We.prototype.setHeader=function(t,e){var r=this,i=t.toLowerCase();lM.indexOf(i)===-1&&(r._headers[i]={name:t,value:e})};We.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null};We.prototype.removeHeader=function(t){var e=this;delete e._headers[t.toLowerCase()]};We.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&e.timeout!==0&&t.setTimeout(e.timeout);var r=t._headers,i=null;e.method!=="GET"&&e.method!=="HEAD"&&(i=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var n=[];if(Object.keys(r).forEach(function(f){var c=r[f].name,u=r[f].value;Array.isArray(u)?u.forEach(function(h){n.push([c,h])}):n.push([c,u])}),t._mode==="fetch"){var o=null;if(ji.abortController){var s=new AbortController;o=s.signal,t._fetchAbortController=s,"requestTimeout"in e&&e.requestTimeout!==0&&(t._fetchTimer=globalThis.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))}globalThis.fetch(t._opts.url,{method:t._opts.method,headers:n,body:i||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:o}).then(function(f){t._fetchResponse=f,t._resetTimers(!1),t._connect()},function(f){t._resetTimers(!0),t._destroyed||t.emit("error",f)})}else{var l=t._xhr=new globalThis.XMLHttpRequest;try{l.open(t._opts.method,t._opts.url,!0)}catch(f){process.nextTick(function(){t.emit("error",f)});return}"responseType"in l&&(l.responseType=t._mode),"withCredentials"in l&&(l.withCredentials=!!e.withCredentials),t._mode==="text"&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(l.timeout=e.requestTimeout,l.ontimeout=function(){t.emit("requestTimeout")}),n.forEach(function(f){l.setRequestHeader(f[0],f[1])}),t._response=null,l.onreadystatechange=function(){switch(l.readyState){case W1.LOADING:case W1.DONE:t._onXHRProgress();break}},t._mode==="moz-chunked-arraybuffer"&&(l.onprogress=function(){t._onXHRProgress()}),l.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{l.send(i)}catch(f){process.nextTick(function(){t.emit("error",f)});return}}}};function aM(t){try{var e=t.status;return e!==null&&e!==0}catch{return!1}}a(aM,"statusValid");We.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),!(!aM(t._xhr)||t._destroyed)&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))};We.prototype._connect=function(){var t=this;t._destroyed||(t._response=new oM(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))};We.prototype._write=function(t,e,r){var i=this;i._body.push(t),r()};We.prototype._resetTimers=function(t){var e=this;globalThis.clearTimeout(e._socketTimer),e._socketTimer=null,t?(globalThis.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=globalThis.setTimeout(function(){e.emit("timeout")},e._socketTimeout))};We.prototype.abort=We.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)};We.prototype.end=function(t,e,r){var i=this;typeof t=="function"&&(r=t,t=void 0),pm.Writable.prototype.end.call(i,t,e,r)};We.prototype.setTimeout=function(t,e){var r=this;e&&r.once("timeout",e),r._socketTimeout=t,r._resetTimers(!1)};We.prototype.flushHeaders=function(){};We.prototype.setNoDelay=function(){};We.prototype.setSocketKeepAlive=function(){};var lM=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]});var X1=O((r3,Z1)=>{Z1.exports=fM;var cM=Object.prototype.hasOwnProperty;function fM(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)cM.call(r,i)&&(t[i]=r[i])}return t}a(fM,"extend")});var J1=O((n3,Y1)=>{Y1.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}});var mm=O(ex=>{var Q1=K1(),uM=dm(),hM=X1(),dM=J1(),pM=Po(),Mt=ex;Mt.request=function(t,e){typeof t=="string"?t=pM.parse(t):t=hM(t);var r=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",i=t.protocol||r,n=t.hostname||t.host,o=t.port,s=t.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),t.url=(n?i+"//"+n:"")+(o?":"+o:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var l=new Q1(t);return e&&l.on("response",e),l};Mt.get=a(function(e,r){var i=Mt.request(e,r);return i.end(),i},"get");Mt.ClientRequest=Q1;Mt.IncomingMessage=uM.IncomingMessage;Mt.Agent=function(){};Mt.Agent.defaultMaxSockets=4;Mt.globalAgent=new Mt.Agent;Mt.STATUS_CODES=dM;Mt.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]});var ix=O((a3,rx)=>{var js=mm(),mM=Po(),wm=rx.exports;for(bf in js)js.hasOwnProperty(bf)&&(wm[bf]=js[bf]);var bf;wm.request=function(t,e){return t=tx(t),js.request.call(this,t,e)};wm.get=function(t,e){return t=tx(t),js.get.call(this,t,e)};function tx(t){if(typeof t=="string"&&(t=mM.parse(t)),t.protocol||(t.protocol="https:"),t.protocol!=="https:")throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}a(tx,"validateParams")});var sx=O((c3,ox)=>{ox.exports=nx;function nx(t,e){if(t&&e)return nx(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=t.apply(this,i),s=i[i.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(l){o[l]=s[l]}),o}a(r,"wrapper")}a(nx,"wrappy")});var cx=O((u3,ym)=>{var ax=sx();ym.exports=ax(vf);ym.exports.strict=ax(lx);vf.proto=vf(function(){Object.defineProperty(Function.prototype,"once",{value:a(function(){return vf(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:a(function(){return lx(this)},"value"),configurable:!0})});function vf(t){var e=a(function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))},"f");return e.called=!1,e}a(vf,"once");function lx(t){var e=a(function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},"f"),r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}a(lx,"onceStrict")});var ux=O((d3,fx)=>{"use strict";function wM(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(wM,"hasOwnProperty");fx.exports=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if(typeof t!="string"||t.length===0)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&typeof i.maxKeys=="number"&&(s=i.maxKeys);var l=t.length;s>0&&l>s&&(l=s);for(var f=0;f<l;++f){var c=t[f].replace(o,"%20"),u=c.indexOf(r),h,d,p,m;u>=0?(h=c.substr(0,u),d=c.substr(u+1)):(h=c,d=""),p=decodeURIComponent(h),m=decodeURIComponent(d),wM(n,p)?yM(n[p])?n[p].push(m):n[p]=[n[p],m]:n[p]=m}return n};var yM=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}});var px=O((m3,dx)=>{"use strict";var Us=a(function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},"stringifyPrimitive");dx.exports=function(t,e,r,i){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?hx(bM(t),function(n){var o=encodeURIComponent(Us(n))+r;return gM(t[n])?hx(t[n],function(s){return o+encodeURIComponent(Us(s))}).join(e):o+encodeURIComponent(Us(t[n]))}).join(e):i?encodeURIComponent(Us(i))+r+encodeURIComponent(Us(t)):""};var gM=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function hx(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}a(hx,"map");var bM=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}});var mx=O(Hs=>{"use strict";Hs.decode=Hs.parse=ux();Hs.encode=Hs.stringify=px()});var bx=O((g3,gx)=>{gx.exports=ao;var vM=j1(),wx=U1(),_M=mm(),FM=ix(),EM=cx(),SM=mx(),yx=Po(),gm=a(t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function","isStream");function ao(t,e){if(t=Object.assign({maxRedirects:10},typeof t=="string"?{url:t}:t),e=EM(e),t.url){let{hostname:l,port:f,protocol:c,auth:u,path:h}=yx.parse(t.url);delete t.url,!l&&!f&&!c&&!u?t.path=h:Object.assign(t,{hostname:l,port:f,protocol:c,auth:u,path:h})}let r={"accept-encoding":"gzip, deflate"};t.headers&&Object.keys(t.headers).forEach(l=>r[l.toLowerCase()]=t.headers[l]),t.headers=r;let i;t.body?i=t.json&&!gm(t.body)?JSON.stringify(t.body):t.body:t.form&&(i=typeof t.form=="string"?t.form:SM.stringify(t.form),t.headers["content-type"]="application/x-www-form-urlencoded"),i&&(t.method||(t.method="POST"),gm(i)||(t.headers["content-length"]=Buffer.byteLength(i)),t.json&&!t.form&&(t.headers["content-type"]="application/json")),delete t.body,delete t.form,t.json&&(t.headers.accept="application/json"),t.method&&(t.method=t.method.toUpperCase());let n=t.hostname,s=(t.protocol==="https:"?FM:_M).request(t,l=>{if(t.followRedirects!==!1&&l.statusCode>=300&&l.statusCode<400&&l.headers.location){t.url=l.headers.location,delete t.headers.host,l.resume();let c=yx.parse(t.url).hostname;return c!==null&&c!==n&&(delete t.headers.cookie,delete t.headers.authorization),t.method==="POST"&&[301,302].includes(l.statusCode)&&(t.method="GET",delete t.headers["content-length"],delete t.headers["content-type"]),t.maxRedirects--===0?e(new Error("too many redirects")):ao(t,e)}let f=typeof wx=="function"&&t.method!=="HEAD";e(null,f?wx(l):l)});return s.on("timeout",()=>{s.abort(),e(new Error("Request timed out"))}),s.on("error",e),gm(i)?i.on("error",e).pipe(s):s.end(i),s}a(ao,"simpleGet");ao.concat=(t,e)=>ao(t,(r,i)=>{if(r)return e(r);vM(i,(n,o)=>{if(n)return e(n);if(t.json)try{o=JSON.parse(o.toString())}catch(s){return e(s,i,o)}e(null,i,o)})});["get","post","put","patch","head","delete"].forEach(t=>{ao[t]=(e,r)=>(typeof e=="string"&&(e={url:e}),ao(Object.assign({method:t.toUpperCase()},e),r))})});var Zh=oe(Tr(),1);var xf=class xf{constructor(e,r){H(this,"entries",[]);H(this,"currentIndex",0);H(this,"closed",!1);H(this,"compositFs");H(this,"dirPath");H(this,"initialized",!1);this.compositFs=e,this.dirPath=r}async initialize(){if(this.initialized)return;let e=new Set;for(let r of[...this.compositFs.subFilesystems].reverse()){let i=await r.readdir(this.dirPath);for(let n of i)e.add(n)}for(let r of Array.from(e)){let i=this.dirPath+"/"+r;await this.compositFs.hiddenFilesFileSystem?.responsible(i)||this.entries.push({name:r,path:i})}this.initialized=!0}async*[Symbol.asyncIterator](){for(await this.initialize();this.currentIndex<this.entries.length&&!this.closed;){let e=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(e.path);yield{name:e.name,isFile:a(()=>r.isFile(),"isFile"),isDirectory:a(()=>r.isDirectory(),"isDirectory"),isBlockDevice:a(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:a(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:a(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:a(()=>r.isFIFO(),"isFIFO"),isSocket:a(()=>r.isSocket(),"isSocket")}}catch(r){console.debug(`Failed to stat ${e.path}:`,r)}}}async read(){if(this.closed)throw new Error("Directory handle is closed");if(await this.initialize(),this.currentIndex>=this.entries.length)return null;let e=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(e.path);return{name:e.name,isFile:a(()=>r.isFile(),"isFile"),isDirectory:a(()=>r.isDirectory(),"isDirectory"),isBlockDevice:a(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:a(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:a(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:a(()=>r.isFIFO(),"isFIFO"),isSocket:a(()=>r.isSocket(),"isSocket")}}catch{return this.read()}}async close(){this.closed=!0,this.entries=[]}get path(){return this.dirPath}};a(xf,"CompositeFsDir");var qi=xf;var Tf=class Tf{constructor(e){H(this,"delegate");H(this,"compositeFs");H(this,"_subFsFileDescriptor");H(this,"handleType","file");H(this,"_compositFsFileDescriptor",-1);this.delegate=e.fs,this._subFsFileDescriptor=e.subFsFileDescriptor,this._compositFsFileDescriptor=-1,this.compositeFs=e.compositeFs;let r=this._subFsFileDescriptor}get fsType(){return this.delegate.fileType()}get subFsFileDescriptor(){return this._subFsFileDescriptor}get fd(){return this._compositFsFileDescriptor}realize(e){if(this._compositFsFileDescriptor!==-1)throw new Error("was already realized");this._compositFsFileDescriptor=e}readableWebStream(e){throw new Error("Method not implemented.")}async appendFile(e,r){return await this.delegate.appendFile(this,e,r)}async chmod(e){return this.delegate.fchmod(this,e)}async chown(e,r){return this.delegate.fchown(this,e,r)}async close(){return this.compositeFs.close(this)}async datasync(){return this.delegate.dataSync(this)}async read(e,r,i,n){return await this.delegate.read(this,e,r,i,n)}readv(e,r){return this.delegate.readv(this,e,r)}async stat(e){return this.delegate.fstat(this,e)}async truncate(e){return this.delegate.ftruncate(this,e)}async utimes(e,r){return this.delegate.futimes(this,e,r)}async write(e,r,i,n){return this.delegate.write(this,e,r,i,n)}async writev(e,r){return this.delegate.writev(this,e,r)}async sync(){return this.delegate.dataSync(this)}};a(Tf,"CompositFsFileHandle");var Pt=Tf;var Hb=oe(Tr(),1),xl=oe(xn(),1);var Vh=class Vh{constructor({parentFs:e,gitRoot:r}){H(this,"compositFs");H(this,"gitRoot");this.compositFs=e,this.gitRoot=r}toStr(e){return typeof e=="string"?e:Buffer.isBuffer(e)?e.toString():e&&typeof e=="object"&&"fd"in e?`FileHandle(fd=${e.fd})`:String(e)}async open(e,r,i){throw new Error(`open not implemented for: ${this.toStr(e)}`)}async access(e,r){throw new Error(`access not implemented for: ${this.toStr(e)}`)}async stat(e,r){throw new Error(`lstat not implemented for: ${this.toStr(e)}`)}async lstat(e,r){throw new Error(`lstat not implemented for: ${this.toStr(e)}`)}async opendir(e,r){throw new Error(`opendir not implemented for: ${this.toStr(e)}`)}async link(e,r){throw new Error(`link not implemented for: ${this.toStr(e)}`)}async mkdir(e,r){throw new Error(`mkdir not implemented for: ${this.toStr(e)}`)}async readdir(e,r){throw new Error(`readdir not implemented for: ${this.toStr(e)}`)}async readlink(e,...r){throw new Error(`readlink not implemented for: ${this.toStr(e)}`)}async unlink(e){throw new Error(`unlink not implemented for: ${this.toStr(e)}`)}async rename(e,r){throw new Error(`rename not implemented for: ${this.toStr(e)}`)}async rmdir(e,...r){throw new Error(`rmdir not implemented for: ${this.toStr(e)}`)}async symlink(e,r,i){throw new Error(`symlink not implemented for: ${this.toStr(r)}`)}async lookup(e){throw new Error(`lookup not implemented for: ${this.toStr(e)}`)}resolvePath(e){throw new Error(`resolvePath not implemented for fd: ${e}`)}async close(e){this.compositFs.close(e)}async dataSync(e){throw new Error(`dataSync not implemented for: ${e.subFsFileDescriptor}`)}async read(e,r,i,n,o){throw new Error(`read not implemented for: ${e.subFsFileDescriptor}`)}async appendFile(e,r,i){throw new Error(`appendFile not implemented for: ${e.subFsFileDescriptor}`)}async fchmod(e,r){throw new Error(`fchmod not implemented for: ${e.subFsFileDescriptor}`)}async fchown(e,r,i){throw new Error(`fchown not implemented for: ${e.subFsFileDescriptor}`)}async ftruncate(e,r){throw new Error(`ftruncate not implemented for: ${e.subFsFileDescriptor}`)}async fstat(e,r){throw new Error(`fstat not implemented for: ${e.subFsFileDescriptor}`)}async futimes(e,r,i){throw new Error(`futimes not implemented for: ${e.subFsFileDescriptor}`)}async write(e,r,i,n,o){throw new Error(`write not implemented for: ${e.subFsFileDescriptor}`)}async writev(e,r,i){throw new Error(`writev not implemented for: ${e.subFsFileDescriptor}`)}async readv(e,r,i){throw new Error(`readv not implemented for: ${e.subFsFileDescriptor}`)}async readFile(e,r){throw new Error(`readFile not implemented for: ${this.toStr(e)}`)}async writeFile(e,r,i){throw new Error(`writeFile not implemented for: ${this.toStr(e)}`)}};a(Vh,"BaseCompositeSubFs");var Ft=Vh;var Gh=class Gh extends Ft{constructor({parentFs:r,gitRoot:i}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,xl.createFsFromVolume)(new xl.Volume));H(this,"targetFs");if(this.compositFs=r,this.gitRoot=i,this.compositFs.parentFs===void 0)throw new Error("PassThroughSubFs not allowed in root fs");this.targetFs=this.compositFs.parentFs}async responsible(r){return!0}fileType(){return 4}async open(r,i,n){let o=Hb.dirname(r),s=await this.targetFs.promises.open(r,i,n);return this.openFh.set(s.fd,s),new Pt({fs:this,compositeFs:this.compositFs,subFsFileDescriptor:s.fd,parentFsFileDescriptors:[s.fd]})}async access(r,i){return await this.targetFs.promises.access(r,i)}async stat(r,i){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,i){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,i){return await this.targetFs.promises.opendir(r,i)}async link(r,i){return await this.targetFs.promises.link(r,i)}async mkdir(r,i){let n=typeof r=="string"?r:r.toString();return await this.targetFs.promises.mkdir(n,i)}async readdir(r,...i){return this.targetFs.promises.readdir(r,...i)}async readlink(r,...i){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,i){return await this.targetFs.promises.rename(r,i)}async rmdir(r,i){return await this.targetFs.promises.rmdir(r,i)}async symlink(r,i,n){return await this.targetFs.promises.symlink(r,i,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.sync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){return typeof r=="string"||Buffer.isBuffer(r)?this.targetFs.readFile(r.toString(),i):super.readFile(r,i)}async writeFile(r,i,n){let o=typeof n=="object"&&n.flag?n.flag:"w",s=await this.targetFs.open(r,o);try{let l;if(typeof i=="string"){let f=typeof n=="object"&&n.encoding?n.encoding:"utf8";l=Buffer.from(i,f)}else Buffer.isBuffer(i)?l=i:l=Buffer.from(i);await s.write(l,0,l.length,0)}finally{await this.targetFs.close(s)}}};a(Gh,"PassThroughSubFs");var Sl=Gh;var qb=oe(Tr(),1),Ol=oe(xn(),1);var Kh=class Kh extends Ft{constructor({parentFs:r,gitRoot:i,passThroughFs:n}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,Ol.createFsFromVolume)(new Ol.Volume));H(this,"targetFs");this.compositFs=r,this.gitRoot=i,this.targetFs=n}async responsible(r){return!0}fileType(){return 4}async open(r,i,n){let o=qb.dirname(r),s=await this.targetFs.promises.open(r,i,n);return this.openFh.set(s.fd,s),new Pt({fs:this,compositeFs:this.compositFs,subFsFileDescriptor:s.fd,parentFsFileDescriptors:[]})}async access(r,i){return await this.targetFs.promises.access(r,i)}async stat(r,...i){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,...i){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,i){let n=await this.targetFs.promises.opendir(r,i);return new qi(this.compositFs,r.toString())}async link(r,i){return await this.targetFs.promises.link(r,i)}async mkdir(r,i){await this.targetFs.promises.mkdir(r,i)}async readdir(r,...i){return this.targetFs.promises.readdir(r,...i)}async readlink(r,...i){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,i){return await this.targetFs.promises.rename(r,i)}async rmdir(r,i){return await this.targetFs.promises.rmdir(r,i)}async symlink(r,i,n){return await this.targetFs.promises.symlink(r,i,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(this.openFh.delete(r.subFsFileDescriptor),await i.close())}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.sync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){return this.targetFs.promises.readFile(r,i)}async writeFile(r,i,n){return this.targetFs.promises.writeFile(r,i,n)}};a(Kh,"PassThroughToAsyncFsSubFs");var Tl=Kh;var Xh=class Xh{constructor({name:e,parentFs:r,storageFs:i,gitRoot:n,defaultBranch:o="main"}){H(this,"promises");H(this,"gitRoot");H(this,"ephemeralFilesFileSystem");H(this,"hiddenFilesFileSystem");H(this,"passThroughFileSystem");H(this,"subFilesystems",[]);H(this,"parentFs");H(this,"name");H(this,"defaultBranch");H(this,"pathToFileDescriptors",new Map);H(this,"openFileHandles",new Map);if(this.name=e,this.parentFs=r,this.gitRoot=n,this.defaultBranch=o,this.promises={access:this.access.bind(this),opendir:this.opendir.bind(this),mkdir:this.mkdir.bind(this),readdir:this.readdir.bind(this),open:this.open.bind(this),stat:this.stat.bind(this),lstat:this.lstat.bind(this),link:this.link.bind(this),readlink:this.readlink.bind(this),unlink:this.unlink.bind(this),rename:this.rename.bind(this),rmdir:this.rmdir.bind(this),symlink:this.symlink.bind(this),readFile:this.readFile.bind(this),writeFile:this.writeFile.bind(this),getFilehandle:this.getFilehandle.bind(this)},!r&&i){this.passThroughFileSystem=new Tl({passThroughFs:i,gitRoot:n,parentFs:this});return}if(!i&&r){this.passThroughFileSystem=new Sl({parentFs:this,gitRoot:n});return}throw new Error("invalid configuration")}getNextFileDescriptor(){let e=Array.from(this.openFileHandles.keys());return e.length===0?1:Math.max(...e)+1}getFilehandle(e){return this.openFileHandles.get(e)}setEphemeralFilesSubFs(e){this.ephemeralFilesFileSystem=e}setHiddenFilesSubFs(e){this.hiddenFilesFileSystem=e}addSubFs(e){this.subFilesystems.push(e)}async getResponsibleFs(e){if(!e.toString().startsWith(this.gitRoot)&&this.gitRoot!=="./")throw new Error("tried to access a file ("+e+") outside of the legit folder: "+this.gitRoot);if(!this.hiddenFilesFileSystem)throw new Error(this.name+" intialize hidden fs first!");if(!this.ephemeralFilesFileSystem)throw new Error(this.name+" intialize ephemeral fs first!");if(await this.hiddenFilesFileSystem.responsible(e.toString()))return this.hiddenFilesFileSystem;if(await this.ephemeralFilesFileSystem.responsible(e.toString()))return this.ephemeralFilesFileSystem;for(let r of this.subFilesystems)if(await r.responsible(e.toString()))return r;return this.passThroughFileSystem}async access(e,r){return(await this.getResponsibleFs(e)).access(e,r)}async opendir(e,r){let i=e.toString();if(!i.startsWith(this.gitRoot))throw new Error("tried to access a directory ("+i+") outside of the legit folder: "+this.gitRoot);return new qi(this,i)}async mkdir(e,r){return(await this.getResponsibleFs(e)).mkdir(e,r)}async readdir(e,r){let i=new Set;for(let n of[...this.subFilesystems].reverse()){let o=await n.readdir(e,r);for(let s of o)await this.ephemeralFilesFileSystem?.responsible((e=="/"?"":e)+"/"+s)||i.add(s)}try{let n=await this.passThroughFileSystem.readdir(e,r);for(let o of n)await this.ephemeralFilesFileSystem?.responsible((e=="/"?"":e)+"/"+o)||i.add(o)}catch(n){if(n.code!=="ENOENT")throw new Error("error reading ephemeral fs: "+n)}try{let n=await this.ephemeralFilesFileSystem.readdir(e,r);for(let o of n)i.add(o)}catch(n){if(n.code!=="ENOENT")throw new Error("error reading ephemeral fs: "+n)}for(let n of i){let o=(e=="/"?"":e)+"/"+n;await this.hiddenFilesFileSystem.responsible(o)&&i.delete(n)}return Array.from(i)}async open(e,r,i){let o=await(await this.getResponsibleFs(e)).open(e,r,i),s=this.getNextFileDescriptor();return o.realize(s),this.openFileHandles.set(s,o),this.pathToFileDescriptors.get(e)||this.pathToFileDescriptors.set(e,[]),this.pathToFileDescriptors.get(e).push(s),o}async close(e){try{await e.delegate.close(e)}catch(r){throw r}finally{for(let[r,i]of this.pathToFileDescriptors.entries()){let n=i.indexOf(e.fd);if(n!==-1){i.splice(n,1),i.length===0&&this.pathToFileDescriptors.delete(r);break}}this.openFileHandles.delete(e.fd)}}async stat(e,r){let i=e.toString();return(await this.getResponsibleFs(e)).stat(e)}async lstat(e,r){return(await this.getResponsibleFs(e)).lstat(e,r)}async link(e,r){throw new Error("not implemented")}async readlink(e,r){throw new Error("not implemented")}async unlink(e){return(await this.getResponsibleFs(e)).unlink(e)}async rename(e,r){if(this.hiddenFilesFileSystem){if(await this.hiddenFilesFileSystem.responsible(Zh.basename(e.toString())))throw new Error("Renaming of hidden Files is not allowed "+e);if(await this.hiddenFilesFileSystem.responsible(Zh.basename(r.toString())))throw new Error("Renaming to hidden Files is not allowed "+r)}let i=await this.getResponsibleFs(e),n=await this.getResponsibleFs(r);if(i===n)return i.rename(e,r);let o=await i.open(e.toString(),"r");try{let s=await i.fstat(o),l=Buffer.alloc(s.size);await i.read(o,l,0,s.size,0),await i.close(o),await n.writeFile(r.toString(),l,"utf8"),await i.unlink(e)}catch(s){try{await i.close(o)}catch{}throw s}}async rmdir(e,r){return(await this.getResponsibleFs(e)).rmdir(e,r)}async symlink(e,r,i){throw new Error("not implemented")}async readFile(e,r){let i=!0,n;if(typeof e=="number"){i=!1;let o=this.getFilehandle(e);if(!o)throw new Error("Invalid file descriptor");n=o}else if(typeof e=="string")n=await this.open(e,"r");else throw new Error("only filehandle and path are supported atm");try{let s=(await n.stat()).size;if(typeof s=="bigint"){if(s>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("File too large to read into buffer");s=Number(s)}let l=Buffer.alloc(s),{bytesRead:f}=await n.read(l,0,s,0);if(r&&typeof r.encoding=="string")return l.slice(0,f).toString(r.encoding);if(typeof r=="string"){if(r==="utf8"||r==="utf-8")return l.slice(0,f).toString(r);throw new Error("Unsupported encoding: "+r)}return l.slice(0,f)}finally{n&&i&&await n.close()}}async writeFile(e,r,i){let n=typeof e!="number",o,s,l,f="w";if(typeof i=="string"?s=i:i&&typeof i=="object"&&(s=i.encoding,l=i.mode,f=i.flag||"w"),typeof e=="number"){let c=this.getFilehandle(e);if(!c)throw new Error("Invalid file descriptor");o=c}else if(typeof e=="string")o=await this.open(e,f,l);else throw new Error("only filehandle and path are supported atm");try{let c;if(typeof r=="string")c=Buffer.from(r,s||"utf8");else if(r instanceof Buffer)c=r;else if(r instanceof Uint8Array)c=Buffer.from(r);else throw new Error("Invalid data type for writeFile");let u=0;for(;u<c.length;){let{bytesWritten:h}=await o.write(c,u,c.length-u,u);u+=h}}finally{o&&n&&await o.close()}}};a(Xh,"CompositeFs");var Wo=Xh;var Jb=oe(sd(),1);var ad=class ad extends Ft{constructor({parentFs:r,gitRoot:i,hiddenFiles:n}){super({parentFs:r,gitRoot:i});H(this,"ig");this.ig=(0,Jb.default)(),this.ig.add(n)}async responsible(r){let i=r.replace(/\\/g,"/"),n=i.startsWith("./")?i.slice(2):i;return n=n.startsWith("/")?n.slice(1):n,n===""||n==="."?!1:this.ig.ignores(n)}fileType(){return 255}error(r){return new Error(`Access to hidden file is not allowed: ${this.toStr(r)}`)}async open(r,i,n){throw this.error(r)}async access(r){throw this.error(r)}async stat(r){throw this.error(r)}async lstat(r){throw this.error(r)}async opendir(r){throw this.error(r)}async link(r){throw this.error(r)}async mkdir(r){throw this.error(r)}async readdir(r){throw this.error(r)}async readlink(r){throw this.error(r)}async unlink(r){throw this.error(r)}async rename(r){throw this.error(r)}async rmdir(r){throw this.error(r)}async symlink(r,i){throw this.error(i)}async lookup(r){throw this.error(r)}resolvePath(r){throw new Error(`Access to hidden file is not allowed: resolvePath(${r})`)}async close(r){throw new Error("Access to hidden file is not allowed: close: "+r.subFsFileDescriptor)}async dataSync(r){throw new Error("Access to hidden file is not allowed: dataSync: "+r.subFsFileDescriptor)}async read(r,i,n,o,s){throw new Error("Access to hidden file is not allowed: readFileHandle: "+r.subFsFileDescriptor)}};a(ad,"HiddenFileSubFs");var Go=ad;var Al=oe(Tr(),1),Il=oe(xn(),1);var Qb=oe(sd(),1);var ld=class ld extends Ft{constructor({parentFs:r,gitRoot:i,ephemeralPatterns:n}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,Il.createFsFromVolume)(new Il.Volume));H(this,"ig");H(this,"patterns");this.compositFs=r,this.gitRoot=i,this.ig=(0,Qb.default)(),this.ig.add(n),this.patterns=n}normalizePath(r){let i=typeof r=="string"?r:r.toString();return i.startsWith("/")?i:"/"+i}async responsible(r){let i=r.replace(/\\/g,"/"),n=i.startsWith("./")?i.slice(2):i;return n=n.startsWith("/")?n.slice(1):n,n===""||n==="."?!1:this.ig.ignores(n)}fileType(){return 5}async open(r,i,n){let o=this.normalizePath(r),s=Al.dirname(o);s&&s!=="/"&&s!=="."&&await this.memFs.promises.mkdir(s,{recursive:!0});let l=await this.memFs.promises.open(o,i,n);return this.openFh.set(l.fd,l),new Pt({fs:this,compositeFs:this.compositFs,subFsFileDescriptor:l.fd,parentFsFileDescriptors:[l.fd]})}async access(r,i){let n=this.normalizePath(r);return await this.memFs.promises.access(n,i)}async stat(r,i){let n=this.normalizePath(r);return this.memFs.promises.stat(n,{bigint:!1})}async lstat(r,i){let n=this.normalizePath(r);return this.memFs.promises.lstat(n,{bigint:!1})}async opendir(r,i){let n=this.normalizePath(r);return await this.memFs.promises.opendir(n,i)}async link(r,i){let n=this.normalizePath(r),o=this.normalizePath(i);return await this.memFs.promises.link(n,o)}async mkdir(r,i){let n=this.normalizePath(r);if(!(typeof i=="object"&&i&&"recursive"in i&&i.recursive)){let s=Al.dirname(n);if(s&&s!=="/"&&s!==".")try{await this.memFs.promises.stat(s)}catch{await this.memFs.promises.mkdir(s,{recursive:!0})}}await this.memFs.promises.mkdir(n,i)}async readdir(r,...i){let n=this.normalizePath(r),o=await this.memFs.promises.readdir(n,...i);return console.log("EPHEMERAL: READDIR: ",o),o}async readlink(r){throw new Error("readlink is not implemented for EphemeralFileSubFs")}async unlink(r){let i=this.normalizePath(r);return await this.memFs.promises.unlink(i)}async rename(r,i){let n=this.normalizePath(r),o=this.normalizePath(i);return await this.memFs.promises.rename(n,o)}async rmdir(r,i){let n=this.normalizePath(r);return await this.memFs.promises.rmdir(n,i)}async symlink(r,i,n){let o=this.normalizePath(r),s=this.normalizePath(i);return await this.memFs.promises.symlink(o,s,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.datasync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){if(typeof r=="string"||Buffer.isBuffer(r)){let n=this.normalizePath(r);return this.memFs.promises.readFile(n,i)}return super.readFile(r,i)}async writeFile(r,i,n){let o=this.normalizePath(r),s=Al.dirname(o);return s&&s!=="/"&&s!=="."&&await this.memFs.promises.mkdir(s,{recursive:!0}),this.memFs.promises.writeFile(o,i,n)}};a(ld,"EphemeralSubFs");var Ko=ld;var sm=oe(Ie(),1);var am=oe(Tr(),1),wf=oe(xn(),1);var sf=oe(Ie(),1);var af={type:"gitBranchesListVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e})=>{let r=t+"/.git";try{return await e.stat(r)}catch{throw new Error(`ENOENT: no such file or directory, stat '${r}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>{try{let r=(await sf.default.listBranches({fs:e,dir:t})).filter(o=>o.indexOf("/")===-1),i=await sf.default.currentBranch({fs:e,dir:t}),n=await Promise.all(r.map(async o=>{let s=await sf.default.resolveRef({fs:e,dir:t,ref:o});return o}));return{type:"directory",content:n,mode:493,size:n}}catch(r){throw r}},"getFile"),rename:a(async t=>{throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Q=oe(Ie(),1);var $t=oe(Ie(),1);async function Sr(t,e,r){try{return await $t.default.resolveRef({fs:t,dir:e,ref:`refs/heads/${r}`})}catch{return}}a(Sr,"tryResolveRef");async function Er({dir:t,fs:e,treeOid:r,deletePathParts:i,addPathParts:n,addObj:o,addKeepIfEmpty:s,deleteKeepIfNotEmpty:l,keepFilename:f=".keep"}){let[c,...u]=n??[],[h,...d]=i??[],p=[];if(r){let{tree:m}=await $t.default.readTree({fs:e,dir:t,oid:r});p=[...m]}if(c===h){let m=c;if(m===void 0)throw new Error("illegal arguement - called with out a path part");if(u.length===0)throw new Error("can not move into it self");if(d.length===0)throw new Error("can not move from it self");let w=p.findIndex(E=>E.path===m),v=(w!==-1?p[w]:void 0)?.oid,g=await Er({dir:t,fs:e,treeOid:v,addPathParts:u,deletePathParts:d,addObj:o,addKeepIfEmpty:s,deleteKeepIfNotEmpty:l});if(g===void 0)throw new Error("on the same path we expect an update - respectivly a newly created subTreeOid");let _=!1;if(g!==v){_=!0;let E={mode:"040000",path:m,oid:g,type:"tree"};w!==-1?p[w]=E:p.push(E)}if(r==null&&!_)throw new Error("Illegal state - if the currentOid is undefined - a new tree should have been created (an update should have happened)");if(_)return await $t.default.writeTree({fs:e,dir:t,tree:p});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}else{let m=!1,w;if(h){let y=p.findIndex(g=>g.path===h),v=y!==-1?p[y]:void 0;if(v===void 0)throw new Error("Element doesnt exist in tree");if(d.length>0){if(v&&v.type!=="tree")throw new Error("SubPart of the path for the obj to delete is not a tree");let g=await Er({dir:t,fs:e,treeOid:v.oid,addPathParts:void 0,deletePathParts:d,addObj:o,addKeepIfEmpty:s,deleteKeepIfNotEmpty:l});if(g===v.oid)throw new Error("in case of a delete we expect a different subtree oid");m=!0,g===void 0?p.splice(y,1):p[y]={mode:"040000",path:h,oid:g,type:"tree"}}else if(m=!0,p.splice(y,1),p.length===0&&s){let g=new Uint8Array(0),_=await $t.default.writeBlob({fs:e,dir:t,blob:g});p.push({mode:"100644",oid:_,path:f,type:"blob"})}w=v}if(c){let y=p.findIndex(g=>g.path===c),v=y!==-1?p[y]:void 0;if(u.length>0){if(v&&v.type!=="tree")throw new Error("SubPart of the path for the obj to add is not a tree");let g=await Er({dir:t,fs:e,treeOid:v?.oid,addPathParts:u,deletePathParts:void 0,addObj:o,addKeepIfEmpty:s,deleteKeepIfNotEmpty:l});if(g===void 0)throw new Error("in case we add, we expect an update - respectivly a newly created subTreeOid");if(g!==v?.oid){m=!0;let _={mode:"040000",path:c,oid:g,type:"tree"};if(y!==-1)p[y]=_;else if(p.push(_),l&&p.length>1){let E=p.findIndex(x=>x.path===f);E!==-1&&p.splice(E,1)}}}else{if(m=!0,o){let g={mode:o.type==="tree"?"040000":"100644",path:c,oid:o.oid,type:o.type};if(y!==-1)p[y]=g;else{if(l&&p.length>0){let _=p.findIndex(E=>E.path===f);_!==-1&&p.splice(_,1)}p.push(g)}}if(s&&p.length===0){let g=new Uint8Array(0),_=await $t.default.writeBlob({fs:e,dir:t,blob:g});p.push({mode:"100644",oid:_,path:f,type:"blob"})}}}if(p.length===0)return;if(m)return await $t.default.writeTree({fs:e,dir:t,tree:p});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}}a(Er,"buildUpdatedTree");async function Li({filePath:t,gitRoot:e,nodeFs:r,commitSha:i,pathParams:n}){if(!n.filePath){let l=await $t.default.readTree({fs:r,dir:e,oid:i});return{type:"tree",entries:l.tree.map(c=>c.path),oid:l.oid}}return(await $t.default.walk({fs:r,dir:e,trees:[$t.default.TREE({ref:i})],map:a(async(l,[f])=>{if(l===n.filePath&&f){let c=await f.type();if(c==="blob")return{type:"blob",oid:await f.oid()};if(c=="tree"){let u=await $t.default.readTree({fs:r,dir:e,oid:await f.oid()});return{type:"tree",entries:u.tree.map(d=>d.path),oid:u.oid}}}},"map")})).find(l=>l!==void 0)}a(Li,"resolveGitObjAtPath");var lf=class lf extends Error{constructor(r,i){super(r);H(this,"code","ENOENT");H(this,"path");this.name="ENOENTError",this.path=i,Object.setPrototypeOf(this,lf.prototype)}};a(lf,"ENOENTError");var $i=lf;var Ls={type:"gitBranchFileVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,filePath:r,cacheFs:i,pathParams:n})=>{if(n.branchName===void 0)throw new Error("branchName should be in pathParams");let o=await Sr(e,t,n.branchName);if(!o)throw new $i(`ENOENT: no such file or directory, stat '${r}'`,r);let s=await Li({filePath:r,gitRoot:t,nodeFs:e,commitSha:o,pathParams:n});if(!s)throw new $i(`ENOENT: no such file or directory, stat '${r}'`,r);let l=await Q.default.readCommit({fs:e,dir:t,oid:o}),{commit:f}=l,c=await Q.default.log({fs:e,dir:t,ref:o,filepath:n.filePath,depth:1}),u=f.committer.timestamp*1e3,h=c.length>0?c[0].commit.committer.timestamp*1e3:u;if(s.type==="tree")return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!0,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:h,mtimeMs:h,ctimeMs:h,birthtimeMs:u,atime:new Date(h),mtime:new Date(h),ctime:new Date(h),birthtime:new Date(h)};{let{blob:d}=await Q.default.readBlob({fs:e,dir:t,oid:s.oid});return{mode:420,size:d.length,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(d.length/4096),atimeMs:h,mtimeMs:h,ctimeMs:h,birthtimeMs:h,atime:new Date(h),mtime:new Date(h),ctime:new Date(h),birthtime:new Date(h)}}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n})=>{if(n.branchName===void 0)throw new Error("branchName should be in pathParams");let o=[];try{let s=await Sr(r,e,n.branchName);if(!s){let f=await Q.default.resolveRef({fs:r,dir:e,ref:"HEAD"});await Q.default.branch({fs:r,dir:e,ref:n.branchName,object:f}),s=await Q.default.resolveRef({fs:r,ref:`refs/heads/${n.branchName}`,dir:e})}let l=await Li({filePath:t,gitRoot:e,nodeFs:r,commitSha:s,pathParams:n});if(!l)return;if(l.type==="blob"){let{blob:f}=await Q.default.readBlob({fs:r,dir:e,oid:l.oid});return{type:"file",content:Buffer.from(f),mode:420,size:f.length,oid:l.oid}}else{let f=[];try{let u=await i.promises.stat(t);if(u&&u.isDirectory()){let h=await i.promises.readdir(t,{withFileTypes:!1,encoding:"utf-8"});f.push(...h)}}catch{}return{type:"directory",content:Array.from(new Set([...f,...l.entries])),mode:493}}}catch{return}},"getFile"),unlink:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n,author:o})=>{if(!n.branchName)throw new Error("branchName should be in pathParams");if(!n.filePath)throw new Error("filePath should be in pathParams");let s=await Q.default.resolveRef({fs:r,dir:e,ref:n.branchName}),l=await Q.default.readTree({fs:r,dir:e,oid:s}),f=await Er({dir:e,fs:r,treeOid:l.oid,deletePathParts:n.filePath.split("/"),addPathParts:void 0,addObj:void 0,deleteKeepIfNotEmpty:!1,addKeepIfEmpty:!0,keepFilename:".keep"});if(f!==l.oid){let c=await Q.default.commit({fs:r,dir:e,message:`Delete ${n.filePath}`,tree:f,noUpdateBranch:!0,parent:[s],author:o});await Q.default.writeRef({fs:r,dir:e,ref:`refs/heads/${n.branchName}`,value:c,force:!0})}},"unlink"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o,author:s})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");if(o.filePath===void 0)throw new Error("filePath should be in pathParams");let l;typeof i=="string"?l=new TextEncoder().encode(i):l=new Uint8Array(i);let f=await Q.default.writeBlob({fs:r,dir:e,blob:l}),c=await Sr(r,e,o.branchName);if(!c){let d=await Q.default.resolveRef({fs:r,dir:e,ref:"HEAD"});await Q.default.branch({fs:r,dir:e,ref:o.branchName,object:d}),c=await Q.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o.branchName}`})}let u=await Q.default.readTree({fs:r,dir:e,oid:c}),h=await Er({dir:e,fs:r,treeOid:u.oid,deletePathParts:void 0,addPathParts:o.filePath.split("/"),addObj:{type:"blob",oid:f},deleteKeepIfNotEmpty:!0,addKeepIfEmpty:!1,keepFilename:".keep"});if(h!==u.oid){let d=await Q.default.commit({fs:r,dir:e,message:`\u{1F4BE} Change '${o.filePath}'`,tree:h,noUpdateBranch:!0,parent:[c],author:s});await Q.default.writeRef({fs:r,dir:e,ref:`refs/heads/${o.branchName}`,value:d,force:!0})}},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o,author:s}){if(n.branchName===void 0)throw new Error("branchName should be in pathParams");if(n.filePath===void 0)throw new Error("filePath should be in pathParams");if(o.branchName===void 0)throw new Error("branchName should be in newPathParams");if(o.filePath===void 0)throw new Error("filePath should be in newPathParams");let l=await Sr(i,r,n.branchName);if(!l)throw new Error("Invalid branch file path - source branch must exist");let f=await Sr(i,r,o.branchName);if(!f){let d=await Q.default.resolveRef({fs:i,dir:r,ref:"HEAD"});await Q.default.branch({fs:i,dir:r,ref:o.branchName,object:d}),f=await Q.default.resolveRef({fs:i,dir:r,ref:`refs/heads/${o.branchName}`})}if(o.branchName!==n.branchName)throw new Error("cross branch move not implemented yet");let c=await Li({gitRoot:r,nodeFs:i,commitSha:l,filePath:t,pathParams:n});if(c===void 0)throw new Error("no obj at path exists");let u=await Er({dir:r,fs:i,deletePathParts:n.filePath.split("/"),addPathParts:o.filePath.split("/"),addObj:c,treeOid:f,addKeepIfEmpty:!0,deleteKeepIfNotEmpty:!0}),h=await Q.default.readTree({fs:i,dir:r,oid:l});if(u!==h.oid){let d=await Q.default.commit({fs:i,dir:r,message:`\u{1F500} Rename '${n.filePath}' to '${o.filePath}'`,tree:u,noUpdateBranch:!0,parent:[f],author:s});await Q.default.writeRef({fs:i,dir:r,ref:`refs/heads/${o.branchName}`,value:d,force:!0})}},"rename"),mkdir:a(async function(t){if(t.pathParams.branchName===void 0)throw new Error("branchName should be in pathParams");if(t.pathParams.filePath===void 0)throw new Error("filePath should be in pathParams");try{throw await Ls.getStats(t),new Error("Folder exists")}catch{}t.filePath.endsWith("/")&&(t.filePath=t.filePath.replace(/\/+$/,"")),t.pathParams&&typeof t.pathParams.filePath=="string"&&(t.pathParams.filePath=t.pathParams.filePath.replace(/\/+$/,""));let e=await Sr(t.nodeFs,t.gitRoot,t.pathParams.branchName);if(!e){let s=await Q.default.resolveRef({fs:t.nodeFs,dir:t.gitRoot,ref:"HEAD"});await Q.default.branch({fs:t.nodeFs,dir:t.gitRoot,ref:t.pathParams.branchName,object:s}),e=await Q.default.resolveRef({fs:t.nodeFs,dir:t.gitRoot,ref:`refs/heads/${t.pathParams.branchName}`})}let r=await Q.default.readTree({fs:t.nodeFs,dir:t.gitRoot,oid:e}),i=new Uint8Array(0),n=await Q.default.writeBlob({fs:t.nodeFs,dir:t.gitRoot,blob:i}),o=await Er({dir:t.gitRoot,fs:t.nodeFs,treeOid:r.oid,deletePathParts:void 0,addPathParts:[...t.pathParams.filePath.split("/"),".keep"],addObj:{type:"blob",oid:n},deleteKeepIfNotEmpty:!0,addKeepIfEmpty:!0,keepFilename:".keep"});if(o!==r.oid){let s=await Q.default.commit({fs:t.nodeFs,dir:t.gitRoot,message:`\u{1F4BE} Change '${t.pathParams.filePath}'`,tree:o,noUpdateBranch:!0,parent:[e],author:t.author});await Q.default.writeRef({fs:t.nodeFs,dir:t.gitRoot,ref:`refs/heads/${t.pathParams.branchName}`,value:s,force:!0})}},"mkdir"),rmdir:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n,author:o})=>{if(!n.branchName)throw new Error("branchName should be in pathParams");if(!n.filePath)throw new Error("filePath should be in pathParams");let s=await Q.default.resolveRef({fs:r,dir:e,ref:n.branchName}),l=await Q.default.readTree({fs:r,dir:e,oid:s}),f=await Er({dir:e,fs:r,treeOid:l.oid,deletePathParts:n.filePath.split("/"),addPathParts:void 0,addObj:void 0,deleteKeepIfNotEmpty:!1,addKeepIfEmpty:!0,keepFilename:".keep"});if(f!==l.oid){let c=await Q.default.commit({fs:r,dir:e,message:`Delete ${n.filePath}`,tree:f,noUpdateBranch:!0,parent:[s],author:o});await Q.default.writeRef({fs:r,dir:e,ref:`refs/heads/${n.branchName}`,value:c,force:!0})}},"rmdir")};var ri=oe(Ie(),1);var cf={type:"gitBranchHeadVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i;try{i=await ri.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await ri.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}let n=await ri.default.readCommit({fs:e,dir:t,oid:i}),{commit:o}=n,s=o.committer.timestamp*1e3;return{mode:420,size:40,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:s,mtimeMs:s,ctimeMs:s,birthtimeMs:s,atime:new Date(s),mtime:new Date(s),ctime:new Date(s),birthtime:new Date(s)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");try{let i;try{i=await ri.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await ri.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}return{type:"file",content:i+`
|
|
104
|
+
`,mode:420,size:i.length}}catch{return}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(console.log("gitBranchHeadVirtualFile writeFile called",{pathParams:o,content:i}),o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=i.toString().trim();try{await ri.default.readCommit({fs:r,dir:e,oid:s})}catch{throw new Error(`Commit ${s} does not exist in the repository`)}await ri.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+o.branchName,value:s,force:!0})},"writeFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var T1=oe(Ie(),1);var O1={type:"gitBranchTipVirtualFile",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.nodeFs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.branchName)throw new Error("branchName should be in pathParams");try{let n=await T1.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`});return{type:"file",content:n+`
|
|
105
|
+
`,mode:420,size:n.length+1}}catch{return}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var ff=oe(Ie(),1);var uf={type:"gitCommitFileVirtualFile",getStats:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!i.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let n=i.sha_1_1_2+i.sha1_3__40,o=await Li({filePath:t,gitRoot:e,nodeFs:r,commitSha:n,pathParams:i});if(!o)throw new $i(`ENOENT: no such file or directory, stat '${t}'`,t);let s=await ff.default.readCommit({fs:r,dir:e,oid:n}),{commit:l}=s,f=l.committer.timestamp*1e3;if(o.type==="tree")return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!0,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:f,mtimeMs:f,ctimeMs:f,birthtimeMs:f,atime:new Date(f),mtime:new Date(f),ctime:new Date(f),birthtime:new Date(f)};{let{blob:c}=await ff.default.readBlob({fs:r,dir:e,oid:o.oid});return{mode:420,size:c.length,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(c.length/4096),atimeMs:f,mtimeMs:f,ctimeMs:f,birthtimeMs:f,atime:new Date(f),mtime:new Date(f),ctime:new Date(f),birthtime:new Date(f)}}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!i.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let n=i.sha_1_1_2+i.sha1_3__40;try{let o=await Li({filePath:t,gitRoot:e,nodeFs:r,commitSha:n,pathParams:i});if(!o)return;if(o.type==="blob"){let{blob:s}=await ff.default.readBlob({fs:r,dir:e,oid:o.oid});return{type:"file",content:Buffer.from(s),mode:420,size:s.length,oid:o.oid}}else return{type:"directory",content:Array.from(new Set([...o.entries.filter(l=>l!==".keep")])),mode:493}}catch{return}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var hf=oe(Ie(),1);function eM(t,e,r){return t===0&&e===2&&r===0?"untracked":t===1&&e===0&&r===0?"deleted":t===1&&e===2&&r!==0?"modified":t===0&&e===2&&r===2?"added":"unknown"}a(eM,"getFileStatus");var k1={type:"gitStatusVirtualFile",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.nodeFs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>{try{let r=await hf.default.currentBranch({fs:e,dir:t})||"HEAD",i=await hf.default.resolveRef({fs:e,dir:t,ref:"HEAD"}),o=(await hf.default.statusMatrix({fs:e,dir:t})).filter(([,l,f,c])=>l!==f||f!==c).map(([l,f,c,u])=>({path:l,status:eM(f,c,u)})),s=JSON.stringify({branch:r,commit:i,clean:o.length===0,files:o},null,2);return{type:"file",content:s,mode:33188,size:Buffer.byteLength(s)}}catch(r){throw console.error(r),r}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var $s={type:"legitVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e})=>{let r=t+"/.git";try{return await e.stat(r)}catch{throw new Error(`ENOENT: no such file or directory, stat '${r}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>({type:"directory",content:[],mode:493,size:0}),"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var R1=[$s,k1,uf,af,Ls,cf,O1];var rm=class rm{constructor(e){this.routes=e;H(this,"compiledRoutes");let r={},i=a((n,o)=>{if(typeof n.type=="string"){r[o]={handler:n,siblings:[]};let s=n}else{let s=[];for(let[l,f]of Object.entries(n))if(l==="."){if(r[o])throw new Error(`Conflict: multiple handlers for path '${o}', '.' and optional '[[parameter_name]]' defined?`);r[o]={handler:f,siblings:s}}else if(l.startsWith("[[")&&l.endsWith("]]")){if(r[o])throw new Error(`Conflict: multiple handlers for path '${o}', '.' and optional '[[parameter_name]]' defined?`);r[o]={handler:f,siblings:s},l.startsWith("[[...")?r[o?`${o}/${l}`:l]={handler:f,siblings:[]}:i(f,o?`${o}/${l}`:l)}else l.startsWith("[")&&l.endsWith("]")?l.startsWith("[...")?r[o?`${o}/${l}`:l]={handler:f,siblings:[]}:i(f,o?`${o}/${l}`:l):(s.push(l),i(f,o?`${o}/${l}`:l))}},"walk");for(let[n,o]of Object.entries(e))i(o,n);this.compiledRoutes=Object.entries(r).map(([n,o])=>{let s=[],l=n.split("/").map(c=>{if(c.startsWith("[[")&&c.endsWith("]]")){let u=c.slice(2,-2).replace(/^\.\.\./,"");return s.push(u),"(.*)"}if(c.startsWith("[")&&c.endsWith("]")){let u=c.slice(1,-1);return s.push(u),"([^/]+)"}return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("/");return{regex:new RegExp(`^${l}$`),paramNames:s,staticSiblings:o.siblings,handler:o.handler}})}match(e){e.length>1&&e.endsWith("/")&&(e=e.replace(/\/+$/,""));for(let{regex:r,paramNames:i,handler:n,staticSiblings:o}of this.compiledRoutes){let s=e.match(r);if(!s)continue;let l={};for(let f=0;f<i.length;f++)l[i[f]]=decodeURIComponent(s[f+1]||"");return{handler:n,params:l,staticSiblings:o}}}};a(rm,"LegitPathRouter");var df=rm;var pf=oe(Ie(),1);var im={type:"gitCommitVirtualFolder",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.nodeFs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{let n=await pf.default.listBranches({fs:r,dir:e}),o=new Set,s=new Set;for(let c of n){let u=`refs/heads/${c}`;try{let h=await pf.default.resolveRef({fs:r,dir:e,ref:u});o.add(h)}catch{}}for(let c of o){let u=await pf.default.log({fs:r,dir:e,ref:c});for(let h of u)s.add(h.oid)}if(!i.sha_1_1_2){let c=new Set;for(let h of s)if(c.add(h.slice(0,2)),c.size>=256)break;let u=Array.from(c).sort();return{type:"directory",content:u,mode:493,size:u}}let l=new Set;for(let c of s)c.startsWith(i.sha_1_1_2)&&l.add(c.slice(2,40));let f=Array.from(l).sort();return{type:"directory",content:f,mode:493,size:f.length}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var st=oe(Ie(),1);var P1=oe(Ie(),1);var nm="-operation";async function Ye(t,e,r){return(await P1.default.listBranches({fs:t,dir:e})).filter(n=>n.endsWith("__"+r+nm))[0]}a(Ye,"resolveOperationBranchName");var A1={type:"gitBranchOperationVirtualFile",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n;try{n=await st.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let o=await Ye(r,e,i.branchName),s=!1;if(o)try{n=await st.default.resolveRef({fs:r,dir:e,ref:o}),s=!0}catch{try{n=await st.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o}`}),s=!0}catch{}}let l=await st.default.readCommit({fs:r,dir:e,oid:n}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Ye(r,e,i.branchName),o,s=!1;return n?(o=await st.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),s=!0):o=await st.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`}),{type:"file",content:Buffer.from(o),mode:420,size:o.length}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o,author:s})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let l;typeof i=="string"?l=new TextEncoder().encode(i):l=new Uint8Array(i);let f=await st.default.writeBlob({fs:r,dir:e,blob:l}),c=await Sr(r,e,o.branchName);if(!c)throw new Error("Invalid branch file path - branch doesn't exist");let u=await Ye(r,e,o.branchName),h=!1;u||(u="legit/__"+o.branchName+nm,await st.default.branch({fs:r,dir:e,ref:u,object:c}),h=!0);let d=await st.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${u}`}),p=await st.default.readTree({fs:r,dir:e,oid:c}),m;i instanceof ArrayBuffer?m=Buffer.from(i).toString("utf-8"):typeof i=="string"?m=i:i instanceof Uint8Array?m=Buffer.from(i).toString("utf-8"):m=String(i);let w=!1;if(!h){let v=await st.default.findMergeBase({fs:r,dir:e,oids:w?[d]:[d,c]});v.length===1&&v[0]===c&&(w=!0)}let y=await st.default.commit({fs:r,dir:e,message:m,tree:p.oid,noUpdateBranch:!0,author:s,parent:w?h?[c,c]:[d]:[d,c]});await st.default.writeRef({fs:r,dir:e,ref:`refs/heads/${u}`,value:y,force:!0})},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Mi=oe(Ie(),1);var om={type:"gitBranchOperationsVirtualFile",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t;if(i.branchName===void 0)throw new Error("branchName should be in pathParams");let n=await Ye(r,e,i.branchName),o,s=!1;if(n)try{o=await Mi.default.resolveRef({fs:r,dir:e,ref:n}),s=!0}catch{try{o=await Mi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),s=!0}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}}else try{o=await Mi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let l=await Mi.default.readCommit({fs:r,dir:e,oid:o}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:(s?await om.getFile(t):void 0)?.content?.length??0,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Ye(r,e,i.branchName),o=[];if(n){let f=await Mi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),c=!1,u=f;for(;u&&!c;){let h=await Mi.default.readCommit({fs:r,dir:e,oid:u});o.push({oid:h.oid,parentOids:h.commit.parent,message:h.commit.message,originBranchOid:"unset"}),u=h.commit.parent&&h.commit.parent.length>0?h.commit.parent[0]:null,h.commit.parent.length===2&&h.commit.parent[0]===h.commit.parent[1]&&(c=!0)}}let s;for(let f=o.length-1;f>=0;f--){let c=o[f];if(s===void 0){if(c.parentOids.length!==2&&c.parentOids[0]!==c.parentOids[1])throw new Error(`Operation commit ${c.oid} does not have two parents as expected`);s=c.parentOids[1]}c.parentOids.length===2&&(s=c.parentOids[1]),c.originBranchOid=s}let l=Buffer.from(JSON.stringify(o,null,2),"utf-8");return{type:"file",content:l,mode:420,size:l.length}},"getFile"),rename:a(async function(t){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var oo=oe(Ie(),1);var tM=new Set([" ","~","^",":","?","*","[","\\"]),rM=[/^\/|\/$/,/\/\//,/\.$/,/\.lock$/,/^@$/,/@\{/],C1="\u2002";function I1(t){let e=t.codePointAt(0);return!(e>=0&&e<=31||e===127||tM.has(t))}a(I1,"isValidChar");function D1(t){let e="";for(let r of t)r===" "?e+=C1:I1(r)?e+=r:e+="%"+r.codePointAt(0);for(let r of rM)if(r.test(e))return Array.from(e).map(i=>I1(i)?i:"%"+i.codePointAt(0)).join("");return e}a(D1,"encodeName");function N1(t){return t.replace(/%(\d+)/g,(e,r)=>String.fromCodePoint(parseInt(r,10))).replace(new RegExp(C1,"g")," ")}a(N1,"decodeName");var B1={type:"getThreadName",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n;try{n=await oo.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let o=await Ye(r,e,i.branchName),s=!1;if(o)try{n=await oo.default.resolveRef({fs:r,dir:e,ref:o}),s=!0}catch{try{n=await oo.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o}`}),s=!0}catch{}}let l=await oo.default.readCommit({fs:r,dir:e,oid:n}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Ye(r,e,i.branchName),o;if(n){let s="legit/",l=`__${i.branchName}-operation`;return n.startsWith(s)&&n.endsWith(l)?o=n.slice(s.length,n.length-l.length):o=n,{type:"file",content:Buffer.from(N1(o)),mode:420,size:o.length}}return{type:"file",content:Buffer.from(""),mode:420,size:0}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=await Ye(r,e,o.branchName);if(s){let l=`legit/${D1(i.toString())}__${o.branchName}-operation`;await oo.default.renameBranch({fs:r,dir:e,oldref:s,ref:l}),s=l}},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var so=oe(Ie(),1);var L1={type:"gitBranchHistory",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i;try{i=await so.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await so.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}let n=await so.default.readCommit({fs:e,dir:t,oid:i}),{commit:o}=n,s=o.committer.timestamp*1e3;return{mode:420,size:1e5,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:s,mtimeMs:s,ctimeMs:s,birthtimeMs:s,atime:new Date(s),mtime:new Date(s),ctime:new Date(s),birthtime:new Date(s)}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=i.branchName,o=[];if(n){let l=await so.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),f=!1,c=l;for(;c&&!f;){let u=await so.default.readCommit({fs:r,dir:e,oid:c});o.push({oid:u.oid,...u.commit}),c=u.commit.parent[0]}}let s=Buffer.from(JSON.stringify(o,null,2),"utf-8");return{type:"file",content:s,mode:420,size:s.length}},"getFile"),rename:a(async t=>{throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var sr=oe(Ie(),1);var $1={type:"gitBranchOperationHeadVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i=await Ye(e,t,r.branchName);if(!i){let f=new Date(0);return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:f.getTime(),mtimeMs:f.getTime(),ctimeMs:f.getTime(),birthtimeMs:f.getTime(),atime:f,mtime:f,ctime:f,birthtime:f}}let n;try{n=await sr.default.resolveRef({fs:e,dir:t,ref:i})}catch{n=await sr.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}let o=await sr.default.readCommit({fs:e,dir:t,oid:n}),{commit:s}=o,l=s.committer.timestamp*1e3;return{mode:420,size:40,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:l,mtimeMs:l,ctimeMs:l,birthtimeMs:l,atime:new Date(l),mtime:new Date(l),ctime:new Date(l),birthtime:new Date(l)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i=await Ye(e,t,r.branchName);if(!i)return{type:"file",content:"",mode:420,size:0};try{let n;try{n=await sr.default.resolveRef({fs:e,dir:t,ref:i})}catch{n=await sr.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}return{type:"file",content:n+`
|
|
106
|
+
`,mode:420,size:n.length}}catch{return}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=await Ye(r,e,o.branchName),l=await sr.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${s}`});if(!s)throw new Error(`Operation branch name could not be resolved for branch ${o.branchName}`);let f=i.toString().trim(),c,u,h=!1;if(!l)throw new Error(`Operation branch ref could not be resolved for branch ${s}`);let d=l;for(;d&&!h;){let p=await sr.default.readCommit({fs:r,dir:e,oid:d});if(p.oid===f&&(c=p.oid),d=p.commit.parent&&p.commit.parent.length>0?p.commit.parent[0]:null,p.commit.parent.length===2){if(p.commit.parent[0]===p.commit.parent[1])h=!0;else if(c!==void 0){u=p.commit.parent[1];break}}}if(c===void 0)throw new Error(`Cant rollback to ${f} couldn't find newOperationBranchHead ${c}`);if(u===void 0)throw new Error(`Cant rollback to ${f} couldn't find newBranchHead ${u}`);await sr.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+s,value:c,force:!0}),await sr.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+o.branchName,value:u,force:!0})},"writeFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var xr=class xr extends Ft{constructor({parentFs:r,gitStorageFs:i,gitRoot:n,virtualFiles:o=R1}){super({parentFs:r,gitRoot:n});H(this,"memFs");H(this,"openFh",{});H(this,"virtualFiles");H(this,"legitFileNames");H(this,"storageFs");this.gitRoot=n,this.storageFs=i,this.memFs=(0,wf.createFsFromVolume)(new wf.Volume),this.virtualFiles=o,this.legitFileNames=["branches","commits"]}async getAuthor(){let r=await sm.default.getConfig({fs:this.storageFs,dir:this.gitRoot,path:"user.name"}),i=await sm.default.getConfig({fs:this.storageFs,dir:this.gitRoot,path:"user.email"}),n=Math.floor(Date.now()/1e3),o=new Date().getTimezoneOffset();return{name:r,email:i,date:n,timezoneOffset:o}}async responsible(r){return this.isLegitPath(r)}isLegitPath(r){return r.includes(`/${xr.LEGIT_DIR}/`)||r.includes(`/${xr.LEGIT_DIR}`)}getRouteHandler(r){let i=r.indexOf(`/${xr.LEGIT_DIR}`);if(i===-1)throw new Error("Not a legit path");let n=r.slice(i+1);return xr.pathRouter.match(n)}async open(r,i,n){let o=this.getRouteHandler(r);if(!o)throw new Error("Not a virtual legit file");if(!(o?.handler.writeFile!==void 0)&&(i.includes("w")||i.includes("a")))throw new Error(`Write operations not allowed for ${o?.handler.type}`);if(i.includes("x")&&o?.handler.type!=="gitBranchFileVirtualFile")throw new Error(`Exclusive operations not allowed for ${o?.handler.type}`);let l=await o.handler.getFile({cacheFs:this.memFs,filePath:r,gitRoot:this.gitRoot,nodeFs:this.storageFs,pathParams:o.params,author:await this.getAuthor()}),f=!1;for(let p of Object.values(this.openFh))p.path===r&&(f=!0);if((l||f)&&i.includes("x"))throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r});if(!l&&!f&&!(i.includes("w")||i.includes("a")))throw Object.assign(new Error(`ENOENT: no such file or directory, open '${r}'`),{code:"ENOENT",errno:-2,syscall:"open",path:r});let c=am.dirname(r);if(await this.memFs.promises.mkdir(c,{recursive:!0}),l===void 0&&!i.includes("x")||l&&l.type==="file")try{let p=await this.memFs.promises.access(r)}catch{await this.memFs.promises.writeFile(r,"")}let u=await this.memFs.promises.open(r,i,n),h=u.fd,d=new Pt({fs:this,compositeFs:this.compositFs,subFsFileDescriptor:h,parentFsFileDescriptors:[]});return this.openFh[h]={path:r,mode:i,fh:u,openSha:l?.oid,readSha:void 0,unflushed:[]},(i.includes("x")||i.includes("w"))&&this.openFh[h].unflushed.push({length:0,start:0}),d}async mkdir(r,i){let n=r.toString(),o=this.getRouteHandler(n),s=i?{options:i}:{};try{await o?.handler.mkdir({cacheFs:this.memFs,filePath:r.toString(),nodeFs:this.storageFs,gitRoot:this.gitRoot,pathParams:o.params,...s,author:await this.getAuthor()});let l=typeof i=="object"?{...i,recursive:!0}:{recursive:!0};await this.memFs.promises.mkdir(r,l);let f=n.split("/"),c="";for(let u=1;u<=f.length;u++){c=f.slice(0,u).join("/");try{if((await this.memFs.promises.stat(c)).isDirectory()){let d=await this.memFs.promises.open(c,"r");this.openFh[d.fd]={path:c,mode:"r",fh:d,openSha:void 0,readSha:void 0,unflushed:[]}}}catch{}}}catch(l){throw l}}async access(r,i){await this.stat(r)}async futimes(r,i,n){let o=this.openFh[r.subFsFileDescriptor];if(!o)throw new Error("Invalid file handle");return await o.fh.utimes(i,n)}async fstat(r,i){let n=this.openFh[r.subFsFileDescriptor];if(!n)throw new Error("Invalid file handle");return this.stat(n.path,i)}async ftruncate(r,i){let n=this.openFh[r.subFsFileDescriptor];if(!n)throw new Error("Invalid file handle");return n.unflushed.push({length:0,start:0}),await n.fh.truncate(i)}async stat(r,i){let n=r.toString(),o=Object.values(this.openFh).find(f=>f.path===n&&f.unflushed.length>0);if(o&&o.unflushed.length>0)return await o.fh.stat(i);let s=this.getRouteHandler(n);if(!s)throw new Error(`ENOENT: no such file or directory, stat '${n}'`);return await s.handler.getStats({cacheFs:this.memFs,filePath:n,gitRoot:this.gitRoot,nodeFs:this.storageFs,pathParams:s.params,author:await this.getAuthor()})}async lstat(r,i){return this.stat(r,i)}async readdir(r,i){let n=r.toString();if(!this.isLegitPath(n))return[".legit"];let o=this.getRouteHandler(n);if(!o)throw new Error(`ENOENT: no such file or directory, scandir '${n}'`);let s=await o?.handler.getFile({cacheFs:this.memFs,filePath:n,gitRoot:this.gitRoot,nodeFs:this.storageFs,pathParams:o.params,author:await this.getAuthor()});if(s){if(s.type!=="directory")throw new Error("not a folder");let l=o?.staticSiblings??[],f=s.content;return f&&!Array.isArray(s.content)&&(f=JSON.parse(s.content)),Array.from(new Set([...f,...l])).sort((u,h)=>u.localeCompare(h,void 0,{numeric:!0,sensitivity:"base"}))}return[]}async read(r,i,n,o,s){let l=r.subFsFileDescriptor,f=this.openFh[l];if(!f)throw new Error("Invalid file handle");if(f.unflushed.length===0){let c=this.getRouteHandler(f.path),u=await c.handler.getFile({cacheFs:this.memFs,filePath:f.path,gitRoot:this.gitRoot,nodeFs:this.storageFs,pathParams:c?.params,author:await this.getAuthor()});if(!u?.content)throw new Error("couldnt access content");if(u.type!=="file")throw new Error("not a file");let h=typeof u.content=="string"?Buffer.from(u.content):u.content,d=typeof s=="number"?s:0,p=Math.min(d+o,h.length),m=Math.max(0,p-d);return h.copy(i,n,d,d+m),{bytesRead:m,buffer:i}}return await f.fh.read(i,n,o,s)}async write(r,i,n,o,s){let l=this.openFh[r.subFsFileDescriptor];if(!l)throw new Error("Invalid file handle");let f=l.mode;if(!f.includes("w")&&!f.includes("a")&&!f.includes("+"))throw Object.assign(new Error("EBADF: bad file descriptor, write"),{code:"EBADF",errno:-9,syscall:"write"});if(l.unflushed.length===0){let d=this.getRouteHandler(l.path),p=await d.handler.getFile({cacheFs:this.memFs,filePath:l.path,gitRoot:this.gitRoot,nodeFs:this.storageFs,pathParams:d.params,author:await this.getAuthor()});p&&p.oid&&(await this.memFs.promises.writeFile(l.path,p.content),l.readSha=p.oid)}let c=await l.fh.write(i,n,o,s),u=n??0,h=s??0;return l.unflushed.push({start:h,length:o||i.byteLength-u+h}),c}async close(r){let i=r.subFsFileDescriptor,n=this.openFh[i];if(!n)throw new Error("Invalid file handle");try{await this.dataSync(r),await n.fh.close()}finally{delete this.openFh[i]}}async dataSync(r){let i=r.subFsFileDescriptor,n=this.openFh[i];if(!n)throw new Error("Invalid file handle");if(n.unflushed.length>0){let o=this.getRouteHandler(n.path);if(o&&o.handler.writeFile){let s=await this.memFs.promises.readFile(n.path);await o.handler.writeFile({cacheFs:this.memFs,filePath:n.path,gitRoot:this.gitRoot,nodeFs:this.storageFs,content:s,pathParams:o.params,author:await this.getAuthor()})}n.unflushed=[]}}async readFile(r,i){let n=typeof r=="string"?r:Buffer.isBuffer(r)?r.toString():r.fd?`FileHandle(${r.fd})`:r.toString(),o=null;typeof i=="string"?o=i:i&&typeof i=="object"&&i.encoding&&(o=i.encoding);let s=await this.open(n,"r");try{let f=(await this.fstat(s)).size,c=Buffer.alloc(f);return await this.read(s,c,0,f,0),await this.close(s),o?c.toString(o):c}catch(l){try{await this.close(s)}catch{}throw l}}async writeFile(r,i,n){let o="w",s="utf8",l;typeof n=="string"?s=n:n&&typeof n=="object"&&(n.flag&&(o=String(n.flag)),n.encoding&&(s=n.encoding),n.mode&&(l=typeof n.mode=="string"?parseInt(n.mode,8):n.mode));let f=await this.open(r,o,l);try{let c;typeof i=="string"?c=Buffer.from(i,s):Buffer.isBuffer(i)?c=i:i instanceof Uint8Array?c=Buffer.from(i):ArrayBuffer.isView(i)?c=Buffer.from(i.buffer,i.byteOffset,i.byteLength):c=Buffer.from(i),await this.write(f,c,0,c.length,0)}finally{await this.close(f)}}async rename(r,i){let n=r.toString(),o=i.toString(),s=this.getRouteHandler(n),l=this.getRouteHandler(o);if(s?.handler.type==="gitBranchFileVirtualFile"&&l?.handler.type==="gitBranchFileVirtualFile"){let f=!0;try{await this.memFs.promises.access(o)}catch{f=!1}let c=!0;try{await this.stat(o)}catch{c=!1}let u=!0;try{await this.stat(n)}catch{u=!1}let h=!0;try{await this.memFs.promises.access(n)}catch{h=!1}if(h){let m=am.dirname(o);try{await this.memFs.promises.access(m)}catch{await this.memFs.promises.mkdir(m,{recursive:!0})}await this.memFs.promises.rename(r,i)}let d=this.getRouteHandler(n);if(!d)throw new Error("VF not found");let p=await d.handler.rename({cacheFs:this.memFs,filePath:n,gitRoot:this.gitRoot,nodeFs:this.storageFs,newPath:o,pathParams:d?.params??{},newPathParams:l?.params??{},author:await this.getAuthor()})}else throw new Error(`Unsupported rename operation from ${s?.handler.type} to ${l?.handler.type}`)}async fchmod(r,i){}async unlink(r){let i=r.toString(),n=this.getRouteHandler(i);if(n?.handler.unlink!==void 0)try{await n.handler.unlink({cacheFs:this.memFs,filePath:i,nodeFs:this.storageFs,gitRoot:this.gitRoot,pathParams:n.params,author:await this.getAuthor()})}catch(o){let s=!1;for(let[l,f]of Object.entries(this.openFh))f.path===i&&f.unflushed.length>0&&(s=!0);if(!s)throw o}finally{let o=!1;for(let[s,l]of Object.entries(this.openFh))l.path===i&&(o=!0,await l.fh.close(),delete this.openFh[Number(s)]);o&&await this.memFs.promises.unlink(i)}else throw new Error(`Cannot unlink ${n?.handler.type} files`)}async rmdir(r,...i){let n=r.toString(),o=this.getRouteHandler(n);if(o?.handler.rmdir!==void 0){await o.handler.rmdir({cacheFs:this.memFs,filePath:n,nodeFs:this.storageFs,gitRoot:this.gitRoot,pathParams:o.params,author:await this.getAuthor()});let s=!1;for(let[l,f]of Object.entries(this.openFh))f.path===n&&(s=!0,await f.fh.close(),delete this.openFh[Number(l)]);s&&await this.memFs.promises.rmdir(n,{recursive:!0})}else throw new Error(`Cannot rmdir
|
|
107
|
+
${o?.handler.type} directories`)}fileType(){return 10}};a(xr,"GitSubFs"),H(xr,"LEGIT_DIR",".legit"),H(xr,"pathRouter",new df({".legit":{".":$s,branches:{".":af,"[branchName]":{".legit":{".":$s,operation:A1,head:cf,operationHead:$1,operationHistory:om,threadName:B1,history:L1},"[[...filePath]]":Ls}},commits:{".":im,"[sha_1_1_2]":{".":im,"[sha1_3__40]":{"[[...filePath]]":uf}}}}}));var mf=xr;var Je=oe(Ie(),1);var vx=oe(bx(),1);function xM(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}a(xM,"fromValue");function TM(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:xM(t)}a(TM,"getIterator");async function _x(t,e){let r=TM(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}a(_x,"forAwait");function OM(t){let{PassThrough:e}=yf(),r=new e;return setTimeout(async()=>{await _x(t,i=>r.write(i)),r.end()},1),r}a(OM,"asyncIteratorToStream");async function kM(t){let e=0,r=[];await _x(t,o=>{r.push(o),e+=o.byteLength});let i=new Uint8Array(e),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}a(kM,"collect");function RM(t){let e=Object.getOwnPropertyDescriptor(t,Symbol.asyncIterator);if(e&&e.enumerable)return t;let r=!1,i=[],n={};return t.on("data",o=>{i.push(o),n.resolve&&(n.resolve({value:i.shift(),done:!1}),n={})}),t.on("error",o=>{n.reject&&(n.reject(o),n={})}),t.on("end",()=>{r=!0,n.resolve&&(n.resolve({done:!0}),n={})}),{next(){return new Promise((o,s)=>{if(i.length===0&&r)return o({done:!0});if(i.length>0)return o({value:i.shift(),done:!1});i.length===0&&!r&&(n={resolve:o,reject:s})})},return(){t.removeAllListeners(),t.destroy&&t.destroy()},[Symbol.asyncIterator](){return this}}}a(RM,"fromNodeStream");async function PM({onProgress:t,url:e,method:r="GET",headers:i={},agent:n,body:o}){return o&&Array.isArray(o)?o=Buffer.from(await kM(o)):o&&(o=OM(o)),new Promise((s,l)=>{(0,vx.default)({url:e,method:r,headers:i,agent:n,body:o},(f,c)=>{if(f)return l(f);try{let u=RM(c);s({url:c.url,method:c.method,statusCode:c.statusCode,statusMessage:c.statusMessage,body:u,headers:c.headers})}catch(u){l(u)}})})}a(PM,"request");var AM={request:PM},_f=AM;var ni="legit",Fx=a(({fs:t,gitRepoPath:e,serverUrl:r="https://hub.legitcontrol.com",auth:i,anonymousBranch:n})=>{let o=!1;async function s(w){let y=await i.getMaxAccessTokenForBranch(w);if(!y)throw new Error(`No access token for branch ${w}`);await Je.default.fetch({fs:t,http:_f,dir:e,singleBranch:!0,ref:`${w}`,remote:ni,url:r,headers:{Authorization:`Bearer ${y}`}});let v=await Je.default.resolveRef({fs:t,dir:e,ref:`${ni}/${w}`});await Je.default.writeRef({fs:t,dir:e,ref:`refs/heads/${w}`,value:v})}a(s,"loadBranch");let l=[];async function f(){let w=await i.getMaxAccessTokenForBranch("todo");await Je.default.fetch({fs:t,http:_f,dir:e,remote:ni,url:r,headers:{Authorization:`Bearer ${w}`}});let y=await Je.default.listBranches({fs:t,dir:e});for(let v of y){if(v===n)continue;let g=`${ni}/${v}`,_,E;try{_=await Je.default.resolveRef({fs:t,dir:e,ref:v})}catch(x){console.log(`Could not resolve local ref ${v}:`,x)}try{E=await Je.default.resolveRef({fs:t,dir:e,ref:g})}catch{E=void 0}if(_&&E){if(_!==E){let x=await Je.default.findMergeBase({fs:t,dir:e,oids:[_,E]});if(x[0]!==_&&x[0]!==E){let R=await Je.default.merge({fs:t,dir:e,ours:_,theirs:E,fastForwardOnly:!1,abortOnConflict:!1,author:{name:"Your Name",email:"your.email@example.com"},mergeDriver:a(async({branches:b,contents:T,path:F})=>{let[P,k,D]=T;return console.log(`Merging ${b[0]} with ${b[1]}...`),console.log("merged:"),console.log(T),{cleanMerge:!0,mergedText:D===void 0?k:D}},"mergeDriver")});await Je.default.writeRef({fs:t,dir:e,ref:`refs/heads/${v}`,value:R.oid,force:!0})}x[0]===_?(console.log(`branch ${v} differs - remote ahaed, not behind`),await Je.default.writeRef({fs:t,dir:e,ref:`refs/heads/${v}`,value:E,force:!0})):x[0]===E?(console.log(`branch ${v} differs - local ahead, not behind`),l.push(v)):(console.log(`branch ${v} differs - both changed`),l.push(v))}}else _&&!E&&l.push(v)}}a(f,"pull");async function c(w){if((await i.getUser()).type!=="local")for(let y of w){let v=await i.getMaxAccessTokenForBranch(y);await Je.default.push({fs:t,http:_f,dir:e,remote:ni,url:r,ref:y,headers:{Authorization:`Bearer ${v}`}})}}a(c,"push");let u=Promise.resolve();async function h(w){u=u.then(()=>c(w)),await u}a(h,"sequentialPush");async function d(){await Je.default.getConfig({fs:t,dir:e,path:`remote.${ni}.fetch`})||await Je.default.setConfig({fs:t,dir:e,path:`remote.${ni}.fetch`,value:`+refs/heads/*:refs/remotes/${ni}/*`});try{await f();let y=[...new Set(l)].filter(v=>v.indexOf(n)===-1);await h(y),l=[]}catch(y){console.error("Error monitoring changes:",y)}finally{o&&setTimeout(d,1e3)}}a(d,"pullPushTick");function p(){o=!0,d()}a(p,"startSync");function m(){o=!1}return a(m,"stopSync"),{start:a(()=>{o||(p(),o=!0)},"start"),stop:a(()=>{m()},"stop"),isRunning:a(()=>o,"isRunning"),loadBranch:s,sequentialPush:h}},"createLegitSyncService");var Ve=oe(Ie(),1);var Ff=oe(xn(),1);var Ex=a((t,e)=>{let r={type:"local",id:"local",name:"Local User",email:"local@legitcontrol.com"};return{getUser:a(async()=>r,"getUser"),signInAnonymously:a(async()=>{r.type="anonymous",r.id=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(),r.email=`anonymous-sha1-${r.id}-@legitcontrol.com`},"signInAnonymously"),addAccessToken:a(async i=>{let n=await t.getUserTokens(r.id);n.accessTokens.push(i),await t.setUserTokens(r.id,n)},"addAccessToken"),getMaxAccessTokenForBranch:a(async i=>{let n=await t.getUserTokens(r.id);return n.accessTokens===void 0||n.accessTokens.length===0?e:n.accessTokens[0]},"getMaxAccessTokenForBranch")}},"createSessionManager");var bm=oe(Ie(),1);var Sx="user.legit_tokens";function xx({storageFs:t,gitRoot:e}){return{getUserTokens:a(async r=>{let i=await bm.default.getConfig({fs:t,dir:e,path:Sx});return JSON.parse(i||"{}")},"getUserTokens"),setUserTokens:a(async(r,i)=>await bm.default.setConfig({fs:t,dir:e,path:Sx,value:JSON.stringify(i)}),"setUserTokens")}}a(xx,"createGitConfigTokenStore");async function $3(){let t=new Ff.Volume,e=(0,Ff.createFsFromVolume)(t);return IM(e,"/")}a($3,"initMemFSLegitFs");async function IM({storageFs:t,gitRoot:e,anonymousBranch:r="anonymous",showKeepFiles:i=!1,initialAuthor:n={type:"local",id:"local",name:"Local User",email:"local@legitcontrol.com"},serverUrl:o="https://sync.legitcontrol.com",publicKey:s}){await t.promises.readdir(e+"/.git").then(()=>!0).catch(()=>!1)||(await Ve.default.init({fs:t,dir:"/",defaultBranch:r}),await t.promises.writeFile(e+"/.keep",""),await Ve.default.add({fs:t,dir:"/",filepath:".keep"}),await Ve.default.commit({fs:t,dir:"/",message:"Initial commit",author:{name:"Test",email:"test@example.com"}}),await Ve.default.setConfig({fs:t,dir:e,path:"init.defaultBranch",value:r})),await Ve.default.getConfig({fs:t,dir:e,path:"user.legit_user_id"})||await Ve.default.setConfig({fs:t,dir:e,path:"user.legit_user_id",value:n.name}),await Ve.default.getConfig({fs:t,dir:e,path:"user.name"})||await Ve.default.setConfig({fs:t,dir:e,path:"user.name",value:n.name}),await Ve.default.getConfig({fs:t,dir:e,path:"user.email"})||await Ve.default.setConfig({fs:t,dir:e,path:"user.email",value:n.email});let h=new Wo({name:"root",parentFs:void 0,storageFs:t,gitRoot:e}),d=new Ko({parentFs:h,gitRoot:e,ephemeralPatterns:[]}),p=new Go({parentFs:h,gitRoot:e,hiddenFiles:[]});h.setHiddenFilesSubFs(p),h.setEphemeralFilesSubFs(d);let m=new Wo({name:"git",parentFs:h,storageFs:void 0,gitRoot:e,defaultBranch:r}),w=new mf({parentFs:m,gitRoot:e,gitStorageFs:h}),y=i?[".git"]:[".git",".keep"],v=new Go({parentFs:m,gitRoot:e,hiddenFiles:y}),g=new Ko({parentFs:m,gitRoot:e,ephemeralPatterns:["**/._*","**/.DS_Store","**/.AppleDouble/","**/.AppleDB","**/.AppleDesktop","**/.Spotlight-V100","**/.TemporaryItems","**/.Trashes","**/.fseventsd","**/.VolumeIcon.icns","**/.ql_disablethumbnails","**/.~lock.*","**/lu[0-9a-zA-Z]*.tmp","**/.metaentries.json.tmp","**/**.sb-**"]});m.addSubFs(w),m.setHiddenFilesSubFs(v),m.setEphemeralFilesSubFs(g);let _=xx({storageFs:t,gitRoot:e}),E=Ex(_,s),x=Fx({fs:t,gitRepoPath:e,serverUrl:o,auth:E,anonymousBranch:r});s&&x.start();let R=Object.assign(m,{auth:E,sync:x,push:a(async b=>{},"push"),shareCurrentBranch:a(async()=>{if((await E.getUser()).type==="local")throw new Error("login first - for example anonymously using legitfs.auth.signInAnonymously()");let b=await R.getCurrentBranch();return b===r&&(b=(await E.getUser()).id,await Ve.default.renameBranch({fs:t,dir:e,oldref:r,ref:b})),await x.sequentialPush([b]),R.setCurrentBranch(b),b},"shareCurrentBranch"),setCurrentBranch:a(async b=>{(await Ve.default.listBranches({fs:t,dir:e})).includes(b)||await x?.loadBranch(b);let k=(await Ve.default.listBranches({fs:t,dir:e})).includes(b);if(console.log("branchExistsAfter",k),!k)throw new Error(`Branch ${b} does not exist`);await Ve.default.setConfig({fs:t,dir:e,path:"init.defaultBranch",value:b})},"setCurrentBranch"),getCurrentBranch:a(async()=>{let b=await Ve.default.getConfig({fs:t,dir:e,path:"init.defaultBranch"});if(!b)throw new Error("No current branch set");return b},"getCurrentBranch")});return R}a(IM,"openLegitFs");var vm=oe(ai(),1);function Tx(t){let e=t.name||"untitled";return{kind:"file",name:e,async getFile(){let i=(await t.stat()).size;console.log("reading data into buffer of size"+i);let n=vm.Buffer.alloc(i);await t.read(n,0,i,0);let o=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);console.log("buffer read",o);let s=o;return new File([s],e||"untitled")},async createWritable(){return{async write(r){console.log("writing data to handle",t);let i;if(typeof r=="string")i=vm.Buffer.from(r,"utf-8");else if(r instanceof Blob){let n=await r.arrayBuffer();i=new Uint8Array(n)}else if(ArrayBuffer.isView(r))i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);else throw console.log("data",r),new Error("Unsupported data type for write");await t.write(i),await t.sync(),console.log("write completed")},async close(){await t.close()}}}}}a(Tx,"fileHandleToFileSystemFileHandle");async function CM(t){let e=await t.getFile();return e.handle=t,e}a(CM,"fileSystemFileHandleToFileWithHandle");async function U3(t){return{openFile:a(async e=>{let r=await t.promises.open(e,"w");return r.name=e,await CM(Tx(r))},"openFile"),fileSave:a(async(e,r,i,n,o)=>{if(i)console.log("using existing handle",i);else{let f=window.prompt("Save as",r?.fileName??"untitled");if(console.log("result of prompt",f),!f)throw new Error("no file choosen");try{let c=await t.promises.open(`${f}`,"w");i=Tx(c)}catch(c){throw console.error("Failed to open file in legitFs",c),new Error("Failed to open file in legitFs")}}let s=e instanceof Blob?e:await e;return await(await i.createWritable()).write(s),i},"fileSave")}}a(U3,"getLegitFsAccess");export{Wo as CompositeFs,Ko as EphemeralSubFs,mf as GitSubFs,Go as HiddenFileSubFs,Sl as PassThroughSubFs,Fx as createLegitSyncService,U3 as getLegitFsAccess,om as gitBranchOperationsVirtualFile,$3 as initMemFSLegitFs,IM as openLegitFs};
|
|
107
108
|
/*! Bundled license information:
|
|
108
109
|
|
|
109
110
|
ieee754/index.js:
|