UNPKG

@vorlefan/prisma-backup

Version:

Export all the databse models into json files and use them as backup

1 lines 163 kB
(()=>{var t={8803:(t,e,r)=>{t.exports=(()=>{"use strict";var t={555:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=n(r(747)),i=n(r(622));e.default=class{constructor(t){return this._route=t,this._routeName="",this._historic=[],this}setRoute(t){return this._routeName=t,this}historic(){return this._historic}setHistoric(t,e,r){const n={routeName:t,filename:e,field:r};return this._historic.push(n),this}async accessFile(t,e=["R_OK","F_OK"]){const r=e.map((t=>u.default.constants[t])).reduce(((t,e)=>e|t));return await new Promise((e=>u.default.access(t,r,(t=>e(!t)))))}async copy(t,e){return!!await this.accessFile(t)&&(await u.default.promises.copyFile(t,e),!0)}readSync({routeName:t=this._routeName,filename:e,folder:r}){if(!this._route.has(t)&&!r)return;const n="string"==typeof r?i.default.join(r,e):this._route.plug(t,e);return u.default.existsSync(n)?(this.setHistoric(t,e,"read"),u.default.readFileSync(n,"utf-8")):void 0}async read({routeName:t=this._routeName,filename:e,folder:r}){if(!this._route.has(t)&&!r)return;const n="string"==typeof r?i.default.join(r,e):this._route.plug(t,e);return await this.accessFile(n)?(this.setHistoric(t,n,"read"),await u.default.promises.readFile(n,"utf-8")):void 0}storeSync({routeName:t=this._routeName,filename:e,force:r=!0,data:n}){if(!this._route.has(t))return!1;const i=this._route.plug(t,e);return u.default.existsSync(i)&&!r||(u.default.writeFileSync(i,n,"utf-8"),this.setHistoric(t,i,"write")),!0}async store({routeName:t=this._routeName,filename:e,force:r=!0,data:n}){if(!this._route.has(t))return!1;const i=this._route.plug(t,e);return await this.accessFile(i)&&!r||(await u.default.promises.writeFile(i,n,"utf-8"),this.setHistoric(t,e,"write")),!0}removeSync({routeName:t=this._routeName,filename:e}){if(!this._route.has(t))return!1;const r=this._route.plug(t,e);return!u.default.existsSync(r)||(u.default.unlinkSync(r),this.setHistoric(t,e,"remove"),!0)}async remove({routeName:t=this._routeName,filename:e}){if(!this._route.has(t))return!1;const r=this._route.plug(t,e);return!await this.accessFile(r)||(u.default.promises.unlink(r),this.setHistoric(t,e,"remove"),!0)}files({routeName:t=this._routeName,extension:e,options:r={}}){if(!this._route.has(t))return[];const n=this._route.get(t),a=n.filepath;if(!u.default.existsSync(a))return[];e&&"string"==typeof e&&(e=new RegExp(`.(${e})$`,"gi"));const o=[];return u.default.readdirSync(a,r).map((t=>{const r=i.default.join(a,t);if(!u.default.lstatSync(r).isDirectory()){let t=r.replace(/^.*[\\\/]/,""),u=i.default.extname(t);if(e&&!t.match(e))return;o.push({name:t.replace(u,""),filename:t,filepath:r,extension:u,routeName:n.name})}})),o}lastFiles({routeName:t=this._routeName,extension:e,options:r}){return this.files({routeName:t,extension:e,options:r}).sort(((t,e)=>u.default.statSync(e.filepath).mtimeMs-u.default.statSync(t.filepath).mtimeMs))}async allFiles(t,e=[]){const r=await u.default.promises.readdir(t);return await Promise.allSettled(r.map((async r=>{const n=i.default.join(t,r);u.default.lstatSync(n).isDirectory()?await this.allFiles(n,e):e.push(n)}))),e}folders(t=this._routeName){if(!this._route.has(t))return[];const e=this._route.get(t);let r=u.default.readdirSync(e.filepath);r=r.map((t=>i.default.join(e.filepath,t))).filter((t=>u.default.lstatSync(t).isDirectory()));const n=[];return r.map((t=>{const e=t.replace(/^.*[\\\/]/,"");n.push({name:e,path:t})})),n}hasFolder(t){return!!u.default.existsSync(t)&&u.default.lstatSync(t).isDirectory()}setFolder(t,e){const r=i.default.join(this._route.get(t).filepath,e);return this.hasFolder(this._route.plug(t,e))||u.default.mkdirSync(r,{recursive:!1}),this}}},582:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FileStream=e.FileJSON=e.FileManager=void 0;var u=r(555);Object.defineProperty(e,"FileManager",{enumerable:!0,get:function(){return n(u).default}});var i=r(207);Object.defineProperty(e,"FileJSON",{enumerable:!0,get:function(){return n(i).default}});var a=r(474);Object.defineProperty(e,"FileStream",{enumerable:!0,get:function(){return n(a).default}})},207:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{constructor(t,e){return this._route=t,this._routeName=e,this}set(t){return this._routeName=t,this}readSync({routeName:t=this._routeName,filename:e}){const r=this._route.io().readSync({routeName:t,filename:e});return"string"==typeof r?JSON.parse(r||"{}"):r}async read({routeName:t=this._routeName,filename:e}){const r=await this._route.io().read({routeName:t,filename:e});return"string"==typeof r?JSON.parse(r||"{}"):r}storeSync({routeName:t=this._routeName,filename:e,data:r,force:n=!0}){const u=JSON.stringify(r,null,"\t");return this._route.io().storeSync({routeName:t,filename:e,data:u,force:n})}async store({routeName:t=this._routeName,filename:e,data:r,force:n=!0}){const u=JSON.stringify(r,null,"\t");return await this._route.io().store({routeName:t,filename:e,data:u,force:n})}removeSync({routeName:t=this._routeName,filename:e}){return this._route.io().removeSync({routeName:t,filename:e})}async remove({routeName:t=this._routeName,filename:e}){return await this._route.io().remove({routeName:t,filename:e})}}},474:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=n(r(747)),i=n(r(605)),a=n(r(211));e.default=class{constructor(t){return this._route=t,this._routeName="",this}async download({url:t,destination:e,protocol:r="http"}){return new Promise(((n,o)=>{const s=u.default.createWriteStream(e);("http"===r?i.default:a.default).get(t,(t=>{t.pipe(s),s.on("finish",(()=>{s.close(),n(!0)})).on("error",(()=>{u.default.unlinkSync(e),o(!1)}))}))}))}async writeFile({data:t,destination:e,options:r="utf8"}){return new Promise(((n,i)=>{const a=u.default.createWriteStream(e,r);a.write(t),a.end(),a.on("finish",(()=>n(!0))).on("error",i)}))}async readFile({filepath:t,onData:e,options:r="utf8"}){return new Promise(((n,i)=>{const a=u.default.createReadStream(t,r);let o="";a.on("data",(function(t){o+=t.toString(),e&&e(t,o)})).on("end",(function(){n({data:o})})).on("error",(function(t){i({data:o,error:t})}))}))}async readJson({filepath:t,onData:e,options:r}){const{data:n,error:u}=await this.readFile({filepath:t,options:r,onData:e});try{return{data:JSON.parse(n),error:u}}catch(t){return{error:u}}}}},607:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PathRoute=e.Routes=e.Route=void 0;const u=n(r(868));e.PathRoute=u.default;const i={_routes:[],route:{}},a={};e.Route=a,i.save=function({instance:t,routeName:e,filename:r,force:n=!0}){if(!(t&&t instanceof u.default))return!1;const i=t.routes();return t.json().set(e).storeSync({filename:r,data:i,force:n}),!0},i.load=function(t){const e=new u.default;let r=e.io().readSync({filename:"",folder:t});return r&&(r=JSON.parse(r),r.map((t=>e.set(t.name,t.filepath)))),o._routes.push(e),e};const o={...i,instance:function(t,e){const r=new u.default;return r._namespace=e,t({instance:r}),o._routes.push(r),o.route[e]=r,a[e]=r,r}};e.Routes=o},868:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=n(r(622)),i=r(582);e.default=class{constructor(){this._routes=[],this._prefix="",this._namespace="",this._storage={},this._io=new i.FileManager(this),this._json=new i.FileJSON(this,""),this._stream=new i.FileStream(this)}io(){return this._io}json(){return this._json}stream(){return this._stream}hasItem(t){return!!this._storage.hasOwnProperty(t)}setItem(t,e,r){return this.hasItem(t)&&r||(this._storage[t]=e),this._storage[t]}getItem(t){return this._storage[t]}routes(){return this._routes}has(t){return!!this._routes.find((e=>e.name===t))}remove(t){this.has(t)&&(this._routes=this._routes.filter((({name:e})=>e!==t)))}set(t,e){if(!this.has(t)){const r={name:t,filepath:e};this._routes.push(r)}return this}get(t){const e={name:"",filepath:"",prefix:""},r=this._routes.find((({name:e})=>e===t));return r?Object.assign(e,r):e}alias(t,e){return this.has(e)&&this.set(t,this.get(e).filepath),this}join(t,e,r){if(this.has(e)){const n=this.get(e),i={name:t,filepath:u.default.join(n.filepath,r||t)};this._routes.push(i)}return this}inject(t,e,r){if(this.has(t))return this;const n=r||t;return this.io().setFolder(e,n),this.join(t,e,r),this}prefix(t){return this._prefix=t,this._routes.forEach((e=>{e.hasOwnProperty("prefix")?e.name.replace(e.prefix||"",t):(e.name=`${t}/${e.name}`,e.prefix=t)})),this}plug(t,e){return u.default.join(this.get(t).filepath||"",e)}clean(t){return this.get(t).filepath.replace(/(\/)[(/)]/g,"/")}back(t,e=1){if(this.has(t)){const r=new Array(e).fill("..");return u.default.resolve(this.get(t).filepath,...r)}return""}endWith(t){const e=t.replace(/(\/)[(/)]/g,"/");return u.default.basename(e)}sliceTo({filepath:t,routeName:e,strict:r=!1,to:n}){if(!this.has(e))return"";let i=(t||this.get(e).filepath).split(/(\/|\\)/gimu);const a=[],o=i.length;for(let t=0;t<o;t++){const e=i[t];if(a.push(e),r){if(e===n)break}else if(new RegExp(`(${n})`,"giu").test(e))break}return u.default.join(...a)}hierarchy(t){const e={};if(!this.has(t))return e;const{filepath:r}=this.get(t);return r.replace(/(\/|\/\/|\\|\\\\)/g," ").split(" ").map(((r,n,u)=>{let i=u[n-1];const a=u.length-n;e[r]={path:this.back(t,a),index:a,next:"",parent:"",current:r},e.hasOwnProperty(i)&&(e[r].parent=i,e[i].next=r)})),e}resolve(...t){return u.default.resolve(...t)}basename(t,e){return u.default.basename(t,e)}dirname(t){return u.default.dirname(t)}structuredJoin(t,e){if(!this.has(t))return this;const r=e?""+e:t;return this.io().folders(t).map((({name:t,path:e})=>this.set(`${r}/${t}`,e))),this}}},747:t=>{t.exports=r(7147)},605:t=>{t.exports=r(3685)},211:t=>{t.exports=r(5687)},622:t=>{t.exports=r(1017)}},e={};return function r(n){if(e[n])return e[n].exports;var u=e[n]={exports:{}};return t[n].call(u.exports,u,u.exports,r),u.exports}(607)})()},5285:(t,e,r)=>{const n=r(5173),u=r(1017),i=r(7396),a=r(6333),o=(t,e)=>"boolean"==typeof t?t:e,s=(t,e)=>"string"==typeof t?t:e,l={noSort:!1,readEntries:!1,method:n.Constants.NONE,fs:null};t.exports=function(t,e){let r=null;const c=Object.assign(Object.create(null),l);t&&"object"==typeof t&&(t instanceof Uint8Array||(Object.assign(c,t),t=c.input?c.input:void 0,c.input&&delete c.input),Buffer.isBuffer(t)&&(r=t,c.method=n.Constants.BUFFER,t=void 0)),Object.assign(c,e);const D=new n(c);if(t&&"string"==typeof t){if(!D.fs.existsSync(t))throw new Error(n.Errors.INVALID_FILENAME);c.method=n.Constants.FILE,c.filename=t,r=D.fs.readFileSync(t)}const f=new a(r,c),{canonical:d,sanitize:p}=n;function h(t){var e;return t&&f&&("string"==typeof t&&(e=f.getEntry(t)),"object"==typeof t&&void 0!==t.entryName&&void 0!==t.header&&(e=f.getEntry(t.entryName)),e)?e:null}function y(t){const{join:e,normalize:r,sep:n}=u.posix;return e(".",r(n+t.split("\\").join(n)+n))}return{readFile:function(t,e){var r=h(t);return r&&r.getData(e)||null},readFileAsync:function(t,e){var r=h(t);r?r.getDataAsync(e):e(null,"getEntry failed for:"+t)},readAsText:function(t,e){var r=h(t);if(r){var n=r.getData();if(n&&n.length)return n.toString(e||"utf8")}return""},readAsTextAsync:function(t,e,r){var n=h(t);n?n.getDataAsync((function(t,n){n?e(t,n):t&&t.length?e(t.toString(r||"utf8")):e("")})):e("")},deleteFile:function(t){var e=h(t);e&&f.deleteEntry(e.entryName)},addZipComment:function(t){f.comment=t},getZipComment:function(){return f.comment||""},addZipEntryComment:function(t,e){var r=h(t);r&&(r.comment=e)},getZipEntryComment:function(t){var e=h(t);return e&&e.comment||""},updateFile:function(t,e){var r=h(t);r&&r.setData(e)},addLocalFile:function(t,e,r,u){if(!D.fs.existsSync(t))throw new Error(n.Errors.FILE_NOT_FOUND.replace("%s",t));{e=e?y(e):"";var i=t.split("\\").join("/").split("/").pop();e+=r||i;const n=D.fs.statSync(t);this.addFile(e,D.fs.readFileSync(t),u,n)}},addLocalFolder:function(t,e,r){var i;if(r instanceof RegExp?(i=r,r=function(t){return i.test(t)}):"function"!=typeof r&&(r=function(){return!0}),e=e?y(e):"",t=u.normalize(t),!D.fs.existsSync(t))throw new Error(n.Errors.FILE_NOT_FOUND.replace("%s",t));{const n=D.findFiles(t),i=this;n.length&&n.forEach((function(n){var a=u.relative(t,n).split("\\").join("/");if(r(a)){var o=D.fs.statSync(n);o.isFile()?i.addFile(e+a,D.fs.readFileSync(n),"",o):i.addFile(e+a+"/",Buffer.alloc(0),"",o)}}))}},addLocalFolderAsync:function(t,e,r,i){var a;i instanceof RegExp?(a=i,i=function(t){return a.test(t)}):"function"!=typeof i&&(i=function(){return!0}),r=r?y(r):"",t=u.normalize(t);var o=this;D.fs.open(t,"r",(function(a){if(a&&"ENOENT"===a.code)e(void 0,n.Errors.FILE_NOT_FOUND.replace("%s",t));else if(a)e(void 0,a);else{var s=D.findFiles(t),l=-1,c=function(){if((l+=1)<s.length){var n=s[l],a=u.relative(t,n).split("\\").join("/");a=a.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),i(a)?D.fs.stat(n,(function(t,u){t&&e(void 0,t),u.isFile()?D.fs.readFile(n,(function(t,n){t?e(void 0,t):(o.addFile(r+a,n,"",u),c())})):(o.addFile(r+a+"/",Buffer.alloc(0),"",u),c())})):c()}else e(!0,void 0)};c()}}))},addLocalFolderPromise:function(t,e){return new Promise(((r,n)=>{const{filter:u,zipPath:i}=Object.assign({},e);this.addLocalFolderAsync(t,((t,e)=>{e&&n(e),t&&r(this)}),i,u)}))},addFile:function(t,e,r,u){let a=h(t);const o=null!=a;o||(a=new i,a.entryName=t),a.comment=r||"";const s="object"==typeof u&&u instanceof D.fs.Stats;s&&(a.header.time=u.mtime);var l=a.isDirectory?16:0;if(!n.isWin){let t=a.isDirectory?16384:32768;t|=s?4095&u.mode:"number"==typeof u?4095&u:a.isDirectory?493:420,l=(l|t<<16)>>>0}a.attr=l,a.setData(e),o||f.setEntry(a)},getEntries:function(){return f?f.entries:[]},getEntry:function(t){return h(t)},getEntryCount:function(){return f.getEntryCount()},forEach:function(t){return f.forEach(t)},extractEntryTo:function(t,e,r,i,a,l){i=o(i,!1),a=o(a,!1),r=o(r,!0),l=s(l,s(a,void 0));var c=h(t);if(!c)throw new Error(n.Errors.NO_ENTRY);var y=d(c.entryName),m=p(e,l&&!c.isDirectory?l:r?y:u.basename(y));if(c.isDirectory)return f.getEntryChildren(c).forEach((function(t){if(t.isDirectory)return;var o=t.getData();if(!o)throw new Error(n.Errors.CANT_EXTRACT_FILE);var s=d(t.entryName),l=p(e,r?s:u.basename(s));const c=a?t.header.fileAttr:void 0;D.writeFileTo(l,o,i,c)})),!0;var E=c.getData();if(!E)throw new Error(n.Errors.CANT_EXTRACT_FILE);if(D.fs.existsSync(m)&&!i)throw new Error(n.Errors.CANT_OVERRIDE);const g=a?t.header.fileAttr:void 0;return D.writeFileTo(m,E,i,g),!0},test:function(t){if(!f)return!1;for(var e in f.entries)try{if(e.isDirectory)continue;if(!f.entries[e].getData(t))return!1}catch(t){return!1}return!0},extractAllTo:function(t,e,r,u){if(e=o(e,!1),u=s(r,u),r=o(r,!1),!f)throw new Error(n.Errors.NO_ZIP);f.entries.forEach((function(i){var a=p(t,d(i.entryName.toString()));if(i.isDirectory)return void D.makeDir(a);var o=i.getData(u);if(!o)throw new Error(n.Errors.CANT_EXTRACT_FILE);const s=r?i.header.fileAttr:void 0;D.writeFileTo(a,o,e,s);try{D.fs.utimesSync(a,i.header.time,i.header.time)}catch(t){throw new Error(n.Errors.CANT_EXTRACT_FILE)}}))},extractAllToAsync:function(t,e,r,i){if(i||(i=function(){}),e=o(e,!1),"function"!=typeof r||i||(i=r),r=o(r,!1),!f)return void i(new Error(n.Errors.NO_ZIP));t=u.resolve(t);const a=e=>p(t,u.normalize(d(e.entryName.toString()))),s=(t,e)=>new Error(t+': "'+e+'"'),l=[],c=new Set;f.entries.forEach((t=>{t.isDirectory?l.push(t):c.add(t)}));for(const t of l){const e=a(t),n=r?t.header.fileAttr:void 0;try{D.makeDir(e),n&&D.fs.chmodSync(e,n),D.fs.utimesSync(e,t.header.time,t.header.time)}catch(t){i(s("Unable to create folder",e))}}const h=()=>{0===c.size&&i()};for(const a of c.values()){const o=u.normalize(d(a.entryName.toString())),l=p(t,o);a.getDataAsync((function(t,u){if(u)i(new Error(u));else if(t){const n=r?a.header.fileAttr:void 0;D.writeFileToAsync(l,t,e,n,(function(t){t?D.fs.utimes(l,a.header.time,a.header.time,(function(t){t?i(s("Unable to set times",l)):(c.delete(a),h())})):i(s("Unable to write file",l))}))}else i(new Error(n.Errors.CANT_EXTRACT_FILE))}))}h()},writeZip:function(t,e){if(1===arguments.length&&"function"==typeof t&&(e=t,t=""),!t&&c.filename&&(t=c.filename),t){var r=f.compressToBuffer();if(r){var n=D.writeFileTo(t,r,!0);"function"==typeof e&&e(n?null:new Error("failed"),"")}}},writeZipPromise:function(t,e){const{overwrite:r,perm:n}=Object.assign({overwrite:!0},e);return new Promise(((e,u)=>{!t&&c.filename&&(t=c.filename),t||u("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then((i=>{D.writeFileToAsync(t,i,r,n,(t=>t?e(t):u("ADM-ZIP: Wasn't able to write zip file")))}),u)}))},toBufferPromise:function(){return new Promise(((t,e)=>{f.toAsyncBuffer(t,e)}))},toBuffer:function(t,e,r,n){return this.valueOf=2,"function"==typeof t?(f.toAsyncBuffer(t,e,r,n),null):f.compressToBuffer()}}}},2907:(t,e,r)=>{var n=r(5173),u=n.Constants;t.exports=function(){var t=20,e=10,r=0,i=0,a=0,o=0,s=0,l=0,c=0,D=0,f=0,d=0,p=0,h=0,y=0;t|=n.isWin?2560:768,r|=u.FLG_EFS;var m={};function E(t){t=new Date(t),a=(t.getFullYear()-1980&127)<<25|t.getMonth()+1<<21|t.getDate()<<16|t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1}return E(+new Date),{get made(){return t},set made(e){t=e},get version(){return e},set version(t){e=t},get flags(){return r},set flags(t){r=t},get method(){return i},set method(t){switch(t){case u.STORED:this.version=10;case u.DEFLATED:default:this.version=20}i=t},get time(){return new Date(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1)},set time(t){E(t)},get crc(){return o},set crc(t){o=Math.max(0,t)>>>0},get compressedSize(){return s},set compressedSize(t){s=Math.max(0,t)>>>0},get size(){return l},set size(t){l=Math.max(0,t)>>>0},get fileNameLength(){return c},set fileNameLength(t){c=t},get extraLength(){return D},set extraLength(t){D=t},get commentLength(){return f},set commentLength(t){f=t},get diskNumStart(){return d},set diskNumStart(t){d=Math.max(0,t)>>>0},get inAttr(){return p},set inAttr(t){p=Math.max(0,t)>>>0},get attr(){return h},set attr(t){h=Math.max(0,t)>>>0},get fileAttr(){return h?(h>>>0|0)>>16&4095:0},get offset(){return y},set offset(t){y=Math.max(0,t)>>>0},get encripted(){return 1==(1&r)},get entryHeaderSize(){return u.CENHDR+c+D+f},get realDataOffset(){return y+u.LOCHDR+m.fnameLen+m.extraLen},get dataHeader(){return m},loadDataHeaderFromBinary:function(t){var e=t.slice(y,y+u.LOCHDR);if(e.readUInt32LE(0)!==u.LOCSIG)throw new Error(n.Errors.INVALID_LOC);m={version:e.readUInt16LE(u.LOCVER),flags:e.readUInt16LE(u.LOCFLG),method:e.readUInt16LE(u.LOCHOW),time:e.readUInt32LE(u.LOCTIM),crc:e.readUInt32LE(u.LOCCRC),compressedSize:e.readUInt32LE(u.LOCSIZ),size:e.readUInt32LE(u.LOCLEN),fnameLen:e.readUInt16LE(u.LOCNAM),extraLen:e.readUInt16LE(u.LOCEXT)}},loadFromBinary:function(m){if(m.length!==u.CENHDR||m.readUInt32LE(0)!==u.CENSIG)throw new Error(n.Errors.INVALID_CEN);t=m.readUInt16LE(u.CENVEM),e=m.readUInt16LE(u.CENVER),r=m.readUInt16LE(u.CENFLG),i=m.readUInt16LE(u.CENHOW),a=m.readUInt32LE(u.CENTIM),o=m.readUInt32LE(u.CENCRC),s=m.readUInt32LE(u.CENSIZ),l=m.readUInt32LE(u.CENLEN),c=m.readUInt16LE(u.CENNAM),D=m.readUInt16LE(u.CENEXT),f=m.readUInt16LE(u.CENCOM),d=m.readUInt16LE(u.CENDSK),p=m.readUInt16LE(u.CENATT),h=m.readUInt32LE(u.CENATX),y=m.readUInt32LE(u.CENOFF)},dataHeaderToBinary:function(){var t=Buffer.alloc(u.LOCHDR);return t.writeUInt32LE(u.LOCSIG,0),t.writeUInt16LE(e,u.LOCVER),t.writeUInt16LE(r,u.LOCFLG),t.writeUInt16LE(i,u.LOCHOW),t.writeUInt32LE(a,u.LOCTIM),t.writeUInt32LE(o,u.LOCCRC),t.writeUInt32LE(s,u.LOCSIZ),t.writeUInt32LE(l,u.LOCLEN),t.writeUInt16LE(c,u.LOCNAM),t.writeUInt16LE(D,u.LOCEXT),t},entryHeaderToBinary:function(){var n=Buffer.alloc(u.CENHDR+c+D+f);return n.writeUInt32LE(u.CENSIG,0),n.writeUInt16LE(t,u.CENVEM),n.writeUInt16LE(e,u.CENVER),n.writeUInt16LE(r,u.CENFLG),n.writeUInt16LE(i,u.CENHOW),n.writeUInt32LE(a,u.CENTIM),n.writeUInt32LE(o,u.CENCRC),n.writeUInt32LE(s,u.CENSIZ),n.writeUInt32LE(l,u.CENLEN),n.writeUInt16LE(c,u.CENNAM),n.writeUInt16LE(D,u.CENEXT),n.writeUInt16LE(f,u.CENCOM),n.writeUInt16LE(d,u.CENDSK),n.writeUInt16LE(p,u.CENATT),n.writeUInt32LE(h,u.CENATX),n.writeUInt32LE(y,u.CENOFF),n.fill(0,u.CENHDR),n},toJSON:function(){const a=function(t){return t+" bytes"};return{made:t,version:e,flags:r,method:n.methodToString(i),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:a(s),size:a(l),fileNameLength:a(c),extraLength:a(D),commentLength:a(f),diskNumStart:d,inAttr:p,attr:h,offset:y,entryHeaderSize:a(u.CENHDR+c+D+f)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}},3854:(t,e,r)=>{e.EntryHeader=r(2907),e.MainHeader=r(3519)},3519:(t,e,r)=>{var n=r(5173),u=n.Constants;t.exports=function(){var t=0,e=0,r=0,i=0,a=0;return{get diskEntries(){return t},set diskEntries(r){t=e=r},get totalEntries(){return e},set totalEntries(r){e=t=r},get size(){return r},set size(t){r=t},get offset(){return i},set offset(t){i=t},get commentLength(){return a},set commentLength(t){a=t},get mainHeaderSize(){return u.ENDHDR+a},loadFromBinary:function(o){if((o.length!==u.ENDHDR||o.readUInt32LE(0)!==u.ENDSIG)&&(o.length<u.ZIP64HDR||o.readUInt32LE(0)!==u.ZIP64SIG))throw new Error(n.Errors.INVALID_END);o.readUInt32LE(0)===u.ENDSIG?(t=o.readUInt16LE(u.ENDSUB),e=o.readUInt16LE(u.ENDTOT),r=o.readUInt32LE(u.ENDSIZ),i=o.readUInt32LE(u.ENDOFF),a=o.readUInt16LE(u.ENDCOM)):(t=n.readBigUInt64LE(o,u.ZIP64SUB),e=n.readBigUInt64LE(o,u.ZIP64TOT),r=n.readBigUInt64LE(o,u.ZIP64SIZ),i=n.readBigUInt64LE(o,u.ZIP64OFF),a=0)},toBinary:function(){var n=Buffer.alloc(u.ENDHDR+a);return n.writeUInt32LE(u.ENDSIG,0),n.writeUInt32LE(0,4),n.writeUInt16LE(t,u.ENDSUB),n.writeUInt16LE(e,u.ENDTOT),n.writeUInt32LE(r,u.ENDSIZ),n.writeUInt32LE(i,u.ENDOFF),n.writeUInt16LE(a,u.ENDCOM),n.fill(" ",u.ENDHDR),n},toJSON:function(){return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:function(t,e){let r=t.toString(16).toUpperCase();for(;r.length<4;)r="0"+r;return"0x"+r}(i),commentLength:a}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}},753:(t,e,r)=>{t.exports=function(t){var e=r(9796),n={chunkSize:1024*(parseInt(t.length/1024)+1)};return{deflate:function(){return e.deflateRawSync(t,n)},deflateAsync:function(r){var u=e.createDeflateRaw(n),i=[],a=0;u.on("data",(function(t){i.push(t),a+=t.length})),u.on("end",(function(){var t=Buffer.alloc(a),e=0;t.fill(0);for(var n=0;n<i.length;n++){var u=i[n];u.copy(t,e),e+=u.length}r&&r(t)})),u.end(t)}}}},1004:(t,e,r)=>{e.Deflater=r(753),e.Inflater=r(1269),e.ZipCrypto=r(4729)},1269:(t,e,r)=>{t.exports=function(t){var e=r(9796);return{inflate:function(){return e.inflateRawSync(t)},inflateAsync:function(r){var n=e.createInflateRaw(),u=[],i=0;n.on("data",(function(t){u.push(t),i+=t.length})),n.on("end",(function(){var t=Buffer.alloc(i),e=0;t.fill(0);for(var n=0;n<u.length;n++){var a=u[n];a.copy(t,e),e+=a.length}r&&r(t)})),n.end(t)}}}},4729:(t,e,r)=>{"use strict";const{randomFillSync:n}=r(6113),u=new Uint32Array(256).map(((t,e)=>{for(let t=0;t<8;t++)0!=(1&e)?e=e>>>1^3988292384:e>>>=1;return e>>>0})),i=(t,e)=>Math.imul(t,e)>>>0,a=(t,e)=>u[255&(t^e)]^t>>>8,o=()=>"function"==typeof n?n(Buffer.alloc(12)):o.node();o.node=()=>{const t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=256*Math.random()&255;return t};const s={genSalt:o};function l(t){const e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let t=0;t<e.length;t++)this.updateKeys(e[t])}l.prototype.updateKeys=function(t){const e=this.keys;return e[0]=a(e[0],t),e[1]+=255&e[0],e[1]=i(e[1],134775813)+1,e[2]=a(e[2],e[1]>>>24),t},l.prototype.next=function(){const t=(2|this.keys[2])>>>0;return i(t,1^t)>>8&255},t.exports={decrypt:function(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);const n=function(t){const e=new l(t);return function(t){const r=Buffer.alloc(t.length);let n=0;for(let u of t)r[n++]=e.updateKeys(u^e.next());return r}}(r);if(n(t.slice(0,12))[11]!==e.crc>>>24)throw"ADM-ZIP: Wrong Password";return n(t.slice(12))},encrypt:function(t,e,r,n=!1){null==t&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));const u=function(t){const e=new l(t);return function(t,r,n=0){r||(r=Buffer.alloc(t.length));for(let u of t){const t=e.next();r[n++]=u^t,e.updateKeys(u)}return r}}(r),i=s.genSalt();i[11]=e.crc>>>24&255,n&&(i[10]=e.crc>>>16&255);const a=Buffer.alloc(t.length+12);return u(i,a),u(t,a,12)},_salter:function(t){Buffer.isBuffer(t)&&t.length>=12?s.genSalt=function(){return t.slice(0,12)}:s.genSalt="node"===t?o.node:o}}},5991:t=>{t.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}},2190:t=>{t.exports={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found"}},3455:(t,e,r)=>{const n=r(5147).require(),u=r(1017);n.existsSync=n.existsSync||u.existsSync,t.exports=function(t){var e=t||"",r={directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0},i=null;return e&&n.existsSync(e)?(i=n.statSync(e),r.directory=i.isDirectory(),r.mtime=i.mtime,r.atime=i.atime,r.executable=0!=(73&i.mode),r.readonly=0==(128&i.mode),r.hidden="."===u.basename(e)[0]):console.warn("Invalid path: "+e),{get directory(){return r.directory},get readOnly(){return r.readonly},get hidden(){return r.hidden},get mtime(){return r.mtime},get atime(){return r.atime},get executable(){return r.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:e,isDirectory:r.directory,isReadOnly:r.readonly,isHidden:r.hidden,isExecutable:r.executable,mTime:r.mtime,aTime:r.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}},5147:(t,e,r)=>{e.require=function(){if("object"==typeof process&&process.versions&&process.versions.electron)try{const t=r(Object(function(){var t=new Error("Cannot find module 'original-fs'");throw t.code="MODULE_NOT_FOUND",t}()));if(Object.keys(t).length>0)return t}catch(t){}return r(7147)}},5173:(t,e,r)=>{t.exports=r(7646),t.exports.Constants=r(5991),t.exports.Errors=r(2190),t.exports.FileAttr=r(3455)},7646:(t,e,r)=>{const n=r(5147).require(),u=r(1017),i=r(5991),a="object"==typeof process&&"win32"===process.platform,o=t=>t&&"object"==typeof t,s=new Uint32Array(256).map(((t,e)=>{for(let t=0;t<8;t++)0!=(1&e)?e=3988292384^e>>>1:e>>>=1;return e>>>0}));function l(t){this.sep=u.sep,this.fs=n,o(t)&&o(t.fs)&&"function"==typeof t.fs.statSync&&(this.fs=t.fs)}t.exports=l,l.prototype.makeDir=function(t){const e=this;!function(t){let r=t.split(e.sep)[0];t.split(e.sep).forEach((function(t){if(t&&":"!==t.substr(-1,1)){var n;r+=e.sep+t;try{n=e.fs.statSync(r)}catch(t){e.fs.mkdirSync(r)}if(n&&n.isFile())throw Errors.FILE_IN_THE_WAY.replace("%s",r)}}))}(t)},l.prototype.writeFileTo=function(t,e,r,n){const i=this;if(i.fs.existsSync(t)){if(!r)return!1;if(i.fs.statSync(t).isDirectory())return!1}var a,o=u.dirname(t);i.fs.existsSync(o)||i.makeDir(o);try{a=i.fs.openSync(t,"w",438)}catch(e){i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0},l.prototype.writeFileToAsync=function(t,e,r,n,i){"function"==typeof n&&(i=n,n=void 0);const a=this;a.fs.exists(t,(function(o){if(o&&!r)return i(!1);a.fs.stat(t,(function(r,s){if(o&&s.isDirectory())return i(!1);var l=u.dirname(t);a.fs.exists(l,(function(r){r||a.makeDir(l),a.fs.open(t,"w",438,(function(r,u){r?a.fs.chmod(t,438,(function(){a.fs.open(t,"w",438,(function(r,u){a.fs.write(u,e,0,e.length,0,(function(){a.fs.close(u,(function(){a.fs.chmod(t,n||438,(function(){i(!0)}))}))}))}))})):u?a.fs.write(u,e,0,e.length,0,(function(){a.fs.close(u,(function(){a.fs.chmod(t,n||438,(function(){i(!0)}))}))})):a.fs.chmod(t,n||438,(function(){i(!0)}))}))}))}))}))},l.prototype.findFiles=function(t){const e=this;return function t(r,n,i){"boolean"==typeof n&&(i=n,n=void 0);let a=[];return e.fs.readdirSync(r).forEach((function(o){var s=u.join(r,o);e.fs.statSync(s).isDirectory()&&i&&(a=a.concat(t(s,n,i))),n&&!n.test(s)||a.push(u.normalize(s)+(e.fs.statSync(s).isDirectory()?e.sep:""))})),a}(t,void 0,!0)},l.prototype.getAttributes=function(){},l.prototype.setAttributes=function(){},l.crc32update=function(t,e){return s[255&(t^e)]^t>>>8},l.crc32=function(t){"string"==typeof t&&(t=Buffer.from(t,"utf8")),s.length||genCRCTable();let e=t.length,r=-1;for(let n=0;n<e;)r=l.crc32update(r,t[n++]);return~r>>>0},l.methodToString=function(t){switch(t){case i.STORED:return"STORED ("+t+")";case i.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}},l.canonical=function(t){if(!t)return"";var e=u.posix.normalize("/"+t.split("\\").join("/"));return u.join(".",e)},l.sanitize=function(t,e){t=u.resolve(u.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var a=u.normalize(u.join(t,r.slice(n,i).join(u.sep)));if(0===a.indexOf(t))return a}return u.normalize(u.join(t,u.basename(e)))},l.toBuffer=function(t){return Buffer.isBuffer(t)?t:t instanceof Uint8Array?Buffer.from(t):"string"==typeof t?Buffer.from(t,"utf8"):Buffer.alloc(0)},l.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)},l.isWin=a,l.crcTable=s},7396:(t,e,r)=>{var n=r(5173),u=r(3854),i=n.Constants,a=r(1004);t.exports=function(t){var e=new u.EntryHeader,r=Buffer.alloc(0),o=Buffer.alloc(0),s=!1,l=null,c=Buffer.alloc(0);function D(){return t&&Buffer.isBuffer(t)?(e.loadDataHeaderFromBinary(t),t.slice(e.realDataOffset,e.realDataOffset+e.compressedSize)):Buffer.alloc(0)}function f(t){return 8==(8&e.flags)||n.crc32(t)===e.dataHeader.crc}function d(t,u,i){if(void 0===u&&"string"==typeof t&&(i=t,t=void 0),s)return t&&u&&u(Buffer.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR),Buffer.alloc(0);var o=D();if(0===o.length)return t&&u&&u(o),o;if(e.encripted){if("string"!=typeof i&&!Buffer.isBuffer(i))throw new Error("ADM-ZIP: Incompatible password parameter");o=a.ZipCrypto.decrypt(o,e,i)}var l=Buffer.alloc(e.size);switch(e.method){case n.Constants.STORED:if(o.copy(l),f(l))return t&&u&&u(l),l;throw t&&u&&u(l,n.Errors.BAD_CRC),new Error(n.Errors.BAD_CRC);case n.Constants.DEFLATED:var c=new a.Inflater(o);if(!t){if(c.inflate(l).copy(l,0),!f(l))throw new Error(n.Errors.BAD_CRC+" "+r.toString());return l}c.inflateAsync((function(t){t.copy(t,0),u&&(f(t)?u(t):u(t,n.Errors.BAD_CRC))}));break;default:throw t&&u&&u(Buffer.alloc(0),n.Errors.UNKNOWN_METHOD),new Error(n.Errors.UNKNOWN_METHOD)}}function p(r,u){if((!l||!l.length)&&Buffer.isBuffer(t))return r&&u&&u(D()),D();if(l.length&&!s){var i;switch(e.method){case n.Constants.STORED:return e.compressedSize=e.size,i=Buffer.alloc(l.length),l.copy(i),r&&u&&u(i),i;default:case n.Constants.DEFLATED:var o=new a.Deflater(l);if(!r){var c=o.deflate();return e.compressedSize=c.length,c}o.deflateAsync((function(t){i=Buffer.alloc(t.length),e.compressedSize=t.length,t.copy(i),u&&u(i)})),o=null}}else{if(!r||!u)return Buffer.alloc(0);u(Buffer.alloc(0))}}function h(t,e){return(t.readUInt32LE(e+4)<<4)+t.readUInt32LE(e)}function y(t){var r,n,u,a;t.length>=i.EF_ZIP64_SCOMP&&(r=h(t,i.EF_ZIP64_SUNCOMP),e.size===i.EF_ZIP64_OR_32&&(e.size=r)),t.length>=i.EF_ZIP64_RHO&&(n=h(t,i.EF_ZIP64_SCOMP),e.compressedSize===i.EF_ZIP64_OR_32&&(e.compressedSize=n)),t.length>=i.EF_ZIP64_DSN&&(u=h(t,i.EF_ZIP64_RHO),e.offset===i.EF_ZIP64_OR_32&&(e.offset=u)),t.length>=i.EF_ZIP64_DSN+4&&(a=t.readUInt32LE(i.EF_ZIP64_DSN),e.diskNumStart===i.EF_ZIP64_OR_16&&(e.diskNumStart=a))}return{get entryName(){return r.toString()},get rawEntryName(){return r},set entryName(t){var u=(r=n.toBuffer(t))[r.length-1];s=47===u||92===u,e.fileNameLength=r.length},get extra(){return c},set extra(t){c=t,e.extraLength=t.length,function(t){for(var e,r,n,u=0;u<t.length;)e=t.readUInt16LE(u),u+=2,r=t.readUInt16LE(u),u+=2,n=t.slice(u,u+r),u+=r,i.ID_ZIP64===e&&y(n)}(t)},get comment(){return o.toString()},set comment(t){o=n.toBuffer(t),e.commentLength=o.length},get name(){var t=r.toString();return s?t.substr(t.length-1).split("/").pop():t.split("/").pop()},get isDirectory(){return s},getCompressedData:function(){return p(!1,null)},getCompressedDataAsync:function(t){p(!0,t)},setData:function(t){l=n.toBuffer(t),!s&&l.length?(e.size=l.length,e.method=n.Constants.DEFLATED,e.crc=n.crc32(t),e.changed=!0):e.method=n.Constants.STORED},getData:function(t){return e.changed?l:d(!1,null,t)},getDataAsync:function(t,r){e.changed?t(l):d(!0,t,r)},set attr(t){e.attr=t},get attr(){return e.attr},set header(t){e.loadFromBinary(t)},get header(){return e},packHeader:function(){var t=e.entryHeaderToBinary(),u=n.Constants.CENHDR;return r.copy(t,u),u+=r.length,e.extraLength&&(c.copy(t,u),u+=e.extraLength),e.commentLength&&o.copy(t,u),t},toJSON:function(){const r=function(t){return"<"+(t&&t.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:e.toJSON(),compressedData:r(t),data:r(l)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}},6333:(t,e,r)=>{const n=r(7396),u=r(3854),i=r(5173);t.exports=function(t,e){var r=[],a={},o=Buffer.alloc(0),s=new u.MainHeader,l=!1;const c=Object.assign(Object.create(null),e),{noSort:D}=c;function f(){l=!0,a={},r=new Array(s.diskEntries);for(var e=s.offset,u=0;u<r.length;u++){var o=e,c=new n(t);c.header=t.slice(o,o+=i.Constants.CENHDR),c.entryName=t.slice(o,o+=c.header.fileNameLength),c.header.extraLength&&(c.extra=t.slice(o,o+=c.header.extraLength)),c.header.commentLength&&(c.comment=t.slice(o,o+c.header.commentLength)),e+=c.header.entryHeaderSize,r[u]=c,a[c.entryName]=c}}function d(){r.length>1&&!D&&r.sort(((t,e)=>t.entryName.toLowerCase().localeCompare(e.entryName.toLowerCase())))}return t?function(e){for(var r=t.length-i.Constants.ENDHDR,n=Math.max(0,r-65535),u=n,a=t.length,l=-1,c=0;r>=u;r--)if(80===t[r])if(t.readUInt32LE(r)!==i.Constants.ENDSIG)if(t.readUInt32LE(r)!==i.Constants.END64SIG){if(t.readUInt32LE(r)===i.Constants.ZIP64SIG){l=r,a=r+i.readBigUInt64LE(t,r+i.Constants.ZIP64SIZE)+i.Constants.ZIP64LEAD;break}}else u=n;else l=r,c=r,a=r+i.Constants.ENDHDR,u=r-i.Constants.END64HDR;if(!~l)throw new Error(i.Errors.INVALID_FORMAT);s.loadFromBinary(t.slice(l,a)),s.commentLength&&(o=t.slice(c+i.Constants.ENDHDR)),e&&f()}(c.readEntries):l=!0,{get entries(){return l||f(),r},get comment(){return o.toString()},set comment(t){o=i.toBuffer(t),s.commentLength=o.length},getEntryCount:function(){return l?r.length:s.diskEntries},forEach:function(e){l?r.forEach(e):function(e){const r=s.diskEntries;let u=s.offset;for(let a=0;a<r;a++){let r=u;const a=new n(t);a.header=t.slice(r,r+=i.Constants.CENHDR),a.entryName=t.slice(r,r+=a.header.fileNameLength),u+=a.header.entryHeaderSize,e(a)}}(e)},getEntry:function(t){return l||f(),a[t]||null},setEntry:function(t){l||f(),r.push(t),a[t.entryName]=t,s.totalEntries=r.length},deleteEntry:function(t){l||f();var e=a[t];if(e&&e.isDirectory){var n=this;this.getEntryChildren(e).forEach((function(e){e.entryName!==t&&n.deleteEntry(e.entryName)}))}r.splice(r.indexOf(e),1),delete a[t],s.totalEntries=r.length},getEntryChildren:function(t){if(l||f(),t&&t.isDirectory){const e=[],n=t.entryName,u=n.length;return r.forEach((function(t){t.entryName.substr(0,u)===n&&e.push(t)})),e}return[]},compressToBuffer:function(){l||f(),d();const t=[],e=[];let n=0,u=0;s.size=0,s.offset=0;for(const i of r){const r=i.getCompressedData();i.header.offset=u;const a=i.header.dataHeaderToBinary(),o=i.rawEntryName.length,l=Buffer.alloc(o+i.extra.length);i.rawEntryName.copy(l,0),l.copy(i.extra,o);const c=a.length+l.length+r.length;u+=c,t.push(a),t.push(l),t.push(r);const D=i.packHeader();e.push(D),s.size+=D.length,n+=c+D.length}n+=s.mainHeaderSize,s.offset=u,u=0;const a=Buffer.alloc(n);for(const e of t)e.copy(a,u),u+=e.length;for(const t of e)t.copy(a,u),u+=t.length;const c=s.toBinary();return o&&o.copy(c,i.Constants.ENDHDR),c.copy(a,u),a},toAsyncBuffer:function(t,e,n,u){try{l||f(),d();const e=[],a=[];let c=0,D=0;s.size=0,s.offset=0;const p=function(r){if(r.length){const t=r.pop(),i=t.entryName+t.extra.toString();n&&n(i),t.getCompressedDataAsync((function(n){u&&u(i),t.header.offset=D;const o=t.header.dataHeaderToBinary(),l=Buffer.alloc(i.length,i),f=o.length+l.length+n.length;D+=f,e.push(o),e.push(l),e.push(n);const d=t.packHeader();a.push(d),s.size+=d.length,c+=f+d.length,p(r)}))}else{c+=s.mainHeaderSize,s.offset=D,D=0;const r=Buffer.alloc(c);e.forEach((function(t){t.copy(r,D),D+=t.length})),a.forEach((function(t){t.copy(r,D),D+=t.length}));const n=s.toBinary();o&&o.copy(n,i.Constants.ENDHDR),n.copy(r,D),t(r)}};p(r)}catch(t){e(t)}}}}},730:(t,e,r)=>{"use strict";const n=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,u=()=>{const t={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in process.env&&(t.enabled="0"!==process.env.FORCE_COLOR);const e=(t,e,r)=>"function"==typeof t?t(e):t.wrap(e,r),u=(r,n)=>{if(""===r||null==r)return"";if(!1===t.enabled)return r;if(!1===t.visible)return"";let u=""+r,i=u.includes("\n"),a=n.length;for(a>0&&n.includes("unstyle")&&(n=[...new Set(["unstyle",...n])].reverse());a-- >0;)u=e(t.styles[n[a]],u,i);return u},i=(e,r,n)=>{t.styles[e]=(t=>{let e=t.open=`[${t.codes[0]}m`,r=t.close=`[${t.codes[1]}m`,n=t.regex=new RegExp(`\\u001b\\[${t.codes[1]}m`,"g");return t.wrap=(t,u)=>{t.includes(r)&&(t=t.replace(n,r+e));let i=e+t+r;return u?i.replace(/\r*\n/g,`${r}$&${e}`):i},t})({name:e,codes:r}),(t.keys[n]||(t.keys[n]=[])).push(e),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(r){t.alias(e,r)},get(){let r=t=>u(t,r.stack);return Reflect.setPrototypeOf(r,t),r.stack=this.stack?this.stack.concat(e):[e],r}})};return i("reset",[0,0],"modifier"),i("bold",[1,22],"modifier"),i("dim",[2,22],"modifier"),i("italic",[3,23],"modifier"),i("underline",[4,24],"modifier"),i("inverse",[7,27],"modifier"),i("hidden",[8,28],"modifier"),i("strikethrough",[9,29],"modifier"),i("black",[30,39],"color"),i("red",[31,39],"color"),i("green",[32,39],"color"),i("yellow",[33,39],"color"),i("blue",[34,39],"color"),i("magenta",[35,39],"color"),i("cyan",[36,39],"color"),i("white",[37,39],"color"),i("gray",[90,39],"color"),i("grey",[90,39],"color"),i("bgBlack",[40,49],"bg"),i("bgRed",[41,49],"bg"),i("bgGreen",[42,49],"bg"),i("bgYellow",[43,49],"bg"),i("bgBlue",[44,49],"bg"),i("bgMagenta",[45,49],"bg"),i("bgCyan",[46,49],"bg"),i("bgWhite",[47,49],"bg"),i("blackBright",[90,39],"bright"),i("redBright",[91,39],"bright"),i("greenBright",[92,39],"bright"),i("yellowBright",[93,39],"bright"),i("blueBright",[94,39],"bright"),i("magentaBright",[95,39],"bright"),i("cyanBright",[96,39],"bright"),i("whiteBright",[97,39],"bright"),i("bgBlackBright",[100,49],"bgBright"),i("bgRedBright",[101,49],"bgBright"),i("bgGreenBright",[102,49],"bgBright"),i("bgYellowBright",[103,49],"bgBright"),i("bgBlueBright",[104,49],"bgBright"),i("bgMagentaBright",[105,49],"bgBright"),i("bgCyanBright",[106,49],"bgBright"),i("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=n,t.hasColor=t.hasAnsi=e=>(t.ansiRegex.lastIndex=0,"string"==typeof e&&""!==e&&t.ansiRegex.test(e)),t.alias=(e,r)=>{let n="string"==typeof r?t[r]:r;if("function"!=typeof n)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");n.stack||(Reflect.defineProperty(n,"name",{value:e}),t.styles[e]=n,n.stack=[e]),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(r){t.alias(e,r)},get(){let e=t=>u(t,e.stack);return Reflect.setPrototypeOf(e,t),e.stack=this.stack?this.stack.concat(n.stack):n.stack,e}})},t.theme=e=>{if(null===(r=e)||"object"!=typeof r||Array.isArray(r))throw new TypeError("Expected theme to be an object");var r;for(let r of Object.keys(e))t.alias(r,e[r]);return t},t.alias("unstyle",(e=>"string"==typeof e&&""!==e?(t.ansiRegex.lastIndex=0,e.replace(t.ansiRegex,"")):"")),t.alias("noop",(t=>t)),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=r(7142),t.define=i,t};t.exports=u(),t.exports.create=u},7142:t=>{"use strict";const e="Hyper"===process.env.TERM_PROGRAM,r="win32"===process.platform,n="linux"===process.platform,u={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},i=Object.assign({},u,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),a=Object.assign({},u,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",question:"?",questionFull:"?",questionSmall:"﹖",pointer:n?"▸":"❯",pointerSmall:n?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});t.exports=r&&!e?i:a,Reflect.defineProperty(t.exports,"common",{enumerable:!1,value:u}),Reflect.defineProperty(t.exports,"windows",{enumerable:!1,value:i}),Reflect.defineProperty(t.exports,"other",{enumerable:!1,value:a})},6002:(t,e,r)=>{const n=r(8672),u=r(7056),i=r(8035),a=r(2138),o=r(5566),s=r(6835),l=r(1145);t.exports={Bar:n,SingleBar:n,MultiBar:u,Presets:i,Format:{Formatter:a,BarFormat:s,ValueFormat:o,TimeFormat:l}}},4958:t=>{t.exports=class{constructor(t,e,r){this.etaBufferLength=t||100,this.valueBuffer=[r],this.timeBuffer=[e],this.eta="0"}update(t,e,r){this.valueBuffer.push(e),this.timeBuffer.push(t),this.calculate(r-e)}getTime(){return this.eta}calculate(t){const e=this.valueBuffer.length,r=Math.min(this.etaBufferLength,e),n=(this.valueBuffer[e-1]-this.valueBuffer[e-r])/(this.timeBuffer[e-1]-this.timeBuffer[e-r]);this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);const u=Math.ceil(t/n/1e3);isNaN(u)?this.eta="NULL":isFinite(u)?this.eta=u>1e7?"INF":u<0?0:u:this.eta="INF"}}},6835:t=>{t.exports=function(t,e){const r=Math.round(t*e.barsize),n=e.barsize-r;return e.barCompleteString.substr(0,r)+e.barGlue+e.barIncompleteString.substr(0,n)}},1145:t=>{t.exports=function(t,e,r){function n(t){return r?r*Math.round(t/r):t}function u(t){return(e.autopaddingChar+t).slice(-2)}return t>3600?u(Math.floor(t/3600))+"h"+u(n(t%3600/60))+"m":t>60?u(Math.floor(t/60))+"m"+u(n(t%60))+"s":t>10?u(n(t))+"s":u(t)+"s"}},5566:t=>{t.exports=function(t,e,r){return!0!==e.autopadding?t:"percentage"===r?(n=t,3,(e.autopaddingChar+n).slice(-3)):t;var n}},2138:(t,e,r)=>{const n=r(4223),u=r(5566),i=r(6835),a=r(1145);t.exports=function(t,e,r){let o=t.format;const s=t.formatTime||a,l=t.formatValue||u,c=t.formatBar||i,D=Math.floor(100*e.progress)+"",f=e.stopTime||Date.now(),d=Math.round((f-e.startTime)/1e3),p=Object.assign({},r,{bar:c(e.progress,t),percentage:l(D,t,"percentage"),total:l(e.total,t,"total"),value:l(e.value,t,"value"),eta:l(e.eta,t,"eta"),eta_formatted:s(e.eta,t,5),duration:l(d,t,"duration"),duration_formatted:s(d,t,1)});o=o.replace(/\{(\w+)\}/g,(function(t,e){return void 0!==p[e]?p[e]:t}));const h=Math.max(0,e.maxWidth-n(o)-2),y=Math.floor(h/2);switch(t.align){case"right":o=h>0?" ".repeat(h)+o:o;break;case"center":o=y>0?" ".repeat(y)+o:o}return o}},9251:(t,e,r)=>{const n=r(4958),u=r(3603),i=r(2138),a=r(2361);t.exports=class extends a{constructor(t){super(),this.options=t,this.terminal=this.options.terminal?this.options.terminal:new u(this.options.stream),this.value=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new n(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter="function"==typeof this.options.format?this.options.format:i}render(){let t=this.value/this.total;isNaN(t)&&(t=this.options&&this.options.emptyOnZero?0:1),t=Math.min(Math.max(t,0),1);const e={progress:t,eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();const r=this.formatter(this.options,e,this.payload);(this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=r)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(r),this.terminal.clearRight(),this.lastDrawnString=r,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(t,e,r){this.value=e||0,this.total=void 0!==t&&t>=0?t:100,this.payload=r||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new n(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",t,e)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(t,e={}){"number"==typeof t&&(this.value=t,this.eta.update(Date.now(),t,this.total));const r=("object"==typeof t?t:e)||{};this.emit("update",this.total,this.value);for(const t in r)this.payload[t]=r[t];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}increment(t=1,e={}){"object"==typeof t?this.update(this.value+1,t):this.update(this.value+t,e)}getTotal(){return this.total}setTotal(t){void 0!==t&&t>=0&&(this.total=t)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}},7056:(t,e,r)=>{const n=r(3603),u=r(9251),i=r(8020),a=r(2361);t.exports=class extends a{constructor(t,e){super(),this.bars=[],this.options=i.parse(t,e),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new n(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule}create(t,e,r){if(!1===this.options.noTTYOutput&&!1===this.terminal.isTTY())return;const n=new u(this.options);return this.bars.push(n),this.isActive||(!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,n.start(t,e,r),this.emit("start"),n}remove(t){const e=this.bars.indexOf(t);return!(e<0||(this.bars.splice(e,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),0))}update(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre");for(let t=0;t<this.bars.length;t++)t>0&&this.terminal.newline(),this.bars[t].render();this.emit("redraw-post"),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find((t=>t.isActive))&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.isActive=!1,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let t=0;t<this.bars.length